@font-face {
    font-family: 'Driftwood';
    src: url('assets/fonts/driftwood.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Display-Dots-Two-Sans';
    src: url('assets/fonts/display_dots_two_sans.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

html {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;

    
    /* Performance optimizations */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

body {
    font-family: 'Arial', sans-serif;
    height: 100vh;
    width: 100vw;
    color: white;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
}

/* Start Screen Styles */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: url('assets/backgrounds/jungle.webp') center/cover no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.jungle-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;

    background: rgba(0, 0, 0, 0.05);
}

.start-content {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 2;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    backdrop-filter: blur(7px);
    border: 2px solid rgba(104, 211, 145, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.home-header {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}



.game-title {
    font-family: 'Driftwood', Arial, sans-serif;
    font-size: 2.2rem;
    color: #2D4A1F;
    text-align: center;
    text-shadow:
        0 2px 0 rgba(139, 69, 19, 0.8),
        0 -2px 0 rgba(0, 0, 0, 0.6),
        2px 2px 4px rgba(0, 0, 0, 0.7),
        0 0 10px rgba(255, 255, 255, 0.3);
    margin: 0 0 0 0;
    animation: titleGlow 3s ease-in-out infinite alternate;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background-image: url('assets/backgrounds/title_screen_bg.webp');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    padding: 50px 40px 25px 40px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 180%;
}

.snake-icon {
    width: 80px;
    height: 80px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
}



@keyframes titleGlow {
    0% {
        text-shadow:
            0 1px 0 rgba(139, 69, 19, 0.6),
            0 -1px 0 rgba(0, 0, 0, 0.4),
            1px 1px 2px rgba(0, 0, 0, 0.5),
            inset 0 2px 4px rgba(0, 0, 0, 0.3);
    }
    100% {
        text-shadow:
            0 1px 0 rgba(139, 69, 19, 0.8),
            0 -1px 0 rgba(0, 0, 0, 0.6),
            1px 1px 3px rgba(0, 0, 0, 0.7),
            inset 0 2px 6px rgba(0, 0, 0, 0.4);
    }
}

.subtitle {
    font-size: 1.1rem;
    font-weight: bold;
    color: #90EE90;
    margin-bottom: 30px;
    font-style: italic;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
    background: rgba(0, 0, 0, 0.5);
    padding: 12px 25px;
    border-radius: 20px;
    display: inline-block;
    border: 1px solid rgba(144, 238, 144, 0.3);
}

.log-container {
    position: relative;
    margin: 40px auto;
    width: fit-content;
    height: fit-content;
    display: flex;
    justify-content: center;
    align-items: center;
}

.log-image {
    transition: all 0.3s ease;
    z-index: 10;
    position: relative;
    width: 500px;
    height: auto;
    filter: drop-shadow(0 8px 25px rgba(139, 69, 19, 0.4));
}

.stone-play-button-overlay {
    position: absolute;
    top: 52%;
    left: 40%;
    transform: translate(-50%, -35%);
    width: 85px;
    height: 85px;
    z-index: 11;
    pointer-events: auto;
    cursor: pointer;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.stone-play-button-overlay:hover {
    transform: translate(-50%, -35%) scale(1.15);
    filter: brightness(1.2) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}

.settings-button-overlay {
    position: absolute;
    top: 52%;
    left: 65%;
    transform: translate(-50%, -35%);
    width: 85px;
    height: 85px;
    z-index: 11;
    pointer-events: auto;
    cursor: pointer;
    filter: brightness(1.3) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.settings-button-overlay:hover {
    transform: translate(-50%, -35%) scale(1.15);
    filter: brightness(1.5) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}



.best-score-display {
    position: relative;
    height: 100vh;
    width: 100%; 
    box-sizing: border-box;
    display: flex;
    align-items: first baseline;
    justify-content: center;
    
    font-family: 'Display-Dots-Two-Sans', Arial, sans-serif;
    font-size: 1.4rem;
    color: #ffd93d;
    text-shadow: 
        2px 2px 0 rgba(0, 0, 0, 0.8),
        0 0 10px rgba(255, 217, 61, 0.5);
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 15px;
    border-radius: 8px;
    border: 2px solid rgba(255, 217, 61, 0.3);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

/* Game Screen Styles */
.game-container {
    background: linear-gradient(135deg, #2d5016 0%, #4a7c59 50%, #1a3a0e 100%);
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    padding: 20px;
    overflow: hidden;
    box-sizing: border-box;
}

.game-header {
    margin-bottom: 20px;
}

.game-header h1 {
    font-size: 2.2rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.jungle-game-title {
    font-family: 'Driftwood', Arial, sans-serif;
    font-size: 2.2rem;
    color: #2D4A1F;
    text-align: center;
    text-shadow:
        0 2px 0 rgba(139, 69, 19, 0.8),
        0 -2px 0 rgba(0, 0, 0, 0.6),
        2px 2px 4px rgba(0, 0, 0, 0.7),
        0 0 10px rgba(255, 255, 255, 0.3);
    margin: 10px 0 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background-image: url('assets/backgrounds/title_screen_bg.webp');
    background-size: 100% 140%;
    background-repeat: no-repeat;
    background-position: center;
    padding: 50px 10px 25px 40px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.game-snake-icon {
    width: 80px;
    height: 80px;
}

.score-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    font-size: 1.2rem;
    font-weight: bold;
}

.score, .high-score {
    font-family: 'Display-Dots-Two-Sans', Arial, sans-serif;
    font-size: 1.4rem;
    color: #ffd93d;
    text-shadow: 
        2px 2px 0 rgba(0, 0, 0, 0.8),
        0 0 10px rgba(255, 217, 61, 0.5);
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 15px;
    border-radius: 8px;
    border: 2px solid rgba(255, 217, 61, 0.3);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.score:hover, .high-score:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 217, 61, 0.6);
    transform: scale(1.05);
}

.mute-btn {
    background: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: all 0.3s ease;
    color: #ffd93d;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 217, 61, 0.3);
    backdrop-filter: blur(5px);
}

.mute-btn svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
}

.mute-btn:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 217, 61, 0.6);
    filter: brightness(1.2);
}

.restart-icon-btn, .home-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: all 0.3s ease;
    color: #ffd93d;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 217, 61, 0.3);
    backdrop-filter: blur(5px);
}

.restart-icon-btn svg, .home-btn svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
}

.restart-icon-btn:hover {
    transform: scale(1.1) rotate(15deg);
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 217, 61, 0.6);
    filter: brightness(1.2);
}

.home-btn:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 217, 61, 0.6);
    filter: brightness(1.2);
}

.home-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}



.game-area {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

#gameCanvas {
    background: linear-gradient(135deg, #9ACD32 0%, #7FFF00 25%, #ADFF2F 50%, #98FB98 75%, #90EE90 100%);
    border: 4px solid #2d5016;
    border-radius: 15px;
    box-shadow: 
        inset 0 0 30px rgba(45, 80, 22, 0.3),
        0 0 20px rgba(45, 80, 22, 0.5);
    display: block;
    position: relative;
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.game-over-board {
    background: url('assets/backgrounds/game_over_board.webp') no-repeat center center;
    background-size: contain;
    width: 600px;
    height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 16% 10%;
    position: relative;
}

.game-over-title {
    font-family: 'Display-Dots-Two-Sans', serif; /* Matches your existing score label style */
    font-size: 3.2rem;
    color: #B22222;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    font-weight: bold;
    letter-spacing: 2px;
    margin-top: 15%;
    margin-bottom: 1%;
    text-align: center;
}

.scores-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: none;
    margin-bottom: 0%;
    gap: 0.5%;
}

.score-item {
    width: 35%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px 0;
}

.score-label {
    font-family: 'Driftwood', serif;
    font-size: 1.6rem;
    color: #FFD700;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-weight: bold;
    letter-spacing: 1px;
}

.score-value {
    font-family: 'Display-Dots-Two-Sans', monospace;
    font-size: 2.8rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        0 0 10px rgba(255, 215, 0, 0.5);
    letter-spacing: 2px;
}

.buttons-row {
    display: flex;
    gap: 1%;
    align-items: center;
    justify-content: center;
    margin-top: none;
    width: 100%;
    margin-bottom: 10%;
}

.stone-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    position: relative;
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.retry-stone-button {
    background: url('assets/buttons/retry_stone.webp') no-repeat center center;
    background-size: contain;
}

.home-stone-button {
    background: url('assets/buttons/home_stone.webp') no-repeat center center;
    background-size: contain;
}

.stone-button:hover {
    transform: scale(1.1);
    filter: brightness(1.2) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}

.stone-button:active {
    transform: scale(0.95);
}





.tutorial-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(2px);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.tutorial-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.tutorial-content {
    background: rgba(45, 80, 22, 0.9);
    color: white;
    padding: 30px 40px;
    border-radius: 15px;
    text-align: center;
    font-size: 1.2rem;
    line-height: 1.6;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.tutorial-content p {
    margin-bottom: 10px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.tutorial-hint {
    font-size: 0.9rem !important;
    opacity: 0.7 !important;
    font-weight: normal !important;
    font-style: italic;
    margin-top: 15px !important;
}

.hidden {
    display: none !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .game-title {
        font-size: 3rem;
    }

    .start-content {
        padding: 30px 20px;
        margin: 20px;
    }

    .log-container {
        width: 280px;
        height: 200px;
    }

    .log-btn {
        padding: 15px 30px;
        font-size: 1.2rem;
    }



    .snake-segment.head {
        top: -80px;
    }

    .snake-segment.body:nth-child(2) {
        top: -65px;
    }

    .snake-segment.body:nth-child(3) {
        top: -50px;
    }

    .snake-segment.body:nth-child(4) {
        top: -35px;
    }

    .snake-segment.tail {
        top: -20px;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 2.5rem;
    }

    .start-content {
        padding: 20px 15px;
    }

    .log-container {
        width: 250px;
        height: 180px;
    }

    .game-container {
        padding: 20px;
        margin: 10px;
    }

    .game-header h1 {
        font-size: 2rem;
    }

    .score-container {
        flex-direction: column;
        gap: 10px;
        font-size: 1rem;
    }

    #gameCanvas {
        width: 100%;
        max-width: 700px;
        height: auto;
    }

    .game-over {
        padding: 20px;
        margin: 10px;
        max-width: 300px;
    }

    .game-over h2 {
        font-size: 1.5rem;
    }


}

/* Black Screen Overlay - Shows immediately on page load */
.black-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

.black-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

.black-overlay-content {
    text-align: center;
}

.initial-loading-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.initial-loading-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffffff;
    animation: dot-pulse 1.4s ease-in-out infinite both;
}

.initial-loading-dots .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.initial-loading-dots .dot:nth-child(2) {
    animation-delay: -0.16s;
}

.initial-loading-dots .dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes dot-pulse {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Loading Screen Styles */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #2E7D32 0%, #388E3C 50%, #4CAF50 100%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease-in, visibility 0.6s ease-in;
}

.loading-screen.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.loading-container {
    text-align: center;
    color: white;
    max-width: 400px;
    padding: 2rem;
}

.loading-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.loading-title h1 {
    font-family: 'Driftwood', serif;
    font-size: 2.5rem;
    color: #FFF8DC;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}



.loading-subtitle {
    font-size: 1.2rem;
    color: #E8F5E8;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.loading-progress {
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA000);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255,215,0,0.5);
}

.loading-text {
    font-size: 1rem;
    color: #E8F5E8;
    opacity: 0.8;
}

.loading-snake {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 2rem;
}

.snake-segment {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    animation: snake-move 1.5s ease-in-out infinite;
}

.snake-segment.head {
    background: linear-gradient(45deg, #66BB6A, #4CAF50);
    animation-delay: 0s;
}

.snake-segment.body {
    background: linear-gradient(45deg, #81C784, #66BB6A);
}

.snake-segment.body:nth-child(2) {
    animation-delay: 0.2s;
}

.snake-segment.body:nth-child(3) {
    animation-delay: 0.4s;
}

.snake-segment.tail {
    background: linear-gradient(45deg, #A5D6A7, #81C784);
    animation-delay: 0.6s;
}

@keyframes snake-move {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

/* Skin Selector Panel Styles */
.skin-selector-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.skin-selector-panel.hidden {
    display: none;
}

.skin-selector-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
}

.skin-selector-content {
    background: linear-gradient(135deg, #2d4a2d, #1a3e1a);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 2px solid #4a7c4a;
}

.skin-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #4a7c4a;
}

.skin-selector-header h2 {
    font-family: 'Driftwood', serif;
    font-size: 1.8em;
    color: #f0f0f0;
    margin: 0;
}

.close-btn {
    background: #d32f2f;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 1.5em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #b71c1c;
    transform: scale(1.1);
}

.skin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.skin-option {
    background: linear-gradient(135deg, #3a5f3a, #2d4a2d);
    border: 2px solid #4a7c4a;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.skin-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: #66bb6a;
}

.skin-option.selected {
    border-color: #81c784;
    background: linear-gradient(135deg, #4a7c4a, #3a5f3a);
    box-shadow: 0 0 20px rgba(129, 199, 132, 0.5);
}

.skin-preview {
    position: relative;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.skin-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.skin-food-preview {
    position: absolute;
    bottom: -10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    padding: 5px;
}

.food-thumbnail {
    width: 30px;
    height: 30px;
    border-radius: 5px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.skin-name {
    font-family: 'Driftwood', serif;
    font-size: 1.2em;
    color: #f0f0f0;
    margin-bottom: 5px;
}

.skin-description {
    font-size: 0.9em;
    color: #bbb;
    font-style: italic;
}

.skin-selector-footer {
    display: flex;
    justify-content: center;
    padding-top: 20px;
    border-top: 2px solid #4a7c4a;
}

.apply-skin-btn {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Driftwood', serif;
}

.apply-skin-btn:hover {
    background: linear-gradient(135deg, #66bb6a, #4caf50);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.apply-skin-btn:active {
    transform: translateY(0);
}



/* Settings Modal Styles */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    background: rgba(0, 0, 0, 0.5);
}

.settings-modal.hidden {
    display: none;
}

.settings-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.settings-content {
    background: linear-gradient(135deg, #2d5016 0%, #4a7c59 50%, #1a3a0e 100%);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    cursor: default;
    border: 3px solid rgba(255, 217, 61, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid rgba(255, 217, 61, 0.3);
    padding-bottom: 15px;
}

.settings-header h2 {
    color: #ffd93d;
    font-family: 'Driftwood', Arial, sans-serif;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin: 0;
}

.close-settings-btn {
    background: none;
    border: none;
    color: #ffd93d;
    font-size: 2rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-settings-btn:hover {
    background: rgba(255, 217, 61, 0.2);
    transform: scale(1.1);
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h3 {
    color: #90EE90;
    font-family: 'Driftwood', Arial, sans-serif;
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 217, 61, 0.2);
}

.setting-item label {
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
}

.toggle-button {
    background: rgba(255, 217, 61, 0.2);
    border: 2px solid rgba(255, 217, 61, 0.3);
    color: #ffd93d;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0.0, 0.2, 1);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-button svg {
    width: 24px;
    height: 24px;
}

.toggle-button:hover {
    background: rgba(255, 217, 61, 0.3);
    transform: scale(1.1);
}

.toggle-button.muted {
    background: rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.3);
    color: #ff6b6b;
}

.download-button {
    background: rgba(74, 144, 226, 0.2);
    border: 2px solid rgba(74, 144, 226, 0.3);
    color: #4a90e2;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0.0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: bold;
}

.download-button svg {
    width: 20px;
    height: 20px;
}

.download-button:hover {
    background: rgba(74, 144, 226, 0.3);
    transform: scale(1.05);
    border-color: rgba(74, 144, 226, 0.5);
}

.download-button:active {
    transform: scale(0.95);
}

.reset-button {
    background: rgba(255, 82, 82, 0.2);
    border: 2px solid rgba(255, 82, 82, 0.3);
    color: #ff5252;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0.0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: bold;
}

.reset-button svg {
    width: 20px;
    height: 20px;
}

.reset-button:hover {
    background: rgba(255, 82, 82, 0.3);
    transform: scale(1.05);
    border-color: rgba(255, 82, 82, 0.5);
}

.reset-button:active {
    transform: scale(0.95);
}

/* Volume Control Styles */
.volume-control {
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 217, 61, 0.2);
}

.volume-control label {
    display: block;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.volume-slider {
    flex: 1;
    height: 8px;
    background: linear-gradient(90deg, #2d4a2d 0%, #1a3e1a 100%);
    border: 2px solid rgba(139, 195, 74, 0.3);
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 48px;
    height: 48px;
    background: var(--thumb-image) no-repeat center center;
    background-size: contain;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.volume-slider::-moz-range-thumb {
    width: 48px;
    height: 48px;
    background: var(--thumb-image) no-repeat center center;
    background-size: contain;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
}

.volume-slider::-moz-range-track {
    height: 8px;
    background: linear-gradient(90deg, #2d4a2d 0%, #1a3e1a 100%);
    border: 2px solid rgba(139, 195, 74, 0.3);
    border-radius: 6px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.volume-value {
    color: #8bc34a;
    font-weight: bold;
    font-size: 1rem;
    min-width: 45px;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Custom jungle-themed slider styling */
.volume-slider {
    position: relative;
}

/* Audio Toggles */
.audio-toggles {
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 217, 61, 0.2);
}

.toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.toggle-item:last-child {
    margin-bottom: 0;
}

.toggle-item label {
    color: white;
    font-size: 1rem;
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 13px;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0.0, 0.2, 1);
    outline: none;
}

.toggle-switch:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.02);
}

.toggle-switch:active {
    transform: scale(0.98);
}

.toggle-switch.active {
    background: rgba(76, 175, 80, 0.8);
}

.toggle-switch.active:hover {
    background: rgba(76, 175, 80, 0.9);
    transform: scale(1.02);
}

.toggle-indicator {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.15s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-switch:hover .toggle-indicator {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.toggle-switch:active .toggle-indicator {
    transform: scale(0.95);
}

.toggle-switch.active .toggle-indicator {
    transform: translateX(24px);
}

.toggle-switch.active:hover .toggle-indicator {
    box-shadow: 0 3px 8px rgba(76, 175, 80, 0.5);
}

.toggle-switch.active:active .toggle-indicator {
    transform: translateX(24px) scale(0.95);
}

.skin-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.skin-selection-grid .skin-option {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 217, 61, 0.2);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.skin-selection-grid .skin-option:hover {
    border-color: rgba(255, 217, 61, 0.5);
    transform: translateY(-2px);
}

.skin-selection-grid .skin-option.selected {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.2);
}

.skin-selection-grid .skin-preview {
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 217, 61, 0.3);
}

.skin-selection-grid .skin-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.skin-selection-grid .skin-name {
    color: white;
    font-size: 0.9rem;
    font-weight: bold;
}

/* Food animation styles */
@keyframes foodFloat {
    0%, 100% {
        transform: translateY(0px) scale(1);
        opacity: 0.9;
    }
    50% {
        transform: translateY(-3px) scale(1.05);
        opacity: 1;
    }
}

/* Offline Support Styles */
.offline-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    color: white;
    padding: 10px 15px;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 0.9rem;
    font-weight: bold;
    z-index: 10000;
    animation: slideInFromRight 0.5s ease-out;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.offline-indicator.hidden {
    display: none;
}

.offline-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.offline-icon {
    font-size: 1.1rem;
}

.offline-text {
    font-family: 'Driftwood', serif;
}

/* Update Notification Styles */
.update-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    font-size: 0.95rem;
    z-index: 10000;
    animation: slideInFromBottom 0.5s ease-out;
    border: 2px solid rgba(255, 255, 255, 0.2);
    max-width: 300px;
}

.update-notification.hidden {
    display: none;
}

.update-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.update-icon {
    font-size: 1.2rem;
}

.update-text {
    flex: 1;
    font-family: 'Display Dots Two Sans', sans-serif;
    font-weight: bold;
}

.update-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #4CAF50;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.update-btn:hover {
    background: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dismiss-btn {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: all 0.3s ease;
}

.dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Animations */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Cache Status Indicator (Optional) */
.cache-status {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffd93d;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    z-index: 9999;
    border: 1px solid rgba(255, 217, 61, 0.3);
    font-family: 'Display Dots Two Sans', sans-serif;
}

.cache-status.hidden {
    display: none;
}

/* Mobile responsive adjustments for offline indicators */
@media (max-width: 768px) {
    .offline-indicator {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .update-notification {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        padding: 12px;
    }
    
    .cache-status {
        bottom: 10px;
        left: 10px;
        font-size: 0.7rem;
        padding: 6px 10px;
    }
}

/* Developer Panel Styles */
.dev-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #ffd93d;
    border-radius: 12px;
    padding: 0;
    z-index: 99999;
    font-family: 'Display Dots Two Sans', sans-serif;
    color: white;
    min-width: 400px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.dev-panel.hidden {
    display: none;
}

.dev-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(45deg, #ffd93d, #ffb300);
    color: #000;
    border-radius: 10px 10px 0 0;
    margin: 0;
}

.dev-panel-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: bold;
}

.dev-panel-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: #000;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.dev-panel-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.dev-panel-content {
    padding: 20px;
}

.dev-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 217, 61, 0.2);
}

.dev-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.dev-section h4 {
    margin: 0 0 10px 0;
    color: #ffd93d;
    font-size: 1rem;
    font-weight: bold;
}

.dev-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dev-btn {
    background: rgba(255, 217, 61, 0.1);
    border: 1px solid rgba(255, 217, 61, 0.3);
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: 'Display Dots Two Sans', sans-serif;
}

.dev-btn:hover {
    background: rgba(255, 217, 61, 0.2);
    border-color: rgba(255, 217, 61, 0.5);
    transform: translateY(-1px);
}

.dev-btn.primary {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.5);
}

.dev-btn.primary:hover {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.7);
}

.dev-btn.warning {
    background: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.5);
}

.dev-btn.warning:hover {
    background: rgba(244, 67, 54, 0.3);
    border-color: rgba(244, 67, 54, 0.7);
}

.dev-btn.info {
    background: rgba(33, 150, 243, 0.2);
    border-color: rgba(33, 150, 243, 0.5);
}

.dev-btn.info:hover {
    background: rgba(33, 150, 243, 0.3);
    border-color: rgba(33, 150, 243, 0.7);
}

.debug-info {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.debug-info p {
    margin: 5px 0;
}

.debug-info strong {
    color: #ffd93d;
}

/* Mobile responsive for dev panel */
@media (max-width: 768px) {
    .dev-panel {
        min-width: 300px;
        top: 20px;
        left: 10px;
        right: 10px;
        transform: none;
        position: fixed;
        width: auto;
    }
    
    .dev-buttons {
        flex-direction: column;
    }
    
    .dev-btn {
        width: 100%;
        text-align: center;
    }
}
