/* MTG League. One typeface (Archivo, variable width), paper for the public site, night for the tables. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("../fonts/archivo-latin.de2f1fe81758.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("../fonts/archivo-latin-ext.589f7bc0fac4.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #f3f0e8;
  --paper-2: #e9e4d8;
  --ink: #15171a;
  --night: #111315;
  --night-2: #1b1e22;
  --night-3: #22262b;
  --night-line: #2a2e34;
  --cream: #f2efe8;
  --mist: #a3a7ae;

  --bg: var(--paper);
  --surface: #fbfaf6;
  --surface-2: var(--paper-2);
  --text: var(--ink);
  --muted: #5b5e63;
  --line: #d9d3c6;
  --good: #1f7a4a;
  --warn: #a14a12;
  --bad: #b3261e;
  --on-accent: #111315;

  --accent: #ff7a3d;
  --accent-ink: #b8430f;
  --accent-soft: #ffe3d4;

  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

[data-accent="ember"] { --accent: #ff7a3d; --accent-ink: #b8430f; --accent-soft: #ffe3d4; }
[data-accent="tide"] { --accent: #4fd1c5; --accent-ink: #0f766e; --accent-soft: #d3f4f0; }
[data-accent="violet"] { --accent: #b794f6; --accent-ink: #6d3fc0; --accent-soft: #ece3fd; }
[data-accent="gold"] { --accent: #f2c94c; --accent-ink: #8a5a00; --accent-soft: #fbefc6; }

/* Night: the event pages, and everything when the device prefers dark. */
.night, .night body {
  --bg: var(--night);
  --surface: var(--night-2);
  --surface-2: var(--night-3);
  --text: var(--cream);
  --muted: var(--mist);
  --line: var(--night-line);
  --good: #9fd8b4;
  --warn: #ff9a66;
  --bad: #f28b82;
  --accent-ink: var(--accent);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, var(--night));
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--night);
    --surface: var(--night-2);
    --surface-2: var(--night-3);
    --text: var(--cream);
    --muted: var(--mist);
    --line: var(--night-line);
    --good: #9fd8b4;
    --warn: #ff9a66;
    --bad: #f28b82;
    --accent-ink: var(--accent);
    --accent-soft: color-mix(in srgb, var(--accent) 16%, var(--night));
    color-scheme: dark;
  }
  [data-accent] { --accent-ink: var(--accent); --accent-soft: color-mix(in srgb, var(--accent) 16%, var(--night)); }
}
.night [data-accent] { --accent-ink: var(--accent); --accent-soft: color-mix(in srgb, var(--accent) 16%, var(--night)); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
img, svg { max-width: 100%; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 24px; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --------------------------------------------------------------- header and footer */

header.site { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; min-height: 64px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 900; font-stretch: 88%; font-size: 1.15rem; margin-right: auto; }
.brand-mark { width: 26px; height: 34px; border-radius: 5px; background: var(--accent); transform: rotate(-8deg); box-shadow: 8px 2px 0 -2px var(--text); transition: transform .4s var(--ease); }
.brand:hover .brand-mark { transform: rotate(4deg); }
header.site nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
header.site nav a, header.site nav button.link {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 999px;
  color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem;
}
header.site nav a:hover, header.site nav button.link:hover { background: var(--surface-2); }
header.site nav a[aria-current="page"] { background: var(--text); color: var(--bg); }
header.site nav form { margin: 0; display: inline; }
header.site nav .button { min-height: 40px; padding: 0 16px; color: var(--on-accent); }
.menu-check { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.menu-toggle { display: none; }
@media (max-width: 719px) {
  header.site .wrap { flex-wrap: nowrap; min-height: 56px; }
  .brand { font-size: 1.05rem; min-width: 0; }
  .menu-toggle {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px;
    background: var(--surface-2); color: var(--text); font-weight: 700; cursor: pointer; flex: none; user-select: none;
  }
  .menu-check:focus-visible + .menu-toggle { outline: 3px solid var(--accent); outline-offset: 2px; }
  .menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 16px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .25s var(--ease), opacity .2s; }
  .menu-icon { position: relative; }
  .menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
  .menu-icon::before { top: -5px; }
  .menu-icon::after { top: 5px; }
  .menu-check:checked + .menu-toggle .menu-icon { background: transparent; }
  .menu-check:checked + .menu-toggle .menu-icon::before { transform: translateY(5px) rotate(45deg); }
  .menu-check:checked + .menu-toggle .menu-icon::after { transform: translateY(-5px) rotate(-45deg); }
  header.site nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 8px 16px 16px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 24px 40px -24px rgba(0, 0, 0, .4);
  }
  .menu-check:checked ~ nav { display: flex; animation: rise .25s var(--ease) both; }
  header.site nav a, header.site nav button.link { min-height: 48px; padding: 0 16px; border-radius: 14px; font-size: 1.05rem; }
  header.site nav form { display: block; }
  header.site nav button.link { width: 100%; justify-content: flex-start; text-decoration: none; }
  header.site nav .button { justify-content: center; margin-top: 6px; }
}

main { flex: 1; padding: 24px 0 64px; }
footer.site { border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; padding: 20px 0 32px; }

/* --------------------------------------------------------------- type */

h1, h2, h3 { line-height: 1.05; margin: 0 0 12px; }
h1 { font-size: clamp(2rem, 6vw, 3.25rem); font-weight: 900; font-stretch: 75%; letter-spacing: -0.01em; }
h2 { font-size: 1.4rem; font-weight: 800; font-stretch: 88%; margin-top: 32px; }
h3 { font-size: 1.1rem; font-weight: 800; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.lede { font-size: 1.15rem; max-width: 60ch; color: var(--muted); }
.display { font-weight: 900; font-stretch: 75%; line-height: .9; }
.num { text-align: right; }

/* --------------------------------------------------------------- buttons and chips */

.button, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 14px; border: 0;
  background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 800; font-size: 1rem;
  text-decoration: none; cursor: pointer;
  transition: transform .12s ease, filter .2s ease, background-color .2s ease, color .2s ease;
}
.button:hover, button:hover { filter: brightness(1.06); text-decoration: none; }
.button:active, button:active { transform: scale(.97); }
.button.secondary, button.secondary { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.button.secondary:hover, button.secondary:hover { background: var(--surface-2); filter: none; }
.button.ink, button.ink { background: var(--text); color: var(--bg); }
.button.big, button.big { min-height: 56px; font-size: 1.1rem; border-radius: 16px; padding: 0 24px; }
.button.small, button.small { min-height: 40px; padding: 0 14px; font-size: .9rem; border-radius: 12px; }
.button.wide, button.wide { width: 100%; }
button:disabled, .button[aria-disabled="true"] { background: var(--surface-2); color: var(--muted); cursor: not-allowed; filter: none; transform: none; box-shadow: none; }
button.link { min-height: 0; padding: 0; background: none; color: var(--accent-ink); font-weight: 600; text-decoration: underline; border-radius: 0; }
button.danger { background: var(--bad); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line); color: var(--text); text-decoration: none; font-size: .9rem; font-weight: 700;
  transition: background-color .2s ease, color .2s ease;
}
.chip:hover { background: var(--surface-2); text-decoration: none; }
.chip[aria-current="true"], .chip[aria-pressed="true"] { background: var(--text); color: var(--bg); box-shadow: none; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--muted); vertical-align: middle; }
.badge.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.badge.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.badge.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.badge.accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }

/* --------------------------------------------------------------- surfaces */

.card { background: var(--surface); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: inset 0 0 0 1px var(--line); }
.card > :last-child { margin-bottom: 0; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card.accent { background: var(--accent-soft); box-shadow: none; }
a.card { display: block; color: inherit; text-decoration: none; transition: transform .2s var(--ease), box-shadow .2s ease; }
a.card:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 2px var(--accent); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.split { display: grid; gap: 24px; align-items: start; }
@media (min-width: 960px) { .split { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); } }
.stack-sm > * + * { margin-top: 8px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.row.between { justify-content: space-between; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form, .row form { margin: 0; }
.stat { font-size: 2rem; font-weight: 900; font-stretch: 75%; line-height: 1; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 0 0 16px; }
.facts > div { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); border-radius: 14px; padding: 12px 14px; }
.facts dt { font-size: .78rem; color: var(--muted); }
.facts dd { margin: 0; font-size: 1.35rem; font-weight: 900; font-stretch: 88%; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h1 { margin: 6px 0 0; }

/* --------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; background: var(--surface-2); }
td.num, th.num { text-align: right; }
td.rank { font-weight: 900; font-stretch: 75%; font-size: 1.25rem; width: 3ch; }
tr.me td { background: var(--accent-soft); }
tr.me td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tr.dropped td { color: var(--muted); }

/* --------------------------------------------------------------- forms */

form.stack > div { margin-bottom: 16px; }
form.stack label, .field-label { display: block; font-weight: 700; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], input[type=date], input[type=url], input[type=search], select, textarea {
  width: 100%; max-width: 520px; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit;
}
textarea { min-height: 96px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 0; }
.helptext { display: block; color: var(--muted); font-size: .85rem; margin-top: 6px; }
ul.errorlist { color: var(--bad); padding-left: 18px; margin: 6px 0; }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.radio-row > div, form.inline-radios div > div { display: inline-block; margin-right: 12px; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); vertical-align: middle; }

/* Choice buttons: a radio group drawn as big tappable tiles. */
.choices { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); border: 0; padding: 0; margin: 0 0 16px; }
.choices legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.choices.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span {
  display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 56px; padding: 10px 14px; border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); font-weight: 800; text-align: center;
  transition: transform .12s ease, background-color .2s ease, box-shadow .2s ease, color .2s ease;
}
.choice small { font-weight: 500; color: var(--muted); font-size: .8rem; }
.choice input:checked + span { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.choice input:checked + span small { color: inherit; opacity: .8; }
.choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.choice input:active + span { transform: scale(.97); }
.choice.big span { min-height: 72px; font-size: 1.25rem; }

/* Pod seats: four tiles around a centre ring. */
.seats { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.seats .choice span { min-height: 120px; align-items: flex-start; justify-content: space-between; text-align: left; padding: 16px; font-size: 1.3rem; }
.seats .choice span em { font-style: normal; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.seats .choice input:checked + span em { color: inherit; }
.seats-ring { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; pointer-events: none; z-index: 1; font-weight: 900; font-stretch: 75%; font-size: 1.4rem; color: var(--accent-ink); }
.seats-ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 2px dashed var(--line); border-top-color: var(--accent); animation: spin 14s linear infinite; }
.seats.odd .seats-ring { display: none; }

/* --------------------------------------------------------------- messages */

.messages { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.messages li { padding: 14px 18px; border-radius: 14px; background: var(--surface); box-shadow: inset 4px 0 0 var(--muted), inset 0 0 0 1px var(--line); font-weight: 600; animation: rise .45s var(--ease) both; }
.messages .success { box-shadow: inset 4px 0 0 var(--good), inset 0 0 0 1px var(--line); }
.messages .error { box-shadow: inset 4px 0 0 var(--bad), inset 0 0 0 1px var(--line); }
.messages .warning { box-shadow: inset 4px 0 0 var(--warn), inset 0 0 0 1px var(--line); }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.6rem; letter-spacing: .08em; padding: 12px 16px; background: var(--surface-2); border: 2px dashed var(--accent); border-radius: 12px; display: inline-block; }

/* --------------------------------------------------------------- home */

.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: center; padding: 24px 0 40px; }
.hero > * { min-width: 0; }
@media (min-width: 900px) { .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); padding: 48px 0 64px; } }
.hero h1 { font-size: clamp(3rem, 10vw, 6.5rem); line-height: .86; margin: 16px 0 20px; }
.hero h1 .accent { color: var(--accent-ink); }
.hero .lede { margin-bottom: 24px; }
.hero .tcard { margin-top: 20px; }
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 16px; background: var(--surface-2); }
.tabs button { min-height: 40px; padding: 0 14px; border-radius: 12px; background: transparent; color: var(--muted); font-size: .92rem; }
.tabs button .dot { transition: transform .3s var(--ease); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 0 var(--line), 0 6px 18px -10px rgba(0, 0, 0, .35); }
.tabs button[aria-selected="true"] .dot { transform: scale(1.3); }
[data-panel][hidden] { display: none !important; }
[data-panel] { animation: rise .5s var(--ease) both; }

.fan { position: relative; height: 340px; perspective: 900px; }
@media (min-width: 900px) { .fan { height: 440px; } }
.fan .mtg-card {
  position: absolute; left: 50%; bottom: 10px; width: 190px; height: 266px; margin-left: -95px; border-radius: 14px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 85%, white), var(--accent) 45%, color-mix(in srgb, var(--accent) 55%, black));
  box-shadow: 0 30px 50px -24px rgba(0, 0, 0, .55), inset 0 0 0 7px rgba(17, 19, 21, .85), inset 0 0 0 8px rgba(255, 255, 255, .25);
  transform-origin: 50% 120%; transform: rotate(var(--r)) translateY(var(--y, 0));
  animation: deal .9s var(--ease) both, bob 6s ease-in-out infinite; animation-delay: var(--d), calc(var(--d) + 1s);
  transition: transform .35s var(--ease);
}
@media (min-width: 900px) { .fan .mtg-card { width: 230px; height: 322px; margin-left: -115px; } }
.fan .mtg-card::before { content: ""; position: absolute; left: 16px; right: 16px; top: 18px; height: 44%; border-radius: 6px; background: linear-gradient(135deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .08)); }
.fan .mtg-card::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 22px; height: 30%; border-radius: 6px; background: repeating-linear-gradient(180deg, rgba(17, 19, 21, .28) 0 3px, transparent 3px 14px); }
.fan .mtg-card:nth-child(1) { --r: -24deg; --d: .05s; filter: saturate(.7) brightness(.85); }
.fan .mtg-card:nth-child(2) { --r: -9deg; --d: .15s; filter: saturate(.85) brightness(.93); }
.fan .mtg-card:nth-child(3) { --r: 6deg; --d: .25s; }
.fan .mtg-card:nth-child(4) { --r: 21deg; --d: .35s; filter: brightness(1.05); }
.fan:hover .mtg-card:nth-child(1) { --r: -30deg; }
.fan:hover .mtg-card:nth-child(2) { --r: -12deg; --y: -12px; }
.fan:hover .mtg-card:nth-child(3) { --r: 8deg; --y: -24px; }
.fan:hover .mtg-card:nth-child(4) { --r: 28deg; }
.fan-glow { position: absolute; inset: 15% 10% 0; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 45%, transparent), transparent); filter: blur(30px); animation: breathe 5s ease-in-out infinite; }
@media (max-width: 719px) {
  /* On a phone the headline and the next tournament come first; the card fan is desktop decoration. */
  .hero { gap: 8px; padding: 8px 0 24px; }
  .hero h1 { font-size: clamp(2.6rem, 13vw, 3.4rem); margin: 14px 0 12px; }
  .fan { display: none; }
  .tabs { flex-wrap: wrap; overflow: visible; }
  .hero .actions .button { flex: 1; }
}

.steps { counter-reset: step; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: step; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--radius); padding: 20px; }
.steps li::before { content: counter(step); display: block; font-size: 2.5rem; font-weight: 900; font-stretch: 75%; color: var(--accent-ink); line-height: 1; margin-bottom: 8px; }
@media (max-width: 719px) {
  /* Number beside the text, so four steps fit on one phone screen. */
  .steps { gap: 8px; }
  .steps li { position: relative; padding: 14px 16px 14px 58px; }
  .steps li::before { position: absolute; left: 16px; top: 12px; font-size: 2rem; margin: 0; }
}

.band { background: var(--surface-2); border-radius: 28px; padding: 28px 20px; margin: 32px 0; }
@media (min-width: 720px) { .band { padding: 40px; } }
.band h2 { margin-top: 0; }

/* --------------------------------------------------------------- tournament cards and history */

.tcard { position: relative; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.tcard::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: var(--accent); opacity: .14; transition: transform .4s var(--ease); }
a.tcard:hover::after { transform: scale(1.6); }
.tcard h3 { font-size: 1.35rem; margin: 0; }
.tcard .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.winner { font-weight: 800; color: var(--accent-ink); }

/* --------------------------------------------------------------- my match */

.now { max-width: 560px; margin: 0 auto; }
.matchcard { position: relative; overflow: hidden; background: var(--surface); border-radius: 26px; padding: 22px; box-shadow: inset 0 0 0 1px var(--line); animation: rise .5s var(--ease) both; }
.matchcard::before { content: ""; position: absolute; inset: -40% -30% auto auto; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 35%, transparent), transparent); animation: breathe 5s ease-in-out infinite; pointer-events: none; }
.matchcard .table-no { font-size: clamp(6rem, 30vw, 9rem); font-weight: 900; font-stretch: 62%; line-height: .8; color: var(--accent-ink); text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 35%, transparent); }
.matchcard .vs { font-size: 2rem; font-weight: 900; font-stretch: 88%; line-height: 1.05; }
.clock { font-weight: 900; font-stretch: 75%; font-size: 2.4rem; line-height: 1; font-variant-numeric: tabular-nums; }
.clock.low { color: var(--warn); }
.clock.over { color: var(--bad); animation: pulse 1.2s ease-in-out infinite; }
.clock.paused { color: var(--muted); }
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; width: var(--p, 0%); background: var(--accent); transition: width 1s linear; }
.podmates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.podmates li { list-style: none; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-weight: 700; }
.podmates li small { display: block; color: var(--muted); font-weight: 500; }
.podmates { padding: 0; margin: 0 0 16px; }

.check { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); animation: pop .55s var(--ease) both; }

/* --------------------------------------------------------------- organiser console */

.console-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0 20px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.console-head .clock { font-size: 3rem; }
.counts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tables td.table-no { font-size: 1.8rem; font-weight: 900; font-stretch: 75%; width: 3ch; }
.tables tr.waiting td { background: color-mix(in srgb, var(--warn) 8%, transparent); }
.tables tr.done td { color: var(--muted); }
.tables tr.disputed td { background: color-mix(in srgb, var(--bad) 10%, transparent); }
.tables td { white-space: normal; vertical-align: middle; }
.tables td.act { text-align: right; white-space: nowrap; }
.inline-score { display: inline-flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.inline-score button { min-height: 40px; padding: 0 10px; font-size: .85rem; border-radius: 10px; }
details.enter > summary { list-style: none; cursor: pointer; display: inline-flex; }
details.enter > summary::-webkit-details-marker { display: none; }
details.enter[open] > summary { margin-bottom: 8px; }
.next-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--radius); padding: 18px 20px; margin-top: 16px; }
.next-bar.ready { box-shadow: inset 0 0 0 2px var(--accent); animation: glow 2.4s ease-in-out infinite; }
.player-list { list-style: none; padding: 0; margin: 0; }
.player-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; border-top: 1px solid var(--line); }
.player-list li:first-child { border-top: 0; }
.player-list form { margin: 0; }

/* --------------------------------------------------------------- big screen */

body.screen { --text: var(--cream); background: #0b0c0e; overflow: hidden; }
.screen-wrap { min-height: 100vh; padding: 4vh 5vw; display: flex; flex-direction: column; gap: 3vh; }
.screen-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.screen-head .eyebrow { font-size: clamp(1rem, 1.6vw, 2rem); color: var(--mist); text-transform: none; letter-spacing: 0; }
.screen-head h1 { font-size: clamp(3rem, 6vw, 6rem); margin: 0; }
.screen-head .clock { font-size: clamp(5rem, 11vw, 12rem); line-height: .82; animation: glowtext 3s ease-in-out infinite; }
.screen-rows { display: grid; gap: 1.4vh; }
.screen-rows.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.screen-row { display: grid; grid-template-columns: 9vw minmax(0, 1fr) auto; align-items: center; gap: 2vw; padding: 1.6vh 2vw; border-radius: 22px; background: #16181b; box-shadow: inset 0 0 0 2px transparent; animation: slide .6s var(--ease) both; animation-delay: var(--d, 0s); }
.screen-row .n { font-size: clamp(2.5rem, 5vw, 6rem); font-weight: 900; font-stretch: 62%; color: var(--accent); line-height: 1; }
.screen-row .who { font-size: clamp(1.4rem, 2.6vw, 3.2rem); font-weight: 800; line-height: 1.1; }
.screen-row .who span { color: #6b7078; font-weight: 400; }
.screen-row .st { font-size: clamp(1rem, 1.6vw, 2rem); font-weight: 800; color: #c9ccd1; text-align: right; }
.screen-row.waiting { box-shadow: inset 0 0 0 2px var(--accent); }
.screen-row.waiting .st { color: #ff9a66; animation: pulse 1.6s ease-in-out infinite; }
.screen-row.done { background: #101a14; }
.screen-row.done .n { color: #6b7078; }
.screen-row.done .st { color: #9fd8b4; }
.screen-foot { margin-top: auto; display: flex; justify-content: space-between; gap: 24px; color: var(--mist); font-size: clamp(1rem, 1.5vw, 1.8rem); }

/* --------------------------------------------------------------- motion */

.rise { animation: rise .55s var(--ease) both; animation-delay: var(--d, 0s); }
.d1 { --d: .05s; } .d2 { --d: .1s; } .d3 { --d: .15s; } .d4 { --d: .2s; } .d5 { --d: .25s; } .d6 { --d: .3s; }
.d7 { --d: .35s; } .d8 { --d: .4s; } .d9 { --d: .45s; } .d10 { --d: .5s; } .d11 { --d: .55s; } .d12 { --d: .6s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes slide { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes deal { from { opacity: 0; transform: translateY(70px) rotate(0deg); } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes breathe { 0%, 100% { opacity: .7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(.5); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes glow { 0%, 100% { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); } 50% { box-shadow: inset 0 0 0 2px var(--accent), 0 0 30px -6px color-mix(in srgb, var(--accent) 60%, transparent); } }
@keyframes glowtext { 0%, 100% { text-shadow: 0 0 0 transparent; } 50% { text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 50%, transparent); } }

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

/* --------------------------------------------------------------- fixes for small layouts */
.choices.cols-2 > .choice:last-child:nth-of-type(odd) { grid-column: 1 / -1; }
.row > input { flex: 1; min-width: 0; width: auto; }
.card .row > h2, .card .row > h3 { margin: 0; }
.tables td.act > * { display: inline-flex; vertical-align: middle; margin-left: 6px; }
.tables td.act details.enter[open] { display: block; margin-top: 8px; }
body.screen main { padding: 0; }
body.screen main > .wrap { max-width: none; padding: 0; }
.screen-foot > span:last-child { white-space: nowrap; }
form:has(input[name=schedule][value=one_night]:checked) .weeks-field { display: none; }
.choices.pods { display: block; }
.tabs { max-width: 100%; }
.tabs button { white-space: nowrap; flex: none; }

/* Installable app */
.app-icon { border-radius: 22%; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .45); flex: none; }
.install-steps { margin: 12px 0 0; padding-left: 1.3em; display: grid; gap: 8px; }
.install-ways .button, .install-ways button { margin-top: 4px; }
.app-promo { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
[hidden] { display: none !important; }
.app-promo img { border-radius: 22%; flex: none; }
.app-promo p { margin: 0; flex: 1; line-height: 1.35; }
/* Full screen on a phone: keep the header clear of the notch and status bar. */
.standalone header.site { padding-top: env(safe-area-inset-top); }
.standalone footer.site { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
