/* HOT SEAT — head-coach career PWA.
 * Phone-first dark identity: deep navy + hot-seat orange/red.
 * 560px column, big touch targets, no horizontal scroll. */
:root {
  --bg: #0b1526;
  --bg2: #0e1a30;
  --card: #141f36;
  --card-hi: #1a2742;
  --line: rgba(148, 163, 184, 0.18);
  --line-soft: rgba(148, 163, 184, 0.10);
  --text: #f4f6fb;
  --muted: #9aa6bd;
  --faint: #6d7891;
  --accent: #ff5a1f;
  --accent-hi: #ff7a45;
  --hot: #ff2e4d;
  --gold: #ffc53d;
  --green: #35d07f;
  --blue: #5ea2ff;
  --tabbar-h: 68px;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 8px;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  --tnum: "SF Mono", ui-monospace, -apple-system, "Segoe UI", Roboto, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
/* heat glow from the top */
body::before {
  content: "";
  position: fixed; inset: 0 0 auto 0; height: 340px; z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 100% at 50% -20%, rgba(255, 90, 31, 0.12), transparent 60%),
    radial-gradient(80% 60% at 50% -10%, rgba(255, 46, 77, 0.06), transparent 70%);
}
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; position: relative; z-index: 1; }
button { font-family: inherit; -webkit-tap-highlight-color: transparent; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- topbar ---------- */
#topbar {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, rgba(11, 21, 38, 0.97), rgba(11, 21, 38, 0.85));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
}
.brand { font-weight: 900; letter-spacing: 2px; font-size: 17px; }
.brand .build-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  background: var(--accent); color: #1a0d05;
  border-radius: 6px; padding: 2px 6px; vertical-align: 2px; margin-left: 6px;
}
.season-line { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ---------- view ---------- */
#view { padding: 12px 12px calc(var(--tabbar-h) + 20px); }
#view:empty { min-height: 40vh; }

/* ---------- tabs ---------- */
#tabs {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px; z-index: 30;
  display: flex;
  background: rgba(11, 21, 38, 0.96);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}
#tabs button {
  flex: 1; background: none; border: 0; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 11px; min-height: var(--tabbar-h);
}
#tabs button b { font-size: 20px; font-weight: 400; }
#tabs button.active { color: var(--accent-hi); }
#tabs button.active b { filter: drop-shadow(0 0 6px rgba(255, 90, 31, 0.6)); }

/* ---------- cards & type ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 8px; font-size: 17px; }
.card h3 { margin: 0 0 8px; font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; color: var(--faint); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mt { margin-top: 10px; }
.mb { margin-bottom: 10px; }
.num { font-family: var(--tnum); font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.hr { border: 0; border-top: 1px solid var(--line-soft); margin: 10px 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; border: 0; border-radius: var(--r-md);
  background: var(--accent); color: #1c0e04;
  font-weight: 800; font-size: 15px; padding: 13px 18px;
  min-height: 48px; text-align: center;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }
.btn.block { display: block; width: 100%; }
.btn.ghost {
  background: var(--card-hi); color: var(--text);
  border: 1px solid var(--line);
}
.btn.danger { background: var(--hot); color: #fff; }
.btn.cool { background: #27406b; color: var(--text); }
.btn.sm { padding: 8px 12px; min-height: 40px; font-size: 13.5px; }
.btn-row { display: flex; gap: 8px; margin-top: 10px; }
.btn-row .btn { flex: 1; }

/* ---------- play buttons (arcade) ---------- */
.play-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.play-btn {
  background: var(--card-hi); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 10px 8px; min-height: 62px; text-align: left;
  display: flex; flex-direction: column; gap: 3px;
}
.play-btn .pn { font-weight: 800; font-size: 14px; }
.play-btn .ph { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.play-btn .grade { font-size: 10.5px; font-weight: 800; letter-spacing: 0.5px; }
.grade.fav { color: var(--green); }
.grade.even { color: var(--gold); }
.grade.tough { color: var(--hot); }
.spec-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.spec-btn {
  flex: 1 1 30%; background: #22314f; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 10px 6px; min-height: 48px; font-weight: 700; font-size: 13px;
}
.spec-btn.warn { border-color: var(--hot); color: #ffb3c0; }
.spec-btn.go { border-color: var(--green); color: #b9f4d4; }

/* ---------- score bug ---------- */
.scorebug {
  background: #0a1222; border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 10px 12px; margin-bottom: 10px;
}
.sb-teams { display: flex; justify-content: space-between; align-items: center; }
.sb-team { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 16px; }
.sb-team .dot { width: 12px; height: 12px; border-radius: 50%; }
.sb-score { font-family: var(--tnum); font-size: 26px; font-weight: 800; }
.sb-meta { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.sb-down { color: var(--gold); font-weight: 800; }

/* ---------- canvas ---------- */
.field-wrap {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line); margin-bottom: 10px; background: #0d3a1f;
}
.field-wrap canvas { display: block; width: 100%; height: auto; }
.field-banner {
  position: absolute; left: 0; right: 0; top: 38%;
  text-align: center; font-weight: 900; font-size: 22px; letter-spacing: 1px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.8); pointer-events: none;
  padding: 8px; opacity: 0; transition: opacity 0.25s;
}
.field-banner.show { opacity: 1; }
.field-banner.td { color: var(--gold); }
.field-banner.to { color: var(--hot); }
.field-banner.info { color: #fff; font-size: 17px; }

/* ---------- shade warning ---------- */
.shade {
  background: rgba(255, 46, 77, 0.12); border: 1px solid var(--hot);
  color: #ffc9d2; border-radius: var(--r-md); padding: 8px 12px;
  font-size: 13px; font-weight: 700; margin-bottom: 10px;
}

/* ---------- play-by-play feed ---------- */
.feed {
  max-height: 220px; overflow-y: auto;
  background: #0a1222; border: 1px solid var(--line-soft);
  border-radius: var(--r-md); padding: 8px 10px; margin-top: 10px;
}
.feed div { padding: 4px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.feed div:last-child { border-bottom: 0; }
.feed .big { font-weight: 800; color: var(--gold); }
.feed .qtag { color: var(--faint); font-size: 11px; font-family: var(--tnum); }

/* ---------- meters ---------- */
.meter { height: 12px; border-radius: 8px; background: #1c2942; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 8px; }
.meter.heat > i { background: linear-gradient(90deg, var(--green), var(--gold) 55%, var(--hot)); }
.meter.cap > i { background: var(--blue); }
.meter-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }

/* ---------- tables ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; color: var(--faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 7px 4px; border-bottom: 1px solid var(--line-soft); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl tr.tap:active { background: var(--card-hi); }
.pos-chip {
  display: inline-block; min-width: 34px; text-align: center;
  background: #22314f; border-radius: 6px; padding: 2px 6px;
  font-size: 11.5px; font-weight: 800; color: var(--blue);
}

/* ---------- checklist ---------- */
.check { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.check:last-child { border-bottom: 0; }
.check .box {
  width: 24px; height: 24px; border-radius: 8px; flex: 0 0 24px;
  border: 2px solid var(--faint); display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: transparent;
}
.check.done .box { border-color: var(--green); background: rgba(53, 208, 127, 0.15); color: var(--green); }
.check .cl { flex: 1; }
.check .cl b { display: block; font-size: 14.5px; }
.check .cl span { font-size: 12px; color: var(--muted); }

/* ---------- forms ---------- */
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; font-weight: 700; }
.input, select.input {
  width: 100%; background: #0a1222; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px; font-size: 15px; min-height: 48px; font-family: inherit;
}
select.input { appearance: none; }
.opt-row { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  flex: 1 1 45%; background: var(--card-hi); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 10px; min-height: 56px; text-align: left;
}
.opt b { display: block; font-size: 14px; }
.opt span { font-size: 11.5px; color: var(--muted); }
.opt.sel { border-color: var(--accent); background: rgba(255, 90, 31, 0.12); }

/* ---------- depth chart ---------- */
.dc-row { display: flex; align-items: center; gap: 6px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.dc-row .nm { flex: 1; font-size: 14px; }
.dc-row .ovr { font-family: var(--tnum); font-weight: 800; width: 34px; text-align: right; }
.dc-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card-hi); color: var(--text); font-size: 16px;
}
.dc-pos { font-size: 12px; font-weight: 900; color: var(--accent-hi); letter-spacing: 1px; margin: 12px 0 2px; }

/* ---------- value bars (trades) ---------- */
.vbar { height: 14px; border-radius: 8px; background: #1c2942; overflow: hidden; margin: 4px 0 8px; }
.vbar > i { display: block; height: 100%; }
.vbar .give { background: var(--green); }
.vbar .get { background: var(--hot); }
.pick-chip {
  display: inline-block; background: #22314f; border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; margin: 3px; font-size: 13px; font-weight: 700;
}
.pick-chip.sel { border-color: var(--accent); background: rgba(255, 90, 31, 0.14); }
.sel-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sel-pill {
  background: rgba(255, 90, 31, 0.14); border: 1px solid var(--accent);
  border-radius: 20px; padding: 5px 10px; font-size: 12.5px; font-weight: 700;
}
.sel-pill button { background: none; border: 0; color: var(--accent-hi); font-size: 14px; margin-left: 4px; }

/* ---------- misc ---------- */
.badge {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 0.5px;
  padding: 3px 8px; border-radius: 20px; text-transform: uppercase;
}
.badge.hot { background: rgba(255, 46, 77, 0.16); color: #ff8ba0; border: 1px solid var(--hot); }
.badge.safe { background: rgba(53, 208, 127, 0.14); color: #7fe7ab; border: 1px solid var(--green); }
.badge.warn { background: rgba(255, 197, 61, 0.14); color: var(--gold); border: 1px solid var(--gold); }
.badge.info { background: rgba(94, 162, 255, 0.14); color: #a8ccff; border: 1px solid var(--blue); }
.tag { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: 1px; font-weight: 800; }
.news-item { padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.news-item:last-child { border-bottom: 0; }
.news-item .tag { margin-right: 6px; }
.inj-out { color: var(--hot); font-weight: 800; }
.inj-q { color: var(--gold); font-weight: 700; }
details.acc { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-md); margin-bottom: 8px; }
details.acc summary { padding: 12px 14px; font-weight: 800; cursor: pointer; list-style: none; }
details.acc summary::-webkit-details-marker { display: none; }
details.acc .acc-body { padding: 0 14px 14px; }
.trade-fx { font-size: 12.5px; color: var(--muted); }
.trade-fx b.up { color: var(--green); }
.trade-fx b.dn { color: var(--hot); }

/* ---------- toast ---------- */
#toast-root { position: fixed; bottom: calc(var(--tabbar-h) + 14px); left: 0; right: 0; z-index: 50; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.toast {
  background: #1c2942; color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 16px; font-size: 14px; font-weight: 700;
  box-shadow: var(--shadow); max-width: 92%; text-align: center;
  animation: toast-in 0.25s ease-out;
}
.toast.err { border-color: var(--hot); }
.toast.ok { border-color: var(--green); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- arcade toggles ---------- */
.tog-row { display: flex; gap: 8px; margin-top: 10px; }
.tog {
  flex: 1; background: var(--card-hi); border: 1px solid var(--line);
  color: var(--muted); border-radius: var(--r-md); padding: 9px; font-size: 12.5px; font-weight: 700;
  min-height: 44px;
}
.tog.on { color: var(--accent-hi); border-color: var(--accent); }

/* big final score */
.final-score { display: flex; justify-content: center; align-items: center; gap: 18px; padding: 12px 0; }
.final-score .fs-team { text-align: center; }
.final-score .fs-team .abbr { font-size: 22px; font-weight: 900; }
.final-score .fs-num { font-family: var(--tnum); font-size: 44px; font-weight: 800; }
.qhdr { font-size: 12px; font-weight: 900; color: var(--gold); letter-spacing: 1px; margin: 10px 0 4px; text-transform: uppercase; }

@media (min-width: 600px) {
  .play-grid { grid-template-columns: 1fr 1fr 1fr 1fr; }
}
