/* WINF × FSCH tournament system — see docs/design (Stitch DESIGN.md).
   Light only: a warm paper canvas, ink borders and hard offset shadows instead of blur. */
:root {
  --paper: #FAF7F2;
  --card: #FFFFFF;
  --field: #F0EDE9;
  --soft: #E5E2DD;
  --ink: #1A1A1D;
  --text: #1C1C19;
  --muted: #6F5E5D;
  --red: #C8102E;
  --red-deep: #9E001F;
  --red-tint: #FCE9EA;
  --amber: #F2A900;
  --amber-tint: #FFF4D6;
  --green: #15803D;
  --green-tint: #E3F4E8;
  --shadow: 3px 3px 0 var(--ink);
  --shadow-sm: 2px 2px 0 var(--ink);
  --radius: .5rem;
  --radius-lg: 1rem;
  --radius-sm: .25rem;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tabbar-h: 4.25rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 1rem; line-height: 1.5;
       background: var(--paper); color: var(--text); }
a { color: var(--red); }
h1, h2, h3 { font-family: var(--display); text-transform: uppercase; line-height: 1.05;
             letter-spacing: -.01em; margin: 0 0 .75rem; overflow-wrap: break-word; hyphens: auto; }
h1 { font-size: 2.5rem; font-weight: 800; }
h2 { font-size: 1.75rem; font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: .02em; }
p { margin: 0 0 .75rem; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

/* ---------- Header, tabs, language ---------- */
.site-header { display: flex; align-items: center; gap: 1rem; padding: .75rem 1rem;
               background: var(--paper); border-bottom: 2px solid var(--ink);
               position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none;
         margin-right: auto; }
.brand-text { display: flex; flex-direction: column; font-family: var(--display); text-transform: uppercase; }
.brand-top { font-size: .8rem; font-weight: 700; letter-spacing: .1em; color: var(--red); }
.brand-bottom { font-size: 1.35rem; font-weight: 800; line-height: 1; }
/* The 4-3-2-1 cup rack, shrunk to a 3-2-1 logo mark. */
.cup-mark { display: grid; grid-template-columns: repeat(6, .4rem); grid-auto-rows: .4rem; gap: .12rem;
            width: 2.6rem; height: 2.6rem; place-content: center; background: var(--red);
            border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.cup-mark i { width: .4rem; height: .4rem; border-radius: 50%; background: var(--paper); justify-self: center; }
.cup-mark i:nth-child(1) { grid-column: 1 / span 2; } .cup-mark i:nth-child(2) { grid-column: 3 / span 2; }
.cup-mark i:nth-child(3) { grid-column: 5 / span 2; } .cup-mark i:nth-child(4) { grid-column: 2 / span 2; }
.cup-mark i:nth-child(5) { grid-column: 4 / span 2; } .cup-mark i:nth-child(6) { grid-column: 3 / span 2; }

.lang-toggle { display: flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden;
               font-family: var(--display); font-weight: 700; letter-spacing: .08em; }
.lang-toggle a { padding: .35rem .7rem; color: var(--text); text-decoration: none; min-width: 2.6rem;
                 text-align: center; }
.lang-toggle a[aria-current] { background: var(--ink); color: var(--paper); }

.tabbar { display: flex; gap: .25rem; }
.tab { display: flex; align-items: center; gap: .4rem; padding: .45rem .7rem; border-radius: var(--radius);
       color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 700;
       text-transform: uppercase; letter-spacing: .06em; font-size: .95rem; border: 2px solid transparent; }
.tab svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8;
           stroke-linecap: round; stroke-linejoin: round; }
.tab:hover { border-color: var(--ink); }
.tab.active { background: var(--red); color: var(--paper); border-color: var(--ink); box-shadow: var(--shadow-sm); }

main { padding: 1.5rem 1rem 2rem; max-width: 1280px; margin: 0 auto; }
.site-footer { padding: 1rem; text-align: center; font-family: var(--display); font-weight: 700;
               text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; color: var(--muted); }

@media (max-width: 899px) {
  body { padding-bottom: var(--tabbar-h); }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; justify-content: space-around;
            background: var(--paper); border-top: 2px solid var(--ink); padding: .4rem .25rem
            calc(.4rem + env(safe-area-inset-bottom)); gap: 0; }
  .tab { flex: 1; flex-direction: column; gap: .15rem; padding: .35rem .1rem; font-size: .72rem;
         letter-spacing: .04em; justify-content: center; text-align: center; }
  .tab.active { box-shadow: none; }
  h1 { font-size: 2.25rem; }
}

/* ---------- Building blocks ---------- */
.card { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius-lg);
        box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.25rem; }
.card-soft { background: var(--field); border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: 1.25rem; }
.lead { font-size: 1.125rem; color: var(--text); }
.muted { color: var(--muted); }
.label { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
         font-size: .9rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .5rem;
        border-radius: var(--radius-sm); font-family: var(--display); font-weight: 700; font-size: .8rem;
        text-transform: uppercase; letter-spacing: .08em; background: var(--soft); color: var(--text);
        white-space: nowrap; }
.chip-live { background: var(--red); color: #fff; }
.chip-live::before { content: ""; width: .4rem; height: .4rem; border-radius: 50%; background: #fff;
                     animation: blink 1.2s steps(2, start) infinite; }
.chip-call { background: var(--amber); color: var(--ink); }
.chip-done { background: var(--green); color: #fff; }
.chip-lost { background: var(--red-tint); color: var(--red-deep); }
@keyframes blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .chip-live::before { animation: none; } }

.stack { display: flex; flex-direction: column; gap: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: .75rem 0; }
.inline { display: inline; }
.big { font-family: var(--display); font-size: 1.75rem; font-weight: 800; text-transform: uppercase; }
.alert { color: var(--red); }
.error { background: var(--red-tint); border: 2px solid var(--red); border-radius: var(--radius);
         padding: .75rem 1rem; color: var(--red-deep); font-weight: 600; }
.flash { border: 2px solid var(--ink); border-radius: var(--radius); padding: .6rem 1rem; font-weight: 600;
         box-shadow: var(--shadow-sm); }
.flash-ok { background: var(--green-tint); border-color: var(--green); }
.flash-error { background: var(--red-tint); border-color: var(--red); }

/* ---------- Forms & buttons ---------- */
label { display: flex; flex-direction: column; gap: .4rem; }
.field-label { display: flex; justify-content: space-between; align-items: baseline;
               font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.required { color: var(--red); font-size: .8rem; letter-spacing: .1em; }
.hint { font-size: .875rem; color: var(--muted); }
input, select, textarea { font: inherit; font-size: 1.05rem; padding: .85rem 1rem; min-height: 3.25rem;
                          border: 2px solid var(--soft); border-radius: var(--radius); background: var(--field);
                          color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--red); outline-offset: 0; border-color: var(--ink);
                            background: var(--card); }
textarea { min-height: 8rem; resize: vertical; }
input::placeholder { color: #9b8f8c; }
.check { flex-direction: row; align-items: flex-start; gap: .85rem; background: var(--field);
         border-radius: var(--radius); padding: 1rem; }
.check input { width: 1.4rem; height: 1.4rem; min-height: 0; margin: .15rem 0 0; accent-color: var(--ink); }
.check strong { display: block; }

fieldset.choice { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr; gap: .6rem; }
@media (min-width: 640px) { fieldset.choice { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
fieldset.choice legend { width: 100%; margin-bottom: .4rem; }
fieldset.choice .hint { grid-column: 1 / -1; }
.choice-option { flex-direction: row; align-items: center; gap: .5rem; background: var(--field); border: 2px solid var(--soft);
                 border-radius: var(--radius); padding: .85rem .8rem; font-weight: 700; cursor: pointer; }
.choice-option:has(input:checked) { border-color: var(--ink); background: var(--card); box-shadow: var(--shadow-sm); }
.choice-option span { white-space: nowrap; }
.choice-option input { width: 1.3rem; height: 1.3rem; min-height: 0; margin: 0; accent-color: var(--red); }
button, .button { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
                  font-size: 1.05rem; min-height: 3rem; padding: .6rem 1.1rem; cursor: pointer;
                  border: 2px solid var(--ink); border-radius: var(--radius); background: var(--card);
                  color: var(--text); box-shadow: var(--shadow-sm); text-decoration: none;
                  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
                  transition: transform .05s, box-shadow .05s; }
button:active, .button:active { transform: translate(2px, 2px); box-shadow: none; }
button.primary, .button.primary { background: var(--red); color: var(--paper); box-shadow: var(--shadow); }
button.win { background: var(--green); color: #fff; box-shadow: var(--shadow); }
button.big, .button.big { width: 100%; min-height: 4.25rem; font-size: 1.6rem; }
.button[aria-disabled="true"] { background: var(--soft); color: var(--muted); border-color: var(--muted);
                               box-shadow: none; cursor: not-allowed; }
.signup-locked { display: flex; flex-direction: column; gap: 1rem; }
button.link { background: none; border: none; box-shadow: none; color: var(--red); padding: 0; min-height: 0;
              text-decoration: underline; font-size: .95rem; }

/* ---------- Registration ---------- */
.hero h1 { font-size: 3.5rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: .5rem; }
.capacity-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem;
                 font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 1.35rem; }
.capacity-head .dot-live { display: inline-block; width: .9rem; height: .9rem; border-radius: 50%;
                           background: var(--red); border: 2px solid var(--ink); margin-right: .4rem;
                           vertical-align: -.05rem; }
.meter { height: .5rem; background: var(--soft); border-radius: 999px; margin: .85rem 0 1rem; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--red); }
.legend { display: flex; justify-content: space-between; gap: 1rem; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend i { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; }
.cups { display: grid; grid-template-columns: repeat(8, 1fr); gap: .6rem; background: var(--card);
        border-radius: var(--radius); padding: 1rem; margin-top: .75rem; justify-items: center; }
.cup { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--soft);
       box-shadow: inset 0 0 0 .3rem var(--soft), inset 0 0 0 .45rem #fff; }
.cup.taken { background: var(--red); box-shadow: inset 0 0 0 .3rem var(--red), inset 0 0 0 .45rem #fff; }
.form-title { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }

/* ---------- Team status ---------- */
.callout { border: 3px solid var(--ink); border-radius: var(--radius-lg); background: var(--card);
           box-shadow: var(--shadow); overflow: hidden; margin-bottom: 1.25rem; }
.callout-stripe { height: .75rem; border-bottom: 2px solid var(--ink);
                  background: repeating-linear-gradient(-45deg, var(--red) 0 12px, var(--amber) 12px 24px); }
.callout-body { padding: 1.25rem; }
.callout.go-now { background: var(--amber-tint); }
.table-callout { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.table-number-xl { font-family: var(--display); font-weight: 900; font-size: 5.5rem; line-height: .85;
                   letter-spacing: -.03em; color: var(--red); }
.vs-chip { display: inline-block; font-family: var(--display); font-weight: 800; font-size: .8rem;
           padding: .1rem .45rem; border: 2px solid var(--ink); border-radius: var(--radius-sm);
           background: var(--ink); color: var(--paper); letter-spacing: .08em; }
.opponent { font-family: var(--display); font-weight: 800; font-size: 1.6rem; text-transform: uppercase; }
.history { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.history li { display: flex; justify-content: space-between; gap: .75rem; align-items: center;
              background: var(--card); border: 2px solid var(--soft); border-radius: var(--radius);
              padding: .6rem .85rem; }

/* ---------- Lists ---------- */
.team-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.card-link { display: flex; align-items: center; justify-content: space-between; gap: .75rem;
             padding: 1rem 1.1rem; min-height: 3.5rem; background: var(--card); color: var(--text);
             border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-sm);
             text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.3rem;
             text-transform: uppercase; }
.card-link:active { transform: translate(2px, 2px); box-shadow: none; }
.card-link .chip { font-size: .75rem; }
.search { display: flex; gap: .6rem; margin-bottom: 1rem; }
.search input { flex: 1; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }

/* ---------- Match cards ---------- */
.match-box { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius);
             box-shadow: var(--shadow-sm); font-size: .9rem; overflow: hidden; }
.match-box.status-in_progress { border-top: 4px solid var(--red); }
.match-box.status-assigned { border-top: 4px solid var(--amber); background: var(--amber-tint); }
.match-head { display: flex; justify-content: space-between; align-items: center; gap: .4rem;
              padding: .3rem .5rem; font-family: var(--display); font-weight: 700; font-size: .75rem;
              text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.match-head .chip { font-size: .68rem; padding: .05rem .35rem; }
.match-head .where { color: var(--text); font-weight: 800; font-size: .85rem; }
.team-line { display: flex; justify-content: space-between; gap: .5rem; padding: .35rem .55rem;
             font-family: var(--display); font-weight: 700; font-size: 1.05rem; text-transform: uppercase;
             margin: 0 .3rem .3rem; border-radius: var(--radius-sm); background: var(--field); }
.team-line.winner { color: var(--red); background: var(--red-tint); }
.team-line.winner::after { content: "→"; color: var(--green); }
.team-line.loser { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.team-line.empty { color: var(--muted); font-style: italic; font-weight: 600; text-transform: none;
                   font-family: var(--body); font-size: .85rem; }

/* ---------- Mirrored bracket: both halves play towards the final in the middle.
   Each pair fills an equal share of its column so connectors can be plain borders. ---------- */
.bracket { --gap: 1.5rem; --line: var(--ink); display: flex; align-items: stretch; gap: var(--gap);
           overflow-x: auto; padding: .25rem .25rem 1rem; }
.bracket-round { display: flex; flex-direction: column; min-width: 11rem; flex: 1 0 11rem; }
.bracket-round > h3 { margin: 0 0 .75rem; font-size: 1rem; text-align: center; padding: .4rem;
                      background: var(--soft); border-radius: var(--radius); letter-spacing: .06em; }
.round-body { flex: 1; display: flex; flex-direction: column; }
.pair { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: .75rem;
        padding: .4rem 0; position: relative; }
.pair::after, .pair::before { content: ""; position: absolute; border-color: var(--line); border-style: solid;
                              border-width: 0; }
.side-left .pair::after { right: calc(var(--gap) / -2); width: calc(var(--gap) / 2); top: 25%; bottom: 25%;
                          border-width: 2px 2px 2px 0; border-radius: 0 6px 6px 0; }
.side-left .pair::before { right: calc(var(--gap) * -1); width: calc(var(--gap) / 2); top: 50%;
                           border-top-width: 2px; }
.side-right .pair::after { left: calc(var(--gap) / -2); width: calc(var(--gap) / 2); top: 25%; bottom: 25%;
                           border-width: 2px 0 2px 2px; border-radius: 6px 0 0 6px; }
.side-right .pair::before { left: calc(var(--gap) * -1); width: calc(var(--gap) / 2); top: 50%;
                            border-top-width: 2px; }
.pair-single::after { display: none; }
.side-left .pair-single::before { right: calc(var(--gap) * -1); width: var(--gap); }
.side-right .pair-single::before { left: calc(var(--gap) * -1); width: var(--gap); }
.bracket-center { min-width: 13rem; }
.bracket-center > h3 { background: var(--red); color: var(--paper); border: 2px solid var(--ink); }
.bracket-center .round-body { justify-content: center; position: relative; }
.final-box .match-box { border-width: 3px; box-shadow: var(--shadow); }
.final-box .team-line { font-size: 1.2rem; }
.third-place { position: absolute; left: 0; right: 0; top: calc(50% + 4.25rem); }
.third-place h3 { font-size: .9rem; text-align: center; margin-bottom: .4rem; color: var(--muted); }

/* ---------- Tables (admin) ---------- */
.table-scroll { overflow-x: auto; border: 2px solid var(--ink); border-radius: var(--radius);
                box-shadow: var(--shadow-sm); background: var(--card); }
table.data { border-collapse: collapse; width: 100%; }
table.data th { font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; text-align: left;
                background: var(--soft); padding: .6rem; border-bottom: 2px solid var(--ink); }
table.data td { padding: .6rem; border-bottom: 1px solid var(--soft); vertical-align: top; }
table.data select, table.data input { min-height: 2.6rem; padding: .4rem .6rem; font-size: .95rem; }
table.data button { min-height: 2.6rem; font-size: .9rem; }
.admin-nav { border-bottom: 2px solid var(--ink); padding-bottom: .75rem; }
.admin-nav a { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
               color: var(--text); text-decoration: none; padding: .35rem .6rem; border-radius: var(--radius);
               border: 2px solid transparent; }
.admin-nav a[aria-current] { border-color: var(--ink); background: var(--card); box-shadow: var(--shadow-sm); }
.admin-match { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius);
               box-shadow: var(--shadow-sm); padding: .85rem 1rem; margin-bottom: .75rem; }
.admin-match.status-in_progress { border-left: 6px solid var(--red); }
.admin-match.status-assigned { border-left: 6px solid var(--amber); }
.admin-match.status-done { border-left: 6px solid var(--green); }
details summary { cursor: pointer; font-family: var(--display); font-weight: 700; text-transform: uppercase;
                  letter-spacing: .06em; }
code.big { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .15em; font-size: 1.3rem; }

/* ---------- Referee desk ---------- */
.desk-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem;
             margin-bottom: 1rem; }
.chip-desk { background: var(--amber); color: var(--ink); font-size: .9rem; padding: .3rem .7rem; }
.ref-match { text-align: center; }
.ref-match .teams { display: grid; gap: .5rem; margin: 1rem 0; }
.ref-match .team-big { font-family: var(--display); font-weight: 800; font-size: 2rem; text-transform: uppercase;
                       line-height: 1; }
.code-input { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 1.6rem; letter-spacing: .3em;
              text-transform: uppercase; text-align: center; }

/* ---------- Projector board: must fit 1920×1080 without scrolling, read from across the
   room. The board fills the viewport and the bracket takes whatever height is left. ---------- */
body.screen main { max-width: none; height: 100vh; display: flex; flex-direction: column; padding: .75rem 2rem; }
body.screen main > div[hx-get] { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.board-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem;
              border-bottom: 3px solid var(--ink); padding-bottom: .4rem; margin-bottom: .6rem; }
.board-head h1 { font-size: 2.6rem; margin: 0; padding-left: .9rem; border-left: .5rem solid var(--red); }
.board-head .label { color: var(--red); }
.board { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr; grid-template-rows: auto auto 1fr;
         gap: .75rem; }
.board-panel { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius-lg);
               box-shadow: var(--shadow); padding: .6rem .9rem; }
.board-panel > h2 { display: flex; align-items: center; gap: .6rem; font-size: 1.3rem; margin-bottom: .5rem; }
.board-calls { display: grid; grid-template-columns: 3fr 1fr; gap: 1.25rem; }
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .6rem; }
.table-cell { border: 2px solid var(--ink); border-radius: var(--radius); background: var(--card); overflow: hidden;
              box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.table-cell .cell-head { display: flex; justify-content: space-between; align-items: center; padding: .25rem .5rem;
                         border-bottom: 2px solid var(--ink); background: var(--soft); }
.table-cell .cell-head .label { font-size: .7rem; text-align: right; line-height: 1.1; }
.table-cell .cell-num { font-family: var(--display); font-weight: 900; font-size: 1.4rem; line-height: 1;
                        text-transform: uppercase; white-space: nowrap; }
.table-cell .cell-body { padding: .4rem .5rem; font-family: var(--display); font-weight: 800; font-size: 1.05rem;
                         text-transform: uppercase; line-height: 1.1; }
.table-cell .cell-body .vs { display: block; font-size: .8rem; color: var(--muted); margin: .2rem 0; }
.table-cell.status-assigned .cell-head { background: var(--amber); }
.table-cell.status-in_progress .cell-head { background: var(--red); color: var(--paper); }
.table-cell.free .cell-body { color: var(--muted); }
.table-cell.inactive { opacity: .45; }
.next-line { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .35rem 0;
             border-bottom: 2px solid var(--soft); font-family: var(--display); font-weight: 700;
             text-transform: uppercase; font-size: 1rem; }
.next-line:last-child { border-bottom: 0; }
.next-line small { display: block; font-size: .8rem; color: var(--muted); letter-spacing: .06em; }
/* Compact bracket: status shows as a coloured edge instead of a header row. */
.board-bracket { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.board-bracket .bracket { --gap: 1rem; flex: 1; min-height: 0; padding-bottom: 0; }
.board-bracket .bracket-round { min-width: 9rem; flex-basis: 9rem; }
.board-bracket .bracket-round > h3 { font-size: .8rem; padding: .2rem; margin-bottom: .35rem; }
.board-bracket .match-head { display: none; }
.board-bracket .match-box { border-width: 2px; box-shadow: none; }
.board-bracket .match-box.status-in_progress { border-left: 5px solid var(--red); border-top-width: 2px; }
.board-bracket .match-box.status-assigned { border-left: 5px solid var(--amber); border-top-width: 2px; }
.board-bracket .team-line { font-size: .82rem; padding: .08rem .35rem; margin: .15rem; }
.board-bracket .pair { gap: .25rem; padding: .1rem 0; }
.board-bracket .third-place { top: calc(50% + 2.6rem); }
@media (max-width: 1100px) { .board-calls { grid-template-columns: 1fr; } }

/* ---------- Splash: two columns on desktop; on phones the call to action comes right
   after the title, details below ---------- */
.splash { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; align-items: start;
          grid-template-areas: "hero" "side" "facts" "info"; }
.splash > * { margin-bottom: 0; }
.splash .hero h1 { margin-top: .6rem; }
.splash-hero { grid-area: hero; } .splash-side { grid-area: side; }
.splash-facts { grid-area: facts; } .splash-info { grid-area: info; }
.facts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.fact { margin: 0; }
.fact p { margin: .15rem 0; }
.fact-big { font-family: var(--display); font-weight: 800; font-size: 2rem; text-transform: uppercase; line-height: 1.05; }
.info-text p:last-child { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.stats > div { display: flex; flex-direction: column; background: var(--field); border-radius: var(--radius); padding: .6rem .8rem; }
.stat-num { font-family: var(--display); font-weight: 900; font-size: 2.6rem; line-height: 1; }
.signup { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (min-width: 900px) {
  .splash { grid-template-columns: minmax(0, 1.6fr) minmax(20rem, 1fr); gap: 1.5rem 2.5rem;
            grid-template-areas: "hero side" "facts side" "info side"; grid-template-rows: auto auto 1fr; }
  .splash-side { position: sticky; top: 6rem; }
  .facts { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 4.5rem; }
  .signup { grid-template-columns: minmax(18rem, 1fr) minmax(0, 1.4fr); gap: 2rem; }
  .signup > .card-soft { position: sticky; top: 6rem; }
}

/* ---------- Page widths: the full bracket is a desktop view (a 32-team draw fits a laptop
   screen), the referee desk a phone view ---------- */
body.wide main { max-width: none; padding-left: 2rem; padding-right: 2rem; }
body.wide .bracket { --gap: 1.25rem; }
body.wide .bracket-round { min-width: 8rem; flex-basis: 8rem; }
body.wide .bracket-center { min-width: 10rem; }
body.wide .team-line { font-size: .95rem; }
body.phone main { max-width: 30rem; }

/* ---------- Organiser dashboard ---------- */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .9rem; margin-bottom: 1.25rem; }
.stat-tile { display: flex; flex-direction: column; gap: .25rem; background: var(--card); border: 2px solid var(--ink);
             border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: .8rem 1rem; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem 1.25rem; }

/* ---------- Legal pages ---------- */
.legal { max-width: 52rem; }
.legal h2 { font-size: 1.35rem; margin-top: 1.5rem; }
.legal ul { padding-left: 1.25rem; }
.legal li { margin-bottom: .4rem; }
.fill-in { background: var(--amber); color: var(--ink); padding: 0 .3rem; border-radius: var(--radius-sm); font-weight: 700; }
.legal-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem; margin-top: .5rem; }
.legal-links a { color: var(--muted); }

/* Two-step confirmation (app.js): the question appears above the armed button. */
.confirm-note { flex-basis: 100%; margin: 0 0 .4rem; padding: .5rem .75rem; font-weight: 600;
                background: var(--red-tint); border: 2px solid var(--red); border-radius: var(--radius); }
button.armed { background: var(--red); border-color: var(--ink); color: var(--paper); }

/* Honeypot: invisible to people, still in the DOM for form-filling bots. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Podium after the final (splash page and projector). */
.podium h2 { margin: 0 0 .75rem; }
.podium ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.podium li { display: flex; align-items: center; gap: .75rem; padding: .6rem .8rem; font-weight: 700;
             border: 2px solid var(--ink); border-radius: var(--radius); background: var(--paper); }
.podium .place { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%;
                 font-family: var(--display); font-size: 1.3rem; background: var(--ink); color: var(--paper); }
.podium .place-1 { background: var(--red); color: var(--paper); font-size: 1.25rem; }
.podium .place-1 .place { background: var(--paper); color: var(--red); }
.podium-name { overflow-wrap: anywhere; }
.screen .podium { max-width: 60rem; margin: 2rem auto; font-size: 2rem; }
.screen .podium .place { width: 4rem; height: 4rem; font-size: 2.4rem; }

/* Referee match timer (app.js); turns red once the planned match length is over. */
.match-timer { font-family: var(--display); font-size: 2.6rem; font-weight: 700; text-align: center;
               margin: .25rem 0 0; font-variant-numeric: tabular-nums; }
.match-timer.over { color: var(--red); }
