/* Beyond the Rim — shared styles for both public portals. */

:root {
  --bg: #0a0e17;
  --bg-raised: #121826;
  --bg-input: #0d1220;
  --line: #222c40;
  --line-strong: #33415c;
  --text: #eef2f8;
  --text-dim: #94a3b8;
  --accent: #e4610f;
  --accent-ink: #ffffff;
  --good: #22c55e;
  --bad: #ef4444;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 500px at 50% -12%, #1b2438 0%, transparent 62%),
    var(--bg);
  color: var(--text);
  font: 16px/1.55 "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 22px 18px 72px; }
.wrap--narrow { max-width: 560px; }

/* ---------- header ---------- */

.masthead { text-align: center; padding: 26px 0 18px; }

.masthead h1 {
  margin: 0;
  font-size: clamp(26px, 6vw, 42px);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 800;
}

.masthead .season { color: var(--text-dim); font-size: 14px; letter-spacing: .18em; text-transform: uppercase; }

.stage-pill {
  display: inline-block;
  margin-top: 12px;
  padding: 7px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* ---------- stage rail ---------- */

.rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 2px 20px;
  scrollbar-width: thin;
}

.rail a {
  flex: 0 0 auto;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
}

.rail a[aria-current="page"] {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(228, 97, 15, .14);
}

/* ---------- team cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.grid--two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  position: relative;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Franchise colour as a top edge — identity without swamping the text. */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--team, var(--accent));
}

.card__head { display: flex; align-items: center; gap: 12px; }

.logo {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--team, #333);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
  object-fit: cover;
}

.card__name { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.25; }
.card__captain { margin: 2px 0 0; color: var(--text-dim); font-size: 13px; }

.badge {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(201, 162, 39, .18);
  color: #e5c454;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ---------- stat strips ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 16px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  text-align: center;
}

.stats div span { display: block; font-size: 11px; color: var(--text-dim); letter-spacing: .08em; text-transform: uppercase; }
.stats div strong { font-size: 19px; font-weight: 700; }

.bars { margin-top: 14px; display: grid; gap: 9px; }
.bar__row { display: grid; grid-template-columns: 78px 1fr 44px; align-items: center; gap: 9px; font-size: 12px; }
.bar__label { color: var(--text-dim); }
.bar__track { height: 7px; border-radius: 999px; background: #1c2436; overflow: hidden; }
.bar__fill { height: 100%; border-radius: 999px; background: var(--team, var(--accent)); }
.bar__value { text-align: right; font-variant-numeric: tabular-nums; }

.votes {
  margin-top: 16px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.votes__count { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.votes__label { font-size: 11px; color: var(--text-dim); letter-spacing: .1em; text-transform: uppercase; }

/* ---------- buttons & forms ---------- */

.btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
}

.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn--ghost { background: transparent; border: 1px solid var(--line-strong); color: var(--text); }

label { display: block; margin: 18px 0 7px; font-size: 13px; color: var(--text-dim); letter-spacing: .06em; text-transform: uppercase; }

input[type="text"], input[type="tel"], input[type="number"], select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text);
  font: inherit;
}

input:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* The team radios are visually hidden, so focus has to be drawn on the
   label instead — otherwise a keyboard voter cannot see where they are. */
.team-option:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- team picker (parent portal) ---------- */

.team-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }

.team-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg-raised);
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  color: inherit;
}

.team-option input { position: absolute; opacity: 0; pointer-events: none; }
.team-option:has(input:checked) { border-color: var(--team, var(--accent)); background: color-mix(in srgb, var(--team, var(--accent)) 16%, var(--bg-raised)); }
.team-option .dot { width: 15px; height: 15px; border-radius: 50%; background: var(--team, #555); flex: 0 0 auto; }

/* ---------- misc ---------- */

.panel {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.note { color: var(--text-dim); font-size: 13px; }
.note--center { text-align: center; }

.summary {
  margin-top: 18px;
  padding: 15px;
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.summary strong { font-size: 24px; }

.msg { margin-top: 16px; padding: 13px 15px; border-radius: 10px; font-size: 14px; }
.msg--ok { background: rgba(34, 197, 94, .14); border: 1px solid rgba(34, 197, 94, .4); }
.msg--bad { background: rgba(239, 68, 68, .13); border: 1px solid rgba(239, 68, 68, .4); }
.msg--wait { background: rgba(228, 97, 15, .13); border: 1px solid rgba(228, 97, 15, .4); }
.msg[hidden] { display: none; }

.countdown {
  margin: 20px auto 6px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.countdown div {
  min-width: 68px;
  padding: 11px 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg-raised);
  text-align: center;
}

.countdown strong { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.countdown span { font-size: 10px; color: var(--text-dim); letter-spacing: .12em; text-transform: uppercase; }

.section-title {
  margin: 34px 0 14px;
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.empty { padding: 42px 18px; text-align: center; color: var(--text-dim); }

.hall { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.hall .card { text-align: center; }
.hall .kind { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dim); }
.hall .who { margin-top: 8px; font-size: 20px; font-weight: 800; }
.hall .sub { color: var(--text-dim); font-size: 13px; }

footer { margin-top: 46px; text-align: center; color: var(--text-dim); font-size: 12px; }
footer a { color: var(--text-dim); }

@media (max-width: 480px) {
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  .bar__fill { transition: width .5s ease; }
  .votes__count { transition: color .3s ease; }
}
