/* Sister site of Random Wheel: same light, same glass, same type.
   Layout idea: the bracket is the poster. The entrants and settings sit in a quiet glass rail beside it. */
:root {
  --paper: #080A1C;
  --panel: #15173A;
  --ink: #F3F1FF;
  --ink-soft: #B3B0D0;
  --line: #2D2F5C;
  --signal-ink: #1A1033;
  --focus: #B5A8FF;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-line: rgba(255, 255, 255, 0.13);
  --field: rgba(6, 8, 24, 0.55);
  --lift: 0 18px 50px -22px rgba(0, 0, 0, 0.8);
  --aurora: 0.55;
  --violet: #7B5CFF;
  --rose: #FF5C8A;
  --amber: #FFB627;
  --aqua: #2ED3C6;
  --font-display: "Bricolage Grotesque", "Trebuchet MS", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Segoe UI", Verdana, sans-serif;
  --radius: 20px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body {
  margin: 0; min-height: 100vh;
  background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; font-weight: 500; line-height: 1.5;
}
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The light behind everything */
body::before, body::after {
  content: ""; position: fixed; z-index: -1; pointer-events: none;
  width: 90vmax; height: 90vmax; border-radius: 50%; opacity: var(--aurora);
}
body::before {
  left: -30vmax; top: -38vmax;
  background: radial-gradient(closest-side, var(--violet), transparent 70%);
  animation: drift-a 26s ease-in-out infinite alternate;
}
body::after {
  right: -34vmax; bottom: -44vmax;
  background: radial-gradient(closest-side, var(--rose), transparent 68%), radial-gradient(closest-side at 30% 30%, var(--amber), transparent 60%);
  animation: drift-b 32s ease-in-out infinite alternate;
}
@keyframes drift-a { to { transform: translate(14vmax, 10vmax) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-12vmax, -9vmax) scale(1.1); } }

.shell { max-width: 1220px; margin: 0 auto; padding: 0 24px 64px; }

/* Header */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; padding: 22px 0 14px; }
.brand {
  font-family: var(--font-display); font-weight: 800; font-size: 23px; line-height: 1; letter-spacing: -0.02em;
  margin: 0; display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none;
}
.brand svg { flex: none; filter: drop-shadow(0 0 8px rgba(255, 92, 138, 0.55)); }
.modes { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line); }
.modes a {
  text-decoration: none; color: var(--ink); padding: 7px 16px; border-radius: 999px; font-weight: 700;
  transition: background 160ms ease, color 160ms ease;
}
.modes a:hover { background: var(--glass-line); }
.modes a[aria-current="page"] { background: linear-gradient(120deg, var(--violet), var(--rose)); color: #FFFFFF; }
.top-tools { margin-inline-start: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.btn {
  border: 1px solid var(--glass-line); background: var(--glass); color: var(--ink);
  border-radius: 12px; padding: 8px 14px; font-weight: 700; cursor: pointer; line-height: 1.2;
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}
.btn:hover { border-color: var(--violet); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.quiet { font-weight: 500; }
.btn[aria-pressed="true"] { background: color-mix(in srgb, var(--violet) 26%, transparent); border-color: var(--violet); }
.btn svg { flex: none; }
#markBtn svg { color: var(--amber); }
#siteShareBtn svg { color: var(--rose); }

/* Page title */
.head { padding: 6px 0 20px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 28px; }
.head > div:first-child { max-width: 760px; min-width: 0; flex: 1 1 420px; }
.spread { display: flex; gap: 8px; flex: none; }
.head h1 {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em;
  font-size: clamp(32px, 5.2vw, 56px); line-height: 1.02; margin: 0; text-wrap: balance;
}
.head p { margin: 10px 0 0; color: var(--ink-soft); font-size: 18px; max-width: 58ch; }

/* Main grid: the bracket takes the room, the rail stays narrow */
.work { display: grid; gap: 26px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }

/* The stage: the button, then the bracket */
.stage { display: flex; flex-direction: column; gap: 16px; min-width: 0; animation: arrive 700ms cubic-bezier(.2, .9, .2, 1) both; }
.go-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.go {
  position: relative; overflow: hidden; cursor: pointer;
  font-family: var(--font-display); font-weight: 800; font-size: 23px; letter-spacing: -0.01em;
  background: linear-gradient(120deg, var(--amber), var(--rose)); color: var(--signal-ink);
  border: 0; border-radius: 999px; padding: 15px 40px 15px;
  box-shadow: 0 14px 34px -12px var(--rose), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: transform 160ms cubic-bezier(.2, .8, .2, 1), box-shadow 160ms ease;
}
.go::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.6) 50%, transparent 62%);
  transform: translateX(-120%); animation: sheen 5s ease-in-out 1.2s infinite;
}
@keyframes sheen { 0%, 62% { transform: translateX(-120%); } 82%, 100% { transform: translateX(120%); } }
.go:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 20px 40px -12px var(--rose), inset 0 1px 0 rgba(255, 255, 255, 0.55); }
.go:active { transform: translateY(1px) scale(0.98); }
.go:disabled { opacity: 0.55; cursor: default; transform: none; }
.go:disabled::after { animation: none; }
.plan { margin: 0; font-weight: 700; font-size: 17px; min-width: 0; flex: 1 1 200px; }
.plan.warn { color: var(--amber); }
.ctl { display: flex; flex-wrap: wrap; gap: 8px; }
/* once a bracket is in play it gets the full width, and the setup steps out of the way */
body.playing .shell { max-width: 1560px; }
body.playing .work { grid-template-columns: minmax(0, 1fr); }
body.playing .only-setup { display: none; }
body.playing .rail { max-width: 440px; }

.bhead h2 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; font-size: clamp(24px, 3.2vw, 34px); line-height: 1.1; margin: 0; overflow-wrap: anywhere; }
.bhead p { margin: 2px 0 0; color: var(--ink-soft); font-weight: 700; font-size: 15px; }

/* The winner */
.champ {
  display: flex; align-items: center; gap: 14px; align-self: flex-start; max-width: 100%;
  background: linear-gradient(120deg, var(--amber), var(--rose)); color: var(--signal-ink);
  border-radius: 22px; padding: 12px 26px 12px 16px;
  box-shadow: 0 18px 44px -14px var(--rose), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.champ { position: relative; overflow: hidden; }
.champ.pop { animation: pop 620ms cubic-bezier(.2, 1.4, .3, 1) both; }
.champ.pop svg { transform-origin: 50% 90%; animation: trophy 1500ms cubic-bezier(.3, 1.5, .4, 1) 120ms both; }
.champ.pop::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.7) 50%, transparent 62%);
  transform: translateX(-120%); animation: sweep 1100ms ease-out 500ms 2 both;
}
@keyframes trophy { 0% { transform: scale(0) rotate(-28deg); } 40% { transform: scale(1.3) rotate(10deg); } 62% { transform: scale(1) rotate(-7deg); } 80% { transform: rotate(4deg); } 100% { transform: none; } }
@keyframes sweep { to { transform: translateX(120%); } }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 26; pointer-events: none; }
@keyframes pop { from { opacity: 0; transform: scale(0.7) translateY(10px); } }
.champ svg { flex: none; }
.champ div { display: flex; flex-direction: column; min-width: 0; }
.champ-k { font-size: 13px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.8; }
.champ strong { font-family: var(--font-display); font-weight: 800; font-size: clamp(24px, 3.4vw, 36px); line-height: 1.05; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.champ.tie strong { font-size: clamp(18px, 2.2vw, 22px); line-height: 1.25; }

/* Round robin standings */
.stand { background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--radius); box-shadow: var(--lift); padding: 6px 8px; overflow-x: auto; }
.stand table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.stand th, .stand td { padding: 7px 10px; text-align: right; white-space: nowrap; }
.stand th { font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); font-weight: 800; }
.stand td { border-top: 1px solid var(--glass-line); font-weight: 700; }
.stand th:nth-child(2), .stand td:nth-child(2) { text-align: left; width: 100%; white-space: normal; overflow-wrap: anywhere; }
.stand td:first-child, .stand th:first-child { color: var(--ink-soft); width: 34px; }
.stand tr.lead td { color: var(--amber); }

/* The bracket: a board that scrolls sideways when it is wider than the screen.
   On a sport page the board has that sport's playing surface behind it. */
.board { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--glass-line); box-shadow: var(--lift); }
.board .bscroll { border: 0; box-shadow: none; border-radius: 0; padding-bottom: 44px; }
/* the site's name rides inside the board, so it is in every screenshot, stream and full-screen view */
.board .mark { position: absolute; right: 18px; bottom: 10px; margin: 0; font-size: 15px; opacity: 0.92; pointer-events: none; }
.board.themed .mark { color: #FFFFFF; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 12px rgba(0, 0, 0, 0.7); }
.surface { position: absolute; inset: 0; }
.surface svg { display: block; width: 100%; height: 100%; }
/* round robin: the standings sit on the board, above the rounds, so the surface is behind both */
.board .stand { position: relative; margin: 18px 22px 0; max-width: 640px; background: color-mix(in srgb, var(--box, #171A40) 90%, transparent); border-color: var(--glass-line); }
.board.themed .stand { border-color: rgba(255, 255, 255, 0.3); box-shadow: 0 10px 22px -8px rgba(0, 0, 0, 0.85); }
.board.themed .bscroll { background: rgba(0, 0, 0, 0.14); padding-top: 24px; padding-bottom: 46px; }
body[data-theme] { --ink-soft: #CBC8C2; }
body[data-theme] .ln { stroke-width: 2.6; stroke-opacity: 0.9; }
body[data-theme] .rh { color: #FFFFFF; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 0, 0, 0.6); }
body[data-theme] .mt { border-color: rgba(255, 255, 255, 0.3); box-shadow: 0 10px 22px -8px rgba(0, 0, 0, 0.85); }
body[data-theme] .mt.ready { border-color: var(--aqua); box-shadow: 0 0 0 2px var(--aqua), 0 0 24px -2px var(--aqua); }
body[data-theme] .mt .no { color: #FFFFFF; }
.h1-ico { width: 0.92em; height: 0.92em; vertical-align: -0.12em; margin-right: 0.24em; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5)); }
.bscroll {
  position: relative; overflow: auto; border-radius: var(--radius); border: 1px solid var(--glass-line); box-shadow: var(--lift);
  padding: 20px 22px 24px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px) 0 0 / 100% 39px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px) 0 0 / 39px 100%,
    rgba(10, 12, 34, 0.62);
  scrollbar-color: var(--line) transparent;
}
.bsize { position: relative; margin: 0 auto; }
.bcanvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.bcanvas svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.ln { fill: none; stroke: var(--ln, #454878); stroke-width: 2; transition: stroke 240ms ease; }
.ln.on { stroke: var(--aqua); }
.rh {
  position: absolute; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 12.5px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-soft); line-height: 20px;
}
.mt {
  position: absolute; border-radius: 13px; background: var(--box, #171A40); border: 1px solid var(--glass-line);
  box-shadow: 0 10px 26px -16px rgba(0, 0, 0, 0.9); transition: border-color 200ms ease, box-shadow 200ms ease;
}
.mt .no {
  position: absolute; left: 10px; top: -9px; min-width: 20px; height: 17px; padding: 0 5px; border-radius: 999px;
  background: var(--line); color: var(--ink-soft); font-size: 11px; font-weight: 800; line-height: 17px; text-align: center; font-variant-numeric: tabular-nums;
}
.mt.ready { border-color: var(--aqua); box-shadow: 0 0 0 1px var(--aqua), 0 0 22px -4px color-mix(in srgb, var(--aqua) 70%, transparent); }
.mt.ready .no { background: var(--aqua); color: #06202A; }
.rw { display: flex; align-items: center; height: 50%; min-width: 0; position: relative; }
.rw + .rw { border-top: 1px solid var(--glass-line); }
.rw:first-of-type, .rw:first-of-type .pl { border-radius: 12px 12px 0 0; }
.rw:last-of-type, .rw:last-of-type .pl { border-radius: 0 0 12px 12px; }
.pl {
  flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: center; gap: 7px;
  background: none; border: 0; padding: 0 6px 0 8px; text-align: left; cursor: pointer; color: inherit;
}
.pl:disabled { cursor: default; }
.pl:not(:disabled):hover { background: rgba(255, 255, 255, 0.07); }
.sd { flex: none; width: 21px; text-align: right; font-size: 12px; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 15px; }
.sc {
  flex: none; width: 36px; height: 24px; margin-right: 5px; padding: 0; text-align: center;
  background: var(--field); border: 1px solid var(--glass-line); border-radius: 7px; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums;
}
.sc:disabled { opacity: 0.35; }
.sc:focus-visible { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 30%, transparent); }
.rw.tbd .nm { font-weight: 500; font-style: italic; color: var(--ink-soft); font-size: 14px; }
.rw.win { background: linear-gradient(100deg, color-mix(in srgb, var(--violet) 46%, transparent), color-mix(in srgb, var(--rose) 30%, transparent)); }
.rw.win::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--amber); border-radius: inherit; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.rw.win .nm { font-weight: 800; }
.rw.out .nm, .rw.out .sd { opacity: 0.45; }
.mt.still .pl:disabled, .mt.still .sc:disabled { opacity: 1; }
.mt.still .sc.blank { visibility: hidden; }
.mt.ghost { border-style: dashed; box-shadow: none; background: color-mix(in srgb, var(--box, #171A40) 62%, transparent); }
body[data-theme] .mt.ghost { box-shadow: none; background: color-mix(in srgb, var(--box) 80%, transparent); }
.mt.ghost .nm { color: var(--ink-soft); font-weight: 600; }
.deal .rw.in { animation: name-in 340ms cubic-bezier(.2, .9, .2, 1) both; }
@keyframes name-in { from { opacity: 0; transform: translateX(-14px); } }

.hint { margin: 0; font-size: 14px; color: var(--ink-soft); }
.mark { margin: 2px 0 0; text-align: center; font-family: var(--font-display); font-weight: 700; letter-spacing: 0.01em; font-size: 15px; color: var(--ink-soft); opacity: 0.8; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; }

.fs-exit {
  display: none; position: fixed; top: 14px; left: 14px; z-index: 30; width: 46px; height: 46px; padding: 0;
  justify-content: center; border-radius: 50%; background: var(--panel);
}
.stage:fullscreen, body.faux-full .stage {
  background: var(--paper); padding: 70px 28px 20px; overflow: auto; justify-content: flex-start;
}
body.faux-full .stage { position: fixed; inset: 0; z-index: 20; }
.stage:fullscreen .fs-exit, body.faux-full .fs-exit { display: inline-flex; }
.stage:fullscreen .go-row, body.faux-full .go-row, .stage:fullscreen .acts, body.faux-full .acts, .stage:fullscreen .hint, body.faux-full .hint { display: none; }

/* The glass rail */
.rail { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card {
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--radius);
  box-shadow: var(--lift); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.rail > .card { animation: settle 600ms cubic-bezier(.2, .8, .2, 1) both; }
.rail > .card:nth-child(1) { animation-delay: 120ms; }
.rail > .card:nth-child(2) { animation-delay: 190ms; }
@keyframes arrive { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
@keyframes settle { from { opacity: 0; transform: translateY(16px); } }
.card h2 { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin: 0; display: flex; align-items: center; gap: 10px; }
.pill {
  font-family: var(--font-body); font-size: 13px; font-weight: 700; color: #FFFFFF; border-radius: 999px; padding: 2px 11px;
  background: linear-gradient(120deg, var(--violet), var(--rose)); font-variant-numeric: tabular-nums;
}
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
textarea, .field input, .field select {
  background: var(--field); border: 1px solid var(--glass-line); border-radius: 12px; color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
textarea { width: 100%; min-height: 250px; resize: vertical; padding: 12px 14px; border-radius: 14px; line-height: 1.45; }
textarea.small { min-height: 84px; }
textarea:focus-visible, .field input:focus-visible, .field select:focus-visible {
  outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px color-mix(in srgb, var(--violet) 28%, transparent);
}
.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--ink-soft); }
.field input, .field select { padding: 8px 10px; font-size: 17px; }
.field select option { background: var(--panel); color: var(--ink); }
.note { font-size: 14px; color: var(--ink-soft); margin: 0; }
.example-flag { font-size: 13px; color: var(--ink-soft); border: 1px dashed var(--glass-line); border-radius: 8px; padding: 5px 9px; margin: 0; }
.check { display: flex; gap: 9px; align-items: center; font-size: 15.5px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--violet); flex: none; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--field); border: 1px solid var(--glass-line); }
.seg button {
  flex: 1 1 0; min-width: 0; border: 0; background: none; border-radius: 10px; padding: 8px 8px; font-weight: 700; cursor: pointer; line-height: 1.2;
  transition: background 160ms ease;
}
.seg button[aria-pressed="true"] { background: linear-gradient(120deg, var(--violet), var(--rose)); color: #FFFFFF; }
.step { display: flex; align-items: stretch; gap: 6px; }
.step input { width: 84px; text-align: center; font-size: 22px; font-weight: 800; padding: 6px 4px; background: var(--field); border: 1px solid var(--glass-line); border-radius: 12px; font-variant-numeric: tabular-nums; }
.step input:focus-visible { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px color-mix(in srgb, var(--violet) 28%, transparent); }
.step .btn { width: 48px; justify-content: center; font-size: 22px; padding: 0; }
.fold { border-top: 1px solid var(--glass-line); padding-top: 10px; }
.fold > summary { cursor: pointer; font-weight: 700; padding: 2px 0; }
.fold[open] > summary { margin-bottom: 10px; }
.fold > * + * { margin-top: 10px; }

.field input[type="text"] { width: 100%; }
.quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-soft); }
.quick span { flex-basis: 100%; }
.quick .btn { min-width: 46px; justify-content: center; padding: 6px 10px; font-weight: 700; }
.field > span { display: block; }
.btn.sure { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 22%, transparent); }
textarea:disabled, .seg button:disabled, .check input:disabled + span { opacity: 0.55; }
.seg button:disabled { cursor: default; }
.seg button { flex: 1 1 auto; white-space: nowrap; padding-inline: 6px; }

/* Text below the tool */
.about { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px 32px; margin-top: 44px; }
.about h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; font-size: 19px; margin: 0 0 6px; text-wrap: balance; }
.about p { margin: 0; color: var(--ink-soft); max-width: 46ch; }
.guide { margin-top: 40px; max-width: 820px; }
.guide h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; font-size: 23px; margin: 30px 0 6px; text-wrap: balance; }
.guide h3 { font-size: 17px; margin: 18px 0 4px; }
.guide p, .guide li { color: var(--ink-soft); max-width: 70ch; }
.guide p { margin: 0 0 10px; }
.guide ol, .guide ul { margin: 0 0 10px; padding-left: 22px; }
.guide li { margin-bottom: 4px; }
.jobs { margin-top: 30px; }
.jobs h3 { font-family: var(--font-display); font-weight: 700; font-size: 19px; margin: 0 0 6px; }
.jobs p { margin: 0 0 4px; line-height: 1.75; color: var(--ink-soft); }
.jobs b { color: var(--ink); }
.plist { list-style: none; padding: 0 !important; display: grid; gap: 8px; }
.plist li { margin: 0; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 12px; padding: 10px 14px; }
.jobs a, .guide a, .foot a, .doc a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.foot { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--glass-line); color: var(--ink-soft); font-size: 14px; }

/* Ads: two fixed spots, labelled, and invisible until Google fills them */
.ad { margin: 34px 0 0; text-align: center; min-width: 0; }
.ad-label { display: none; margin: 0 0 6px; font-size: 12px; color: var(--ink-soft); }
.ad:has(ins[data-ad-status="filled"]) .ad-label { display: block; }
.ad ins[data-ad-status="unfilled"] { display: none !important; }

/* About, contact, privacy and terms */
.doc { max-width: 70ch; margin: 10px 0 0; }
.doc h1 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.025em; font-size: clamp(28px, 5vw, 40px); line-height: 1.1; margin: 10px 0 4px; }
.doc h2 { font-size: 20px; margin: 30px 0 6px; }
.doc p, .doc ul { margin: 0 0 12px; }
.doc ul { padding-inline-start: 22px; }
.doc li { margin-bottom: 6px; }

.field.wide { width: 100%; }
.field.wide > span { color: var(--ink); font-weight: 700; }
.contact-form { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; max-width: 560px; margin: 0 0 14px; }
.contact-form .field input, .contact-form textarea { font-size: 16px; color: var(--ink); }
.contact-form .field input { padding: 9px 12px; }
.contact-form textarea { min-height: 170px; }
.contact-form .cf-turnstile { min-height: 65px; max-width: 100%; }
.contact-form .btn { background: linear-gradient(120deg, var(--violet), var(--rose)); color: #FFFFFF; border-color: transparent; padding: 10px 20px; }
.contact-form .note { margin: 0; }
.contact-form .note.bad { color: var(--rose); }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); border-radius: 999px; padding: 10px 20px; box-shadow: var(--lift);
  font-size: 15px; font-weight: 600; z-index: 40; max-width: calc(100% - 32px); opacity: 0; pointer-events: none;
  transition: opacity 160ms ease;
}
.toast.show { opacity: 1; }

@media (max-width: 1020px) {
  .work { grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
}
@media (max-width: 880px) {
  .shell { padding: 0 16px 48px; }
  .work { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  /* on a phone you type first, then press the button, then run the bracket */
  .rail { order: 1; }
  .stage { order: 2; }
  .head { padding-bottom: 14px; }
  .head p { font-size: 16px; }
  textarea { min-height: 170px; }
  /* the button rides at the bottom of the screen, so it is always one tap away while you type */
  body.has-go:not(.playing) .shell { padding-bottom: 104px; }
  body:not(.playing) .go { position: fixed; left: 16px; right: 16px; bottom: 14px; z-index: 15; padding: 14px 20px; }
  body.has-go:not(.playing) .toast { bottom: 88px; }
  body.playing .go { font-size: 19px; padding: 11px 26px; }
  .bscroll, .board .bscroll { padding: 18px 14px 42px; }
  .board .stand { margin: 14px 14px 0; }
  /* once the bracket is in play it comes first, and the setup moves below it */
  body.playing .rail { order: 3; max-width: none; }
}
@media (max-width: 600px) {
  .top { gap: 10px 12px; padding: 14px 0 10px; }
  .brand { font-size: 19px; }
  .modes { order: 3; width: 100%; }
  .modes a { flex: 1 1 0; text-align: center; padding: 7px 6px; font-size: 15px; white-space: nowrap; }
  .top-tools { gap: 6px; }
  .top-tools .btn { padding: 7px 10px; font-size: 14px; }
  .seg button { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  body::before, body::after, .go::after, .stage, .rail > .card, .deal .rw.in, .champ.pop, .champ.pop svg, .champ.pop::after { animation: none; }
  .btn, .go { transition: none; }
}
@media print {
  @page { size: landscape; margin: 10mm; }
  body { background: #FFFFFF; color: #000000; }
  body::before, body::after, .top, .head, .rail, .go-row, .acts, .hint, .about, .ad, .guide, .jobs, .foot, .toast, .fs-exit, .confetti { display: none !important; }
  .shell { max-width: none; padding: 0; }
  .work { display: block; }
  .stage { animation: none; }
  .bhead h2, .bhead p, .mark, .rh, .stand th, .stand td, .stand tr.lead td { color: #000000; }
  .champ { background: none; box-shadow: none; border: 2px solid #000000; color: #000000; }
  .stand, .board .stand, .board.themed .stand { background: none; border: 1px solid #999999; box-shadow: none; margin: 0 0 10px; }
  .stand td { border-color: #BBBBBB; }
  .board { overflow: visible; border: 0; box-shadow: none; }
  .surface { display: none; }
  .bscroll, .board.themed .bscroll { overflow: visible; background: none; border: 0; box-shadow: none; padding: 8px 0 0; }
  .h1-ico { display: none; }
  .board .mark, .board.themed .mark { position: static; text-align: right; text-shadow: none; color: #000000; margin-top: 8px; }
  .bsize { margin: 0; }
  .ln, .ln.on { stroke: #555555; }
  .mt, .mt.ready { background: #FFFFFF; border: 1px solid #555555; box-shadow: none; }
  .mt .no, .mt.ready .no { background: #FFFFFF; color: #000000; border: 1px solid #555555; line-height: 15px; }
  .rw + .rw { border-color: #999999; }
  .rw.win { background: none; }
  .rw.win::before { background: #000000; }
  .nm, .sd { color: #000000; }
  .rw.win .nm { font-weight: 800; text-decoration: underline; }
  .rw.out .nm, .rw.out .sd { opacity: 1; color: #666666; }
  .rw.tbd .nm { color: #777777; }
  .sc { background: none; border: 0; color: #000000; }
  .sc:disabled { opacity: 1; }
}
