    body { margin: 0; }
    canvas { display: block; }
    #fishCaught {
        display: none;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 20px;
        border-radius: 10px;
        text-align: center;
        font-family: Arial, sans-serif;
    }
    #fishCaught img {
        width: 150px;
        height: auto;
        margin-bottom: 10px;
    }
    #fishCaught p {
        margin: 10px 0;
        font-size: 18px;
    }
    #collection {
        display: none;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(0, 0, 0, 0.9);
        color: white;
        padding: 30px;
        border-radius: 15px;
        font-family: Arial, sans-serif;
        width: 80%;
        max-height: 80vh;
        overflow-y: auto;
    }
    #fishShop {
        display: none;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(0, 0, 0, 0.9);
        color: white;
        padding: 30px;
        border-radius: 15px;
        font-family: Arial, sans-serif;
        width: 80%;
        max-height: 80vh;
        overflow-y: auto;
    }
    #fishShop h2 {
        text-align: center;
        color: #ffd700;
        margin-bottom: 20px;
        font-size: 24px;
    }
    .shop-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 1px solid #666;
    }
    .shop-money {
        color: #ffd700;
        font-size: 22px;
        font-weight: bold;
    }
    .shop-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
        margin-bottom: 20px;
    }
    .shop-item {
        background: rgba(255, 255, 255, 0.1);
        padding: 15px;
        border-radius: 10px;
        text-align: center;
        position: relative;
    }
    .shop-item:hover {
        background: rgba(255, 255, 255, 0.2);
        cursor: pointer;
    }
    .shop-item img {
        width: 100px;
        height: auto;
        margin-bottom: 10px;
    }
    .shop-item h3 {
        margin: 5px 0;
        color: #ffffff;
    }
    .shop-item p {
        margin: 5px 0;
        font-size: 14px;
    }
    .shop-item .price {
        color: #ffd700;
        font-weight: bold;
        font-size: 16px;
    }
    .shop-item .count {
        position: absolute;
        top: 5px;
        right: 5px;
        background: rgba(0, 0, 0, 0.7);
        color: white;
        border-radius: 50%;
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
    }
    .shop-controls {
        display: flex;
        justify-content: space-between;
        margin-top: 20px;
    }
    .shop-button {
        background: #4a6d8c;
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 5px;
        cursor: pointer;
        font-size: 16px;
    }
    .shop-button:hover {
        background: #5d8baf;
    }
    #moneyDisplay {
        position: fixed;
        top: 20px;
        right: 20px;
        background: rgba(0, 0, 0, 0.7);
        color: #ffd700;
        padding: 10px 15px;
        border-radius: 10px;
        font-family: Arial, sans-serif;
        font-weight: bold;
        z-index: 1000;
    }
    .shop-notification {
        color: #00ff00;
        font-size: 16px;
        text-align: center;
        margin-top: 15px;
        min-height: 20px;
    }
    #collection h2 {
        text-align: center;
        color: #00ffff;
        margin-bottom: 20px;
        font-size: 24px;
    }
    .fish-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
        margin-bottom: 20px;
        justify-content: flex-start;
        padding: 10px 0;
    }
    
    .fish-card {
        background: rgba(255, 255, 255, 0.1);
        padding: 15px;
        border-radius: 10px;
        text-align: center;
        width: calc(25% - 20px); /* 4 cards per row with gap */
        min-width: 180px;
        margin-bottom: 15px;
    }

    @media (max-width: 992px) {
        .fish-card {
            width: calc(33.33% - 20px); /* 3 cards per row on medium screens */
        }
    }

    @media (max-width: 768px) {
        .fish-card {
            width: calc(50% - 20px); /* 2 cards per row on small screens */
        }
    }

    @media (max-width: 480px) {
        .fish-card {
            width: 100%; /* 1 card per row on very small screens */
        }
    }

    /* Add custom scrollbar styling */
    .fish-grid::-webkit-scrollbar {
        height: 8px;
    }
    
    .fish-grid::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 4px;
    }
    
    .fish-grid::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 4px;
    }
    
    .fish-grid::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.4);
    }

    @media (max-width: 768px) {
        .fish-grid {
            gap: 10px;
        }
        
        .fish-card {
            min-width: 140px;
            padding: 10px;
        }
    }

    @media (max-width: 480px) {
        .fish-card {
            min-width: 120px;
        }
    }
    .fish-card img {
        width: 150px;
        height: auto;
        margin-bottom: 10px;
    }
    .fish-card h3 {
        margin: 5px 0;
        color: #00ffff;
    }
    .fish-card p {
        margin: 5px 0;
        font-size: 14px;
    }
    .record {
        background: rgba(255, 215, 0, 0.1);
        padding: 15px;
        border-radius: 10px;
        margin-bottom: 20px;
    }
    .record h3 {
        color: gold;
        margin: 5px 0;
    }
    .close-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        background: none;
        border: none;
        color: white;
        font-size: 24px;
        cursor: pointer;
    }
    #instructions {
        position: fixed;
        top: 20px;
        left: 20px;
        background: rgba(0, 0, 0, 0.7);
        color: white;
        padding: 15px;
        border-radius: 10px;
        font-family: Arial, sans-serif;
        z-index: 1000;
    }
    #instructions h3 {
        margin: 0 0 10px 0;
        color: #00ffff;
    }
    #instructions p {
        margin: 5px 0;
        font-size: 14px;
    }
    #instructions .key {
        display: inline-block;
        background: rgba(255, 255, 255, 0.2);
        padding: 2px 6px;
        border-radius: 4px;
        margin-right: 5px;
        font-weight: bold;
    }
    #mobileControls {
        display: none;
        position: fixed;
        bottom: 20px;
        left: 0;
        right: 0;
        z-index: 1000;
    }
    .joystickArea {
        position: fixed;
        bottom: 30px;
        width: 100px;
        height: 100px;
        background: rgba(255, 255, 255, 0.2);
        border: 2px solid rgba(255, 255, 255, 0.4);
        border-radius: 50px;
        touch-action: none;
        -webkit-tap-highlight-color: transparent;
    }
    #turnJoystickArea {
        left: 20px;
    }
    #moveJoystickArea {
        right: 20px;
    }
    .joystick {
        position: absolute;
        width: 46px;
        height: 46px;
        background: rgba(255, 255, 255, 0.6);
        border: 2px solid rgba(255, 255, 255, 0.8);
        border-radius: 23px;
        top: 50%;
        left: 50%;
        touch-action: none;
        will-change: transform;
        transform: translate(-50%, -50%);
        -webkit-tap-highlight-color: transparent;
    }
    .mobileButton {
        position: relative;
        width: 60px;
        height: 60px;
        background: rgba(255, 255, 255, 0.4);
        border: 2px solid rgba(255, 255, 255, 0.6);
        border-radius: 30px;
        color: white;
        font-size: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: none;
        transition: transform 0.15s ease-out, background-color 0.15s ease-out;
        -webkit-tap-highlight-color: transparent;
        margin: 0;
        padding: 0;
    }
    /* Remove individual button positioning */
    #fishButton, #collectionButton {
        left: auto;
    }
    .mobileButton:active, .mobileButton.mobile-active {
        transform: scale(0.9);
        background: rgba(255, 255, 255, 0.6);
    }
    @media (max-width: 1024px), (pointer: coarse) {
        #mobileControls {
            display: block;
            touch-action: none;
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            user-select: none;
        }
        #instructions {
            display: none;
        }
        #fishCaught {
            bottom: 150px;
            top: auto;
            transform: translate(-50%, 0);
        }
    }
    @media (max-width: 768px) {
        #collection {
            padding: 15px;
            width: 90%;
            max-height: 85vh;
        }
        #collection h2 {
            font-size: 20px;
            margin-bottom: 15px;
        }
        .fish-grid {
            grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
            gap: 10px;
            margin-bottom: 15px;
        }
        .fish-card {
            padding: 10px;
        }
        .fish-card img {
            width: 100px;
            height: auto;
        }
        .fish-card h3 {
            font-size: 14px;
            margin: 3px 0;
        }
        .fish-card p {
            font-size: 12px;
            margin: 3px 0;
        }
        .record {
            padding: 10px;
            margin-bottom: 15px;
        }
        .record h3 {
            font-size: 16px;
        }
        .record p {
            font-size: 12px;
            margin: 3px 0;
        }
        .record img {
            width: 100px;
            height: auto;
        }
        .close-btn {
            font-size: 20px;
            top: 5px;
            right: 5px;
        }
        #fishShop {
            padding: 15px;
            width: 90%;
        }
        .shop-grid {
            grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
            gap: 10px;
        }
        .shop-item img {
            width: 80px;
        }
        .shop-button {
            padding: 8px 15px;
            font-size: 14px;
        }
    }
    @media (max-width: 480px) {
        #collection {
            padding: 10px;
            width: 95%;
        }
        .fish-grid {
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 8px;
        }
        .fish-card img {
            width: 80px;
            height: auto;
        }
        .fish-card h3 {
            font-size: 13px;
        }
        .fish-card p {
            font-size: 11px;
        }
    }
    
    /* Add styles for the upgrade shop */
    #upgradeShop {
        display: none;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(0, 0, 0, 0.9);
        color: white;
        padding: 30px;
        border-radius: 15px;
        font-family: Arial, sans-serif;
        width: 80%;
        max-height: 80vh;
        overflow-y: auto;
    }
    #upgradeShop h2 {
        text-align: center;
        color: #ffd700;
        margin-bottom: 20px;
        font-size: 24px;
    }
    .upgrade-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
        margin-bottom: 20px;
    }
    .upgrade-item {
        background: rgba(255, 255, 255, 0.1);
        padding: 20px;
        border-radius: 10px;
        text-align: center;
    }
    .upgrade-item h3 {
        color: #00ffff;
        margin: 10px 0;
    }
    .upgrade-item p {
        margin: 10px 0;
        font-size: 14px;
    }
    .upgrade-item .price {
        color: #ffd700;
        font-weight: bold;
        font-size: 18px;
        margin: 15px 0;
    }
    .upgrade-item button {
        background: #4a6d8c;
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 5px;
        cursor: pointer;
        font-size: 16px;
        width: 100%;
    }
    .upgrade-item button:hover {
        background: #5d8baf;
    }
    .upgrade-item button:disabled {
        background: #2c4152;
        cursor: not-allowed;
    }
    .upgrade-item.owned {
        background: rgba(0, 255, 0, 0.1);
    }
    .upgrade-item.owned button {
        background: #2c4152;
        cursor: not-allowed;
    }
    /* Add styles for the tabbed shop interface */
    .shop-tabs {
        display: flex;
        justify-content: center;
        margin-bottom: 20px;
        border-bottom: 2px solid #4a6d8c;
    }
    .shop-tab {
        background: none;
        border: none;
        color: #ffffff;
        padding: 10px 20px;
        margin: 0 10px;
        font-size: 18px;
        cursor: pointer;
        opacity: 0.7;
        transition: all 0.3s ease;
    }
    .shop-tab.active {
        opacity: 1;
        border-bottom: 3px solid #00ffff;
        color: #00ffff;
    }
    .shop-tab:hover {
        opacity: 1;
    }
    .shop-content {
        display: none;
    }
    .shop-content.active {
        display: block;
    }
    .mobile-button-group {
        position: fixed;
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 20px;
        z-index: 1000;
        width: auto;
        padding: 0 10px;
        pointer-events: auto;
    }
    /* Add styles for collection tabs */
    .collection-tabs {
        display: flex;
        justify-content: center;
        margin-bottom: 20px;
        border-bottom: 2px solid #4a6d8c;
    }
    .collection-tab {
        background: none;
        border: none;
        color: #ffffff;
        padding: 10px 20px;
        margin: 0 10px;
        font-size: 18px;
        cursor: pointer;
        opacity: 0.7;
        transition: all 0.3s ease;
    }
    .collection-tab.active {
        opacity: 1;
        border-bottom: 3px solid #00ffff;
        color: #00ffff;
    }
    .collection-tab:hover {
        opacity: 1;
    }
    .collection-content {
        display: none;
    }
    .collection-content.active {
        display: block;
    }
    .inventory-item {
        background: rgba(255, 255, 255, 0.1);
        padding: 12px;
        border-radius: 8px;
        margin-bottom: 10px;
        width: calc(33.33% - 10px);
        display: inline-block;
        margin-right: 10px;
        vertical-align: top;
        box-sizing: border-box;
    }
    .inventory-item h3 {
        color: #00ffff;
        margin: 3px 0;
        font-size: 16px;
    }
    .inventory-item p {
        margin: 3px 0;
        color: #ffffff;
        font-size: 13px;
    }
    .inventory-item.owned {
        background: rgba(0, 255, 0, 0.1);
        border: 1px solid rgba(0, 255, 0, 0.3);
    }
    .inventory-section {
        margin-bottom: 30px;
    }
    .inventory-section h2 {
        color: #00ffff;
        margin-bottom: 15px;
        font-size: 20px;
        text-align: center;
    }
    .fish-inventory-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    .fish-inventory-item {
        background: rgba(255, 255, 255, 0.1);
        padding: 15px;
        border-radius: 10px;
        text-align: center;
    }
    .fish-inventory-item img {
        width: 100px;
        height: auto;
        margin-bottom: 10px;
    }
    .fish-inventory-item h3 {
        color: #00ffff;
        margin: 5px 0;
    }
    .fish-inventory-item p {
        margin: 5px 0;
        color: #ffffff;
        font-size: 14px;
    }

    /* Add after other styles */
    #questMenu {
        display: none;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(0, 0, 0, 0.9);
        padding: 20px;
        border-radius: 10px;
        border: 2px solid #4a90e2;
        color: white;
        z-index: 1000;
        width: 80%;
        max-width: 600px;
        max-height: 80vh;
        overflow-y: auto;
    }

    #questMenu h2 {
        color: #4a90e2;
        text-align: center;
        margin-bottom: 20px;
        font-size: 24px;
    }

    .quest-content {
        padding: 15px;
    }

    .close-quest {
        position: absolute;
        top: 10px;
        right: 10px;
        background: none;
        border: none;
        color: white;
        font-size: 24px;
        cursor: pointer;
    }

    .close-quest:hover {
        color: #4a90e2;
    }

    #questPrompt {
        display: none;
        position: fixed;
        bottom: 20%;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.7);
        color: white;
        padding: 10px 20px;
        border-radius: 5px;
        z-index: 1000;
    }
    
    /* Add after other styles */
    .quest-item {
        background: rgba(74, 144, 226, 0.1);
        border: 1px solid #4a90e2;
        border-radius: 8px;
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .quest-item h3 {
        color: #4a90e2;
        margin-top: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        padding-bottom: 10px;
    }
    
    .quest-description {
        font-style: italic;
        color: #ccc;
        line-height: 1.5;
        margin-bottom: 15px;
    }
    
    .quest-requirements h4, .quest-reward h4 {
        color: #ffcc00;
        margin-bottom: 5px;
    }
    
    .quest-requirements ul {
        list-style-type: none;
        padding-left: 10px;
    }
    
    .quest-requirements li {
        margin-bottom: 5px;
        display: flex;
        align-items: center;
    }
    
    .quest-requirements li.completed {
        color: #4caf50;
    }
    
    .quest-requirements li.missing {
        color: #ff6b6b;
    }
    
    .quest-button {
        background: #4a90e2;
        color: white;
        border: none;
        padding: 8px 15px;
        border-radius: 4px;
        cursor: pointer;
        margin-top: 10px;
        font-weight: bold;
        transition: background 0.3s;
    }
    
    .quest-button:hover {
        background: #3a7bc8;
    }
    
    .quest-button:disabled {
        background: #555;
        cursor: not-allowed;
    }
    
    #questPrompt {
        font-family: 'Courier New', monospace;
        font-style: italic;
    }