/* Trikot Blau-Weiß: helle Fläche, Königsblau als Vereinsfarbe, dunkelblaue Schrift. Bewusst nur ein (helles) Theme. */
:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --line: #d9dfea;
  --ink: #0f1b33;
  --muted: #5b6780;
  --blue: #1747d1;
  --blue-soft: #e6ecfb;
  --on-blue: #ffffff;
  --win: #1e9e5a;
  --miss: #d93a2b;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 500 17px/1.45 var(--body);
  -webkit-text-size-adjust: 100%;
}
#app {
  max-width: 520px; margin: 0 auto; min-height: 100%;
  padding-block: max(12px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
  display: flex; flex-direction: column; gap: 20px;
}
.view { display: flex; flex-direction: column; gap: 16px; }
.view.center { flex: 1; align-items: center; justify-content: center; min-height: 60vh; }
[hidden] { display: none !important; }

.board { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 12px; border-bottom: 3px solid var(--blue); }
.brand { font: 900 30px/1 var(--display); letter-spacing: .04em; }
.brand span { color: var(--blue); }
.score { display: flex; align-items: center; gap: 10px; font: 800 15px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.score b { font: 900 30px/1 var(--display); color: var(--blue); font-variant-numeric: tabular-nums; min-width: 1ch; text-align: center; }
.score .off { opacity: .45; }

h1, h2 { margin: 0; font-family: var(--display); text-transform: uppercase; letter-spacing: .03em; }
.title { font-size: 40px; font-weight: 900; line-height: 1; }
h2 { font-size: 22px; font-weight: 800; }
.lead { margin: 0; color: var(--muted); }
.label { margin: 0; font: 700 13px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hint { margin: 0; font-size: 14px; color: var(--muted); }
.error { margin: 0; color: var(--miss); font-weight: 600; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; }
.row > input { flex: 1; min-width: 0; }

input {
  font: 600 18px/1.2 var(--body); color: var(--ink); background: var(--bg);
  border: 2px solid var(--line); border-radius: 10px; padding: 14px; width: 100%;
}
input:focus { outline: none; border-color: var(--blue); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 14px; color: var(--muted); font-weight: 600; }
.code-input { text-transform: uppercase; letter-spacing: .3em; font-family: var(--display); font-size: 24px; font-weight: 800; }

.btn {
  font: 800 19px/1 var(--display); letter-spacing: .06em; text-transform: uppercase;
  border: 2px solid var(--line); background: var(--panel); color: var(--ink);
  border-radius: 10px; padding: 14px 18px; cursor: pointer;
}
.btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.btn.big { padding: 18px; font-size: 22px; width: 100%; }
.btn.ghost { background: none; color: var(--muted); }
.btn:disabled { opacity: .5; cursor: default; }

.toggles { display: flex; gap: 10px; flex-wrap: wrap; }
.toggle { position: relative; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle span { display: inline-block; padding: 9px 14px; border: 2px solid var(--line); border-radius: 999px; font-weight: 700; color: var(--muted); }
.toggle input:checked + span { border-color: var(--blue); color: var(--blue); }
.toggle input:disabled + span { opacity: .45; border-style: dashed; cursor: default; }
.score span { white-space: nowrap; max-width: 9ch; overflow: hidden; text-overflow: ellipsis; }
.toggle input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }

.bigcode { font: 900 84px/1 var(--display); letter-spacing: .14em; color: var(--blue); font-variant-numeric: tabular-nums; }
.linkbox { font-size: 14px; }
.waiting { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); animation: pulse 1.2s infinite; flex: none; }
@keyframes pulse { 50% { opacity: .25; } }

.search { position: relative; display: flex; flex-direction: column; gap: 12px; }
.suggest {
  list-style: none; margin: 0; padding: 4px; position: absolute; left: 0; right: 0; top: 58px; z-index: 5;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(15, 27, 51, .14);
}
.suggest li { padding: 12px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.suggest li small { color: var(--muted); }
.suggest li:hover, .suggest li.on { background: var(--blue-soft); }

.chosen { background: var(--panel); border: 2px solid var(--blue); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.chosen strong { font: 900 30px/1.05 var(--display); text-transform: uppercase; }

.countnum { font: 900 200px/1 var(--display); color: var(--blue); animation: pop .9s ease-out; }
@keyframes pop { from { transform: scale(1.5); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); } }

.crit { display: flex; flex-direction: column; gap: 6px; }
.crit .clubs { font: 900 32px/1.02 var(--display); text-transform: uppercase; text-wrap: balance; }
.crit .x { color: var(--blue); padding: 0 .15em; }
.crit .tags { display: flex; gap: 8px; flex-wrap: wrap; }
.crit .tag { font: 800 18px/1 var(--display); text-transform: uppercase; letter-spacing: .05em; border: 2px solid var(--blue); color: var(--blue); padding: 7px 11px; border-radius: 8px; }
.crit.small .clubs { font-size: 22px; }

.timer { display: flex; align-items: center; gap: 12px; }
.timer .track { flex: 1; height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
#timer-bar { height: 100%; background: var(--blue); width: 100%; transition: width .2s linear; }
#timer-bar.low { background: var(--miss); }
#timer-sec { font: 900 34px/1 var(--display); font-variant-numeric: tabular-nums; min-width: 2.6ch; text-align: right; }
#timer-sec.low { color: var(--miss); }
.lock { display: flex; align-items: center; gap: 10px; background: #fdecea; color: var(--miss); border-radius: 10px; padding: 12px 14px; font-weight: 700; }
.lock b { font: 900 28px/1 var(--display); font-variant-numeric: tabular-nums; }

.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.feed li { color: var(--muted); font-size: 15px; }
.feed li s { color: var(--miss); }

.result { display: flex; flex-direction: column; gap: 6px; }
.result .big { font: 900 44px/1 var(--display); text-transform: uppercase; }
.result .big.win { color: var(--win); }
.result .big.lose { color: var(--miss); }
.result .who { font-size: 18px; }
.result .who b { color: var(--blue); }
.sols { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sols li { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; font-weight: 600; }

.toast { width: max-content; max-width: calc(100% - 32px); text-align: center; position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: 10px; font-weight: 700; }

@media (prefers-reduced-motion: reduce) { .dot, .countnum { animation: none; } #timer-bar { transition: none; } }
