:root {
  --pitch: #0e1d15;
  --surface: #16291e;
  --surface-2: #1d3427;
  --line: #294a37;
  --ink: #e9f0ea;
  --muted: #90a897;
  --floodlight: #e8b53c;
  --live: #6fd08c;
  --danger: #e2705f;
  --radius: 10px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset;
}

* { box-sizing: border-box; }

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

a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------------------------------------------------------------- structure */
.app { padding-bottom: 76px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: rgba(14, 29, 21, .93);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 16px; margin: 0; font-weight: 600; letter-spacing: .2px; }
.topbar .sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.topbar .spacer { flex: 1; }

.back {
  background: none; border: 0; color: var(--muted);
  padding: 6px 8px 6px 0; cursor: pointer; font-size: 20px; line-height: 1;
}

main { padding: 16px; max-width: 900px; margin: 0 auto; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: #0b1710; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  background: none; border: 0; cursor: pointer;
  padding: 9px 2px 11px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px;
}
.tabbar button svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.tabbar button[aria-current="page"] { color: var(--floodlight); }

/* ------------------------------------------------------------------- pieces */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card > h2 {
  font-size: 13px; margin: 0 0 10px; font-weight: 600; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
}
.card > h2 .count { color: var(--floodlight); font-variant-numeric: tabular-nums; }
.card > h2 button { margin-left: auto; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 11px 12px; min-height: 70px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.stat .label { font-size: 10.5px; color: var(--muted); }
.stat .value { font-size: 19px; font-weight: 650; line-height: 1.15; }
.stat .value.small { font-size: 14px; font-weight: 550; }

.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
.team-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; cursor: pointer; text-align: left; width: 100%;
  border-left: 3px solid var(--stripe, var(--line));
  display: flex; flex-direction: column; gap: 7px; min-height: 104px;
}
.team-card:hover { background: var(--surface-2); }
.team-card .name { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.team-card .meta { color: var(--muted); font-size: 11.5px; display: flex; gap: 10px; margin-top: auto; }

.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 2px; border-top: 1px solid var(--line); cursor: pointer;
  background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; width: 100%;
}
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-size: 14px; }
.row .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.row .num {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  background: var(--surface-2); color: var(--muted);
  display: grid; place-items: center; font-size: 11.5px; font-variant-numeric: tabular-nums;
}

.stars { color: var(--floodlight); font-size: 13px; letter-spacing: 1px; white-space: nowrap; }
.stars .empty { color: #3d5546; }
.star-value { font-variant-numeric: tabular-nums; font-weight: 600; }

table.standings { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.standings th {
  text-align: right; color: var(--muted); font-weight: 500; font-size: 11px;
  padding: 4px 3px; border-bottom: 1px solid var(--line);
}
table.standings th:nth-child(2) { text-align: left; }
table.standings td { padding: 6px 3px; text-align: right; border-bottom: 1px solid rgba(41,74,55,.5); }
table.standings td:nth-child(2) { text-align: left; }
table.standings td.pts { font-weight: 650; color: var(--floodlight); }

/* -------------------------------------------------------------------- pitch */
.pitch {
  position: relative; width: 100%; aspect-ratio: 68 / 100;
  background:
    repeating-linear-gradient(180deg, #1a3325 0 8%, #172d21 8% 16%);
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.pitch .marking { position: absolute; border: 1px solid rgba(160, 200, 175, .22); }
.pitch .halfway { left: 0; right: 0; top: 50%; border-width: 1px 0 0; }
.pitch .circle {
  width: 30%; aspect-ratio: 1; border-radius: 50%;
  left: 35%; top: 50%; transform: translateY(-50%);
}
.pitch .box-top { left: 21%; right: 21%; top: 0; height: 15%; border-width: 0 1px 1px; }
.pitch .box-bottom { left: 21%; right: 21%; bottom: 0; height: 15%; border-width: 1px 1px 0; }
.shirt {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer; width: 54px;
}
.shirt .jersey {
  width: 26px; height: 24px; border-radius: 5px 5px 3px 3px;
  background: var(--stripe, #cfe3d6); color: #10261a;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .35);
}
.shirt .jersey.empty { background: #2b4a37; color: #7e9b8a; box-shadow: none; border: 1px dashed #47705a; }
.shirt .tag {
  font-size: 9.5px; color: #d9e6dd; text-align: center; line-height: 1.15;
  max-width: 54px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
}

/* ------------------------------------------------------------------- inputs */
label.field { display: block; margin-bottom: 11px; }
label.field > span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 9px 10px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--floodlight); }
textarea { min-height: 62px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 8px; }

button.btn {
  background: var(--floodlight); color: #16281a; border: 0;
  padding: 10px 15px; border-radius: 8px; font-weight: 600; cursor: pointer;
}
button.btn.ghost { background: none; color: var(--ink); border: 1px solid var(--line); }
button.btn.sm { padding: 5px 10px; font-size: 12.5px; font-weight: 550; }
button.btn.danger { background: none; color: var(--danger); border: 1px solid var(--danger); }
button.btn:disabled { opacity: .5; cursor: default; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 999px; font-size: 11.5px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--floodlight); color: #16281a; border-color: var(--floodlight); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ------------------------------------------------------------------ ratings */
.rate { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid rgba(41,74,55,.45); }
.rate:first-of-type { border-top: 0; }
.rate .lbl { flex: 1; font-size: 12.5px; min-width: 0; }
.rate .scale { display: flex; gap: 2px; }
.rate .scale button {
  width: 21px; height: 21px; border-radius: 50%; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
  font-size: 10px; padding: 0; font-variant-numeric: tabular-nums;
}
.rate .scale button[aria-pressed="true"] {
  background: var(--floodlight); color: #16281a; border-color: var(--floodlight); font-weight: 700;
}
.rate .val {
  width: 30px; text-align: right; font-variant-numeric: tabular-nums;
  font-weight: 650; color: var(--floodlight); font-size: 13px;
}
.rate.readonly .bar { flex: 1; height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; max-width: 120px; }
.rate.readonly .bar i { display: block; height: 100%; background: var(--floodlight); }

.section-title {
  font-size: 11.5px; color: var(--floodlight); margin: 14px 0 6px;
  padding-bottom: 4px; border-bottom: 1px solid var(--line); font-weight: 600;
}

.star-picker { display: flex; gap: 6px; align-items: center; }
.star-picker button {
  background: none; border: 0; cursor: pointer; font-size: 27px; line-height: 1;
  color: #3d5546; padding: 0;
}
.star-picker button.on { color: var(--floodlight); }

/* ------------------------------------------------------------------- modals */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(4, 12, 8, .72); z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--pitch); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 16px 16px 0 0; width: 100%; max-width: 900px;
  max-height: 92vh; overflow-y: auto; padding: 16px 16px 28px;
}
.sheet h3 { margin: 2px 0 14px; font-size: 15px; }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sheet-head h3 { margin: 0; flex: 1; }

.toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 9px 15px; border-radius: 999px; z-index: 60; font-size: 13px;
  max-width: 88vw; text-align: center;
}
.toast.error { border-color: var(--danger); color: #ffd9d2; }

.empty { color: var(--muted); font-size: 13px; padding: 10px 0; }
.muted { color: var(--muted); }
.offline-bar {
  background: var(--floodlight); color: #16281a; text-align: center;
  padding: 5px; font-size: 12px; font-weight: 600;
}

/* -------------------------------------------------------------------- login */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-box { width: 100%; max-width: 350px; }
.login-box .brand { font-size: 25px; font-weight: 700; letter-spacing: -.4px; }
.login-box .tagline { color: var(--muted); font-size: 13px; margin: 5px 0 26px; }
.otp-input {
  letter-spacing: 11px; font-size: 22px; text-align: center; font-variant-numeric: tabular-nums;
}
.error-msg { color: var(--danger); font-size: 13px; margin: 10px 0 0; }

/* ----------------------------------------------------------------- calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-head { font-size: 10px; color: var(--muted); text-align: center; padding: 3px 0; }
.cal-day {
  min-height: 54px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; padding: 4px; font-size: 10px;
}
.cal-day .d { color: var(--muted); font-size: 10px; }
.cal-day.other { opacity: .35; }
.cal-ev {
  background: var(--surface-2); border-left: 2px solid var(--floodlight);
  border-radius: 3px; padding: 2px 3px; margin-top: 2px; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis;
}

.coverage { width: 100%; border-collapse: collapse; font-size: 11px; }
.coverage th { color: var(--muted); font-weight: 500; padding: 4px; text-align: center; }
.coverage th.team { text-align: left; }
.coverage td { text-align: center; padding: 5px 4px; border-top: 1px solid var(--line); }
.coverage td.ok { color: var(--live); }
.coverage td.partial { color: var(--floodlight); }
.coverage td.none { color: #4c6555; }

@media (max-width: 420px) {
  .stat-row { gap: 6px; }
  .stat { padding: 9px 10px; min-height: 64px; }
  .stat .value { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ================================================================
   ATHLON CONTROL — canonical visual layer
   ================================================================ */
:root {
  --pitch: #0E1A0B;
  --surface: rgba(242, 244, 236, .075);
  --surface-2: rgba(242, 244, 236, .12);
  --line: rgba(242, 244, 236, .16);
  --ink: #F2F4EC;
  --muted: #AEB8A4;
  --floodlight: #FFB020;
  --live: #79C657;
  --danger: #F08A78;
  --turf: #366B13;
  --deep: #1B3A0A;
  --bone: #E4E7DA;
  --display: 'Fira Sans Condensed', sans-serif;
  --body: 'Commissioner', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
  --radius: 16px;
  --shadow: 0 20px 44px -30px rgba(0, 0, 0, .72), inset 0 1px 0 rgba(242, 244, 236, .11);
}
html, body { min-height: 100%; }
body {
  font-family: var(--body);
  font-size: 14px;
  background:
    radial-gradient(ellipse 48% 32% at 10% 0%, rgba(54, 107, 19, .28), transparent 72%),
    radial-gradient(ellipse 42% 30% at 94% 8%, rgba(255, 176, 32, .12), transparent 72%),
    linear-gradient(150deg, #0E1A0B 0%, #132A0C 48%, #0E1A0B 100%);
  background-attachment: fixed;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .18;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.10'/%3E%3C/svg%3E");
}
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 100; padding: 10px 14px; background: var(--floodlight); color: #1A1200; border-radius: 8px; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--floodlight); outline-offset: 3px; }
button, input, select, textarea { font-family: var(--body); }
button { transition: transform .16s ease, filter .16s ease, border-color .16s ease, background .16s ease; }
button:active { transform: translateY(1px) scale(.985); }

.topbar {
  min-height: 64px; padding: 10px max(16px, calc((100vw - 1180px) / 2));
  background: rgba(14, 26, 11, .82); border-bottom-color: rgba(242, 244, 236, .12);
  backdrop-filter: blur(18px) saturate(1.25); -webkit-backdrop-filter: blur(18px) saturate(1.25);
}
.top-mark { width: 38px; height: 38px; object-fit: cover; border-radius: 10px; box-shadow: 0 0 26px rgba(255, 176, 32, .13); }
.topbar h1 { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: .01em; text-transform: uppercase; }
.topbar .sub, .row .sub, .stat .label, .brand-meta { font-family: var(--mono); letter-spacing: .06em; }
.back { color: var(--bone); min-width: 44px; min-height: 44px; border-radius: 10px; }
main { max-width: 1180px; padding: 24px 18px 100px; }

.card, .stat, .team-card {
  background: var(--surface); border-color: rgba(242, 244, 236, .16);
  backdrop-filter: blur(16px) saturate(1.25); -webkit-backdrop-filter: blur(16px) saturate(1.25);
  box-shadow: var(--shadow);
}
.card { padding: 18px; margin-bottom: 16px; }
.card > h2 { font-family: var(--display); color: var(--bone); font-size: 15px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.stat { padding: 15px 16px; min-height: 86px; }
.stat .label { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; }
.stat .value { font-family: var(--mono); font-size: 26px; }
.team-card { border-left-width: 4px; padding: 16px; min-height: 124px; border-radius: 16px; }
.team-card:hover, .row:hover { background: rgba(242, 244, 236, .12); }
.team-card .name, .row .title { font-family: var(--display); font-size: 16px; font-weight: 700; }
.row { min-height: 48px; padding: 11px 4px; }
.row .num { font-family: var(--mono); border-radius: 8px; background: rgba(255, 176, 32, .12); color: var(--floodlight); }
.stars, .star-value, table, .coverage, .cal-day { font-family: var(--mono); }

button.btn {
  min-height: 42px; border-radius: 12px; padding: 10px 16px; background: var(--floodlight); color: #1A1200;
  font-family: var(--display); font-size: 14px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 7px 0 #9D6810, 0 14px 24px -15px rgba(255, 176, 32, .65);
}
button.btn:hover { filter: brightness(1.08); }
button.btn:active { box-shadow: 0 3px 0 #9D6810, 0 8px 18px -12px rgba(255, 176, 32, .55); transform: translateY(4px); }
button.btn.ghost { color: var(--bone); background: rgba(242, 244, 236, .06); border-color: rgba(242, 244, 236, .22); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
button.btn.danger { color: #FFD7CF; background: rgba(200, 68, 47, .12); box-shadow: none; }
.chip { min-height: 38px; border-radius: 10px; font-family: var(--display); font-weight: 700; }
.chip[aria-pressed="true"] { background: var(--floodlight); color: #1A1200; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  min-height: 44px; padding: 11px 12px; border-radius: 10px; background: rgba(242, 244, 236, .08); border-color: rgba(242, 244, 236, .2);
}
label.field > span, .section-title { font-family: var(--mono); letter-spacing: .08em; }
.section-title { color: var(--floodlight); }
.rate .scale button { min-width: 25px; width: 25px; height: 25px; border-radius: 7px; font-family: var(--mono); }

.tabbar {
  width: min(560px, calc(100% - 22px)); left: 50%; right: auto; bottom: max(10px, env(safe-area-inset-bottom));
  transform: translateX(-50%); padding: 6px; border: 1px solid rgba(242, 244, 236, .16); border-radius: 16px;
  background: rgba(14, 26, 11, .90); backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 20px 50px rgba(0,0,0,.38);
}
.tabbar button { min-height: 50px; border-radius: 11px; font-family: var(--display); font-weight: 700; letter-spacing: .02em; }
.tabbar button[aria-current="page"] { color: #1A1200; background: var(--floodlight); }

.login-wrap { padding: 24px; background: radial-gradient(circle at 50% 22%, rgba(54,107,19,.30), transparent 38%); }
.login-box {
  max-width: 410px; padding: 32px; border-radius: 22px; background: rgba(242, 244, 236, .075);
  border: 1px solid rgba(242, 244, 236, .18); backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: 0 28px 70px -30px rgba(0,0,0,.78), inset 0 1px 0 rgba(242,244,236,.12);
}
.login-mark { display: flex; align-items: center; gap: 14px; }
.login-mark img { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 0 32px rgba(255,176,32,.16); }
.login-box .brand { font-family: var(--display); font-size: 30px; font-weight: 800; text-transform: uppercase; line-height: 1; }
.brand-meta { margin-top: 5px; color: var(--floodlight); font-size: 9px; letter-spacing: .18em; }
.login-box .tagline { font-family: var(--mono); letter-spacing: .08em; margin: 14px 0 26px; }

.sheet-backdrop { z-index: 50; backdrop-filter: blur(8px); }
.sheet { background: linear-gradient(155deg, #12240D, #0E1A0B); border-color: rgba(242,244,236,.18); border-radius: 20px 20px 0 0; padding: 18px max(16px, calc((100% - 860px)/2)) 34px; }
.sheet-head { position: sticky; top: -18px; z-index: 2; padding: 12px 0; background: rgba(14,26,11,.94); backdrop-filter: blur(14px); }
.sheet h3 { font-family: var(--display); font-size: 21px; font-weight: 800; text-transform: uppercase; }
.toast { border-radius: 11px; background: #213914; font-family: var(--mono); }
.offline-bar { background: var(--floodlight); color: #1A1200; font-family: var(--mono); }
.pitch { max-width: 520px; margin: 0 auto; border-radius: 14px; background: repeating-linear-gradient(180deg, #244C14 0 8%, #1B3A0A 8% 16%); }

@media (max-width: 640px) {
  body { background-attachment: scroll; }
  main { padding: 14px 12px 98px; }
  .topbar { min-height: 56px; padding: 8px 10px; gap: 8px; }
  .top-mark { width: 34px; height: 34px; }
  .topbar h1 { font-size: 17px; }
  .topbar .sub { display: none; }
  .topbar .btn.sm { min-height: 38px; padding: 7px 10px; font-size: 11px; }
  .teams-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .team-card { min-height: 112px; padding: 12px; }
  .team-card .name { font-size: 14px; }
  .card { padding: 14px; border-radius: 14px; }
  .stat-row { gap: 7px; }
  .stat { padding: 11px 10px; min-height: 72px; border-radius: 13px; }
  .stat .value { font-size: 20px; }
  .grid2 { grid-template-columns: 1fr; }
  .rate { flex-wrap: wrap; }
  .rate .lbl { flex-basis: calc(100% - 40px); }
  .rate .scale { width: 100%; justify-content: space-between; gap: 2px; }
  .rate .scale button { min-width: 24px; width: 24px; height: 28px; }
  .sheet { max-height: 94dvh; }
  .login-box { padding: 26px 22px; }
}

@media (max-width: 350px) {
  .teams-grid { grid-template-columns: 1fr; }
  .tabbar button { font-size: 9px; }
  .tabbar button svg { width: 18px; height: 18px; }
  .rate .scale button { min-width: 22px; width: 22px; }
}

