:root {
  --bg: #f5f5f0;
  --panel: #ffffff;
  --panel2: #f0efeb;
  --line: #e0ddd6;
  --text: #1a1a1a;
  --muted: #7a7568;
  --accent: #1a6b4a;
  --gold: #b8860b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}
header {
  padding: 1.8rem 1rem 1.4rem;
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
h1 { margin: 0; font-size: 1.9rem; letter-spacing: -0.5px; }
h1 span { color: var(--accent); }
.tagline { color: var(--muted); margin: 0.25rem 0 1.3rem; font-size: 0.9rem; }

.tabs {
  display: inline-flex; gap: 0.2rem; max-width: 100%;
  padding: 0.3rem; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
}
.tab {
  background: transparent; color: var(--muted);
  border: none; white-space: nowrap;
  padding: 0.5rem 1.15rem; font-size: 0.92rem; font-weight: 600;
  border-radius: 10px; cursor: pointer;
  transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: var(--panel); color: var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.10), 0 1px 1px rgba(0,0,0,0.04);
}

.livebar { max-width: 1100px; margin: 0 auto; padding: 0.6rem 1rem 0; display: flex; align-items: center; gap: 0.6rem; justify-content: flex-end; }
.live-status { font-size: 0.8rem; color: var(--muted); }
.live-status::before { content: "\25CF"; margin-right: 0.4rem; }
.live-status.ok { color: var(--accent); }
.live-status.ok::before { color: var(--accent); }
.live-status.loading::before { color: var(--gold); }
.live-status.warn { color: var(--gold); }
.live-status.muted::before { color: var(--muted); }
.live-refresh { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 7px; padding: 0.3rem 0.7rem; font-size: 0.8rem; cursor: pointer; }
.live-refresh:hover { border-color: var(--accent); }

main { max-width: 1100px; margin: 0 auto; padding: 0.8rem 1rem 3rem; }

/* leaderboard */
table.board { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
table.board th, table.board td { padding: 0.7rem 0.6rem; text-align: center; border-bottom: 1px solid var(--line); }
table.board th { background: var(--panel2); color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
table.board td:nth-child(2) { text-align: left; font-weight: 600; }
table.board td.rank { color: var(--muted); }
table.board tr:first-child td.pts { color: var(--gold); }
td.pts, .pts { font-weight: 800; color: var(--accent); font-size: 1.05rem; }
.pchip { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 0.5rem; vertical-align: middle; }
.rules { color: var(--muted); font-size: 0.85rem; text-align: center; margin-top: 1rem; }
.rules b { color: var(--text); }
table.board tr.leader td { background: rgba(184,134,11,0.08); }
table.board tr.leader td.pts { color: var(--gold); }
table.board tr.leader.me td { background: linear-gradient(90deg, rgba(184,134,11,0.10), rgba(26,107,74,0.08)); }
.medal { font-size: 1.05rem; line-height: 1; }

/* match centre (leaderboard) */
.matchcentre { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr)); gap: 1rem; margin-top: 1.4rem; }
.mc-col { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0.6rem 0.9rem 0.8rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.mc-col h3 { margin: 0.3rem 0 0.5rem; font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.mc-row { display: grid; grid-template-columns: 92px 62px minmax(0, 1fr); align-items: center; gap: 0.5rem; padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--line); font-size: 0.85rem; }
.mc-row:last-child { border-bottom: none; }
.mc-when { color: var(--muted); font-size: 0.68rem; display: flex; flex-direction: column; line-height: 1.25; }
.mc-when small { font-size: 0.94em; opacity: 0.85; }
.mc-tag { justify-self: start; text-align: center; color: var(--muted); font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; border: 1px solid var(--line); border-radius: 999px; padding: 0.1rem 0.4rem; white-space: nowrap; }
.mc-match { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.4rem; }
/* each side is a flex row: the owner badge sits on the inner edge (next to the
   score) and long names wrap to a second line rather than truncating */
.mc-side { display: flex; align-items: center; gap: 0.35rem; min-width: 0; overflow: hidden; }
.mc-side > * { min-width: 0; }
.mc-side .owner { flex: 0 0 auto; }
.mc-side .team { max-width: 100%; }
.mc-side .tnm { min-width: 0; }
.mc-side:first-child { justify-content: flex-end; text-align: right; }
.mc-side:last-child { justify-content: flex-start; text-align: left; }
.mc-side.win { font-weight: 700; }
.mc-sc { font-weight: 700; color: var(--muted); min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
.mc-row.done .mc-sc { color: var(--text); }
.mc-row.today { background: rgba(26,107,74,0.06); border-radius: 6px; }
.mc-row.today .mc-tag { border-color: var(--accent); color: var(--accent); }
/* a row where one of your teams is playing — lightly tinted, no marker */
.mc-row.mine { background: rgba(184,134,11,0.07); border-radius: 6px; }
.mc-row.mine.today { background: linear-gradient(90deg, rgba(184,134,11,0.10), rgba(26,107,74,0.07)); }
.mc-empty { color: var(--muted); font-size: 0.85rem; margin: 0.3rem 0; }
.mc-side .bdg, .mc-sc .bdg { color: var(--gold); font-size: 0.6rem; margin-left: 1px; }

/* grid of cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.card h3 { margin: 0 0 0.7rem; font-size: 1.1rem; display: flex; align-items: center; gap: 0.4rem; }

/* group stage scroller + its mobile navigation arrows */
.groups-wrap { position: relative; }
.gnav {
  display: none; position: fixed; bottom: 1rem;
  z-index: 50; width: 44px; height: 44px; border-radius: 50%;
  align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid var(--line); color: var(--accent);
  font-size: 1.5rem; line-height: 1; cursor: pointer;
  box-shadow: 0 3px 12px rgba(0,0,0,0.2);
  transition: opacity .15s ease, border-color .15s ease;
}
.gnav.prev { right: 4.2rem; }
.gnav.next { right: 1rem; }
.gnav:disabled { opacity: 0.3; cursor: default; }
.gnav:not(:disabled):hover { border-color: var(--accent); }

/* horizontal scroller (group stage) — one row, edges faded out */
.hscroll {
  display: flex; gap: 1rem; overflow-x: auto; overflow-y: hidden;
  align-items: flex-start;
  padding: 0.5rem 1.6rem 1.2rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 1.6rem, #000 calc(100% - 1.6rem), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 1.6rem, #000 calc(100% - 1.6rem), transparent 100%);
}
.hscroll > .card { flex: 0 0 380px; scroll-snap-align: start; }
.hscroll::-webkit-scrollbar { height: 8px; }
.hscroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.hscroll::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.hscroll::-webkit-scrollbar-track { background: transparent; }

/* standings */
table.standings { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-bottom: 0.8rem; }
table.standings th, table.standings td { padding: 0.35rem 0.3rem; text-align: center; border-bottom: 1px solid var(--line); }
table.standings th { color: var(--muted); font-weight: 600; font-size: 0.72rem; }
/* fixed height sized for two lines so every row is identical, wrapped or not */
table.standings tbody td { height: 3.3rem; }
table.standings .tname { text-align: left; min-width: 150px; white-space: nowrap; }
table.standings tr.qual td { background: rgba(26,107,74,0.06); }
table.standings tr.third td { background: rgba(184,134,11,0.06); }

/* fixtures */
.fixtures { display: flex; flex-direction: column; gap: 0.3rem; }
.fx {
  display: grid; grid-template-columns: 64px 1fr auto 1fr; align-items: center;
  gap: 0.4rem; padding: 0.35rem 0.5rem; border-radius: 8px; background: var(--panel2); font-size: 0.85rem;
  /* fixed height sized for two lines: every fixture row is identical, wrapped or not */
  height: 3.3rem;
}
.fx .date { color: var(--muted); font-size: 0.72rem; display: flex; flex-direction: column; line-height: 1.2; }
.fx .date small { font-size: 0.66rem; opacity: 0.8; }
.fx .home { text-align: right; }
.fx .away { text-align: left; }
.fx .score { font-weight: 700; min-width: 38px; text-align: center; color: var(--muted); }
.fx.done .score { color: var(--text); }
.decided { display: block; font-size: 0.6rem; color: var(--gold); font-weight: 600; }

/* teams + owners */
.team { display: inline-flex; align-items: center; gap: 0.35rem; }
.team.out { color: var(--muted); text-decoration: line-through; opacity: 0.6; }
.team.tbd, .tbd { color: var(--muted); font-style: italic; }
.owner {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; font-size: 0.62rem; font-weight: 800; color: #fff;
}

/* connected bracket (top-bottom) */
.bracket2-wrap {
  overflow-x: auto; padding-bottom: 0.5rem;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
  -webkit-overflow-scrolling: touch;
}
.bracket2-wrap::-webkit-scrollbar { height: 8px; }
.bracket2-wrap::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.bracket2-wrap::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.bracket2-wrap::-webkit-scrollbar-track { background: transparent; margin: 0 0.5rem; }
.bracket2 { position: relative; }
.blines { position: absolute; left: 0; top: 0; pointer-events: none; }
.blines path { fill: none; stroke: var(--line); stroke-width: 2; }
.brow { position: absolute; left: 0; width: 52px; display: flex; align-items: center; color: var(--muted); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.bx { position: absolute; box-sizing: border-box; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: 0.78rem; z-index: 1; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.bx.done { border-color: #a3b8cc; }
.bx.mine { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 4px 16px rgba(26,107,74,0.12); }
.bxline { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 3px 7px; height: 50%; }
.bxline + .bxline { border-top: 1px solid var(--line); }
.bxline.win { background: rgba(26,107,74,0.08); font-weight: 700; }
.bxline .bs { color: var(--muted); font-variant-numeric: tabular-nums; }
.bxline.win .bs { color: var(--text); }
.bxline .team { overflow: hidden; white-space: nowrap; min-width: 0; }
.bxline .tnm { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bx .src { color: var(--muted); font-style: italic; font-size: 0.72rem; }
.bx .proj { opacity: 0.85; font-style: italic; }
.bx .bdg { color: var(--gold); font-size: 0.6rem; margin-left: 2px; }
.bxcap { position: absolute; text-align: center; color: var(--muted); font-size: 0.6rem; line-height: 1; pointer-events: none; }
.tp { margin-top: 1.4rem; }
.tp h4 { margin: 0 0 0.4rem; color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.tp .bx { position: static; }
.tpwhen { color: var(--muted); font-size: 0.7rem; margin: 0.35rem 0 0; max-width: 124px; }
.brkey { display: flex; align-items: center; gap: 0.4rem; color: var(--muted); font-size: 0.8rem; margin-top: 1rem; flex-wrap: wrap; }
.brkey .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* desktop bracket hover tooltip */
.bxtip {
  position: fixed; z-index: 1002; pointer-events: none;
  max-width: 260px; padding: 0.55rem 0.7rem;
  background: #1a1a1a; color: #fff; border-radius: 8px;
  font-size: 0.78rem; line-height: 1.4;
  box-shadow: 0 6px 24px rgba(0,0,0,0.28);
  opacity: 0; transform: translateY(4px);
  transition: opacity .12s ease, transform .12s ease;
}
.bxtip.show { opacity: 1; transform: none; }
.bxtip-h { font-weight: 700; display: flex; flex-direction: column; gap: 0.1rem; margin-bottom: 0.35rem; }
.bxtip-when { font-weight: 500; color: #d8c27a; font-size: 0.72rem; }
.bxtip-paths { display: flex; flex-direction: column; gap: 0.2rem; color: #d6d6d6; }

/* knockout as a stacked list (mobile) */
.ko-list { display: flex; flex-direction: column; gap: 1.3rem; }
.ko-round h3 { margin: 0 0 0.5rem; font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ko-round .ties { display: flex; flex-direction: column; gap: 0.5rem; }
.ko-tie { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.ko-tie.done { border-color: #a3b8cc; }
.ko-tie.mine { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 4px 16px rgba(26,107,74,0.12); }
.ko-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0.5rem 0.7rem; font-size: 0.9rem; }
.ko-line + .ko-line { border-top: 1px solid var(--line); }
.ko-line.win { background: rgba(26,107,74,0.08); font-weight: 700; }
.ko-line .ko-s { color: var(--muted); font-variant-numeric: tabular-nums; }
.ko-line.win .ko-s { color: var(--text); }
.ko-line .src { color: var(--muted); font-style: italic; font-size: 0.85rem; }
.ko-line .proj { font-style: italic; opacity: 0.85; }
.ko-line .bdg { color: var(--gold); font-size: 0.6rem; margin-left: 2px; }
.ko-when { color: var(--muted); font-size: 0.72rem; padding: 0.35rem 0.7rem; border-top: 1px solid var(--line); background: var(--panel2); }

/* player breakdown */
.card.player h3 .ptotal { margin-left: auto; color: var(--accent); font-size: 0.95rem; }
.card .sub { color: var(--muted); font-size: 0.82rem; margin: -0.3rem 0 0.7rem; }
.teamlist { list-style: none; margin: 0; padding: 0; }
.teamlist li { display: flex; justify-content: space-between; align-items: center; padding: 0.35rem 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.teamlist li.out { opacity: 0.55; }
.teamlist li b { color: var(--accent); white-space: nowrap; }
.grp { color: var(--muted); font-weight: 600; margin-left: 0.2rem; }

/* ===== Gate / login ===== */
body.locked { overflow: hidden; }

.site {
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 0.45s ease 0.1s, transform 0.55s cubic-bezier(.16,1,.3,1) 0.1s;
}
.site.reveal { opacity: 1; transform: none; }

.gate {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: transparent;
  transition: opacity 0.5s ease;
}
.gate.exit { pointer-events: none; opacity: 0; }

/* daytime sky behind the clouds */
.sky {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg, #bcdcf3 0%, #d6e8f3 45%, #eef3f1 100%);
  transition: opacity 1.2s ease;
}
.gate.exit .sky { opacity: 0; transition: opacity 0.6s ease 0.2s; }

/* two banks of cloud built from overlapping puffs, parting on login */
.cloud-bank {
  position: absolute; top: -15%; height: 130%; z-index: 1; pointer-events: none;
  filter: blur(8px);
  background-color: rgba(255,255,255,0);
  background-image:
    radial-gradient(circle at center, #fff 0 40px, rgba(255,255,255,0) 44px),
    radial-gradient(circle at center, #fff 0 40px, rgba(255,255,255,0) 44px);
  background-size: 78px 78px;
  background-position: 0 0, 39px 39px;
  transition: transform 0.6s cubic-bezier(.55,0,.25,1), opacity 0.5s ease;
}
.cloud-bank.left { left: -12%; width: 64%; animation: cloudL 16s ease-in-out infinite alternate; }
.cloud-bank.right { right: -12%; width: 64%; animation: cloudR 16s ease-in-out infinite alternate; }
@keyframes cloudL { from { transform: translateX(-1.5%); } to { transform: translateX(1.5%); } }
@keyframes cloudR { from { transform: translateX(1.5%); } to { transform: translateX(-1.5%); } }

.gate.exit .cloud-bank { animation: none; }
.gate.exit .cloud-bank.left { transform: translateX(-118%) scale(1.08); opacity: 0; }
.gate.exit .cloud-bank.right { transform: translateX(118%) scale(1.08); opacity: 0; }
.gate.exit .gate-card {
  opacity: 0; transform: translateY(-10px) scale(0.96);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.gate-card {
  position: relative; z-index: 2; text-align: center;
  width: min(92vw, 440px); padding: 2.8rem 2rem 2.2rem;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
  animation: cardIn 0.6s ease both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.gate-trophy { font-size: 1rem; line-height: 1; color: var(--muted); letter-spacing: 0.15em; text-transform: uppercase; font-weight: 600; margin-bottom: 0.2rem; }
.gate-kicker { margin: 0.5rem 0 0; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.28em; text-transform: uppercase; }
.gate-title { margin: 0.3rem 0 0; font-size: 2.2rem; font-weight: 800; letter-spacing: -1px; color: var(--text); }
.gate-title span { color: var(--accent); }
.gate-sub { color: var(--muted); margin: 0.6rem 0 1.6rem; font-size: 0.92rem; }

#gate-form { display: flex; gap: 0.5rem; }
#gate-input {
  flex: 1; padding: 0.8rem 1rem; font-size: 1rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; outline: none; transition: border-color .2s, box-shadow .2s;
}
#gate-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,107,74,0.12); }
.gate-go {
  padding: 0 1.2rem; font-size: 0.95rem; font-weight: 700; color: #fff; cursor: pointer;
  background: var(--accent); border: none; border-radius: 10px;
  transition: transform .12s ease, box-shadow .2s ease;
}
.gate-go:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,107,74,0.25); }
.gate-go:active { transform: translateY(0); }

.gate-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; justify-content: center; margin-top: 1.1rem; }
.gate-chip {
  padding: 0.4rem 0.85rem; font-size: 0.85rem; color: var(--text); cursor: pointer;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 999px; transition: background .15s, border-color .15s, transform .12s;
}
.gate-chip:hover { background: var(--bg); border-color: var(--accent); transform: translateY(-1px); }
.gate-error { min-height: 1.2em; margin: 0.9rem 0 0; color: #c0392b; font-size: 0.85rem; }
.gate-card.shake { animation: shake .45s; }
@keyframes shake { 10%,90%{transform:translateX(-2px)} 20%,80%{transform:translateX(4px)} 30%,50%,70%{transform:translateX(-8px)} 40%,60%{transform:translateX(8px)} }

.confetti { position: fixed; inset: 0; z-index: 1001; pointer-events: none; }

/* logged-in chip + "me" highlights */
.livebar-spacer { flex: 1; }
.whoami { display: none; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: var(--muted); cursor: pointer; }
.whoami.show { display: inline-flex; }
.whoami b { color: var(--text); }
.whoami .switch { color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 0.35rem; font-size: 0.72rem; }
.whoami:hover .switch { border-color: var(--accent); color: var(--text); }
table.board tr.me td { background: rgba(26,107,74,0.08); }
table.board tr.me td:nth-child(2)::after { content: " you"; color: var(--accent); font-size: 0.7rem; font-weight: 700; }
.card.player.me { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 4px 16px rgba(26,107,74,0.10); }

@media (prefers-reduced-motion: reduce) {
  .site { transition: opacity .3s ease; transform: none; }
  .cloud-bank { animation: none; transition: opacity .4s ease; }
  .gate.exit .cloud-bank { transform: none; opacity: 0; }
  .gate.exit .sky { transition: opacity .4s ease; }
  .gate.exit .gate-card { transition: opacity .3s ease; transform: none; }
}

@media (max-width: 720px) {
  header { padding: 1.2rem 0.75rem 1rem; }
  h1 { font-size: 1.5rem; }
  .tagline { margin-bottom: 1rem; }
  main { padding: 0.8rem 0.75rem 3rem; }
  .livebar { padding: 0.6rem 0.75rem 0; }
  /* tab bar becomes a swipeable strip instead of wrapping */
  .tabs {
    display: flex; width: 100%; overflow-x: auto;
    justify-content: flex-start; border-radius: 12px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 1 0 auto; padding: 0.5rem 0.9rem; }
  .hscroll > .card { flex-basis: 84vw; max-width: 360px; }
  /* group navigation arrows are mobile-only */
  .gnav { display: inline-flex; }
}

@media (max-width: 480px) {
  .fx { grid-template-columns: 48px 1fr auto 1fr; font-size: 0.8rem; gap: 0.3rem; }
  /* phones: date + group tag share the top line, the match gets a full-width
     row of its own so long names have room and the tag can't overlap them */
  .mc-row { grid-template-columns: 1fr auto; column-gap: 0.5rem; row-gap: 0.3rem; font-size: 0.85rem; padding: 0.55rem 0.3rem; }
  .mc-when { grid-column: 1; grid-row: 1; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0.05rem 0.4rem; font-size: 0.7rem; }
  .mc-tag { grid-column: 2; grid-row: 1; align-self: center; }
  .mc-match { grid-column: 1 / -1; grid-row: 2; }
  .gate-title { font-size: 1.7rem; }
  .gate-card { padding: 2.2rem 1.4rem 1.8rem; }
  #gate-form { flex-direction: column; }
}
