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

body {
    font-family: 'Mogra', cursive, sans-serif;
    background: #0d0d0d;
    min-height: 100vh;
    color: #ffffff;
    font-weight: 400;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.screen.active {
    display: block;
}

/* Game Screen Styles */
#gameScreen {
    background: #0d0d0d;
    position: relative;
    overflow: hidden;
}

#gameScreen::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 50%, #0d0d0d 100%);
    z-index: -1;
}

#gameScreen .container {
    position: relative;
    z-index: 10;
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

#gameScreen header {
    text-align: center;
    margin-bottom: 3rem;
}

#gameScreen header p {
    font-family: 'Mogra', cursive;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Immersive Landing Screen */
.landing-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    z-index: 10;
    padding: 20px;
    padding-top: 40px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: default;
}

.landing-container *,
.landing-container *::before,
.landing-container *::after {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: default;
}

.landing-container input {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    cursor: text;
}

/* Fullscreen Slideshow Background */
.slideshow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 3s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Knewave Font Typography with Letter Animations */
.brand-title {
    font-family: 'Knewave', cursive, sans-serif;
    font-weight: 400;
    font-size: clamp(3.2rem, 12vw, 9rem);
    text-align: center;
    margin-bottom: 1rem;
    margin-top: 0;
    position: relative;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.15em;
}

.letter {
    display: inline-block;
    color: #FFF8E7;
    text-shadow: 
        4px 4px 0px #E8D5B7,
        8px 8px 0px #D4A574,
        12px 12px 0px #C19660,
        16px 16px 25px rgba(0,0,0,0.6);
    font-weight: 400;
    opacity: 0;
    transform: translateY(50px) rotate(0deg);
    animation: letterAppear 0.6s ease-out forwards;
    position: relative;
    line-height: 1;
}

.letter::before {
    content: attr(data-letter);
    position: absolute;
    top: 3px;
    left: 3px;
    color: #F5E6D3;
    z-index: -1;
    opacity: 0.9;
    filter: blur(1px);
}

.letter::after {
    content: attr(data-letter);
    position: absolute;
    top: 6px;
    left: 6px;
    color: #E8D5B7;
    z-index: -2;
    opacity: 0.7;
    filter: blur(2px);
}

/* Individual letter animations with different inclinations */
.letter:nth-child(1) { animation-delay: 0.1s; transform: translateY(50px) rotate(-35deg) skewX(-15deg); }
.letter:nth-child(2) { animation-delay: 0.2s; transform: translateY(50px) rotate(25deg) skewX(12deg); }
.letter:nth-child(3) { animation-delay: 0.3s; transform: translateY(50px) rotate(-20deg) skewX(-18deg); }
.letter:nth-child(4) { animation-delay: 0.4s; transform: translateY(50px) rotate(30deg) skewX(20deg); }
.letter:nth-child(5) { animation-delay: 0.5s; transform: translateY(50px) rotate(-25deg) skewX(-12deg); }
.letter:nth-child(6) { animation-delay: 0.6s; transform: translateY(50px) rotate(18deg) skewX(15deg); }
.letter:nth-child(7) { animation-delay: 0.7s; transform: translateY(50px) rotate(-30deg) skewX(-20deg); }
.letter:nth-child(8) { animation-delay: 0.8s; transform: translateY(50px) rotate(35deg) skewX(18deg); }
.letter:nth-child(9) { animation-delay: 0.9s; transform: translateY(50px) rotate(-12deg) skewX(-8deg); }
.letter:nth-child(10) { animation-delay: 1.0s; transform: translateY(50px) rotate(20deg) skewX(12deg); }

@keyframes letterAppear {
    0% {
        opacity: 0;
        transform: translateY(80px) rotate(var(--rotation, 0deg)) skewX(var(--skew, 0deg)) scale(0.3);
    }
    30% {
        opacity: 1;
        transform: translateY(-20px) rotate(calc(var(--rotation, 0deg) * 0.5)) skewX(calc(var(--skew, 0deg) * 0.5)) scale(1.3);
    }
    60% {
        opacity: 1;
        transform: translateY(-10px) rotate(calc(var(--rotation, 0deg) * 0.2)) skewX(calc(var(--skew, 0deg) * 0.2)) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotate(0deg) skewX(0deg) scale(1);
    }
}

/* Add pulse animation for clicked images */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Landing Header */
.landing-header {
    text-align: center;
    margin-bottom: 4rem;
    z-index: 20;
    position: relative;
}

.greeting-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: #ffffff;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    z-index: 20;
    position: relative;
}

.intro-text {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: #ffffff;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    z-index: 20;
    position: relative;
}

/* First Riddle - No Cards, Just Text */
.first-riddle {
    z-index: 20;
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: 90vw;
    max-width: 1200px;
    padding: 2rem;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.first-riddle h3 {
    font-family: 'Mogra', cursive, sans-serif;
    font-weight: 400;
    font-size: clamp(1.3rem, 4vw, 2rem);
    color: #ffffff;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    line-height: 1.6;
}

/* Letter Boxes for Answer Input */
.letter-boxes {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.letter-box {
    width: 18px;
    height: 18px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Mogra', cursive, sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    text-transform: uppercase;
    transition: all 0.3s ease;
    outline: none;
    cursor: pointer;
    box-shadow: 
        0 2px 8px rgba(0,0,0,0.2),
        inset 0 1px 3px rgba(255,255,255,0.1);
}

.letter-box:focus {
    border-color: #00ff88;
    background: rgba(0,255,136,0.1);
    transform: scale(1.05);
    box-shadow: 
        0 6px 20px rgba(0,255,136,0.3),
        inset 0 2px 5px rgba(255,255,255,0.2);
}

.letter-box.filled {
    background: rgba(255,255,255,0.1);
    border-color: #ffffff;
    animation: letterPop 0.3s ease;
}

.letter-box.correct {
    border-color: #00ff88;
    background: rgba(0,255,136,0.2);
    animation: correctPulse 0.6s ease;
}

.letter-box.incorrect {
    border-color: #ff4444;
    background: rgba(255,68,68,0.2);
    animation: shake 0.5s ease;
}

@keyframes letterPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); border-color: #00ff88; }
    50% { transform: scale(1.1); border-color: #ffffff; }
}
.answer-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.answer-input {
    background: transparent;
    border: none;
    border-bottom: 3px solid #ffffff;
    color: #ffffff;
    font-size: 1.5rem;
    font-family: 'Mogra', cursive, sans-serif;
    padding: 12px 0;
    outline: none;
    transition: all 0.3s ease;
    width: 600px;
    max-width: 100%;
    text-align: center;
}

.answer-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.answer-input:focus {
    border-bottom-color: #00ff88;
    box-shadow: 0 3px 0 #00ff88;
}

.answer-input:disabled {
    border-bottom-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.5);
}

/* SVG Submit Button */
.submit-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.submit-btn:hover:not(:disabled) {
    transform: scale(1.1);
}

.submit-btn:hover:not(:disabled) .send-icon {
    stroke: #ffffff;
    filter: drop-shadow(0 0 8px #ffffff);
    transform: scale(1.1);
}

.submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.send-icon {
    width: 24px;
    height: 24px;
    stroke: #ffffff;
    stroke-width: 2;
    fill: none;
    transition: all 0.3s ease;
}

/* Floating Images */
.floating-images {
    position: absolute;
    inset: 0;
    pointer-events: none; /* container is invisible to events… */
    z-index: 100;         /* …but sits above everything so images are never buried */
}

/* Wrapper carries the float animation; img carries hover effects — no transform conflict */
.floating-wrapper {
    position: absolute;
    pointer-events: none;
    /* size comes from img content */
}

.floating-image {
    display: block;
    border-radius: 50%;
    object-fit: cover;
    opacity: 0.78;
    cursor: pointer !important;
    pointer-events: auto;
    /* subtle ambient glow in normal state — no hard stroke */
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5))
            drop-shadow(0 0 6px rgba(255,255,255,0.3));
    transition: transform 0.35s cubic-bezier(.34,1.56,.64,1),
                opacity   0.3s ease,
                filter    0.3s ease,
                outline   0s;
    outline: 0px solid transparent;
}

.floating-image:hover {
    transform: scale(1.18);
    opacity: 1;
    /* thick white stroke via stacked drop-shadows + bright outer glow */
    filter:
        drop-shadow(0 0 0   4px #fff)
        drop-shadow(0 0 0   4px #fff)
        drop-shadow(0 0 0   4px #fff)
        drop-shadow(0 0 0   4px #fff)
        drop-shadow(0 0 0   4px #fff)
        drop-shadow(0 0 16px rgba(255,255,255,0.9))
        drop-shadow(0 0 30px rgba(255,255,255,0.5));
}

/* Name label — fades in on wrapper hover */
.floating-label {
    position: absolute;
    bottom: -26px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-family: 'Mogra', cursive;
    font-size: 0.88rem;
    padding: 3px 12px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Label — trigger on the IMAGE (not wrapper) so pointer-events:none on wrapper doesn't block :hover */
.floating-image:hover ~ .floating-label,
.floating-image.keyboard-selected ~ .floating-label {
    opacity: 1;
}

/* Explicitly override scale when both keyboard-selected and hovered */
.floating-image.keyboard-selected:hover {
    transform: scale(1.18);
}

/* Keyboard-selected person — pulsing white stroke.
   Animation only touches filter so hover's transform: scale() is never overridden. */
.floating-image.keyboard-selected {
    opacity: 1;
    transform: scale(1.14);
    filter:
        drop-shadow(0 0 0 4px #fff)
        drop-shadow(0 0 0 4px #fff)
        drop-shadow(0 0 0 4px #fff)
        drop-shadow(0 0 0 4px #fff)
        drop-shadow(0 0 0 4px #fff)
        drop-shadow(0 0 18px rgba(255,255,255,0.95))
        drop-shadow(0 0 36px rgba(255,255,255,0.5));
    animation: kbSelectedPulse 1.4s ease-in-out infinite;
}

@keyframes kbSelectedPulse {
    /* Only pulse the outer glow — never touch transform so hover scale works */
    0%, 100% {
        filter:
            drop-shadow(0 0 0 4px #fff)
            drop-shadow(0 0 0 4px #fff)
            drop-shadow(0 0 0 4px #fff)
            drop-shadow(0 0 0 4px #fff)
            drop-shadow(0 0 0 4px #fff)
            drop-shadow(0 0 18px rgba(255,255,255,0.95))
            drop-shadow(0 0 36px rgba(255,255,255,0.5));
    }
    50% {
        filter:
            drop-shadow(0 0 0 5px #fff)
            drop-shadow(0 0 0 5px #fff)
            drop-shadow(0 0 0 5px #fff)
            drop-shadow(0 0 0 5px #fff)
            drop-shadow(0 0 0 5px #fff)
            drop-shadow(0 0 28px rgba(255,255,255,1))
            drop-shadow(0 0 50px rgba(255,255,255,0.7));
    }
}

/* Updated Floating Animations */
@keyframes float1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    25% { transform: translate(30px, -40px) rotate(5deg) scale(1.05); }
    50% { transform: translate(-20px, 30px) rotate(-3deg) scale(0.95); }
    75% { transform: translate(40px, 15px) rotate(2deg) scale(1.02); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    33% { transform: translate(-35px, 20px) rotate(-4deg) scale(1.03); }
    66% { transform: translate(20px, -35px) rotate(3deg) scale(0.97); }
}

@keyframes float3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    25% { transform: translate(40px, -30px) rotate(6deg) scale(1.04); }
    50% { transform: translate(-30px, 40px) rotate(-5deg) scale(0.96); }
    75% { transform: translate(35px, 20px) rotate(-2deg) scale(1.01); }
}

@keyframes float4 {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    20% { transform: translate(-30px, -35px) rotate(4deg) scale(1.02); }
    40% { transform: translate(35px, 30px) rotate(-3deg) scale(0.98); }
    60% { transform: translate(-25px, 40px) rotate(2deg) scale(1.03); }
    80% { transform: translate(30px, -20px) rotate(-4deg) scale(0.97); }
}

@keyframes float5 {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    50% { transform: translate(20px, -30px) rotate(5deg) scale(1.05); }
}

@keyframes float6 {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    33% { transform: translate(-40px, 35px) rotate(-6deg) scale(1.04); }
    66% { transform: translate(25px, -40px) rotate(4deg) scale(0.96); }
}

/* Slideshow Controls - Hidden for fullscreen effect */
.slideshow-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 25;
}

.slide-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.slide-dot.active {
    background: #ffffff;
    transform: scale(1.3);
    box-shadow: 0 0 10px #00ff88;
}

.slide-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* Result Message - Minimal, no card */
.result-message {
    padding: 8px 16px;
    margin-top: 15px;
    font-weight: 500;
    text-align: center;
    font-size: 14px;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.result-message.show {
    opacity: 1;
}

.result-message.success {
    color: #00ff88;
}

.result-message.error {
    color: #ff4444;
}

/* Main Game Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

header {
    text-align: center;
    margin-bottom: 60px;
    color: #2d3748;
}

header p {
    font-size: 1.2rem;
    color: #718096;
    margin-top: 1rem;
}

main {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

section h2 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    color: #2d3748;
    margin-bottom: 30px;
    text-align: center;
}

.video-section {
    text-align: center;
}

.video-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto 30px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

#treasureVideo {
    width: 100%;
    height: auto;
    display: block;
}

.upload-section {
    margin-top: 30px;
}

.upload-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #4a5568;
}

.upload-section input[type="file"] {
    padding: 12px;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    background: #f7fafc;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 400px;
}

.upload-section input[type="file"]:hover {
    border-color: #a0aec0;
    background: #edf2f7;
}

.clues-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.clue-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 30px;
    transition: all 0.3s ease;
}

.clue-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.clue-card h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: #2d3748;
    margin-bottom: 15px;
}

.clue-text {
    margin-bottom: 20px;
    line-height: 1.6;
    color: #4a5568;
}

.answer-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.answer-input {
    background: transparent;
    border: none;
    border-bottom: 3px solid #ffffff;
    color: #ffffff;
    font-size: 1.5rem;
    font-family: 'Mogra', cursive, sans-serif;
    padding: 12px 0;
    outline: none;
    transition: all 0.3s ease;
    width: 600px;
    max-width: 100%;
    text-align: center;
}

.answer-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.answer-input:focus {
    border-bottom-color: #00ff88;
    box-shadow: 0 3px 0 #00ff88;
}

.answer-input:disabled {
    border-bottom-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.5);
}

/* SVG Submit Button */
.submit-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.submit-btn:hover:not(:disabled) {
    transform: scale(1.1);
}

.submit-btn:hover:not(:disabled) .send-icon {
    stroke: #ffffff;
    filter: drop-shadow(0 0 8px #ffffff);
    transform: scale(1.1);
}

.submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.send-icon {
    width: 24px;
    height: 24px;
    stroke: #ffffff;
    stroke-width: 2;
    fill: none;
    transition: all 0.3s ease;
}

.result-message {
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    font-weight: 500;
    text-align: center;
    font-size: 14px;
}

.result-message.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.result-message.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.gifts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.gift-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    min-height: 320px;
}

.gift-card.locked {
    background: #f8fafc;
    opacity: 0.8;
}

.gift-card.unlocked {
    border-color: #10b981;
    background: #f0fdf4;
    transform: scale(1.02);
}

.gift-lock {
    font-size: 3rem;
    margin-bottom: 20px;
}

.gift-card h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: #2d3748;
    margin-bottom: 20px;
}

.gift-image {
    width: 100%;
    max-width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
}

.gift-description {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #4a5568;
    font-size: 14px;
}

.gift-coordinates {
    font-weight: 500;
    color: #2d3748;
    font-size: 13px;
}

.progress-section {
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 32px;
    background: #f1f5f9;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    transition: width 0.6s ease;
    border-radius: 16px;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

#progressText {
    font-size: 1.1rem;
    color: #4a5568;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    
    .landing-container {
        padding: 40px 15px;
    }
    
    .brand-title {
        font-size: 2rem;
        letter-spacing: 0.1em;
    }
    
    .greeting-title {
        font-size: 1.5rem;
    }
    
    section {
        padding: 25px;
    }
    
    .riddle-card {
        padding: 30px 25px;
    }
    
    .clues-grid,
    .gifts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .answer-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .submit-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .brand-title {
        font-size: 1.5rem;
        letter-spacing: 0.05em;
    }

    .riddle-card {
        padding: 25px 20px;
    }

    section {
        padding: 20px;
    }
}

/* ── Media Modal ── */
.media-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.media-modal-card {
    background: #111;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 36px 32px 28px;
    max-width: 640px;
    width: 92%;
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
    transition: max-width 0.25s ease, padding 0.25s ease;
}

/* Expand to near-fullscreen when showing video */
.media-modal-card.has-video {
    max-width: min(92vw, 1100px);
    width: 92vw;
    max-height: 92vh;
    padding: 48px 28px 28px;
}

.media-modal-card.has-video video {
    max-height: calc(92vh - 160px); /* leave room for title + padding */
    object-fit: contain;
}

.media-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.media-modal-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.media-modal-title {
    font-family: 'Knewave', cursive;
    font-size: 2.2rem;
    color: #fff;
    text-align: center;
    margin-bottom: 22px;
    text-transform: capitalize;
    letter-spacing: 0.03em;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.4);
}

.media-modal-content video,
.media-modal-content audio {
    width: 100%;
    display: block;
    margin-bottom: 14px;
    border-radius: 12px;
    outline: none;
}

.media-modal-content video:last-child,
.media-modal-content audio:last-child {
    margin-bottom: 0;
}

.media-no-media {
    text-align: center;
    color: rgba(255, 255, 255, 0.45);
    font-family: 'Mogra', cursive;
    font-size: 1.1rem;
    padding: 24px 16px;
    line-height: 1.7;
}

/* ── Audio-only focus mode ── */
.audio-photo-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 4px auto 20px;
}

/* Expanding ripple ring */
.audio-ring {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.7);
    opacity: 0;
    pointer-events: none;
}

/* Portrait photo */
.audio-modal-photo {
    display: block;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.22);
    box-shadow:
        0 0 0 0 rgba(255,255,255,0),
        0 12px 40px rgba(0,0,0,0.6);
}

/* Equalizer bar container */
.audio-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    height: 60px;
    margin: 0 auto 18px;
    width: fit-content;
}

/* Individual bar */
.audio-bar {
    width: 5px;
    height: 52px;
    border-radius: 3px 3px 2px 2px;
    background: linear-gradient(
        to top,
        #ffffff     0%,
        #ffffff     40%,
        rgba(255,255,255,0.45) 100%
    );
    transform-origin: bottom center;
    transform: scaleY(0.08);
}

/* Native audio player */
.media-modal-content audio {
    margin-top: 4px;
}
