/* CRACK AND COMBAT - COMPLETE GAME STYLES */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;700;800&family=Rajdhani:wght@300;400;600;700&display=swap');

/* ===== CSS VARIABLES - CYBERPUNK THEME ===== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-tertiary: #1a1a24;
    --bg-nav: #080810;
    --bg-sidebar: #0f0f1a;
    
    --accent-cyan: #00ffff;
    --accent-cyan-bright: #33ffff;
    --accent-cyan-dim: #00cccc;
    --accent-red: #ff0044;
    --accent-red-bright: #ff3366;
    --accent-red-dim: #cc0033;
    --accent-yellow: #ffd700;
    --accent-purple: #8a2be2;
    --accent-green: #00ff88;
    
    --text-primary: #ffffff;
    --text-secondary: #b8b8b8;
    --text-muted: #666666;
    --text-cyan: #00ffff;
    --text-red: #ff0044;
    --text-matrix: #00ff41;
    
    --border-cyan: rgba(0, 255, 255, 0.5);
    --border-red: rgba(255, 0, 68, 0.5);
    --border-dim: rgba(255, 255, 255, 0.1);
    
    --glow-cyan: 0 0 20px rgba(0, 255, 255, 0.5);
    --glow-red: 0 0 20px rgba(255, 0, 68, 0.5);
    --shadow-deep: 0 8px 32px rgba(0, 0, 0, 0.8);
    
    --gradient-cyan: linear-gradient(135deg, #00ffff, #0099cc);
    --gradient-red: linear-gradient(135deg, #ff0044, #cc0033);
    --gradient-dark: linear-gradient(135deg, #0a0a0f, #1a1a24);
    
    --glass-bg: rgba(0, 0, 0, 0.08);
    --glass-border: rgba(0, 255, 255, 0.3);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ===== BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(255, 0, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 0, 0, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(255, 0, 0, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
}

/* ===== ANIMATED GAME BACKGROUND ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

/* Removed distracting floating icons animation */

/* Removed distracting circuit patterns animation */

/* Removed distracting strategic symbols animation */

/* Removed distracting energy particles animation */

/* Removed distracting scanlines animation */

/* ===== PAGE SYSTEM ===== */
.page {
    display: none;
    width: 100vw;
    min-height: 100vh;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 10;
}

.page.active { 
    display: flex;
    animation: pageTransition 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes pageTransition {
    0% { 
        opacity: 0; 
        transform: scale(0.98) translateY(20px);
        filter: blur(2px);
    }
    100% { 
        opacity: 1; 
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

.page-content {
    width: 100%;
    max-width: clamp(500px, 85vw, 950px);
    margin: 0 auto;
    padding: clamp(25px, 3vh, 60px);
    text-align: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px) saturate(1.3);
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
    border: 2px solid var(--accent-cyan);
    border-radius: 8px;
    box-shadow: 
        0 0 50px rgba(0, 255, 255, 0.15),
        inset 0 1px 0 rgba(0, 255, 255, 0.1),
        0 8px 32px rgba(0, 0, 0, 0.8),
        inset 0 0 40px rgba(0, 0, 0, 0.4);
    position: relative;
    /* Removed max-height and overflow restrictions */
}

.page-content::before {
    content: '';
    display: none;
}

.page-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 255, 255, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 0, 68, 0.02) 0%, transparent 50%);
    pointer-events: none;
    border-radius: 6px;
}

/* ===== MATRIX BACKGROUND EFFECT ===== */
/* Reusable matrix background class for any page */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    opacity: 0.8; /* Increased from 0.4 for better visibility */
    pointer-events: none;
    will-change: transform; /* GPU acceleration */
    transform: translateZ(0); /* Force GPU layer */
}

/* Alternative: smaller matrix background for overlay use */
.matrix-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    opacity: 0.2;
    pointer-events: none;
}

/* Matrix rain animation - continuous seamless layers */
.matrix-bg::before,
.matrix-bg::after,
.matrix-layer-1,
.matrix-layer-2,
.matrix-layer-3 {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 200%;
    background-repeat: repeat;
    will-change: transform;
    transform: translateZ(0); /* Force GPU layer */
    backface-visibility: hidden; /* Prevent flickering */
}

.matrix-bg::before {
    top: -100%;
    background-image: 
        repeating-linear-gradient(180deg, 
            transparent 0px,
            transparent 10px,
            rgba(0, 255, 65, 0.2) 12px,
            rgba(0, 255, 65, 0.3) 14px,
            rgba(0, 255, 65, 0.2) 16px,
            transparent 18px,
            transparent 40px);
    background-size: 50px 100%;
    background-position: 0 0, 25px 0, 50px 0;
    animation: matrixFall 12s linear infinite;
}

.matrix-bg::after {
    top: -100%;
    background-image: 
        repeating-linear-gradient(180deg, 
            transparent 0px,
            transparent 15px,
            rgba(0, 255, 65, 0.15) 17px,
            rgba(0, 255, 65, 0.25) 19px,
            rgba(0, 255, 65, 0.15) 21px,
            transparent 23px,
            transparent 50px);
    background-size: 70px 100%;
    background-position: 35px 0, 70px 0;
    animation: matrixFall 14s linear infinite;
    animation-delay: -2s;
}

.matrix-layer-1 {
    top: -100%;
    background-image: 
        repeating-linear-gradient(180deg, 
            transparent 0px,
            transparent 20px,
            rgba(0, 255, 65, 0.1) 22px,
            rgba(0, 255, 65, 0.2) 24px,
            rgba(0, 255, 65, 0.1) 26px,
            transparent 28px,
            transparent 60px);
    background-size: 90px 100%;
    background-position: 15px 0, 45px 0, 75px 0;
    animation: matrixFall 16s linear infinite;
    animation-delay: -4s;
}

.matrix-layer-2 {
    top: -100%;
    background-image: 
        repeating-linear-gradient(180deg, 
            transparent 0px,
            transparent 25px,
            rgba(0, 255, 65, 0.18) 27px,
            rgba(0, 255, 65, 0.28) 29px,
            rgba(0, 255, 65, 0.18) 31px,
            transparent 33px,
            transparent 70px);
    background-size: 110px 100%;
    background-position: 55px 0, 110px 0;
    animation: matrixFall 18s linear infinite;
    animation-delay: -6s;
}

.matrix-layer-3 {
    top: -100%;
    background-image: 
        repeating-linear-gradient(180deg, 
            transparent 0px,
            transparent 30px,
            rgba(0, 255, 65, 0.12) 32px,
            rgba(0, 255, 65, 0.22) 34px,
            rgba(0, 255, 65, 0.12) 36px,
            transparent 38px,
            transparent 80px);
    background-size: 130px 100%;
    background-position: 65px 0, 130px 0;
    animation: matrixFall 20s linear infinite;
    animation-delay: -8s;
}

/* Matrix characters falling */
.matrix-bg-overlay::before {
    content: '0101001010100101110010101001010111001010100101011100101010010101110010101001010111001010100101011100101010010101110010101001010111001010100101011100';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 200%;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: rgba(0, 255, 65, 0.1);
    word-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.2;
    animation: matrixText 30s linear infinite;
    letter-spacing: 2px;
}

/* Continuous seamless matrix fall animation - optimized */
@keyframes matrixFall {
    0% { 
        transform: translateY(0) translateZ(0);
    }
    100% { 
        transform: translateY(100%) translateZ(0);
    }
}

@keyframes matrixText {
    0% { transform: translateY(-100%); opacity: 0; }
    10% { opacity: 0.1; }
    90% { opacity: 0.1; }
    100% { transform: translateY(100%); opacity: 0; }
}

/* Enhanced matrix effect for special screens */
.page.active .matrix-bg {
    animation: matrixIntensify 2s ease-out;
}

@keyframes matrixIntensify {
    0% { opacity: 0.1; }
    50% { opacity: 0.6; }
    100% { opacity: 0.4; }
}

/* ===== CLEAN CENTERED LAYOUT ===== */
.clean-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100vw;
    position: relative;
    z-index: 10;
    padding: clamp(10px, 2vh, 20px);
    box-sizing: border-box;
}


/* Main Content Area */
.main-content {
    background: rgba(0, 0, 0, 0.12);
    border: 2px solid var(--accent-cyan);
    border-radius: 8px;
    backdrop-filter: blur(8px);
    box-shadow: 
        0 0 50px rgba(0, 255, 255, 0.15),
        inset 0 1px 0 rgba(0, 255, 255, 0.1),
        var(--shadow-deep);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(15px, 3vh, 60px);
    position: relative;
    max-width: clamp(600px, 85vw, 950px);
    width: 100%;
    /* Removed max-height restrictions */
    overflow: visible;
}

.main-content::before {
    content: '';
    display: none;
}

.main-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 255, 255, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 0, 68, 0.02) 0%, transparent 50%);
    pointer-events: none;
    border-radius: 6px;
}

/* Title Section */
.title-section {
    text-align: center;
    margin-top: clamp(25px, 4vh, 45px);
    margin-bottom: clamp(15px, 3vh, 40px);
    z-index: 2;
    position: relative;
}

.cyber-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 900;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 4px;
    line-height: 0.9;
}

.title-crack {
    color: var(--accent-red);
    text-shadow: 
        0 0 10px var(--accent-red),
        0 0 20px var(--accent-red),
        0 0 40px rgba(255, 0, 68, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.9),
        0 4px 8px rgba(0, 0, 0, 0.8);
    animation: crackGlow 3s ease-in-out infinite alternate;
}

@keyframes crackGlow {
    0% { 
        text-shadow: 
            0 0 10px var(--accent-red),
            0 0 20px var(--accent-red),
            0 0 40px rgba(255, 0, 68, 0.5);
    }
    100% { 
        text-shadow: 
            0 0 15px var(--accent-red),
            0 0 30px var(--accent-red),
            0 0 60px rgba(255, 0, 68, 0.8);
    }
}

.title-separator {
    color: var(--text-secondary);
    margin: 0 20px;
    font-size: 0.8em;
    opacity: 0.7;
}

.title-combat {
    color: var(--accent-cyan);
    text-shadow: 
        0 0 10px var(--accent-cyan),
        0 0 20px var(--accent-cyan),
        0 0 40px rgba(0, 255, 255, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.9),
        0 4px 8px rgba(0, 0, 0, 0.8);
    animation: combatGlow 3s ease-in-out infinite alternate;
}

@keyframes combatGlow {
    0% { 
        text-shadow: 
            0 0 10px var(--accent-cyan),
            0 0 20px var(--accent-cyan),
            0 0 40px rgba(0, 255, 255, 0.5);
    }
    100% { 
        text-shadow: 
            0 0 15px var(--accent-cyan),
            0 0 30px var(--accent-cyan),
            0 0 60px rgba(0, 255, 255, 0.8);
    }
}

.cyber-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--text-primary);
    margin-top: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 
        0 0 10px rgba(0, 0, 0, 0.9),
        0 2px 4px rgba(0, 0, 0, 0.9),
        0 0 20px currentColor;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 4px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Hexagonal AI Symbol */
.ai-symbol-container {
    margin: clamp(15px, 2vh, 35px) 0;
    z-index: 2;
    position: relative;
}

.hexagon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(150px, 18vw, 220px);
    height: clamp(150px, 18vw, 220px);
    margin: 0 auto;
}

.hexagon-outer {
    width: clamp(120px, 14vw, 170px);
    height: clamp(120px, 14vw, 170px);
    position: relative;
    transform: rotate(0deg);
    animation: hexRotate 20s linear infinite;
}

@keyframes hexRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hexagon-inner {
    width: 100%;
    height: 100%;
    background: linear-gradient(60deg, transparent 35%, var(--border-cyan) 35%, var(--border-cyan) 65%, transparent 65%),
                linear-gradient(-60deg, transparent 35%, var(--border-cyan) 35%, var(--border-cyan) 65%, transparent 65%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hexagon-inner::before {
    content: '';
    position: absolute;
    width: 130px;
    height: 130px;
    background: linear-gradient(30deg, transparent 35%, var(--border-red) 35%, var(--border-red) 65%, transparent 65%),
                linear-gradient(-30deg, transparent 35%, var(--border-red) 35%, var(--border-red) 65%, transparent 65%);
    animation: hexRotateReverse 15s linear infinite;
}

@keyframes hexRotateReverse {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}

.ai-core {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.core-ring {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 2px solid var(--accent-cyan);
    border-radius: 50%;
    animation: coreRingPulse 2s ease-in-out infinite alternate;
}

@keyframes coreRingPulse {
    0% { 
        transform: scale(1);
        box-shadow: var(--glow-cyan);
    }
    100% { 
        transform: scale(1.2);
        box-shadow: 0 0 30px rgba(0, 255, 255, 0.8);
    }
}

.core-center {
    font-family: 'Rajdhani', sans-serif;
    font-size: 24px;
    font-weight: 900;
    color: var(--text-primary);
    text-shadow: var(--glow-cyan);
    z-index: 4;
    position: relative;
}

/* Game Controls - Clean Layout */
.game-controls {
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2vh, 30px);
    margin: clamp(15px, 2vh, 40px) 0;
    position: relative;
    z-index: 2;
    max-width: clamp(400px, 70vw, 650px);
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.controls-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.title-text {
    font-family: 'Rajdhani', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-cyan);
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.status-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

.status-indicator {
    color: var(--accent-cyan);
    animation: statusBlink 2s ease-in-out infinite;
}

.input-section, .action-section, .join-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cyber-label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.cyber-input {
    width: 100%;
    padding: clamp(12px, 1.5vh, 16px) clamp(16px, 2vw, 24px);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px) saturate(1.3);
    -webkit-backdrop-filter: blur(10px) saturate(1.3);
    border: 2px solid var(--border-dim);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(12px, 1.2vw, 16px);
    text-transform: uppercase;
    letter-spacing: clamp(0.5px, 0.1vw, 2px);
    transition: all 0.3s ease;
    min-height: clamp(40px, 5vh, 50px);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 4px 15px rgba(0, 0, 0, 0.6);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.cyber-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 
        0 0 25px rgba(0, 255, 255, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.4),
        inset 0 0 10px rgba(0, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.8);
}


.cyber-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.join-controls {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
}

.code-input {
    font-weight: 700;
    text-align: center;
    letter-spacing: 4px;
}

/* Cyberpunk Buttons */
.cyber-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 1.5vh, 18px) clamp(24px, 3vw, 40px);
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px) saturate(1.5);
    -webkit-backdrop-filter: blur(10px) saturate(1.5);
    border: 2px solid var(--border-dim);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(12px, 1.2vw, 15px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: clamp(1px, 0.15vw, 3px);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
    min-height: clamp(40px, 5vh, 50px);
    animation: buttonPulse 3s ease-in-out infinite;
    text-shadow: 0 0 8px currentColor, 0 2px 4px rgba(0, 0, 0, 0.8);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.6),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
}

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

.cyber-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transition: left 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 1;
}

.cyber-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 1;
}

.cyber-btn:hover::before {
    left: 100%;
}

.cyber-btn:hover::after {
    width: 300px;
    height: 300px;
}

.cyber-btn:active {
    transform: translateY(1px) scale(0.98);
}

.cyber-btn .btn-text {
    position: relative;
    z-index: 2;
}

.cyber-btn.primary {
    border-color: var(--accent-red);
    border-width: 2px;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(255, 0, 68, 0.45), rgba(255, 0, 68, 0.35));
    backdrop-filter: blur(12px) saturate(1.8);
    -webkit-backdrop-filter: blur(12px) saturate(1.8);
    box-shadow: 
        0 0 40px rgba(255, 0, 68, 0.5),
        0 4px 20px rgba(0, 0, 0, 0.7),
        inset 0 0 30px rgba(255, 0, 68, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: buttonPulseRed 3s ease-in-out infinite;
    text-shadow: 
        0 0 10px rgba(255, 0, 68, 0.8),
        0 0 20px rgba(255, 0, 68, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.9);
}

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

.cyber-btn.primary::before {
    background: linear-gradient(90deg, transparent, rgba(255, 0, 68, 0.7), transparent);
}

.cyber-btn.primary::after {
    background: radial-gradient(circle, rgba(255, 0, 68, 0.7) 0%, transparent 70%);
}

.cyber-btn.primary:hover {
    background: linear-gradient(135deg, rgba(255, 0, 68, 0.5), rgba(255, 0, 68, 0.2));
    color: white;
    box-shadow: 
        0 0 50px rgba(255, 0, 68, 0.7),
        0 0 25px rgba(255, 0, 68, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-5px) scale(1.05);
    border-color: var(--accent-red-bright);
}

.cyber-btn.primary:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 
        0 0 20px rgba(255, 0, 68, 0.6),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.cyber-btn.secondary {
    border-color: var(--accent-cyan);
    border-width: 2px;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.45), rgba(0, 255, 255, 0.35));
    backdrop-filter: blur(12px) saturate(1.8);
    -webkit-backdrop-filter: blur(12px) saturate(1.8);
    box-shadow: 
        0 0 40px rgba(0, 255, 255, 0.5),
        0 4px 20px rgba(0, 0, 0, 0.7),
        inset 0 0 30px rgba(0, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: buttonPulseCyan 3s ease-in-out infinite;
    text-shadow: 
        0 0 10px rgba(0, 255, 255, 0.8),
        0 0 20px rgba(0, 255, 255, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.9);
}

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

.cyber-btn.secondary::before {
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.7), transparent);
}

.cyber-btn.secondary::after {
    background: radial-gradient(circle, rgba(0, 255, 255, 0.7) 0%, transparent 70%);
}

.cyber-btn.secondary:hover {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.5), rgba(0, 255, 255, 0.2));
    color: var(--bg-primary);
    box-shadow: 
        0 0 50px rgba(0, 255, 255, 0.7),
        0 0 25px rgba(0, 255, 255, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-5px) scale(1.05);
    border-color: var(--accent-cyan-bright);
}

.cyber-btn.secondary:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.6),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-prefix, .btn-suffix {
    opacity: 0.6;
    font-weight: 400;
}

.btn-text {
    margin: 0 8px;
}

/* Top Audio Controls Bar */
.top-audio-bar {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.audio-controls-top {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideInFromTop 0.5s ease-out;
}

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

.audio-btn-top {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-dim);
    border-radius: 6px;
    color: var(--accent-green);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    font-size: 16px;
    position: relative;
    overflow: hidden;
}

.audio-btn-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.3), transparent);
    transition: left 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.audio-btn-top::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.4) 0%, transparent 70%);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.audio-btn-top:hover {
    border-color: var(--accent-green);
    background: rgba(0, 255, 136, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
    transform: translateY(-3px) scale(1.05);
}

.audio-btn-top:hover::before {
    left: 100%;
}

.audio-btn-top:hover::after {
    width: 60px;
    height: 60px;
}

.audio-btn-top:active {
    transform: translateY(-1px) scale(0.95);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.audio-btn-top .audio-icon {
    position: relative;
    z-index: 1;
    transition: all 0.2s ease;
}

.audio-btn-top:hover .audio-icon {
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.8);
}

.audio-btn-top .audio-icon {
    font-size: 18px;
    line-height: 1;
}

/* Responsive adjustments for top audio bar */
@media (max-width: 768px) {
    .top-audio-bar {
        top: 10px;
        right: 10px;
    }
    
    .audio-controls-top {
        padding: 6px;
        gap: 6px;
    }
    
    .audio-btn-top {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .audio-btn-top .audio-icon {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .top-audio-bar {
        top: 8px;
        right: 8px;
    }
    
    .audio-controls-top {
        padding: 4px;
        gap: 4px;
    }
    
    .audio-btn-top {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .audio-btn-top .audio-icon {
        font-size: 14px;
    }
}

/* Help Section */
.help-section {
    margin-top: clamp(10px, 1vh, 25px);
    z-index: 2;
    position: relative;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.help-btn {
    display: inline-flex;
    align-items: center;
    gap: clamp(6px, 0.8vw, 10px);
    padding: clamp(8px, 1vh, 12px) clamp(16px, 2vw, 24px);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-dim);
    border-radius: 4px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(10px, 1vw, 13px);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: clamp(0.5px, 0.1vw, 1.5px);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    min-height: clamp(32px, 4vh, 40px);
    position: relative;
    overflow: hidden;
}

.help-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.2), transparent);
    transition: left 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.help-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    background: rgba(0, 255, 255, 0.05);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.help-btn:hover::before {
    left: 100%;
}

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

.help-btn .help-icon,
.help-btn .help-text {
    position: relative;
    z-index: 1;
}

.help-icon {
    font-size: 12px;
    font-weight: bold;
}


/* Audio Settings Modal */
.audio-settings {
    max-width: 400px;
}

.setting-section {
    margin-bottom: 25px;
}

.setting-section h3 {
    color: var(--accent-cyan);
    font-size: 16px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'JetBrains Mono', monospace;
}

.volume-control {
    margin-bottom: 15px;
}

.volume-control label {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.volume-slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-slider {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid var(--border-dim);
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-green);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 255, 136, 0.5);
    transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    background: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.7);
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent-green);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 5px rgba(0, 255, 136, 0.5);
    transition: all 0.2s ease;
}

.volume-slider::-moz-range-thumb:hover {
    background: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.7);
}

.volume-value {
    color: var(--accent-green);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: bold;
    min-width: 40px;
    text-align: right;
}

.audio-option {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.audio-option .btn {
    flex: 1;
    min-width: 120px;
}



/* Input Styles */
.input-group, .join-input-group {
    margin-bottom: 25px;
}

.input-label {
    display: block;
    color: var(--accent-red);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-align: left;
}

.player-input, .code-input {
    width: 100%;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--border-secondary);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: 'JetBrains Mono', monospace;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

.player-input:focus, .code-input:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 
        0 0 20px rgba(255, 0, 0, 0.3),
        inset 0 0 20px rgba(255, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.9);
}

.player-input::placeholder, .code-input::placeholder {
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 1px;
}

/* Action Buttons */
.action-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 25px;
}

.action-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 30px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-primary);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.action-btn.primary-action {
    background: var(--red-gradient);
    border-color: var(--accent-red-bright);
    box-shadow: var(--shadow-red);
}

.action-btn.secondary-action {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-white);
}

.btn-glow {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 14px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.action-btn.primary-action .btn-glow {
    background: var(--red-glow-gradient);
}

.action-btn.secondary-action .btn-glow {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        var(--shadow-glow);
}

.action-btn:hover .btn-glow {
    opacity: 0.8;
}

.action-btn:active {
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 1.3rem;
    filter: drop-shadow(0 0 5px currentColor);
}

.btn-text {
    font-weight: 800;
}

/* Join Container */
.join-container {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
    align-items: end;
}

.join-input-group {
    margin-bottom: 0;
}

.code-input {
    max-width: 150px;
    font-size: 1.2rem;
    font-weight: 700;
}

/* Info Button */
.info-section {
    text-align: center;
}

.info-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.info-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-red);
    color: var(--accent-red);
    transform: translateY(-2px);
}

.info-icon {
    font-size: 1.1rem;
}

/* Status Bar */
.status-bar {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-secondary);
    border-radius: 10px;
    padding: 15px 20px;
    backdrop-filter: blur(10px);
}

.status-item {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.status-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-value.ready {
    color: var(--accent-red);
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
    animation: statusReady 2s ease-in-out infinite alternate;
}

@keyframes statusReady {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

h2 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.8em;
    margin-bottom: 25px;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
}

/* ===== BUTTONS ===== */
.btn {
    padding: clamp(12px, 1.5vh, 18px) clamp(24px, 3vw, 40px);
    border: 2px solid transparent;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: clamp(14px, 1.2vw, 18px);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    margin: clamp(4px, 0.5vh, 8px);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: clamp(0.5px, 0.1vw, 2px);
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px) saturate(1.5);
    -webkit-backdrop-filter: blur(12px) saturate(1.5);
    min-height: clamp(44px, 5vh, 54px);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.6),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 1;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 1;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover::after {
    width: 200px;
    height: 200px;
}

.btn:active {
    transform: translateY(1px) scale(0.98);
}

.btn.primary {
    background: linear-gradient(135deg, rgba(255, 0, 68, 0.5), rgba(255, 0, 68, 0.4));
    border-color: var(--accent-red);
    color: white;
    backdrop-filter: blur(12px) saturate(1.8);
    -webkit-backdrop-filter: blur(12px) saturate(1.8);
    box-shadow: 
        0 0 40px rgba(255, 0, 68, 0.5),
        0 4px 20px rgba(0, 0, 0, 0.7),
        inset 0 0 30px rgba(255, 0, 68, 0.2);
    text-shadow: 
        0 0 10px rgba(255, 0, 68, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.9);
    position: relative;
    overflow: hidden;
}

.btn.primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.btn.primary:hover::after {
    transform: translateX(100%);
}

.btn.primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 0 35px rgba(255, 0, 68, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: var(--accent-red-bright);
    background: rgba(255, 0, 68, 0.3);
    color: white;
}

.btn.primary:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 
        0 0 25px rgba(255, 0, 68, 0.7),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn.secondary {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.4), rgba(0, 255, 255, 0.3));
    border-color: var(--accent-cyan);
    color: white;
    backdrop-filter: blur(12px) saturate(1.8);
    -webkit-backdrop-filter: blur(12px) saturate(1.8);
    box-shadow: 
        0 0 40px rgba(0, 255, 255, 0.4),
        0 4px 20px rgba(0, 0, 0, 0.7),
        inset 0 0 30px rgba(0, 255, 255, 0.15);
    text-shadow: 
        0 0 10px rgba(0, 255, 255, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.9);
}

.btn.secondary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 0 35px rgba(0, 255, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: var(--accent-cyan-bright);
    background: rgba(0, 255, 255, 0.3);
    color: var(--bg-primary);
}

.btn.secondary:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 
        0 0 25px rgba(0, 255, 255, 0.7),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn.tertiary {
    background: rgba(0, 255, 255, 0.05);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
    margin-top: 15px;
}

.btn.tertiary:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 0 25px rgba(0, 255, 255, 0.4),
        var(--shadow-deep);
    border-color: var(--accent-cyan-bright);
    background: rgba(0, 255, 255, 0.1);
}

.btn.large {
    padding: 16px 32px;
    font-size: 1.2em;
}

.btn:active {
    transform: translateY(0);
}

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

.btn.hidden { 
    display: none; 
}

/* ===== INPUTS ===== */
input[type="text"], textarea {
    width: 100%;
    max-width: clamp(350px, 60vw, 500px);
    padding: clamp(14px, 1.5vh, 20px) clamp(20px, 2.5vw, 30px);
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid var(--border-dim);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: clamp(14px, 1.2vw, 18px);
    font-family: 'JetBrains Mono', monospace;
    text-align: center;
    margin: clamp(6px, 1vh, 12px) 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px) saturate(1.3);
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
    min-height: clamp(44px, 5vh, 54px);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 4px 15px rgba(0, 0, 0, 0.6);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}


input[type="text"]:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 
        0 0 25px rgba(0, 255, 255, 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.4),
        inset 0 0 10px rgba(0, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-1px);
}

input[type="text"]::placeholder, textarea::placeholder { 
    color: var(--text-muted); 
    text-align: center;
}

.response-textarea {
    height: clamp(120px, 15vh, 180px);
    resize: vertical;
    min-height: clamp(80px, 10vh, 120px);
    max-height: clamp(300px, 35vh, 400px);
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    font-size: clamp(14px, 1.1vw, 16px);
    line-height: 1.5;
    padding: clamp(16px, 2vh, 24px);
}


/* ===== ACTION SECTIONS ===== */
.action-section, .answer-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    width: 100%;
}

.join-section {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 350px;
}

.join-section input { flex: 2; }
.join-section button { flex: 1; min-width: auto; }

.response-section {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* ===== LOBBY SYSTEM ===== */
.lobby-header {
    margin-top: clamp(35px, 5vh, 50px);
    margin-bottom: clamp(30px, 4vh, 40px);
    text-align: center;
    animation: slideDown 0.8s ease-out;
}

@keyframes slideDown {
    0% { opacity: 0; transform: translateY(-30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.lobby-header h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(0, 245, 255, 0.5);
}

.room-info {
    background: var(--bg-secondary);
    border: 2px solid var(--accent-red);
    padding: 16px 24px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 1.3em;
    font-weight: 700;
    letter-spacing: 4px;
    font-family: 'Rajdhani', sans-serif;
    color: var(--accent-red);
    box-shadow: 
        0 0 30px rgba(255, 8, 68, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: roomCodePulse 2s ease-in-out infinite alternate;
}

@keyframes roomCodePulse {
    0% { box-shadow: 0 0 30px rgba(255, 8, 68, 0.3); }
    100% { box-shadow: 0 0 40px rgba(255, 8, 68, 0.5); }
}

.players-section {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px) saturate(1.3);
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
    padding: 24px;
    border-radius: 12px;
    margin: 24px 0;
    border: 1px solid var(--glass-border);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.6),
        inset 0 0 30px rgba(0, 0, 0, 0.3),
        var(--shadow-soft);
}

.players-section h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.4em;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 
        0 0 10px var(--accent-cyan),
        0 2px 4px rgba(0, 0, 0, 0.9);
}

#players-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 30px;
}

.player {
    background: var(--bg-secondary);
    border: 2px solid var(--border-secondary);
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    font-family: 'Rajdhani', sans-serif;
    margin: 6px;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.player::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 245, 255, 0.1), transparent);
    transition: left 0.6s;
}

.player:hover {
    transform: translateY(-2px) scale(1.02);
    border-color: var(--accent-cyan);
    box-shadow: 0 5px 20px rgba(0, 245, 255, 0.2);
}

.player:hover::before {
    left: 100%;
}

.player.owner-player {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), var(--bg-secondary));
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.owner-badge {
    background: linear-gradient(135deg, var(--accent-yellow), #ffa500);
    color: var(--bg-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9em;
    margin-top: 12px;
    display: inline-block;
    animation: ownerGlow 3s ease-in-out infinite alternate;
    font-family: 'Rajdhani', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes ownerGlow {
    0% { 
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
        transform: scale(1);
    }
    100% { 
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
        transform: scale(1.02);
    }
}

.waiting-text {
    color: var(--text-muted);
    font-style: italic;
    margin-top: 15px;
    font-size: 1em;
    animation: waitingPulse 2s ease-in-out infinite alternate;
}

@keyframes waitingPulse {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* ===== ORACLE SYSTEM ===== */
.oracle-avatar {
    font-size: clamp(2.4em, 5vw, 3.2em);
    margin: clamp(35px, 4vh, 45px) 0 clamp(15px, 2vh, 25px);
    filter: drop-shadow(0 0 25px rgba(0, 229, 255, 0.5));
    animation: aiPresence 5s ease-in-out infinite;
    position: relative;
    background: var(--neural-gradient);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: aiPresence 5s ease-in-out infinite, aiGradient 8s ease infinite;
}

.oracle-avatar.large { 
    font-size: 4.2em;
    animation: aiPresenceLarge 5s ease-in-out infinite;
}

@keyframes aiPresence {
    0%, 100% { 
        transform: translateY(0) rotate(0deg);
        filter: drop-shadow(0 0 20px rgba(255, 8, 68, 0.4));
    }
    25% { 
        transform: translateY(-5px) rotate(1deg);
        filter: drop-shadow(0 0 25px rgba(0, 245, 255, 0.4));
    }
    50% { 
        transform: translateY(-8px) rotate(0deg);
        filter: drop-shadow(0 0 30px rgba(139, 0, 255, 0.4));
    }
    75% { 
        transform: translateY(-3px) rotate(-1deg);
        filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.4));
    }
}

@keyframes aiPresenceLarge {
    0%, 100% { 
        transform: translateY(0) rotate(0deg) scale(1);
        filter: drop-shadow(0 0 30px rgba(255, 8, 68, 0.5));
    }
    33% { 
        transform: translateY(-10px) rotate(2deg) scale(1.02);
        filter: drop-shadow(0 0 40px rgba(0, 245, 255, 0.5));
    }
    66% { 
        transform: translateY(-15px) rotate(-1deg) scale(0.98);
        filter: drop-shadow(0 0 35px rgba(139, 0, 255, 0.5));
    }
}

.oracle-message {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border: 2px solid var(--accent-red);
    padding: 20px 24px;
    border-radius: 8px;
    font-style: italic;
    margin: 20px auto;
    line-height: 1.6;
    max-width: 500px;
    box-shadow: 
        0 0 30px rgba(255, 8, 68, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    animation: messageTransmission 3s ease-in-out infinite alternate;
    position: relative;
    font-family: 'JetBrains Mono', monospace;
}

.oracle-message::before {
    content: '> ';
    color: var(--accent-red);
    font-weight: 700;
}

@keyframes messageTransmission {
    0% { 
        box-shadow: 0 0 30px rgba(255, 8, 68, 0.2);
        border-color: var(--accent-red);
    }
    100% { 
        box-shadow: 0 0 40px rgba(255, 8, 68, 0.4);
        border-color: var(--accent-cyan);
    }
}

/* ===== TIMER SYSTEM ===== */
.timer-section {
    margin-top: clamp(35px, 5vh, 50px);
    margin-bottom: clamp(25px, 3vh, 35px);
    padding: clamp(15px, 2vh, 25px) 0;
}

.timer {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(3em, 8vw, 5em);
    font-weight: 800;
    color: white;
    background: rgba(0, 0, 0, 0.85);
    border: 3px solid var(--accent-cyan);
    padding: clamp(15px, 3vh, 25px) clamp(30px, 5vw, 50px);
    margin: 0 auto clamp(10px, 2vh, 20px);
    border-radius: 8px;
    box-shadow: 
        0 0 45px rgba(0, 229, 255, 0.4),
        inset 0 0 25px rgba(0, 229, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 8px 32px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px) saturate(1.5);
    -webkit-backdrop-filter: blur(15px) saturate(1.5);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-shadow: 
        0 0 20px var(--accent-cyan),
        0 0 15px rgba(0, 229, 255, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.9);
    min-width: clamp(120px, 20vw, 200px);
}

.timer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 245, 255, 0.2), transparent);
    animation: timerScan 2s linear infinite;
}

@keyframes timerScan {
    0% { left: -100%; }
    100% { left: 100%; }
}

.timer.danger {
    color: #ffa500;
    border-color: #ffa500;
    box-shadow: 
        0 0 40px rgba(255, 165, 0, 0.4),
        inset 0 0 20px rgba(255, 165, 0, 0.1);
}

.timer.danger::before {
    background: linear-gradient(90deg, transparent, rgba(255, 165, 0, 0.3), transparent);
}

.timer.urgent {
    color: var(--accent-red);
    border-color: var(--accent-red);
    box-shadow: 
        0 0 40px rgba(255, 8, 68, 0.4),
        inset 0 0 20px rgba(255, 8, 68, 0.1);
    animation: timerCritical 0.5s ease-in-out infinite alternate;
}

.timer.urgent::before {
    background: linear-gradient(90deg, transparent, rgba(255, 8, 68, 0.3), transparent);
}

@keyframes timerCritical { 
    0% { 
        transform: scale(1);
        box-shadow: 0 0 40px rgba(255, 8, 68, 0.4);
    }
    100% { 
        transform: scale(1.05);
        box-shadow: 0 0 60px rgba(255, 8, 68, 0.7);
    }
}

.timer.auto-submit {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    animation: autoSubmitPulse 0.5s ease-in-out;
    color: white;
    font-weight: bold;
}

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

/* ===== GAME CONTENT SECTIONS ===== */
.riddle-question {
    color: var(--text-primary);
    font-style: italic;
    margin-bottom: 30px;
    line-height: 1.7;
    font-size: 1.15em;
    padding: 24px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--border-secondary);
    border-left: 4px solid var(--accent-cyan);
    border-radius: 8px;
    backdrop-filter: blur(15px) saturate(1.3);
    -webkit-backdrop-filter: blur(15px) saturate(1.3);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 4px 20px rgba(0, 0, 0, 0.6),
        inset 0 0 30px rgba(0, 0, 0, 0.3);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.challenge-description {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px) saturate(1.3);
    -webkit-backdrop-filter: blur(15px) saturate(1.3);
    border: 1px solid var(--border-secondary);
    border-left: 4px solid var(--accent-red);
    border-radius: 8px;
    padding: 25px 30px;
    margin: 25px 0;
    line-height: 1.8;
    font-size: 1.15em;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 4px 20px rgba(0, 0, 0, 0.6),
        inset 0 0 30px rgba(0, 0, 0, 0.3);
    position: relative;
    color: white;
    font-style: normal;
    font-weight: 400;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.3px;
    word-break: break-word;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    /* Remove scrolling - let content expand naturally */
    height: auto;
    max-height: none;
    overflow: visible;
}

.challenge-description::before {
    content: '⚠ AI CHALLENGE';
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--accent-red);
    color: var(--bg-primary);
    padding: 6px 14px;
    font-size: 0.75em;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Rajdhani', sans-serif;
    font-style: normal;
}

/* ===== SUBMISSION STATUS ===== */
.submission-status {
    text-align: center;
    margin-top: 20px;
    padding: 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.submission-status p {
    color: var(--text-muted);
    font-size: 1em;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
}

/* ===== RESULTS SYSTEM ===== */
.results-header h2,
.round-summary-section h2,
.game-over-section h1 {
    color: var(--accent-red);
    text-shadow: 0 0 20px rgba(255, 8, 68, 0.5);
}

.all-answers-section h3,
.points-table-container h3 {
    margin-bottom: 24px;
    font-family: 'Rajdhani', sans-serif;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Answer Items */
#all-answers-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.answer-item {
    background: var(--bg-secondary);
    border: 2px solid var(--border-secondary);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 8px;
    backdrop-filter: blur(15px);
    transition: all 0.3s ease;
    animation: answerReveal 0.6s ease-out;
    position: relative;
}

@keyframes answerReveal {
    0% { 
        opacity: 0; 
        transform: translateX(-30px);
        filter: blur(2px);
    }
    100% { 
        opacity: 1; 
        transform: translateX(0);
        filter: blur(0);
    }
}

.answer-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.answer-item.correct {
    border-color: #00ff88;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), var(--bg-secondary));
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

.answer-item.incorrect {
    border-color: var(--accent-red);
    background: linear-gradient(135deg, rgba(255, 8, 68, 0.1), var(--bg-secondary));
    box-shadow: 0 0 20px rgba(255, 8, 68, 0.2);
}

.answer-item.winner {
    border-color: var(--accent-yellow);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), var(--bg-secondary));
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.answer-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.player-name {
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1em;
}

.answer-order {
    background: var(--bg-tertiary);
    color: var(--accent-purple);
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9em;
    border: 1px solid var(--accent-purple);
    font-family: 'Rajdhani', sans-serif;
}

.winner-badge {
    background: linear-gradient(135deg, var(--accent-yellow), #ffa500);
    color: var(--bg-primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    animation: winnerPulse 2.5s ease-in-out infinite;
    font-family: 'Rajdhani', sans-serif;
    text-transform: uppercase;
    font-size: 0.8em;
    letter-spacing: 1px;
}

@keyframes winnerPulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
    }
}

.answer-text {
    color: var(--text-secondary);
    font-size: 1em;
    padding: 8px 0;
    line-height: 1.5;
    font-style: italic;
}

.answer-status {
    font-weight: 700;
    font-size: 1em;
    font-family: 'Rajdhani', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.answer-item.correct .answer-status {
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.answer-item.incorrect .answer-status {
    color: var(--accent-red);
    text-shadow: 0 0 10px rgba(255, 8, 68, 0.5);
}

/* ===== TRIVIA CHALLENGE STYLES ===== */
.trivia-section {
    text-align: center;
    padding: 30px 0;
    margin-bottom: 30px;
}

.trivia-question-text {
    background: var(--bg-secondary);
    border: 2px solid var(--accent-cyan);
    border-radius: 12px;
    padding: 25px 30px;
    margin: 25px auto;
    line-height: 1.7;
    font-size: 1.2em;
    color: var(--text-primary);
    font-weight: 500;
    max-width: 600px;
    box-shadow: 
        0 0 30px rgba(0, 245, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    position: relative;
    animation: questionPulse 3s ease-in-out infinite alternate;
}

@keyframes questionPulse {
    0% { 
        box-shadow: 0 0 30px rgba(0, 245, 255, 0.2);
        border-color: var(--accent-cyan);
    }
    100% { 
        box-shadow: 0 0 40px rgba(0, 245, 255, 0.4);
        border-color: var(--accent-purple);
    }
}

.trivia-question-text::before {
    content: '🧠 QUESTION';
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--accent-cyan);
    color: var(--bg-primary);
    padding: 6px 14px;
    font-size: 0.75em;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Rajdhani', sans-serif;
}

.trivia-options-section {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px 0;
}

.trivia-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    padding: 0 20px;
}

.trivia-option {
    padding: 20px 25px !important;
    font-size: 1.1em !important;
    font-weight: 600 !important;
    text-align: left !important;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border: 3px solid var(--border-secondary) !important;
    background: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(12px) saturate(1.3);
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
    word-wrap: break-word;
    line-height: 1.4;
    color: var(--text-primary) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.trivia-option:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: var(--accent-cyan) !important;
    box-shadow: 
        0 8px 25px rgba(0, 245, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(0, 245, 255, 0.1), var(--glass-bg)) !important;
}

.trivia-option.selected {
    border-color: var(--accent-red) !important;
    background: linear-gradient(135deg, rgba(255, 8, 68, 0.2), var(--glass-bg)) !important;
    color: var(--text-primary) !important;
    box-shadow: 
        0 0 30px rgba(255, 8, 68, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: selectedPulse 1.5s ease-in-out infinite alternate;
}

@keyframes selectedPulse {
    0% { 
        box-shadow: 0 0 30px rgba(255, 8, 68, 0.4);
        transform: translateY(-3px) scale(1.02);
    }
    100% { 
        box-shadow: 0 0 40px rgba(255, 8, 68, 0.6);
        transform: translateY(-3px) scale(1.03);
    }
}

.trivia-option:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.trivia-option:disabled:hover {
    transform: none !important;
    border-color: var(--border-secondary) !important;
    box-shadow: none !important;
    background: var(--glass-bg) !important;
}

/* Trivia Results Styles */
.trivia-results-section {
    max-width: 700px;
    margin: 0 auto;
}

.correct-answer-display {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), var(--bg-secondary));
    border: 2px solid #00ff88;
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
    backdrop-filter: blur(15px);
}

.correct-answer-display h3 {
    color: #00ff88;
    margin-bottom: 15px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.correct-answer-display p {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

.all-trivia-answers-section {
    margin-top: 30px;
}

.all-trivia-answers-section h3 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--accent-cyan);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ===== FAST TAPPER STYLES ===== */
.tapper-section {
    text-align: center;
    padding: 30px 0;
}

.tap-counter {
    margin: 30px 0;
    text-align: center;
}

.tap-count-display {
    font-family: 'Rajdhani', sans-serif;
    font-size: 4em;
    font-weight: 800;
    color: var(--accent-cyan);
    display: block;
    text-shadow: 0 0 20px rgba(0, 245, 255, 0.5);
    animation: numberPulse 0.1s ease-out;
    user-select: none;
    -webkit-user-select: none;
}

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

.tap-btn {
    font-size: 2em !important;
    font-weight: 800 !important;
    padding: 30px 60px !important;
    border-radius: 50% !important;
    width: 200px;
    height: 200px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    transition: all 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Rajdhani', sans-serif !important;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.tap-btn:active {
    transform: scale(0.95);
    box-shadow: 0 0 40px var(--accent-red);
}

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

/* ===== CHALLENGE RESULTS ===== */
.challenge-result-item, .tap-result-item {
    background: var(--bg-secondary);
    border: 2px solid var(--border-secondary);
    border-radius: 8px;
    margin: 16px 0;
    padding: 20px;
    animation: resultReveal 0.6s ease-out;
    backdrop-filter: blur(15px);
    transition: all 0.3s ease;
}

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

.challenge-result-item:hover, .tap-result-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.challenge-result-item.passed {
    border-color: #00ff88;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), var(--bg-secondary));
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

.challenge-result-item.failed {
    border-color: var(--accent-red);
    background: linear-gradient(135deg, rgba(255, 8, 68, 0.1), var(--bg-secondary));
    box-shadow: 0 0 20px rgba(255, 8, 68, 0.2);
}

.challenge-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.challenge-player-name {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1.2em;
    color: var(--text-primary);
}

.challenge-verdict {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Rajdhani', sans-serif;
    border: 2px solid;
}

.challenge-verdict.passed {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    border-color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.challenge-verdict.failed {
    background: rgba(255, 8, 68, 0.2);
    color: var(--accent-red);
    border-color: var(--accent-red);
    box-shadow: 0 0 10px rgba(255, 8, 68, 0.3);
}

.challenge-response {
    background: var(--bg-primary);
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0;
    font-style: italic;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    border-left: 4px solid var(--accent-cyan);
    word-break: break-word;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    max-height: 100px;
    overflow-y: auto;
}

.challenge-feedback {
    color: var(--text-primary);
    line-height: 1.5;
    margin-top: 8px;
    font-family: 'JetBrains Mono', monospace;
    word-break: break-word;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    max-height: 150px;
    overflow-y: auto;
}

/* Fast Tapper Results */
.tap-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    margin: 8px 0;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
}

.tap-result-item.winner {
    border-color: var(--accent-yellow);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), var(--bg-secondary));
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    animation: winnerGlow 2s ease-in-out infinite alternate;
}

@keyframes winnerGlow {
    0% { 
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
        transform: translateY(-2px) scale(1);
    }
    100% { 
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
        transform: translateY(-2px) scale(1.02);
    }
}

.tap-result-name {
    font-size: 1.1em;
    color: var(--text-primary);
}

.tap-result-count {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--accent-cyan);
}

.tap-result-item.winner .tap-result-name,
.tap-result-item.winner .tap-result-count {
    color: var(--accent-yellow);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* ===== INDIVIDUAL RESULT OVERLAY ===== */
.result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 15000;
    backdrop-filter: blur(15px);
    animation: overlayFadeIn 0.3s ease-out;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

@keyframes overlayFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.result-overlay-content {
    max-width: 95%;
    max-height: none;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
}

.individual-result {
    background: var(--bg-secondary);
    border: 3px solid;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    max-width: 600px;
    width: 90%;
    max-height: none;
    overflow: visible;
    animation: resultPopIn 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(20px);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    margin: auto;
}

@keyframes resultPopIn {
    0% { 
        opacity: 0; 
        transform: scale(0.8) translateY(30px);
    }
    100% { 
        opacity: 1; 
        transform: scale(1) translateY(0);
    }
}

.individual-result.passed {
    border-color: #00ff88;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), var(--bg-secondary));
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.3);
}

.individual-result.failed {
    border-color: var(--accent-red);
    background: linear-gradient(135deg, rgba(255, 8, 68, 0.1), var(--bg-secondary));
    box-shadow: 0 0 40px rgba(255, 8, 68, 0.3);
}

.individual-result h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2em;
    font-weight: 800;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.individual-result.passed h3 {
    color: #00ff88;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.individual-result.failed h3 {
    color: var(--accent-red);
    text-shadow: 0 0 20px rgba(255, 8, 68, 0.5);
}

.auto-submit-indicator {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    margin-bottom: 12px;
    border: 1px solid #ff9800;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
}

.result-response {
    background: var(--bg-primary);
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0;
    font-style: italic;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    border-left: 4px solid var(--accent-cyan);
    word-break: break-word;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    max-height: 180px;
    overflow-y: auto;
    min-height: 50px;
    text-align: center;
    max-width: 90%;
    margin: 0 auto 10px auto;
}

.result-feedback {
    color: var(--text-primary);
    line-height: 1.5;
    margin: 16px 0;
    font-family: 'JetBrains Mono', monospace;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    word-break: break-word;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    max-height: 180px;
    overflow-y: auto;
    min-height: 50px;
    text-align: center;
    max-width: 90%;
    margin: 16px auto;
}

.continue-instruction {
    margin: 15px 0;
    color: var(--text-muted);
    font-style: italic;
}

/* ===== POINTS TABLE SYSTEM ===== */
.points-table-container,
.final-points-table-container {
    background: var(--bg-secondary);
    border: 2px solid var(--border-secondary);
    padding: 24px;
    border-radius: 8px;
    max-width: 850px;
    margin: 24px auto;
    backdrop-filter: blur(15px);
    box-shadow: var(--shadow-soft);
}

.points-table {
    width: 100%;
}

.points-table-header,
.points-table-row {
    display: grid;
    grid-template-columns: 2fr repeat(5, 1fr) 1fr;
    gap: 12px;
    padding: 12px 16px;
    font-size: 0.95em;
    border-radius: 8px;
    margin-bottom: 4px;
    font-family: 'Rajdhani', sans-serif;
}

.points-table-header {
    background: var(--bg-tertiary);
    border: 2px solid var(--accent-red);
    color: var(--text-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.points-table-row {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    align-items: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.points-table-row:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
    border-color: var(--accent-cyan);
}

.player-name-cell {
    font-weight: 600;
    color: var(--text-primary);
}

.round-result {
    text-align: center;
    font-size: 1em;
    border-radius: 4px;
    font-weight: 700;
    padding: 6px 8px;
    font-family: 'Rajdhani', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.round-result.win {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    border: 2px solid #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.round-result.loss {
    background: rgba(255, 8, 68, 0.2);
    color: var(--accent-red);
    border: 2px solid var(--accent-red);
    box-shadow: 0 0 15px rgba(255, 8, 68, 0.3);
}

.total-score {
    text-align: center;
    font-weight: 700;
    color: var(--accent-yellow);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2em;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.no-data {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-style: italic;
    background: var(--glass-bg);
    border-radius: 8px;
    border: 1px solid var(--border-secondary);
}

/* ===== BIG WINNER ANNOUNCEMENT ===== */
.big-winner-announcement {
    background: linear-gradient(135deg, var(--accent-yellow), #ffa500);
    color: #000000;
    padding: 40px;
    border: 4px solid var(--accent-yellow);
    border-radius: 8px;
    margin: 40px 0;
    text-align: center;
    font-size: clamp(1.8em, 5vw, 2.8em);
    font-weight: 800;
    font-family: 'Rajdhani', sans-serif;
    animation: victoryGlow 3s ease-in-out infinite alternate;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    box-shadow: 
        0 0 50px rgba(255, 215, 0, 0.5),
        inset 0 0 30px rgba(255, 255, 255, 0.1);
}

@keyframes victoryGlow {
    0% { 
        box-shadow: 
            0 0 50px rgba(255, 215, 0, 0.5),
            inset 0 0 30px rgba(255, 255, 255, 0.1);
        transform: scale(1);
    }
    100% { 
        box-shadow: 
            0 0 80px rgba(255, 215, 0, 0.8),
            inset 0 0 50px rgba(255, 255, 255, 0.2);
        transform: scale(1.02);
    }
}

.final-score {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    margin: 8px 0;
    background: var(--bg-secondary);
    border: 2px solid var(--border-secondary);
    border-radius: 8px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
}

.final-score:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.final-score.winner {
    border-color: var(--accent-yellow);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), var(--bg-secondary));
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    animation: winnerGlow 2s ease-in-out infinite alternate;
}

/* ===== WAITING SCREEN ===== */
.waiting-section {
    text-align: center;
    padding: 40px;
}

.waiting-section h2 {
    font-family: 'Rajdhani', sans-serif;
    color: var(--accent-cyan);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    animation: waitingPulse 2.5s ease-in-out infinite alternate;
}

@keyframes waitingPulse {
    0% { 
        opacity: 0.7; 
        transform: scale(1);
        text-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
    }
    100% { 
        opacity: 1; 
        transform: scale(1.02);
        text-shadow: 0 0 30px rgba(0, 245, 255, 0.6);
    }
}

.waiting-text {
    color: var(--text-muted);
    font-style: italic;
    margin-top: 20px;
    font-size: 1.1em;
    animation: fadeInOut 3.5s ease-in-out infinite;
}


/* ===== MOBILE RESPONSIVENESS ===== */
@media (max-width: 768px) {
    .clean-layout {
        padding: 10px;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
    }
    
    .main-content {
        max-width: 100%;
        padding: 15px;
        margin: 10px 0;
        /* Removed max-height restrictions */
    }
    
    .main-content::before {
        display: none;
    }
    
    .main-content::after {
        top: 0;
    }
    
    .title-section {
        margin-top: 35px;
        margin-bottom: 15px;
    }
    
    .page-content {
        padding: 20px 15px;
        /* Removed max-height restrictions */
    }
    
    .page-content::before {
        display: none;
    }
    
    .page-content::after {
        top: 0;
    }
    
    .ai-symbol-container {
        margin: 10px 0;
    }
    
    .game-controls {
        gap: 10px;
        margin: 15px 0;
    }
    
    .help-section {
        margin-top: 10px;
    }
    
    .cyber-title {
        font-size: clamp(2rem, 6vw, 3rem);
        letter-spacing: 2px;
    }
    
    .title-separator {
        margin: 0 10px;
    }
    
    .ai-symbol-container {
        margin: 20px 0;
    }
    
    .hexagon-wrapper {
        width: 150px;
        height: 150px;
    }
    
    .hexagon-outer {
        width: 120px;
        height: 120px;
    }
    
    .game-controls {
        max-width: 100%;
        margin: 20px 0;
    }
    
    .join-controls {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Other existing mobile styles */
    .page-content {
        padding: 18px;
        margin: 8px;
        max-width: 95%;
    }
    
    .timer {
        font-size: 3em !important;
        padding: 16px 30px;
    }
    
    .oracle-avatar {
        font-size: 2.4em;
    }
    
    .oracle-avatar.large {
        font-size: 3.6em;
    }
    
    .big-winner-announcement {
        font-size: 1.6em;
        padding: 30px 20px;
    }
    
    .response-textarea {
        height: 100px;
        padding: 16px;
        font-size: 0.95em;
    }
    
    .tap-btn {
        width: 150px;
        height: 150px;
        font-size: 1.5em !important;
        padding: 20px !important;
    }
    
    .tap-count-display {
        font-size: 3em;
    }
    
    .individual-result {
        padding: 20px;
        margin: 10px;
        max-width: 90%;
        max-height: 70vh;
    }
    
    .individual-result h3 {
        font-size: 1.6em;
    }
    
    .result-feedback, .result-response {
        max-height: 120px;
        font-size: 0.95em;
    }
    
    .challenge-description {
        font-size: 1.05em;
        padding: 20px 25px;
        line-height: 1.7;
        max-height: 250px;
    }
    
    .trivia-options {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 10px;
    }
    
    .trivia-option {
        min-height: 60px;
        padding: 15px 20px !important;
        font-size: 1em !important;
    }
    
    .trivia-question-text {
        font-size: 1.1em;
        padding: 20px 25px;
        margin: 20px 10px;
    }
    
    .points-table-header, 
    .points-table-row {
        font-size: 0.8em;
        padding: 10px 8px;
        gap: 6px;
    }
}

/* ===== EXTRA SMALL PHONES (320px - 480px) ===== */
@media (max-width: 480px) {
    .clean-layout {
        padding: 2px;
        min-height: 100vh;
    }
    
    .main-content {
        padding: 8px;
        margin: 2px 0;
        /* Removed max-height restrictions */
        border-width: 1px;
    }
    
    .title-section {
        margin-bottom: 10px;
    }
    
    .ai-symbol-container {
        margin: 8px 0;
    }
    
    .game-controls {
        gap: 8px;
        margin: 10px 0;
    }
    
    .help-section {
        margin-top: 8px;
    }
    
    .cyber-title {
        font-size: clamp(1.2rem, 4vw, 1.8rem);
        letter-spacing: 0.5px;
        line-height: 1.1;
    }
    
    .title-separator {
        margin: 0 4px;
        font-size: 0.6em;
    }
    
    .cyber-subtitle {
        font-size: 10px;
        letter-spacing: 1px;
        margin-top: 5px;
    }
    
    .hexagon-wrapper {
        width: 120px;
        height: 120px;
    }
    
    .hexagon-outer {
        width: 100px;
        height: 100px;
    }
    
    .core-center {
        font-size: 18px;
    }
    
    .title-text {
        font-size: 16px;
        letter-spacing: 1px;
    }

    .status-display {
        font-size: 10px;
    }
    
    .cyber-label {
        font-size: 10px;
    }
    
    .cyber-input {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .cyber-btn {
        padding: 10px 16px;
        font-size: 11px;
        letter-spacing: 1px;
    }
    
    .help-btn {
        padding: 6px 12px;
        font-size: 10px;
    }
    
    /* Other existing mobile styles */
    .page-content {
        padding: 10px;
        margin: 2px;
        max-width: 99%;
        border-width: 1px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.9em;
        min-height: 40px;
        border-width: 1px;
    }
    
    .btn.large {
        padding: 14px 24px;
        font-size: 1em;
        min-height: 44px;
    }
    
    .timer {
        font-size: 2.4em !important;
        padding: 12px 24px;
    }
    
    .response-textarea {
        height: 80px;
        padding: 12px;
        font-size: 0.9em;
    }
    
    .tap-btn {
        width: 120px;
        height: 120px;
        font-size: 1.2em !important;
        padding: 15px !important;
    }
    
    .tap-count-display {
        font-size: 2.5em;
    }
    
    .challenge-result-item,
    .tap-result-item {
        padding: 12px 16px;
        margin: 6px 0;
    }
    
    .challenge-player-name {
        font-size: 1em;
    }
    
    .tap-result-name {
        font-size: 1em;
    }
    
    .tap-result-count {
        font-size: 1.1em;
    }
    
    .challenge-description {
        font-size: 1em;
        padding: 18px 20px;
        line-height: 1.6;
        letter-spacing: 0.1px;
        /* Ensure no scrolling issues on mobile */
        height: auto;
        max-height: none;
        overflow: visible;
    }
    
    .trivia-options {
        gap: 12px;
        padding: 0 5px;
    }
    
    .trivia-option {
        min-height: 50px;
        padding: 12px 16px !important;
        font-size: 0.95em !important;
    }
    
    .trivia-question-text {
        font-size: 1em;
        padding: 18px 20px;
        margin: 15px 5px;
    }
}

/* ===== VERY SMALL PHONES (320px and below) ===== */
@media (max-width: 360px) {
    body {
        font-size: 14px;
    }
    
    .clean-layout {
        padding: 1px;
    }
    
    .main-content, .page-content {
        padding: 6px;
        margin: 1px 0;
        border-radius: 4px;
    }
    
    .cyber-title {
        font-size: clamp(1rem, 4vw, 1.4rem);
        letter-spacing: 0px;
        margin-bottom: 5px;
    }
    
    .title-separator {
        margin: 0 2px;
        font-size: 0.5em;
    }
    
    .cyber-subtitle {
        font-size: 8px;
        letter-spacing: 0.5px;
    }
    
    .hexagon-wrapper {
        width: 80px;
        height: 80px;
    }
    
    .hexagon-outer {
        width: 70px;
        height: 70px;
    }
    
    .core-center {
        font-size: 14px;
    }
    
    .game-controls {
        gap: 6px;
        margin: 8px 0;
    }
    
    .title-text {
        font-size: 12px;
        letter-spacing: 0.5px;
    }
    
    .status-display {
        font-size: 8px;
    }
    
    .cyber-label {
        font-size: 8px;
        margin-bottom: 4px;
    }
    
    .cyber-input {
        padding: 8px 10px;
        font-size: 11px;
        min-height: 32px;
    }
    
    .cyber-btn {
        padding: 8px 12px;
        font-size: 10px;
        min-height: 32px;
        letter-spacing: 0.5px;
    }
    
    .help-btn {
        padding: 4px 8px;
        font-size: 8px;
        min-height: 24px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.8em;
        min-height: 36px;
    }
    
    .btn.large {
        padding: 12px 20px;
        font-size: 0.9em;
        min-height: 40px;
    }
    
    .timer {
        font-size: 2em !important;
        padding: 8px 16px;
        border-width: 2px;
    }
    
    .oracle-avatar {
        font-size: 2em;
        margin: 15px 0 10px;
    }
    
    .oracle-avatar.large {
        font-size: 2.8em;
    }
    
    .oracle-message {
        padding: 12px 16px;
        font-size: 0.9em;
        margin: 10px auto;
    }
    
    .riddle-question, .challenge-description {
        font-size: 0.9em;
        padding: 12px 16px;
        line-height: 1.5;
    }
    
    .response-textarea {
        height: 60px;
        padding: 8px;
        font-size: 0.8em;
        min-height: 60px;
    }
    
    .trivia-options {
        gap: 8px;
        padding: 0;
    }
    
    .trivia-option {
        min-height: 40px;
        padding: 8px 12px !important;
        font-size: 0.8em !important;
    }
    
    .trivia-question-text {
        font-size: 0.9em;
        padding: 12px 16px;
        margin: 10px 0;
    }
    
    .tap-btn {
        width: 100px;
        height: 100px;
        font-size: 1em !important;
        padding: 10px !important;
    }
    
    .tap-count-display {
        font-size: 2em;
    }
    
    .big-winner-announcement {
        font-size: 1.2em;
        padding: 20px 10px;
        margin: 20px 0;
    }
    
    .individual-result {
        padding: 15px;
        margin: 5px;
        max-width: 95%;
    }
    
    .individual-result h3 {
        font-size: 1.2em;
    }
    
    .result-feedback, .result-response {
        font-size: 0.8em;
        padding: 8px;
    }
    
    .points-table-header, 
    .points-table-row {
        font-size: 0.7em;
        padding: 6px 4px;
        gap: 3px;
    }
    
    .modal-content {
        max-width: 98%;
        margin: 2px 0;
    }
    
    .modal-header {
        padding: 10px 15px;
    }
    
    .modal-header h2 {
        font-size: 1.2em;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .rule-section {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .rule-section h3 {
        font-size: 1em;
        margin-bottom: 8px;
    }
    
    .rule-section p,
    .rule-section li {
        font-size: 0.8em;
        line-height: 1.4;
    }
}

/* ===== MOBILE TOUCH IMPROVEMENTS ===== */
@media (hover: none) and (pointer: coarse) {
    /* Touch device optimizations */
    .btn, .cyber-btn, .help-btn {
        min-height: 44px; /* iOS recommended touch target */
        min-width: 44px;
        -webkit-tap-highlight-color: rgba(0, 255, 255, 0.3);
    }
    
    .trivia-option {
        min-height: 48px !important;
        -webkit-tap-highlight-color: rgba(0, 255, 255, 0.3);
    }
    
    .tap-btn {
        -webkit-tap-highlight-color: rgba(255, 0, 68, 0.5);
        user-select: none;
        -webkit-user-select: none;
        touch-action: manipulation;
    }
    
    input, textarea {
        font-size: 16px; /* Prevent zoom on iOS */
        -webkit-appearance: none;
        border-radius: 4px;
    }
    
    /* Improve scrolling on mobile */
    .page-content, .individual-result, .modal-body {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}

/* ===== MOBILE KEYBOARD ADJUSTMENTS ===== */
.keyboard-open .page-content {
    /* Removed max-height and overflow restrictions */
}

.keyboard-open .main-content {
    /* Removed max-height and overflow restrictions */
    padding: 10px;
}

.keyboard-open .ai-symbol-container {
    display: none; /* Hide decorative elements when keyboard is open */
}

.keyboard-open .title-section {
    margin-top: 10px;
    margin-bottom: 10px;
}

.keyboard-open .cyber-title {
    font-size: 1.5rem;
}

@media (max-width: 480px) {
    .keyboard-open .page-content {
        /* Removed max-height restrictions */
        padding: 8px;
    }
    
    .keyboard-open .main-content {
        /* Removed max-height restrictions */
        padding: 8px;
    }
}

/* ===== ACCESSIBILITY ===== */
.btn:focus,
input[type="text"]:focus,
textarea:focus {
    outline: 3px solid rgba(0, 245, 255, 0.6);
    outline-offset: 2px;
}

/* ===== PERFORMANCE & REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    /* Disable matrix rain on reduced motion */
    .matrix-bg,
    .matrix-layer-1,
    .matrix-layer-2,
    .matrix-layer-3 {
        display: none !important;
    }
    
    .tap-btn:active {
        transform: none !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --border-primary: rgba(255, 255, 255, 0.8);
        --border-secondary: rgba(255, 255, 255, 0.4);
        --text-muted: #aaa;
    }
}

/* ===== LOADING SYSTEM ===== */
.loading-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 20px;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, var(--accent-red), var(--accent-purple));
    border-radius: 50%;
    animation: aiLoading 1.8s ease-in-out infinite both;
    box-shadow: 0 0 15px rgba(255, 8, 68, 0.5);
}

.loading-dots span:nth-child(1) { animation-delay: -0.4s; }
.loading-dots span:nth-child(2) { animation-delay: -0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes aiLoading {
    0%, 80%, 100% { 
        transform: scale(0); 
        box-shadow: 0 0 15px rgba(255, 8, 68, 0.5);
    }
    40% { 
        transform: scale(1); 
        box-shadow: 0 0 25px rgba(255, 8, 68, 0.8);
    }
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.hidden { display: none; }
.visible { display: block; }

/* Will-change for performance optimization */
.tap-btn,
.response-textarea,
.challenge-result-item,
.timer {
    will-change: transform;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-red);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
/* Reduce complexity on mobile for better performance */
@media (max-width: 768px) {
    /* Reduce matrix layers on mobile */
    .matrix-layer-2,
    .matrix-layer-3 {
        display: none;
    }
    
    /* Simplify matrix animation */
    .matrix-bg {
        opacity: 0.5;
    }
    
    /* Reduce backdrop filter intensity */
    .page-content,
    .cyber-btn,
    .btn,
    input[type="text"],
    textarea,
    .trivia-option,
    .riddle-question,
    .challenge-description {
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
    }
    
    /* Disable complex animations on mobile */
    .cyber-btn::before,
    .cyber-btn::after,
    .btn::before,
    .btn::after {
        display: none;
    }
    
    /* Simplify hover effects */
    .cyber-btn:hover,
    .btn:hover {
        transform: translateY(-2px);
    }
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-red) var(--bg-secondary);
}

/* ===== CUSTOM NOTIFICATIONS ===== */
.custom-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-cyan);
    border-radius: 8px;
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.3),
        var(--shadow-deep);
    z-index: 15000;
    animation: notificationSlideIn 0.3s ease-out;
    backdrop-filter: blur(15px);
}

.custom-notification.warning {
    border-color: #ff9800;
    box-shadow: 
        0 0 30px rgba(255, 152, 0, 0.3),
        var(--shadow-deep);
}

.custom-notification.error {
    border-color: var(--accent-red);
    box-shadow: 
        0 0 30px rgba(255, 0, 68, 0.3),
        var(--shadow-deep);
}

.custom-notification.success {
    border-color: #00ff88;
    box-shadow: 
        0 0 30px rgba(0, 255, 136, 0.3),
        var(--shadow-deep);
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    gap: 15px;
}

.notification-message {
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    line-height: 1.4;
    flex: 1;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

@keyframes notificationSlideIn {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Stack multiple notifications */
.custom-notification:nth-child(n+2) {
    top: calc(20px + (80px * var(--notification-index, 0)));
}

/* Mobile responsive */
@media (max-width: 480px) {
    .custom-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .notification-content {
        padding: 12px 15px;
    }
    
    .notification-message {
        font-size: 13px;
    }
}

/* ===== FINAL TOUCHES ===== */
/* Ensure proper z-indexing */
.page { z-index: 10; }
.result-overlay { z-index: 10000; }
body::after { z-index: 1000; }
body::before { z-index: -1; }

/* Duplicate section removed - styles are defined earlier in the file */

/* ===== MOBILE RESPONSIVENESS ===== */
@media (max-width: 768px) {
    /* ... (other mobile styles) ... */

    .individual-result {
        padding: 20px;
        margin: 10px;
        max-width: 90%;
        max-height: none; /* Corrected: Removed fixed height limit */
        overflow: visible; /* Corrected: Prevents scrollbar on mobile */
    }

    .individual-result h3 {
        font-size: 1.6em;
    }

    .result-feedback,
    .result-response {
        /* This line was causing a lot of issues */
        max-height: none;
        overflow: visible;
        font-size: 0.95em;
    }
}

/* Duplicate challenge description styles removed - already defined above */

/* ===== HOW TO PLAY MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15000;
    backdrop-filter: blur(15px);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
    overflow-y: auto;
    padding: 20px;
}

.modal-overlay.show {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

@keyframes modalFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.modal-content {
    background: var(--bg-secondary);
    border: 2px solid var(--accent-cyan);
    border-radius: 12px;
    max-width: 90%;
    max-height: 90vh;
    width: 700px;
    overflow: visible;
    animation: modalSlideIn 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(20px);
    box-shadow: 
        0 0 50px rgba(0, 245, 255, 0.3),
        var(--shadow-soft);
    position: relative;
    margin: auto;
}

@keyframes modalSlideIn {
    0% { 
        opacity: 0; 
        transform: scale(0.9) translateY(-20px);
    }
    100% { 
        opacity: 1; 
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    padding: 20px 30px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.modal-header h2 {
    color: white;
    margin: 0;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.8em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-weight: bold;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    color: var(--text-primary);
    overflow: visible;
    max-height: none;
}

.game-rules {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.rule-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 20px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.rule-section:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.1);
}

.rule-section h3 {
    color: var(--accent-cyan);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rule-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 15px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1em;
}

.rule-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rule-section li {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95em;
    position: relative;
    padding-left: 20px;
}

.rule-section li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-red);
    font-weight: bold;
}

.rule-section li strong {
    color: var(--accent-yellow);
    font-weight: 600;
}

/* ===== MODAL RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 10px;
        align-items: flex-start;
        justify-content: center;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: none;
        width: auto;
        margin: 10px 0;
        overflow: visible;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-header h2 {
        font-size: 1.5em;
    }
    
    .modal-body {
        padding: 20px;
        overflow: visible;
        max-height: none;
    }
    
    .rule-section h3 {
        font-size: 1.2em;
    }
    
    .rule-section p,
    .rule-section li {
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .modal-overlay {
        padding: 5px;
    }
    
    .modal-content {
        max-width: 98%;
        max-height: none;
        margin: 5px 0;
        overflow: visible;
    }
}

/* Desktop specific enhancements */
@media (min-width: 769px) {
    .modal-overlay {
        padding: 40px;
    }
    
    .modal-content {
        width: 800px;
        max-width: 90vw;
        max-height: 85vh;
    }
    
    .modal-header h2 {
        font-size: 2.2em;
    }
    
    .rule-section h3 {
        font-size: 1.6em;
    }
    
    .rule-section p {
        font-size: 1.1em;
    }
}


