/* ================= CUSTOM VARIABLES & THEME ================= */
:root {
    --bg-dark: #0a0a0e;
    --bg-dark-accent: #111116;
    --red-brand: #e50914;
    --red-hover: #f6121d;
    --gold-brand: #f5c518;
    --gold-glow: rgba(245, 197, 24, 0.35);
    --glass-bg: rgba(18, 18, 24, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-focus: rgba(229, 9, 20, 0.5);
    
    --text-primary: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.55);
    --text-dim: rgba(255, 255, 255, 0.35);
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    --font-sans: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

/* ================= RESET & GENERAL STYLE ================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

button, input {
    font-family: inherit;
    color: inherit;
}

/* Utilities */
.hidden {
    display: none !important;
}

.font-bold {
    font-weight: 700;
}

.text-gold {
    color: var(--gold-brand) !important;
}

.max-width-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Icons styling */
svg {
    stroke-width: 2px;
}

.gold-icon {
    color: var(--gold-brand);
}

.accent-red {
    color: var(--red-brand);
}

/* ================= SCREENS SWITCHING ================= */
#app-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    padding: 2rem 1rem 1.5rem; /* Reduced padding to eliminate space wastage and keep layout above fold */
    opacity: 0;
    pointer-events: none;
    transform: translateY(15px);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center; /* Center horizontally for compact layout */
}

.screen.active {
    position: relative;
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
    z-index: 2;
}

/* ================= ANIMATIONS ================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(229, 9, 20, 0.4);
    }
    50% {
        box-shadow: 0 0 25px rgba(229, 9, 20, 0.7);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

@keyframes bounceIn {
    0% { transform: scale(0.95); opacity: 0; }
    70% { transform: scale(1.02); opacity: 0.9; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.anim-fade-up {
    animation: fadeInUp var(--transition-normal) forwards;
}

.anim-pulse-glow {
    animation: pulseGlow 2.5s infinite;
}

.anim-shake {
    animation: shake 0.4s ease-in-out;
}

.anim-bounce-in {
    animation: bounceIn var(--transition-normal) forwards;
}

/* ================= PREMIUM GLASSMORPHISM CARDS ================= */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.glow-primary:hover {
    border-color: rgba(229, 9, 20, 0.25);
    box-shadow: 0 25px 50px rgba(229, 9, 20, 0.15), 0 20px 40px rgba(0,0,0,0.5);
}

.glow-gold {
    box-shadow: 0 0 15px var(--gold-glow);
    border-color: rgba(245, 197, 24, 0.4) !important;
}

/* ================= BUTTONS & FORMS ================= */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-weight: 700;
    border-radius: 50px;
    padding: 1rem 2rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--red-brand);
    color: var(--text-primary);
}

.btn-primary:hover {
    background-color: var(--red-hover);
    transform: translateY(-2px) scale(1.02);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}

.btn-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.full-width {
    width: 100%;
}

/* Form Groups */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.input-wrapper input {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 1.1rem 1.1rem 1.1rem 3.2rem;
    font-size: 1.05rem;
    transition: all var(--transition-fast);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--red-brand);
    background-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.2);
}

.input-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    transition: color var(--transition-fast);
}

.input-wrapper input:focus + .input-icon {
    color: var(--red-brand);
}

.password-toggle-btn {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color var(--transition-fast);
    z-index: 10;
}

.password-toggle-btn:hover {
    color: var(--gold-brand);
}

.password-toggle-btn svg {
    width: 18px;
    height: 18px;
}

/* Hide native Edge / IE password reveal button */
input::-ms-reveal,
input::-ms-clear {
    display: none;
}

/* ================= LOBBY SPECIFICS ================= */
#lobby-screen {
    position: relative;
    overflow: hidden;
}

.hero-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(ellipse at top, rgba(229, 9, 20, 0.12) 0%, rgba(10, 10, 14, 0.95) 75%);
    z-index: -1;
    pointer-events: none;
}

.lobby-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.5rem 1.25rem;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 700px;
    margin-bottom: 3.5rem;
}

/* Lobby Grid */
.grid-lobby {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    width: 100%;
    text-align: left;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 2rem;
}

/* Selection Buttons Grid */
.category-grid, .difficulty-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.category-grid {
    grid-template-columns: 1fr 1.1fr 1.1fr; /* Custom split for lengths */
}

.format-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.btn-select {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.8rem 0.5rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
    transition: all var(--transition-fast);
}

.btn-select-text {
    display: flex;
    flex-direction: column;
}

.btn-emoji {
    font-size: 1.4rem;
}

.btn-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.btn-sub {
    font-size: 0.65rem;
    color: var(--text-dim);
    font-weight: 400;
    margin-top: 0.15rem;
}

.btn-select:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.btn-select.active {
    background-color: rgba(229, 9, 20, 0.15);
    border-color: var(--red-brand);
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.2);
}

.btn-select.active .btn-sub {
    color: var(--text-muted);
}

/* Preview Card Details */
.preview-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.window-dots {
    display: flex;
    gap: 0.4rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.red-dot { background-color: var(--red-brand); }
.gold-dot { background-color: var(--gold-brand); }
.green-dot { background-color: #10b981; }

.preview-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.preview-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 14px;
    overflow: hidden;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 40px rgba(0,0,0,0.8);
    background-size: cover;
    background-position: center;
    transition: background-image 0.5s ease-in-out;
}

.media-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 60%, rgba(0,0,0,0.1) 100%);
    z-index: 1;
}

.preview-quote-box {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    right: 1rem;
    z-index: 2;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    max-width: 80%;
}

.quote-icon {
    width: 1rem;
    height: 1rem;
    color: var(--gold-brand);
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.quote-text {
    font-size: 0.8rem;
    font-style: italic;
    line-height: 1.4;
    color: var(--text-primary);
}

.media-round-badge {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    z-index: 2;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--gold-brand);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.preview-input-container {
    margin-top: 1.5rem;
}

.mock-input {
    width: 100%;
    background-color: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.9rem 1.2rem;
    font-size: 0.85rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.mock-icon {
    width: 1.1rem;
    height: 1.1rem;
}

.preview-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.meta-tag {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.meta-tag svg {
    width: 1rem;
    height: 1rem;
    color: var(--gold-brand);
}

/* ================= PLAY SCREEN SPECIFICS ================= */
.game-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 800px;
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.game-tag {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.4rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.game-tag.accent-red {
    background: rgba(229, 9, 20, 0.1);
    border-color: rgba(229, 9, 20, 0.25);
    color: #ff7178;
}

.score-badge {
    background: rgba(245, 197, 24, 0.1);
    border: 1px solid rgba(245, 197, 24, 0.35);
    border-radius: 50px;
    padding: 0.45rem 1.2rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gold-brand);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-card {
    padding: 0;
    overflow: hidden;
}

/* Media Display area */
.media-display-area {
    position: relative;
    width: 100%;
    height: clamp(320px, 55vh, 500px); /* Massive premium height that scales beautifully up to 500px tall! */
    background-color: #020204;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.media-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
}

#media-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Guarantee 100% of the widescreen illustration is visible with ZERO cropping! */
    background-color: #020204; /* Premium solid cinema-black padding bars */
    display: block;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 100%);
}

#media-quote-wrapper, #media-scene-wrapper {
    flex-direction: column;
    padding: 2rem 2.5rem;
    text-align: center;
    width: calc(100% - 4rem);
    max-width: 580px;
    height: auto;
    max-height: calc(100% - 3rem);
    background: rgba(10, 10, 15, 0.78); /* Sleek dark translucent glass */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    margin: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-sizing: border-box;
}

.quote-icon-large, .scene-icon-large {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--gold-brand);
    opacity: 0.4;
    margin-bottom: 1.25rem;
}

.game-dialogue {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 700;
    font-style: italic;
    line-height: 1.4;
    color: var(--text-primary);
}

.game-scene-text {
    font-family: var(--font-sans);
    font-size: 1.15rem; /* Slightly smaller for descriptive paragraphs */
    font-weight: 500;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    max-width: 550px;
}

/* Film strip graphics decoration */
.film-strip {
    position: absolute;
    left: 0;
    right: 0;
    height: 12px;
    z-index: 3;
    opacity: 0.15;
    background-image: radial-gradient(circle, var(--text-primary) 3px, transparent 4px);
    background-size: 18px 12px;
}

.top-strip {
    top: 6px;
}

.bottom-strip {
    bottom: 6px;
}

/* Loading States for Scene */
.media-loading-wrapper {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 4;
}

.spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid rgba(229, 9, 20, 0.2);
    border-top: 3px solid var(--red-brand);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
}

.sparkle-loader {
    width: 1.25rem;
    height: 1.25rem;
    animation: spin 3s linear infinite;
}

/* Interactive Controls */
.game-controls {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background-color: var(--bg-dark-accent);
}

.relative-container {
    position: relative;
    width: 100%;
}

.input-large input {
    padding: 1.25rem 1.25rem 1.25rem 3.5rem !important;
    font-size: 1.15rem !important;
    border-radius: 16px !important;
    background-color: rgba(255,255,255,0.02) !important;
}

.input-large .input-icon {
    left: 1.35rem;
    width: 1.35rem;
    height: 1.35rem;
}

/* Keyboard navigable suggestions box */
.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background-color: #0c0c10;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.8);
    overflow: hidden;
    z-index: 10;
    max-height: 250px;
    overflow-y: auto;
}

.suggestion-item {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-icon {
    width: 1rem;
    height: 1rem;
    color: var(--text-dim);
}

.suggestion-item:hover, .suggestion-item.active {
    background-color: rgba(229, 9, 20, 0.15);
    color: var(--text-primary);
}

.suggestion-item.active .suggestion-icon {
    color: var(--red-brand);
}

/* Buttons actions alignment */
.buttons-grid {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.buttons-grid button {
    flex: 1;
}

/* Hints container */
.hint-box {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    background: rgba(245, 197, 24, 0.08);
    border: 1px solid rgba(245, 197, 24, 0.25);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-top: 0.5rem;
}

.hint-box svg {
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.15rem;
}

.hint-text {
    font-size: 0.9rem;
    color: rgba(245, 197, 24, 0.9);
}

/* Feedback response box */
.feedback-box {
    padding: 1.25rem;
    border-radius: 14px;
    border: 1px solid transparent;
    margin-top: 1.5rem;
}

.feedback-box.correct {
    background-color: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.35);
    animation: bounceIn var(--transition-normal) forwards;
}

.feedback-box.wrong {
    background-color: rgba(229, 9, 20, 0.08);
    border-color: rgba(229, 9, 20, 0.35);
    animation: shake 0.4s ease-in-out;
}

.feedback-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.feedback-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.feedback-status svg {
    width: 1.4rem;
    height: 1.4rem;
}

.correct .correct-icon {
    display: inline-block;
    color: #34d399;
}

.correct .feedback-points {
    color: #34d399;
}

.wrong .wrong-icon {
    display: inline-block;
    color: #f87171;
}

.wrong .feedback-points {
    color: #f87171;
}

.feedback-movie {
    color: var(--text-muted);
}

/* ================= RESULT SCREEN SPECIFICS ================= */
.result-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
}

.result-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.trophy-wrapper {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-color: rgba(245, 197, 24, 0.08);
    border: 1px solid rgba(245, 197, 24, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    box-shadow: 0 0 20px var(--gold-glow);
}

.large-trophy {
    width: 45px;
    height: 45px;
    color: var(--gold-brand);
}

.result-headline {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.result-text {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.result-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    width: 100%;
    margin-bottom: 2.5rem;
}

.metric-box {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.metric-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: 900;
    font-family: var(--font-heading);
}

/* Leaderboard Details */
.leaderboard-section {
    width: 100%;
    margin-bottom: 2.5rem;
    text-align: left;
}

.leaderboard-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.leaderboard-wrapper {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
}

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

.leaderboard-table th, .leaderboard-table td {
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
}

.leaderboard-table th {
    background-color: rgba(255,255,255,0.02);
    text-align: left;
    font-weight: 700;
    color: var(--text-dim);
    border-bottom: 1px solid var(--glass-border);
}

.leaderboard-table td {
    border-bottom: 1px solid rgba(255,255,255,0.02);
    color: var(--text-muted);
}

.leaderboard-table tr:last-child td {
    border-bottom: none;
}

.leaderboard-table tr.highlight td {
    background-color: rgba(229, 9, 20, 0.05);
    color: var(--text-primary);
    font-weight: 600;
}

/* ================= RESPONSIVE DESIGN ================= */
@media (max-width: 900px) {
    .grid-lobby {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 600px) {
    .screen {
        padding-top: 4rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .category-grid, .difficulty-grid {
        grid-template-columns: 1fr;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .buttons-grid {
        flex-direction: column;
    }
    
    .glass-card {
        padding: 1.5rem;
    }
    
    .game-dialogue {
        font-size: 1.35rem;
    }

    /* Intro Curtain Stage Word Responsive fixes */
    #stage-intro-overlay {
        --spotlight-x: 50% !important;
        --spotlight-y: 50% !important;
    }
    .stage-word {
        font-size: 2.2rem;
        letter-spacing: 0.12em;
        text-indent: 0.12em;
    }
    .stage-word-lights {
        left: 50% !important;
        top: 35% !important;
    }
    .stage-word-camera {
        left: 50% !important;
        top: 50% !important;
    }
    .stage-word-guess {
        left: 50% !important;
        top: 65% !important;
        font-size: 3.2rem;
    }

    /* Game Screen Menu Container Overlap Fix */
    #game-screen .menu-container {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        z-index: 100 !important;
    }
}

/* ================= PERSISTENT LOGIN (WELCOME BACK) ================= */
.welcome-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.75rem;
}

.welcome-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.welcome-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(245, 197, 24, 0.08);
    border: 1px solid rgba(245, 197, 24, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-avatar svg {
    width: 20px;
    height: 20px;
}

.welcome-info {
    display: flex;
    flex-direction: column;
}

.welcome-title {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.welcome-name {
    font-size: 1.1rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--text-primary);
}

.btn-logout {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dim);
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.btn-logout:hover {
    color: var(--red-brand);
    transform: scale(1.03);
}

/* ================= PLAY MODE SPECIFICS ================= */
.mode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* ================= VERSUS AI MULTIPLAYER SPECIFICS ================= */
.versus-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem;
    background: rgba(18, 18, 24, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.versus-player {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.player-user {
    justify-content: flex-start;
}

.player-opponent {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

.player-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.user-avatar {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.opponent-avatar {
    background: rgba(245, 197, 24, 0.08);
    border: 1px solid rgba(245, 197, 24, 0.25);
}

.player-meta {
    display: flex;
    flex-direction: column;
}

.player-user .player-meta {
    align-items: flex-start;
}

.player-opponent .player-meta {
    align-items: flex-end;
}

.player-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.player-score {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--gold-brand);
}

.versus-middle-area {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 1rem;
    min-width: 80px;
}

.versus-middle-area .versus-divider {
    margin: 0 !important;
}

.versus-middle-area .timer-badge {
    margin-right: 0 !important;
    background: rgba(18, 18, 24, 0.85) !important;
    border: 2px solid var(--gold-brand) !important;
    box-shadow: 0 0 15px rgba(245, 197, 24, 0.35) !important;
    color: var(--text-primary) !important;
    padding: 0.5rem 1.25rem !important;
    border-radius: 50px !important;
    font-family: var(--font-heading) !important;
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 0.6rem !important;
    transition: all 0.3s ease !important;
}

.versus-middle-area .timer-badge .timer-icon {
    width: 1.2rem !important;
    height: 1.2rem !important;
    color: var(--gold-brand) !important;
    filter: drop-shadow(0 0 4px rgba(245, 197, 24, 0.5));
}

.versus-middle-area .timer-badge.warning {
    border-color: var(--red-brand) !important;
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.65) !important;
    color: #ffb3b3 !important;
    animation: warningPulse 1s infinite alternate !important;
}

.versus-middle-area .timer-badge.warning .timer-icon {
    color: var(--red-brand) !important;
    filter: drop-shadow(0 0 6px rgba(229, 9, 20, 0.8)) !important;
}

@keyframes warningPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.06); }
}

.versus-divider {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(229, 9, 20, 0.15);
    border: 1px solid rgba(229, 9, 20, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 900;
    color: var(--red-brand);
    letter-spacing: 0.05em;
    margin: 0 1rem;
}

/* Opponent Typing indicators */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 0.5rem;
}

.typing-indicator span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--gold-brand);
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.3); opacity: 0.4; }
    40% { transform: scale(1.1); opacity: 1; }
}

/* ================= 15s COUNTDOWN TIMER ================= */
.timer-badge {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.45rem 1.2rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 0.5rem;
    transition: all var(--transition-fast);
}

.timer-badge.warning {
    color: var(--red-brand) !important;
    border-color: rgba(229, 9, 20, 0.35) !important;
    box-shadow: 0 0 12px rgba(229, 9, 20, 0.25) !important;
    animation: pulseGlow 1s infinite !important;
}

.timer-icon {
    width: 1rem;
    height: 1rem;
}

.timer-badge.warning .timer-icon {
    color: var(--red-brand) !important;
}

/* Spin the clock hands dynamically! */
.timer-icon svg line,
.timer-icon svg polyline,
.timer-icon line,
.timer-icon polyline {
    transform-origin: 12px 12px !important;
    transform-box: fill-box !important;
    animation: rotateClockHand 4s linear infinite;
}

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

/* Warning state spins 4x faster and glows intensely! */
.timer-badge.warning .timer-icon polyline,
.timer-badge.warning .timer-icon line {
    animation: rotateClockHand 0.8s linear infinite !important;
}

/* Tick Pop heartbeat animation */
.tick-pulse {
    display: inline-block;
    animation: tickPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes tickPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); text-shadow: 0 0 8px currentColor; }
    100% { transform: scale(1); }
}


/* ================= AUTHENTICATION PORTAL SPECIFICS ================= */
.auth-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-align: center;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.auth-card {
    width: 100%;
    margin-top: 1.5rem;
    padding: 2.2rem !important;
}

.auth-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.05rem;
    font-weight: 700;
    font-family: var(--font-heading);
    cursor: pointer;
    padding: 0.5rem 1rem;
    position: relative;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--gold-brand);
}

.tab-btn.active::after {
    content: "";
    position: absolute;
    bottom: -9px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gold-brand);
    border-radius: 4px;
    box-shadow: 0 0 10px var(--gold-glow);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: left;
}

.gender-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.gender-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.75rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-fast);
}

.gender-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.gender-btn.active {
    background: rgba(245, 197, 24, 0.1);
    border-color: rgba(245, 197, 24, 0.4);
    color: var(--gold-brand);
    box-shadow: 0 0 15px rgba(245, 197, 24, 0.15);
}

/* ================= SUPERADMIN PORTAL SPECIFICS ================= */
.admin-table {
    width: 100%;
    margin-top: 1rem;
}

.admin-table th, .admin-table td {
    padding: 0.9rem 1rem !important;
    vertical-align: middle;
}

.admin-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background-color var(--transition-fast);
}

.admin-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
}

.badge-gender-male {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #38bdf8;
}

.badge-gender-female {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.25);
    color: #f43f5e;
}

.badge-gender-other {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.25);
    color: #a855f7;
}

.badge-role-admin {
    background: rgba(245, 197, 24, 0.12);
    border: 1px solid rgba(245, 197, 24, 0.4);
    color: var(--gold-brand);
    box-shadow: 0 0 10px rgba(245, 197, 24, 0.1);
}

.badge-role-user {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ccc;
}

.badge-role-guest {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

.admin-profile-name {
    font-weight: 700;
    color: #fff;
    font-size: 0.9rem;
}

.admin-profile-email {
    font-size: 0.75rem;
    color: #888;
}

#admin-search-users:focus {
    border-color: rgba(245, 197, 24, 0.5) !important;
    box-shadow: 0 0 10px rgba(245, 197, 24, 0.15) !important;
}

/* Fix grid responsive gap */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .admin-profile-badge {
        text-align: left !important;
        width: 100%;
    }
    
    .admin-profile-badge div {
        justify-content: flex-start !important;
    }
}

/* ================= CINEMATIC THEATER CURTAIN INTRO STAGE ================= */
#stage-intro-overlay {
    --spotlight-x: -20%;
    --spotlight-y: 30%;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #020103;
    z-index: 99999;
    overflow: hidden;
    transition: opacity 1.2s cubic-bezier(0.77, 0, 0.175, 1), 
                filter 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

#stage-intro-overlay.dissolve {
    opacity: 0;
    filter: blur(15px);
    pointer-events: none;
}

/* Shadow Vignette Mask Overlay */
.stage-spotlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(
        circle 220px at var(--spotlight-x) var(--spotlight-y),
        transparent 0%,
        rgba(0, 0, 0, 0.96) 80%
    );
    pointer-events: none;
    z-index: 15;
    transition: opacity 1.2s ease;
}

/* Volumetric Gold Lighting Beam Overlay */
.stage-spotlight-beam {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(
        circle 220px at var(--spotlight-x) var(--spotlight-y),
        rgba(255, 235, 170, 0.35) 0%,
        rgba(255, 195, 80, 0.08) 55%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 16;
    mix-blend-mode: screen;
    transition: opacity 1.2s ease;
}

/* Retro Blinking Recording Indicator */
.camera-rec-container {
    position: absolute;
    top: 2.5rem;
    left: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #fff;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.camera-rec-container.active {
    opacity: 1;
}

.rec-dot {
    width: 10px;
    height: 10px;
    background-color: #ff0000;
    border-radius: 50%;
    box-shadow: 0 0 10px #ff0000;
    animation: blinkRec 1s infinite steps(2, start);
}

@keyframes blinkRec {
    to { opacity: 0; }
}

/* Velvet Stage Curtains */
.curtain-half {
    position: absolute;
    top: 0;
    width: 50vw;
    height: 100vh;
    background: repeating-linear-gradient(
        to right,
        #120001 0%,
        #240102 8%,
        #4f0307 18%,
        #82070e 28%,
        #bd101a 38%,
        #82070e 48%,
        #4f0307 58%,
        #240102 68%,
        #120001 75%
    );
    background-size: 14vw 100%;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.85);
    transition: transform 2.2s cubic-bezier(0.77, 0, 0.175, 1), filter 2.2s ease;
    z-index: 10;
}

.curtain-left {
    left: 0;
    transform-origin: left center;
    box-shadow: inset -20px 0 40px rgba(0,0,0,0.65), inset 0 0 100px rgba(0,0,0,0.85);
    border-right: 1px solid rgba(0, 0, 0, 0.5);
}

.curtain-right {
    right: 0;
    transform-origin: right center;
    box-shadow: inset 20px 0 40px rgba(0,0,0,0.65), inset 0 0 100px rgba(0,0,0,0.85);
    border-left: 1px solid rgba(0, 0, 0, 0.5);
}

#stage-intro-overlay.drawn-back .curtain-left {
    transform: translateX(-92%) scaleX(0.2);
    filter: brightness(0.25) contrast(1.1);
}

#stage-intro-overlay.drawn-back .curtain-right {
    transform: translateX(92%) scaleX(0.2);
    filter: brightness(0.25) contrast(1.1);
}

/* Theatrical Word Emblems on the Curtain */
.stage-word {
    position: absolute;
    transform: translate(-50%, -50%) scale(0.95);
    font-family: var(--font-heading);
    font-size: 4rem; /* Highly visual stage size */
    font-weight: 900;
    letter-spacing: 0.25em;
    text-indent: 0.25em;
    color: #fff;
    text-shadow: 0 0 15px rgba(0,0,0,0.95);
    z-index: 18;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                filter 0.8s ease;
    pointer-events: none;
}

/* Individual Coordinates matching spotlight sweep */
.stage-word-lights {
    left: 25%;
    top: 45%;
}

.stage-word-camera {
    left: 75%;
    top: 55%;
}

.stage-word-guess {
    left: 50%;
    top: 50%;
    font-size: 5.5rem; /* Large Climax Word! */
}

/* Color Neon Shadow Illuminations */
.stage-word-lights.illuminated {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
    color: #fff;
    text-shadow: 
        0 0 12px rgba(245, 197, 24, 0.45),
        0 0 28px rgba(245, 197, 24, 0.75),
        0 0 55px rgba(245, 197, 24, 0.95);
}

.stage-word-camera.illuminated {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
    color: #fff;
    text-shadow: 
        0 0 12px rgba(229, 9, 20, 0.45),
        0 0 28px rgba(229, 9, 20, 0.75),
        0 0 55px rgba(229, 9, 20, 0.95);
}

.stage-word-guess.illuminated {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
    color: var(--gold-brand);
    text-shadow: 
        0 0 15px rgba(245, 197, 24, 0.5),
        0 0 35px rgba(245, 197, 24, 0.8),
        0 0 65px rgba(245, 197, 24, 0.98),
        0 0 100px rgba(229, 9, 20, 0.88);
}

/* Curtain Split Dissolves */
#stage-intro-overlay.drawn-back .stage-word {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7) rotate(-4deg);
    filter: blur(10px);
    transition: opacity 1.2s ease, transform 1.2s ease, filter 1.2s ease;
}

/* Skip button on the stage */
.btn-skip-intro {
    position: absolute;
    bottom: 2.5rem;
    right: 2.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 0.55rem 1.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 25;
    transition: all var(--transition-fast);
}

.btn-skip-intro:hover {
    background: rgba(229, 9, 20, 0.15);
    border-color: rgba(229, 9, 20, 0.5);
    color: #fff;
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.35);
    transform: translateY(-1px);
}


/* ================= LOBBY SPACING COMPACTNESS OVERRIDES ================= */
.lobby-hero-compact {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0.25rem 0 1rem 0; /* Extremely tight margins to avoid scrolling completely */
    padding: 0.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.lobby-hero-compact .brand-badge {
    margin-bottom: 0 !important;
    padding: 0.35rem 0.8rem !important;
    font-size: 0.65rem !important;
}

.lobby-hero-compact .hero-title {
    font-size: 1.4rem !important;
    margin-bottom: 0 !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: -0.01em;
}

.lobby-hero-compact .hero-subtitle {
    font-size: 0.8rem !important;
    margin-bottom: 0 !important;
    color: var(--text-dim) !important;
    max-width: fit-content !important;
    text-align: right;
}

/* Adjust lobby section screen padding to ensure full fold is above fold */
#lobby-screen.screen {
    padding: 0.75rem 1rem 0.75rem !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.lobby-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}


/* ================= GAME CONFIGURATION PANEL ================= */
.config-card {
    max-width: 700px;
    width: 100%;
    position: relative;
    overflow: hidden;
    border-color: rgba(229, 9, 20, 0.3) !important;
    box-shadow: 0 25px 60px rgba(229, 9, 20, 0.1), 0 20px 40px rgba(0,0,0,0.6) !important;
}

.config-card form {
    opacity: 1;
}

/* ================= GAME SCREEN MENU & CONTROLLER ================= */
.menu-container {
    position: relative;
    display: inline-block;
}

.btn-menu {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.btn-menu:hover {
    background: rgba(229, 9, 20, 0.15);
    border-color: var(--red-brand);
    color: #fff;
    transform: scale(1.05);
}

.menu-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    width: 240px;
    background: rgba(12, 12, 16, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    padding: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transform-origin: top left;
    animation: dropdownOpen 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes dropdownOpen {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.menu-header {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
    padding-left: 0.25rem;
}

.menu-item {
    width: 100%;
    background: none;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-fast);
}

.menu-item:hover {
    background: rgba(229, 9, 20, 0.15);
    color: #fff;
}

.menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0.25rem 0;
}

.menu-control-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0.5rem;
}

.control-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.control-label svg {
    width: 14px;
    height: 14px;
}

/* Custom CSS Toggle Switch */
.toggle-switch {
    position: relative;
    width: 40px;
    height: 20px;
}

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

.toggle-switch label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.1);
    transition: .3s;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.05);
}

.toggle-switch label:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: #888;
    transition: .3s;
    border-radius: 50%;
}

.toggle-switch input:checked + label {
    background-color: rgba(229, 9, 20, 0.25);
    border-color: var(--red-brand);
}

.toggle-switch input:checked + label:before {
    transform: translateX(20px);
    background-color: var(--red-brand);
    box-shadow: 0 0 8px rgba(229, 9, 20, 0.6);
}

/* Volume Slider styling */
.volume-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.5rem 0.25rem 0.5rem;
}

.volume-slider {
    flex: 1;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.1);
    height: 4px;
    border-radius: 5px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gold-brand);
    cursor: pointer;
    box-shadow: 0 0 6px rgba(245, 197, 24, 0.8);
    transition: transform 0.1s;
}

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

.volume-val {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gold-brand);
    min-width: 32px;
    text-align: right;
}

/* ================= GAME SCREEN VIEWPORT COMPACTNESS ================= */
#game-screen.screen {
    padding: 2rem 1rem !important;
    align-items: center !important; /* Center card vertically to fill screen majestically! */
}

/* Float the options menu button absolutely at the left-most upper corner of the screen */
#game-screen .menu-container {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 100;
}

#game-screen .btn-menu {
    width: 38px;
    height: 38px;
    background: rgba(18, 18, 24, 0.8) !important;
    border: 1px solid var(--glass-border) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.game-container {
    width: 100%;
    max-width: 1280px !important; /* Expanded to 1280px for a massive, full-screen cinema presentation! */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem !important; /* Premium vertical spacing */
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem !important; /* Comfortable header padding */
    margin-bottom: 0rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.6rem !important;
}

.media-display-area {
    height: 420px !important; /* Expanded to fill empty bottom space beautifully on widescreen displays */
    aspect-ratio: auto !important; /* Cancel 16/9 ratio to enforce strict height limits! */
}

#media-quote-wrapper, #media-scene-wrapper {
    padding: 2rem 3rem !important; /* Extremely spacious padding for rich dialogue presentation */
}

.quote-icon-large, .scene-icon-large {
    width: 2rem !important;
    height: 2rem !important;
    margin-bottom: 0.5rem !important;
}

.game-dialogue {
    font-size: 1.85rem !important; /* Big, bold, theatrical spoken dialogues! */
    line-height: 1.35 !important;
}

.game-scene-text {
    font-size: 1.35rem !important; /* Clear, detailed scene description text puzzles */
    line-height: 1.4 !important;
}

.game-controls {
    padding: 1.25rem 1.5rem !important; /* Premium spaced control cards */
    gap: 0.8rem !important;
}

.input-large input {
    padding: 0.75rem 1rem 0.75rem 2.5rem !important; /* Sleek, comfortable search bars */
    font-size: 1.05rem !important;
    border-radius: 10px !important;
}

.input-large .input-icon {
    left: 0.9rem;
    width: 1.1rem;
    height: 1.1rem;
}

.buttons-grid {
    margin-top: 0.4rem !important;
    gap: 0.8rem !important;
}

.buttons-grid .btn-primary, .buttons-grid .btn-secondary {
    padding: 0.75rem 1.25rem !important; /* Tactile, premium action buttons */
    font-size: 0.95rem !important;
}

.hint-box {
    margin-top: 0.3rem !important;
    padding: 0.5rem 0.8rem !important;
    border-radius: 8px !important;
}

.hint-box svg {
    width: 0.85rem;
    height: 0.85rem;
}

.hint-text {
    font-size: 0.8rem !important;
}

.feedback-box {
    margin-top: 0.4rem !important;
    padding: 0.75rem 1rem !important;
    border-radius: 10px !important;
}

.feedback-status svg {
    width: 1.2rem;
    height: 1.2rem;
}

/* ================= THEMATIC CINEMA BACKDROP DECORS ================= */
.cinema-backdrop-decor {
    position: absolute;
    opacity: 0.035; /* Subtle background watermarks */
    pointer-events: none;
    z-index: 0;
    transition: opacity var(--transition-normal);
}

.cinema-backdrop-decor svg {
    width: 6.5rem !important;
    height: 6.5rem !important;
}

/* Left decors vertical spacing */
.left-decor-1 {
    top: 15vh;
    left: 5%;
    color: var(--gold-brand) !important;
    filter: drop-shadow(0 0 15px rgba(245, 197, 24, 0.45));
    animation: floatDecor 8s ease-in-out infinite;
}
.left-decor-2 {
    top: 48vh;
    left: 6%;
    color: var(--red-brand) !important;
    filter: drop-shadow(0 0 15px rgba(229, 9, 20, 0.45));
    animation: floatDecor 10s ease-in-out infinite -2s;
}
.left-decor-3 {
    top: 78vh;
    left: 5%;
    color: var(--gold-brand) !important;
    filter: drop-shadow(0 0 15px rgba(245, 197, 24, 0.45));
    animation: floatDecor 9s ease-in-out infinite -4s;
}

/* Right decors vertical spacing */
.right-decor-1 {
    top: 15vh;
    right: 5%;
    color: var(--red-brand) !important;
    filter: drop-shadow(0 0 15px rgba(229, 9, 20, 0.45));
    animation: floatDecor 9s ease-in-out infinite -1s;
}
.right-decor-2 {
    top: 48vh;
    right: 6%;
    color: var(--gold-brand) !important;
    filter: drop-shadow(0 0 15px rgba(245, 197, 24, 0.45));
    animation: floatDecor 8s ease-in-out infinite -3s;
}
.right-decor-3 {
    top: 78vh;
    right: 5%;
    color: var(--red-brand) !important;
    filter: drop-shadow(0 0 15px rgba(229, 9, 20, 0.45));
    animation: floatDecor 10s ease-in-out infinite -5s;
}

/* Slow, smooth, floating-rotation keyframes */
@keyframes floatDecor {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(3deg);
    }
}

/* Hide background decors on smaller screens to keep layouts clean and focused */
@media (max-width: 1100px) {
    .cinema-backdrop-decor {
        display: none !important;
    }
}

/* ================= AKINATOR GENIE LOADING SCREEN ================= */
.genie-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 500px;
    width: 100%;
    position: relative;
    z-index: 10;
}

.genie-avatar-wrapper {
    position: relative;
    width: 280px;
    height: 280px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: levitateGenie 4s ease-in-out infinite;
}

.genie-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(245, 197, 24, 0.5));
    z-index: 5;
    -webkit-mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 38%, rgba(0, 0, 0, 0) 68%);
    mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 38%, rgba(0, 0, 0, 0) 68%);
}

.genie-glow-smoke {
    position: absolute;
    bottom: -15px;
    width: 140px;
    height: 35px;
    background: radial-gradient(ellipse, rgba(229, 9, 20, 0.35) 0%, rgba(245, 197, 24, 0.2) 50%, transparent 100%);
    filter: blur(12px);
    z-index: 1;
    animation: pulseSmoke 2.5s ease-in-out infinite alternate;
}

@keyframes levitateGenie {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

@keyframes pulseSmoke {
    0% {
        transform: scale(0.9);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Glassmorphic Speech Bubble */
.genie-speech-bubble {
    background: var(--glass-bg);
    border: 1px solid rgba(245, 197, 24, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 1.25rem 2.25rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(245, 197, 24, 0.15);
    position: relative;
    max-width: 90%;
    width: auto;
    text-align: center;
    animation: bounceIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Speak Bubble tail pointing up to the genie */
.genie-speech-bubble::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 10px 10px 10px;
    border-style: solid;
    border-color: transparent transparent rgba(245, 197, 24, 0.3) transparent;
}

.genie-speech-bubble::after {
    content: '';
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 10px 10px 10px;
    border-style: solid;
    border-color: transparent transparent var(--bg-dark-accent) transparent;
}

.genie-speech-text {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.45;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.genie-speech-text.verdict {
    color: var(--gold-brand);
    animation: textFlash 0.5s ease-in-out;
}

@keyframes textFlash {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.97); }
}

.genie-pulse-ring {
    position: absolute;
    bottom: -40px;
    width: 220px;
    height: 14px;
    background: radial-gradient(ellipse, rgba(245, 197, 24, 0.28) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulseRing 2s infinite ease-in-out;
    pointer-events: none;
}

@keyframes pulseRing {
    0% {
        transform: scale(0.8);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(0.8);
        opacity: 0.3;
    }
}

.loading-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0rem;
    height: 1.4rem; /* Safe size boundary to prevent layout shifting on text updates */
}

/* ================= PURE CSS CLAPPERBOARD TAKE SLATE ================= */
.clapperboard-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.clapperboard-container.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.clapperboard {
    width: 290px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    perspective: 800px;
    transition: opacity 0.5s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0.15;
    pointer-events: none;
}

.clapperboard.ready {
    opacity: 1;
    pointer-events: auto;
}

.clapperboard:hover {
    transform: scale(1.04);
}

.clapperboard:active {
    transform: scale(0.98);
}

.clapper-top {
    height: 24px;
    background-color: #1a1a20;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    position: relative;
    transform-origin: bottom left;
    transform: rotate(-16deg);
    transition: transform 0.15s cubic-bezier(0.6, -0.28, 0.735, 0.045);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    z-index: 2;
    overflow: hidden;
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-bottom: none;
}

/* Zebra stripes on top clapper arm using pure CSS repeating-linear-gradient */
.clapper-stripes {
    width: 150%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        #111116,
        #111116 15px,
        #ffffff 15px,
        #ffffff 30px
    );
    opacity: 0.9;
}

.clapperboard.clapped .clapper-top {
    transform: rotate(0deg);
}

.clapper-bottom {
    background-color: #121216;
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6), 0 0 20px rgba(245, 197, 24, 0.08);
    padding: 1.2rem 1rem 1rem 1rem;
    position: relative;
    z-index: 1;
    overflow: hidden;
    margin-top: -1px; /* seamless snap */
}

/* Stationary stripes base bar matching top clapper arm */
.clapper-stripes-fixed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 12px;
    background: repeating-linear-gradient(
        -45deg,
        #111116,
        #111116 15px,
        #ffffff 15px,
        #ffffff 30px
    );
    opacity: 0.9;
    border-bottom: 1.5px solid rgba(0, 0, 0, 0.4);
}

.slate-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.slate-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 6px;
}

.slate-row:last-child {
    border-bottom: none;
}

.slate-header-row {
    justify-content: center;
    gap: 8px;
    border-bottom-width: 2px;
    border-bottom-color: rgba(255,255,255,0.12);
}

.slate-cell {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.slate-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.col-60 {
    width: 55%;
    border-right: 1px solid rgba(255,255,255,0.06);
}

.col-40 {
    width: 45%;
}

.slate-label {
    font-family: monospace;
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    font-weight: bold;
    text-transform: uppercase;
}

.slate-val {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.05em;
    margin-top: 1px;
}

.slate-action-row {
    flex-direction: column;
    align-items: center;
    margin-top: 4px;
    padding-bottom: 0;
}

.slate-action-glow {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: var(--gold-brand);
    text-shadow: 0 0 10px rgba(245, 197, 24, 0.4);
    animation: pulseAction 1.4s infinite alternate ease-in-out;
}

.slate-action-sub {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

@keyframes pulseAction {
    0% {
        transform: scale(0.97);
        text-shadow: 0 0 5px rgba(245, 197, 24, 0.25);
    }
    100% {
        transform: scale(1.03);
        text-shadow: 0 0 16px rgba(245, 197, 24, 0.65), 0 0 25px rgba(245, 197, 24, 0.45);
    }
}

/* ================= CINEPHILE GENIE STYLING & ANIMATIONS ================= */
.game-layout-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.2rem;
    align-items: start;
    width: 100%;
}

.genie-panel {
    background: rgba(18, 18, 24, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 480px;
    box-shadow: var(--neon-glow-shadow-primary);
    transition: all 0.3s ease;
}

.genie-bubble-wrapper {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    width: 100%;
    margin-bottom: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.genie-bubble-arrow {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(255, 255, 255, 0.05);
}

.genie-bubble-text {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.45;
    margin: 0;
    font-weight: 500;
}

.genie-mascot-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.genie-mascot-img {
    width: 240px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.genie-controls-wrapper {
    width: 100%;
}

.full-width {
    width: 100% !important;
}

/* Animations */
@keyframes genie-float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.genie-idle-float {
    animation: genie-float 4s ease-in-out infinite;
}

@keyframes genie-bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    30% { transform: translateY(-20px) scale(1.05); }
    50% { transform: translateY(0) scale(0.95); }
    70% { transform: translateY(-10px) scale(1.02); }
}

.genie-bounce {
    animation: genie-bounce 1s ease-in-out;
}

@keyframes genie-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

.genie-shake {
    animation: genie-shake 0.8s ease-in-out;
}

@keyframes genie-lean {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) translateY(-5px) rotate(2deg); }
}

.genie-lean {
    animation: genie-lean 1.5s ease-in-out;
}

@keyframes genie-glow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(245, 197, 24, 0.4)) drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5)); }
    50% { filter: drop-shadow(0 0 25px rgba(245, 197, 24, 0.9)) drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5)); transform: scale(1.05); }
}

.genie-glow-animation {
    animation: genie-glow 2s ease-in-out infinite;
}

/* Responsiveness */
@media (max-width: 992px) {
    .game-layout-wrapper {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .genie-panel {
        min-height: auto;
        padding: 1.2rem;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: space-between;
    }
    
    .genie-bubble-wrapper {
        width: calc(100% - 170px);
        margin-bottom: 0;
        align-self: center;
    }
    
    .genie-bubble-arrow {
        bottom: 50%;
        left: -8px;
        transform: translateY(50%);
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
        border-right: 8px solid rgba(255, 255, 255, 0.05);
        border-left: none;
    }
    
    .genie-mascot-container {
        width: 140px;
        margin-bottom: 0;
        flex-grow: 0;
    }
    
    .genie-mascot-img {
        width: 130px;
    }
    
    .genie-controls-wrapper {
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* Make Microsoft Edge native password reveal icon light and highly visible against dark inputs */
input[type="password"]::-ms-reveal {
    filter: invert(100%) brightness(1.2);
    cursor: pointer;
}

/* Premium Leaderboard Personal Standing Box Styling */
.leaderboard-user-rank-box {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.75) 0%, rgba(10, 10, 15, 0.85) 100%);
    border: 1px solid rgba(245, 197, 24, 0.25); /* Subtle gold accent border */
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.leaderboard-user-rank-box:hover {
    border-color: rgba(245, 197, 24, 0.45);
    box-shadow: 0 6px 24px rgba(245, 197, 24, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.user-rank-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-rank-avatar {
    width: 2.25rem;
    height: 2.25rem;
    background: rgba(245, 197, 24, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(245, 197, 24, 0.2);
}

.user-rank-details {
    display: flex;
    flex-direction: column;
}

.user-rank-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
}

.user-rank-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.user-rank-score-block {
    display: flex;
    gap: 1rem;
}

.user-rank-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.stat-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
}

.stat-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--gold-brand);
    text-shadow: 0 0 8px rgba(245, 197, 24, 0.35);
}

/* ================= UNIFIED CINEMATIC SITE FOOTER ================= */
.site-footer {
    width: 100%;
    margin-top: 3.5rem;
    padding: 2.5rem 0 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(to bottom, rgba(2, 2, 4, 0.2), rgba(2, 2, 4, 0.85));
    backdrop-filter: blur(8px);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2.5rem;
    text-align: left;
}

.footer-brand-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.gradient-gold-red-text {
    background: linear-gradient(135deg, var(--gold-brand) 30%, var(--red-brand) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.5;
    max-width: 360px;
}

.footer-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-primary);
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.25rem;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--gold-brand);
    border-radius: 2px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-link-item {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.footer-link-item:hover {
    color: var(--gold-brand);
    transform: translateX(4px);
    text-shadow: 0 0 8px rgba(245, 197, 24, 0.3);
}

.footer-social-badges {
    display: flex;
    gap: 0.75rem;
}

.social-badge {
    width: 2.2rem;
    height: 2.2rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.social-badge i {
    width: 1.15rem;
    height: 1.15rem;
}

.social-badge:hover {
    color: #fff;
    background: rgba(245, 197, 24, 0.12);
    border-color: rgba(245, 197, 24, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(245, 197, 24, 0.25);
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0 auto;
    padding: 1.2rem 1.5rem 0 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    justify-content: center;
}

.footer-copyright {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-desc {
        max-width: 100%;
    }
    
    .footer-title::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .footer-social-badges {
        justify-content: center;
    }
    
    .footer-link-item:hover {
        transform: none;
    }
}


/* ================= PREMIUM SYSTEM MODALS ================= */
.custom-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.custom-modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(2, 2, 4, 0.75);
    backdrop-filter: blur(15px);
    transition: opacity 0.3s ease;
}

.modal-card {
    position: relative;
    z-index: 10001;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75);
    animation: modalPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    padding: 0;
}

.btn-modal-close:hover {
    color: var(--red-brand);
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    line-height: 1.6;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
}

.modal-body h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-top: 1.2rem;
    margin-bottom: 0.4rem;
}

.modal-body h3:first-of-type {
    margin-top: 0;
}

.modal-body p {
    margin-bottom: 1rem;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}

/* Custom Scrollbar for Modal Body */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--gold-brand);
}

#admin-reset-leaderboard-btn:hover {
    background: rgba(220, 38, 38, 0.3) !important;
    border-color: rgba(220, 38, 38, 0.7) !important;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.3) !important;
}

/* ================= PREMIUM MOBILE RESPONSIVE OPTIMIZATIONS ================= */
@media (max-width: 768px) {
    .media-display-area {
        height: 240px !important;
    }
    
    #media-quote-wrapper, #media-scene-wrapper {
        padding: 1.25rem 1.5rem !important;
    }
    
    .game-dialogue {
        font-size: 1.3rem !important;
    }
    
    .game-scene-text {
        font-size: 1rem !important;
    }
    
    .game-controls {
        padding: 1rem !important;
        gap: 0.6rem !important;
    }
    
    .buttons-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem !important;
    }
    
    .category-grid, .difficulty-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    
    .welcome-box {
        padding: 0.75rem 1rem;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .screen {
        padding: 4.5rem 1rem 2rem 1rem !important;
    }
    
    .media-display-area {
        height: 180px !important;
    }
    
    #media-quote-wrapper, #media-scene-wrapper {
        padding: 0.75rem 1rem !important;
    }
    
    .game-dialogue {
        font-size: 1.1rem !important;
    }
    
    .game-scene-text {
        font-size: 0.85rem !important;
    }
    
    .game-tag {
        font-size: 0.6rem;
        padding: 0.3rem 0.75rem;
    }
    
    .score-badge {
        font-size: 0.7rem;
        padding: 0.35rem 0.9rem;
    }
    
    .welcome-name {
        font-size: 0.95rem;
    }
    
    .welcome-title {
        font-size: 0.6rem;
    }
    
    .welcome-avatar {
        width: 34px;
        height: 34px;
    }
    
    .format-grid {
        grid-template-columns: 1fr !important;
    }
    
    .custom-modal {
        padding: 0.75rem;
    }
    
    .modal-card {
        max-height: 92vh !important;
    }
    
    .modal-header {
        padding: 0.8rem 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 0.8rem 1rem;
    }
}

/* ================= VIEWPORT HEIGHT COMPACTNESS OPTIMIZATIONS ================= */
@media (max-height: 850px) {
    .media-display-area {
        height: 330px !important; /* Shrink media card height to preserve vertical space */
    }
    .versus-card {
        padding: 0.5rem 1.25rem !important;
        margin-bottom: 0.75rem !important;
    }
    .game-controls {
        padding: 1rem 1.25rem !important;
        gap: 0.75rem !important;
    }
    .buttons-grid {
        margin-top: 0.75rem !important;
        gap: 0.75rem !important;
    }
    .hint-box {
        margin-top: 0.25rem !important;
        padding: 0.5rem 1rem !important;
    }
}

@media (max-height: 750px) {
    .media-display-area {
        height: 265px !important; /* Even smaller for shorter viewports to guarantee no button clipping */
    }
    .versus-card {
        padding: 0.4rem 1rem !important;
        margin-bottom: 0.5rem !important;
    }
    .game-controls {
        padding: 0.75rem 1rem !important;
        gap: 0.5rem !important;
    }
    .buttons-grid {
        margin-top: 0.5rem !important;
        gap: 0.5rem !important;
    }
}

/* ================= AUTH LOADING OVERLAY SYSTEM ================= */
.auth-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 14, 0.78); /* Semi-translucent dark cinematic backdrop */
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    z-index: 99999; /* Higher than everything else */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-loading-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: all;
    display: flex;
}

.auth-loading-card {
    background: rgba(18, 18, 24, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 2.5rem 3rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    max-width: 340px;
    width: calc(100% - 2.5rem);
    text-align: center;
    transform: scale(0.85);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-loading-overlay:not(.hidden) .auth-loading-card {
    transform: scale(1);
}

.auth-loading-spinner {
    width: 3.25rem;
    height: 3.25rem;
    border: 4px solid rgba(245, 197, 24, 0.1);
    border-top: 4px solid var(--gold-brand); /* Premium rotating gold ring */
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

.auth-loading-text {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.25rem;
    letter-spacing: 0.01em;
}



