/* Spacing and radius scale, so new pieces stop inventing their own paddings.
   Same idea as the Vitalo7 tokens: the numbers live in one place. */
:root {
  --sp-1: 8px; --sp-2: 16px; --sp-3: 24px; --sp-4: 32px;
  --r-input: 8px; --r-card: 12px; --r-pill: 999px;
}

/* Dark is the default: the match console is used in a sports hall in the evening, and a white
   screen there is unusable. Light exists for the landing page, which people read at a desk.
   Only the surface colours swap; team colours come from the club and never change. */

/* Any class that sets display beats the browser's own [hidden] rule, and the element stays on
   screen with nothing in the JavaScript to explain why. The confirmation box shipped like that
   once — visible from page load, its close button doing nothing. One rule, never again. */
[hidden] { display: none !important; }

:root, :root[data-theme="dark"] {
  --bg: #020617; --card: #0f172a; --border: #1e293b;
  --text: #ffffff; --dim: #94a3b8; --muted: #64748b;
  --gold: #f59e0b; --shadow: 0 1px 3px rgba(0,0,0,.4);
  --team-a: #ff5500; --team-b: #00ff00;
  /* A shade lighter than --card: an open menu should look like a panel, not like page. */
  --menu-bg: #1b2740;
}
:root[data-theme="light"] {
  --bg: #f8fafc; --card: #ffffff; --border: #e2e8f0;
  --text: #0f172a; --dim: #475569; --muted: #64748b;
  --gold: #b45309; --shadow: 0 1px 3px rgba(15,23,42,.08);
  --team-a: #ea580c; --team-b: #16a34a;
  --menu-bg: #e4ebf2;   /* darker than white, so the panel separates from the page */
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f8fafc; --card: #ffffff; --border: #e2e8f0;
    --text: #0f172a; --dim: #475569; --muted: #64748b;
    --gold: #b45309; --shadow: 0 1px 3px rgba(15,23,42,.08);
    --team-a: #ea580c; --team-b: #16a34a;
    --menu-bg: #e4ebf2;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, sans-serif; line-height: 1.5; }
a { color: var(--gold); text-decoration: none; }
h1 { font-size: 26px; margin: 0 0 10px; }
h2 { font-size: 19px; margin: 0 0 8px; }
h3 { font-size: 15px; margin: 18px 0 6px; }

.nav { display: flex; justify-content: space-between; align-items: center; gap: 12px;
       padding: 12px 16px; background: var(--card); border-bottom: 2px solid var(--border); flex-wrap: wrap; }
.nav .logo { font-weight: 900; font-size: 17px; color: var(--text); }
/* Wraps: five links plus two buttons do not fit one phone-width line, and a header that
   pushes the whole page sideways is worse than one that takes two rows. */
.nav nav { display: flex; align-items: center; gap: 14px; font-size: 14px; flex-wrap: wrap; }
.nav-user { color: var(--dim); font-size: 12px; }
.wrap { max-width: 860px; margin: 0 auto; padding: 20px 16px 60px; }
.foot { border-top: 1px solid var(--border); padding: 18px 16px; color: var(--dim);
        font-size: 12px; display: flex; justify-content: space-between; gap: 12px;
        /* Three groups now, and on a phone they stack rather than squeeze. */
        flex-wrap: wrap; }

.btn { display: inline-block; padding: 10px 16px; border-radius: 8px; border: none; background: var(--gold);
       color: #1a1300; font-weight: 800; cursor: pointer; font-size: 14px; }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn--big { padding: 14px 22px; font-size: 15px; }
.btn--wide { width: 100%; }

/* Full width of the column, edge to edge on a phone: the picture is the pitch and it earns it. */
.hero-img { display: block; width: 100%; height: auto; border-radius: 14px;
            border: 1px solid var(--border); box-shadow: var(--shadow); margin: 20px 0 4px; }
.app-shot { width: 100%; max-width: 200px; height: auto; display: block; margin: 0 auto 8px;
            border-radius: 12px; }
.shot-caption { text-align: center; font-size: 13px; font-weight: 700; color: var(--gold);
                margin: 0 0 12px; }

/* A 9:16 clip beside its text: on a phone it stacks and fills the width, on a desktop the
   portrait video keeps its natural size instead of stretching into a letterbox. */
.promo { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.promo > div { flex: 1; min-width: 240px; }
.promo-video { width: 100%; max-width: 280px; height: auto; border-radius: 14px;
               border: 1px solid var(--border); box-shadow: var(--shadow); display: block;
               background: #000; }
iframe.promo-video { aspect-ratio: 9 / 16; }

/* The YouTube stand-in. Same size and shape as the real player, so nothing shifts when it is
   swapped in on click. */
.promo-video.yt { aspect-ratio: 9 / 16; background-size: cover; background-position: center;
                  cursor: pointer; position: relative; }
.promo-video.yt:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.yt-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
           font-size: 34px; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.promo-video.yt::after { content: ''; position: absolute; inset: 0; border-radius: 13px;
                         background: radial-gradient(circle at center, rgba(0,0,0,.35), rgba(0,0,0,.05)); }
.yt-play { z-index: 1; }

.hero { padding: 30px 0 10px; }
.hero h1 { font-size: 38px; line-height: 1.15; }
.lead { color: var(--dim); font-size: 17px; max-width: 40em; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0 6px; }
.hero-alt { background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--gold);
            border-radius: 10px; padding: 12px 16px; margin: 18px 0 0; font-size: 14px;
            color: var(--dim); max-width: 40em; }
.hero-alt a { color: var(--gold); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 28px 0; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.card h3 { margin-top: 0; color: var(--gold); }
.card p { color: var(--dim); font-size: 14px; margin: 0; }

.theme-toggle { background: transparent; border: 1px solid var(--border); color: var(--text);
                border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 15px; }

/* Language picker. Eight of them in a row swallowed the header, so they fold into a native
   <details> — no script, and the links are still in the markup for anything that reads it. */
.langs { position: relative; }
.langs summary { list-style: none; cursor: pointer; border: 1px solid var(--border);
                 border-radius: 8px; padding: 7px 10px; font-size: 13px; font-weight: 700;
                 color: var(--text); user-select: none; }
.langs summary::-webkit-details-marker { display: none; }
.langs-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
              background: var(--card); border: 1px solid var(--border); border-radius: 10px;
              box-shadow: 0 8px 24px rgba(0,0,0,.35); padding: 6px; min-width: 150px;
              display: flex; flex-direction: column; }
.langs-menu a { padding: 8px 12px; border-radius: 6px; color: var(--text); font-size: 14px;
                white-space: nowrap; }
.langs-menu a:hover { background: var(--bg); }
.langs-menu a.on { color: var(--gold); font-weight: 700; }

section { margin: 0 0 46px; }
section h2 { font-size: 24px; margin-bottom: 14px; }

/* The three steps: pictures first on a phone, side by side once there is room. */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 22px;
         grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.steps li { background: var(--card); border: 1px solid var(--border); border-radius: 14px;
            padding: 16px; box-shadow: var(--shadow); }
.steps img { width: 100%; height: auto; max-width: 260px; display: block; margin: 0 auto 10px; }
.steps h3 { margin: 0 0 6px; font-size: 16px; color: var(--gold); }
.steps p { color: var(--dim); font-size: 14px; margin: 0; }

.card { box-shadow: var(--shadow); }
.card p + p { margin-top: 10px; }

/* Screenshots are tall, so the grid fits as many 260px columns as it can rather than forcing
   four across. The one phone screenshot is ordered last in index.php — see the note there. */
.shots { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.shots figure { margin: 0; }
.shots img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border);
             box-shadow: var(--shadow); display: block; }
.shots figcaption { color: var(--dim); font-size: 13px; margin-top: 8px; }

/* Guide page: a jump list, numbered steps, and picture-beside-text rows that stack on a phone. */
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 36px; }
.toc a { background: var(--card); border: 1px solid var(--border); border-radius: 8px;
         padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--text); }
.toc a:hover { border-color: var(--gold); }

.steps-list { padding-left: 20px; color: var(--dim); }
.steps-list li { margin-bottom: 10px; }
.steps-list b, .guide-row b { color: var(--text); }

.guide-row { display: grid; grid-template-columns: minmax(0, 260px) 1fr; gap: 24px;
             align-items: start; }
.guide-row img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border);
                 box-shadow: var(--shadow); }
.guide-row ul, .guide-row p { color: var(--dim); }
.guide-row ul { padding-left: 20px; }
.guide-row li { margin-bottom: 8px; }
@media (max-width: 620px) { .guide-row { grid-template-columns: 1fr; } }

/* Waiting-list progress bar. */
.meter { background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
         height: 14px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--gold); border-radius: 999px; }

textarea { background: var(--bg); border: 1px solid var(--border); color: var(--text);
           padding: 10px; border-radius: 8px; font-size: 15px; font-family: inherit;
           width: 100%; margin-top: 4px; resize: vertical; }

.faq { background: var(--card); border: 1px solid var(--border); border-radius: 10px;
       padding: 12px 16px; margin-bottom: 8px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { color: var(--dim); font-size: 14px; margin: 10px 0 0; }

.cta-band { background: var(--card); border: 1px solid var(--border); border-radius: 14px;
            padding: 30px; text-align: center; box-shadow: var(--shadow); }
.cta-band h2 { margin-bottom: 6px; }
.cta-band .lead { margin: 0 auto 18px; }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin: 0 0 16px; }
.panel--narrow { max-width: 440px; margin: 24px auto; }

/* The sign-up page is the one most of a club ever opens, and since the season table and the
   match archive gained rows you can open, 440px was squeezing three columns and a breakdown
   into a column built for a password box. Wider on anything that is not a phone; the phone
   keeps the full width it always had. */
#su.panel--narrow { max-width: 620px; }
.panel-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.inline-form { display: inline-flex; align-items: center; gap: 8px; margin: 8px 0 0; }
label { display: block; margin: 0 0 12px; font-size: 13px; color: var(--dim); }
label.check, label.check input { display: inline-block; margin: 0; }
label.check { color: var(--text); font-size: 13px; }
input, select { background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 10px;
                border-radius: 8px; font-size: 15px; font-family: inherit; width: 100%; margin-top: 4px; }
input[type=checkbox] { width: auto; }
.hint { color: var(--dim); font-size: 12px; }
.dim { color: var(--dim); } .gold { color: var(--gold); } .small { font-size: 12px; }
.strong { font-weight: 800; } .right { text-align: right; } .grow { flex-grow: 1; }
.code { font-family: ui-monospace, monospace; letter-spacing: 3px; color: var(--gold); }

.alert { padding: 10px 14px; border-radius: 8px; margin: 0 0 14px; font-size: 14px; }
.alert--error { background: #dc2626; color: #fff; }
.alert--ok { background: #16a34a; color: #fff; }
.alert--info { background: var(--card); border: 1px solid var(--border); }

.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { color: var(--muted); text-transform: uppercase; font-size: 10px; text-align: left; padding: 10px; }
.table td { padding: 10px; border-bottom: 1px solid var(--border); font-weight: bold; }

/* ---------------- match console ---------------- */
.console { max-width: 760px; margin: 0 auto; padding-bottom: 20px; }
.nav-tabs { display: flex; background: var(--card); border-bottom: 2px solid var(--border); }
.tab { flex: 1; padding: 16px 6px; text-align: center; cursor: pointer; font-weight: 800;
       text-transform: uppercase; color: var(--muted); font-size: 13px; border-bottom: 4px solid transparent; }
.tab.active { color: var(--team-a); border-bottom-color: var(--team-a); }
.pane { display: none; padding: 15px; flex-direction: column; gap: 12px; }
.pane.active { display: flex; }
.row { display: flex; gap: 10px; align-items: center; background: var(--card); padding: 12px;
       border-radius: 10px; border: 1px solid var(--border); flex-wrap: wrap; }
.col-stack { flex-direction: column; align-items: stretch; }
.flex-row { display: flex; gap: 8px; align-items: center; }
.space-between { justify-content: space-between; }
.grp { margin: 0; }
.mini { font-size: 9px; font-weight: 800; color: var(--muted); text-transform: uppercase; }
.inp { width: 80px; text-align: center; font-weight: bold; margin: 0; }
.inp.wide { width: 100px; font-size: 12px; }
.inp.left { text-align: left; width: auto; }
.timer { font-size: 22px; font-weight: 900; color: var(--gold); cursor: pointer; }

.score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.score-val { font-size: 55px; font-weight: 900; line-height: 1; }
.score-val.small-num { font-size: 30px; }
.ca { color: var(--team-a); } .cb { color: var(--team-b); }
.court { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 6px; }
.p-card { border: 1px solid var(--border); border-radius: 10px; padding: 8px 5px; text-align: center;
          cursor: pointer; background: var(--card); }
.p-card.sel { border: 2px solid var(--gold); background: rgba(245,158,11,.1); }
/* Substituted off but already on the scoresheet: still shown so the totals add up. */
.p-card.off { opacity: .5; }
.p-name { font-size: 11px; font-weight: 800; text-transform: uppercase; display: block; margin-bottom: 3px; color: var(--text); }
.p-pts { color: var(--team-a); font-size: 22px; }

.log { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px;
       height: 110px; overflow-y: auto; font-size: 12px; color: var(--dim); }
.log.tall { height: 200px; }
/* The archive is a list people scroll looking for a particular night, and each row can now open
   into its scorers. 110px showed three rows and half of a fourth. */
#su-history.log { height: 200px; }
.log-item { display: flex; justify-content: space-between; align-items: center;
            padding: 5px 0; border-bottom: 1px solid var(--border); }
.del { color: #ef4444; font-weight: 800; cursor: pointer; }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.admin-card { background: var(--card); padding: 10px; border-radius: 10px;
              display: flex; justify-content: space-between; align-items: center;
              border: 1px solid var(--border); gap: 10px; }
.admin-card.clickable { cursor: pointer; }
.admin-card.in { border-color: var(--team-b); background: rgba(34, 197, 94, .08); }

/* Fixed name column, so the colour and in/out buttons line up down the grid instead of
   drifting with the length of each nickname. Delete then sits alone at the far right, half a
   card away from the two buttons that get pressed every week — the one that cannot be undone
   should never be next to the ones that can. */
.admin-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: none; }
.pname { font-size: 12px; font-weight: bold; width: 108px; flex: none;
         overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-btn { border: none; color: #fff; border-radius: 6px; font-size: 13px; font-weight: 900;
            width: 36px; height: 32px; cursor: pointer; flex-shrink: 0; }
.inout-btn { border: none; color: #fff; border-radius: 6px; font-size: 10px; font-weight: bold;
             width: 52px; height: 32px; cursor: pointer; flex-shrink: 0; }
.x-btn { background: #ef4444; border: none; color: #fff; border-radius: 6px; font-size: 11px;
         font-weight: bold; width: 34px; height: 32px; cursor: pointer; flex-shrink: 0;
         margin-left: auto; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 6px; cursor: pointer; border: 2px solid transparent;
         /* White and grey bibs would otherwise vanish into the light theme's own background. */
         box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .5); }
.swatch.on { border-color: var(--text); }
.admin-card.out { border-color: #ef4444; background: rgba(239, 68, 68, .10); }
.admin-card.out .nm { color: #ef4444; }

.su-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
/* A heading per group with its own count, so "who is missing" is read rather than worked out. */
.su-head { display: flex; justify-content: space-between; align-items: baseline;
           margin: 14px 0 2px; font-size: 11px; font-weight: 800; letter-spacing: .06em;
           text-transform: uppercase; color: var(--muted); }
.su-head b { color: var(--text); font-size: 13px; }
.su-head:first-child { margin-top: 0; }

/* Confirmation box for signing in and out. Fixed rather than a native <dialog>: this page is
   opened on whatever phone the group chat happened to reach. */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center;
         justify-content: center; padding: 16px; background: rgba(2, 6, 23, .72); }
.modal-box { background: var(--card); border: 1px solid var(--border); border-radius: 14px;
             box-shadow: var(--shadow); padding: 20px; width: 100%; max-width: 340px;
             display: flex; flex-direction: column; gap: 10px; text-align: center; }
.modal-name { font-size: 20px; font-weight: 900; }
.btn--danger { background: #ef4444; border-color: #ef4444; color: #fff; }
.stats-box { background: var(--card); border: 1px solid var(--border); border-radius: 10px;
             padding: 12px; margin-top: 16px; text-align: left; }
.stats-box summary { cursor: pointer; font-weight: 800; color: var(--gold);
                     text-transform: uppercase; font-size: 13px; }
.stats-box[open] summary { margin-bottom: 10px; }

.footer { background: var(--card); border-top: 2px solid var(--border); padding: 15px;
          position: sticky; bottom: 0; }
.scorer-label { text-align: center; font-size: 11px; color: var(--gold); font-weight: 800;
                margin-bottom: 10px; text-transform: uppercase; }
.pts-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.btn-pts { height: 55px; border-radius: 10px; border: none; font-weight: 900; font-size: 22px;
           cursor: pointer; color: #fff; }
.btn-pts.minus { background: #1e293b; color: #ef4444; }
.btn-pts.plus { background: var(--gold); color: #1a1300; }

/* An opened match or player in the season tab. Indented and dimmer than the row it hangs from,
   so a long archive still reads as a list rather than as one flat wall of numbers. */
.breakdown { margin: 4px 0 10px 14px; padding-left: 10px; border-left: 2px solid var(--border); }
.breakdown .log-item { padding: 3px 0; }
tr.clickable, .log-item.clickable { cursor: pointer; }
tr.clickable:hover, .log-item.clickable:hover { background: var(--card); }

/* Light theme: the palette includes white (and pale yellow/cyan), which vanishes on a white page.
   A dark outline keeps every team colour readable; paint-order draws it behind the fill. */
:root[data-theme="light"] :is(.ca, .cb, .p-pts, .team-btn, .inout-btn, [style*="color:var(--team"], [style*="color: var(--team"]) {
  -webkit-text-stroke: 2px #334155; paint-order: stroke fill;
}
:root[data-theme="light"] :is(.team-btn, .inout-btn, .swatch) { box-shadow: inset 0 0 0 1px #64748b; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) :is(.ca, .cb, .p-pts, .team-btn, .inout-btn, [style*="color:var(--team"], [style*="color: var(--team"]) {
    -webkit-text-stroke: 2px #334155; paint-order: stroke fill;
  }
  :root:not([data-theme="dark"]) :is(.team-btn, .inout-btn, .swatch) { box-shadow: inset 0 0 0 1px #64748b; }
}

/* Club crests. 72px slots: big enough to recognise the picture, small enough that three of them
   and their labels still fit across a phone. */
.logos { display: flex; gap: 16px; flex-wrap: wrap; }
.logo-slot { position: relative; text-align: center; width: 72px; }
.logo-btn {
  width: 72px; height: 72px; padding: 0; overflow: hidden; cursor: pointer;
  border: 1px dashed var(--border); border-radius: 12px; background: var(--card);
  display: grid; place-items: center; color: var(--dim); font-size: 26px; line-height: 1;
}
.logo-btn:hover { border-color: var(--gold); color: var(--text); }
.logo-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo-del {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: 50%; background: var(--border); color: var(--text);
  font-size: 15px; line-height: 20px; cursor: pointer; box-shadow: var(--shadow);
}
.logo-del:hover { background: #c0392b; color: #fff; }
.logo-slot .mini { display: block; margin-top: 5px; }

/* The results page: a club crest in the table, and a dot for each team colour. The dot is used
   instead of colouring the team name, because a white or yellow bib would vanish on light. */
.club-cell { display: flex; align-items: center; gap: 8px; }
.crest { width: 32px; height: 32px; border-radius: 7px; object-fit: cover; flex: none; }
.dot {
  display: inline-block; width: 11px; height: 11px; border-radius: 50%;
  margin: 0 5px; vertical-align: baseline; box-shadow: inset 0 0 0 1px rgba(100,116,139,.8);
}

/* Crests grow under the pointer, because 32px tells you which club it is but not much else.
   position/z-index keep the enlarged one above the rows around it. */
.crest { position: relative; transition: transform .12s ease; }
.crest:hover, .crest:focus { transform: scale(3); z-index: 5; box-shadow: var(--shadow); }
.crest--team {
  width: 22px; height: 22px; border-radius: 5px; vertical-align: -5px; margin: 0 3px;
  display: inline-block;
}

/* Avatars. Round, so they never read as a club crest, and they zoom like one under the pointer. */
.avatar, .avatar-btn {
  width: 34px; height: 34px; border-radius: 50%; flex: none; padding: 0; overflow: hidden;
  object-fit: cover; display: inline-grid; place-items: center;
}
.avatar-btn {
  border: 1px dashed var(--border); background: var(--card); color: var(--dim);
  font-size: 17px; line-height: 1; cursor: pointer;
}
.avatar-btn:hover { border-color: var(--gold); color: var(--text); }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar { position: relative; transition: transform .12s ease; vertical-align: -11px; margin-right: 8px; }
.avatar:hover { transform: scale(3); z-index: 5; box-shadow: var(--shadow); }
.avatar-wrap { position: relative; flex: none; }
.avatar-del {
  position: absolute; top: -5px; right: -5px; width: 18px; height: 18px; padding: 0;
  border: 0; border-radius: 50%; background: var(--border); color: var(--text);
  font-size: 12px; line-height: 16px; cursor: pointer;
}
.avatar-del:hover { background: #c0392b; color: #fff; }

/* The updates list: a date and a tag over each entry, no bullets. */
.updates { list-style: none; padding: 0; margin: 0; }
.updates li { padding: 14px 0; border-bottom: 1px solid var(--border); }
.updates li:last-child { border-bottom: 0; }
.upd-head { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; }
.upd-head time { color: var(--muted); font-size: 13px; }
.tag {
  font-size: 11px; font-weight: bold; text-transform: uppercase; letter-spacing: .4px;
  padding: 2px 8px; border-radius: 99px; color: var(--bg); background: var(--dim);
}
.tag--app { background: var(--gold); }

/* The log / per-player switch inside an open match. */
.view-swap { font-size: 12px; padding: 4px 11px; margin-bottom: 9px; }

/* A deleted match. The row stays — a season you cannot audit is worse than one with a gap — but
   it reads as struck out and says who removed it. */
.log-item.struck { opacity: .6; }
.log-item.struck b, .log-item.struck .dim:first-child { text-decoration: line-through; }
.struck-by { margin-left: 8px; font-style: italic; }

/* The results page on a phone. A three-column table of date, club and score cannot be squeezed
   into 343px, so each match becomes a card: club on top, the score in the middle at a size worth
   reading across a room, the date small underneath. */
@media (max-width: 560px) {
  .table--matches, .table--matches tbody { display: block; }
  .table--matches thead { display: none; }
  .table--matches tr {
    /* Date up on the club line: it is the least important thing here and a row of its own
       cost every card 22px, which is one match fewer per screen. */
    display: grid; gap: 4px;
    grid-template-areas: "club when" "score score";
    grid-template-columns: 1fr auto; align-items: baseline;
    border: 1px solid var(--border); border-radius: var(--r-card);
    background: var(--card); padding: var(--sp-1) 12px; margin: 0 0 var(--sp-1);
  }
  .table--matches td { display: block; border: 0; padding: 0; }
  /* The block rule above would otherwise win over .club-cell and drop a long club name
     under its own crest; min-width:0 is what lets the name shorten instead of pushing. */
  .table--matches .club-cell  {
    grid-area: club; display: flex; align-items: center; gap: var(--sp-1); min-width: 0;
  }
  .table--matches .club-cell b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .table--matches .score-cell { grid-area: score; }
  .table--matches .when-cell  { grid-area: when; font-weight: 400; font-size: 12px; text-align: right; }

  /* The scorer tables fit once the padding stops eating a third of the width. The club column
     gives way first: a nickname matters more than the club it is in. */
  .table th, .table td { padding: var(--sp-1) 6px; }
  /* Only the scorer tables: in a match card the third cell is the score itself. */
  .table:not(.table--matches) td:nth-child(3) {
    max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .crest { width: 26px; height: 26px; }
}

/* One row per side: crest, colour, name, then the points hard against the right. The winner's
   number is the gold one, which is what the eye is looking for. */
.score-cell { display: grid; gap: 3px; min-width: 190px; }
.side { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 4px; }
.side-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.side-pts { text-align: right; font-variant-numeric: tabular-nums; padding-left: 10px; }

/* The phone menu. One button; the links are ordinary markup underneath it. */
.menu-btn {
  display: none; font-size: 21px; line-height: 1; padding: 5px 11px; cursor: pointer;
  color: var(--text); background: var(--card);
  border: 1px solid var(--border); border-radius: var(--r-input);
}
.nav-tools { display: flex; align-items: center; gap: var(--sp-1); }

@media (max-width: 700px) {
  .nav { position: relative; flex-wrap: nowrap; }
  .menu-btn { display: block; order: 2; }
  .nav-tools { order: 3; }
  body.menu-js .nav nav { display: none; }
  body.menu-js.menu-open .nav nav {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
    padding: var(--sp-1) var(--sp-2) var(--sp-2);
    background: var(--menu-bg); border-bottom: 2px solid var(--gold);
    box-shadow: 0 10px 24px rgba(0,0,0,.28);
  }
  body.menu-js.menu-open .nav nav > * { padding: 7px 0; }
}

/* Home only in the burger. On a wide screen the logo is plainly a link and a seventh item would
   just crowd the row; on a phone the menu is where people look for the way back. */
.nav-home { display: none; }
@media (max-width: 700px) { body.menu-js .nav-home { display: block; } }

/* Portal: one card per sport. */
.sport-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.sport-card img { width: 100%; height: auto; border-radius: 10px; display: block; }
.sport-card h2 a { color: inherit; text-decoration: none; }
