:root {
    --primary-bg: rgba(0, 0, 0, 0.7);
    --accent-color: #FF5F5F;
    --accent-hover: #FF3F3F;
    --correct-bg: rgba(0, 255, 0, 0.2);
    --incorrect-bg: rgba(255, 0, 0, 0.2);
    --text-color: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    background: linear-gradient(-45deg, #667eea, #6b7973, #50282894, #5a371771);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    color: var(--text-color);
    overflow-x: hidden;
}


body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("../../data/BG.jpg") no-repeat center center/cover;
    opacity: 0.9;
    z-index: -1;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(0.5rem, 2vw, 0.75rem) clamp(1rem, 3vw, 2rem);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header h4 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 800;
    background: linear-gradient(135deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.social-icons {
    display: flex;
    gap: clamp(0.3rem, 1vw, 0.5rem);
}

.social-link,
.stats-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(32px, 5vw, 36px);
    height: clamp(32px, 5vw, 36px);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    text-decoration: none;
    font-size: clamp(1rem, 2vw, 1.1rem);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-link:hover,
.stats-btn:hover {
    transform: translateY(-2px) scale(1.05);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 3vw, 2rem);
    gap: 1rem;
}

footer {
    text-align: center;
    padding: clamp(0.3rem, 1vw, 0.5rem);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    font-size: clamp(0.65rem, 1.5vw, 0.75rem);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer p {
    margin: 5px;
    color: #ffffff;
}

.VersionNumber {
    margin-left: 0.5rem;
    opacity: 0.7;
}

#game-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: clamp(0.75rem, 2vw, 1.25rem);
    max-width: 700px;
    width: 100%;
    text-align: center;
    position: relative;
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

#stage-indicator {
    font-size: clamp(1.3rem, 3vw, 2rem);
    font-weight: 800;
    margin-bottom: clamp(0.75rem, 2vw, 1rem);
    color: #ffffff;
    white-space: nowrap;
    background: linear-gradient(135deg, #ffffff, #b1b1b1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#media-player {
    margin: clamp(0.75rem, 2vw, 1.25rem) 0;
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 120px;
    transition: height 0.2s ease;
}

#media-player audio,
#media-player video {
    width: 100%;
    max-width: 700px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

#loading-indicator {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: var(--text-color);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Modern Custom Audio Player */
.custom-audio {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 16px;
    border-radius: 12px;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.custom-audio:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.custom-play-pause {
    background: linear-gradient(135deg, var(--accent-color), #ff7979);
    color: white;
    border: none;
    padding: 3px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1em;
    width: 44px;
    height: 44px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 95, 95, 0.3);
}

.custom-play-pause:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 95, 95, 0.4);
}

.custom-progress {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    cursor: pointer;
    outline: none;
}

.custom-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    background: linear-gradient(135deg, #ffffff, #3f3f3f);
    height: 16px;
    width: 16px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(255, 221, 0, 0.3);
    transition: transform 0.2s ease;
}

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

.custom-time {
    font-size: 0.9em;
    color: #ffffff;
    min-width: 80px;
    font-weight: 700;
}

#volume-container {
    width: 250px;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 12px;
    z-index: -.04;
}

#global-volume {
    width: 100px;
}

#input-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: clamp(0.5rem, 2vw, 1rem);
    margin: clamp(0.75rem, 2vw, 1rem) 0;
    position: relative;
    width: 100%;
    z-index: 20;
}

#guess-input {
    padding: clamp(0.6rem, 2vw, 0.8rem);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: var(--text-color);
    border-radius: 12px;
    flex: 1;
    min-width: 250px;
    max-width: 500px;
    transition: all 0.3s ease;
}

#guess-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#guess-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(255, 95, 95, 0.3);
}

#submit-btn {
    padding: clamp(0.6rem, 2vw, 0.8rem) clamp(1.2rem, 3vw, 1.6rem);
    background: linear-gradient(135deg, var(--accent-color), #ff7979);
    color: var(--text-color);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(255, 95, 95, 0.4);
    white-space: nowrap;
    animation: buttonPulse 2s ease-in-out infinite;
}

#submit-btn:hover {
    background: linear-gradient(135deg, var(--accent-hover), #ff5555);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 24px rgba(255, 95, 95, 0.6);
}

@keyframes buttonPulse {

    0%,
    100% {
        box-shadow: 0 4px 16px rgba(255, 95, 95, 0.4);
    }

    50% {
        box-shadow: 0 4px 24px rgba(255, 95, 95, 0.6);
    }
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: calc(100% - clamp(100px, 20vw, 150px));
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    margin-top: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
    z-index: 50;
    display: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

@media (max-width: 600px) {
    .dropdown {
        left: 0;
        width: 100%;
    }
}

.dropdown.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.dropdown ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dropdown li {
    padding: clamp(0.6rem, 1.5vw, 0.8rem);
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.dropdown li:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

.dropdown li:last-child {
    border-bottom: none;
}

#previous-guesses {
    margin-top: 1rem;
    text-align: left;
    width: 100%;
}

.guess-item,
.skip-item {
    margin: 0.5rem 0;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.guess-item:hover,
.skip-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

.skip-item {
    color: #FFD700;
}

#score {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    margin-top: 1rem;
    color: #ffffff;
    font-weight: 700;
}

#reveal {
    display: none;
    text-align: center;
    margin-top: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    transition: opacity 0.3s ease;
    animation: scaleIn 0.5s ease;
}

#reveal .movie-poster {
    max-width: 300px;
    max-height: 450px;
    width: auto;
    height: auto;
    margin: 1rem auto;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

#reveal strong {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: var(--text-color);
    display: block;
    margin: 1rem 0;
    font-weight: 800;
}

#share-btn,
#calendar-btn,
#play-start-btn {
    padding: clamp(0.6rem, 2vw, 0.8rem) clamp(1.2rem, 3vw, 1.6rem);
    background: linear-gradient(135deg, var(--accent-color), #ff7979);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(255, 95, 95, 0.4);
    margin: 0.5rem auto;
    display: block;
    width: fit-content;
}

#share-btn:hover,
#calendar-btn:hover,
#play-start-btn:hover {
    background: linear-gradient(135deg, var(--accent-hover), #ff5555);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 24px rgba(255, 95, 95, 0.6);
}

#image-gallery {
    position: relative;
    text-align: center;
    width: 100%;
}

#image-gallery img {
    width: 100%;
    max-width: 700px;
    height: auto;
    border-radius: 12px;
    margin-bottom: 10px;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

#max-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    padding: 5px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
}

#max-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.gallery-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

#image-gallery button {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

#image-gallery button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

#frame-counter {
    margin-top: 10px;
    font-size: 1em;
    color: #ffffff;
    font-weight: 600;
}

/* Image Modal */
#image-modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s;
}

#image-modal img {
    margin: auto;
    display: block;
    width: 90%;
    max-width: 1200px;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.modal-prev,
.modal-next {
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.modal-prev:hover,
.modal-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.modal-counter {
    text-align: center;
    margin-top: 5px;
    color: #fff;
    font-weight: 600;
}

#close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#close-modal:hover {
    transform: scale(1.1);
}

#date {
    font-size: clamp(0.9rem, 2vw, 1rem);
    color: #ffffff;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: clamp(0.75rem, 2vw, 1rem);
    border-radius: 16px;
    font-weight: 700;
}

/* Start Screen */
#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(102, 126, 234, 0.3), rgba(168, 53, 53, 0.3));
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.start-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(30px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: clamp(2rem, 5vw, 3rem);
    max-width: 650px;
    width: 90%;
    text-align: center;
    color: #fff;
    animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 80px rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
}

.start-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotateGlow 10s linear infinite;
    pointer-events: none;
}

@keyframes rotateGlow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.start-content h2 {
    font-size: clamp(2rem, 5vw, 2.8rem);
    margin-bottom: 1.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #FFD700, #FFA500, #FF5F5F);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
    position: relative;
    z-index: 1;
}

.start-content p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    margin: 1.5rem 0;
    opacity: 0.95;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.start-content ul {
    list-style: none;
    padding: 0;
    margin: 2rem auto;
    text-align: left;
    max-width: 500px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

.start-content li {
    margin: 1rem 0;
    padding-left: 2rem;
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    position: relative;
    font-weight: 600;
    line-height: 1.6;
    transition: all 0.3s ease;
}

.start-content li::before {
    content: '🎬';
    position: absolute;
    left: 0;
    font-size: 1.3em;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.start-content li:hover {
    transform: translateX(5px);
    color: #FFD700;
}

#start-loading {
    color: var(--accent-color);
    font-weight: 700;
    margin: 1rem 0;
    position: relative;
    z-index: 1;
}

#play-start-btn {
    animation: buttonPulse 2s ease-in-out infinite;
    margin-top: 1.5rem;
}

#calendar-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.calendar-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    max-width: 600px;
    width: 90%;
    text-align: center;
    color: #fff;
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.calendar-content h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#calendar-dates {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
    margin: 1rem 0;
}

.calendar-day {
    padding: clamp(0.5rem, 1.5vw, 0.75rem);
    border-radius: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    font-weight: 600;
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.calendar-day.inactive {
    background: rgba(255, 255, 255, 0.05);
    color: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

.calendar-day.active {
    background: linear-gradient(135deg, var(--accent-color), #ff7979);
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(255, 95, 95, 0.4);
}

.calendar-day.current {
    background: #4CAF50;
    font-weight: 700;
    border-radius: 50%;
    color: white;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.calendar-nav button {
    background: linear-gradient(135deg, var(--accent-color), #ff7979);
    color: white;
    border: none;
    padding: clamp(0.5rem, 1.5vw, 0.75rem) clamp(0.75rem, 2vw, 1rem);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 95, 95, 0.3);
}

.calendar-nav button:hover {
    background: linear-gradient(135deg, var(--accent-hover), #ff5555);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 95, 95, 0.5);
}

#month-year {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 700;
}

#close-calendar-btn {
    margin-top: 1.5rem;
    padding: clamp(0.6rem, 2vw, 0.8rem) clamp(1.2rem, 3vw, 1.6rem);
    background: linear-gradient(135deg, var(--accent-color), #ff7979);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(255, 95, 95, 0.4);
}

#close-calendar-btn:hover {
    background: linear-gradient(135deg, var(--accent-hover), #ff5555);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 95, 95, 0.6);
}

/* Stats Screen & Achievements */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.overlay.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.overlay-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border-radius: 20px;
    max-width: min(90%, 900px);
    max-height: 85vh;
    overflow-y: auto;
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    position: relative;
}

.overlay-content h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 1.5rem;
    font-weight: 800;
    text-align: center;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 600;
}

.achievements-section {
    margin-top: 2rem;
}

.achievements-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
    text-align: center;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.achievement {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1rem 0.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.achievement.unlocked {
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.5);
}

.achievement.locked {
    opacity: 0.5;
    filter: grayscale(1);
}

.achievement:hover {
    transform: translateY(-2px);
}

.achievement-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.achievement-name {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.achievement-desc {
    font-size: 0.7rem;
    opacity: 0.7;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.celebration-message {
    animation: pulse 1s infinite;
    font-weight: 800;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .header-right {
        width: 100%;
        justify-content: center;
    }

    #game-container {
        padding: clamp(0.75rem, 2vw, 1.5rem);
    }
}

/* Achievement styles */
.achievement {
    display: flex;
    align-items: center;
    padding: 12px;
    margin: 8px 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.achievement.unlocked {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.5);
}

.achievement.locked {
    opacity: 0.5;
    filter: grayscale(100%);
}

.achievement-icon {
    font-size: 32px;
    margin-right: 12px;
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.achievement-desc {
    font-size: 12px;
    opacity: 0.8;
}

.achievements-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 16px;
}

/* Endless Mode Prompt Styles */
.endless-content {
    max-width: 500px;
    text-align: center;
    padding: 2rem;
}

.endless-content h2 {
    margin: 0 0 1rem 0;
    font-size: 28px;
    color: #fff;
}

.endless-message {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.endless-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.endless-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.feature-icon {
    font-size: 32px;
}

.feature-text {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.9;
}

.endless-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.endless-btn {
    flex: 1;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: inline-block;
    font-family: inherit;
}

.endless-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.endless-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.endless-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.endless-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.endless-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 13px;
    opacity: 0.7;
    cursor: pointer;
    user-select: none;
}

.endless-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

@media (max-width: 600px) {
    .endless-features {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .endless-buttons {
        flex-direction: column;
    }

    .endless-content {
        padding: 1.5rem;
    }
}

/* Settings Button */
.settings-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(32px, 5vw, 36px);
    height: clamp(32px, 5vw, 36px);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    font-size: clamp(1rem, 2vw, 1.1rem);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}

.settings-btn:hover {
    transform: translateY(-2px) scale(1.05);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* Settings Modal */
.settings-content {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
}

.settings-content h2 {
    margin: 0 0 1.5rem 0;
    font-size: 28px;
    text-align: center;
}

.settings-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.setting-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-icon {
    font-size: 24px;
}

.setting-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    position: relative;
}

.setting-item:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-item label {
    font-size: 15px;
    font-weight: 500;
    flex: 0 0 auto;
}

.setting-item.coming-soon {
    opacity: 0.5;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    max-width: 300px;
}

.volume-icon {
    font-size: 18px;
}

.volume-control input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.volume-control input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.volume-value {
    font-size: 14px;
    min-width: 40px;
    text-align: right;
    font-weight: 600;
    color: #667eea;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 26px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

input:checked+.toggle-slider {
    background-color: #667eea;
}

input:checked+.toggle-slider:before {
    transform: translateX(24px);
}

input:disabled+.toggle-slider {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Select Dropdown */
.setting-item select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    cursor: pointer;
    min-width: 150px;
}

.setting-item select:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Coming Soon Badge */
.badge {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Settings Footer */
.settings-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-version {
    font-size: 13px;
    opacity: 0.6;
    margin: 0;
}

.reset-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Responsive */
@media (max-width: 600px) {
    .settings-content {
        padding: 1.5rem;
    }

    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .volume-control,
    .setting-item select {
        width: 100%;
        max-width: none;
    }

    .badge {
        position: static;
        transform: none;
        margin-top: 0.5rem;
    }

    .settings-footer {
        flex-direction: column;
        gap: 1rem;
    }
}