:root { font-family: Inter, Arial, sans-serif; color: #f8fafc; background: #06101b; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, #18324a, #06101b 62%); overflow: hidden; }
button { font: inherit; color: inherit; touch-action: manipulation; }
main { height: 100vh; display: flex; flex-direction: column; padding: 1.5vh 2vw; }
header { display: flex; justify-content: space-between; font-weight: 800; letter-spacing: .12em; }
header > div { display: flex; gap: 2rem; }
.brand { color: #f59e0b; }
.dashboard { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(310px, 34%) 1fr; gap: 1.2vw; margin: 1.3vh 0; }
.score-panel { min-height: 0; display: grid; grid-template-rows: 1fr auto 1fr; gap: 1vh; }
.camera-view { position: relative; min-width: 0; min-height: 0; overflow: hidden; border: 2px solid #334155; border-radius: 1rem; background: #020617; }
#camera-feed { width: 100%; height: 100%; display: block; object-fit: contain; }
.camera-state { position: absolute; inset: 0; display: grid; place-items: center; padding: 2rem; background: #020617; color: #cbd5e1; font-size: clamp(1.1rem, 2vw, 2rem); font-weight: 800; text-align: center; }
.camera-state[hidden] { display: none; }
.camera-state.offline, .camera-state.unavailable { color: #fdba74; }
#camera-badge { position: absolute; top: .75rem; left: .75rem; padding: .45rem .75rem; border-radius: .5rem; background: #020617c9; font-size: clamp(.65rem, 1vw, 1rem); font-weight: 900; letter-spacing: .1em; }
.team { position: relative; min-height: 0; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr auto; align-items: center; padding: 1.2vh 1.2vw; border: 4px solid transparent; border-radius: 1.4rem; background: rgba(15, 23, 42, .76); opacity: .68; cursor: pointer; overflow: hidden; }
.team.serving { opacity: 1; box-shadow: 0 .7rem 2rem #0008; }
.orange.serving { border-color: #f97316; background: linear-gradient(#7c2d12cc, #1c1917); }
.blue.serving { border-color: #38bdf8; background: linear-gradient(#075985cc, #0c1928); }
.team-number { align-self: start; justify-self: start; color: #94a3b8; font-size: clamp(.7rem, .9vw, 1rem); font-weight: 900; letter-spacing: .16em; }
.serve { visibility: hidden; align-self: start; justify-self: end; font-size: clamp(.7rem, 1vw, 1rem); font-weight: 900; letter-spacing: .16em; }
.serving .serve { visibility: visible; }
.orange .serve { color: #fdba74; } .blue .serve { color: #7dd3fc; }
.name { align-self: center; justify-self: start; font-size: clamp(1.3rem, 2.2vw, 2.6rem); font-weight: 800; }
.team strong { grid-row: 2; grid-column: 2; align-self: center; font-size: clamp(5rem, 8vw, 8rem); line-height: .8; }
.hint { grid-column: 1 / -1; align-self: end; justify-self: center; font-size: clamp(.55rem, .7vw, .8rem); color: #cbd5e1; letter-spacing: .08em; }
.service { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: .8rem; padding: .55rem 1rem; border-radius: .8rem; text-align: left; color: #94a3b8; background: #0f2133; }
.service small { font-weight: 800; }
.service b { font-size: clamp(2.2rem, 3vw, 3.4rem); line-height: 1; color: #fbbf24; }
#server-name { font-size: clamp(.75rem, 1.2vw, 1.2rem); }
#message { min-height: 2.5rem; text-align: center; font-size: clamp(1rem, 2vw, 2rem); font-weight: 700; }
footer { display: flex; justify-content: center; gap: 1rem; }
footer button, .choice { border: 0; border-radius: .8rem; padding: .9rem 1.5rem; background: #1e3a52; font-weight: 900; cursor: pointer; }
footer .danger { background: #9a3412; }
.overlay { position: fixed; inset: 0; display: grid; place-items: center; background: #020617dc; }
.overlay[hidden] { display: none; }
.pickle-overlay { padding: 0; background: #000; z-index: 20; overflow: hidden; }
.pickle-overlay video { position: relative; z-index: 1; width: 100vw; height: 100vh; display: block; object-fit: contain; background: #000; }
.pickle-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: #020617; font-size: clamp(4rem, 12vw, 13rem); font-weight: 900; letter-spacing: .06em; text-shadow: 0 0 32px #f59e0b; z-index: 0; }
.dialog { width: min(90vw, 560px); padding: 2rem; border: 2px solid #475569; border-radius: 1.5rem; text-align: center; background: #0f2133; }
.dialog h2 { font-size: 3rem; margin: 0 0 2rem; }
.choice { min-width: 9rem; margin: .5rem; font-size: 1.5rem; }
.choice.selected { outline: 5px solid #f59e0b; background: #9a3412; }
.dialog p { color: #94a3b8; }
.result-actions { display: flex; justify-content: center; flex-wrap: wrap; }
.result-btn { min-width: 9rem; margin: .5rem; padding: .9rem 1.5rem; font-size: 1.5rem; border: 0; border-radius: .8rem; background: #1e3a52; color: inherit; font-weight: 900; cursor: pointer; }
.result-btn.danger { background: #7f1d1d; }
#stats-list { margin: 0 0 1rem; padding: 0; list-style: none; display: grid; gap: .5rem; max-height: 40vh; overflow-y: auto; text-align: left; }
#stats-list[hidden] { display: none; }
#stats-list li { display: flex; justify-content: space-between; padding: .6rem .9rem; border-radius: .6rem; background: #16283c; color: #e2e8f0; font-weight: 700; font-size: 1.1rem; }
#qr-banner { position: fixed; right: 1.2rem; bottom: 9.8rem; display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; border: 2px solid #334155; border-radius: 1rem; background: #0f2133f0; box-shadow: 0 .5rem 1.5rem #0008; z-index: 5; }
#qr-banner[hidden] { display: none; }
#qr-banner-image { width: 84px; height: 84px; border-radius: .4rem; background: white; padding: .3rem; }
#qr-banner div { display: grid; gap: .2rem; color: #f8fafc; }
#qr-banner b { font-size: .85rem; letter-spacing: .08em; color: #fbbf24; }
#qr-banner-timer { font-size: .75rem; color: #94a3b8; }
#start-qr { position: fixed; right: 1.2rem; bottom: 1.2rem; width: 8rem; display: grid; gap: .45rem; justify-items: center; padding: .65rem; border: 2px solid #f59e0b; border-radius: 1rem; background: #020617eb; box-shadow: 0 .7rem 1.6rem #0009; z-index: 4; }
#start-qr img { width: 6.6rem; height: 6.6rem; padding: .35rem; border-radius: .45rem; background: white; }
#start-qr b { color: #fbbf24; font-size: .74rem; line-height: 1.05; text-align: center; letter-spacing: .08em; }
@media (max-width: 900px) {
  header { font-size: .75rem; } .brand { display: none; }
  .dashboard { grid-template-columns: minmax(260px, 40%) 1fr; }
  .team { border-radius: 1rem; } .hint { display: none; }
  .team strong { font-size: clamp(4rem, 9vw, 6rem); }
  #start-qr { width: 6.8rem; padding: .5rem; }
  #start-qr img { width: 5.4rem; height: 5.4rem; }
  #start-qr b { font-size: .62rem; }
  #qr-banner { bottom: 8.3rem; }
}
