/* Hear My Team — slice styles.
 *
 * Visual language from the Codex wireframes (layouts/): navy + red, card
 * stacks, mobile frame. The additions are the honesty states the mocks predate
 * — freshness captions, unverified streams, unconfirmed sports, honest absence
 * — which are the whole reason the slice exists, so they are styled as first
 * class furniture rather than as fine print.
 */

:root {
  --navy: #0d2240;
  --navy-soft: #17335c;
  --red: #c8102e;
  --ink: #12161c;
  --muted: #5b6675;
  --line: #e2e6ec;
  --bg: #f5f7fa;
  --card: #ffffff;
  --warn-bg: #fff4e5;
  --warn-ink: #8a4b00;
  --warn-line: #f0c088;
  --unstated-bg: #f1f4f8;
  --radius: 14px;
  --pad: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef2f7; --muted: #9aa6b6; --line: #26303d;
    --bg: #0a121e; --card: #111b29;
    --warn-bg: #3a2a12; --warn-ink: #f0c088; --warn-line: #6b4a1c;
    --unstated-bg: #16202e;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

/* ── top bar ─────────────────────────────────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: calc(env(safe-area-inset-top) + 12px) var(--pad) 12px;
  background: var(--navy); color: #fff;
}
.wordmark { margin: 0; font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; }
.wordmark span { color: #ff6b81; font-style: italic; }

.place {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 52%; padding: 7px 11px;
  font: inherit; font-size: .8rem; color: #fff;
  background: rgba(255,255,255,.12); border: 0; border-radius: 999px; cursor: pointer;
}
.place:hover { background: rgba(255,255,255,.2); }
.pin, .glass { width: 15px; height: 15px; fill: currentColor; flex: none; }
#place-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── layout ──────────────────────────────────────────────────────── */

#app { max-width: 620px; margin: 0 auto; padding: var(--pad); }
.screen { animation: rise .18s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }

.field-label {
  margin: 22px 0 8px; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
}

/* ── level tabs & sport chips ────────────────────────────────────── */

.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.level {
  padding: 11px 8px; font: inherit; font-size: .88rem; font-weight: 600;
  color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.level.is-active { background: var(--red); border-color: var(--red); color: #fff; }
.level:disabled { opacity: .4; cursor: not-allowed; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  flex: 1 1 30%; padding: 12px 10px; font: inherit; font-size: .84rem; font-weight: 600;
  color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.chip.is-active { border-color: var(--red); color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.chip:disabled { opacity: .42; cursor: not-allowed; }

/* ── search ──────────────────────────────────────────────────────── */

.search {
  display: flex; align-items: center; gap: 9px; padding: 0 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
}
.search .glass { color: var(--muted); }
#team-search { flex: 1; padding: 13px 0; font: inherit; color: var(--ink);
  background: none; border: 0; outline: none; }
#team-search::-webkit-search-cancel-button { display: none; }
.clear { display: none; padding: 4px 6px; font-size: 1.2rem; line-height: 1;
  color: var(--muted); background: none; border: 0; cursor: pointer; }
.search.has-text .clear { display: block; }

.results { list-style: none; margin: 8px 0 0; padding: 0; }
.results li {
  display: flex; align-items: baseline; gap: 8px; padding: 12px 14px; margin-bottom: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.results li:hover, .results li:focus-visible { border-color: var(--navy-soft); outline: none; }
.results .name { font-weight: 650; }
.results .meta { font-size: .8rem; color: var(--muted); }

/* ── answer ──────────────────────────────────────────────────────── */

.back { margin: 4px 0 14px; padding: 0; font: inherit; font-size: .86rem;
  color: var(--navy-soft); background: none; border: 0; cursor: pointer; }

.teamcard {
  padding: 16px; margin-bottom: 16px;
  background: var(--navy); color: #fff; border-radius: var(--radius);
}
.teamcard h2 { margin: 0 0 3px; font-size: 1.3rem; letter-spacing: -.01em; }
.teamcard .meta { font-size: .82rem; opacity: .82; }

.section-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin: 22px 0 9px; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
}
.section-title .count { font-weight: 500; text-transform: none; letter-spacing: 0; }

.card {
  padding: 13px 14px; margin-bottom: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 11px;
}
.row { display: flex; align-items: center; gap: 12px; }
.row .grow { flex: 1; min-width: 0; }

.dial { font-size: 1.06rem; font-weight: 700; letter-spacing: -.01em; }
.callsign { font-size: .84rem; color: var(--muted); }
.where { font-size: .8rem; color: var(--muted); }
.distance { font-variant-numeric: tabular-nums; font-size: .88rem; font-weight: 650; white-space: nowrap; }

.badge {
  display: inline-block; padding: 2px 7px; margin-left: 6px;
  font-size: .66rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  border-radius: 999px; vertical-align: middle;
}
.badge.flagship { background: var(--red); color: #fff; }
.badge.partial { background: var(--unstated-bg); color: var(--muted); }
.badge.language { margin-left: 0; margin-top: 4px; background: var(--navy-soft); color: #fff; }

/* Freshness — the slice's soul. Never fine print. */
.freshness {
  display: block; margin-top: 7px; padding: 5px 8px;
  font-size: .75rem; border-radius: 7px;
  background: var(--unstated-bg); color: var(--muted);
}
.freshness.warn {
  background: var(--warn-bg); color: var(--warn-ink);
  border: 1px solid var(--warn-line); font-weight: 600;
}

/* Streams */
.stream .platform { font-size: 1rem; font-weight: 650; }
.verify { margin-top: 3px; font-size: .76rem; color: var(--muted); }
.candidate-source {
  display: flex; align-items: center; min-height: 44px;
  width: fit-content; color: var(--ink); font-size: .82rem;
  text-decoration: underline; text-underline-offset: 3px;
}
.card > .listen { display: inline-flex; align-items: center; margin-top: 8px; }
.listen {
  padding: 9px 15px; font: inherit; font-size: .84rem; font-weight: 700;
  color: #fff; background: var(--red); border: 0; border-radius: 9px;
  text-decoration: none; white-space: nowrap;
}
.listen.frontdoor { background: var(--card); color: var(--navy-soft);
  border: 1px solid var(--line); font-weight: 600; }

/* Honest absence */
.absence {
  padding: 18px 16px; text-align: center;
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius);
}
.absence h3 { margin: 0 0 6px; font-size: 1rem; }
.absence p { margin: 0; font-size: .86rem; color: var(--muted); }

/* Games */
.game {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 11px 13px; margin-bottom: 7px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
}
.game .when { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.game .when.tba { color: var(--warn-ink); font-weight: 650; }

/* ── location sheet ──────────────────────────────────────────────── */

.sheet {
  width: min(460px, calc(100% - 28px)); padding: 20px;
  color: var(--ink); background: var(--card);
  border: 0; border-radius: var(--radius);
  box-shadow: 0 18px 60px rgba(0,0,0,.28);
}
.sheet::backdrop { background: rgba(6,12,22,.55); }
.sheet h2 { margin: 0 0 6px; font-size: 1.1rem; }
.muted { color: var(--muted); font-size: .85rem; }
.or { margin: 14px 0 8px; font-size: .78rem; color: var(--muted); text-align: center; }
#place-input { width: 100%; padding: 12px; font: inherit; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px; }
.error { margin: 9px 0 0; font-size: .82rem; color: var(--red); }
.alts { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.alts button { padding: 6px 10px; font: inherit; font-size: .78rem;
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.primary { padding: 11px 16px; font: inherit; font-weight: 700; color: #fff;
  background: var(--navy); border: 0; border-radius: 9px; cursor: pointer; }
.primary.wide { width: 100%; }
.ghost { padding: 11px 14px; font: inherit; color: var(--muted);
  background: none; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }

.loading { padding: 26px; text-align: center; color: var(--muted); }

/* Veracity badges — verified renders nothing; lower tiers say so honestly. */
.tier {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 0.6rem;
  margin-top: 0.15rem;
}
.tier-reported { background: #f2ecdc; color: #6b5d33; }
.tier-unverified { background: #f6ddd2; color: #8a3b1e; }
