/* ============================================================
   ClubTap Pick'em — World Cup 2026
   Match Programme skin. Daily prediction game.
   Responsive: <900 = single column + bottom tabs (phone)
               >=900 = feed + standings sidebar (desktop)
   ============================================================ */
:root {
  --paper: #efe6d0;
  --panel: #f6efdd;
  --card: #fbf6e8;
  --ink: #23201a;
  --muted: #7d7259;
  --line: #ccc0a0;
  --line-soft: #ddd1b2;
  --orange: #c8521f;
  --green: #16563a;
  --green-deep: #0f3f2a;
  --gold: #d99f24;
  --cream: #f4ecd2;
  --disp: "Oswald", sans-serif;
  --body: "Barlow", sans-serif;
  --safe-top: 12px;
  --shadow: 0 8px 24px rgba(35,28,16,0.16);
  --shadow-lg: 0 18px 50px rgba(35,28,16,0.30);
  --mat: 0 0 0 4px var(--card), 0 0 0 5.5px var(--ink);
}

* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(circle at 18% 8%, rgba(22,86,58,0.06), transparent 42%),
    radial-gradient(circle at 88% 96%, rgba(200,82,31,0.05), transparent 45%);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
.disp { font-family: var(--disp); }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--gold); color: var(--ink); }

/* film grain */
.ct-grain {
  position: fixed; inset: 0; z-index: 200; pointer-events: none;
  opacity: 0.28; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------- app shell ---------------- */
.app {
  position: relative;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  display: flex; flex-direction: column; overflow: hidden;
}

/* top bar */
.topbar {
  flex: none; z-index: 60;
  display: flex; align-items: center; gap: 12px;
  padding: calc(var(--safe-top) + 10px) 16px 12px;
  background: var(--paper);
  border-bottom: 1.5px solid var(--ink);
  box-shadow: 0 1px 0 var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; flex: none; border-radius: 7px;
  background: var(--green); border: 1.5px solid var(--green-deep);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--mat);
  text-decoration: none;
  transition: transform .12s, filter .14s;
}
.brand-mark svg { display: block; }
.brand-mark img {
  width: 24px; height: 24px; display: block;
  object-fit: contain;
}
.brand-mark:hover { filter: brightness(1.05); }
.brand-mark:active { transform: scale(.96); }
.brand-name {
  font-family: var(--disp); font-weight: 700; font-size: 17px;
  letter-spacing: 0.04em; text-transform: uppercase; line-height: 1; color: var(--ink);
}
.brand-name small {
  display: block; font-size: 9.5px; letter-spacing: 0.22em;
  color: var(--orange); font-weight: 600; margin-top: 2px;
}
.topbar-spacer { flex: 1; }

/* desktop top nav (hidden on mobile) */
.topnav { display: none; gap: 4px; }
.topnav button {
  font-family: var(--disp); font-weight: 600; font-size: 12.5px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  background: none; border: 0; padding: 9px 14px; border-radius: 5px;
  position: relative; transition: color .15s;
}
.topnav button:hover { color: var(--ink); }
.topnav button.on { color: var(--green); }
.topnav button.on::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px;
  height: 2px; background: var(--orange);
}

/* avatar / sign-in */
.av-btn {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 4px 13px 4px 4px; border-radius: 999px;
  background: var(--green); border: 1.5px solid var(--green-deep); color: var(--cream);
  font-family: var(--disp); font-weight: 600; font-size: 12.5px; letter-spacing: 0.04em;
  box-shadow: var(--shadow);
}
.av-btn .av {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: var(--gold); border: 1.5px solid var(--green-deep); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--disp); font-weight: 700; font-size: 13px;
}
.av-btn .av-label { white-space: nowrap; }
.av-btn.signed-out { padding: 7px 16px; }
@media (max-width: 600px) { .av-btn .av-label { display: none; } .av-btn { padding: 3px; } .av-btn.signed-out { padding: 7px 14px; } }

/* scroll body */
.scroll {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.scroll::-webkit-scrollbar { width: 10px; }
.scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 3px solid var(--paper); }

/* the responsive layout wrapper */
.layout {
  max-width: 1120px; margin: 0 auto; padding: 18px 16px 28px;
  display: grid; grid-template-columns: 1fr; gap: 22px;
}
.col-side { display: none; }

/* ---------------- matchday header ---------------- */
.md-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 4px;
}
.md-nav {
  width: 38px; height: 38px; flex: none; border-radius: 6px;
  border: 1.5px solid var(--ink); background: var(--card);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--disp); font-size: 20px; color: var(--ink);
  box-shadow: var(--shadow); transition: transform .12s, background .15s;
}
.md-nav:active { transform: scale(.96); }
.md-nav:disabled { opacity: 0.32; cursor: default; }
.md-nav::after { content: ""; position: absolute; inset: -2px; }
.md-nav { position: relative; }
.md-title { flex: 1; text-align: center; min-width: 0; }
.md-title .ey {
  font-family: var(--disp); font-weight: 600; font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--orange);
}
.md-title h1 {
  font-family: var(--disp); font-weight: 700; font-size: clamp(20px, 5vw, 26px);
  line-height: 1.02; text-transform: uppercase; letter-spacing: 0.01em; color: var(--green);
  text-wrap: balance;
}
.md-title .dt {
  font-size: 12.5px; color: var(--muted); margin-top: 2px;
}

.data-state {
  margin-top: 18px;
  padding: 22px;
  border: 1.5px solid var(--ink);
  background: var(--card);
  box-shadow: var(--shadow);
}
.data-state-kicker {
  font-family: var(--disp); font-weight: 700; font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--orange);
}
.data-state h2 {
  margin-top: 5px;
  font-family: var(--disp); font-size: 24px; line-height: 1.05;
  text-transform: uppercase; color: var(--green);
  text-wrap: balance;
}
.data-state p {
  margin-top: 8px;
  max-width: 62ch;
  color: var(--muted); font-size: 14px; line-height: 1.45;
  text-wrap: pretty;
}
.data-state code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em; color: var(--ink);
}
.data-state-btn {
  margin-top: 16px;
  border: 1.5px solid var(--green-deep); border-radius: 5px;
  background: var(--green); color: var(--cream);
  font-family: var(--disp); font-weight: 700; font-size: 12px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}
.data-state-btn { transition: transform .12s; }
.data-state-btn:active { transform: scale(0.96); }

/* progress / lock strip */
.md-strip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0; padding: 11px 14px 12px;
  background: var(--card); border: 1.5px solid var(--ink); border-bottom: none;
  border-radius: 9px 9px 0 0;
  box-shadow: var(--shadow);
}
.md-strip .seg { display: flex; align-items: center; gap: 8px; }
.md-strip .pill {
  font-family: var(--disp); font-weight: 600; font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 5px 10px 4px; border-radius: 999px;
  border: 1.5px solid var(--ink); white-space: nowrap;
}
.md-strip .pill.live { background: var(--orange); color: #fff; border-color: var(--orange); }
.md-strip .pill.live i {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #fff;
  margin-right: 5px; vertical-align: 1px; animation: blink 1.2s steps(2,end) infinite;
}
@keyframes blink { 50% { opacity: 0.25; } }
.md-strip .pill.next { background: var(--panel); color: var(--ink); }
.md-strip .pill.next b { color: var(--orange); font-family: var(--disp); }
.md-strip .save-state { margin-left: auto; display: flex; align-items: center; gap: 7px;
  font-family: var(--disp); font-weight: 600; font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--green); }
.md-strip .save-state.flash { color: var(--green); }
.md-strip .save-state .tick {
  width: 17px; height: 17px; border-radius: 50%; background: var(--green); color: var(--cream);
  display: flex; align-items: center; justify-content: center; font-size: 11px;
}
.md-prog { flex-basis: 100%; height: 3px; background: var(--panel);
  overflow: hidden; margin: 8px -14px -12px; border-top: 1px solid var(--line); }
.md-prog i { display: block; height: 100%; background: var(--green);
  transition: width .4s cubic-bezier(.3,1,.3,1); }

/* ---------------- match card ---------------- */
.feed { display: flex; flex-direction: column; gap: 16px; }
.md-strip + .feed .match:first-child { border-radius: 0 0 9px 9px; }
.match {
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 9px;
  box-shadow: var(--shadow), var(--mat);
  overflow: hidden; transition: opacity .3s;
}
.match-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 14px; background: var(--panel); border-bottom: 1.5px solid var(--ink);
}
.match-top .grp {
  font-family: var(--disp); font-weight: 600; font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.match-top .grp b { color: var(--green); }
.match-lock {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--disp); font-weight: 600; font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); font-variant-numeric: tabular-nums;
}
.match-lock svg { display: block; }
.match-lock.soon { color: var(--orange); }
.match-lock.locked { color: var(--ink); }

.match-body { padding: 15px 14px 16px; }

/* teams row + center pick */
.tie {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 10px;
}
.team {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 10px 6px; border-radius: 7px; border: 1.5px solid transparent;
  background: transparent; transition: background .15s, border-color .15s;
  min-width: 0; cursor: pointer; position: relative;
}
.team:hover { background: var(--panel); }
.team .flag {
  width: 56px; height: 56px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 36px; line-height: 1;
  background: var(--panel); border: 1.5px solid var(--ink);
  box-shadow: 0 2px 0 var(--line);
  overflow: hidden;
}
.team .flag.flag-img {
  background-size: cover; background-position: center;
  box-shadow: 0 2px 0 var(--line), inset 0 0 0 1px rgba(0,0,0,0.1);
}
.team .nm {
  font-family: var(--disp); font-weight: 700; font-size: 14px; letter-spacing: 0.03em;
  text-transform: uppercase; text-align: center; line-height: 1.05; color: var(--ink);
  max-width: 12ch;
}
.team .rk { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.team.pick { background: var(--green); border-color: var(--green-deep); box-shadow: var(--mat); }
.team.pick .nm { color: var(--cream); }
.team.pick .rk { color: rgba(244,236,210,0.7); }
.team.pick .flag { box-shadow: 0 0 0 2px var(--gold); }
.team .pick-tag {
  position: absolute; top: 8px; right: 8px; opacity: 0;
  font-family: var(--disp); font-weight: 700; font-size: 9px; letter-spacing: 0.14em;
  color: var(--orange); background: transparent;
  padding: 3px 6px; border-radius: 2px;
  text-transform: uppercase;
  outline: 1.5px solid var(--orange); outline-offset: 2px;
  transform: rotate(-6deg);
  transition: opacity .18s ease, transform .18s cubic-bezier(.2,1.4,.4,1);
  mix-blend-mode: multiply;
}
.team.pick .pick-tag { opacity: 1; transform: rotate(-8deg) scale(1.02); }

/* center column: vs / draw */
.midcol { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-width: 64px; }
.midcol .vs {
  font-family: var(--disp); font-weight: 700; font-size: 13px; letter-spacing: 0.12em;
  color: var(--muted); text-transform: uppercase;
}
.draw-btn {
  font-family: var(--disp); font-weight: 700; font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 8px 10px; border-radius: 6px;
  border: 1.5px solid var(--ink); background: var(--card); color: var(--ink);
  box-shadow: 0 2px 0 var(--line); transition: transform .12s, background .15s;
  white-space: nowrap;
}
.draw-btn:active { transform: translateY(1px); box-shadow: none; }
.draw-btn.pick { background: var(--gold); border-color: var(--ink); box-shadow: var(--mat); }
.ko-note {
  font-size: 9.5px; color: var(--muted); text-align: center; max-width: 70px; line-height: 1.2;
}

/* score predictor */
.score {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  margin-top: 15px; padding-top: 15px; border-top: 1.5px dashed var(--line);
}
.score-head {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between;
  margin-top: -4px;
}
.score-head .lbl {
  font-family: var(--disp); font-weight: 600; font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted);
}
.score-head .bonus {
  font-family: var(--disp); font-weight: 600; font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--orange);
}
.stepper { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.stepper .sg {
  display: flex; align-items: center; gap: 10px;
}
.step {
  width: 38px; height: 38px; flex: none; border-radius: 7px;
  border: 1.5px solid var(--ink); background: var(--card); color: var(--ink);
  font-family: var(--disp); font-size: 22px; font-weight: 600; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 0 var(--line); transition: transform .1s, background .12s;
}
.step:active { transform: translateY(1px); box-shadow: none; background: var(--panel); }
.step:disabled { opacity: 0.3; box-shadow: none; }
.step.minus { font-size: 26px; }
.sval {
  font-family: var(--disp); font-weight: 700; font-size: 40px; line-height: 1;
  font-variant-numeric: tabular-nums; min-width: 40px; text-align: center; color: var(--green);
}
.sval.dim { color: var(--line); }
.score .x {
  font-family: var(--disp); font-weight: 700; font-size: 18px; color: var(--muted);
  align-self: center; padding-top: 18px;
}
/* stacked layout rows */
.stack-row { display: flex; align-items: center; gap: 10px; }
.stack-row .stepper { margin-left: auto; }
.stack-row .sval { font-size: 30px; min-width: 30px; }
.stack-row .step { width: 34px; height: 34px; font-size: 20px; }
.stack-row .step.minus { font-size: 22px; }
.score-clear {
  grid-column: 1 / -1; text-align: center; margin-top: 4px;
}
.score-clear button {
  font-family: var(--disp); font-weight: 600; font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); background: none; border: 0;
  border-bottom: 1px dashed var(--line); padding: 2px 0;
}
.score-clear button:hover { color: var(--orange); }

/* per-match save tick */
.match-foot {
  display: flex; align-items: center; gap: 8px; margin-top: 14px;
  padding-top: 12px; border-top: 1px solid var(--line-soft);
  font-size: 12px; color: var(--muted);
}
.match-foot .saved {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--disp); font-weight: 600; font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--green);
}
.match-foot .saved .tick {
  width: 16px; height: 16px; border-radius: 50%; background: var(--green); color: var(--cream);
  display: flex; align-items: center; justify-content: center; font-size: 10px;
}
.match-foot .empty { color: var(--muted); font-style: italic; }
.match-foot .pts-pos {
  margin-left: auto; font-family: var(--disp); font-weight: 600; font-size: 10.5px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}

/* knockout penalties checkbox */
.pens {
  display: flex; align-items: center; gap: 9px; margin-top: 13px;
  padding: 10px 12px; border-radius: 6px; background: var(--panel);
  border: 1px dashed var(--line);
}
.pens .box {
  width: 22px; height: 22px; flex: none; border-radius: 5px; border: 1.5px solid var(--ink);
  background: var(--card); display: flex; align-items: center; justify-content: center;
  color: transparent; font-size: 14px; transition: background .12s;
}
.pens.on .box { background: var(--green); color: var(--cream); border-color: var(--green-deep); }
.pens .txt { font-size: 12px; color: var(--muted); line-height: 1.25; }
.pens .txt b { color: var(--ink); font-family: var(--disp); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; font-size: 11px; }

/* locked / finished overlay tint */
.match.locked .match-body { opacity: 0.78; filter: grayscale(0.35) sepia(0.12); }
.match.finished .match-top { background: var(--green); border-color: var(--green-deep); }
.match.finished .match-top .grp, .match.finished .match-top .grp b { color: var(--cream); }
.match.finished .match-lock { color: rgba(244,236,210,0.85); }
.ft-tie {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  margin: 2px 0 4px;
}
.ft-team { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.ft-team .flag {
  width: 50px; height: 50px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 32px; line-height: 1;
  background: var(--panel); border: 1.5px solid var(--ink); box-shadow: 0 2px 0 var(--line);
  overflow: hidden;
}
.ft-team .flag.flag-img {
  background-size: cover; background-position: center;
  box-shadow: 0 2px 0 var(--line), inset 0 0 0 1px rgba(0,0,0,0.1);
}
.ft-team .nm {
  font-family: var(--disp); font-weight: 700; font-size: 14px; letter-spacing: 0.03em;
  text-transform: uppercase; text-align: center; line-height: 1.05; color: var(--muted);
}
.ft-team.win .nm { color: var(--green); }
.ft-num {
  font-family: var(--disp); font-weight: 700; font-size: 38px; line-height: 1; color: var(--ink);
  font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px;
}
.ft-num span { color: var(--muted); font-size: 26px; }
.pick-summary {
  display: flex; align-items: center; gap: 10px;
  margin-top: 13px; padding: 9px 12px;
  border: 1.5px solid var(--ink); border-radius: 6px;
  background: var(--panel);
  font-family: var(--disp); font-size: 13px; letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pick-summary .ps-label {
  color: var(--muted); font-weight: 700; font-size: 11px; letter-spacing: 0.1em;
}
.pick-summary .ps-text {
  color: var(--ink); font-weight: 700; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pick-summary .ps-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  padding: 3px 8px; border-radius: 4px; border: 1.5px solid var(--ink);
  flex: none;
}
.pick-summary .ps-badge.exact { background: var(--green); color: var(--cream); border-color: var(--green-deep); }
.pick-summary .ps-badge.hit { background: var(--gold); color: var(--ink); }
.pick-summary .ps-badge.miss { background: var(--card); color: var(--muted); }
.pick-summary.none .ps-text { color: var(--muted); font-style: italic; text-transform: none; letter-spacing: 0.02em; }
.pick-summary.miss .ps-text { color: var(--muted); }

.recap-link {
  display: block; width: 100%; margin-top: 13px; padding: 11px;
  font-family: var(--disp); font-weight: 700; font-size: 13px; letter-spacing: 0.06em;
  text-transform: uppercase; text-align: center;
  border: 1.5px solid var(--ink); border-radius: 6px; background: var(--gold); color: var(--ink);
  box-shadow: var(--shadow); transition: transform .12s, filter .15s;
}
.recap-link:active { transform: scale(.96); }
.recap-link.earned { background: var(--green); color: var(--cream); border-color: var(--green-deep); }

/* ---------------- bottom tab bar (mobile) ---------------- */
.tabbar {
  flex: none; z-index: 60; display: flex;
  background: var(--card); border-top: 1.5px solid var(--ink);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 20px rgba(35,28,16,0.10);
}
.tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: 0; padding: 8px 2px 6px; color: var(--muted);
  font-family: var(--disp); font-weight: 600; font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; position: relative;
  transition: color .15s;
}
.tabbar button + button { box-shadow: inset 1px 0 0 var(--line-soft); }
.tabbar button svg { display: block; transition: stroke .15s; }
.tabbar button .ico {
  width: 36px; height: 28px; display: flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.tabbar button.on { color: var(--ink); }
.tabbar button.on::after {
  content: ""; position: absolute; left: 30%; right: 30%; bottom: 2px;
  height: 2px; background: var(--orange);
}
.tabbar button.on .ico svg path,
.tabbar button.on .ico svg circle,
.tabbar button.on .ico svg rect { stroke: var(--green); }
.tab-badge {
  position: absolute; top: 2px; right: 50%; margin-right: -22px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--orange); color: #fff; font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--card);
}

/* ---------------- generic section header ---------------- */
.sec-head { margin-bottom: 14px; }
.sec-head .ey {
  font-family: var(--disp); font-weight: 600; font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--orange);
}
.sec-head h2 {
  font-family: var(--disp); font-weight: 700; font-size: clamp(22px, 5vw, 28px);
  line-height: 1.02; text-transform: uppercase; letter-spacing: 0.01em; color: var(--green);
  margin-top: 2px; text-wrap: balance;
}
.sec-head p { font-size: 13px; color: var(--muted); margin-top: 5px; max-width: 52ch; text-wrap: pretty; }

/* segmented control (leaderboard scope) */
.seg-ctl {
  display: inline-flex; padding: 4px; gap: 4px; border-radius: 8px;
  background: var(--panel); border: 1.5px solid var(--ink); margin-bottom: 16px;
  box-shadow: var(--shadow); flex-wrap: wrap;
}
.seg-ctl button {
  font-family: var(--disp); font-weight: 600; font-size: 11.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); background: none; border: 0;
  padding: 8px 14px; border-radius: 5px; transition: background .14s, color .14s;
}
.seg-ctl button.on { background: var(--green); color: var(--cream); }

/* leaderboard table */
.lb {
  border: 1.5px solid var(--ink); border-radius: 9px; overflow: hidden;
  background: var(--card); box-shadow: var(--shadow), var(--mat);
}
.lb-head {
  display: grid; grid-template-columns: 40px 1fr 64px 54px; gap: 10px; align-items: center;
  padding: 10px 15px; background: var(--green); color: var(--cream); border-bottom: 1.5px solid var(--ink);
  font-family: var(--disp); font-weight: 600; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
}
.lb-head .r-pts, .lb-head .r-exact { text-align: right; }
.lb-head .r-exact { color: rgba(244,236,210,0.7); }
.lb-row {
  display: grid; grid-template-columns: 40px 1fr 64px 54px; gap: 10px; align-items: center;
  padding: 11px 15px; border-top: 1px solid var(--line-soft); font-size: 15px;
}
.lb-row:first-child { border-top: 0; }
.lb-row .pos {
  font-family: var(--disp); font-weight: 700; font-size: 15px; color: var(--muted);
  font-variant-numeric: tabular-nums; text-align: center;
}
.lb-row .pos.medal { color: var(--ink); }
.lb-row .who { display: flex; align-items: center; gap: 9px; min-width: 0; font-weight: 600; }
.lb-row .who .uflag { font-size: 18px; line-height: 1; flex: none; }
.lb-row .who .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row .delta {
  font-family: var(--disp); font-weight: 600; font-size: 10px; flex: none;
  display: inline-flex; align-items: center; gap: 2px;
}
.lb-row .delta.up { color: var(--green); }
.lb-row .delta.down { color: var(--orange); }
.lb-row .r-pts {
  font-family: var(--disp); font-weight: 700; font-size: 17px; color: var(--green);
  font-variant-numeric: tabular-nums; text-align: right;
}
.lb-row .r-exact {
  font-family: var(--disp); font-weight: 600; font-size: 13px; color: var(--muted);
  font-variant-numeric: tabular-nums; text-align: right;
}
.lb-row.you {
  background: linear-gradient(to right, rgba(217,159,36,0.10), transparent 60%);
  box-shadow: inset 4px 0 0 var(--gold);
  border-bottom: 1.5px solid var(--gold);
}
.lb-row.you + .lb-row { border-top-color: var(--gold); }
.lb-row.you .pos, .lb-row.you .r-pts, .lb-row.you .r-exact { color: var(--ink); }
.lb-row.you .you-pill {
  font-family: var(--disp); font-weight: 700; font-size: 8.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--gold); background: var(--ink);
  padding: 2px 6px; border-radius: 3px; flex: none;
}
.lb-gap { padding: 6px 15px; text-align: center; border-top: 1px dashed var(--line);
  font-family: var(--disp); font-weight: 700; letter-spacing: 0.3em; color: var(--muted); opacity: 0.6; }

/* podium */
.podium {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end;
  margin-bottom: 18px;
}
.pod {
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 9px;
  box-shadow: var(--shadow); padding: 14px 8px 12px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.pod .medal { font-family: var(--disp); font-weight: 700; font-size: 13px; }
.pod .pflag { font-size: 30px; line-height: 1; }
.pod .pnm { font-family: var(--disp); font-weight: 700; font-size: 12.5px; text-transform: uppercase;
  letter-spacing: 0.02em; line-height: 1.05; }
.pod .ppts { font-family: var(--disp); font-weight: 700; font-size: 22px; color: var(--green);
  font-variant-numeric: tabular-nums; }
.pod.p1 { background: var(--green); border-color: var(--green-deep); padding-top: 22px; }
.pod.p1 .pnm, .pod.p1 .medal { color: var(--cream); }
.pod.p1 .ppts { color: var(--gold); }
.pod.p2 { padding-top: 16px; }

/* ---------------- groups ---------------- */
.grp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.grp-act {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left;
  padding: 16px 16px; border-radius: 9px; border: 1.5px solid var(--ink);
  box-shadow: var(--shadow); transition: transform .12s, filter .15s;
}
.grp-act:active { transform: scale(.96); }
.grp-act.create { background: var(--green); color: var(--cream); border-color: var(--green-deep); }
.grp-act.join { background: var(--card); color: var(--ink); }
.grp-act .ga-ico {
  width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid currentColor;
}
.grp-act .ga-t { font-family: var(--disp); font-weight: 700; font-size: 15px; letter-spacing: 0.03em;
  text-transform: uppercase; }
.grp-act .ga-s { font-size: 11.5px; opacity: 0.78; line-height: 1.25; }
.grp-act.create .ga-s { color: rgba(244,236,210,0.8); }

.grp-card {
  display: flex; align-items: center; gap: 14px; padding: 15px;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 9px;
  box-shadow: var(--shadow); margin-bottom: 13px; transition: transform .12s;
  width: 100%; text-align: left;
}
.grp-card:active { transform: scale(.96); }
.grp-card .gc-badge {
  width: 50px; height: 50px; flex: none; border-radius: 6px; border: 1.5px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--disp); font-weight: 700; font-size: 22px; color: var(--cream);
  box-shadow: 0 2px 0 var(--line);
}
.grp-card .gc-meta { flex: 1; min-width: 0; }
.grp-card .gc-meta h3 {
  font-family: var(--disp); font-weight: 700; font-size: 16px; letter-spacing: 0.02em;
  text-transform: uppercase; line-height: 1.05; color: var(--ink);
}
.grp-card .gc-meta .gc-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.grp-card .gc-rank { text-align: right; flex: none; }
.grp-card .gc-rank .rp {
  font-family: var(--disp); font-weight: 700; font-size: 22px; line-height: 1; color: var(--green);
}
.grp-card .gc-rank .rl { font-family: var(--disp); font-weight: 600; font-size: 9px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); }

/* group detail */
.gd-hero {
  display: flex; align-items: center; gap: 15px; padding: 18px;
  background: var(--green); color: var(--cream); border: 1.5px solid var(--green-deep);
  border-radius: 10px; box-shadow: var(--shadow), var(--mat); margin-bottom: 16px;
}
.gd-hero .gh-badge {
  width: 60px; height: 60px; flex: none; border-radius: 7px; border: 1.5px solid var(--cream);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--disp); font-weight: 700; font-size: 28px; background: rgba(255,255,255,0.12);
}
.gd-hero .gh-meta { flex: 1; min-width: 0; }
.gd-hero .gh-meta .eyy { font-family: var(--disp); font-weight: 600; font-size: 10px;
  letter-spacing: 0.2em; text-transform: uppercase; color: rgba(244,236,210,0.7); }
.gd-hero .gh-meta h2 { font-family: var(--disp); font-weight: 700; font-size: 24px;
  text-transform: uppercase; letter-spacing: 0.01em; line-height: 1.02; margin-top: 2px; text-wrap: balance; }
.gd-hero .gh-meta .gh-sub { font-size: 12.5px; color: rgba(244,236,210,0.82); margin-top: 4px; }

.invite {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px; margin-bottom: 18px;
  background: var(--card); border: 1.5px dashed var(--ink); border-radius: 9px;
}
.invite .inv-meta { flex: 1; min-width: 0; }
.invite .inv-meta .il { font-family: var(--disp); font-weight: 600; font-size: 9.5px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.invite .code {
  font-family: var(--disp); font-weight: 700; font-size: 24px; letter-spacing: 0.16em;
  color: var(--ink); margin-top: 1px;
}
.invite .copy {
  flex: none; padding: 10px 16px; border-radius: 6px; border: 1.5px solid var(--green-deep);
  background: var(--green); color: var(--cream);
  font-family: var(--disp); font-weight: 700; font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase; box-shadow: var(--shadow); transition: transform .12s;
}
.invite .copy:active { transform: scale(.96); }
.invite .copy.done { background: var(--gold); color: var(--ink); }

/* back link */
.backlink {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 14px;
  font-family: var(--disp); font-weight: 600; font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); background: none; border: 0; padding: 4px 0;
}
.backlink:hover { color: var(--orange); }

/* ---------------- forms (create / join) ---------------- */
.form-card {
  max-width: 460px; margin: 0 auto;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 11px;
  box-shadow: var(--shadow-lg), var(--mat); overflow: hidden;
}
.form-card .fc-head {
  padding: 18px 20px; background: var(--green); color: var(--cream);
  border-bottom: 1.5px solid var(--ink); position: relative;
}
.form-card .fc-head::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--gold);
}
.form-card .fc-head .eyy { font-family: var(--disp); font-weight: 600; font-size: 10px;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.form-card .fc-head h2 { font-family: var(--disp); font-weight: 700; font-size: 23px;
  text-transform: uppercase; letter-spacing: 0.01em; margin-top: 3px; text-wrap: balance; }
.form-card .fc-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.field label {
  display: block; font-family: var(--disp); font-weight: 600; font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px;
}
.field input {
  width: 100%; font-family: var(--body); font-size: 16px; color: var(--ink);
  padding: 13px 14px; border-radius: 7px; border: 1.5px solid var(--ink);
  background: var(--panel); box-shadow: inset 0 2px 4px rgba(35,28,16,0.08);
  transition: box-shadow .15s;
}
.field input::placeholder { color: var(--line); }
.field input:focus { outline: none; box-shadow: inset 0 2px 4px rgba(35,28,16,0.08), 0 0 0 2px var(--gold); }
.field input.code-input {
  font-family: var(--disp); font-weight: 700; font-size: 26px; letter-spacing: 0.3em;
  text-transform: uppercase; text-align: center;
}
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.btn-primary {
  width: 100%; min-height: 54px; border-radius: 7px; border: 1.5px solid var(--green-deep);
  background: var(--green); color: var(--cream);
  font-family: var(--disp); font-weight: 700; font-size: 17px; letter-spacing: 0.06em;
  text-transform: uppercase; box-shadow: var(--shadow-lg), var(--mat);
  transition: transform .12s, filter .15s;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { transform: scale(.96); }
.btn-primary:disabled { opacity: 0.45; filter: none; cursor: default; box-shadow: var(--shadow); }
.btn-ghost {
  width: 100%; min-height: 50px; border-radius: 7px; border: 1.5px solid var(--ink);
  background: var(--card); color: var(--ink);
  font-family: var(--disp); font-weight: 700; font-size: 15px; letter-spacing: 0.06em;
  text-transform: uppercase; box-shadow: var(--shadow); transition: transform .12s;
}
.btn-ghost:active { transform: scale(.96); }

/* success state after create/join */
.success-badge {
  text-align: center; padding: 8px 0 4px;
}
.success-badge .sb-ring {
  width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%;
  background: var(--gold); border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: var(--ink);
}

/* ---------------- inline recap (finished match card) ---------------- */
.recap-inline {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px;
  margin-top: 10px;
}
.ri-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 1.5px solid var(--ink); border-radius: 6px; background: var(--panel);
  min-width: 0;
}
.ri-row .ri-mark {
  flex: none; width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; border: 1.5px solid var(--ink);
  background: var(--card); color: var(--muted);
}
.ri-row.hit .ri-mark { background: var(--green); color: var(--cream); border-color: var(--green-deep); }
.ri-row .ri-k {
  flex: 1; min-width: 0;
  font-family: var(--disp); font-weight: 700; font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ri-row.hit .ri-k { color: var(--ink); }
.ri-row .ri-pts {
  flex: none; font-family: var(--disp); font-weight: 700; font-size: 14px;
  font-variant-numeric: tabular-nums; color: var(--line);
}
.ri-row.hit .ri-pts { color: var(--green); }

.ri-total {
  display: flex; align-items: baseline; justify-content: center; gap: 6px;
  padding: 8px 14px; border: 1.5px solid var(--ink); border-radius: 6px;
  background: var(--card);
  font-family: var(--disp); text-transform: uppercase;
}
.ri-total .ri-tl { font-weight: 600; font-size: 10px; letter-spacing: 0.14em; color: var(--muted); }
.ri-total .ri-tv {
  font-weight: 700; font-size: 20px; color: var(--ink); font-variant-numeric: tabular-nums;
}
.ri-total .ri-tv small { font-size: 11px; color: var(--muted); margin-left: 1px; }
.ri-total.earned { background: var(--green); border-color: var(--green-deep); }
.ri-total.earned .ri-tl { color: rgba(244,236,210,0.8); }
.ri-total.earned .ri-tv { color: var(--gold); }
.ri-total.earned .ri-tv small { color: rgba(244,236,210,0.75); }

@media (max-width: 520px) {
  .recap-inline { grid-template-columns: 1fr 1fr; }
  .ri-total { grid-column: 1 / -1; justify-content: space-between; }
}

/* toast — paper strip */
.toast {
  position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%) translateY(20px);
  z-index: 180; padding: 11px 16px 11px 18px; border-radius: 6px;
  background: var(--card); color: var(--ink); border: 1.5px solid var(--ink);
  font-family: var(--disp); font-weight: 600; font-size: 12.5px; letter-spacing: 0.06em;
  box-shadow: var(--shadow-lg), inset 5px 0 0 var(--gold);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  padding-left: 22px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .tk { color: var(--green); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .es-ico { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 14px; max-width: 32ch; margin: 0 auto; line-height: 1.4; text-wrap: pretty; }

/* ============================================================
   DESKTOP ( >= 900 )
   ============================================================ */
@media (min-width: 900px) {
  :root { --safe-top: 4px; }
  .topnav { display: flex; }
  .tabbar { display: none; }
  .layout { grid-template-columns: 1fr 320px; align-items: start; }
  .col-side { display: block; position: sticky; top: 0; display: flex; flex-direction: column; gap: 16px; }
  /* center single-column screens (groups forms, leaderboard) keep full width */
  .layout.single { grid-template-columns: 1fr; max-width: 760px; }
  .team .flag { width: 60px; height: 60px; font-size: 40px; }
  .sval { font-size: 46px; }
  .match-body { padding: 18px 18px 18px; }
}

/* sidebar widgets (desktop only) */
.side-card {
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 9px;
  box-shadow: var(--shadow); overflow: hidden;
}
.side-card .sc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; background: var(--panel); border-bottom: 1.5px solid var(--ink);
}
.side-card .sc-head .t { font-family: var(--disp); font-weight: 700; font-size: 12px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--green); }
.side-card .sc-head button { font-family: var(--disp); font-weight: 600; font-size: 10.5px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: none; border: 0; }
.side-card .sc-head button:hover { color: var(--orange); }
.side-mini-row {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 9px; align-items: center;
  padding: 9px 14px; border-top: 1px solid var(--line-soft); font-size: 13.5px;
}
.side-mini-row:first-of-type { border-top: 0; }
.side-mini-row .pos { font-family: var(--disp); font-weight: 700; font-size: 12px; color: var(--muted); text-align: center; }
.side-mini-row .who { display: flex; align-items: center; gap: 7px; min-width: 0; font-weight: 600; }
.side-mini-row .who .uflag { font-size: 14px; flex: none; }
.side-mini-row .who .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-mini-row .pts { font-family: var(--disp); font-weight: 700; font-size: 14px; color: var(--green); }
.side-mini-row.you { background: var(--gold); }
.side-mini-row.you .pos, .side-mini-row.you .pts { color: var(--ink); }
.side-rule { padding: 14px; }
.side-rule h4 { font-family: var(--disp); font-weight: 700; font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--green); margin-bottom: 10px; }
.side-rule ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.side-rule li { font-size: 12px; color: var(--muted); line-height: 1.35; display: grid;
  grid-template-columns: 44px 1fr; gap: 10px; align-items: baseline; }
.side-rule li b { font-family: var(--disp); font-weight: 700; color: var(--green);
  text-align: right; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.side-rule li .pp { font-family: var(--disp); font-weight: 700; color: var(--orange);
  margin-left: 2px; font-size: 10.5px; letter-spacing: 0.04em; text-transform: lowercase; }
.side-empty { padding: 16px 14px; font-size: 12px; color: var(--muted); font-style: italic;
  text-align: center; line-height: 1.4; }

/* ===== sign-in modal ===== */
.pe-auth-modal {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(35, 28, 16, 0.55);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.pe-auth-modal.open { display: flex; }
.pe-auth-card {
  background: var(--bg, #f4ecd2);
  border-radius: 14px;
  padding: 22px 22px 18px;
  width: 100%; max-width: 360px;
  box-shadow: 0 10px 30px rgba(35, 28, 16, 0.22);
  position: relative;
}
.pe-auth-close {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(35, 28, 16, 0.06); color: var(--ink); border: 0;
  font-size: 14px; cursor: pointer;
}
.pe-auth-close::after { content: ""; position: absolute; inset: -6px; }
.pe-auth-kicker {
  font-family: var(--disp); font-weight: 700; font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--green); margin-bottom: 4px;
}
.pe-auth-title {
  font-family: var(--disp); font-weight: 700; font-size: 22px;
  color: var(--ink); margin: 0 0 6px; text-wrap: balance;
}
.pe-auth-copy { font-size: 13px; color: var(--muted); line-height: 1.4; margin: 0 0 14px; text-wrap: pretty; }
.pe-auth-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px; border-radius: 10px;
  background: #fff; color: #1a1a1a; border: 1px solid rgba(0,0,0,0.12);
  font-weight: 600; font-size: 14px; cursor: pointer;
}
.pe-auth-google:hover { background: #f7f7f7; }
.pe-auth-sep {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; color: var(--muted); margin: 14px 0;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.pe-auth-sep::before, .pe-auth-sep::after {
  content: ""; flex: 1; height: 1px; background: rgba(35,28,16,0.12);
}
.pe-auth-email { display: flex; gap: 8px; }
.pe-auth-email input {
  flex: 1; padding: 10px 12px; border-radius: 9px; border: 1px solid rgba(35,28,16,0.18);
  background: #fff; font-size: 14px; color: var(--ink);
}
.pe-auth-email button {
  padding: 10px 14px; border-radius: 9px; border: 0;
  background: var(--green); color: #fff; font-weight: 600; cursor: pointer;
}
.pe-auth-status {
  margin: 10px 0 0; font-size: 12px; color: var(--muted); min-height: 16px;
}
.pe-account-card .pe-auth-copy { word-break: break-all; }
.pe-profile-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}
.pe-profile-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.pe-profile-field span {
  font-family: var(--disp);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.pe-profile-field input,
.pe-profile-field select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 9px;
  border: 1px solid rgba(35,28,16,0.18);
  background: #fff;
  color: var(--ink);
  font-size: 14px;
}
.pe-profile-field--country {
  max-width: 120px;
}
.pe-profile-save {
  min-height: 44px;
  align-self: end;
  padding: 10px 14px;
  border-radius: 9px;
  border: 0;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.pe-profile-save:disabled {
  opacity: 0.55;
  cursor: default;
}
.pe-account-signout {
  display: block; width: 100%; padding: 12px; border-radius: 10px;
  background: var(--green); color: var(--cream);
  border: 1.5px solid var(--green-deep);
  font-family: var(--disp); font-weight: 700; font-size: 13px;
  letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer; box-shadow: var(--shadow);
}
.pe-account-signout { transition: transform .12s; }
.pe-account-signout:active { transform: scale(0.96); }

/* ============================================================
   Programme polish — design audit pass
   ============================================================ */

/* focus visibility — gold ring across all interactive surfaces */
:where(button, [role="button"], a, .team):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: inherit;
}
.field input:focus-visible { outline: none; }

/* registration crosshair marks on match cards — printers' alignment glyph */
.match { position: relative; }
.match::before,
.match::after {
  content: ""; position: absolute; width: 8px; height: 8px;
  background:
    linear-gradient(var(--line-soft), var(--line-soft)) center/100% 1px no-repeat,
    linear-gradient(var(--line-soft), var(--line-soft)) center/1px 100% no-repeat;
  pointer-events: none; opacity: 0.55;
}
.match::before { top: 6px; left: 6px; }
.match::after  { bottom: 6px; right: 6px; }
.match.finished::before,
.match.finished::after { background:
  linear-gradient(var(--cream), var(--cream)) center/100% 1px no-repeat,
  linear-gradient(var(--cream), var(--cream)) center/1px 100% no-repeat;
  opacity: 0.35; }

/* staggered enter for match feed (first paint only) */
@keyframes pe-rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.feed .match {
  animation: pe-rise .42s cubic-bezier(.2,.9,.3,1) both;
}
.feed .match:nth-child(1) { animation-delay: 40ms; }
.feed .match:nth-child(2) { animation-delay: 100ms; }
.feed .match:nth-child(3) { animation-delay: 160ms; }
.feed .match:nth-child(4) { animation-delay: 220ms; }
.feed .match:nth-child(5) { animation-delay: 280ms; }
.feed .match:nth-child(6) { animation-delay: 340ms; }
.feed .match:nth-child(7) { animation-delay: 400ms; }
.feed .match:nth-child(n+8) { animation-delay: 460ms; }

/* staggered enter for leaderboard rows */
.lb-row { animation: pe-rise .35s cubic-bezier(.2,.9,.3,1) both; }
.lb-row:nth-child(1) { animation-delay: 20ms; }
.lb-row:nth-child(2) { animation-delay: 60ms; }
.lb-row:nth-child(3) { animation-delay: 100ms; }
.lb-row:nth-child(4) { animation-delay: 140ms; }
.lb-row:nth-child(5) { animation-delay: 180ms; }
.lb-row:nth-child(6) { animation-delay: 220ms; }
.lb-row:nth-child(n+7) { animation-delay: 260ms; }

@media (prefers-reduced-motion: reduce) {
  .feed .match, .lb-row { animation: none; }
  .team .pick-tag { transition: opacity .12s; }
}

/* unify the av-btn with the rest of the lifted-paper system */
.av-btn { box-shadow: var(--shadow), 0 2px 0 var(--green-deep); }

/* demote save-state — it competes with LIVE in the strip */
.md-strip .save-state { opacity: 0.78; font-size: 10.5px; }
.md-strip .save-state .tick { width: 14px; height: 14px; font-size: 9px; }

/* hover lift on match-tier interactive cards (desktop only) */
@media (hover: hover) and (min-width: 900px) {
  .grp-card { transition: transform .18s ease, box-shadow .18s ease; }
  .grp-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
  .pod { transition: transform .18s ease; }
  .pod:hover { transform: translateY(-2px); }
}

/* ============================================================
   World Cup wallchart design-system reskin
   Flat screen-print board: paper, ink, dense rules, stamped data.
   ============================================================ */
:root {
  --paper: oklch(0.950 0.024 82);
  --paper-2: oklch(0.910 0.030 80);
  --paper-3: oklch(0.866 0.034 77);
  --ink: oklch(0.235 0.020 256);
  --ink-soft: oklch(0.40 0.02 256);
  --red: oklch(0.545 0.170 28);
  --blue: oklch(0.470 0.130 256);
  --green: oklch(0.500 0.110 152);
  --gold: oklch(0.745 0.140 80);
  --red-ink: oklch(0.45 0.16 28);
  --gold-ink: oklch(0.52 0.12 78);
  --rule: 2.5px;
  --hair: 1.5px;
  --frame: var(--ink);
  --font-display: "Anton", "Archivo", sans-serif;
  --font-body: "Archivo", system-ui, sans-serif;
  --font-mono: "Space Mono", monospace;

  /* Legacy aliases used by the existing templates. */
  --panel: var(--paper-2);
  --card: var(--paper);
  --muted: var(--ink-soft);
  --line: color-mix(in oklch, var(--ink) 34%, var(--paper-3));
  --line-soft: color-mix(in oklch, var(--ink) 20%, var(--paper-3));
  --orange: var(--red);
  --green-deep: color-mix(in oklch, var(--green) 76%, var(--ink));
  --cream: var(--paper);
  --disp: var(--font-display);
  --body: var(--font-body);
  --shadow: 3px 3px 0 color-mix(in oklch, var(--ink) 22%, transparent);
  --shadow-lg: 5px 5px 0 color-mix(in oklch, var(--ink) 28%, transparent);
  --mat: none;
}

html,
body {
  background: var(--paper-2);
  color: var(--ink);
}

body {
  font-family: var(--font-body);
  background-image: none;
  text-rendering: optimizeLegibility;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 0;
  background-image: radial-gradient(var(--ink) 0.5px, transparent 0.7px);
  background-size: 6px 6px;
  opacity: 0.085;
}

body::after {
  z-index: 1;
  background:
    linear-gradient(90deg, transparent calc(33.33% - 3px), rgba(0,0,0,.04) calc(33.33% - 1px), rgba(255,255,255,.14) 33.33%, rgba(0,0,0,.035) calc(33.33% + 1px), transparent calc(33.33% + 3px)),
    linear-gradient(90deg, transparent calc(66.66% - 3px), rgba(0,0,0,.04) calc(66.66% - 1px), rgba(255,255,255,.14) 66.66%, rgba(0,0,0,.035) calc(66.66% + 1px), transparent calc(66.66% + 3px)),
    linear-gradient(180deg, transparent calc(50% - 3px), rgba(0,0,0,.035) calc(50% - 1px), rgba(255,255,255,.12) 50%, rgba(0,0,0,.035) calc(50% + 1px), transparent calc(50% + 3px)),
    radial-gradient(125% 95% at 50% 40%, transparent 66%, rgba(60,40,10,.08) 100%);
  mix-blend-mode: multiply;
}

.ct-grain {
  z-index: 3;
  opacity: 0.12;
  mix-blend-mode: multiply;
  background-image: radial-gradient(var(--ink) 0.45px, transparent 0.65px);
  background-size: 5px 5px;
}

.app {
  position: relative;
  z-index: 2;
}

.modal,
.toast,
.pe-auth-modal {
  z-index: 220;
}

.disp,
.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 0.92;
  text-transform: uppercase;
}

.mono,
.ey,
.eyy,
.data-state-kicker,
.match-lock,
.score-head .lbl,
.score-head .bonus,
.md-strip .pill,
.save-state,
.field label,
.hint,
.lb-head,
.gc-sub,
.il,
.pe-auth-kicker {
  font-family: var(--font-mono);
}

button {
  color: inherit;
}

:where(button, [role="button"], a, .team):focus-visible,
.field input:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 0;
}

.topbar {
  min-height: 78px;
  padding: calc(var(--safe-top) + 12px) 22px 13px;
  background: var(--ink);
  color: var(--paper);
  border-bottom: var(--rule) double var(--paper);
  box-shadow: inset 0 -8px 0 color-mix(in oklch, var(--paper) 9%, transparent);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 0;
  background: var(--paper);
  border: var(--hair) solid var(--paper);
  box-shadow: inset 0 0 0 2px var(--ink), 4px 4px 0 color-mix(in oklch, var(--paper) 18%, transparent);
}

.brand-mark svg circle { stroke: var(--ink); }
.brand-mark svg path { fill: var(--gold); stroke: var(--ink); stroke-width: 0.45px; }
.brand-mark img {
  width: 30px;
  height: 30px;
}

.brand-name {
  color: var(--paper);
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 31px);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 0.9;
}

.brand-name small {
  margin-top: 5px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.topnav {
  align-self: stretch;
  align-items: flex-end;
  gap: 0;
  border-left: var(--hair) solid color-mix(in oklch, var(--paper) 42%, transparent);
  border-right: var(--hair) solid color-mix(in oklch, var(--paper) 42%, transparent);
}

.topnav button {
  min-height: 44px;
  border-radius: 0;
  border-right: var(--hair) solid color-mix(in oklch, var(--paper) 42%, transparent);
  color: color-mix(in oklch, var(--paper) 76%, var(--ink));
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  padding: 12px 18px;
  transition-property: background-color, color, transform;
  transition-duration: .14s;
}

.topnav button:last-child { border-right: 0; }
.topnav button:hover { color: var(--paper); background: color-mix(in oklch, var(--paper) 8%, transparent); }
.topnav button.on {
  background: var(--paper);
  color: var(--ink);
}
.topnav button.on::after { display: none; }

.av-btn,
.av-btn.signed-out {
  min-height: 44px;
  border-radius: 0;
  border: var(--hair) solid var(--paper);
  background: var(--red);
  color: var(--paper);
  box-shadow: 3px 3px 0 color-mix(in oklch, var(--paper) 22%, transparent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 7px 14px;
}

.av-btn .av {
  border-radius: 0;
  background: var(--gold);
  border: var(--hair) solid var(--ink);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
}

.scroll::-webkit-scrollbar-thumb {
  background: var(--ink);
  border-radius: 0;
  border: 3px solid var(--paper-2);
}

.layout {
  max-width: 1320px;
  padding: 22px;
  gap: 22px;
}

.layout.single {
  max-width: 900px;
}

.md-head,
.sec-head {
  padding: 14px 18px;
  margin-bottom: 0;
  background: var(--paper);
  border: var(--rule) solid var(--ink);
  box-shadow: var(--shadow);
}

.md-head {
  display: grid;
  grid-template-columns: 52px minmax(0, 760px) 52px;
  justify-content: center;
  align-items: center;
  column-gap: 28px;
  min-height: 154px;
  padding: 18px 24px;
}

.md-title .ey,
.sec-head .ey,
.data-state-kicker {
  color: var(--red-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.md-title h1,
.sec-head h2,
.data-state h2 {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(35px, 4.6vw, 54px);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 0.92;
  margin-top: 5px;
}

.md-title .dt,
.sec-head p,
.data-state p {
  color: var(--ink-soft);
  font-size: 13px;
}

.md-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.md-title .dt {
  margin-top: 4px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.md-nav {
  width: 52px;
  height: 52px;
  border-radius: 0;
  border: var(--rule) solid var(--ink);
  background: var(--paper-3);
  box-shadow: none;
  font-family: var(--font-display);
  font-weight: 400;
  transition-property: transform, background-color;
  transition-duration: .12s;
}

.md-nav:active,
.grp-card:active,
.grp-act:active,
.btn-primary:active,
.btn-ghost:active,
.invite .copy:active,
.recap-link:active,
.data-state-btn:active,
.pe-account-signout:active {
  transform: scale(0.96);
}

.md-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  padding: 18px 34px;
  background: var(--paper);
  border: var(--rule) solid var(--ink);
  border-radius: 0;
  box-shadow: var(--shadow);
}

.md-strip .seg {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.md-strip .pill {
  border-radius: 0;
  border: var(--hair) solid var(--ink);
  background: var(--paper-3);
  color: var(--ink);
  font-size: 10px;
  letter-spacing: 0.12em;
  padding: 6px 9px;
}

.md-strip .pill.live {
  background: var(--red);
  border-color: var(--ink);
  color: var(--paper);
}

.md-strip .pill.live i {
  background: var(--paper);
  animation: pulse 1.2s ease-in-out infinite;
}

.md-strip .pill.next b {
  color: var(--red-ink);
  font-family: var(--font-mono);
}

.md-strip .save-state {
  justify-self: end;
  margin-left: 0;
  color: var(--blue);
  font-size: 13px;
  letter-spacing: 0.12em;
  opacity: 1;
}

.tick,
.md-strip .save-state .tick,
.match-foot .saved .tick {
  border-radius: 0;
  background: var(--green);
  color: var(--paper);
  border: 1px solid var(--ink);
}

.feed {
  gap: 14px;
  margin-top: 14px;
}

.match,
.data-state,
.side-card,
.lb,
.pod,
.grp-card,
.grp-act,
.gd-hero,
.invite,
.form-card,
.modal-card,
.pe-auth-card,
.empty-state {
  border: var(--rule) solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.match {
  overflow: visible;
}

.match::before,
.match::after {
  width: 10px;
  height: 10px;
  background:
    linear-gradient(var(--ink-soft), var(--ink-soft)) center/100% 1px no-repeat,
    linear-gradient(var(--ink-soft), var(--ink-soft)) center/1px 100% no-repeat;
  opacity: 0.5;
}

.match-top,
.side-card .sc-head,
.lb-head,
.form-card .fc-head,
.modal-head {
  background: var(--ink);
  color: var(--paper);
  border-bottom: var(--rule) solid var(--ink);
}

.match-top {
  padding: 9px 14px;
}

.match-top .grp,
.match-lock {
  color: color-mix(in oklch, var(--paper) 82%, var(--ink));
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.match-top .grp b,
.match-lock.soon {
  color: var(--gold);
  font-family: var(--font-mono);
}

.match-body {
  padding: 16px;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 31px, color-mix(in oklch, var(--ink) 7%, transparent) 32px),
    var(--paper);
}

.tie {
  gap: 0;
  border: var(--hair) solid var(--ink);
  background: var(--paper-3);
}

.team {
  min-height: 156px;
  border-radius: 0;
  border: 0;
  border-right: var(--hair) solid var(--ink);
  background: var(--paper);
  justify-content: center;
  gap: 10px;
  padding: 18px 10px;
  transition-property: background-color, color, transform;
  transition-duration: .14s;
}

.tie .team:last-child {
  border-right: 0;
  border-left: var(--hair) solid var(--ink);
}

.team:hover {
  background: color-mix(in oklch, var(--blue) 8%, var(--paper));
}

.team .flag,
.ft-team .flag,
.recap-tie .rt-team .flag {
  border-radius: 0;
  border: var(--hair) solid var(--ink);
  background: var(--paper-3);
  box-shadow: 2px 2px 0 color-mix(in oklch, var(--ink) 20%, transparent);
  outline: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 34px;
}

.team .flag {
  width: 116px;
  height: 76px;
}

.ft-team .flag {
  width: 88px;
  height: 58px;
}

.recap-tie .rt-team .flag {
  width: 74px;
  height: 48px;
}

.team .flag.flag-img,
.ft-team .flag.flag-img,
.recap-tie .rt-team .flag.flag-img {
  box-shadow: 2px 2px 0 color-mix(in oklch, var(--ink) 20%, transparent), inset 0 0 0 1px rgba(0,0,0,0.1);
}

.team .nm,
.ft-team .nm,
.recap-tie .rt-team .nm {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--ink);
  max-width: min(18ch, 100%);
  text-align: center;
  text-wrap: balance;
}

.team .rk,
.ko-note {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  text-align: center;
}

.team.pick {
  background: var(--blue);
  border-color: var(--ink);
  box-shadow: inset 0 0 0 4px color-mix(in oklch, var(--paper) 18%, transparent);
}

.team.pick .nm,
.team.pick .rk {
  color: var(--paper);
}

.team.pick .flag {
  box-shadow: 0 0 0 3px var(--gold), 2px 2px 0 color-mix(in oklch, var(--ink) 20%, transparent);
}

.team .pick-tag {
  top: 9px;
  right: 9px;
  border-radius: 0;
  outline: 0;
  border: var(--hair) solid var(--ink);
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  mix-blend-mode: normal;
}

.midcol {
  min-width: 84px;
  padding: 10px;
  background: var(--paper-3);
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.midcol .vs,
.score .x {
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
}

.draw-btn,
.step,
.recap-link,
.data-state-btn,
.btn-primary,
.btn-ghost,
.invite .copy,
.pe-account-signout,
.pe-auth-email button,
.pe-auth-google {
  min-height: 44px;
  border-radius: 0;
  border: var(--rule) solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 2px 2px 0 color-mix(in oklch, var(--ink) 22%, transparent);
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.04em;
  transition-property: background-color, color, transform, filter;
  transition-duration: .14s;
}

.draw-btn.pick {
  background: var(--gold);
  color: var(--ink);
  box-shadow: inset 0 0 0 3px color-mix(in oklch, var(--paper) 22%, transparent), 2px 2px 0 color-mix(in oklch, var(--ink) 22%, transparent);
}

.score {
  margin-top: 14px;
  padding: 14px;
  border: var(--hair) dashed var(--ink);
  background: color-mix(in oklch, var(--paper-3) 72%, var(--paper));
}

.score-head .lbl,
.score-head .bonus {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.score-head .bonus {
  color: var(--red-ink);
}

.step {
  width: 44px;
  height: 44px;
  box-shadow: none;
  font-family: var(--font-mono);
}

.step:active {
  transform: scale(0.96);
  background: var(--gold);
}

.step:disabled {
  opacity: 0.35;
}

.sval,
.ft-num,
.recap-tie .rt-score,
.lb-row .r-pts,
.lb-row .r-exact,
.side-mini-row .pts,
.ppts,
.gc-rank .rp,
.invite .code,
.recap-total .rv {
  font-variant-numeric: tabular-nums;
}

.sval {
  color: var(--blue);
  font-family: var(--font-display);
  font-weight: 400;
}

.sval.dim {
  color: color-mix(in oklch, var(--ink) 25%, var(--paper-3));
}

.score-clear button,
.backlink,
.side-card .sc-head button {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  border-bottom-color: var(--ink);
}

.match-foot {
  border-top: var(--hair) dashed var(--ink);
  font-family: var(--font-mono);
}

.match-foot .saved,
.match-foot .pts-pos {
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 10px;
}

.match-foot .empty {
  color: var(--ink-soft);
  font-style: normal;
}

.pens {
  border-radius: 0;
  border: var(--hair) dashed var(--ink);
  background: var(--paper-3);
}

.pens .box,
.recap-r .ind {
  border-radius: 0;
  border: var(--hair) solid var(--ink);
}

.pens.on .box,
.recap-r.hit .ind {
  background: var(--green);
  color: var(--paper);
}

.match.locked .match-body {
  opacity: 0.82;
  filter: grayscale(0.25);
}

.match.finished .match-top {
  background: var(--green);
  border-color: var(--ink);
}

.match.finished .match-top .grp,
.match.finished .match-top .grp b,
.match.finished .match-lock {
  color: var(--paper);
}

.ft-team.win .nm,
.recap-tie .rt-team.win .nm {
  color: var(--green);
}

.ft-num {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
}

.recap-link,
.btn-primary,
.data-state-btn,
.pe-account-signout,
.pe-auth-email button {
  background: var(--red);
  color: var(--paper);
}

.recap-link.earned {
  background: var(--green);
  color: var(--paper);
}

.tabbar {
  background: var(--paper-3);
  border-top: var(--rule) solid var(--ink);
  box-shadow: none;
  gap: 0;
  padding: 0 0 env(safe-area-inset-bottom);
}

.tabbar button {
  min-height: 64px;
  border-right: var(--hair) solid var(--ink);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  padding: 8px 4px;
}

.tabbar button + button { box-shadow: none; }
.tabbar button:last-child { border-right: 0; }
.tabbar button.on {
  background: var(--ink);
  color: var(--paper);
}
.tabbar button.on::after { display: none; }
.tabbar button .ico { color: currentColor; }
.tabbar button svg :is(path, circle, rect) { stroke: currentColor; }
.tabbar button.on .ico svg :is(path, circle, rect) { stroke: var(--paper); }

.tab-badge {
  border-radius: 0;
  background: var(--red);
  color: var(--paper);
  border: var(--hair) solid var(--ink);
  font-family: var(--font-mono);
}

.sec-head {
  margin-bottom: 16px;
}

.sec-head h2 {
  font-size: clamp(34px, 7vw, 56px);
}

.seg-ctl {
  display: flex;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  gap: 0;
  padding: 0;
  border: var(--rule) solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.seg-ctl button {
  min-height: 40px;
  border-right: var(--hair) solid var(--ink);
  border-radius: 0;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 8px 13px;
  white-space: nowrap;
}

.seg-ctl button:last-child { border-right: 0; }
.seg-ctl button.on,
.seg-ctl button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.lb {
  overflow: hidden;
}

.lb-head {
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 10px;
}

.lb-row,
.side-mini-row {
  border-top: var(--hair) dashed var(--line);
  background: var(--paper);
}

.lb-row {
  min-height: 50px;
}

.lb-row .pos,
.side-mini-row .pos {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
}

.lb-row .who,
.side-mini-row .who {
  font-weight: 700;
}

.lb-row .uflag,
.side-mini-row .uflag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  min-height: 26px;
  border: var(--hair) solid var(--ink);
  background: var(--paper-3);
}

.lb-row .r-pts,
.lb-row .r-exact,
.side-mini-row .pts {
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
}

.lb-row.leader,
.lb-row.you,
.side-mini-row.you {
  background: color-mix(in oklch, var(--gold) 32%, var(--paper));
  box-shadow: inset 7px 0 0 var(--gold);
  border-bottom: var(--hair) solid var(--ink);
}

.lb-row.you .you-pill {
  border-radius: 0;
  border: var(--hair) solid var(--ink);
  background: var(--blue);
  color: var(--paper);
  font-family: var(--font-mono);
}

.lb-gap {
  border-top: var(--hair) dashed var(--ink);
  background: var(--paper-3);
  font-family: var(--font-mono);
}

.podium {
  gap: 0;
  border: var(--rule) solid var(--ink);
  background: var(--paper-3);
  box-shadow: var(--shadow);
}

.pod {
  border: 0;
  border-right: var(--hair) solid var(--ink);
  box-shadow: none;
  background: var(--paper);
}

.pod:last-child { border-right: 0; }
.pod.p1 {
  background: color-mix(in oklch, var(--gold) 36%, var(--paper));
  border-color: var(--ink);
}
.pod.p1 .pnm,
.pod.p1 .medal { color: var(--ink); }
.pod .medal,
.pod .pnm,
.pod .ppts {
  font-family: var(--font-display);
  font-weight: 400;
}
.pod .ppts { color: var(--blue); }

.side-card .sc-head .t {
  color: var(--paper);
  font-family: var(--font-mono);
}

.side-card .sc-head button {
  color: var(--gold);
}

.side-rule h4 {
  color: var(--red-ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  margin: 0 0 14px;
  padding-bottom: 9px;
  border-bottom: var(--hair) dashed var(--ink);
}

.side-rule li {
  color: var(--ink-soft);
}

.side-rule li b,
.side-rule li .pp {
  color: var(--red-ink);
  font-family: var(--font-mono);
}

.grp-actions {
  gap: 14px;
}

.grp-act {
  color: var(--ink);
  padding: 16px;
}

.grp-act.create {
  background: var(--red);
  color: var(--paper);
  border-color: var(--ink);
}

.grp-act.join {
  background: var(--paper);
}

.grp-act .ga-ico,
.grp-card .gc-badge,
.gd-hero .gh-badge,
.success-badge .sb-ring {
  border-radius: 0;
  border: var(--rule) solid var(--ink);
  background: var(--gold);
  color: var(--ink);
  box-shadow: 2px 2px 0 color-mix(in oklch, var(--ink) 22%, transparent);
  font-family: var(--font-display);
  font-weight: 400;
}

.grp-act .ga-t,
.grp-card .gc-meta h3,
.gd-hero .gh-meta h2,
.form-card .fc-head h2,
.modal-head h2,
.pe-auth-title {
  font-family: var(--font-display);
  font-weight: 400;
}

.grp-act .ga-s,
.grp-card .gc-meta .gc-sub,
.gd-hero .gh-meta .gh-sub,
.field .hint,
.pe-auth-copy {
  color: var(--ink-soft);
}

.grp-act.create .ga-s {
  color: color-mix(in oklch, var(--paper) 82%, var(--red));
}

.grp-card {
  width: 100%;
}

.grp-card .gc-badge.monogram,
.gd-hero .gh-badge {
  background: var(--green);
  color: var(--paper);
}

.grp-card .gc-rank .rp {
  color: var(--red);
  font-family: var(--font-display);
  font-weight: 400;
}

.grp-card .gc-rank .rl {
  color: var(--ink-soft);
  font-family: var(--font-mono);
}

.gd-hero {
  background: var(--ink);
  color: var(--paper);
}

.gd-hero .gh-meta .eyy,
.form-card .fc-head .eyy,
.modal-head .eyy {
  color: var(--gold);
  font-family: var(--font-mono);
}

.gd-hero .gh-meta .gh-sub {
  color: color-mix(in oklch, var(--paper) 74%, var(--ink));
}

.invite {
  border-style: dashed;
}

.invite .il,
.field label {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.invite .code,
.field input.code-input {
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
}

.field input {
  border-radius: 0;
  border: var(--rule) solid var(--ink);
  background: var(--paper-3);
  box-shadow: inset 3px 3px 0 color-mix(in oklch, var(--ink) 8%, transparent);
  font-family: var(--font-body);
}

.field input:focus {
  box-shadow: inset 3px 3px 0 color-mix(in oklch, var(--ink) 8%, transparent), 0 0 0 3px var(--gold);
}

.btn-ghost {
  background: var(--paper);
}

.success-badge .sb-ring {
  border-radius: 50%;
  background: var(--green);
  color: var(--paper);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: color-mix(in oklch, var(--ink) 62%, transparent);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.modal-card {
  max-width: 460px;
}

.modal-head::before,
.form-card .fc-head::before {
  background: var(--gold);
  width: 8px;
}

.modal-close,
.pe-auth-close {
  border-radius: 0;
  border: var(--hair) solid currentColor;
  background: transparent;
}

.recap-r {
  border-radius: 0;
  border: var(--hair) solid var(--ink);
  background: var(--paper-3);
}

.recap-r.hit {
  background: color-mix(in oklch, var(--green) 13%, var(--paper));
}

.recap-r.miss .ind {
  background: var(--paper);
  color: var(--red);
}

.recap-total {
  border-radius: 0;
  border: var(--rule) solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.recap-total .rv {
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 400;
}

.toast {
  position: fixed;
  z-index: 240;
  border-radius: 0;
  border: var(--rule) solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-lg), inset 8px 0 0 var(--gold);
  font-family: var(--font-mono);
}

.toast .tk {
  color: var(--green);
}

.empty-state {
  padding: 34px 20px;
}

.empty-state .es-ico {
  color: var(--red);
  opacity: 1;
}

.pe-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 230;
  background: color-mix(in oklch, var(--ink) 62%, transparent);
}

.pe-auth-card {
  background: var(--paper);
  padding: 24px;
  max-height: min(88vh, 720px);
  overflow: auto;
}

.pe-auth-close {
  color: var(--ink);
}

.pe-auth-kicker {
  color: var(--red-ink);
}

.pe-auth-google {
  background: var(--paper-3);
}

.pe-auth-sep {
  font-family: var(--font-mono);
}

.pe-auth-email input {
  border-radius: 0;
  border: var(--hair) solid var(--ink);
  background: var(--paper-3);
}

.pe-profile-form {
  grid-template-columns: 1fr 1fr;
}

.pe-profile-field span {
  color: var(--ink-soft);
  font-family: var(--font-mono);
}

.pe-profile-field input,
.pe-profile-field select {
  border-radius: 0;
  border: var(--hair) solid var(--ink);
  background: var(--paper-3);
  box-shadow: inset 2px 2px 0 color-mix(in oklch, var(--ink) 8%, transparent);
}

.pe-profile-save {
  border-radius: 0;
  border: var(--rule) solid var(--ink);
  background: var(--red);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 2px 2px 0 color-mix(in oklch, var(--ink) 22%, transparent);
}

@media (hover: hover) {
  .draw-btn:hover,
  .step:hover,
  .recap-link:hover,
  .btn-primary:hover,
  .btn-ghost:hover,
  .invite .copy:hover,
  .grp-act:hover,
  .grp-card:hover,
  .data-state-btn:hover {
    filter: none;
    transform: translate(-1px, -1px);
  }
}

@media (min-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 330px;
  }

  .col-side {
    top: 22px;
  }
}

@media (max-width: 720px) {
  body::after,
  .match::before,
  .match::after {
    display: none;
  }

  .topbar {
    min-height: 66px;
    padding: calc(var(--safe-top) + 8px) 12px 10px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-name {
    font-size: 20px;
  }

  .brand-name small {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .av-btn.signed-out {
    min-width: 72px;
    justify-content: center;
    padding-inline: 10px;
  }

  .av-btn.signed-out .av-label {
    display: inline;
    white-space: nowrap;
  }

  .layout {
    padding: 12px 12px 18px;
  }

  .md-head {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    column-gap: 10px;
    min-height: 0;
    padding: 12px 10px;
  }

  .md-nav {
    width: 44px;
    height: 44px;
  }

  .md-title h1,
  .sec-head h2 {
    font-size: clamp(34px, 10.5vw, 48px);
  }

  .md-title .dt {
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  .md-strip {
    grid-template-columns: 1fr auto;
    gap: 10px 12px;
    align-items: flex-start;
    padding: 12px;
  }

  .md-strip .save-state {
    margin-left: 0;
  }

  .team {
    min-height: 140px;
  }

  .team .flag {
    width: 88px;
    height: 58px;
  }

  .midcol {
    min-width: 76px;
    padding: 8px 6px;
  }

  .midcol .vs {
    margin-bottom: 8px;
  }

  .draw-btn {
    font-size: 10px;
    min-width: 58px;
    padding-inline: 7px;
  }

  .score {
    gap: 8px;
    padding: 12px 8px;
  }

  .score-head {
    gap: 8px;
  }

  .score-head .lbl,
  .score-head .bonus {
    font-size: 9px;
    letter-spacing: 0.08em;
  }

  .sval {
    min-width: 34px;
    font-size: 36px;
  }

  .grp-actions {
    grid-template-columns: 1fr;
  }

  .lb-head,
  .lb-row {
    grid-template-columns: 34px minmax(0, 1fr) 54px 48px;
    gap: 7px;
    padding-inline: 10px;
  }

  .podium {
    grid-template-columns: 1fr;
  }

  .pod {
    border-right: 0;
    border-bottom: var(--hair) solid var(--ink);
  }

  .pod:last-child {
    border-bottom: 0;
  }

  .invite {
    align-items: stretch;
    flex-direction: column;
  }

  .invite .copy {
    width: 100%;
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: 78px;
    transform: translateY(20px);
    justify-content: center;
    white-space: normal;
    text-align: center;
  }

  .toast.show {
    transform: translateY(0);
  }

  .pe-profile-form {
    grid-template-columns: 1fr;
  }

  .pe-profile-field--country {
    max-width: none;
  }
}

@media (max-width: 430px) {
  .tie {
    grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr);
  }

  .team {
    padding-inline: 5px;
  }

  .team .nm {
    font-size: 12px;
    max-width: 10ch;
  }

  .team .rk {
    font-size: 9px;
  }

  .midcol .vs {
    font-size: 10px;
  }

  .draw-btn {
    font-size: 9px;
    letter-spacing: 0.04em;
  }

  .tabbar button {
    font-size: 9px;
  }
}

@media (max-width: 899px) {
  .tabbar {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
}
