/* Lepenica — tote-board aesthetic: ink ground, amber phosphor numerals, ticket stubs. */

@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@500;700;800&family=Archivo:wght@400;500;600;700&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=JetBrains+Mono:wght@400;600;800&display=swap');

:root {
    --ink: #0b0d0a;
    --ink-2: #12150f;
    --ink-3: #1a1e17;
    --line: #2b3126;
    --paper: #ece5d5;
    --muted: #8b9182;
    --amber: #ffb020;
    --amber-dim: #7a5510;
    --signal: #86e05a;
    --loss: #e0553f;
    --void: #6f7a8a;

    --display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
    --statute: 'EB Garamond', 'Iowan Old Style', Georgia, serif;
    --body: 'Archivo', 'Helvetica Neue', sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;

    --stub: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background:
        radial-gradient(1200px 600px at 70% -10%, #1c2118 0%, transparent 60%),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, .012) 0 1px, transparent 1px 3px),
        var(--ink);
    color: var(--paper);
    font: 15px/1.55 var(--body);
    letter-spacing: .01em;
    min-height: 100vh;
}

/* Faint grain so the flat black reads as printed stock, not a void. */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
    z-index: 99;
}

a { color: var(--amber); }

/* ---------- chrome ---------- */

header.bar {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 0 28px;
    height: 66px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 176, 32, .05), transparent), var(--ink-2);
    position: sticky;
    top: 0;
    z-index: 50;
}

.wordmark {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex: 0 0 auto;
}

/* Served at 2x and drawn at half, so it stays crisp on a phone. */
.wordmark img {
    height: 30px;
    width: auto;
    display: block;
}

.gate-logo {
    height: 42px;
    width: auto;
    display: block;
    margin-bottom: 4px;
}

nav {
    display: flex;
    gap: 4px;
    margin-right: auto;
    min-width: 0;   /* a flex child will not shrink below its content without this */
}

nav a {
    font-family: var(--display);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    padding: 6px 14px 4px;
    border: 1px solid transparent;
    transition: color .15s, border-color .15s, background .15s;
}

nav a:hover { color: var(--paper); border-color: var(--line); }

nav a[aria-current='page'] {
    color: var(--ink);
    background: var(--amber);
    border-color: var(--amber);
}

.whoami {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
}

.whoami .name { font-weight: 600; color: var(--paper); text-decoration: none; }
.whoami .name:hover { color: var(--amber); }

/* Sortable table headings. */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--paper); }
th.sortable[aria-sort] { color: var(--amber); }
th.sortable[aria-sort]::after { content: ' \25BE'; }
th.sortable[aria-sort='ascending']::after { content: ' \25B4'; }

td.pos { color: var(--signal); }
td.neg { color: var(--loss); }

.rank {
    font-family: var(--mono);
    font-weight: 600;
    color: var(--muted);
}

.rank.top { color: var(--amber); }

.whoami .role {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .14em;
    padding: 3px 7px;
    border: 1px solid var(--line);
    color: var(--muted);
    text-transform: uppercase;
}

.whoami .role.ADMIN { color: var(--amber); border-color: var(--amber-dim); }
.whoami .role.MODERATOR { color: var(--signal); border-color: #38571f; }

.wallet {
    font-family: var(--mono);
    font-weight: 600;
    font-size: 14px;
    color: var(--amber);
}

main { max-width: 1180px; margin: 0 auto; padding: 34px 28px 90px; }

/* ---------- headings ---------- */

.eyebrow {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 10px;
}

h1, h2 {
    font-family: var(--display);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
    line-height: .95;
    margin: 0;
}

h1 { font-size: 46px; }
h2 { font-size: 27px; margin: 44px 0 16px; }

.rule {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 14px 0 0;
}

/* ---------- the round ---------- */

.round {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    margin-top: 22px;
}

.round > * { background: var(--ink-2); padding: 26px 28px; }

.fixture { display: flex; align-items: center; gap: 22px; }

.fixture .team {
    font-family: var(--display);
    font-size: 42px;
    font-weight: 800;
    text-transform: uppercase;
    line-height: .9;
    flex: 1;
}

.fixture .team.away { text-align: right; }

.fixture .v {
    font-family: var(--mono);
    color: var(--amber);
    font-size: 13px;
    letter-spacing: .2em;
}

.kickoff {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px dashed var(--line);
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}

.countdown { color: var(--paper); font-weight: 600; }

/* The pot: the one number everybody stares at. */
.pot {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        radial-gradient(120% 100% at 50% 0%, rgba(255, 176, 32, .12), transparent 70%),
        var(--ink-3) !important;
}

.pot .amount {
    font-family: var(--mono);
    font-weight: 800;
    font-size: clamp(28px, 2.6vw, 40px);
    line-height: 1;
    white-space: nowrap;
    color: var(--amber);
    text-shadow: 0 0 26px rgba(255, 176, 32, .45);
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.pot .amount .cur {
    font-family: var(--body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .1em;
    margin-left: 8px;
    opacity: .65;
    text-shadow: none;
}

.pot .amount.flash { animation: flash .7s ease-out; }

@keyframes flash {
    0% { color: #fff; text-shadow: 0 0 40px rgba(255, 255, 255, .8); }
    100% { color: var(--amber); text-shadow: 0 0 26px rgba(255, 176, 32, .45); }
}

.pot .breakdown {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    display: grid;
    gap: 5px;
}

.pot .breakdown b { color: var(--paper); font-weight: 600; float: right; }

.venue {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .06em;
    color: var(--muted);
}

/* What the pasted link turned out to be, before the round is opened on it. */
.fixture-found {
    display: flex;
    gap: 14px;
    align-items: baseline;
    flex-wrap: wrap;
    border: 1px solid var(--amber-dim);
    background: rgba(255, 176, 32, .06);
    padding: 12px 16px;
    margin-bottom: 18px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
}

.fixture-found strong {
    font-family: var(--display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--paper);
}

.fixture-found .missing { color: var(--loss); }
.fixture-found em { color: var(--amber); font-style: normal; margin-left: auto; }
.fixture-found[hidden] { display: none; }

/* The round as it stands right now, when it is linked to a source. */
.live-score {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-top: 18px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    background: linear-gradient(90deg, rgba(134, 224, 90, .07), transparent 60%);
}

.live-score.final { background: linear-gradient(90deg, rgba(255, 176, 32, .09), transparent 60%); }

.live-score .tick {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .2em;
    padding: 3px 8px;
    border: 1px solid #38571f;
    color: var(--signal);
}

.live-score.final .tick { border-color: var(--amber-dim); color: var(--amber); }

.live-score .line {
    font-family: var(--mono);
    font-weight: 800;
    font-size: 30px;
    letter-spacing: .04em;
    color: var(--paper);
    font-variant-numeric: tabular-nums;
}

.live-score .stage {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-left: auto;
}

/* ---------- score entry ---------- */

.pick {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.score-input { display: flex; align-items: center; gap: 10px; }

.score-input input {
    width: 78px;
    height: 78px;
    text-align: center;
    background: var(--ink);
    border: 1px solid var(--line);
    color: var(--amber);
    font-family: var(--mono);
    font-weight: 800;
    font-size: 34px;
    transition: border-color .15s, box-shadow .15s;
}

.score-input input:focus {
    outline: 0;
    border-color: var(--amber);
    box-shadow: 0 0 0 1px var(--amber-dim), 0 0 24px rgba(255, 176, 32, .18);
}

.score-input .colon {
    font-family: var(--mono);
    font-size: 26px;
    color: var(--muted);
}

/* ---------- buttons & fields ---------- */

button, .btn {
    font-family: var(--display);
    font-weight: 700;
    font-size: 19px;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 11px 22px 9px;
    background: var(--amber);
    color: var(--ink);
    border: 1px solid var(--amber);
    cursor: pointer;
    transition: transform .1s, filter .15s;
}

button:hover { filter: brightness(1.12); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .35; cursor: not-allowed; filter: none; }

button.ghost {
    background: transparent;
    color: var(--paper);
    border-color: var(--line);
}

button.ghost:hover { border-color: var(--paper); }

button.danger { background: transparent; color: var(--loss); border-color: #55231c; }
button.danger:hover { background: var(--loss); color: var(--ink); }

button.tiny {
    font-family: var(--body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    padding: 6px 11px;
}

input[type=text], input[type=password], input[type=number], input[type=email],
input[type=tel], input[type=search], input[type=url], input[type=datetime-local], select {
    background: var(--ink);
    border: 1px solid var(--line);
    color: var(--paper);
    font-family: var(--body);
    font-size: 14px;
    padding: 10px 12px;
    transition: border-color .15s;
}

input:focus, select:focus { outline: 0; border-color: var(--amber); }

label.field {
    display: grid;
    gap: 6px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- ticket stubs ---------- */

.stubs { display: grid; gap: 10px; }

.stub {
    display: grid;
    grid-template-columns: var(--stub) 1fr auto auto;
    align-items: center;
    gap: 20px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    padding: 0 20px 0 0;
}

/* Only on the way in. Re-running this on every poll made the whole list flicker. */
.stub.fresh { animation: deal .35s backwards; }

@keyframes deal {
    from { opacity: 0; transform: translateY(6px); }
}

/* Perforated left edge — the stub torn off the book. */
.stub .perf {
    align-self: stretch;
    background:
        radial-gradient(circle at left center, var(--ink) 3px, transparent 3.5px) left center / var(--stub) 11px repeat-y;
    border-right: 1px dashed var(--line);
}

.stub.mine { border-color: var(--amber-dim); background: linear-gradient(90deg, rgba(255, 176, 32, .06), transparent 40%), var(--ink-2); }

.stub .who { padding: 14px 0; }
.stub .who .name { font-weight: 600; }

.stub .who .meta {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
}

.stub .call {
    font-family: var(--mono);
    font-weight: 800;
    font-size: 22px;
    color: var(--paper);
    font-variant-numeric: tabular-nums;
}

/* Status chip — used inside stubs, in tables, and on its own beside your call. */
.status {
    display: inline-block;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .16em;
    padding: 4px 9px;
    border: 1px solid var(--line);
    color: var(--muted);
    min-width: 74px;
    text-align: center;
}

.status.WON { color: var(--signal); border-color: #38571f; background: rgba(134, 224, 90, .07); }
.status.LOST { color: var(--loss); border-color: #55231c; }
.status.VOID { color: var(--void); }
.status.OPEN { color: var(--amber); border-color: var(--amber-dim); }

/* ---------- dialogs ---------- */

.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(5, 6, 4, .78);
    animation: backdrop-in .12s ease-out;
}

@keyframes backdrop-in { from { opacity: 0; } }

.dialog {
    width: min(430px, 100%);
    background: var(--ink-2);
    border: 1px solid var(--line);
    padding: 26px 28px 22px;
    position: relative;
    animation: dialog-in .16s ease-out;
}

/* The same struck-amber edge the login card has. */
.dialog::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: repeating-linear-gradient(90deg, var(--amber) 0 16px, transparent 16px 26px);
}

@keyframes dialog-in { from { opacity: 0; transform: translateY(-6px); } }

.dialog h2 {
    margin: 4px 0 0;
    font-size: 26px;
}

.dialog-message { margin-top: 12px; }

.dialog-message p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

@media (max-width: 700px) {
    .dialog-actions { flex-direction: column-reverse; }
    .dialog-actions button { width: 100%; }
}

.dialog.wide {
    width: min(680px, 100%);
    max-height: min(80vh, 760px);
    display: flex;
    flex-direction: column;
}

.sheet-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.sheet-sub {
    margin: 6px 0 0;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}

.sheet-close { align-self: center; }

.sheet-body {
    margin-top: 20px;
    overflow-y: auto;
    /* The thread scrolls inside the sheet; the page behind it does not move. */
    flex: 1;
}

/* The row holding your call, with the way into the talk on the other side of it. */
.pick-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.pick-row .pick {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    flex: 1 1 auto;
}

button.talk {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    color: var(--amber);
    border: 1px solid var(--amber);
    animation: talk-pulse 2.2s ease-in-out infinite;
}

button.talk .count {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 800;
    background: var(--amber);
    color: var(--ink);
    padding: 1px 7px;
}

button.talk:hover { background: var(--amber); color: var(--ink); filter: none; }
button.talk:hover .count { background: var(--ink); color: var(--amber); }

/* Deliberately noticeable: the talk is easy to miss otherwise. */
@keyframes talk-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 176, 32, .45); }
    50%      { box-shadow: 0 0 0 7px rgba(255, 176, 32, 0); }
}

/* Anyone who has asked for less movement gets a static button. */
@media (prefers-reduced-motion: reduce) {
    button.talk { animation: none; }
    .stub.fresh { animation: none; }
    .live::before { animation: none; }
}

/* ---------- comments ---------- */

.thread {
    border: 1px solid var(--line);
    background: var(--ink-2);
    margin-bottom: 10px;
}

.comment { padding: 14px 18px; }

.comment.removed { color: var(--muted); font-style: italic; }

/* A reply is set in from the comment it answers, with a rule to tie them together. */
.reply {
    margin-left: 26px;
    border-left: 1px solid var(--line);
    border-top: 1px solid var(--line);
}

.comment-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.comment-head .name { font-weight: 600; }

.comment-body {
    margin-top: 6px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.comment-actions { margin-top: 10px; display: flex; gap: 14px; }

button.link {
    background: none;
    border: 0;
    padding: 0;
    min-height: 0;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    cursor: pointer;
}

button.link:hover { color: var(--amber); filter: none; }
button.link.danger-link:hover { color: var(--loss); }

.comment-compose { margin-top: 14px; display: grid; gap: 10px; }

textarea, .edit-box {
    width: 100%;
    background: var(--ink);
    border: 1px solid var(--line);
    color: var(--paper);
    font-family: var(--body);
    font-size: 15px;
    line-height: 1.5;
    padding: 12px;
    resize: vertical;
}

textarea:focus, .edit-box:focus { outline: 0; border-color: var(--amber); }

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

table { width: 100%; border-collapse: collapse; }

th {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
    padding: 0 14px 10px;
    border-bottom: 1px solid var(--line);
}

td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

tbody tr:hover { background: var(--ink-2); }

td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
td.amber { color: var(--amber); }

/* Inline controls in a table cell line up on their centres, not the row baseline. */
td .row { align-items: center; gap: 8px; }
td.actions { white-space: nowrap; }
td.actions button + button { margin-left: 6px; }

.meta { font-family: var(--mono); font-size: 11px; color: var(--muted); }

.hint {
    margin: 16px 0 0;
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1.7;
    color: var(--muted);
}

.sort-control { display: none; }

.panel.danger-zone { border-color: #55231c; }

/* ---------- misc ---------- */

.panel {
    border: 1px solid var(--line);
    background: var(--ink-2);
    padding: 22px 24px;
}

.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }

.empty {
    border: 1px dashed var(--line);
    padding: 46px 24px;
    text-align: center;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.notice {
    font-family: var(--mono);
    font-size: 12px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    margin-bottom: 18px;
}

.notice.error { color: var(--loss); border-color: #55231c; background: rgba(224, 85, 63, .07); }
.notice.ok { color: var(--signal); border-color: #38571f; background: rgba(134, 224, 90, .07); }
.notice[hidden] { display: none; }

/* Live pulse — proof the board is polling, not frozen. */
.live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--muted);
}

.live::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--signal);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(134, 224, 90, .5); }
    50% { opacity: .45; box-shadow: 0 0 0 6px rgba(134, 224, 90, 0); }
}

.staff {
    margin-top: 40px;
    border-top: 1px solid var(--line);
    padding-top: 22px;
}

.staff summary {
    font-family: var(--display);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    cursor: pointer;
    color: var(--muted);
}

.staff summary:hover { color: var(--paper); }
.staff .panel { margin-top: 16px; }

/* ---------- login ---------- */

body.gate { display: grid; place-items: center; }

.gate-card {
    width: min(430px, 92vw);
    border: 1px solid var(--line);
    background: var(--ink-2);
    padding: 40px;
    position: relative;
}

.gate-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: repeating-linear-gradient(90deg, var(--amber) 0 16px, transparent 16px 26px);
}


.gate-card .tagline {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    margin: 0 0 28px;
}

.gate-card form { display: grid; gap: 16px; }
.gate-card button { width: 100%; margin-top: 4px; }

.gate-card .switch {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

.gate-card .switch button {
    width: auto;
    background: none;
    border: 0;
    color: var(--amber);
    font-family: var(--body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    padding: 0;
    margin: 0;
}



/* ---------- the rulebook: set as a statute ---------- */

.statute {
    max-width: 780px;
    margin: 0 auto;
}

.statute .crest {
    text-align: center;
    padding: 8px 0 30px;
}

/* Rosette: a ring of amber ticks, struck like a seal. */
.statute .crest .seal {
    width: 74px;
    height: 74px;
    margin: 0 auto 22px;
    border: 2px solid var(--amber);
    border-radius: 50%;
    display: grid;
    place-items: center;
    position: relative;
    background: radial-gradient(circle, rgba(255, 176, 32, .14), transparent 70%);
}

.statute .crest .seal::before {
    content: '';
    position: absolute;
    inset: -9px;
    border-radius: 50%;
    background: repeating-conic-gradient(var(--amber) 0 2deg, transparent 2deg 10deg);
    -webkit-mask: radial-gradient(circle, transparent 0 40px, #000 40px);
    mask: radial-gradient(circle, transparent 0 40px, #000 40px);
    opacity: .5;
}

.statute .crest .crest-mark {
    display: block;
    width: 76px;
    height: 76px;
    margin: 0 auto 22px;
}

.statute h1 {
    font-family: var(--display);
    font-size: 62px;
    letter-spacing: .1em;
    margin: 0;
}

.statute .crest .sub {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .34em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 12px 0 0;
}

/* Double rule under the masthead, the way a statute opens. */
.statute .double-rule {
    border: 0;
    border-top: 3px double var(--line);
    margin: 26px 0 34px;
}

.statute .preamble {
    font-family: var(--statute);
    font-size: 22px;
    line-height: 1.6;
    font-style: italic;
    color: var(--paper);
    margin: 0 0 36px;
    padding-left: 120px;   /* clears the article column, so it lines up with the rest */
}

.statute .preamble-mark {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--amber);
    display: block;
    margin-bottom: 10px;
}

/* The drop cap belongs to the text, not to the "Clan 1" marker above it. */
.statute .preamble .text { display: block; }

.statute .preamble .text::first-letter {
    font-size: 300%;
    line-height: .8;
    float: left;
    padding: 8px 10px 0 0;
    color: var(--amber);
    font-style: normal;
}

.article {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 24px;
    padding: 20px 0;
    border-top: 1px solid var(--line);
    align-items: baseline;
}

.article:last-of-type { border-bottom: 1px solid var(--line); }

.article .n {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--amber);
    text-align: right;
    padding-top: 4px;
}

.article .body {
    font-family: var(--statute);
    font-size: 19px;
    line-height: 1.65;
    color: var(--paper);
}

.article .body .heading {
    display: block;
    font-family: var(--display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--amber);
    margin-bottom: 4px;
}

/* How the app treats each article: enforced, honour system, or not built yet. */
.article .tag {
    display: block;
    width: fit-content;
    margin-top: 12px;
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    padding: 3px 8px;
    border: 1px solid var(--line);
    color: var(--muted);
}

.article .tag.enforced { color: var(--signal); border-color: #38571f; }
.article .tag.pending { color: var(--loss); border-color: #55231c; }

.statute .colophon {
    margin-top: 46px;
    padding-top: 22px;
    border-top: 3px double var(--line);
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1.9;
    color: var(--muted);
    text-align: center;
}

.statute .legend {
    display: flex;
    justify-content: center;
    gap: 22px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.statute .legend span {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}

.statute .legend b { font-weight: 600; }
.statute .legend .enforced b { color: var(--signal); }
.statute .legend .pending b { color: var(--loss); }

a.btn { text-decoration: none; }

    .article { grid-template-columns: 1fr; gap: 6px; }
    .article .n { text-align: left; }


/* ==================================================================================
   Small screens
   ==================================================================================
   The board is checked on a phone far more than on a desk, so this is not an
   afterthought. Two things drive it: nothing may push the page wider than the
   viewport, and every table has to stop being a table.
   ================================================================================== */

/* Belt and braces against a stray wide child scrolling the whole page sideways. */
html, body { max-width: 100%; overflow-x: hidden; }

@media (max-width: 900px) {
    .wordmark img { height: 24px; }

    .round { grid-template-columns: 1fr; }
    .fixture .team { font-size: 30px; }
    h1 { font-size: 34px; }
    h2 { font-size: 23px; margin-top: 34px; }
    main { padding: 22px 16px 60px; }

    /* Two rows: who you are on top, where you can go underneath. */
    header.bar {
        height: auto;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px 14px;
        padding: 10px 16px;
    }

    .wordmark { font-size: 24px; }

    .whoami {
        margin-left: auto;
        gap: 10px;
        font-size: 12px;
    }

    /* The nav takes the full second row and scrolls rather than overflowing the page.
       Five items do not fit across a phone, and hiding one is worse than swiping. */
    nav {
        order: 3;
        width: 100%;
        margin: 0 -16px;
        padding: 2px 16px 4px;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    nav::-webkit-scrollbar { display: none; }

    nav a {
        flex: 0 0 auto;
        scroll-snap-align: start;
        font-size: 17px;
        padding: 7px 12px 5px;
    }
}

@media (max-width: 700px) {
    /* ---- tables become cards ---- */
    table.cards thead { display: none; }

    table.cards,
    table.cards tbody,
    table.cards tr,
    table.cards td {
        display: block;
        width: 100%;
    }

    table.cards tr {
        border: 1px solid var(--line);
        background: var(--ink-2);
        margin-bottom: 10px;
        padding: 6px 0;
    }

    table.cards tr:hover { background: var(--ink-2); }

    table.cards td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        border: 0;
        padding: 7px 16px;
        text-align: right;
    }

    /* The heading the cell would have sat under, now printed beside it. */
    table.cards td::before {
        content: attr(data-label);
        font-family: var(--mono);
        font-size: 10px;
        font-weight: 600;
        letter-spacing: .16em;
        text-transform: uppercase;
        color: var(--muted);
        text-align: left;
        flex: 0 0 auto;
    }

    /* The name leads the card, so it gets no label and the full width. */
    table.cards td.who {
        display: block;
        text-align: left;
        border-bottom: 1px solid var(--line);
        margin-bottom: 4px;
        padding-bottom: 10px;
        font-size: 17px;
    }

    table.cards td.who::before { content: none; }

    /* The standing is the card's number, not a row of its own. */
    table.cards tr { position: relative; }

    table.cards td.rank {
        position: absolute;
        top: 12px;
        right: 16px;
        width: auto;
        padding: 0;
        font-size: 13px;
        color: var(--muted);
    }

    table.cards td.rank::before { content: '#'; letter-spacing: 0; }
    table.cards td.who { padding-right: 54px; }
    table.cards td.actions { justify-content: flex-end; }
    table.cards td.actions::before { content: attr(data-label); }
    table.cards td select,
    table.cards td input[type=number] { max-width: 55%; }

    .sort-control {
        display: flex;
        align-items: flex-end;
        gap: 12px;
        margin-top: 22px;
    }

    .sort-control .field { flex: 1; }
    .sort-control select { width: 100%; }

    /* ---- ticket stubs: name over the call, rather than four columns ---- */
    .stub {
        grid-template-columns: var(--stub) 1fr auto;
        grid-template-areas:
            "perf who    who"
            "perf call   status";
        gap: 0 16px;
        padding-right: 16px;
    }

    .stub .perf { grid-area: perf; }
    .stub .who { grid-area: who; padding: 12px 0 4px; }
    .stub .call { grid-area: call; padding-bottom: 12px; font-size: 20px; }
    .stub .status { grid-area: status; margin-bottom: 12px; }

    /* ---- forms stack ---- */
    .row { gap: 12px; }
    .row > .field,
    .row > label.field { flex: 1 1 100%; min-width: 0; }
    .row > button { width: 100%; }
    .panel { padding: 18px 16px; }

    .kickoff { flex-direction: column; align-items: flex-start; gap: 4px; }
    .pot .amount { font-size: clamp(26px, 8vw, 34px); }

    /* ---- the statute ---- */
    .statute h1 { font-size: 40px; }
    .article { grid-template-columns: 1fr; gap: 6px; }
    .article .n { text-align: left; }
    .statute .preamble { padding-left: 0; }
    .statute .legend { gap: 10px; }

    .gate-card { padding: 30px 22px; }
}

/* Anything with a finger rather than a mouse gets a target it can actually hit. */
@media (pointer: coarse) {
    button, .btn, nav a, select, input[type=text], input[type=password],
    input[type=email], input[type=number], input[type=datetime-local] {
        min-height: 44px;
    }

    button.tiny { min-height: 38px; }

    /* iOS zooms the page in on any field whose text is under 16px. */
    input, select, textarea { font-size: 16px; }

    .score-input input { height: 72px; font-size: 30px; }
}
