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

:root {
    --bg: #0a0a1a;
    --surface: #141428;
    --surface-2: #1e1e3a;
    --primary: #e94560;
    --primary-hover: #ff6b81;
    --primary-glow: rgba(233, 69, 96, 0.3);
    --accent: #16213e;
    --accent-2: #1a1a3e;
    --text: #f0f0f0;
    --text-muted: #8888aa;
    --success: #2ecc71;
    --success-glow: rgba(46, 204, 113, 0.3);
    --warning: #f39c12;
    --gold: #ffd700;
    --silver: #c0c0c0;
    --bronze: #cd7f32;
    --border: #2a2a4a;
    --cat-politika: #e94560;
    --cat-veda: #3498db;
    --cat-hudba: #9b59b6;
    --cat-film: #e67e22;
    --cat-sport: #2ecc71;
    --cat-historie: #c0a060;
    --cat-literatura: #1abc9c;
    --cat-umeni: #e84393;
    --cat-byznys: #00cec9;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    background-image: radial-gradient(ellipse at 20% 50%, rgba(233, 69, 96, 0.05) 0%, transparent 60%),
                      radial-gradient(ellipse at 80% 20%, rgba(52, 152, 219, 0.05) 0%, transparent 60%);
    color: var(--text);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-x: hidden;
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 0.3rem;
    background: linear-gradient(135deg, var(--primary), #ff8a80);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
h2 { font-size: 1.4rem; color: var(--text-muted); margin-bottom: 1.5rem; }

.container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.9rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #c0392b);
    min-width: 180px;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 15px var(--primary-glow);
    position: relative;
    overflow: hidden;
}
.btn::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s;
}
.btn:hover::after { left: 100%; }
.btn:hover { transform: translateY(-3px); box-shadow: 0 8px 25px var(--primary-glow); }
.btn:active { transform: translateY(-1px); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--secondary { background: var(--surface-2); border: 2px solid var(--border); box-shadow: none; }
.btn--secondary:hover { border-color: var(--primary); box-shadow: 0 4px 15px var(--primary-glow); }
.btn--success { background: linear-gradient(135deg, var(--success), #27ae60); box-shadow: 0 4px 15px var(--success-glow); }
.btn--small { padding: 0.6rem 1.4rem; font-size: 1rem; min-width: auto; border-radius: 12px; }
.btn--wide { width: 100%; max-width: 400px; }

/* Input */
input[type="text"] {
    width: 100%;
    max-width: 400px;
    padding: 0.9rem 1.2rem;
    font-size: 1.1rem;
    border: 2px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: all 0.25s;
}
input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

/* Room code display */
.room-code {
    font-size: 5rem;
    font-weight: 800;
    letter-spacing: 0.8rem;
    background: linear-gradient(135deg, var(--primary), #ff8a80);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Courier New', monospace;
    text-shadow: none;
    filter: drop-shadow(0 0 20px var(--primary-glow));
}

/* QR */
#qr { margin: 1rem 0; }
#qr canvas { border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }

/* Player list */
.player-list {
    list-style: none;
    width: 100%;
    max-width: 500px;
}
.player-list li {
    padding: 0.7rem 1.2rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    transition: all 0.3s;
    animation: slideIn 0.4s cubic-bezier(.4,0,.2,1);
}
.player-list li .score {
    background: linear-gradient(135deg, var(--primary), #c0392b);
    color: #fff;
    border-radius: 50%;
    width: 2.2rem;
    height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px var(--primary-glow);
}

/* Category badge */
.cat-badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Hints (TV) */
.hint-area {
    width: 100%;
    text-align: center;
    min-height: 200px;
}
.hint-list {
    list-style: none;
    text-align: left;
    margin: 1rem auto;
    max-width: 600px;
}
.hint-list li {
    padding: 0.7rem 1.2rem;
    font-size: 1.3rem;
    border-left: 4px solid var(--primary);
    margin-bottom: 0.6rem;
    background: linear-gradient(135deg, var(--surface-2), var(--accent));
    border-radius: 0 12px 12px 0;
    animation: hintSlide 0.6s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.hint-list li:nth-child(2) { border-left-color: #3498db; }
.hint-list li:nth-child(3) { border-left-color: #9b59b6; }
.hint-list li:nth-child(4) { border-left-color: #e67e22; }
.hint-list li:nth-child(5) { border-left-color: #2ecc71; }
.hint-list li:nth-child(6) { border-left-color: #f39c12; }

/* Round info */
.round-info {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    max-width: 500px;
    height: 8px;
    background: var(--surface-2);
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}
.progress-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #ff8a80);
    transition: width 0.5s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Circular timer (TV only) */
.timer-ring {
    width: 100px;
    height: 100px;
    margin: 0 auto;
}
.timer-ring circle {
    fill: none;
    stroke-width: 6;
    transform: rotate(-90deg);
    transform-origin: center;
}
.timer-ring .bg { stroke: var(--surface-2); }
.timer-ring .fg {
    stroke: var(--primary);
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
    filter: drop-shadow(0 0 6px var(--primary-glow));
}

/* Result / reveal */
.reveal {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--success), #27ae60);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: popIn 0.6s cubic-bezier(.4,0,.2,1);
    filter: drop-shadow(0 0 15px var(--success-glow));
}
.reveal.no-winner {
    background: linear-gradient(135deg, var(--warning), #e67e22);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 15px rgba(243, 156, 18, 0.3));
}

/* Scoreboard */
.scoreboard {
    width: 100%;
    max-width: 600px;
}
.scoreboard-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.4rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    transition: all 0.5s cubic-bezier(.4,0,.2,1);
    animation: slideIn 0.4s cubic-bezier(.4,0,.2,1);
}
.scoreboard-row:first-child {
    background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,215,0,0.05));
    border: 2px solid var(--gold);
    font-weight: 700;
    font-size: 1.4rem;
    box-shadow: 0 4px 20px rgba(255,215,0,0.15);
}
.scoreboard-row:nth-child(2) { border-color: var(--silver); }
.scoreboard-row:nth-child(3) { border-color: var(--bronze); }
.scoreboard-row .medal { margin-right: 0.6rem; font-size: 1.3rem; }
.scoreboard-row .rank { margin-right: 0.8rem; color: var(--text-muted); font-weight: 400; }
.scoreboard-row:first-child .rank { color: var(--gold); }
.scoreboard-row .score-num {
    background: linear-gradient(135deg, var(--primary), #c0392b);
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    min-width: 3rem;
    text-align: center;
}

/* Feedback on phone */
.feedback {
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    animation: shake 0.4s;
    margin-top: 0.5rem;
}
.feedback.wrong { color: var(--primary); background: rgba(233,69,96,0.1); }
.feedback.correct { color: var(--success); font-weight: 700; background: rgba(46,204,113,0.1); }

/* Pick choices */
.pick-grid {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    width: 100%;
    max-width: 400px;
}
.pick-card {
    padding: 1.1rem 1.3rem;
    background: var(--surface-2);
    border: 2px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
    text-align: left;
}
.pick-card:hover { border-color: var(--primary); transform: translateX(6px); box-shadow: 0 4px 15px var(--primary-glow); }
.pick-card:active { transform: translateX(3px); }
.pick-card .name { font-weight: 700; font-size: 1.15rem; }
.pick-card .cat { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.2rem; }

/* Toggle */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1rem;
    margin: 0.5rem 0;
}
.toggle-row input[type="checkbox"] {
    width: 1.3rem;
    height: 1.3rem;
    accent-color: var(--primary);
}

/* Confetti canvas */
#confetti-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

/* Pulse animation for waiting */
.pulse { animation: pulse 2s ease-in-out infinite; }

/* Winner flash */
.winner-flash {
    animation: winnerFlash 0.8s ease;
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes hintSlide {
    from { opacity: 0; transform: translateX(-50px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes popIn {
    0% { opacity: 0; transform: scale(0.5); }
    70% { transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
@keyframes winnerFlash {
    0% { background: rgba(46,204,113,0.3); }
    100% { background: transparent; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* TV (host) specific */
.host-body {
    justify-content: flex-start;
    padding: 2rem 3rem;
}
.host-body .container { max-width: 1000px; }
.host-body h1 { font-size: 3rem; }
.host-body .hint-list li { font-size: 2rem; padding: 1rem 1.5rem; }
.host-body .scoreboard-row { font-size: 1.6rem; padding: 1.1rem 1.8rem; }
.host-body .scoreboard-row:first-child { font-size: 2rem; }
.host-body .room-code { font-size: 6rem; }
.host-body .round-info { font-size: 1.3rem; }
.host-body .player-list li { font-size: 1.4rem; padding: 0.8rem 1.4rem; }
.host-body .reveal { font-size: 3.5rem; }

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

/* Responsive */
@media (max-width: 480px) {
    h1 { font-size: 1.6rem; }
    .room-code { font-size: 3rem; }
    .btn { padding: 0.7rem 1.5rem; font-size: 1rem; }
    .hint-list li { font-size: 1.1rem; }
}
