:root { color-scheme: dark; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #08120c; color: #f5f7f4; font-synthesis: none; }
* { box-sizing: border-box; }
html, body, #app { width: 100%; max-width: 100%; min-height: 100%; }
body { margin: 0; min-width: 280px; min-height: 100vh; overflow-x: hidden; background: radial-gradient(circle at 20% 0%, #183523 0, #08120c 45%, #050a07 100%); }
button { font: inherit; }
.eyebrow { margin: 0 0 .75rem; color: #8fdda6; font-size: clamp(.8rem, 1.3vw, 1.1rem); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2.25rem, 5vw, 5.5rem); line-height: .98; letter-spacing: -.045em; }
.pairing-layout { width: 100%; min-width: 0; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); align-items: center; gap: clamp(2rem, 6vw, 7rem); padding: clamp(2rem, 6vw, 7rem); }
.pairing-copy { min-width: 0; }
.steps { margin: clamp(2rem, 5vh, 4rem) 0; padding: 0; list-style: none; counter-reset: steps; display: grid; gap: 1.15rem; max-width: 46rem; }
.steps li { counter-increment: steps; display: grid; grid-template-columns: 2.6rem 1fr; align-items: center; gap: 1rem; font-size: clamp(1rem, 2vw, 1.55rem); color: #d7e1d9; }
.steps li::before { content: counter(steps); display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: #1d4229; color: #adf2bf; font-weight: 800; }
.qr-panel { max-width: 100%; justify-self: center; padding: clamp(1rem, 2vw, 1.5rem); background: white; border-radius: 2rem; box-shadow: 0 2rem 6rem #0008; line-height: 0; }
.qr-panel canvas { display: block; width: min(38vw, 420px); max-width: 100%; height: auto; border-radius: .5rem; }
.status-line { display: flex; align-items: center; gap: .75rem; font-size: clamp(1rem, 1.8vw, 1.35rem); font-weight: 700; }
.pulse, .connection-dot { width: .75rem; height: .75rem; border-radius: 50%; background: #54d777; box-shadow: 0 0 0 .4rem #54d77725; }
.pulse { animation: pulse 1.8s ease-out infinite; }
.expiry { color: #91a095; }
.scoreboard { min-height: 100vh; padding: clamp(1.4rem, 4vw, 4.5rem); display: flex; flex-direction: column; gap: clamp(1.5rem, 4vh, 3.5rem); }
.score-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; }
.score-heading { min-width: 0; }
.score-subtitle { margin: .85rem 0 0; color: #b8c7bb; font-size: clamp(1rem, 1.8vw, 1.35rem); }
.header-badges, .player-badges { display: flex; flex-wrap: wrap; gap: .5rem; }
.header-badges { margin-top: 1rem; }
.badge { display: inline-flex; padding: .35rem .65rem; border: 1px solid #71dd8e55; border-radius: 999px; background: #183b23; color: #adf2bf; font-size: clamp(.7rem, 1.1vw, .9rem); font-weight: 800; letter-spacing: .02em; }
.connection { display: flex; align-items: center; gap: .75rem; color: #b8c7bb; white-space: nowrap; }
.connection-warning { color: #ffd980; }
.connection-warning .connection-dot { background: #f2b84b; box-shadow: 0 0 0 .4rem #f2b84b25; }
.scores { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(.8rem, 2vw, 1.5rem); align-content: center; }
.player { min-height: clamp(7rem, 17vh, 13rem); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: clamp(1rem, 2vw, 2rem); padding: clamp(1.2rem, 3vw, 2.5rem); border: 1px solid #ffffff18; border-radius: clamp(1.2rem, 2vw, 2rem); background: #ffffff0b; }
.player.leader { border-color: #71dd8e55; background: linear-gradient(135deg, #214f2eaa, #102419aa); }
.player-copy { min-width: 0; }
.player h2 { overflow: hidden; margin: 0; font-size: clamp(1.4rem, 3vw, 3rem); text-overflow: ellipsis; white-space: nowrap; }
.player-badges { margin-top: .65rem; }
.player strong { font-size: clamp(2rem, 5vw, 5rem); font-variant-numeric: tabular-nums; letter-spacing: -.05em; }
.rank { display: grid; place-items: center; width: clamp(2.3rem, 4vw, 3.7rem); aspect-ratio: 1; border-radius: 50%; background: #ffffff10; color: #9ca9a0; font-weight: 800; }
.last-result { display: flex; align-items: baseline; padding: 1rem 1.4rem; border-radius: 1rem; background: #ffffff0a; color: #b8c7bb; }
.last-result span { color: #8fdda6; font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.last-result > div { min-width: 0; margin-left: 1rem; }
.last-result p { margin: 0; }
.last-result small { display: block; margin-top: .3rem; color: #91a095; }
.party-report { display: grid; gap: 1rem; }
.party-report > h2 { margin: 0; color: #8fdda6; font-size: clamp(1.4rem, 2.4vw, 2.2rem); }
.highlight-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 1rem; }
.highlight-card { padding: clamp(1rem, 2vw, 1.5rem); border: 1px solid #71dd8e44; border-radius: 1.2rem; background: linear-gradient(135deg, #214f2e77, #102419aa); }
.highlight-card h3 { margin: 0 0 .45rem; font-size: clamp(1.05rem, 1.7vw, 1.35rem); }
.highlight-card p { margin: 0; color: #c5d2c8; line-height: 1.45; }
.centered-state { min-height: 100vh; display: grid; place-items: center; padding: 2rem; text-align: center; }
.state-card { max-width: 42rem; padding: clamp(2rem, 6vw, 5rem); border: 1px solid #ffffff18; border-radius: 2rem; background: #102017dd; box-shadow: 0 2rem 6rem #0007; }
.state-card h1 { font-size: clamp(2rem, 5vw, 4rem); }
.state-card > p:not(.eyebrow) { color: #b8c7bb; font-size: clamp(1rem, 2vw, 1.3rem); line-height: 1.6; }
.state-card button { margin-top: 1rem; padding: .9rem 1.4rem; border: 0; border-radius: .8rem; background: #66da85; color: #07110a; font-weight: 800; cursor: pointer; }
.state-icon { width: 3.5rem; height: 3.5rem; margin: 0 auto 2rem; border: .35rem solid #ffffff25; border-top-color: #70dc8d; border-radius: 50%; }
.spinner { animation: spin 1s linear infinite; }
.offline, .finished, .expired, .error { border: 0; border-radius: 1rem; background: #f2b84b; }
.finished { background: #70dc8d; }
.error { background: #ec6b62; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 70% { box-shadow: 0 0 0 1rem #54d77700; } 100% { box-shadow: 0 0 0 0 #54d77700; } }
@media (max-width: 760px) {
    .pairing-layout { grid-template-columns: minmax(0, 1fr); padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); text-align: center; }
    .steps { text-align: left; }
    .steps li { min-width: 0; }
    .qr-panel { order: -1; }
    .qr-panel { width: min(100%, 352px); }
    .qr-panel canvas { width: 100%; }
    .score-header { align-items: flex-start; flex-direction: column; }
    .scores { grid-template-columns: 1fr; }
    .player { min-height: 6rem; }
    .last-result { align-items: flex-start; flex-direction: column; }
    .last-result > div { margin-top: .35rem; margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
