:root {
    --ocean-deep: #0A192F;
    --ocean-vibrant: #178CA4;
    --text-primary: #FFFFFF;
    --text-secondary: #E0F2FE;
    
    --seaweed-green: #10B981;
    --coral-red: #FF6B6B;
    --sun-yellow: #FBBF24;
    --cyan-accent: #38BDF8;
    
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-blur: blur(12px);

    --font-rounded: 'Quicksand', sans-serif;
}

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

body {
    background: linear-gradient(135deg, var(--ocean-deep) 0%, var(--ocean-vibrant) 100%);
    color: var(--text-primary);
    font-family: var(--font-rounded);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Seagull Layer Rework */
.seagull-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 150; /* Above modal to ensure click works */
    overflow: hidden;
}

.seagull {
    position: absolute;
    width: 70px;
    height: 50px;
    pointer-events: auto;
    cursor: pointer;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
}

.seagull svg {
    width: 100%;
    height: 100%;
    transform-origin: center;
}

.bird-wings {
    animation: flap-natural 0.5s ease-in-out infinite;
    transform-origin: center;
}

@keyframes flap-natural {
    0%, 100% { transform: scaleY(1) translateY(0); }
    50% { transform: scaleY(0.4) translateY(12px); }
}

.seagull.scared {
    filter: drop-shadow(0 0 12px var(--cyan-accent));
}

.seagull.looping {
    animation: loop-rework 0.8s ease-in-out forwards;
}

@keyframes loop-rework {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.8) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

.poop {
    position: absolute;
    width: 8px;
    height: 10px;
    background: #FFFFFF;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    z-index: 140;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    animation: fall-and-fade 2s ease-in forwards;
}

@keyframes fall-and-fade {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(100vh) scale(0.5); opacity: 0; }
}

#app {
    width: 100%;
    max-width: 800px; /* Reduced from 900px */
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1.5rem; /* Reduced from 2rem */
    padding-bottom: 80px; /* Reserved space for AdSense Banner */
    position: relative;
}

/* AdSense Container Placeholder */
.ad-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px; /* Standard mobile ad height + buffer */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50; /* Below modals, above background */
    pointer-events: none; /* Ensure it doesn't block clicks if empty */
}

/* Glassmorphism Helper */
.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem; /* Reduced from 2rem */
}

.logo {
    font-weight: 700;
    font-size: 2.2rem; /* Reduced from 2.8rem */
    letter-spacing: 5px;
    background: linear-gradient(to bottom, #FFFFFF 0%, var(--cyan-accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    cursor: default;
    transition: all 0.5s ease;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.3));
}

.logo:hover {
    letter-spacing: 7px;
    filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.6));
    transform: scale(1.02);
}

.logo::after {
    content: '〰️';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    -webkit-text-fill-color: var(--cyan-accent);
    opacity: 0.5;
}

@media (max-width: 600px) {
    .logo {
        font-size: 1.8rem;
    }
    
    .timer-display {
        width: 90px;
        height: 90px;
    }
    
    .active-letter-large {
        font-size: 2.5rem;
    }
    
    .btn-difficulty {
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    .modal {
        padding: 1.5rem;
    }

    #start-modal .logo {
        font-size: 2.5rem;
    }

    .stat-card {
        padding: 0.4rem 0.8rem;
    }

    .stat-card .value {
        font-size: 1.2rem;
    }
    
    .ad-container {
        height: 50px; /* Strict height for smallest screens */
    }
}

/* iPhone SE / Very Narrow Screens Fix */
@media (max-width: 400px) {
    .logo {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }
    
    #start-modal .logo {
        font-size: 2rem;
    }
    
    .alphabet-wheel {
        transform: scale(0.9); /* Prevent horizontal overflow */
    }
}

.stat-card {
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.stat-card .value {
    font-size: 1.2rem; /* Reduced from 1.5rem */
    font-weight: 700;
}

.text-success { color: var(--seaweed-green); }
.text-danger { color: var(--coral-red); }

/* Themed Stat Pills */
.stat-pill {
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
}
.stat-pill.correct { background: rgba(16, 185, 129, 0.25); color: #065F46; border: 1px solid rgba(16, 185, 129, 0.3); }
.logbook-table tr.correct-row { background: rgba(16, 185, 129, 0.15); }
.logbook-table tr.wrong-row { background: rgba(239, 68, 68, 0.15); }
.logbook-table tr.passed-row { background: rgba(245, 158, 11, 0.15); }

/* Colorblind Row Overrides */
.colorblind-mode .logbook-table tr.correct-row { background: rgba(59, 130, 246, 0.2); border-left: 5px solid #3B82F6; }
.colorblind-mode .logbook-table tr.wrong-row { background: rgba(249, 115, 22, 0.2); border-left: 5px solid #F97316; }
.stat-pill.wrong { background: rgba(239, 68, 68, 0.25); color: #991B1B; border: 1px solid rgba(239, 68, 68, 0.3); }
.stat-pill.passed { background: rgba(245, 158, 11, 0.25); color: #92400E; border: 1px solid rgba(245, 158, 11, 0.3); }

/* Main Container */
.game-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem; /* Reduced from 2.5rem */
}

/* Alphabet Wheel */
.wheel-container {
    position: relative;
    width: 300px; /* Reduced from 350px */
    height: 300px; /* Reduced from 350px */
    display: flex;
    justify-content: center;
    align-items: center;
}

.letter-node {
    position: absolute;
    width: 32px;
    height: 32px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(0, 0, 0, 0.1) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2), inset -2px -2px 5px rgba(0,0,0,0.2);
    backdrop-filter: blur(2px);
    animation: bubble-float 4s ease-in-out infinite;
}

/* Bubble Highlight Dot */
.letter-node::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 7px;
    width: 6px;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transform: rotate(-30deg);
}

@keyframes bubble-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-5px) scale(1.02); }
}

.letter-node.active {
    background: radial-gradient(circle at 30% 30%, rgba(56, 189, 248, 0.4) 0%, rgba(56, 189, 248, 0.1) 100%);
    border-color: var(--cyan-accent);
    box-shadow: 0 0 20px var(--cyan-accent), inset 0 0 10px white;
    transform: scale(1.25);
    z-index: 10;
    animation: none; /* Stop floating when active to keep focus */
}

.letter-node.correct { background: #10B981; border-color: transparent; box-shadow: inset 0 0 10px rgba(0,0,0,0.2); }
.letter-node.wrong { background: #FF6B6B; border-color: transparent; box-shadow: inset 0 0 10px rgba(0,0,0,0.2); }
.letter-node.passed { background: #FBBF24; color: var(--ocean-deep); border-color: transparent; box-shadow: inset 0 0 10px rgba(0,0,0,0.2); }

/* Colorblind Mode Overrides */
.colorblind-mode .letter-node.correct { background: #3B82F6 !important; } /* High-contrast Blue */
.colorblind-mode .letter-node.wrong { background: #F97316 !important; }   /* High-contrast Orange */
.colorblind-mode .letter-node.passed { background: #94A3B8 !important; }  /* Gray */

/* Symbolic Indicators for Colorblind Mode */
.colorblind-mode .letter-node::after {
    position: absolute;
    bottom: -8px;
    font-size: 10px;
    font-weight: 900;
    text-shadow: 0 0 3px black;
    color: white;
}
.colorblind-mode .letter-node.correct::after { content: '✓'; }
.colorblind-mode .letter-node.wrong::after { content: '✕'; }
.colorblind-mode .letter-node.passed::after { content: '?'; }

.colorblind-mode .stat-pill.correct { background: #3B82F6; color: white; }
.colorblind-mode .stat-pill.wrong { background: #F97316; color: white; }
.colorblind-mode .stat-pill.passed { background: #94A3B8; color: white; }

/* Timer Display (Life Ring) */
.timer-display {
    width: 150px; /* Reduced from 180px */
    height: 150px; /* Reduced from 180px */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    border: 4px dashed rgba(255,255,255,0.2);
}

.timer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
    gap: 0.2rem;
}

.active-letter-large {
    font-size: 4rem; /* Reduced from 5rem */
    font-weight: 700;
    color: white;
}

.timer-seconds {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--cyan-accent); /* Make it pop a bit more */
    letter-spacing: 1px;
}

/* Question Area */
.question-card {
    padding: 1rem 1.5rem; /* Reduced padding */
    border-radius: 24px;
    min-height: 80px; /* Reduced from 100px */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.1rem; /* Reduced from 1.2rem */
    font-weight: 500;
    width: 100%;
    max-width: 600px;
}

/* Input (Pill Dashboard) */
.input-section {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input[type="text"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    padding: 0.8rem 1.5rem; /* Reduced from 1rem 2rem */
    border-radius: 40px;
    color: white;
    font-size: 1.3rem; /* Reduced from 1.5rem */
    font-family: var(--font-rounded);
    text-align: center;
    outline: none;
    transition: all 0.3s;
}

input[type="text"]:focus {
    border-color: var(--cyan-accent);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.button-group {
    display: flex;
    gap: 1rem;
}

.btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 40px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font-rounded);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-submit { background: var(--seaweed-green); color: white; }
.btn-pass { background: var(--sun-yellow); color: var(--ocean-deep); }

.btn:hover:not(:disabled) {
    transform: translateY(-3px);
    filter: brightness(1.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.btn:disabled { opacity: 0.3; }

/* Modals */
.bg-dimmer {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(5, 12, 23, 0.8);
    z-index: 100;
    pointer-events: none;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200; /* Increased to stay above seagull-container (150) */
    pointer-events: none; /* Let clicks pass to seagulls */
}

.modal {
    padding: 4rem 3rem;
    border-radius: 32px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    position: relative;
    pointer-events: auto; /* Catch clicks for modal content */
}

/* Restored Original Nautical Animation */
.ocean-scene {
    position: relative;
    height: 100px;
    margin-bottom: 1rem;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    border-radius: 20px;
}

.sailboat {
    font-size: 4rem;
    animation: bobbing 4s ease-in-out infinite;
    position: relative;
    z-index: 5;
    margin-bottom: -5px;
}

.waves {
    position: absolute;
    bottom: -10px;
    white-space: nowrap;
    display: flex;
    font-size: 2rem;
    user-select: none;
    pointer-events: none;
}

.waves-back {
    z-index: 2;
    opacity: 0.4;
    animation: drift-back 15s linear infinite, wave-bob 5s ease-in-out infinite;
    bottom: 0px;
}

.waves-front {
    z-index: 8;
    opacity: 0.8;
    animation: drift-front 8s linear infinite, wave-bob 3s ease-in-out infinite;
    bottom: -15px;
}

@keyframes bobbing {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-15px) rotate(8deg); }
}

@keyframes wave-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

.modal-title-main {
    font-family: 'Paytone One', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    /* Softer, more friendly Ocean/Teal gradient */
    background: linear-gradient(to bottom, #A5F3FC 0%, #22D3EE 100%); 
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Reduced glow for a calmer look */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    text-shadow: 
        0 1px 0 #0891B2,
        0 2px 0 #0891B2,
        0 3px 0 #0891B2; /* Thinner, softer 3D effect */
    letter-spacing: 1px;
    position: relative;
    z-index: 10;
}

.modal-subtitle-main {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1rem;
    opacity: 0.8;
}

.difficulty-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-difficulty-large {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 1.2rem;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: 700;
}

.btn-difficulty-large:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--cyan-accent);
}

/* Filter & Sound Toggle Controls */
.controls-top-right {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    gap: 1rem;
    z-index: 50;
}

.btn-icon-glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-icon-glass:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--cyan-accent);
    color: white;
    transform: translateY(-2px);
}

.btn-icon-glass.active {
    background: rgba(56, 189, 248, 0.2);
    color: var(--cyan-accent);
    border-color: var(--cyan-accent);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.filter-dropdown {
    position: absolute;
    top: 2rem;
    left: calc(100% + 1rem); /* Open to the right side, outside the modal */
    right: auto;
    width: 280px;
    padding: 1.5rem;
    border-radius: 20px;
    text-align: left;
    z-index: 100; /* Ensure it stays above everything */
}

@media (max-width: 850px) {
    .filter-dropdown {
        left: auto;
        right: 2rem;
        top: 5.5rem; /* Fallback to inside for mobile */
    }
}

.category-grid { display: flex; flex-direction: column; gap: 0.8rem; }
.toggle-control { display: flex; align-items: center; gap: 0.8rem; cursor: pointer; }
.toggle-control input { appearance: none; width: 34px; height: 18px; background: rgba(255,255,255,0.1); border-radius: 20px; position: relative; cursor: pointer; }
.toggle-control input:checked { background: var(--cyan-accent); }
.toggle-control input::before { content: ''; position: absolute; width: 12px; height: 12px; background: white; border-radius: 50%; top: 3px; left: 3px; transition: 0.3s; }
.toggle-control input:checked::before { transform: translateX(16px); }

/* VINTAGE LOGBOOK MODAL */
.logbook {
    background: #FAF3E0 !important; /* Aged Parchment */
    border: 12px solid #3E2723 !important; /* Leather Border */
    border-radius: 10px !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6), inset 0 0 100px rgba(0,0,0,0.1) !important;
    max-width: 800px !important;
    width: 95% !important;
    padding: 2rem !important;
    position: relative;
    overflow: hidden;
}

.logbook::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px);
    background-size: 100% 2.2rem; /* Ruled lines */
    pointer-events: none;
    z-index: 1;
}

.logbook-header {
    text-align: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #3E2723;
    padding-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.logbook-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: #3E2723;
    letter-spacing: 3px;
    margin: 0;
}

.logbook-date {
    font-family: 'Architects Daughter', cursive;
    font-size: 1.2rem;
    color: #5D4037;
    margin-top: 0.2rem;
}

.logbook-stats {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.logbook-paper {
    background: transparent !important;
    max-height: 350px !important;
    overflow-y: auto !important; /* FIXED: Added missing scroll */
    margin-bottom: 1.5rem !important;
    scrollbar-width: thin;
    scrollbar-color: #3E2723 transparent;
    position: relative;
    z-index: 2;
}

.logbook-table {
    width: 100%;
    border-collapse: collapse;
}

.logbook-table th {
    font-family: 'Quicksand', sans-serif;
    text-align: left;
    color: #3E2723;
    font-size: 0.8rem;
    text-transform: uppercase;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(62, 39, 35, 0.2);
}

.logbook-table td {
    padding: 0.8rem 0.5rem;
    font-size: 1rem;
    line-height: 1.4;
}

/* Clue Column - Printed Ink */
.logbook-table td:nth-child(2) {
    font-family: 'Playfair Display', serif;
    color: #1A2530;
    font-weight: 500;
    width: 40%;
}

/* User Answer Column - Hand-written Ink */
.logbook-table td:nth-child(3) {
    font-family: 'Architects Daughter', cursive;
    color: #003366; /* Fountain Pen Blue */
    font-size: 1.4rem;
    transform: rotate(-1deg); /* Slight natural tilt */
}

/* Correct Answer Column */
.logbook-table td:nth-child(4) {
    font-family: 'Quicksand', sans-serif;
    color: #5D4037;
    font-weight: 700;
    font-size: 0.9rem;
}

.logbook-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid #3E2723;
    padding-top: 1.5rem;
    position: relative;
    z-index: 2;
}

.signature {
    font-family: 'Architects Daughter', cursive;
    font-size: 2rem;
    color: #3E2723;
    margin: 0;
}

.btn-logbook {
    background: #3E2723 !important;
    color: #FAF3E0 !important;
    padding: 0.8rem 2rem !important;
    font-size: 1rem !important;
    border: none !important;
}

.btn-logbook:hover {
    background: #5D4037 !important;
    transform: scale(1.05);
}

/* Loading & Error */
.filter-error { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); background: var(--coral-red); padding: 0.6rem 1.2rem; border-radius: 12px; font-weight: 700; }
/* SEAGULL COMBO MINI-GAME STYLES */
.combo-float {
    position: fixed;
    pointer-events: none;
    z-index: 200;
    font-weight: 900;
    font-family: 'Paytone One', sans-serif;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
    animation: combo-up-fade 1s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
    white-space: nowrap;
}

.combo-tier-1 { color: #FFFFFF; font-size: 1.5rem; }
.combo-tier-2 { color: #FBBF24; font-size: 2.2rem; filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.6)); }
.combo-tier-3 { 
    color: #FF4D4D; 
    font-size: 3rem; 
    filter: drop-shadow(0 0 15px rgba(255, 77, 77, 0.8));
    animation: combo-up-fade 1s forwards, shake-intense 0.2s infinite;
}

@keyframes combo-up-fade {
    0% { transform: translate(-50%, 0) scale(0.5); opacity: 0; }
    20% { transform: translate(-50%, -40px) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -120px) scale(1); opacity: 0; }
}

@keyframes shake-intense {
    0%, 100% { transform: translate(-50%, -60px) rotate(0deg); }
    25% { transform: translate(-52%, -62px) rotate(-2deg); }
    75% { transform: translate(-48%, -58px) rotate(2deg); }
}

/* Feather Particles */
.feather-particle {
    position: fixed;
    width: 20px;
    height: 20px;
    pointer-events: none;
    z-index: 190;
    fill: rgba(255, 255, 255, 0.8);
    animation: feather-scatter 1.5s ease-out forwards;
}

@keyframes feather-scatter {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) rotate(var(--dr)); opacity: 0; }
}

/* Combo Meter UI */
.combo-meter {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 210;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    transform: scale(0.5) translateY(50px);
}

.combo-meter.active {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.combo-meter-value {
    font-family: 'Paytone One', sans-serif;
    font-size: 4rem;
    background: linear-gradient(to bottom, #FBBF24, #D97706);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.4));
    line-height: 1;
}

.combo-meter-label {
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.pulse-scale {
    animation: pulse-quick 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pulse-quick {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* How to Play Manual Styles */
.manual-content {
    text-align: left;
    padding: 1.5rem 2rem !important;
}

.manual-step {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    margin-bottom: 1.8rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(62, 39, 35, 0.1);
}

.manual-step:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.manual-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: rgba(56, 189, 248, 0.1);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.manual-text h4 {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.1rem;
    color: #1A0F0E;
    margin-bottom: 0.4rem;
    font-weight: 700;
}

.manual-text p {
    font-family: 'Playfair Display', serif;
    color: #3E2723;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.hidden { display: none !important; }
.modal-footer-legal {
    margin-top: 2rem;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.modal-footer-legal:hover {
    opacity: 1;
}

.btn-link-glass {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    text-decoration: underline;
    font-family: var(--font-rounded);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.5rem;
}

.privacy-content {
    text-align: left !important;
    padding: 0 1rem;
}

.privacy-scroll-area {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 1rem;
    font-family: 'Playfair Display', serif; /* More formal serif font */
    color: #3E2723;
    line-height: 1.6;
}

.privacy-scroll-area h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    margin: 1.5rem 0 0.5rem 0;
    color: #1A0F0E; /* Darker for more contrast/formality */
    border-bottom: 1px solid rgba(62, 39, 35, 0.1);
    text-transform: uppercase;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.privacy-scroll-area p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.privacy-scroll-area a {
    color: #003366;
    text-decoration: underline;
}

.privacy-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.privacy-scroll-area::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.privacy-scroll-area::-webkit-scrollbar-thumb {
    background: #3E2723;
    border-radius: 10px;
}

@media (max-width: 600px) {
    .wheel-container { width: 300px; height: 300px; }
    .letter-node { width: 34px; height: 34px; font-size: 0.9rem; }
    .active-letter-large { font-size: 3.5rem; }
    .logo { font-size: 1.8rem; }
}

/* Glassmorphism Share Score Button Styling */
.btn-share {
    background: rgba(56, 189, 248, 0.25) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    color: #FAF3E0 !important;
    border: 1px solid rgba(56, 189, 248, 0.5) !important;
    padding: 0.8rem 2rem !important;
    font-size: 1rem !important;
    border-radius: 12px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.btn-share:hover {
    background: rgba(56, 189, 248, 0.4) !important;
    border-color: rgba(56, 189, 248, 0.7) !important;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

.btn-share:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 2px 10px rgba(56, 189, 248, 0.25);
}
