/* ==========================================================================
   SWARAG MIDNIGHT DESIGN SYSTEM TOKENS
   ========================================================================== */
:root {
    /* Backgrounds */
    --bg-primary: #08090D;
    --bg-surface: #10131B;
    --bg-card: #181C27;
    
    /* Text Hierarchy */
    --text-primary: #F5F3EE;
    --text-secondary: #9B9EAA;
    --text-muted: #6C7080;
    
    /* Primary Brand Accent */
    --gold-primary: #F4B860;
    --gold-glow: rgba(244, 184, 96, 0.18);
    --gold-hover: #F7C67D;
    
    /* Secondary Game Accents */
    --coral: #FF647C;
    --violet: #8B6CFF;
    --cyan: #42D9E8;
    --green: #47D18C;
    --red: #FF5364;
    --orange: #FF8A3D;
    --blue: #3B82F6;
    --crimson: #E11D48;
    
    /* Borders & Surfaces */
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(244, 184, 96, 0.3);
    --border-radius: 20px;
    --border-radius-sm: 12px;
    
    /* Consolidated Landing Design Tokens */
    --fz-xs: 0.75rem;
    --fz-sm: 0.85rem;
    --fz-base: 1rem;
    --fz-md: 1.125rem;
    --fz-lg: 1.25rem;
    --fz-xl: 1.5rem;
    --fz-2xl: 2.2rem;
    --fz-3xl: 2.8rem;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-pill: 99px;
    
    /* Legacy Mapping Aliases for Existing Controls */
    --primary: var(--gold-primary);
    --primary-glow: var(--gold-glow);
    --secondary: var(--violet);
    --secondary-glow: rgba(139, 108, 255, 0.2);
    --card-bg: var(--bg-card);
    --card-border: var(--border-subtle);
    --text-color: var(--text-primary);
    
    /* Typography */
    --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition-speed: 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

html,
body {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-color);
    min-height: 100vh;
    min-height: 100dvh;
}

/* ==========================================================================
   AMBIENT GLOWS & BACKGROUND
   ========================================================================== */
#app-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    z-index: 1;
}

.ambient-glow {
    display: none !important;
}

.glow-1 {
    top: -10%;
    left: -10%;
    background-color: var(--primary);
}

.glow-2 {
    bottom: -10%;
    right: -10%;
    background-color: var(--secondary);
}

/* ==========================================================================
   GLASSMORPHISM CARD STYLE
   ========================================================================== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: 0 8px 30px rgba(255, 79, 112, 0.05);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.card:hover {
    border-color: rgba(255, 79, 112, 0.25);
}

/* ==========================================================================
   VIEWS CONTROLLER
   ========================================================================== */
.view {
    width: 100%;
    animation: fadeIn 0.4s ease forwards;
}

.view:not(#view-landing):not(#view-game):not(#view-lobby) {
    max-width: 520px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#view-game, #view-lobby {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    padding: 20px;
}

.view#view-game-selection {
    max-width: 950px;
}

.hidden, .view.hidden {
    display: none !important;
}

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

/* ==========================================================================
   HERO / LOGO DESIGN
   ========================================================================== */
.hero-card {
    text-align: center;
}

.logo-container {
    margin-bottom: 30px;
}

.logo-icon {
    display: inline-block;
    font-size: 3rem;
    color: var(--secondary);
    text-shadow: 0 0 20px var(--secondary-glow);
    margin-bottom: 10px;
    animation: float 4s ease-in-out infinite;
}

.logo-title {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: 4px;
    background: linear-gradient(135deg, #fff 0%, var(--primary) 50%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.logo-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

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

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    color: var(--text-muted);
}

.input-wrapper input {
    width: 100%;
    background: var(--bg-card, #181C27);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    padding: 14px 15px 14px 45px;
    color: var(--text-primary, #F5F3EE);
    font-family: var(--font-main);
    font-size: 1rem;
    outline: none;
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.input-wrapper input:focus {
    background: var(--bg-card, #181C27);
    border-color: var(--gold-primary, #F4B860);
    box-shadow: 0 0 16px var(--gold-glow);
    color: var(--text-primary, #F5F3EE);
}

/* Global Autofill Visibility Fix */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus {
    -webkit-text-fill-color: #F5F3EE !important;
    -webkit-box-shadow: 0 0 0px 1000px #181C27 inset !important;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: #F5F3EE !important;
}

/* Global Placeholder High-Contrast Styling */
::placeholder,
::-webkit-input-placeholder,
::-moz-placeholder {
    color: var(--text-secondary, #9B9EAA) !important;
    opacity: 1 !important;
}

.uppercase-input {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
}


/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all var(--transition-speed) ease;
    user-select: none;
}

/* Touch Friendly sizes */
@media (pointer: coarse) {
    .btn, .input-wrapper input {
        min-height: 48px;
    }
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-primary, #F4B860) 0%, var(--gold-hover, #F7C67D) 100%);
    color: #08090D !important;
    font-weight: 700;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 184, 96, 0.35);
    color: #08090D !important;
}

.btn-glow {
    box-shadow: 0 4px 15px rgba(244, 184, 96, 0.25);
}

.btn-secondary {
    background: var(--bg-card, #181C27);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
    color: var(--text-primary, #F5F3EE);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(244, 184, 96, 0.12);
    border-color: var(--gold-primary, #F4B860);
    box-shadow: 0 4px 15px rgba(244, 184, 96, 0.2);
    color: var(--text-primary, #F5F3EE);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
    color: var(--text-primary, #F5F3EE);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--gold-primary, #F4B860);
    background: rgba(244, 184, 96, 0.08);
    color: var(--text-primary, #F5F3EE);
}

.btn-danger {
    background: linear-gradient(135deg, #E11D48 0%, #c3003a 100%);
    color: #FFFFFF;
    font-weight: 700;
}

.btn-danger:hover:not(:disabled) {
    box-shadow: 0 0 15px rgba(225, 29, 72, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #47D18C 0%, #24a100 100%);
    color: #08090D !important;
    font-weight: 800;
}

.btn-success:hover:not(:disabled) {
    box-shadow: 0 0 15px rgba(71, 209, 140, 0.4);
    color: #08090D !important;
}


.btn:active {
    transform: translateY(1px) !important;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 8px;
}

/* ==========================================================================
   GAME SELECTION CONTAINER
   ========================================================================== */
#view-game-selection {
    max-width: 1060px;
    width: 100%;
    margin: 0 auto;
}

.action-footer {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* ==========================================================================
   LOBBY LAYOUT (Grid)
   ========================================================================== */
#view-lobby {
    max-width: 900px;
}

.lobby-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 768px) {
    .lobby-layout {
        grid-template-columns: 1fr;
    }
}

.lobby-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card, .voice-panel, .host-panel {
    padding: 20px;
}

.info-card h3, .voice-panel h3, .host-panel h3, .players-card h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.room-code-badge {
    background: rgba(255, 79, 112, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.room-code-badge .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.room-code-badge #lobby-code-display {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--secondary);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.2s;
}

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

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding: 8px 0;
    border-bottom: 1px solid var(--card-border);
}

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

.info-label {
    color: var(--text-muted);
}

.info-value {
    font-weight: 600;
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-waiting { background: rgba(139, 92, 246, 0.08); color: var(--secondary); border: 1px solid var(--secondary); }
.badge-locked { background: rgba(245, 158, 11, 0.08); color: var(--warning); border: 1px solid var(--warning); }
.badge-playing { background: rgba(16, 185, 129, 0.08); color: var(--success); border: 1px solid var(--success); }

/* Voice panel */
.voice-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-voice {
    background: var(--bg-card, #181C27);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    color: var(--text-primary, #F5F3EE);
    font-weight: 700;
    transition: all 0.2s ease;
}

.btn-voice.mic-off {
    border-color: rgba(255, 90, 90, 0.4);
    color: #FF5A5A;
    background: rgba(255, 90, 90, 0.1);
}

.btn-voice.mic-on {
    border-color: rgba(71, 209, 140, 0.4);
    color: #47D18C;
    background: rgba(71, 209, 140, 0.1);
    box-shadow: 0 0 12px rgba(71, 209, 140, 0.25);
}

.voice-help-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.3;
}

/* Host Panel */
.crown-icon {
    color: var(--warning);
    text-shadow: 0 0 10px rgba(255,170,0,0.5);
}

.host-button-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.host-button-grid .btn-danger {
    grid-column: span 2;
}

/* Players Grid List */
.players-card {
    height: 100%;
    min-height: 380px;
}

.players-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.player-card {
    background: rgba(255, 79, 112, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    box-shadow: 0 4px 12px rgba(255, 79, 112, 0.02);
}

.player-card.disconnected {
    opacity: 0.5;
}

.player-card.disconnected .status-tag {
    color: var(--text-muted);
}

.player-card.host-border {
    border-color: var(--warning);
    box-shadow: 0 0 8px rgba(255, 170, 0, 0.1);
}

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

.player-name {
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

.player-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-online { background-color: var(--success); box-shadow: 0 0 6px var(--success-glow); }
.status-offline { background-color: var(--danger); }

.voice-status-tag {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.voice-on { background: rgba(57, 255, 20, 0.1); color: var(--success); }
.voice-off { background: rgba(255, 79, 112, 0.04); color: var(--text-muted); }

.player-actions-row {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.btn-player-action {
    flex: 1;
    padding: 6px;
    font-size: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--card-border);
    background: transparent;
    color: var(--text-color);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.btn-mute.active {
    background: rgba(255, 0, 85, 0.15);
    border-color: var(--danger);
    color: var(--danger);
}

.btn-kick:hover {
    background: rgba(255, 0, 85, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

/* Modal styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(36, 25, 35, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-card {
    width: 90%;
    max-width: 440px;
}

.modal-game-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
    max-height: 260px;
    overflow-y: auto;
}

.modal-game-item {
    background: rgba(255, 79, 112, 0.04);
    border: 1px solid var(--card-border);
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.modal-game-item:hover {
    border-color: var(--primary);
    background: rgba(255, 79, 112, 0.08);
}

.modal-game-item.selected {
    border-color: var(--primary);
    background: rgba(255, 79, 112, 0.12);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
}

/* ==========================================================================
   GAME VIEW LAYOUT
   ========================================================================== */
#view-game {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.game-main-content {
    width: 100%;
    max-width: 1060px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.game-container {
    display: grid;
    grid-template-columns: 1fr 280px;
    grid-template-rows: auto 1fr;
    gap: 16px;
}

@media (min-width: 869px) {
    #view-game .game-container {
        grid-template-columns: 1fr !important;
        max-width: 1000px !important;
        margin: 0 auto !important;
    }

    #view-game .game-container:has(.sidebar-widget:not([style*="display: none"]):not([style*="display:none"])) {
        grid-template-columns: 1fr 280px !important;
        max-width: 1060px !important;
        margin: 0 auto !important;
    }
}

@media (max-width: 820px) {
    .game-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
}

.game-hud {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}

.hud-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hud-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.hud-value {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.game-play-area {
    min-height: 400px;
}

.sandbox-card {
    height: 100%;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

.game-sidebar-overlay {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-widget {
    padding: 15px;
}

.sidebar-widget h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.game-scores-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.score-row {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    font-size: 0.9rem;
}

.score-row.highlight {
    border: 1px solid var(--secondary);
    background: rgba(0, 229, 255, 0.05);
}

.score-name {
    display: flex;
    align-items: center;
    gap: 6px;
}

.score-points {
    font-weight: bold;
}

/* Voice overlays */
.voice-mini-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.voice-mini-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.01);
    font-size: 0.85rem;
}

/* Results panel overlay */
.results-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 8, 20, 0.92);
    border-radius: var(--border-radius);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    animation: fadeIn 0.3s ease;
}

.results-card {
    text-align: center;
    max-width: 380px;
    padding: 30px;
}

.winner-announcement {
    margin: 20px 0;
}

.trophy-icon {
    font-size: 3rem;
    color: var(--warning);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(255, 170, 0, 0)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 15px rgba(255, 170, 0, 0.6)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(255, 170, 0, 0)); }
}

.rematch-actions {
    margin-top: 25px;
}

/* ==========================================================================
   GAME SPECIFIC SANDBOX UI
   ========================================================================== */
.sandbox-title {
    font-size: 1.5rem;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 800;
    color: var(--secondary);
}

.sandbox-target-indicator {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.sandbox-clicker-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.btn-sandbox-click {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(157, 78, 221, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.1s, box-shadow var(--transition-speed);
}

.btn-sandbox-click:active {
    transform: scale(0.92);
    box-shadow: 0 4px 10px rgba(157, 78, 221, 0.2);
}

/* Math Sandbox */
.math-question-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 15px 30px;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--secondary);
    margin-bottom: 20px;
}

.math-input-wrapper {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 320px;
}

.toast.hidden {
    display: none !important;
}

@keyframes toastSlideIn {
    from {
        transform: translateY(-12px) scale(0.96);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .toast {
        top: 16px;
        right: 16px;
        left: 16px;
        padding: 12px 16px;
        font-size: 0.9rem;
        display: flex;
    }
}

/* Loading helper */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 30px;
}

/* Old landing page styles removed to prevent overrides */

/* ==========================================================================
   RIDDLE RUSH STYLING
   ========================================================================== */
.riddle-rush-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.4s ease;
}

.riddle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.riddle-round {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-color);
    min-width: 0;
    max-width: 100%;
}

.riddle-timer-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 800;
    background: rgba(255, 79, 112, 0.04);
    border: 1px solid var(--card-border);
    padding: 6px 12px;
    border-radius: 20px;
    color: var(--secondary);
    box-shadow: 0 4px 12px rgba(255, 79, 112, 0.03);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.riddle-timer-container.low-time {
    color: var(--danger);
    border-color: var(--danger);
    box-shadow: 0 0 12px var(--danger-glow);
    animation: pulse 1s infinite;
}

.riddle-question-card {
    background: var(--bg-surface, #10131B);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: center;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.riddle-category-difficulty {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.badge-category {
    background: rgba(255, 79, 112, 0.08);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-difficulty {
    background: rgba(139, 92, 246, 0.08);
    color: var(--secondary);
    border: 1px solid var(--secondary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.riddle-question {
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-primary, #F5F3EE);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* Riddle Rush Progressive Letter Hint System */
.riddle-hint-card {
    background: rgba(244, 184, 96, 0.05);
    border: 1px dashed rgba(244, 184, 96, 0.3);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 5px 0;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.riddle-hint-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 500px;
    min-width: 0;
    box-sizing: border-box;
}

.riddle-hint-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gold-primary, #F4B860);
    background: rgba(244, 184, 96, 0.12);
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.riddle-hint-meta {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary, #9B9EAA);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.riddle-hint-slots-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 14px;
    padding: 6px 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.riddle-word-group {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    align-items: center;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.riddle-letter-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 44px;
    background: var(--bg-card, #181C27);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary, #F5F3EE);
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    user-select: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

.riddle-letter-slot.unrevealed {
    color: rgba(155, 158, 170, 0.5);
    background: rgba(24, 28, 39, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
}

.riddle-letter-slot.revealed {
    color: var(--gold-primary, #F4B860);
    background: var(--bg-card, #181C27);
    border-color: var(--gold-primary, #F4B860);
    box-shadow: 0 0 12px rgba(244, 184, 96, 0.25);
}

.riddle-letter-slot.hint-pop {
    animation: hintLetterPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes hintLetterPop {
    0% {
        transform: scale(0.6) rotate(-5deg);
        background: rgba(244, 184, 96, 0.3);
        border-color: var(--gold-primary, #F4B860);
        box-shadow: 0 0 20px rgba(244, 184, 96, 0.6);
    }
    50% {
        transform: scale(1.18) rotate(3deg);
        background: rgba(244, 184, 96, 0.15);
        border-color: var(--gold-primary, #F4B860);
        box-shadow: 0 0 18px rgba(244, 184, 96, 0.4);
    }
    100% {
        transform: scale(1) rotate(0deg);
        background: var(--bg-card, #181C27);
        border-color: var(--gold-primary, #F4B860);
        box-shadow: 0 0 12px rgba(244, 184, 96, 0.25);
    }
}

.riddle-punct-slot {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0 2px;
    align-self: center;
    box-sizing: border-box;
}

.riddle-input-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 480px;
    min-width: 0;
    margin: 0 auto;
    box-sizing: border-box;
}

.riddle-input-area input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background: var(--bg-card, #181C27);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 1.1rem;
    color: var(--text-primary, #F5F3EE);
    outline: none;
    text-align: center;
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.riddle-input-area input:focus {
    border-color: var(--violet, #8B6CFF);
    background: var(--bg-card, #181C27);
    box-shadow: 0 0 15px rgba(139, 108, 255, 0.3);
    color: var(--text-primary, #F5F3EE);
}


.riddle-submit-btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 16px;
    font-size: 1.1rem;
}

.riddle-feedback {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 800;
    animation: fadeIn var(--transition-speed) ease;
}

.riddle-feedback.correct {
    background: rgba(57, 255, 20, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
    box-shadow: 0 0 15px var(--success-glow);
}

.riddle-feedback.wrong {
    background: rgba(255, 0, 85, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
    box-shadow: 0 0 15px var(--danger-glow);
}

.riddle-feedback.waiting {
    background: rgba(255, 79, 112, 0.03);
    color: var(--text-muted);
    border: 1px solid var(--card-border);
}

.riddle-players-status {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.riddle-players-status h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.riddle-players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.riddle-player-card {
    background: rgba(255, 79, 112, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.85rem;
    transition: all var(--transition-speed);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.riddle-player-card span {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    max-width: 100%;
}

.riddle-player-card.ready {
    border-color: var(--card-border);
}

.riddle-player-card.correct {
    border-color: var(--success);
    background: rgba(57, 255, 20, 0.05);
    color: var(--success);
}

.riddle-player-card.wrong {
    border-color: var(--danger);
    background: rgba(255, 0, 85, 0.05);
    color: var(--danger);
}

/* Round Results Section */
.riddle-results-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.riddle-reveal-card {
    background: rgba(255, 79, 112, 0.05);
    border: 1px solid var(--primary);
    box-shadow: 0 4px 15px rgba(255, 79, 112, 0.1);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.riddle-reveal-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.riddle-reveal-ans {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--success);
    text-shadow: 0 0 12px var(--success-glow);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.riddle-reveal-exp {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
    font-style: italic;
}

.round-results-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.round-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 0.95rem;
}

.round-result-row.correct {
    border-color: var(--success);
    background: rgba(57, 255, 20, 0.03);
}

.round-result-row.wrong {
    border-color: var(--danger);
    background: rgba(255, 0, 85, 0.03);
}

.round-result-player {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.round-result-player i {
    font-size: 1.1rem;
}

.round-result-player.correct i { color: var(--success); }
.round-result-player.wrong i { color: var(--danger); }

.round-result-details {
    display: flex;
    align-items: center;
    gap: 15px;
}

.result-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.result-points {
    font-weight: 800;
    color: #fff;
}

.round-result-row.correct .result-points {
    color: var(--secondary);
    text-shadow: 0 0 8px var(--secondary-glow);
}

.results-action-area {
    margin-top: 15px;
    display: flex;
    justify-content: center;
}

/* Final Leaderboard Podium Design */
.final-results-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 30px;
    text-align: center;
}

.final-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 15px;
    margin: 30px 0 10px 0;
    min-height: 220px;
}

.podium-slot {
    flex: 1;
    max-width: 130px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 12px 12px 8px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px 10px;
    position: relative;
    transition: transform var(--transition-speed);
}

.podium-slot:hover {
    transform: translateY(-5px);
}

.podium-rank {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: #000;
}

.podium-slot.rank-1 {
    min-height: 210px;
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}
.podium-slot.rank-1 .podium-rank {
    background: linear-gradient(135deg, #ffe066 0%, #ffd700 100%);
    color: #5d4037;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.podium-slot.rank-2 {
    min-height: 180px;
    border-color: #c0c0c0;
    background: rgba(192, 192, 192, 0.05);
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.15);
}
.podium-slot.rank-2 .podium-rank {
    background: linear-gradient(135deg, #e5e7eb 0%, #c0c0c0 100%);
    box-shadow: 0 0 8px rgba(192, 192, 192, 0.4);
}

.podium-slot.rank-3 {
    min-height: 155px;
    border-color: #cd7f32;
    background: rgba(205, 127, 50, 0.05);
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.15);
}
.podium-slot.rank-3 .podium-rank {
    background: linear-gradient(135deg, #edbb99 0%, #cd7f32 100%);
    box-shadow: 0 0 8px rgba(205, 127, 50, 0.4);
}

.podium-name {
    font-weight: 800;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.podium-score {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.podium-slot.rank-1 .podium-score {
    color: #ffd700;
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.3);
}

.podium-trophy {
    position: absolute;
    top: -24px;
    font-size: 1.8rem;
    animation: float 4s ease-in-out infinite;
}

.podium-slot.rank-1 .podium-trophy { color: #ffd700; }
.podium-slot.rank-2 .podium-trophy { color: #c0c0c0; }
.podium-slot.rank-3 .podium-trophy { color: #cd7f32; }

.final-leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 500px;
    margin: 10px auto;
    width: 100%;
}

.leaderboard-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 0.9rem;
}

.leaderboard-row-player {
    display: flex;
    align-items: center;
    gap: 12px;
}

.leaderboard-rank-badge {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
}

.leaderboard-row-score {
    font-weight: 800;
    color: var(--secondary);
}

.final-actions {
    margin-top: 25px;
    display: flex;
    gap: 15px;
    justify-content: center;
    width: 100%;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}

.final-actions .btn {
    flex: 1;
}

/* ==========================================================================
   NEW LOBBY LAYOUT & CHAT SYSTEM
   ========================================================================== */
.lobby-layout {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 20px;
    align-items: stretch;
    min-height: 520px;
    width: 100%;
}

@media (max-width: 820px) {
    .lobby-layout {
        grid-template-columns: 1fr;
    }
}

.lobby-left-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lobby-right-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
}

.lobby-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
}

.lobby-voice-control {
    display: flex;
    align-items: center;
}

.lobby-voice-control .btn-voice {
    width: auto !important;
    padding: 8px 18px !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    border-radius: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.lobby-voice-control .btn-voice:hover {
    transform: scale(1.03);
}

.lobby-room-code-panel {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.room-code-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.room-code-badge-new {
    display: flex;
    align-items: center;
    gap: 12px;
}

.room-code-badge-new #lobby-code-display {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--secondary);
    text-shadow: 0 0 10px var(--secondary-glow);
}

/* Lobby Game / Host Panel */
.lobby-game-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.host-controls-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.host-button-row {
    display: flex;
    gap: 10px;
}

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

.player-waiting-area {
    padding: 10px 0;
    text-align: center;
}

.wait-message {
    font-size: 0.95rem;
    font-weight: 600;
}

/* Chat Layout */
.chat-panel {
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 480px;
}

.chat-header {
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 12px;
    margin-bottom: 10px;
}

.chat-header h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 5px;
    margin-bottom: 15px;
    max-height: 380px;
    min-height: 250px;
}

.chat-messages-container::-webkit-scrollbar {
    width: 6px;
}
.chat-messages-container::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.chat-messages-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-message-bubble {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    animation: fadeIn 0.2s ease;
}

.chat-message-bubble.self {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary) 0%, #ff3b60 100%);
    color: #fff;
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 10px var(--primary-glow);
}

.chat-message-bubble.other {
    align-self: flex-start;
    background: rgba(255, 79, 112, 0.05);
    color: var(--text-color);
    border-bottom-left-radius: 2px;
    border: 1px solid var(--card-border);
}

.chat-message-author {
    font-size: 0.75rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.chat-message-bubble.self .chat-message-author {
    color: var(--secondary);
}

.chat-message-bubble.other .chat-message-author {
    color: var(--text-muted);
}

.chat-message-text {
    word-break: break-word;
}

.chat-system-message {
    align-self: center;
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-muted);
    background: rgba(255, 79, 112, 0.03);
    padding: 6px 12px;
    border-radius: 15px;
    border: 1px solid var(--card-border);
    text-align: center;
    margin: 4px 0;
    width: 90%;
}

.chat-input-area {
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    background: var(--bg-card, #181C27);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    padding: 10px 15px;
    font-family: var(--font-main);
    color: var(--text-primary, #F5F3EE);
    outline: none;
    font-size: 0.9rem;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.chat-input-area input:focus {
    background: var(--bg-card, #181C27);
    border-color: var(--gold-primary, #F4B860);
    box-shadow: 0 0 10px var(--gold-glow);
    color: var(--text-primary, #F5F3EE);
}


.chat-input-area .btn {
    width: auto;
    padding: 10px 15px;
    border-radius: 10px;
}

/* Global Post-Game Navigation */
.post-game-nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding: 15px 25px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    width: 100%;
    box-sizing: border-box;
}

.post-game-nav-container .btn {
    flex: 1;
    max-width: 250px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 800;
}

@media (max-width: 600px) {
    .post-game-nav-container {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    .post-game-nav-container .btn {
        max-width: 100%;
        width: 100%;
    }
}

/* Glassmorphism Selectable Game Cards */
.modal-game-item {
    background: rgba(255, 79, 112, 0.03);
    border: 1px solid var(--card-border, rgba(255, 79, 112, 0.12));
    padding: 14px 18px;
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-speed);
    margin-bottom: 10px;
}

.modal-game-item:hover {
    border-color: var(--primary);
    background: rgba(255, 79, 112, 0.08);
    box-shadow: 0 4px 15px rgba(255, 79, 112, 0.1);
}

.modal-game-item.selected {
    border-color: var(--primary);
    background: rgba(255, 79, 112, 0.12);
    box-shadow: 0 0 15px rgba(255, 79, 112, 0.2);
}

.modal-game-item-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.modal-game-icon {
    font-size: 2rem;
}

.modal-game-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-game-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary, #F5F3EE);
}

.modal-game-desc {
    font-size: 0.82rem;
    color: var(--text-secondary, #9B9EAA);
}

.modal-game-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--card-border, rgba(255, 79, 112, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-game-item.selected .modal-game-radio {
    border-color: var(--primary);
    background: var(--primary);
}

.modal-game-radio-inner {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    transition: all 0.2s;
}

.modal-game-item.selected .modal-game-radio-inner {
    background: #FFFFFF;
}

/* Custom Modal scrollbar */
.modal-game-list::-webkit-scrollbar {
    width: 6px;
}
.modal-game-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
}
.modal-game-list::-webkit-scrollbar-thumb {
    background: rgba(255, 79, 112, 0.2);
    border-radius: 10px;
}
.modal-game-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ==========================================================================
   GLOBAL PRE-GAME SYSTEM STYLES (SWARAG BRAND IDENTITY)
   ========================================================================== */

.pre-game-card {
    max-width: 650px;
    width: 90%;
    margin: 40px auto;
    padding: 35px 30px;
    text-align: center;
    border-radius: 20px;
    background: var(--bg-surface, #10131B);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    animation: fadeInScale 0.3s ease-out;
}

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

.pre-game-header {
    margin-bottom: 25px;
}

.pre-game-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.pre-game-icon {
    font-size: 2.5rem;
}

.pre-game-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary, #F5F3EE);
    letter-spacing: 0.5px;
}

.pre-game-desc {
    font-size: 1rem;
    color: var(--text-secondary, #9B9EAA);
    max-width: 500px;
    margin: 0 auto;
}

.pre-game-host-badge {
    display: inline-block;
    background: rgba(244, 184, 96, 0.10);
    border: 1px solid rgba(244, 184, 96, 0.25);
    color: var(--gold-primary, #F4B860);
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    margin-bottom: 25px;
}

.pre-game-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.pre-game-actions .btn {
    min-width: 160px;
    padding: 12px 24px;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 30px;
    cursor: pointer;
    opacity: 1 !important;
    pointer-events: auto !important;
}

#btn-pregame-tutorial {
    background: rgba(139, 92, 246, 0.12);
    border: 1.5px solid rgba(139, 92, 246, 0.35);
    color: #A78BFA;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

#btn-pregame-tutorial:hover {
    background: rgba(139, 92, 246, 0.22);
    border-color: #8B5CF6;
    color: #F5F3EE;
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
}

#btn-pregame-ready {
    background: rgba(244, 184, 96, 0.10);
    border: 1.5px solid var(--gold-primary, #F4B860);
    color: var(--gold-primary, #F4B860);
}

#btn-pregame-ready:hover {
    background: rgba(244, 184, 96, 0.20);
    box-shadow: 0 0 20px rgba(244, 184, 96, 0.35);
    transform: translateY(-2px);
}

.btn-ready-active {
    background: linear-gradient(135deg, rgba(71, 209, 140, 0.2) 0%, rgba(16, 185, 129, 0.3) 100%) !important;
    border: 1.5px solid #47D18C !important;
    color: #47D18C !important;
    box-shadow: 0 0 20px rgba(71, 209, 140, 0.35) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.btn-ready-active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(71, 209, 140, 0.45) !important;
}

.pre-game-players-container {
    background: var(--bg-card, #181C27);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 25px;
    text-align: left;
}

.pre-game-players-container .players-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.pre-game-players-container .players-header h3 {
    color: var(--text-primary, #F5F3EE);
    font-size: 0.95rem;
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    font-weight: 700;
    letter-spacing: 1px;
}

.pregame-players-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.pregame-player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--bg-surface, #10131B);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    color: var(--text-primary, #F5F3EE);
    font-weight: 600;
    font-size: 0.95rem;
}

.pregame-player-item.is-you {
    border: 1px solid rgba(244, 184, 96, 0.35);
    background: var(--bg-surface, #10131B);
    box-shadow: 0 0 12px rgba(244, 184, 96, 0.1);
}

.pregame-player-item strong {
    color: var(--gold-primary, #F4B860) !important;
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.ready-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
}

.ready-indicator.is-ready {
    background: rgba(71, 209, 140, 0.10);
    border: 1px solid rgba(71, 209, 140, 0.30);
    color: #47D18C;
}

.ready-indicator.not-ready {
    background: rgba(155, 158, 170, 0.08);
    border: 1px solid rgba(155, 158, 170, 0.18);
    color: #9B9EAA;
}

.pre-game-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pregame-tooltip {
    font-size: 0.85rem;
    color: var(--text-secondary, #9B9EAA);
    margin-top: 6px;
}

#btn-pregame-back,
.style-back-to-room {
    background: var(--bg-card, #181C27) !important;
    color: var(--text-secondary, #9B9EAA) !important;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08)) !important;
    min-height: 48px !important;
    border-radius: 12px !important;
    font-family: var(--font-display, 'Space Grotesk', sans-serif) !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    letter-spacing: 0.5px !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    width: 100% !important;
}

#btn-pregame-back:hover,
.style-back-to-room:hover {
    background: var(--bg-card, #181C27) !important;
    color: var(--text-primary, #F5F3EE) !important;
    border-color: var(--gold-primary, #F4B860) !important;
    box-shadow: 0 0 16px rgba(244, 184, 96, 0.2) !important;
    transform: translateY(-1px) !important;
}

#btn-pregame-back:focus-visible,
.style-back-to-room:focus-visible {
    outline: 2px solid var(--gold-primary, #F4B860) !important;
    outline-offset: 2px !important;
}

/* Modal Overlay Base Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(36, 25, 35, 0.45);
    backdrop-filter: blur(8px);
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay.hidden {
    display: none !important;
    pointer-events: none !important;
}

.modal-card {
    background: var(--bg-surface, #10131B);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: var(--border-radius, 20px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    padding: 30px;
    max-width: 520px;
    width: 92%;
    margin: 0 auto;
    color: var(--text-primary, #F5F3EE);
    position: relative;
    box-sizing: border-box;
}

.modal-card h3 {
    color: var(--text-primary, #F5F3EE);
    font-weight: 800;
}

.modal-card p {
    color: var(--text-secondary, #9B9EAA);
}

/* Tutorial Modal Styles */
.tutorial-modal-card {
    max-width: 620px;
    width: 92%;
    max-height: 85vh;
    padding: 25px 30px;
    border-radius: 20px;
    background: var(--bg-surface, #10131B);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    text-align: left;
    display: flex;
    flex-direction: column;
}

.tutorial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    padding-bottom: 12px;
}

.tutorial-header h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary, #F5F3EE);
}

.btn-icon-close {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: var(--text-secondary, #9B9EAA);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.btn-icon-close:hover {
    color: var(--gold-primary, #F4B860);
}

.tutorial-body {
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 8px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    color: var(--text-primary, #F5F3EE);
}

.tutorial-body::-webkit-scrollbar {
    width: 6px;
}
.tutorial-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
}
.tutorial-body::-webkit-scrollbar-thumb {
    background: rgba(244, 184, 96, 0.2);
    border-radius: 10px;
}
.tutorial-body::-webkit-scrollbar-thumb:hover {
    background: var(--gold-primary, #F4B860);
}

.tutorial-section h4 {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--gold-primary, #F4B860);
    letter-spacing: 1px;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.tutorial-section p, .tutorial-section ol {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary, #F5F3EE);
}

.tutorial-section ol {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tutorial-grid-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    background: var(--bg-card, #181C27);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--text-primary, #F5F3EE);
}

.tutorial-footer {
    margin-top: 20px;
    text-align: right;
}

/* ==========================================================================
   GLOBAL COUNTDOWN OVERLAY
   ========================================================================== */

.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 9, 13, 0.85);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.countdown-overlay.hidden {
    display: none !important;
    pointer-events: none !important;
}

.countdown-card {
    text-align: center;
    padding: 40px 60px;
    border-radius: 30px;
    background: var(--bg-surface, #10131B);
    border: 2px solid var(--gold-primary, #F4B860);
    box-shadow: 0 0 40px rgba(244, 184, 96, 0.3);
    animation: countdownPulse 1s infinite alternate;
}

.countdown-number {
    font-size: 5.5rem;
    font-weight: 900;
    color: var(--primary, #FF4F70);
    text-shadow: 0 0 20px rgba(255, 79, 112, 0.4);
    display: block;
    line-height: 1;
    margin-bottom: 10px;
}

.countdown-subtitle {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-primary, #F5F3EE);
    text-transform: uppercase;
}

@keyframes countdownPulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .pre-game-card {
        padding: 25px 18px;
        margin: 20px auto;
    }
    .pre-game-title {
        font-size: 1.5rem;
    }
    .pre-game-actions {
        flex-direction: column;
        gap: 12px;
    }
    .pre-game-actions .btn {
        width: 100%;
    }
    .countdown-number {
        font-size: 4rem;
    }
    .countdown-card {
        padding: 30px 40px;
    }
}

@keyframes countdownPulse {
    from { transform: scale(1); }
    to { transform: scale(1.06); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .pre-game-card {
        padding: 25px 18px;
        margin: 20px auto;
    }
    .pre-game-title {
        font-size: 1.5rem;
    }
    .pre-game-actions {
        flex-direction: column;
        gap: 12px;
    }
    .pre-game-actions .btn {
        width: 100%;
    }
    .countdown-number {
        font-size: 4.5rem;
    }
    .countdown-card {
        padding: 30px 40px;
    }
}

/* Real-time Player Status Badges in Private Room */
.status-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.5px;
}

.status-badge-playing {
    background: rgba(16, 185, 129, 0.12);
    color: #10B981;
    border: 1.5px solid #10B981;
}

.status-badge-in-room {
    background: rgba(59, 130, 246, 0.12);
    color: #3B82F6;
    border: 1.5px solid #3B82F6;
}

.status-badge-offline {
    background: rgba(156, 163, 175, 0.12);
    color: #9CA3AF;
    border: 1.5px solid #9CA3AF;
}

/* Exit Game HUD Button */
.hud-exit-item {
    margin-left: auto;
}

.btn-exit-game {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.btn-exit-game:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

/* ==========================================================================
   COMPACT REUSABLE FLOATING VOICE WIDGET
   ========================================================================== */
#voice-widget-floating,
.voice-widget-floating {
    position: fixed !important;
    z-index: 9999 !important;
    display: flex !important;
    flex-direction: column !important;
    width: auto !important;
    max-width: 280px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: auto !important;
    box-sizing: border-box !important;
}

/* Dedicated Desktop / Laptop Layout (min-width: 769px) */
@media (min-width: 769px) {
    #voice-widget-floating,
    .voice-widget-floating {
        bottom: 24px !important;
        left: 24px !important;
        right: auto !important;
        top: auto !important;
        align-items: flex-start !important;
    }

    .voice-widget-popover {
        left: 0 !important;
        right: auto !important;
        width: 260px !important;
        transform-origin: bottom left !important;
    }
}

/* Mobile & Android Layout - Preserved Exactly (max-width: 768px) */
@media (max-width: 768px) {
    #voice-widget-floating,
    .voice-widget-floating {
        bottom: 12px !important;
        right: 12px !important;
        left: auto !important;
        top: auto !important;
        align-items: flex-end !important;
    }

    .voice-widget-popover {
        width: 240px !important;
        transform-origin: bottom right !important;
    }
}

#voice-widget-floating.hidden,
.voice-widget-floating.hidden {
    display: none !important;
}

.voice-widget-trigger {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    border-radius: 50% !important;
    background: var(--bg-surface, #10131B) !important;
    border: 1.5px solid var(--gold-primary, #F4B860) !important;
    color: var(--gold-primary, #F4B860) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.2rem !important;
    cursor: pointer !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 14px rgba(244, 184, 96, 0.25) !important;
    position: relative !important;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
}

.voice-widget-trigger:hover {
    transform: scale(1.08) !important;
    background: var(--bg-card, #181C27) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 20px rgba(244, 184, 96, 0.4) !important;
}

.voice-badge-count,
#voice-participant-count {
    position: absolute !important;
    top: -4px !important;
    right: -4px !important;
    background: var(--gold-primary, #F4B860) !important;
    color: #08090D !important;
    font-family: var(--font-display, 'Space Grotesk', sans-serif) !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    border-radius: 50% !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border: 2px solid var(--bg-surface, #10131B) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
    line-height: 1 !important;
    z-index: 2 !important;
}

.voice-widget-popover {
    max-width: calc(100vw - 36px) !important;
    background: var(--bg-surface, #10131B) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12)) !important;
    border-radius: 16px !important;
    padding: 14px 16px !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6) !important;
    margin-bottom: 12px !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
    color: var(--text-primary, #F5F3EE) !important;
}

.voice-widget-floating.collapsed .voice-widget-popover {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.voice-popover-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-family: var(--font-display, 'Space Grotesk', sans-serif) !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    letter-spacing: 0.5px !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1)) !important;
    color: var(--text-primary, #F5F3EE) !important;
}

.voice-header-title {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: var(--text-primary, #F5F3EE) !important;
}

.voice-popover-count {
    background: rgba(244, 184, 96, 0.15) !important;
    color: var(--gold-primary, #F4B860) !important;
    border: 1px solid rgba(244, 184, 96, 0.3) !important;
    padding: 2px 8px !important;
    border-radius: 10px !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
}

.voice-popover-list {
    max-height: 160px !important;
    overflow-y: auto !important;
    padding: 8px 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
}

.voice-mini-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    background: var(--bg-card, #181C27) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: var(--text-primary, #F5F3EE) !important;
}

.voice-mini-row .player-nick {
    max-width: 130px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: var(--text-primary, #F5F3EE) !important;
}

.voice-mini-row .voice-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.voice-popover-footer {
    padding-top: 10px !important;
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1)) !important;
    text-align: center !important;
}

.voice-popover-footer .btn-voice {
    width: 100% !important;
    padding: 7px 12px !important;
    font-size: 0.82rem !important;
    border-radius: 8px !important;
}

@media (max-width: 480px) {
    #voice-widget-floating,
    .voice-widget-floating {
        bottom: 12px !important;
        right: 12px !important;
    }
    
    .voice-widget-trigger {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        font-size: 1.05rem !important;
    }
    
    .voice-widget-popover {
        width: 225px !important;
        padding: 10px 12px !important;
    }

    .voice-popover-footer .btn-voice {
        min-height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* Disabled Button Visual Enhancements */
button:disabled,
.btn:disabled,
.btn.disabled {
    opacity: 0.55 !important;
    cursor: not-allowed !important;
    filter: grayscale(40%) !important;
    transform: none !important;
    box-shadow: none !important;
    pointer-events: none !important;
}

/* Global Toast Notification Styling */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11000;
    padding: 12px 24px;
    border-radius: 12px;
    background: rgba(16, 19, 27, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    animation: toastSlideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 90vw;
    text-align: center;
}

.toast.error {
    border-color: rgba(225, 29, 72, 0.4);
    color: var(--text-primary);
    background: rgba(24, 28, 39, 0.96);
}

.toast-icon {
    font-size: 1.1rem;
    color: var(--gold-primary);
}

.toast.error .toast-icon {
    color: var(--crimson);
}

@keyframes toastSlideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Responsive Game HUD Styling */
@media (max-width: 768px) {
    .game-hud {
        padding: 12px 18px;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .hud-item {
        font-size: 0.85rem;
    }
    
    .hud-value {
        font-size: 1rem;
    }
    
    .btn-exit-game {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .game-hud {
        padding: 10px 14px;
        gap: 8px;
    }
    
    .hud-value {
        font-size: 0.9rem;
    }
    
    .btn-exit-game {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   SWARAG OBSIDIAN BRAND SPLASH / INTRO REVEAL SCREEN
   ========================================================================== */
.swarag-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 99999;
    background-color: var(--bg-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.45s ease;
    will-change: opacity, transform;
}

.splash-ambient-bg {
    position: absolute;
    width: 650px;
    height: 650px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(244, 184, 96, 0.07) 0%, rgba(8, 9, 13, 0) 70%);
    pointer-events: none;
    animation: ambientPulse 4s ease-in-out infinite alternate;
}

@keyframes ambientPulse {
    0% { transform: scale(0.95); opacity: 0.7; }
    100% { transform: scale(1.1); opacity: 1; }
}

/* Floating Particles */
.splash-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.splash-particles .particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--gold-primary);
    border-radius: 50%;
    opacity: 0;
    filter: blur(1px);
    animation: particleFloat 3.5s ease-in-out infinite;
}

.particle.p-1 { top: 25%; left: 20%; animation-delay: 0.1s; }
.particle.p-2 { top: 70%; left: 80%; animation-delay: 0.6s; }
.particle.p-3 { top: 80%; left: 30%; animation-delay: 1.2s; }
.particle.p-4 { top: 20%; left: 75%; animation-delay: 1.8s; }

@keyframes particleFloat {
    0% { opacity: 0; transform: translateY(10px) scale(0.8); }
    50% { opacity: 0.4; transform: translateY(-15px) scale(1.2); }
    100% { opacity: 0; transform: translateY(-30px) scale(0.8); }
}

/* Constellation Nodes for 8 Games */
.splash-game-constellation {
    position: absolute;
    width: 100%;
    max-width: 650px;
    height: 420px;
    pointer-events: none;
    opacity: 0;
    animation: constellationFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.2s forwards;
}

@keyframes constellationFadeIn {
    to { opacity: 0.16; }
}

.constellation-node {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: rgba(24, 28, 39, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    animation: floatNode 4s ease-in-out infinite alternate;
}

.node-riddle { top: 10%; left: 10%; color: var(--violet); animation-delay: 0s; }
.node-draw { top: 12%; right: 12%; color: var(--coral); animation-delay: 0.4s; }
.node-story { bottom: 18%; left: 8%; color: var(--orange); animation-delay: 0.8s; }
.node-number { bottom: 15%; right: 10%; color: var(--cyan); animation-delay: 1.2s; }
.node-memory { top: 48%; left: 2%; color: var(--green); animation-delay: 1.6s; }
.node-cards { top: 52%; right: 4%; color: var(--gold-primary); animation-delay: 2.0s; }
.node-imposter { top: -2%; left: 48%; color: var(--crimson); animation-delay: 0.3s; }
.node-remember { bottom: -2%; right: 46%; color: var(--blue); animation-delay: 1.1s; }

@keyframes floatNode {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}

/* Central Content Card */
.splash-content-card {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 44px 36px;
    max-width: 440px;
    width: 88%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(244, 184, 96, 0.05);
}

.splash-brand-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.splash-logo-badge {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(244, 184, 96, 0.18);
    opacity: 0;
    overflow: hidden;
    animation: emblemReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.25s forwards;
}

@keyframes emblemReveal {
    0% { opacity: 0; transform: scale(0.85); }
    100% { opacity: 1; transform: scale(1); }
}

.splash-light-sweep {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: lightSweep 2.5s ease-in-out infinite 0.7s;
}

@keyframes lightSweep {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

.splash-logo-icon {
    font-size: 2.1rem;
    color: var(--gold-primary);
}

.splash-brand-title {
    font-family: var(--font-display);
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: 5px;
    line-height: 1;
    color: var(--text-primary);
    margin: 0;
    opacity: 0;
    animation: titleReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.55s forwards;
}

@keyframes titleReveal {
    0% { opacity: 0; transform: translateY(8px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.splash-tagline {
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gold-primary);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: 24px;
    opacity: 0;
    animation: taglineReveal 0.5s ease-out 0.9s forwards;
}

@keyframes taglineReveal {
    0% { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Subtle Loading Indicator */
.splash-loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 6px;
    opacity: 0;
    animation: loaderReveal 0.5s ease-out 1.2s forwards;
}

@keyframes loaderReveal {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.splash-loader-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 3px;
    color: var(--gold-primary);
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
}

.splash-dots span {
    opacity: 0;
    animation: splashDotFade 1.4s infinite;
}

.splash-dots span:nth-child(1) { animation-delay: 0s; }
.splash-dots span:nth-child(2) { animation-delay: 0.3s; }
.splash-dots span:nth-child(3) { animation-delay: 0.6s; }

@keyframes splashDotFade {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.splash-loader-bar {
    width: 160px;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.splash-loader-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--gold-primary, #F4B860), var(--cyan, #42D9E8));
    border-radius: 4px;
    animation: splashProgressFill 8s linear forwards;
    box-shadow: 0 0 8px rgba(244, 184, 96, 0.6);
}

@keyframes splashProgressFill {
    0% { width: 0%; }
    100% { width: 100%; }
}

.swarag-splash.splash-fade-out {
    opacity: 0;
    transform: scale(1.02);
    pointer-events: none !important;
}

/* Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .splash-logo-badge, .splash-brand-title, .splash-tagline, .splash-game-constellation, .splash-loader-container {
        opacity: 1 !important;
        animation: none !important;
        transform: none !important;
    }
}


/* ==========================================================================
   LANDING PAGE STYLES (MOBILE-FIRST)
   ========================================================================== */
#view-landing {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: 40px;
}

/* Landing Navigation Bar */
.landing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    max-width: 1200px;
    margin: 0 auto;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(8, 9, 13, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.logo-badge-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-accent {
    font-size: 1.1rem;
    color: var(--gold-primary);
}

.brand-wordmark {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-primary);
}

.mobile-nav-toggle {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 1.2rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.landing-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: color var(--transition-speed);
}

.nav-link:hover {
    color: var(--text-primary);
}

.btn-lp-nav-play {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.btn-lp-nav-play:hover {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
}

/* Landing Hero Container */
.landing-hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px 60px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gold-primary);
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.badge-icon {
    font-size: 0.85rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.text-gold-accent {
    color: var(--gold-primary);
}

.hero-subtitle {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 520px;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.btn-lp-primary {
    background: var(--gold-primary);
    color: #08090D;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fz-base);
    padding: 14px 28px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    transition: transform var(--transition-speed), background-color var(--transition-speed), box-shadow var(--transition-speed);
}

.btn-lp-primary:hover {
    background: var(--gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--gold-glow);
}

.btn-lp-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--fz-base);
    padding: 14px 24px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    transition: all var(--transition-speed);
}

.btn-lp-secondary:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: var(--bg-card);
}

.hero-no-signup {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Mock Lobby Card (Hero Visual - Issue #7 & #9 Fixes) */
.mock-lobby-card {
    background: rgba(14, 17, 24, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.mock-lobby-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 16px;
}

.mock-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
}

.mock-lobby-title {
    font-family: var(--font-display);
    font-size: var(--fz-sm);
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.mock-game-count-badge {
    font-family: var(--font-display);
    font-size: var(--fz-xs);
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--gold-primary);
    background: rgba(244, 184, 96, 0.12);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(244, 184, 96, 0.2);
}

.mock-lobby-games {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 16px;
    max-height: 275px;
    overflow-y: auto;
    padding-right: 4px;
}

.mock-lobby-games::-webkit-scrollbar {
    width: 4px;
}

.mock-lobby-games::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}

.mock-game-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(24, 28, 39, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    font-size: var(--fz-sm);
    font-weight: 500;
    transition: border-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.mock-game-row:hover {
    border-color: var(--border-hover);
    transform: translateX(3px);
}

.mock-game-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-icon-pill {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fz-sm);
}

.icon-violet { background: rgba(139, 108, 255, 0.18); color: var(--violet); }
.icon-coral { background: rgba(255, 100, 124, 0.18); color: var(--coral); }
.icon-orange { background: rgba(255, 138, 61, 0.18); color: var(--orange); }
.icon-cyan { background: rgba(66, 217, 232, 0.18); color: var(--cyan); }
.icon-gold { background: rgba(244, 184, 96, 0.18); color: var(--gold-primary); }
.icon-crimson { background: rgba(225, 29, 72, 0.18); color: var(--crimson); }
.icon-green { background: rgba(71, 209, 140, 0.18); color: var(--green); }
.icon-blue { background: rgba(59, 130, 246, 0.18); color: var(--blue); }

.mock-row-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mock-player-count {
    font-size: var(--fz-xs);
    color: var(--text-muted);
}

.mock-play-indicator {
    font-family: var(--font-display);
    font-size: var(--fz-xs);
    font-weight: 700;
    color: var(--gold-primary);
}

.chaos-meter-container {
    background: rgba(24, 28, 39, 0.65);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-top: 16px;
    margin-bottom: 18px;
}

.chaos-meter-header {
    display: flex;
    justify-content: space-between;
    font-size: var(--fz-xs);
    font-weight: 600;
    margin-bottom: 8px;
}

.chaos-meter-title { color: var(--text-muted); letter-spacing: 0.5px; }
.chaos-level-text { color: var(--gold-primary); }

.chaos-meter-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.chaos-meter-fill {
    width: 85%;
    height: 100%;
    background: linear-gradient(90deg, var(--gold-primary) 0%, var(--coral) 100%);
    border-radius: var(--radius-pill);
}

.mock-lobby-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--fz-sm);
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

.mock-room-code-label {
    color: var(--text-secondary);
}

.text-gold {
    font-family: var(--font-display);
    color: var(--gold-primary);
    letter-spacing: 1px;
}

.mock-status-indicator {
    font-size: var(--fz-xs);
    font-weight: 500;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.5px;
}

.status-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    animation: statusPulse 2s infinite ease-in-out;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* Landing Sections Common */
.landing-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px;
}

.section-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 40px;
}

.section-badge {
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--gold-primary);
    text-transform: uppercase;
    display: block;
    margin-bottom: 8px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Games Showcase Library Grid */
.games-showcase-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.game-show-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition-speed), border-color var(--transition-speed), box-shadow var(--transition-speed);
    display: flex;
    flex-direction: column;
}

.game-show-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.game-show-card:focus-visible {
    outline: 2px solid var(--gold-primary);
    outline-offset: 4px;
    border-color: var(--gold-primary);
}

.game-card-banner,
.game-card-visual {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.banner-violet, .gc-riddle .game-card-visual { background: radial-gradient(circle at center, rgba(139, 108, 255, 0.3) 0%, rgba(16, 19, 27, 0.95) 80%); border-bottom: 1px solid rgba(139, 108, 255, 0.2); }
.banner-coral, .gc-draw .game-card-visual { background: radial-gradient(circle at center, rgba(255, 100, 124, 0.3) 0%, rgba(16, 19, 27, 0.95) 80%); border-bottom: 1px solid rgba(255, 100, 124, 0.2); }
.banner-orange, .gc-story .game-card-visual { background: radial-gradient(circle at center, rgba(255, 138, 61, 0.3) 0%, rgba(16, 19, 27, 0.95) 80%); border-bottom: 1px solid rgba(255, 138, 61, 0.2); }
.banner-cyan, .gc-number .game-card-visual { background: radial-gradient(circle at center, rgba(66, 217, 232, 0.3) 0%, rgba(16, 19, 27, 0.95) 80%); border-bottom: 1px solid rgba(66, 217, 232, 0.2); }
.banner-green, .gc-memory .game-card-visual { background: radial-gradient(circle at center, rgba(71, 209, 140, 0.3) 0%, rgba(16, 19, 27, 0.95) 80%); border-bottom: 1px solid rgba(71, 209, 140, 0.2); }
.banner-gold, .gc-cards .game-card-visual { background: radial-gradient(circle at center, rgba(244, 184, 96, 0.3) 0%, rgba(16, 19, 27, 0.95) 80%); border-bottom: 1px solid rgba(244, 184, 96, 0.2); }
.banner-crimson, .gc-imposter .game-card-visual { background: radial-gradient(circle at center, rgba(225, 29, 72, 0.3) 0%, rgba(16, 19, 27, 0.95) 80%); border-bottom: 1px solid rgba(225, 29, 72, 0.2); }
.banner-blue, .gc-draw-rem .game-card-visual { background: radial-gradient(circle at center, rgba(59, 130, 246, 0.3) 0%, rgba(16, 19, 27, 0.95) 80%); border-bottom: 1px solid rgba(59, 130, 246, 0.2); }

.game-card-img {
    width: 100%;
    height: 100%;
    max-height: 120px;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}

.game-show-card:hover .game-card-img,
.game-card:hover .game-card-img {
    transform: scale(1.03);
}

.game-card-emoji {
    font-size: 2.8rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.game-tag {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(8, 9, 13, 0.6);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: 99px;
    border: 1px solid var(--border-subtle);
}

.game-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.game-card-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.game-card-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 20px;
    flex: 1;
}

.game-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.meta-item {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-card-action {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gold-primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(244, 184, 96, 0.1);
    border: 1px solid rgba(244, 184, 96, 0.25);
    cursor: pointer;
    transition: all 0.2s ease;
}

.game-show-card:hover .btn-card-action,
.game-show-card:focus-visible .btn-card-action {
    background: var(--gold-primary);
    color: #08090D;
    border-color: var(--gold-primary);
    box-shadow: 0 0 12px var(--gold-glow);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 28px;
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 18px;
}

.feature-card h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* Timeline Step */
.timeline-container {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.timeline-step {
    flex: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 28px;
}

.step-badge {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold-primary);
    background: rgba(244, 184, 96, 0.12);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.timeline-step h3 {
    font-family: var(--font-display);
    font-size: var(--fz-md);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.timeline-step p {
    font-size: var(--fz-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}

.timeline-divider {
    color: var(--gold-primary);
    background: rgba(244, 184, 96, 0.15);
    border: 1px solid rgba(244, 184, 96, 0.3);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-top: 42px;
    flex-shrink: 0;
    box-shadow: 0 0 16px var(--gold-glow);
}

/* Final CTA Section */
.section-final-cta {
    padding: 40px 24px 60px;
}

.final-cta-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 48px 32px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.final-cta-title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.final-cta-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

/* Footer */
.landing-footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 20px;
    border-top: 1px solid var(--border-subtle);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-primary);

}

.footer-tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color var(--transition-speed);
}

.footer-link:hover {
    color: var(--gold-primary);
}

.footer-bottom {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* ==========================================================================
   MOBILE-FIRST RESPONSIVE DESIGN (360px, 390px, 412px, 768px)
   ========================================================================== */
@media (max-width: 992px) {
    .landing-hero-container {
        grid-template-columns: 1fr;
        padding: 32px 20px 40px;
        gap: 32px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .timeline-container {
        flex-direction: column;
        gap: 16px;
    }

    .timeline-divider {
        display: none;
    }
}

@media (max-width: 768px) {
    .landing-header {
        padding: 14px 18px;
    }

    .mobile-nav-toggle {
        display: flex;
    }

    .landing-nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-subtle);
        flex-direction: column;
        padding: 20px;
        gap: 16px;
        display: none;
    }

    .landing-nav.nav-open {
        display: flex;
    }

    .btn-lp-nav-play {
        width: 100%;
        text-align: center;
        min-height: 48px;
    }

    .hero-title {
        font-size: 2.1rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-lp-primary, .btn-lp-secondary {
        width: 100%;
        min-height: 48px;
    }

    .section-title {
        font-size: 1.7rem;
    }

    .games-showcase-grid,
    .game-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .final-cta-card {
        padding: 32px 20px;
    }

    .final-cta-title {
        font-size: 1.7rem;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
}

@media (max-width: 412px) {
    .hero-title {
        font-size: 1.85rem;
    }

    .splash-brand-title {
        font-size: 2.2rem;
        letter-spacing: 3px;
    }

    .splash-content-card {
        padding: 32px 20px;
    }

    .game-card-banner {
        height: 90px;
    }
}

/* Safe Area Inset Support for Mobile Browsers */
@supports (padding: env(safe-area-inset-bottom)) {
    #view-landing {
        padding-bottom: calc(40px + env(safe-area-inset-bottom));
    }
}

/* ==========================================================================
   PHASE 5 — QUICK PLAY / PLAYER PASS (#view-home)
   ========================================================================== */
.player-pass-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 40px 32px;
    max-width: 460px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
}

.pass-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--gold-primary);
    background: rgba(244, 184, 96, 0.1);
    padding: 5px 12px;
    border-radius: 99px;
    border: 1px solid rgba(244, 184, 96, 0.2);
    margin-bottom: 24px;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold-primary);
    box-shadow: 0 0 6px var(--gold-primary);
}

.input-group {
    margin-bottom: 24px;
    text-align: left;
}

.input-group label {
    display: block;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.input-wrapper input {
    width: 100%;
    height: 52px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 0 16px 0 44px;
    font-family: var(--font-main);
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper input:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 16px var(--gold-glow);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper input:focus ~ .input-icon {
    color: var(--gold-primary);
}

.room-code-input {
    font-family: var(--font-display) !important;
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    letter-spacing: 6px !important;
    text-transform: uppercase !important;
    text-align: center !important;
    padding-left: 16px !important;
}

.btn-block {
    width: 100%;
    justify-content: center;
    min-height: 50px;
}

.btn-lp-outline {
    background: rgba(24, 28, 39, 0.6);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    padding: 12px 24px;
    min-height: 48px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.btn-lp-outline:hover {
    color: var(--text-primary);
    border-color: rgba(244, 184, 96, 0.4);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.btn-lp-outline:active {
    transform: translateY(0);
    background: rgba(244, 184, 96, 0.1);
}

.btn-lp-danger {
    background: rgba(225, 29, 72, 0.15);
    color: var(--crimson);
    border: 1px solid rgba(225, 29, 72, 0.3);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-speed);
}

.btn-lp-danger:hover {
    background: var(--crimson);
    color: #fff;
}

/* ==========================================================================
   PHASE 6 — JOIN & GAME SELECTION (#view-join, #view-game-selection)
   ========================================================================== */
.join-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 40px 32px;
    max-width: 460px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.selection-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 20px;
}

.selection-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 24px;
}

.btn-back-top {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: 10px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.room-creation-card {
    background: var(--bg-surface);
    border: 1.5px solid var(--gold-primary);
    box-shadow: 0 0 25px var(--gold-glow);
    border-radius: 20px;
    padding: 28px 32px;
    margin-top: 28px;
    text-align: center;
    width: 100%;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease;
}

.room-creation-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 18px;
}

.selected-game-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.selected-game-name {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gold-primary);
    text-shadow: 0 0 10px var(--gold-glow);
}

.game-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.game-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.game-card.selected {
    border-color: var(--gold-primary);
    box-shadow: 0 0 24px rgba(244, 184, 96, 0.3), inset 0 0 12px rgba(244, 184, 96, 0.1);
    background: var(--bg-card);
}

/* Accent themes for selection catalog cards */
.gc-riddle, .theme-violet { border-top: 3px solid #8B6CFF; }
.gc-draw, .theme-coral { border-top: 3px solid #FF647C; }
.gc-story, .theme-orange { border-top: 3px solid #FF8A3D; }
.gc-number, .theme-cyan { border-top: 3px solid #42D9E8; }
.gc-memory, .theme-green { border-top: 3px solid #47D18C; }
.gc-cards, .theme-gold { border-top: 3px solid #F4B860; }
.gc-imposter, .theme-crimson { border-top: 3px solid #E11D48; }
.gc-draw-rem, .theme-blue { border-top: 3px solid #3B82F6; }

.gc-riddle.selected { border-color: #8B6CFF; box-shadow: 0 0 24px rgba(139, 108, 255, 0.4); }
.gc-draw.selected { border-color: #FF647C; box-shadow: 0 0 24px rgba(255, 100, 124, 0.4); }
.gc-story.selected { border-color: #FF8A3D; box-shadow: 0 0 24px rgba(255, 138, 61, 0.4); }
.gc-number.selected { border-color: #42D9E8; box-shadow: 0 0 24px rgba(66, 217, 232, 0.4); }
.gc-memory.selected { border-color: #47D18C; box-shadow: 0 0 24px rgba(71, 209, 140, 0.4); }
.gc-cards.selected { border-color: #F4B860; box-shadow: 0 0 24px rgba(244, 184, 96, 0.4); }
.gc-imposter.selected { border-color: #E11D48; box-shadow: 0 0 24px rgba(225, 29, 72, 0.4); }
.gc-draw-rem.selected { border-color: #3B82F6; box-shadow: 0 0 24px rgba(59, 130, 246, 0.4); }

/* ==========================================================================
   PHASE 7 — LOBBY & VOICE (#view-lobby, #voice-widget-floating)
   ========================================================================== */
.lobby-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
    align-items: start;
}

.lobby-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    margin-bottom: 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
}

.room-code-badge-new {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--gold-primary);
    background: var(--bg-card);
    padding: 6px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.btn-icon:hover { color: var(--gold-primary); }

.players-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 24px;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.player-card-item {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.player-card-item.is-host {
    border-color: rgba(244, 184, 96, 0.3);
}

.player-card-item.is-ready {
    border-color: rgba(71, 209, 140, 0.4);
    background: rgba(71, 209, 140, 0.05);
}

.chat-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 520px;
}

.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 6px;
    margin-bottom: 16px;
}

.chat-input-area {
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    height: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 0 14px;
    color: var(--text-primary);
    outline: none;
}

.chat-input-area input:focus {
    border-color: var(--gold-primary);
}

/* Floating Voice Widget */
.voice-widget-floating {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
}

.voice-widget-trigger {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--gold-primary);
    color: var(--gold-primary);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px var(--gold-glow);
    position: relative;
    transition: transform 0.2s ease;
}

.voice-widget-trigger:hover {
    transform: scale(1.08);
}

.voice-badge-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--gold-primary);
    color: #08090D;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-widget-popover {
    position: absolute;
    bottom: 64px;
    right: 0;
    width: 280px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    display: none;
}

.voice-widget-floating:not(.collapsed) .voice-widget-popover {
    display: block;
}

/* ==========================================================================
   PHASE 8 & 9 — PRE-GAME & COUNTDOWN OVERLAY
   ========================================================================== */
.pre-game-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 40px 32px;
    max-width: 580px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.pre-game-actions {
    display: flex;
    gap: 14px;
    margin-bottom: 28px;
}

.pre-game-actions button {
    flex: 1;
    min-height: 48px;
}

.countdown-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(8, 9, 13, 0.94);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.countdown-card {
    text-align: center;
}

.countdown-number {
    font-family: var(--font-display);
    font-size: 8rem;
    font-weight: 700;
    color: var(--gold-primary);
    text-shadow: 0 0 40px var(--gold-glow);
    display: block;
    line-height: 1;
    animation: countdownPulse 0.9s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes countdownPulse {
    0% { transform: scale(0.7); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: scale(1.1); opacity: 0; }
}

.countdown-subtitle {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--text-primary);
    margin-top: 16px;
    text-transform: uppercase;
}

/* ==========================================================================
   PHASE 10 — GAMEPLAY HUD (#view-game)
   ========================================================================== */
.game-container {
    margin: 0 auto;
}

.game-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    margin-bottom: 16px;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hud-label {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.hud-value {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gold-primary);
}

.sandbox-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 24px;
    min-height: 480px;
}

/* Modal overlays */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(8, 9, 13, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 32px 28px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==========================================================================
   MOBILE-FIRST MEDIA QUERIES (360px, 390px, 412px, 768px) & ACCESSIBILITY
   ========================================================================== */
@media (max-width: 868px) {
    .view:not(#view-landing) {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 16px 12px;
        width: 100%;
        max-width: 100%;
        min-height: auto;
        box-sizing: border-box;
    }

    .view#view-game, .view#view-lobby, .view#view-game-selection {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 16px 12px;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    #view-game .game-container {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .game-hud {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        padding: 10px 12px;
        gap: 8px;
    }

    .game-hud .hud-item {
        min-width: 0;
        max-width: 100%;
        flex-shrink: 1;
        box-sizing: border-box;
    }

    .game-hud .hud-value {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }

    .game-hud .hud-brand-logo {
        max-width: 100%;
        height: auto;
    }

    .game-play-area,
    .sandbox-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .lobby-layout {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    
    .chat-panel {
        height: 380px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 600px) {
    .view:not(#view-landing) {
        padding: 16px 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .lobby-layout, .lobby-left-panel, .lobby-right-panel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 0;
        box-sizing: border-box;
    }

    .lobby-header-row {
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: space-between;
        width: 100%;
        box-sizing: border-box;
    }

    .lobby-voice-control {
        flex-shrink: 0;
    }

    .lobby-room-code-panel {
        flex-shrink: 1;
        min-width: 0;
        max-width: 100%;
    }

    .room-code-badge-new {
        font-size: 1.2rem;
        letter-spacing: 2px;
        padding: 4px 10px;
        gap: 8px;
        max-width: 100%;
        box-sizing: border-box;
    }

    #lobby-code-display {
        overflow-wrap: break-word;
        word-break: break-all;
    }

    .host-button-row {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }

    .host-button-row .btn-sm {
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
        text-align: center;
        box-sizing: border-box;
    }

    .game-hud {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }

    .sandbox-card {
        padding: 16px 12px;
    }

    .info-card, .voice-panel, .host-panel, .lobby-game-card, .chat-panel {
        padding: 16px 14px;
        width: 100%;
        box-sizing: border-box;
    }

    .players-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin-left: 0;
        margin-right: 0;
        padding: 16px 14px;
        box-sizing: border-box;
        overflow: hidden;
    }

    .players-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .players-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .player-card, .player-card-item {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        overflow: hidden;
        padding: 12px 14px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .player-header {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 6px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .player-name {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        font-size: 0.95rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: flex;
        align-items: center;
        gap: 6px;
        box-sizing: border-box;
    }

    .status-badge {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        font-size: 0.72rem;
        padding: 3px 8px;
        border-radius: 12px;
        white-space: nowrap;
        flex-shrink: 0;
        max-width: 100%;
        box-sizing: border-box;
        margin-top: 2px;
    }

    .player-status-bar {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.8rem;
        flex-wrap: wrap;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .player-actions-row {
        display: flex;
        gap: 8px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        flex-wrap: wrap;
    }

    .room-creation-card {
        padding: 20px 16px;
        margin-top: 20px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .selected-game-name {
        font-size: 1.3rem;
    }

    /* Game Screen Components (Mobile <=600px) */
    .riddle-rush-wrapper,
    .riddle-results-container {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .riddle-header {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }

    .riddle-round {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        font-size: 0.95rem;
        white-space: nowrap;
    }

    .riddle-timer-container {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        font-size: 0.95rem;
        padding: 4px 10px;
        white-space: nowrap;
    }

    .riddle-question-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        padding: 16px 12px;
        gap: 12px;
        overflow: hidden;
    }

    .riddle-category-difficulty {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .riddle-question {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        font-size: 1.15rem;
        line-height: 1.4;
        overflow-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
    }

    .riddle-hint-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        padding: 12px 8px;
        gap: 10px;
        overflow: hidden;
    }

    .riddle-hint-header {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 6px;
    }

    .riddle-hint-slots-container {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 8px;
    }

    .riddle-word-group {
        display: inline-flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
        align-items: center;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .riddle-letter-slot {
        box-sizing: border-box;
        max-width: 100%;
        min-width: 0;
        width: clamp(24px, 6.2vw, 34px);
        height: clamp(30px, 7.8vw, 40px);
        font-size: clamp(0.85rem, 3.6vw, 1.15rem);
        border-radius: 6px;
        flex-shrink: 1;
    }

    .riddle-punct-slot {
        box-sizing: border-box;
        font-size: 1rem;
        padding: 0 1px;
    }

    .riddle-input-area {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        gap: 10px;
    }

    .riddle-input-area input {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        padding: 12px 14px;
        font-size: 1rem;
    }

    .riddle-submit-btn {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        padding: 12px 14px;
        font-size: 1rem;
    }

    .riddle-players-status {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .riddle-players-grid {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    .riddle-player-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        overflow: hidden;
        padding: 6px 8px;
        font-size: 0.8rem;
    }

    .riddle-player-card span {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .riddle-reveal-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        padding: 16px 12px;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .riddle-reveal-ans {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        font-size: 1.5rem;
        overflow-wrap: break-word;
        word-break: break-word;
    }
}

@media (max-width: 480px) {
    .player-pass-card, .join-card, .pre-game-card {
        padding: 24px 16px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .room-code-input {
        font-size: 1.2rem !important;
        letter-spacing: 4px !important;
    }

    .pre-game-actions {
        flex-direction: column;
    }

    .lobby-exit-container {
        width: 100%;
        box-sizing: border-box;
    }

    #btn-lobby-exit {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .selection-container {
        padding: 20px 14px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    #view-game-selection .game-grid,
    #game-cards-container.game-grid,
    .selection-container .game-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .voice-widget-popover {
        width: calc(100vw - 32px);
        max-width: 280px;
        right: 0;
    }

    /* Mobile Safe Area Inset Support */
    .voice-widget-floating {
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        right: calc(16px + env(safe-area-inset-right, 0px));
    }

    .game-hud-top {
        padding-top: calc(8px + env(safe-area-inset-top, 0px));
    }

    .riddle-question {
        font-size: 1.05rem;
    }

    .riddle-timer-container {
        font-size: 0.88rem;
        padding: 4px 8px;
    }

    .riddle-round {
        font-size: 0.88rem;
    }

    .riddle-letter-slot {
        width: clamp(22px, 6vw, 30px);
        height: clamp(28px, 7.5vw, 36px);
        font-size: clamp(0.8rem, 3.4vw, 1rem);
    }
}


/* Accessible Focus States */
:focus-visible {
    outline: 2px solid var(--gold-primary, #F4B860);
    outline-offset: 2px;
}

/* Accessibility: Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .splash-ambient-bg, .splash-particles, .splash-light-sweep {
        animation: none !important;
    }
}

/* ==========================================================================
   OFFICIAL SWARAG BRAND LOGO INTEGRATION STYLING
   ========================================================================== */

/* Brand Logo Image in Navbar & Cards */
.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.logo-badge-icon {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 12px rgba(244, 184, 96, 0.25);
}

/* Splash Emblem Image */
.splash-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;
    display: block;
}

/* Footer Brand Logo Wrapper */
.footer-logo-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-hover);
    box-shadow: 0 0 10px rgba(244, 184, 96, 0.2);
}

/* Compact In-Game HUD Brand Logo */
.hud-brand-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hud-brand-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--border-hover);
    box-shadow: 0 0 8px rgba(244, 184, 96, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hud-brand-logo:hover {
    transform: scale(1.08);
    box-shadow: 0 0 12px rgba(244, 184, 96, 0.4);
}

/* Mobile Responsive Controls for Official Logo */
@media (max-width: 480px) {
    .logo-badge-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }
    
    .splash-logo-badge {
        width: 58px;
        height: 58px;
        border-radius: 16px;
    }
    
    .hud-brand-logo {
        width: 22px;
        height: 22px;
    }

    .footer-logo-img {
        width: 26px;
        height: 26px;
    }
}

/* ==========================================================================
   STORY CHAOS START MODE CARD STYLES
   ========================================================================== */
.story-mode-card {
    background: rgba(24, 28, 39, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    margin: 16px 0;
    text-align: left;
}

.story-mode-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gold-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.story-mode-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 580px) {
    .story-mode-options {
        grid-template-columns: 1fr;
    }
}

.story-mode-btn {
    background: rgba(16, 19, 27, 0.85);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-speed);
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--text-secondary);
    width: 100%;
}

.story-mode-btn:hover:not(:disabled) {
    border-color: var(--gold-primary);
    background: rgba(244, 184, 96, 0.08);
    transform: translateY(-1px);
}

.story-mode-btn.active {
    border-color: var(--gold-primary);
    background: rgba(244, 184, 96, 0.15);
    box-shadow: 0 0 12px var(--gold-glow);
}

.story-mode-btn.active .mode-btn-title {
    color: var(--gold-primary);
}

.mode-btn-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mode-btn-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.mode-btn-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.story-mode-btn:disabled {
    cursor: default;
    opacity: 0.85;
}

/* ==========================================================================
   RESPONSIVE ADVERTISEMENT PLACEHOLDERS (PHASE 2 AD MONETIZATION READINESS)
   ========================================================================== */

/* Outer Ad Wrapper for Landing Page */
.landing-ad-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

/* Outer Ad Wrapper for Lobby Sidebar */
.lobby-ad-wrapper {
    width: 100%;
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

/* Outer Ad Wrapper for Post-Game Overlay */
.postgame-ad-wrapper {
    width: 100%;
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.postgame-ad-slot {
    width: 100%;
}

/* Base Ad Slot Container Styling */
.ad-slot-container {
    background: rgba(18, 20, 29, 0.4);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: border-color 0.2s ease;
}

.ad-slot-label {
    font-size: 0.7rem;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    user-select: none;
    text-align: center;
}

/* Viewport Media Queries for Ad Placeholders */

/* Desktop / Laptop Layout (>= 768px) */
@media (min-width: 768px) {
    .ad-slot-container.mobile-ad {
        display: none !important;
    }
    
    .ad-slot-container.desktop-ad {
        display: flex !important;
        width: 100%;
        max-width: 970px;
        height: 90px;
        min-height: 90px;
        margin: 0 auto;
    }

    .lobby-ad-wrapper .ad-slot-container.desktop-ad,
    .postgame-ad-wrapper .ad-slot-container.desktop-ad {
        max-width: 100%;
        height: 75px;
        min-height: 75px;
    }
}

/* Mobile Layout (< 768px) */
@media (max-width: 767px) {
    .ad-slot-container.desktop-ad {
        display: none !important;
    }

    .ad-slot-container.mobile-ad {
        display: flex !important;
        width: 100%;
        height: 100px;
        min-height: 100px;
        margin: 0 auto;
    }

    .landing-ad-wrapper {
        margin: 1.25rem auto;
        padding: 0 16px;
    }

    .lobby-ad-wrapper .ad-slot-container.mobile-ad,
    .postgame-ad-wrapper .ad-slot-container.mobile-ad {
        height: 70px;
        min-height: 70px;
    }
}

/* Tablet & Mobile Safety: Hide gameplay side ads on screens < 1200px */
@media (max-width: 1199px) {
    .game-side-ad {
        display: none !important;
    }
}

/* Space-Aware Active Gameplay Side Ad Placeholders (Absolute Positioning Outside Flow) */
.game-side-ad {
    position: absolute;
    top: 0;
    width: 160px;
    box-sizing: border-box;
    z-index: 10;
    pointer-events: auto;
    transition: opacity 0.2s ease;
}

.game-side-ad.hidden-ad {
    display: none !important;
}

.game-side-ad-slot {
    width: 160px;
    height: 520px;
    max-height: 80vh;
    min-height: 300px;
}

/* Tablet & Mobile Safety: Hide lobby side ads on screens < 1200px */
@media (max-width: 1199px) {
    .lobby-side-ad {
        display: none !important;
    }
}

/* Space-Aware Private Room / Lobby Side Ad Placeholders (Absolute Positioning Outside Flow) */
.lobby-side-ad {
    position: absolute;
    top: 0;
    width: 160px;
    box-sizing: border-box;
    z-index: 10;
    pointer-events: auto;
    transition: opacity 0.2s ease;
}

.lobby-side-ad.hidden-ad {
    display: none !important;
}

.lobby-side-ad-slot {
    width: 160px;
    height: 520px;
    max-height: 80vh;
    min-height: 300px;
}

/* Enhanced Focus Outline Accessibility */
:focus-visible {
    outline: 2px solid var(--primary, #6366f1) !important;
    outline-offset: 3px !important;
}


