/* ==========================================================================
   WORD QUEST — Executive Academic Theme & Style Architecture
   English Department Competition
   Ultra Mobile-Friendly Edition
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS VARIABLES & THEME TOKENS
   -------------------------------------------------------------------------- */
:root {
    /* Sophisticated Light Academic Palette */
    --bg-dark: #eef2f7;
    --bg-darker: #e7ecf4;
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-bg-hover: rgba(255, 255, 255, 1);
    --card-border: rgba(15, 23, 42, 0.12);
    --card-border-gold: rgba(217, 119, 6, 0.35);

    /* Regal Warm Gold & Executive Blue Accents */
    --accent-gold: #d97706;
    --accent-gold-light: #b45309;
    --accent-gold-glow: rgba(217, 119, 6, 0.2);
    --accent-navy: #1e3a8a;
    --accent-blue: #2563eb;
    --accent-indigo: #4f46e5;
    --accent-slate: #334155;

    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    /* States & Shadows */
    --focus-ring: rgba(217, 119, 6, 0.3);
    --error-red: #dc2626;
    --error-bg: rgba(239, 68, 68, 0.12);
    --shadow-card: 0 10px 30px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    --shadow-gold: 0 0 20px rgba(217, 119, 6, 0.18);

    /* Typography & Spacing */
    --font-title: 'Cinzel', serif;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   2. GLOBAL RESET & MOBILE TOUCH OPTIMIZATION
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.executive-theme {
    background-color: var(--bg-darker);
}

.hidden {
    display: none !important;
}

/* Clean Background Grid Mesh */
.bg-grid-mesh {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: radial-gradient(rgba(15, 23, 42, 0.1) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.8;
}

/* --------------------------------------------------------------------------
   3. LAYOUT & CONTAINERS
   -------------------------------------------------------------------------- */
.app-container {
    position: relative;
    z-index: 2;
    max-width: 1080px;
    margin: 0 auto;
    padding: clamp(0.75rem, 2.5vw, 1.75rem) clamp(0.85rem, 3.5vw, 1.5rem);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Header Navbar & Emblem Badge */
.app-header {
    width: 100%;
    margin-bottom: 1rem;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    gap: 1rem;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-college-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.college-logo-img {
    height: 44px;
    width: auto;
    display: block;
}

.header-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid var(--accent-gold);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-title);
    font-size: 1.2rem;
    font-weight: 800;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), var(--shadow-gold);
    flex-shrink: 0;
}

.header-brand-info {
    display: flex;
    flex-direction: column;
}

.header-app-title {
    font-family: var(--font-title);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: 0.02em;
}

.header-right-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-litfest-badge {
    font-family: var(--font-title);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    text-transform: uppercase;
    white-space: nowrap;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    background: rgba(226, 232, 240, 0.7);
    border: 1px solid rgba(217, 119, 6, 0.35);
    border-radius: var(--radius-full);
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--accent-gold-light);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.badge-img {
    height: 32px;
    width: auto;
    display: block;
    filter: brightness(1.3) contrast(1.1);
}

.header-admin-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    background: rgba(226, 232, 240, 0.7);
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.header-admin-link:hover {
    color: var(--text-primary);
    border-color: var(--accent-gold);
    background: #e2e8f0;
}

.badge-icon {
    font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   4. HERO SECTION
   -------------------------------------------------------------------------- */
.hero-section {
    text-align: center;
    margin-bottom: 1.25rem;
}

.logo-emblem {
    width: clamp(46px, 12vw, 58px);
    height: clamp(46px, 12vw, 58px);
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid var(--accent-gold);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-title);
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    font-weight: 800;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15), var(--shadow-gold);
}

.logo-letter-accent {
    color: #f59e0b;
}

.game-title {
    font-family: var(--font-title);
    font-size: clamp(2.2rem, 7.5vw, 4rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.1;
    color: var(--text-primary);
}

.gold-text {
    background: linear-gradient(135deg, #d97706 0%, #b45309 50%, #92400e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    filter: drop-shadow(0 2px 10px rgba(217, 119, 6, 0.3));
}

.landing-top-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.landing-hero {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 0 1.5rem;
}

.hero-badge {
    display: inline-flex;
    padding: 0.4rem 1.2rem;
    background: rgba(226, 232, 240, 0.7);
    border: 1px solid rgba(217, 119, 6, 0.35);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-gold-light);
    margin-bottom: 1rem;
    letter-spacing: 0.04em;
}

.hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin: 1.25rem 0 1.75rem;
    flex-wrap: nowrap;
}

.hero-stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.hero-stat-icon {
    font-size: 1.1rem;
}

@media (max-width: 480px) {
    .hero-stats {
        gap: 0.75rem;
    }
    .hero-stat {
        font-size: 0.72rem;
        gap: 0.25rem;
    }
    .hero-stat-icon {
        font-size: 0.9rem;
    }
}

.hero-cta {
    display: inline-flex;
    width: auto;
    padding: 0.85rem 2.6rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-decoration: none;
    border-radius: 999px;
    box-shadow: 0 8px 28px rgba(217, 119, 6, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-cta:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 14px 36px rgba(217, 119, 6, 0.55);
}

.hero-cta:active {
    transform: translateY(0) scale(0.98);
}


.hero-subtitle {
    font-size: clamp(0.9rem, 2.5vw, 1.15rem);
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 580px;
    margin: 0.75rem auto 0;
    letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   5. CONTENT GRID & STRUCTURED CARDS
   -------------------------------------------------------------------------- */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: clamp(1.25rem, 3vw, 2rem);
    align-items: stretch;
    margin-bottom: 2rem;
}

/* Base Glassmorphism Executive Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: clamp(1.25rem, 3.5vw, 1.85rem);
    box-shadow: var(--shadow-card);
    transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-card:hover {
    border-color: rgba(15, 23, 42, 0.16);
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.14);
}

/* Card Header */
.card-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.card-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: rgba(226, 232, 240, 0.85);
    border: 1px solid rgba(15, 23, 42, 0.12);
    color: var(--accent-gold-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon-gold {
    background: rgba(217, 119, 6, 0.15);
    border-color: rgba(217, 119, 6, 0.35);
    color: var(--accent-gold-light);
}

.card-title {
    font-family: var(--font-title);
    font-size: clamp(1.15rem, 3.5vw, 1.35rem);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.card-desc {
    font-size: 0.825rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* --------------------------------------------------------------------------
   6. FORM CONTROLS & INPUTS
   -------------------------------------------------------------------------- */
.player-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-wrapper,
.select-wrapper {
    position: relative;
    width: 100%;
}

.glass-input {
    width: 100%;
    min-height: 46px;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.925rem;
    font-weight: 500;
    outline: none;
    transition: var(--transition-fast);
}

.glass-input::placeholder {
    color: var(--text-muted);
}

.glass-input:hover {
    border-color: rgba(15, 23, 42, 0.25);
}

.glass-input:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.glass-select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 3rem;
}

.glass-select option {
    background-color: #ffffff;
    color: var(--text-primary);
    padding: 0.5rem;
}

.select-arrow {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

/* Difficulty Badges */
.difficulty-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: rgba(15, 23, 42, 0.02);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.diff-chip {
    font-size: 0.725rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.diff-easy {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.diff-medium {
    background: rgba(217, 119, 6, 0.18);
    color: #b45309;
    border: 1px solid rgba(217, 119, 6, 0.35);
}

.diff-hard {
    background: rgba(239, 68, 68, 0.18);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.diff-desc {
    font-size: 0.775rem;
    color: var(--text-secondary);
}

/* Error Messages & Shake */
.error-message {
    font-size: 0.775rem;
    color: var(--error-red);
    min-height: 0;
    margin-top: 0;
    font-weight: 500;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.error-message.visible {
    opacity: 1;
    min-height: 1.1rem;
    max-height: 2rem;
    margin-top: 0.2rem;
}

.input-error {
    border-color: var(--error-red) !important;
    background: var(--error-bg) !important;
}

.shake {
    animation: shakeAnim 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakeAnim {

    10%,
    90% {
        transform: translate3d(-2px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(4px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-6px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(6px, 0, 0);
    }
}

/* --------------------------------------------------------------------------
   7. BUTTON STYLES
   -------------------------------------------------------------------------- */
.glass-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    min-height: 48px;
    padding: 0.9rem 1.5rem;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(217, 119, 6, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(217, 119, 6, 0.45);
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(15, 23, 42, 0.15);
    color: var(--text-primary);
    text-decoration: none;
}

.btn-secondary:hover {
    background: rgba(15, 23, 42, 0.12);
    border-color: rgba(15, 23, 42, 0.25);
}

/* --------------------------------------------------------------------------
   8. RULES & ROUNDS LIST
   -------------------------------------------------------------------------- */
.rounds-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.round-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.85rem;
    background: rgba(15, 23, 42, 0.02);
    border-radius: var(--radius-md);
    border: 1px solid rgba(15, 23, 42, 0.06);
    transition: var(--transition-fast);
}

.round-item:hover {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.12);
}

.round-badge {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: rgba(217, 119, 6, 0.15);
    color: var(--accent-gold-light);
    border: 1px solid rgba(217, 119, 6, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 0.825rem;
    flex-shrink: 0;
}

.round-badge-navy {
    background: rgba(30, 58, 138, 0.3);
    color: #2563eb;
    border-color: rgba(147, 197, 253, 0.3);
}

.round-badge-gold {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.3);
}

.round-title {
    font-size: 0.925rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.round-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.rules-footer {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.6rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.rule-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-gold-light);
    background: rgba(217, 119, 6, 0.1);
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(217, 119, 6, 0.2);
    white-space: nowrap;
    flex-shrink: 1;
}

@media (max-width: 480px) {
    .rules-footer {
        gap: 0.35rem;
    }
    .rule-chip {
        font-size: 0.65rem;
        padding: 0.28rem 0.5rem;
        gap: 0.25rem;
    }
    .rule-chip svg {
        width: 12px;
        height: 12px;
    }
}

/* --------------------------------------------------------------------------
   9. FOOTER
   -------------------------------------------------------------------------- */
.footer {
    text-align: center;
    padding: 1.5rem 0 1.25rem;
    font-size: 0.825rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(15, 23, 42, 0.05);
}

.footer strong {
    color: var(--text-secondary);
}

.footer-built-by {
    margin-top: 0.4rem;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    opacity: 0.65;
}

.footer-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    text-decoration: none;
    color: var(--text-muted);
    vertical-align: middle;
    transition: opacity 0.2s ease;
}

.footer-brand-link:hover {
    opacity: 0.9;
}

.footer-brand-logo {
    display: inline-block;
    width: 12px;
    height: 12px;
    min-width: 12px;
    min-height: 12px;
    max-width: 12px;
    max-height: 12px;
    border-radius: 2px;
    vertical-align: middle;
    opacity: 0.6;
    flex-shrink: 0;
}

.footer-built-by strong {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   10. HIGH-TECH EXECUTIVE GAMING HUD (RESPONSIVE)
   -------------------------------------------------------------------------- */
.arena-layout {
    max-width: 1000px;
}

.hud-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    margin-bottom: clamp(1.25rem, 3.5vw, 2rem);
    gap: 0.75rem;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.1);
}

.hud-left,
.hud-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hud-home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.1);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.hud-home-btn:hover {
    background: rgba(15, 23, 42, 0.1);
    color: var(--accent-gold-light);
}

.player-info-badge {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d97706, #1e3a8a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 1rem;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(217, 119, 6, 0.3);
    flex-shrink: 0;
}

.player-text-details {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.player-name-display {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
}

.hud-center {
    display: flex;
    align-items: center;
    gap: clamp(0.5rem, 2vw, 1.25rem);
}

.hud-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.3rem 0.75rem;
    background: rgba(15, 23, 42, 0.02);
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: var(--radius-sm);
    min-width: 65px;
}

.stat-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-value {
    font-family: var(--font-title);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.highlight-gold {
    color: var(--accent-gold-light);
}

.streak-stat-box {
    flex-direction: row;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
}

.streak-stat-box.active {
    background: rgba(217, 119, 6, 0.15);
    border-color: rgba(217, 119, 6, 0.4);
}

.streak-value {
    color: #b45309;
}

.timer-stat-box {
    flex-direction: row;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
}

.timer-ring-svg {
    transform: rotate(-90deg);
    width: 32px;
    height: 32px;
}

.timer-ring-bg {
    fill: none;
    stroke: rgba(15, 23, 42, 0.08);
    stroke-width: 3.5;
}

.timer-ring-fill {
    fill: none;
    stroke: var(--accent-gold-light);
    stroke-width: 3.5;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.timer-text {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 1.1rem;
}

.hud-control-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.1);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.hud-control-btn:hover {
    background: rgba(15, 23, 42, 0.1);
    color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   11. FLUID MOBILE LETTER SLOTS & TILE BANK
   -------------------------------------------------------------------------- */
.arena-card {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
    padding: clamp(1.75rem, 5vw, 3rem) clamp(1.25rem, 4vw, 2.5rem);
}

.round-preview-badge {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    background: rgba(217, 119, 6, 0.15);
    border: 1px solid rgba(217, 119, 6, 0.35);
    color: var(--accent-gold-light);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 1.25rem;
}

.arena-title {
    font-family: var(--font-title);
    font-size: clamp(1.6rem, 5vw, 2.1rem);
    font-weight: 700;
    margin-bottom: 0.85rem;
}

.arena-desc {
    color: var(--text-secondary);
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    margin-bottom: 1.75rem;
    line-height: 1.55;
}

.round-features-list {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.feature-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.btn-group {
    display: flex;
    gap: 0.85rem;
    justify-content: center;
    flex-wrap: wrap;
}

.game-card {
    max-width: 820px;
    margin: 0 auto;
    padding: clamp(1.25rem, 4vw, 2.5rem);
}

.game-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.category-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.cat-dot-gold {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-gold-light);
    box-shadow: 0 0 8px var(--accent-gold);
}

.cat-dot-navy {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #2563eb;
    box-shadow: 0 0 8px #60a5fa;
}

.progress-pill {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(15, 23, 42, 0.04);
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.hint-container {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.75rem;
    text-align: center;
}

.hint-text {
    font-size: clamp(0.875rem, 2.5vw, 0.95rem);
    color: var(--text-primary);
    font-weight: 500;
}

/* FLUID DYNAMIC LETTER TILES (Never overflow mobile screens) */
.letter-slots-wrapper {
    display: flex;
    justify-content: center;
    gap: clamp(0.3rem, 1.5vw, 0.65rem);
    margin-bottom: clamp(1.5rem, 4vw, 2.25rem);
    flex-wrap: wrap;
}

.letter-slot {
    width: clamp(34px, 9.5vw, 52px);
    height: clamp(40px, 11vw, 58px);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.9);
    border: 1.5px dashed rgba(15, 23, 42, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-title);
    font-size: clamp(1.2rem, 4.5vw, 1.7rem);
    font-weight: 800;
    color: var(--accent-gold-light);
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.letter-slot.filled {
    border-style: solid;
    border-color: var(--accent-gold);
    background: rgba(217, 119, 6, 0.1);
    box-shadow: 0 0 15px rgba(217, 119, 6, 0.2);
}

.tile-bank-wrapper {
    display: flex;
    justify-content: center;
    gap: clamp(0.3rem, 1.5vw, 0.65rem);
    margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
    flex-wrap: wrap;
}

.letter-tile {
    width: clamp(34px, 9.5vw, 50px);
    height: clamp(38px, 10.5vw, 54px);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-family: var(--font-title);
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: var(--transition-fast);
    flex-shrink: 0;

}

.letter-tile:hover,
.letter-tile:active {
    transform: translateY(-2px);
    border-color: var(--accent-gold);
    color: var(--accent-gold-light);
    box-shadow: 0 6px 15px rgba(217, 119, 6, 0.25);
}

.letter-tile.used {
    opacity: 0.18;
    pointer-events: none;
    box-shadow: none;
}

.game-actions-bar {
    display: flex;
    justify-content: center;
    gap: clamp(0.5rem, 2vw, 0.85rem);
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.12);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: clamp(0.825rem, 2.5vw, 0.9rem);
    cursor: pointer;
    transition: var(--transition-fast);
    flex: 1 1 auto;
    min-width: 90px;
}

.action-btn:hover {
    background: rgba(15, 23, 42, 0.1);
    border-color: rgba(15, 23, 42, 0.25);
}

.action-hint {
    background: rgba(217, 119, 6, 0.12);
    border-color: rgba(217, 119, 6, 0.3);
    color: #b45309;
}

.action-submit {
    flex: 2 1 160px;
    max-width: 100%;
}

/* Round 2 Word Chain */
.chain-banner {
    text-align: center;
    margin-bottom: 1.75rem;
}

.chain-instruction {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.65rem;
}

.target-letter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(56px, 14vw, 68px);
    height: clamp(56px, 14vw, 68px);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #1e3a8a, #0f172a);
    border: 2px solid var(--accent-gold);
    font-family: var(--font-title);
    font-size: clamp(2rem, 6vw, 2.6rem);
    font-weight: 800;
    color: #ffffff;
    box-shadow: 0 0 25px rgba(217, 119, 6, 0.3);
}

.chain-history-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.9rem 0.85rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    min-height: 64px;
}

.chain-empty-text {
    font-size: 0.825rem;
    color: var(--text-muted);
    width: 100%;
    text-align: center;
}

.chain-word-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    background: rgba(30, 58, 138, 0.3);
    border: 1px solid rgba(147, 197, 253, 0.3);
    border-radius: var(--radius-full);
    font-family: var(--font-main);
    font-size: 0.825rem;
    font-weight: 600;
    color: #2563eb;
    white-space: nowrap;
}

.chain-input-form {
    max-width: 480px;
    margin: 0 auto;
}

.chain-input-wrapper {
    display: flex;
    gap: 0.65rem;
}

.chain-input {
    text-transform: uppercase;
    font-family: var(--font-main);
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* Round 3 Matrix Grid */
.word-search-layout {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 1.5rem;
    align-items: start;
}

.search-grid-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: clamp(0.25rem, 1vw, 0.5rem);
    background: rgba(255, 255, 255, 0.85);
    padding: clamp(0.65rem, 2vw, 1.1rem);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.grid-cell {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.1);
    color: var(--text-primary);
    font-family: var(--font-title);
    font-size: clamp(0.95rem, 4.5vw, 1.3rem);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
    min-height: 36px;
}

.grid-cell:hover,
.grid-cell:active {
    background: rgba(217, 119, 6, 0.15);
    border-color: var(--accent-gold);
}

.grid-cell.selected {
    background: var(--accent-gold);
    color: #ffffff;
    border-color: #ffffff;
    box-shadow: 0 0 12px rgba(217, 119, 6, 0.5);
}

.grid-cell.found-cell {
    background: rgba(34, 197, 94, 0.25);
    border-color: #16a34a;
    color: #16a34a;
}

.search-sidebar {
    background: rgba(15, 23, 42, 0.02);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.sidebar-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    padding-bottom: 0.35rem;
}

.target-words-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.target-word-item {
    padding: 0.4rem 0.7rem;
    background: rgba(15, 23, 42, 0.03);
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.target-word-item.found {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
    text-decoration: line-through;
    opacity: 0.7;
}

/* --------------------------------------------------------------------------
   12. VICTORY & LEADERBOARD MODAL (MOBILE RESPONSIVE SCROLL)
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-card {
    width: 100%;
    max-width: 560px;
    max-height: 88vh;
    overflow-y: auto;
    padding: clamp(1.25rem, 4vw, 2.25rem);
    text-align: center;
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(217, 119, 6, 0.3);
}

.trophy-badge {
    font-size: 2.75rem;
    margin-bottom: 0.4rem;
}

.modal-title {
    font-family: var(--font-title);
    font-size: clamp(1.5rem, 4.5vw, 1.9rem);
    font-weight: 800;
    margin-bottom: 0.2rem;
}

.modal-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.modal-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin-bottom: 1.35rem;
}

.modal-stat-card {
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: var(--radius-md);
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mstat-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.mstat-val {
    font-family: var(--font-title);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.rank-badge {
    font-size: 0.85rem;
    color: var(--accent-gold-light);
}

.leaderboard-section {
    margin-bottom: 1.5rem;
    text-align: left;
}

.leaderboard-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-title);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.leaderboard-table-wrapper {
    max-height: 150px;
    overflow-y: auto;
    border-radius: var(--radius-md);
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(15, 23, 42, 0.04);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.825rem;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 0.45rem 0.75rem;
    text-align: left;
}

.leaderboard-table th {
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-muted);
    font-weight: 600;
}

.leaderboard-table tr:not(:last-child) td {
    border-bottom: 1px solid rgba(15, 23, 42, 0.04);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    width: max-content;
    max-width: 90vw;
}

.toast {
    padding: 0.65rem 1.1rem;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--accent-gold);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
    text-align: center;
    transition: all 0.3s ease;
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.card-entrance {
    animation: cardEntranceAnim 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardEntranceAnim {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --------------------------------------------------------------------------
   13. COMPACT MOBILE MEDIA QUERIES (320px to 640px)
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .hud-bar {
        padding: 0.6rem 0.85rem;
        gap: 0.5rem;
    }

    .hud-center {
        width: 100%;
        order: 3;
        justify-content: space-between;
        border-top: 1px solid rgba(15, 23, 42, 0.08);
        padding-top: 0.5rem;
        margin-top: 0.25rem;
    }

    .hud-left {
        gap: 0.5rem;
    }

    .player-name-display {
        max-width: 100px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .word-search-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .chain-input-wrapper {
        flex-direction: column;
    }

    .btn-secondary,
    .btn-lg {
        max-width: 100%;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .glass-btn {
        width: 100%;
    }
}

@media (max-width: 380px) {
    .hud-stat-box {
        min-width: 52px;
        padding: 0.2rem 0.45rem;
    }

    .stat-value {
        font-size: 1rem;
    }

    .timer-text {
        font-size: 0.95rem;
    }
}

/* Balanced mobile padding and spacing */
@media (max-width: 600px) {
    .header-inner {
        padding: 0.6rem 0.9rem;
        gap: 0.5rem;
    }

    .header-app-title {
        font-size: 1.15rem;
    }

    .header-logo-icon {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .header-badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.75rem;
    }

    .hero-subtitle {
        font-size: 0.85rem;
    }

    .glass-card {
        padding: 1.25rem 1.15rem;
    }

    .card-header {
        margin-bottom: 1.1rem;
        gap: 0.75rem;
    }

    .player-form {
        gap: 0.95rem;
    }

    .glass-btn {
        min-height: 46px;
        padding: 0.75rem 1.25rem;
        margin-top: 0.25rem;
    }
}

/* ==========================================================================
   ALREADY REGISTERED & RETURNING PLAYER STYLES
   ========================================================================== */

/* Utility: hide elements */
.hidden {
    display: none !important;
}

/* Divider "or" line */
.already-reg-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.1rem 0 0.6rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
}

.already-reg-divider::before,
.already-reg-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(15, 23, 42, 0.1);
}

/* "Already Registered?" ghost link-style button */
.already-reg-btn {
    width: 100%;
    background: transparent;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: var(--transition-fast);
    letter-spacing: 0.02em;
    text-align: center;
    font-family: var(--font-main);
}

.already-reg-btn:hover {
    color: var(--accent-gold-light);
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.06);
}

/* "← New Registration" back link */
.ret-back-link {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-family: var(--font-main);
    cursor: pointer;
    padding: 0.25rem 0;
    transition: color var(--transition-fast);
    text-align: center;
    width: 100%;
    margin-top: 0.25rem;
}

.ret-back-link:hover {
    color: var(--text-secondary);
}

/* Global lookup error (e.g. "not found") */
.ret-global-error {
    text-align: center;
    font-size: 0.875rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--error-bg);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.ret-global-error.visible {
    display: block;
}