/* GroundSide app styles — same palette as the marketing page. */

:root {
  --bg:        #06080B;
  --panel:     #10141A;
  --panel-2:   #171D25;
  --line:      #232B36;
  --line-soft: #1A212A;

  --ink:   #FFFFFF;
  --muted: #98A5B3;
  --faint: #6D7A88;

  --accent:     #FFB13C;
  --accent-hi:  #FFC565;
  --accent-ink: #171003;
  --accent-dim: rgba(255,177,60,.14);

  --live: #FF3B30;
  --good: #35C08A;
  --bad:  #FF6B5E;

  --display: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --body:    "Barlow", ui-sans-serif, system-ui, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --wrap: 1160px;
  --r: 12px;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
main { min-height: 62vh; padding: 40px 0 72px; }
main > .wrap, main > section > .wrap { max-width: var(--wrap); }
main:not(.wide) .narrow { max-width: 560px; margin: 0 auto; }

h1,h2,h3 { font-family: var(--display); margin: 0; letter-spacing: -.02em; text-wrap: balance; }
h1 { font-weight: 800; font-size: clamp(28px, 4vw, 40px); line-height: 1.08; }
h2 { font-weight: 700; font-size: clamp(21px, 2.6vw, 27px); line-height: 1.14; }
h3 { font-weight: 700; font-size: 17px; }
p  { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 13.5px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.inline { display: inline; }
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent);
}

/* ---- nav ---- */
.nav { border-bottom: 1px solid var(--line-soft); background: rgba(6,8,11,.9); position: sticky; top: 0; z-index: 30; }
.nav-in { display: flex; align-items: center; height: 66px; gap: 18px; }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -.03em; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.navlink { color: var(--muted); font-size: 15px; }
.navlink:hover { color: var(--ink); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--body); font-weight: 600; font-size: 15.5px;
  padding: 12px 22px; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hi); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--panel-2); }
.btn-danger { background: transparent; border-color: rgba(255,107,94,.4); color: var(--bad); }
.btn-danger:hover { background: rgba(255,107,94,.1); }
.btn-sm { font-size: 14px; padding: 8px 15px; }
.btn-block { width: 100%; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---- cards & forms ---- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.card-tight { padding: 18px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
@media (min-width: 820px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--muted); }
input, select, textarea {
  width: 100%; font-family: var(--body); font-size: 15.5px; color: var(--ink);
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 11px 13px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input::placeholder { color: #55616E; }
.field { margin-bottom: 16px; }
.field-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.hint { font-size: 12.5px; color: var(--faint); margin-top: 5px; }

.alert { border-radius: 9px; padding: 12px 15px; font-size: 14.5px; margin-bottom: 18px; border: 1px solid; }
.alert-error { background: rgba(255,107,94,.09); border-color: rgba(255,107,94,.35); color: #FFB3AB; }
.alert-ok    { background: rgba(53,192,138,.09); border-color: rgba(53,192,138,.35); color: #9BE3C4; }
.alert-info  { background: var(--accent-dim); border-color: rgba(255,177,60,.32); color: #FFD79B; }

/* ---- fixture tiles ---- */
.tiles { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 10px; }
.tile-media {
  position: relative; aspect-ratio: 16/9; border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--line-soft);
  background:
    radial-gradient(circle at 70% 20%, color-mix(in srgb, var(--club) 26%, transparent), transparent 60%),
    linear-gradient(150deg, #182029, #0B0F14);
  display: grid; place-items: center;
}
.tile:hover .tile-media { border-color: var(--accent); }
.tile-art span {
  font-family: var(--display); font-weight: 800; font-size: 34px;
  color: color-mix(in srgb, var(--club) 70%, #fff); opacity: .55; letter-spacing: -.02em;
}
.badge {
  position: absolute; top: 9px; left: 9px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--display); font-weight: 700; font-size: 10.5px;
  letter-spacing: .1em; text-transform: uppercase; padding: 4px 8px; border-radius: 4px;
}
.badge.live { background: var(--live); color: #fff; }
.badge.live::before { content:""; width:6px; height:6px; border-radius:50%; background:#fff; animation: blink 1.5s infinite; }
.badge.soon { background: rgba(0,0,0,.72); border: 1px solid rgba(255,255,255,.18); color: #D8E0E8; letter-spacing: .04em; text-transform: none; }
.badge.lock { left: auto; right: 9px; background: rgba(0,0,0,.72); border: 1px solid rgba(255,255,255,.18); color: #D8E0E8; padding: 5px; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.25} }
.tile-title { font-family: var(--display); font-weight: 600; font-size: 16px; line-height: 1.3; }
.tile-sub { color: var(--faint); font-size: 13.5px; }

/* ---- data / dashboards ---- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; font-size: 15px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 13.5px; }
.copyfield { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel-2); }
.copyfield code { flex: 1; padding: 11px 13px; overflow-x: auto; white-space: nowrap; }
.copyfield button {
  border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--faint);
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  padding: 0 14px; cursor: pointer;
}
.copyfield button:hover { background: var(--accent-dim); color: var(--accent); }
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono);
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 4px; border: 1px solid;
}
.pill-good { color: var(--good); background: rgba(53,192,138,.1); border-color: rgba(53,192,138,.32); }
.pill-idle { color: var(--faint); background: rgba(255,255,255,.04); border-color: var(--line); }
.pill-warn { color: var(--accent); background: var(--accent-dim); border-color: rgba(255,177,60,.32); }

table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line-soft); }
th { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
tbody tr:last-child td { border-bottom: 0; }
.scroller { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }

ol.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: flex; flex-direction: column; gap: 18px; }
ol.steps > li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; gap: 14px; }
ol.steps > li::before {
  content: counter(s); font-family: var(--mono); font-size: 12px;
  width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--accent);
}

.site-foot { border-top: 1px solid var(--line-soft); padding: 26px 0 40px; color: var(--faint); font-size: 13.5px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: space-between; }
.demo-flag { color: var(--accent); }

/* ---- player ---- */
.player-wrap { background: #000; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16/9; position: relative; }
.player-wrap video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-idle { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; }
.player-idle .pulse { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); margin: 0 auto 14px; box-shadow: 0 0 0 0 rgba(255,177,60,.5); animation: pulse 2s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(255,177,60,.5)} 70%{box-shadow:0 0 0 14px rgba(255,177,60,0)} 100%{box-shadow:0 0 0 0 rgba(255,177,60,0)} }

/* ---- quality picker ---- */
/* Sits over the video, so it carries its own dark surface rather than the
   theme's: it is always against black, in either theme. */
.q-picker { position: absolute; right: 12px; bottom: 12px; z-index: 3; }
.q-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: #fff;
  background: rgba(12,12,14,.72); border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(8px);
}
.q-btn::after { content: "▾"; font-size: 10px; opacity: .8; }
.q-btn:hover { background: rgba(12,12,14,.88); }
.q-btn:focus-visible { outline: 2px solid var(--club, var(--accent)); outline-offset: 2px; }

.q-menu {
  display: none; position: absolute; right: 0; bottom: calc(100% + 8px);
  min-width: 132px; padding: 5px; border-radius: 12px;
  background: rgba(12,12,14,.94); border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(10px); box-shadow: 0 12px 28px rgba(0,0,0,.5);
}
.q-menu.open { display: block; }
.q-item {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 8px 10px; border: 0; border-radius: 8px;
  background: none; color: rgba(255,255,255,.82); cursor: pointer;
  font: inherit; font-size: 13px; text-align: left;
}
.q-item:hover { background: rgba(255,255,255,.1); color: #fff; }
.q-item.on { color: #fff; font-weight: 600; }
.q-item.on::after { content: "✓"; color: var(--club, var(--accent)); }

@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ---- club branding ---- */
.crest { display: block; flex: none; border-radius: 6px; object-fit: contain; }

.club-head {
  background: linear-gradient(180deg, color-mix(in srgb, var(--club) 12%, var(--panel)), var(--panel));
  border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden;
}
.club-bar { height: 4px; background: var(--club); }
.club-head-in { display: flex; align-items: center; gap: 16px; padding: 18px 20px; }
.club-head h1 { font-size: clamp(21px, 2.9vw, 31px); }

/* The player picks up the club colour rather than the house amber. */
.player-wrap.branded { border-color: color-mix(in srgb, var(--club) 42%, var(--line)); }
.player-wrap.branded .pulse {
  background: var(--club);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--club) 50%, transparent);
  animation: pulse-club 2s infinite;
}
@keyframes pulse-club {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--club) 50%, transparent); }
  70%  { box-shadow: 0 0 0 14px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.idle-card { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.idle-card .crest { margin-bottom: 2px; }

.sponsor {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 14px 18px; border: 1px solid var(--line-soft); border-radius: var(--r);
  background: var(--panel); flex-wrap: wrap;
}
.sponsor a { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; }
.sponsor-label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--faint);
}
.sponsor-name { font-family: var(--display); font-weight: 700; font-size: 19px; }
.sponsor a:hover .sponsor-name { color: var(--accent); }

.brand-preview {
  display: grid; place-items: center; flex: none;
  width: 84px; height: 84px; border-radius: 10px;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 60% 25%, color-mix(in srgb, var(--club) 26%, transparent), transparent 62%), var(--panel-2);
}
.tile-art .crest { opacity: .92; }

/* ---- club-side pages ---- */
.club-nav { background: rgba(6,8,11,.94); }
.brand-sub {
  font-family: var(--body); font-weight: 500; font-size: 13px;
  color: var(--faint); letter-spacing: 0; margin-left: 2px;
}
.club-hero {
  padding: 68px 0 44px;
  background:
    radial-gradient(ellipse 70% 90% at 12% 0%, rgba(255,177,60,.13), transparent 62%),
    linear-gradient(180deg, #0A0E13, var(--bg));
  border-bottom: 1px solid var(--line-soft);
}
.btn-lg { font-size: 16.5px; padding: 14px 26px; }

/* ---- roster on the watch page ---- */
.roster {
  border: 1px solid var(--line-soft); border-radius: var(--r);
  background: var(--panel); padding: 0 18px;
}
.roster summary {
  list-style: none; cursor: pointer; padding: 15px 0;
  font-family: var(--display); font-weight: 600; font-size: 15.5px;
}
.roster summary::-webkit-details-marker { display: none; }
.roster summary::after { content: " ▾"; color: var(--faint); }
.roster[open] summary::after { content: " ▴"; }
.roster-grid {
  display: grid; gap: 2px 20px; padding-bottom: 16px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.roster-row {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 10px;
  padding: 6px 0; border-top: 1px solid var(--line-soft); font-size: 14.5px;
}
.roster-no { font-family: var(--mono); color: var(--accent); font-size: 13px; }

/* ---- public team page ---- */
.team-link { color: var(--accent); }
.team-link:hover { text-decoration: underline; }

.live-now {
  display: block; border-color: color-mix(in srgb, var(--club) 45%, var(--line));
  background: linear-gradient(120deg, color-mix(in srgb, var(--club) 12%, var(--panel)), var(--panel));
}
.live-now:hover { border-color: var(--club); }

.squad {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
}
.squad-card {
  display: grid; grid-template-columns: 34px 1fr; gap: 4px 12px;
  align-items: center;
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: 10px; padding: 12px 14px;
}
.squad-no {
  grid-row: span 2; align-self: start;
  font-family: var(--display); font-weight: 800; font-size: 19px;
  color: var(--accent); text-align: center;
  font-variant-numeric: tabular-nums;
}
.squad-name { font-weight: 600; font-size: 15px; }
.squad-pos { font-size: 12.5px; color: var(--faint); }

/* ---- player photos ---- */
.avatar {
  border-radius: 50%; object-fit: cover; flex: none; display: block;
  border: 1px solid var(--line);
}
.avatar-fallback {
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; letter-spacing: -.02em;
}

/* Squad cards become photo · name · number */
.squad-card {
  grid-template-columns: auto 1fr auto;
  gap: 12px;
}
.squad-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.squad-card .squad-no {
  grid-row: auto; align-self: center;
  font-size: 17px; opacity: .85;
}
.squad-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.roster-row { grid-template-columns: 28px 26px 1fr auto; align-items: center; }

/* ---- replays ---- */
.replays { display: flex; flex-direction: column; gap: 8px; }
.replay-row {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 12px;
  align-items: center; padding: 13px 16px;
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: 10px; font-size: 15px;
}
a.replay-row:hover { border-color: var(--accent); }
a.replay-row:hover .faint { color: var(--accent); }
.replay-ico {
  display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 50%; background: var(--accent-dim); color: var(--accent);
  font-size: 11px;
}
.player-wrap video[controls] { background: #000; }

/* ---- camera quality panel ---- */
.quality { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.quality.good { border-color: rgba(53,192,138,.4); }
.quality.warn { border-color: rgba(255,177,60,.45); }
.quality-figures {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  background: var(--panel-2);
}
.quality-figures > div {
  padding: 14px 16px; display: flex; flex-direction: column; gap: 2px;
  border-right: 1px solid var(--line-soft);
}
.quality-figures > div:last-child { border-right: 0; }
.qv { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.ql { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
      text-transform: uppercase; color: var(--faint); }
.quality-verdict { padding: 14px 16px; border-top: 1px solid var(--line-soft); }
.quality.good .quality-verdict strong { color: var(--good); }
.quality.warn .quality-verdict strong { color: var(--accent); }
.quality-verdict p { font-size: 14px; margin-top: 4px; }

/* ---- broadcast quality preset (club side) ---- */
.preset-choice { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .preset-choice { grid-template-columns: 1fr 1fr; } }
.preset {
  display: grid; gap: 3px; margin: 0; cursor: pointer; position: relative;
  padding: 14px 16px; border-radius: var(--r);
  background: var(--panel-2); border: 1px solid var(--line);
}
.preset:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.preset:has(input:checked) { border-color: var(--accent); background: var(--accent-dim); }
.preset input { position: absolute; opacity: 0; width: 0; height: 0; }
.preset:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.preset-label { font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--ink); }
