:root {
  --bg: #0b1a2e;
  --bar: #08121f;
  --panel: #12253f;
  --raised: #1b3254;
  --line: #22395a;
  --line-strong: #2d4a72;
  --text: #eef3fa;
  --muted: #9fb2cc;
  --accent: #ffc93c;
  --live: #ff7a45;
  --win: #7ee08a;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 Inter, system-ui, sans-serif; }
a { color: var(--accent); }
button, input, select { font: inherit; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

.bar { background: var(--bar); border-bottom: 1px solid var(--line); }
.bar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 12px 16px; }
.brand { font: italic 800 28px 'Barlow Condensed', sans-serif; text-transform: uppercase; color: var(--text); text-decoration: none; }
.brand span, h1 span { color: var(--accent); }
nav { display: flex; gap: 4px; flex: 1 1 auto; flex-wrap: wrap; }
nav a { padding: 8px 12px; border-radius: 6px; color: #c3d1e4; text-decoration: none; font-weight: 600; }
nav a.on { background: var(--panel); color: var(--text); }
.me { margin: 0; font-size: 13px; color: var(--muted); }
.me strong { color: var(--text); font-size: 15px; }

input, select { height: 40px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); }
button { height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); font-weight: 600; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button.primary { border: 0; background: var(--accent); color: var(--bg); font: italic 800 22px 'Barlow Condensed', sans-serif; text-transform: uppercase; }

main { padding: 24px 16px 56px; }
h1 { margin: 0 0 16px; font: italic 800 48px/1 'Barlow Condensed', sans-serif; text-transform: uppercase; }
h2 { margin: 24px 0 10px; font: italic 700 26px 'Barlow Condensed', sans-serif; text-transform: uppercase; }
.head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; }
.notice { padding: 10px 14px; border-radius: 8px; background: #3a2412; border: 1px solid var(--live); }

.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 16px; }
.teams button { height: auto; min-height: 48px; text-align: left; background: var(--panel); border: 2px solid var(--line); }
.teams button[aria-pressed="true"] { border-color: var(--accent); background: var(--raised); }

.panel { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 18px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); margin: 12px 0; }
.panel > div:first-child { flex: 1 1 200px; }
.label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.big { font: italic 800 30px/1.1 'Barlow Condensed', sans-serif; text-transform: uppercase; }
.status { color: var(--accent); font-weight: 600; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); }
.row .grow { flex: 1 1 260px; min-width: 0; }
.row .sub { font-size: 13px; color: var(--muted); }
.score { font-variant-numeric: tabular-nums; font-weight: 700; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--raised); color: var(--muted); }
.tag.live { background: var(--live); color: var(--bg); }
.empty { color: var(--muted); padding: 12px 0; }

.create summary { cursor: pointer; font-weight: 600; flex: 1 1 100%; }
.create form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; flex: 1 1 100%; }
.create label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }

.draw { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.round { display: flex; flex-direction: column; gap: 10px; justify-content: space-around; }
.tie { border-radius: 8px; background: var(--panel); border: 1px solid var(--line); }
.tie.mine { border: 2px solid var(--accent); }
.tie .side { display: flex; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tie .side .grow { flex: 1; min-width: 0; }
.tie .side.won { font-weight: 700; color: var(--win); }
.tie .state { padding: 6px 10px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.tie .state button { height: 32px; padding: 0 12px; }

@media (max-width: 600px) {
  h1 { font-size: 36px; }
  .me { flex: 1 1 100%; }
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 8px 0 20px; }
.stat { padding: 14px 16px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.stat .value { font: italic 800 36px/1 'Barlow Condensed', sans-serif; color: var(--accent); }
.stat .label { margin-top: 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 8px 20px; }
.board.wide { grid-column: 1 / -1; }
.board h2 { margin-top: 12px; }
.row .won { font-weight: 700; color: var(--win); }
.rank { width: 28px; text-align: center; font: italic 800 22px 'Barlow Condensed', sans-serif; color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 24px; }
.site-footer p { margin: 0; }
.footer-notice { flex-basis: 100%; }
.legal { max-width: 800px; }
.legal h1 { margin-top: 24px; }
.legal p, .legal li { line-height: 1.7; }
.legal li + li { margin-top: 8px; }
.legal section { margin-top: 32px; }
