/* Light, high-contrast theme for bright sports halls; touch targets ≥ 56px. */
:root {
  --blue: #1565c0; --blue-d: #0d47a1; --bg: #f4f6f9; --card: #fff; --text: #111; --muted: #5f6b7a;
  --line: #d7dde5; --green: #2e7d32; --red: #c62828; --orange: #ef6c00; --yellow: #f9a825;
  --r: 12px; font-size: 17px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; }

#bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .5rem;
  background: var(--blue); color: #fff; padding: .55rem .8rem; padding-top: max(.55rem, env(safe-area-inset-top)); }
#bar h1 { flex: 1; margin: 0; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bar .icon { background: none; border: 0; color: #fff; font-size: 2rem; line-height: 1; padding: 0 .4rem; }
.net { font-size: .8rem; padding: .2rem .55rem; border-radius: 999px; background: rgba(255,255,255,.18); white-space: nowrap; }
.net.off { background: var(--orange); }
.net.pending { background: var(--yellow); color: #000; }

main { padding: .8rem; max-width: 1200px; margin: 0 auto; }
.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: .85rem; }
h2 { font-size: 1.05rem; margin: 1.2rem 0 .5rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: .9rem; margin-bottom: .6rem; }
.list { display: flex; flex-direction: column; gap: .5rem; }
.item { display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r); padding: .8rem .9rem; min-height: 56px; }
.item:active { background: #e8eef7; }
.item .grow { flex: 1; min-width: 0; }
.item .sub { color: var(--muted); font-size: .85rem; }
.item.next { border: 2px solid var(--blue); }
.badge { font-size: .75rem; font-weight: 700; padding: .2rem .5rem; border-radius: 999px; background: #e3e7ed; white-space: nowrap; }
.badge.live { background: var(--red); color: #fff; }
.badge.fin { background: #e8f5e9; color: var(--green); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 56px; padding: .6rem 1rem;
  border-radius: var(--r); border: 1px solid var(--line); background: var(--card); font-weight: 600; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.danger { color: var(--red); border-color: #f2c4c4; }
.btn.small { min-height: 40px; padding: .3rem .7rem; font-size: .9rem; }
.btn:disabled { opacity: .45; }
.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.field { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .7rem; }
.field input, .field select { min-height: 48px; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.check { display: flex; align-items: center; gap: .5rem; min-height: 44px; }
.check input { width: 22px; height: 22px; }
.error { color: var(--red); }

/* --- game screen --- */
.score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5rem; }
.score .team { font-weight: 700; font-size: .95rem; }
.score .team.us { color: var(--blue-d); }
.score .team:last-child { text-align: right; }
.score .goals { font-size: 2.1rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.status { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .5rem; flex-wrap: wrap; }
.clock { display: flex; align-items: center; gap: .4rem; }
.clock .time { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 4.2ch; text-align: center;
  background: #111; color: #fff; border-radius: 8px; padding: .1rem .5rem; border: 0; }
.clock .btn { min-height: 44px; min-width: 52px; }
.tabs { display: flex; gap: .3rem; margin: .6rem 0; }
.tabs button { flex: 1; min-height: 48px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; font-weight: 600; }
.tabs button.on { background: var(--blue); color: #fff; border-color: var(--blue); }

.group { margin-bottom: .8rem; }
.group-title { font-size: .85rem; font-weight: 700; color: var(--muted); text-transform: uppercase; margin: .2rem 0 .4rem; }
.actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.act { min-height: 72px; border-radius: var(--r); border: 0; font-weight: 700; font-size: 1.05rem; color: #fff; }
.act.us { background: var(--blue); }
.act.them { background: #455a64; }
.act.pen { background: #6d4c41; }
.act small { display: block; font-weight: 400; font-size: .75rem; opacity: .85; }

.log .ev { display: flex; gap: .6rem; align-items: center; padding: .55rem .2rem; border-bottom: 1px solid var(--line); }
.log .ev .t { font-variant-numeric: tabular-nums; color: var(--muted); width: 3.2rem; flex: none; }
.log .ev .d { flex: 1; min-width: 0; }
.log .ev .d .sub { color: var(--muted); font-size: .85rem; }
.log .ev.them .d strong { color: #455a64; }
.log .ev.us .d strong { color: var(--blue-d); }
.pend { font-size: .75rem; color: var(--orange); }

/* --- entry sheet --- */
.sheet { position: fixed; inset: 0; z-index: 20; background: var(--bg); overflow: auto; display: flex; flex-direction: column; }
.sheet-head { display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem; background: #263238; color: #fff;
  padding-top: max(.6rem, env(safe-area-inset-top)); }
.sheet-head h3 { flex: 1; margin: 0; font-size: 1.05rem; }
.sheet-head button { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 8px; min-height: 40px; padding: 0 .8rem; }
.summary { padding: .4rem .8rem; background: #eceff1; font-size: .9rem; min-height: 2rem; }
.step { padding: .8rem; flex: 1; max-width: 900px; width: 100%; margin: 0 auto; }
.step h4 { margin: .2rem 0 .7rem; font-size: 1.1rem; }
.sheet-foot { display: flex; gap: .5rem; padding: .7rem .8rem; border-top: 1px solid var(--line); background: var(--card);
  padding-bottom: max(.7rem, env(safe-area-inset-bottom)); }
.sheet-foot .btn { flex: 1; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: .5rem; }
.pick { min-height: 64px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); padding: .3rem; }
.pick b { display: block; font-size: 1.35rem; }
.pick span { display: block; font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick.sel { border: 3px solid var(--blue); }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.choice { min-height: 72px; border-radius: var(--r); border: 0; font-weight: 700; font-size: 1.1rem; color: #fff; background: #546e7a; }
.choice.goal { background: var(--green); } .choice.saved { background: var(--blue); }
.choice.miss { background: #8d6e63; } .choice.post { background: var(--orange); } .choice.blocked { background: #6a1b9a; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; max-width: 360px; }
.keypad button { min-height: 64px; font-size: 1.4rem; font-weight: 700; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); }
.keypad .display { grid-column: span 3; text-align: center; font-size: 2rem; font-weight: 800; min-height: 3rem; }

.goal { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 4px;
  aspect-ratio: 3 / 2; max-width: 560px; margin: 0 auto; padding: 6px; background: repeating-linear-gradient(90deg, #c62828 0 24px, #fff 24px 48px);
  border-radius: 6px; }
.goal button { border: 0; background: rgba(255,255,255,.92); border-radius: 4px; font-weight: 700; color: #333; font-size: .9rem; }
.goal button:active { background: #bbdefb; }
.court { width: 100%; max-width: 640px; display: block; margin: 0 auto; touch-action: manipulation; }

.toast { position: fixed; left: 50%; top: calc(3.6rem + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 30;
  background: #263238; color: #fff; border-radius: 999px; padding: .6rem .6rem .6rem 1.1rem; display: flex; gap: .8rem; align-items: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.25); max-width: calc(100% - 2rem); }
.toast span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast button { flex: none; background: #fff; color: #263238; border: 0; border-radius: 999px; min-height: 40px; padding: 0 1rem; font-weight: 700; }

@media (min-width: 900px) and (orientation: landscape) {
  /* Tablet landscape: entry/squad on the left, log always visible on the right. */
  .game-cols { display: grid; grid-template-columns: 3fr 2fr; gap: 1rem; align-items: start; }
  .game-cols > .tabs { grid-column: 1 / -1; }
  .game-cols .tabs [data-tab="verlauf"] { display: none; }
  .game-cols .pane-log { display: block !important; grid-column: 2; grid-row: 2; }
  .game-cols .pane-main { grid-column: 1; grid-row: 2; }
}
