:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: #172234;
  background: #f2f4f6;
  --navy: #141b27;
  --muted: #536174;
  --line: #d9dfe6;
  --paper: #fff;
  --red: #b32124;
  --red-hover: #92191c;
  --orange: #ffb35b;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.035em; }
p { line-height: 1.55; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 3px solid #408bd5; outline-offset: 3px; }
.topbar { background: var(--navy); color: white; border-top: 4px solid #e74741; }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.brand { display: flex; align-items: center; gap: 11px; line-height: 1.15; }
.brand strong { display: block; font-size: 1rem; letter-spacing: -.025em; }
.brand div span { display: block; margin-top: 4px; font-size: .75rem; color: #c6ced9; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; background: #c72d30; color: #fff; font-size: 1.3rem; font-weight: 850; border-radius: 8px; }
.shell { max-width: 1180px; margin: 0 auto; padding: 36px 24px 64px; }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.page-title h1 { font-weight: 820; font-size: clamp(2rem, 5vw, 3rem); }
.page-title p { margin-top: 9px; color: var(--muted); }
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav .button, .topbar .button { color: #e4eaf2; background: #252f3e; border-color: #414c5e; }
.nav .selected, .nav .button:hover, .topbar .button:hover { background: #f6f8fa; color: var(--navy); }
.button { display: inline-flex; align-items: center; justify-content: center; padding: .65rem .94rem; font-size: .92rem; font-weight: 700; min-height: 43px; text-decoration: none; border: 1px solid #cbd3de; border-radius: 8px; background: #fff; color: #192538; cursor: pointer; line-height: 1.2; text-align: center; }
.button:hover { background: #e9eef3; }
.button.primary { background: var(--red); border-color: var(--red); color: white; }
.button.primary:hover { background: var(--red-hover); }
.button.danger { color: #9b191b; border-color: #e9c3c4; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 2px 4px #101a2910; min-width: 0; }
.card h2, .card h3 { margin-bottom: 12px; }
.stack { display: grid; gap: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 315px), 1fr)); align-items: start; gap: 16px; }
.field { display: grid; gap: 6px; font-size: .9rem; font-weight: 700; min-width: 0; }
.field > span { overflow-wrap: anywhere; }
input:not([type=checkbox]), textarea, select { width: 100%; border: 1px solid #bcc7d4; border-radius: 8px; padding: 9px 11px; color: #172234; background: #fff; min-height: 43px; font-weight: 500; min-width: 0; }
input[type=checkbox] { accent-color: var(--red); width: 1.1rem; height: 1.1rem; }
.check { display: flex; align-items: center; gap: 9px; }
.two-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.feedback { color: var(--muted); font-weight: 650; }
.feedback:empty { display: none; }
.feedback.error { color: #a31c22; }
.signal { border-radius: 8px; padding: 10px 13px; background: #e8edf4; }
.signal:empty { display: none; }
.signal.error { background: #fff1da; color: #5b350f; }
.muted, small { color: var(--muted); line-height: 1.5; }
.badge { display: inline-flex; width: fit-content; padding: 4px 9px; border-radius: 6px; background: #eaf0f5; color: #38485d; font-size: .78rem; font-weight: 750; }
.badge.ok { background: #e6f4e9; color: #235333; }
.badge.warn { background: #ffebd0; color: #6d3c0b; }
.list { display: grid; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.list-row:last-child { border-bottom: 0; padding-bottom: 0; }
.pool { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 11px; }
.pool .check { padding: 5px 0; }
.table-box { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .8rem; color: var(--muted); }
td { font-size: .91rem; }
details { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
summary { font-weight: 700; cursor: pointer; }
details > :not(summary) { margin-top: 12px; }
.photo { display: block; width: 100%; max-height: 380px; object-fit: contain; background: #e4e9ef; border-radius: 8px; }
.picture-link { display: block; }
.picture-empty { display: grid; place-items: center; background: #e9eef4; color: var(--muted); padding: 20px; border-radius: 8px; min-height: 115px; }
.login-layout { min-height: calc(100vh - 74px); display: grid; place-items: center; padding: 30px 18px; background: radial-gradient(ellipse at 50% 0%, #e9edf2, #f7f8fa); }
.login-panel { width: min(100%, 440px); padding: clamp(22px, 6vw, 36px); border-top: 4px solid var(--red); }
.login-panel .button { width: 100%; }
.live { min-height: 100vh; background: #eef1f5; }
.live.display { background: #141b27; color: #f4f7fb; }
.live .shell { padding-top: 26px; }
.game-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.game-head .timer { font-size: clamp(2.2rem, 7vw, 4rem); font-weight: 810; font-variant-numeric: tabular-nums; letter-spacing: -.07em; line-height: .95; white-space: nowrap; }
.timer-block { text-align: right; }
.timer-block small { display: block; margin-top: 6px; }
.display small, .display .live-note { color: #c9d1dd; }
.game-board { display: grid; grid-template-columns: minmax(0,1fr) minmax(180px, 260px); align-items: start; gap: 18px; }
.task-panel { border-top: 4px solid #bf3033; }
.task-panel h1 { font-size: clamp(2.2rem, 7vw, 5rem); overflow-wrap: anywhere; font-weight: 850; }
.task-meta { display: flex; gap: 8px 15px; align-items: center; flex-wrap: wrap; }
.points { font-weight: 780; color: #8c2022; }
.hint-image { max-height: 45vh; }
.qr-panel { text-align: center; }
.qr-panel .qr-image { width: min(100%, 220px); aspect-ratio: 1; display: block; margin: 0 auto; background: white; border: 1px solid var(--line); border-radius: 8px; }
.qr-panel .button { width: 100%; }
.display .card { background: #202b3b; color: #f4f7fb; border-color: #435167; }
.display .task-panel { border-top-color: #f04d47; }
.display .points { color: #ffd499; }
.display .badge { background: #374862; color: white; }
.game-controls { position: sticky; bottom: 8px; z-index: 1; }
.game-controls .actions { gap: 10px; }
.team .shell { max-width: 650px; padding-inline: 15px; }
.team .game-board { display: block; }
.team .task-panel h1 { font-size: clamp(2rem, 9vw, 3.6rem); }
.team .capture { display: grid; gap: 12px; }
.capture .button { min-height: 48px; }
.file-pick { position: relative; overflow: hidden; display: inline-flex; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-pick:focus-within { outline: 3px solid #408bd5; outline-offset: 3px; }
.scoreline { display: flex; align-items: baseline; gap: 13px; flex-wrap: wrap; }
.scoreline strong { font-size: clamp(2rem, 6vw, 3.2rem); font-variant-numeric: tabular-nums; }
.scoreline p { color: var(--muted); }
.compare { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.compare h3 { font-size: 1rem; margin-bottom: 9px; }
.compare small { display: block; margin-top: 7px; }
@media (max-width: 620px) {
  .shell, .topbar-inner { padding-inline: 16px; }
  .card { padding: 16px; }
  .game-board, .compare { grid-template-columns: minmax(0,1fr); }
  .game-controls { position: static; }
  .topbar-inner { gap: 10px; }
}

