/* Phone control screen */
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); min-height: 100vh; }
.bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px; background: rgba(7, 34, 25, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(232,185,49,.25);
}
.bar .logo { height: 26px; width: auto; }
.bar .wlr { height: 24px; }
.bar .ttl { flex: 1; text-align: center; font-size: 1.6rem; color: var(--gold); line-height: 1; }

main { padding: 14px; max-width: 720px; margin: 0 auto; }
h2 { margin: 6px 0 12px; font-size: 1.15rem; letter-spacing: .02em; }
h2 .festive { font-size: 1.6rem; color: var(--gold); }
.muted { opacity: .7; }
.small { font-size: .85rem; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.stack { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(7, 34, 25, 0.96); border-top: 1px solid rgba(232,185,49,.3); padding-bottom: env(safe-area-inset-bottom);
}
.tabs button { background: none; border: 0; color: var(--cream); opacity: .6; padding: 8px 0 10px; font-size: .72rem; font-weight: 600; display: grid; gap: 2px; justify-items: center; }
.tabs button span { font-size: 1.35rem; }
.tabs button.on { opacity: 1; color: var(--gold); }

/* Station cards */
.st { padding: 14px; }
.st-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.st-top .nm { font-weight: 800; font-size: 1.1rem; }
.pill { font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--pine-light); letter-spacing: .04em; }
.pill.live { background: var(--red); }
.pill.gold { background: var(--gold); color: var(--ink); }
.vs-line { display: flex; align-items: center; gap: 10px; }
.vs-line .t { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.vs-line .t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-line .t.right { justify-content: flex-end; text-align: right; }
.vs { font-family: var(--festive); color: var(--gold); font-size: 1.3rem; }
.actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.actions .btn { flex: 1; }
select, input[type=text], input[type=number], textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1.5px solid rgba(232,185,49,.45);
  background: var(--cream); color: var(--ink); font-size: 16px; /* 16px stops iOS zooming */
}
label.fld { display: grid; gap: 5px; font-size: .85rem; font-weight: 600; }
.pick { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.next-hint { font-size: .8rem; margin-top: 6px; opacity: .75; }
.check { display: flex; gap: 8px; align-items: center; font-size: .9rem; margin-top: 10px; }
.check input { width: 20px; height: 20px; }

/* Teams */
.team { padding: 12px; display: flex; gap: 12px; align-items: center; }
.team .info { flex: 1; min-width: 0; }
.team .info b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team.out { opacity: .55; }
.seg { display: inline-flex; background: rgba(0,0,0,.3); border-radius: 999px; padding: 3px; margin-top: 6px; }
.seg button { border: 0; background: none; color: var(--cream); font-size: .75rem; font-weight: 700; padding: 5px 10px; border-radius: 999px; opacity: .7; }
.seg button.on { opacity: 1; background: var(--pine-light); }
.seg button.on[data-status=away] { background: #a7801a; }
.seg button.on[data-status=out] { background: var(--red-deep); }

/* Evenness */
.even { padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.even .bar-mini { height: 8px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: 5px; }
.even .bar-mini i { display: block; height: 100%; background: var(--gold); }
.even.behind { border-color: rgba(200,16,46,.6); }
.even .count { font-weight: 800; font-variant-numeric: tabular-nums; }
.stepper { display: inline-flex; align-items: center; gap: 12px; }
.stepper button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--red); color: var(--cream); font-size: 1.3rem; font-weight: 800; }
.stepper b { font-size: 1.6rem; min-width: 1.5em; text-align: center; }

/* History */
.hist { padding: 10px 12px; cursor: pointer; }
.hist .meta { font-size: .78rem; opacity: .7; margin-bottom: 4px; }
.hist .w { color: var(--gold); }

/* Bottom sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 720px; max-height: 92vh; overflow: auto; background: var(--pine); border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border-top: 3px solid var(--gold); animation: up .22s ease-out;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet h3 { margin: 0 0 14px; font-size: 1.2rem; display: flex; align-items: center; gap: 8px; }
.sheet h3 .x { margin-left: auto; background: none; border: 0; color: var(--cream); font-size: 1.6rem; line-height: 1; }
.winner-pick { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: stretch; }
.wp {
  border: 2px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); color: var(--cream); border-radius: 14px; padding: 12px 6px;
  display: grid; justify-items: center; gap: 6px; font-weight: 700; text-align: center;
}
.wp.on { border-color: var(--gold); background: rgba(232,185,49,.2); box-shadow: 0 0 0 2px var(--gold) inset; }
.wp.tie { align-self: center; padding: 12px 14px; }
.wp small { font-weight: 600; opacity: .8; }
.scores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.photo-row { display: flex; gap: 12px; align-items: center; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; }
.danger { color: #ffb3bf; background: none; border: 0; font-weight: 700; padding: 10px; }
.we-list { margin: 0; padding-left: 1.6rem; }
.we-list li { padding: 3px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: rgba(255,255,255,.12); border-radius: 999px; padding: 5px 6px 5px 12px; display: inline-flex; gap: 6px; align-items: center; }
.chip button { border: 0; background: rgba(0,0,0,.3); color: var(--cream); border-radius: 50%; width: 24px; height: 24px; }
.danger-zone { padding: 14px; margin-top: 10px; border-color: rgba(200, 16, 46, .6); background: rgba(142, 11, 32, .18); }
.btn.danger-btn { width: 100%; background: transparent; border: 2px solid var(--red); box-shadow: none; color: #ffb3bf; }
.tv-link { color: var(--cream); text-decoration: none; font-weight: 700; font-size: .8rem; background: rgba(255,255,255,.12); padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.bar .ttl { white-space: nowrap; }
@media (max-width: 420px) {
  .bar { gap: 8px; padding-left: 10px; padding-right: 10px; }
  .bar .ttl { font-size: 1.3rem; }
  .bar .logo { height: 20px; }
  .bar .wlr { height: 19px; }
}
.nb { display: grid; min-width: 0; line-height: 1.2; }
.nb b, .nb small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb small { font-size: .75rem; opacity: .75; font-weight: 500; }
.vs-line .t.right .nb { text-align: right; }
.wp small.pl { opacity: .7; font-weight: 500; margin-top: -4px; }
.tiebreak { padding: 14px; border-color: var(--gold); background: rgba(232, 185, 49, .12); display: grid; gap: 10px; }
.game-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
