/* ═══════════════════════════════════════════════════════
   SURVEY SAYS! — EXACT 3D GAME SHOW REFINEMENT
   ═══════════════════════════════════════════════════════ */

:root {
    --gold: #fccb35;
    --gold-dark: #b8860b;
    --blue-glow: #31d7ff;
    --blue-board: #061c4d;
    --blue-frame: #3eb9ff;
    --blue-header: #0d2d5e;
    --bg-dark: #0a0c24;
    --red-score: #b22222;
    --text-white: #ffffff;
    --text-black: #000000;
    --radius-lg: 2rem;
    --radius-md: 0.75rem;
}

/* ── Global Styles ────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

html, body {
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background: #000;
    color: var(--text-white);
    height: 100vh;
    height: 100dvh;
    overflow-y: auto; /* Allow vertical scroll */
    overflow-x: hidden; /* Strict lock */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ── Stage Background (Floor & Lighting) ─────────────── */
.stage-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    background: radial-gradient(circle at center, #1a3a6e 0%, #061c4d 100%);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.stage-bg::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="50" cy="50" r="1" fill="white" opacity="0.2"/></svg>');
    opacity: 0.3;
    animation: slowRotate 120s linear infinite;
}

@keyframes slowRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ── Gold 3D Scrolling Text ─────────────────────────── */
.scrolling-text-wrapper {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4rem;
    transform: rotate(-10deg) scale(1.5); /* Angled and scaled for background filling */
    pointer-events: none;
    user-select: none;
    overflow: hidden;
}

.scrolling-text-row {
    display: flex;
    white-space: nowrap;
    width: fit-content;
    animation: scroll-left 40s linear infinite;
}

.scrolling-text-row.reverse {
    animation: scroll-right 40s linear infinite;
}

.gold-3d-text {
    font-size: 6rem;
    font-weight: 900;
    color: #fccb35;
    text-transform: uppercase;
    letter-spacing: 0.5rem;
    opacity: 0.45; /* Increased visibility as requested */
    padding-right: 2rem;
    
    /* 3D Gold Aesthetic */
    background: linear-gradient(180deg, #fff 0%, #fccb35 40%, #b8860b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    
    text-shadow: 
        1px 1px 0px #b8860b,
        2px 2px 0px #b8860b,
        3px 3px 0px #b8860b,
        4px 4px 6px rgba(0,0,0,0.5);
}

@keyframes scroll-left {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@keyframes scroll-right {
    from { transform: translateX(-50%); }
    to { transform: translateX(0); }
}

/* Stinger Replacement Transition */
.transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gold);
    z-index: 9999;
    transform: translateY(100%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.stinger-text {
    color: #000;
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 950;
    text-transform: uppercase;
    text-align: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.transition-overlay.in .stinger-text {
    opacity: 1;
    transform: scale(1);
}

.transition-overlay.in {
    animation: swipe-in 0.5s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.transition-overlay.out {
    animation: swipe-out 0.5s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes swipe-in {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes swipe-out {
    from { transform: translateY(0); }
    to { transform: translateY(-100%); }
}

.stage-bg.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* ── App Container ────────────────────────────────────── */
#app {
    width: 100%;
    max-width: 480px;
    height: 100vh; /* FILL ENTIRE VIEWPORT */
    position: relative;
    padding: 1rem;
    z-index: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    margin: 0 auto; /* Horizontal center inside body */
}

/* ── Screen Management ────────────────────────────────── */
.screen {
    display: none;
    flex-direction: column;
    height: 100vh; /* Fill full height of #app */
    width: 100%;
    overflow-x: hidden;
    animation: fadeIn 0.4s ease-out;
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ═══════════════════════════════════════════════════════
   HOME SCREEN
   ═══════════════════════════════════════════════════════ */
#home-screen {
    justify-content: center;
    align-items: center;
    position: relative;
}

#home-screen header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
}

.logo-marquee {
    background: linear-gradient(135deg, #103e8c 0%, #061c4d 100%);
    border: 6px solid #4eb9f1;
    border-radius: 1.5rem;
    padding: 2rem 3rem;
    box-shadow: 0 0 30px rgba(49, 215, 255, 0.5), inset 0 0 15px rgba(255,255,255,0.1);
    text-align: center;
    position: relative;
}

.logo-marquee::before {
    content: '';
    position: absolute;
    inset: -12px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 1.8rem;
    pointer-events: none;
}

.logo-marquee h1 {
    font-size: 3rem;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 4px 0 var(--gold-dark), 0 8px 10px rgba(0,0,0,0.5);
    line-height: 0.9;
}

.logo-marquee h1 span {
    font-size: 4rem;
    display: block;
}

/* ── Buttons (Home) ──────────────────────────────────── */
.menu-actions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 90%;
    max-width: 400px;
    z-index: 100;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0 !important;
}

.btn-split-row {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.btn-split-row button {
    flex: 1;
}

button {
    font-family: inherit;
    font-weight: 800;
    padding: 1.2rem;
    border: none;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(180deg, #3eb9ff 0%, #1e88e5 100%);
    color: white;
    border-bottom: 5px solid #0d47a1;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.btn-primary:active {
    transform: translateY(3px);
    border-bottom-width: 2px;
}

.btn-secondary {
    background: linear-gradient(180deg, #37474f 0%, #263238 100%);
    color: white;
    border: 2px solid #546e7a;
    border-bottom: 4px solid #102027;
}

.btn-secondary:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
}

.btn-text {
    background: transparent;
    color: #90a4ae;
}

/* ═══════════════════════════════════════════════════════
   GAME SCREEN — EXACT MATCHING
   ═══════════════════════════════════════════════════════ */

/* ── Top Bar (Timer & Small Marquee) ─────────────────── */
.game-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.timer-badge-new {
    background: linear-gradient(180deg, #1e88e5 0%, #0d47a1 100%);
    border: 3px solid #64b5f6;
    border-radius: 2rem;
    padding: 0.3rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.timer-icon-new {
    font-size: 1.2rem;
}

.timer-badge-new span#game-timer {
    font-size: 1.5rem;
    font-weight: 900;
}

.timer-badge-new small {
    font-size: 0.9rem;
    margin-left: -2px;
}

.marquee-small {
    background: linear-gradient(180deg, #103e8c 0%, #061c4d 100%);
    border: 3px solid #4eb9f1;
    border-radius: 0.8rem;
    padding: 0.5rem 1.5rem;
    box-shadow: 0 4px 10px rgba(49, 215, 255, 0.3);
}

.marquee-small span {
    font-weight: 900;
    color: var(--gold);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* ── Player Scores ───────────────────────────────────── */
.scores-row-new {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Join Modal Specifics */
.join-modal-body {
    margin: 1.5rem 0;
    text-align: center;
}

.join-modal-body p {
    font-size: 0.9rem;
    color: #b0bec5;
    margin-bottom: 1rem;
    line-height: 1.4;
}

#join-code-modal-input {
    width: 100%;
    padding: 1.2rem;
    background: rgba(0, 0, 0, 0.4);
    border: 3px solid #4eb9f1;
    border-radius: 1rem;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    text-align: center;
    text-transform: uppercase;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

#join-code-modal-input:focus {
    outline: none;
    border-color: #fccb35;
    box-shadow: 0 0 15px rgba(252, 203, 53, 0.3), inset 0 2px 10px rgba(0,0,0,0.5);
}

.modal-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

#btn-join-game {
    width: 100%;
    margin: 0;
}

.btn-icon {
    background: var(--glass);
    color: white;
    border: 1px solid var(--glass-border);
    padding: 0.5rem;
    font-size: 1.1rem;
}
.score-box-new {
    background: rgba(13, 45, 94, 0.4);
    border: 2px solid #2bb8e6;
    border-radius: 1rem;
    padding: 0.5rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: inset 0 0 10px rgba(43, 184, 230, 0.2);
}

.score-box-new.score-opp {
    border-color: #e74c3c;
    background: rgba(192, 57, 43, 0.15);
}

.player-icon-new, .result-icon, .floating-avatar-circle, #menu-avatar-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    overflow: hidden;
    flex-shrink: 0;
}

.score-info-new {
    display: flex;
    flex-direction: column;
}

.score-info-new label {
    font-size: 0.65rem;
    font-weight: 800;
    color: #90a4ae;
}

.score-info-new span {
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1;
}

/* ── Main Board Frame ────────────────────────────────── */
.board-outer-frame {
    flex: 1;
    background: linear-gradient(180deg, #81d4fa 0%, #039be5 100%);
    border-radius: 3rem;
    padding: 8px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5), 0 0 30px rgba(49, 215, 255, 0.5);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.board-inner-container {
    flex: 1;
    background: #020818;
    border-radius: 2.5rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.prompt-container-new {
    padding: 1rem 1rem;
    text-align: center;
}

.prompt-container-new h2 {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.25;
    color: white;
}

/* ── Answer Board Slots ─────────────────────────────── */
.feud-board-new {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 1.25rem 1rem;
    overflow-y: hidden;
}

.board-slot-new {
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 8px;
    flex: 1;
    min-height: 0;
    perspective: 1000px;
}

.slot-num-box {
    background: linear-gradient(180deg, #81d4fa 0%, #0277bd 100%);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #061c4d;
    font-weight: 900;
    font-size: 1.4rem;
    box-shadow: 0 3px 5px rgba(0,0,0,0.3);
}

.slot-content {
    background: var(--blue-board);
    border: 3px solid #2bb8e6;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    padding: 0 1.2rem;
    transition: all 0.3s;
    box-shadow: inset 0 0 15px rgba(43, 184, 230, 0.3);
    overflow: hidden;
}

.slot-text {
    flex: 1;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    opacity: 0;
    transition: opacity 0.3s;
}

.slot-score {
    font-weight: 900;
    font-size: 1.1rem;
    color: #4eb9f1;
    opacity: 0;
    transition: opacity 0.3s;
}

/* Board Revealed State */
.board-slot-new.revealed .slot-text,
.board-slot-new.revealed .slot-score {
    opacity: 1;
}

.board-slot-new.revealed .slot-content {
    background: #0d2d5e;
}

.board-slot-new.empty {
    opacity: 0.2;
}

/* ── Input & Controls ────────────────────────────────── */
.game-controls-new {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input-container-new {
    background: #e0f2f1;
    border: 4px solid #4eb9f1;
    border-radius: 1rem;
    padding: 2px;
}

.input-container-new input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 1rem;
    text-align: center;
    font-family: inherit;
    font-weight: 900;
    font-size: 1rem;
    color: var(--blue-board);
    text-transform: uppercase;
}

.input-container-new input:focus {
    outline: none;
}

.submit-container-new {
    background: #1a1c2c;
    border: 4px solid #4eb9f1;
    border-radius: 1.2rem;
    padding: 6px;
}

.btn-submit-gold {
    width: 100%;
    background: linear-gradient(180deg, #fce570 0%, #fccb35 100%);
    color: var(--text-black);
    font-weight: 900;
    font-size: 1.4rem;
    letter-spacing: 1px;
    border-radius: 0.8rem;
    border-bottom: 6px solid #b8860b;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.btn-submit-gold:active {
    transform: translateY(3px);
    border-bottom-width: 3px;
}

/* ═══════════════════════════════════════════════════════
   TOAST / UTILS
   ═══════════════════════════════════════════════════════ */
.toast {
    position: fixed;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    padding: 1rem 2rem;
    border-radius: 2rem;
    color: white;
    font-weight: 800;
    z-index: 1000;
    transition: opacity 0.3s;
}

.hidden { display: none !important; }
.hidden-btn { display: none; }

/* ── Lobby Screen Validation ─────────────────────────── */
.lobby-card {
    background: linear-gradient(135deg, #0d47a1 0%, #061c4d 100%);
    border: 4px solid #4eb9f1;
    border-radius: 2rem;
    padding: 2.5rem;
    box-shadow: 0 0 40px rgba(0,0,0,0.8), inset 0 0 20px rgba(0,0,0,0.5);
    text-align: center;
    width: 90%;
    max-width: 400px;
    margin: 0 auto;
}

.lobby-card h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #fff;
    text-shadow: 0 4px 0 rgba(0,0,0,0.5);
}

.join-input-group {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 3px solid #2bb8e6;
    border-radius: 1rem;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}

.join-input-group input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    text-align: center;
    letter-spacing: 1px;
    outline: none;
    min-width: 0;
}

.join-input-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.join-input-group button.btn-icon {
    font-size: 1.5rem;
    padding: 0.2rem;
    opacity: 0.8;
}

.join-input-group button.btn-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

.join-error-text {
    color: #ff5252;
    font-weight: 800;
    margin-top: 1rem;
    font-size: 0.95rem;
    background: rgba(255, 82, 82, 0.15);
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 82, 82, 0.5);
}

/* ── Results Screen Refinement ────────────────────────── */
.results-card {
    background: linear-gradient(135deg, #103e8c 0%, #061c4d 100%) !important;
    border: 6px solid #4eb9f1 !important;
    border-radius: 2.5rem !important;
    padding: 2rem !important;
    box-shadow: 0 0 50px rgba(49, 215, 255, 0.6), 0 10px 40px rgba(0,0,0,0.6) !important;
    text-align: center;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
}

#result-status {
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: 1rem;
    text-shadow: 0 4px 0 rgba(0,0,0,0.5), 0 0 20px rgba(49, 215, 255, 0.5);
    color: #fff;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex: 1;
    min-height: 0;
}

.player-results, .opponent-results {
    background: rgba(13, 45, 94, 0.6) !important;
    border: 3px solid #2bb8e6 !important;
    border-radius: 1.5rem !important;
    padding: 1rem 0.5rem !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-height: 0;
    transition: all 0.3s ease;
}

.player-results.winner, .opponent-results.winner {
    border-color: var(--gold) !important;
    box-shadow: 0 0 20px rgba(252, 203, 53, 0.4);
    transform: scale(1.02);
}

.player-results.winner::before, .opponent-results.winner::before {
    content: 'WINNER';
    position: absolute;
    top: -12px;
    background: var(--gold);
    color: #000;
    font-weight: 900;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.7rem;
    letter-spacing: 1px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.player-results.loser, .opponent-results.loser {
    opacity: 0.7;
    filter: grayscale(0.4);
}

.opponent-results {
    border-color: #e74c3c !important;
}

.player-results ul, .opponent-results ul {
    list-style: none !important;
    list-style-type: none !important;
    width: 100%;
    overflow-y: auto;
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    padding: 0.75rem !important;
    background: rgba(0, 0, 0, 0.4) !important;
    border-radius: 1rem;
    flex: 1;
    margin: 0 !important;
}

.player-results ul li, .opponent-results ul li {
    display: block !important;
    background: linear-gradient(180deg, rgba(49, 215, 255, 0.3) 0%, rgba(49, 215, 255, 0.1) 100%) !important;
    border: 2px solid rgba(49, 215, 255, 0.5) !important;
    border-radius: 0.6rem !important;
    padding: 0.5rem !important;
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    color: #fff !important;
    text-align: center;
}

.opponent-results ul li {
    background: linear-gradient(180deg, rgba(231, 76, 60, 0.3) 0%, rgba(231, 76, 60, 0.1) 100%) !important;
    border-color: rgba(231, 76, 60, 0.5) !important;
}

/* Force Gold Button */
.btn-submit-gold {
    background: linear-gradient(180deg, #fce570 0%, #fccb35 100%) !important;
    color: #000 !important;
    border: none !important;
    border-bottom: 6px solid #b8860b !important;
}

.rematch-status {
    font-size: 0.9rem;
    font-weight: 800;
    color: #4eb9f1;
}

/* ── Floating Avatar Circle ─────────────────────────── */
/* ── Settings Controls ────────────────────────────────── */
.settings-btn {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    width: 50px;
    height: 50px;
    background: rgba(13, 45, 94, 0.6);
    border: 3px solid #4eb9f1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: all 0.2s;
    padding: 0;
}

.settings-btn:hover {
    transform: rotate(45deg);
    background: rgba(43, 184, 230, 0.3);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
    padding: 1rem;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalSlideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.settings-card {
    background: rgba(10, 15, 30, 0.98) !important;
    border: 3px solid #4eb9f1 !important;
    padding: 2.5rem 2rem 2rem !important;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(78, 185, 241, 0.3);
    border-radius: 2rem !important;
}

.settings-card h2 {
    margin-bottom: 2rem;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(252, 203, 53, 0.5);
    font-size: 2rem;
}

.settings-list {
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.setting-item, .setting-item-col {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.8rem 1.2rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.setting-item label {
    font-weight: 800;
    color: #4eb9f1;
    font-size: 1.1rem;
}

/* Toggle Switch Styling */
.toggle-wrapper {
    position: relative;
    width: 60px;
    height: 30px;
}

.toggle-wrapper input {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    height: 100%;
    width: 60px; /* match wrapper width */
    z-index: 10; /* high z-index to catch clicks */
    margin: 0;
}

.toggle-switch {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #37474f;
    transition: .4s;
    border-radius: 30px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

input:checked + .toggle-switch .toggle-slider {
    background: linear-gradient(180deg, #3eb9ff 0%, #1e88e5 100%);
}

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

/* Volume Slider Styling */
.volume-control {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex: 1;
    margin-left: 2rem;
    justify-content: flex-end;
}

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

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #37474f;
    border-radius: 5px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--gold);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    border: 2px solid #fff;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--gold);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
}

.floating-avatar-circle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 60px;
    height: 60px;
    background: linear-gradient(180deg, #81d4fa 0%, #0277bd 100%);
    border: 3px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4), 0 0 20px rgba(49, 215, 255, 0.4);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-bottom: 4px solid #01579b;
}

.floating-avatar-circle:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 30px rgba(49, 215, 255, 0.6);
}

.floating-avatar-circle:active {
    transform: scale(0.95);
    border-bottom-width: 2px;
}

#menu-avatar-icon {
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.3));
}

/* Shake Animation for Incorrect Answers */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
    border-color: #e74c3c !important;
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.5) !important;
}

/* ── Responsive Height Adjustments ───────────────────── */
@media (max-height: 700px) {
    #app {
        padding: 0.5rem;
    }
    .scores-row-new {
        margin-bottom: 0.5rem;
    }
    .prompt-container-new {
        padding: 0.5rem 1rem;
    }
    .prompt-container-new h2 {
        font-size: 1.1rem;
    }
    .slot-num-box {
        font-size: 1.2rem;
    }
    .slot-text, .slot-score {
        font-size: 1rem;
    }
    .game-controls-new {
        margin-top: 0.5rem;
    }
    .input-container-new input {
        padding: 0.75rem;
    }
    .btn-submit-gold {
        font-size: 1.2rem;
        padding: 1rem;
    }
}

/* ── Countdown Overlay ────────────────────────────────── */
.countdown-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    z-index: 1000;
    font-size: 6rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 30px rgba(49, 215, 255, 0.8), 0 5px 15px rgba(0,0,0,0.5);
    pointer-events: none;
    animation: countdownPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    letter-spacing: -2px;
}

.countdown-overlay.go {
    color: var(--gold);
    text-shadow: 0 0 40px rgba(252, 203, 53, 0.8), 0 5px 15px rgba(0,0,0,0.5);
    font-size: 8rem;
}

@keyframes countdownPop {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ── Avatar Selection Screen ──────────────────────────── */
#avatar-screen {
    background: radial-gradient(circle at center, #0d2d5e 0%, #050a18 100%);
    padding: 2rem 1rem;
    position: relative;
    z-index: 10;
    flex-direction: column;
    align-items: center;
}
#avatar-screen.active {
    display: flex;
}

.avatar-header {
    margin-bottom: 1.5rem;
    padding: 0 1rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.avatar-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(252, 203, 53, 0.4), 0 4px 10px rgba(0,0,0,0.5);
    margin: 0;
    letter-spacing: 0.5px;
    padding: 0 0.5rem;
    white-space: nowrap;
    line-height: 1.2;
}

.header-spacer {
    width: 28px; /* Same as back arrow width */
}

.btn-back-arrow {
    flex-shrink: 0;
    background: #fff !important;
    border: none !important;
    color: #000;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.btn-back-arrow:hover {
    transform: scale(1.1);
    background: var(--gold) !important;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    justify-content: center;
    align-content: flex-start;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.avatar-option {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 10px;
    position: relative;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.avatar-delete-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 900;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
    transition: transform 0.2s;
    z-index: 5;
    line-height: 1;
}

.avatar-delete-badge:hover {
    transform: scale(1.2);
    background: #ff0000;
}

.avatar-option:hover {
    transform: scale(1.1) translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--blue-glow);
    box-shadow: 0 0 25px rgba(49, 215, 255, 0.3);
}

.avatar-option.selected {
    background: rgba(252, 203, 53, 0.1);
    border: 3px solid var(--gold);
    box-shadow: 0 0 30px rgba(252, 203, 53, 0.5), inset 0 0 15px rgba(252, 203, 53, 0.2);
    transform: scale(1.08);
}

.avatar-option img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.3));
}

.avatar-img-fit {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ── Unlocking System ──────────────────────────── */
.points-badge {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
    padding: 0.5rem 1.2rem;
    border-radius: 2rem;
    font-weight: 900;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    letter-spacing: 1px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.avatar-option.locked {
    cursor: not-allowed;
    filter: grayscale(1) brightness(0.7);
    opacity: 0.6;
}

.avatar-option.locked:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.1);
}

.lock-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: none;
    z-index: 2;
}

.lock-overlay svg {
    width: 24px;
    height: 24px;
    color: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.lock-overlay span {
    font-size: 10px;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    background: rgba(0, 0, 0, 0.5);
    padding: 1px 6px;
    border-radius: 10px;
}

.earned-points-badge {
    background: var(--gold);
    color: #000;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-weight: 900;
    font-size: 0.8rem;
    margin: 0.5rem auto;
    width: fit-content;
    box-shadow: 0 0 15px rgba(252, 203, 53, 0.4);
    animation: pointsPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes pointsPop {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (max-width: 400px) {
    .avatar-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
