/* Straight Sets v2 — app.css
 *
 * The palette agreed from the mockups: a pale clay court, deep green as
 * both ink and action colour, terracotta as the one warm marker.
 *
 * The rule that matters: glass on chrome (sidebar, headers, auth cards),
 * solid behind dense text (brackets, tables). Glass over a busy
 * background undermines contrast, and heavy backdrop-blur is a real
 * performance cost on older phones.
 */

:root {
  --court:        #E8DED2;
  --court-deep:   #D9CBB9;
  --ink:          #14312A;
  --ink-soft:     rgba(20, 49, 42, .62);
  --accent:       #14312A;
  --accent-warm:  #B5533A;
  --line:         rgba(20, 49, 42, .16);
  --muted:        #6E7B74;
  --surface:      #FFFFFF;
  --win:          #1D7A4C;
  --miss:         #B5533A;
  --connector:    #B9C7C0;

  --glass-bg:     rgba(255, 255, 255, .55);
  --glass-border: rgba(255, 255, 255, .7);
  --shadow:       0 8px 32px rgba(20, 49, 42, .08);
  --shadow-solid: 0 4px 20px rgba(20, 49, 42, .06);

  --radius:    16px;
  --radius-sm: 11px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* --- The court backdrop -------------------------------------------- */

.court-bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  /* Safari has a known bug where a `position:fixed; overflow:hidden`
     box fails to clip a transformed descendant (the rotated svg below),
     letting it expand the page's scrollable width and throw the whole
     layout off-centre on load. clip-path is honoured even when Safari's
     overflow clip isn't. */
  clip-path: inset(0);
  background: linear-gradient(165deg, var(--court) 0%, var(--court-deep) 100%);
}
.court-bg svg {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-8deg);
  width: 132%; height: 132%; opacity: .15;
}

.stage { position: relative; z-index: 1; min-height: 100vh; }

/* --- Glass (chrome only) ------------------------------------------- */

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

/* --- Typography ----------------------------------------------------- */

h1, h2, h3, .display {
  font-family: 'Sora', 'Inter', sans-serif;
  letter-spacing: -.02em;
  margin: 0;
}
h1 { font-size: 30px; font-weight: 700; line-height: 1.15; }
h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }

.wordmark {
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 13px;
  letter-spacing: .22em; text-transform: uppercase; color: var(--accent-warm);
}
.sub { color: var(--ink-soft); font-size: 14px; line-height: 1.5; margin: 0; }
.muted { color: var(--muted); }

/* --- Forms ---------------------------------------------------------- */

label {
  display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 7px;
}
input, select, textarea {
  width: 100%; padding: 13px 15px; border-radius: var(--radius-sm);
  font-size: 16px; line-height: 1.25; font-family: inherit; color: var(--ink);
  background: rgba(255, 255, 255, .85); border: 1px solid var(--line);
}
/* iOS Safari gives date/time inputs a native appearance with its own
   intrinsic min-width, which ignores width:100% and pushes the field
   past the card's right edge on a phone. It also sizes them taller than
   a text input and centres the value. Strip the native look, let them
   shrink, pin the height to a text input's, and left-align the value. */
input[type="date"], input[type="datetime-local"], input[type="time"] {
  -webkit-appearance: none; appearance: none;
  display: block; min-width: 0; max-width: 100%;
  height: calc(1.25em + 28px);
  text-align: left;
}
input::-webkit-date-and-time-value { text-align: left; margin: 0; }
textarea { resize: vertical; display: block; }
input::placeholder, textarea::placeholder { color: rgba(20, 49, 42, .35); }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent;
}
.field { margin-bottom: 18px; }

/* Safari renders its "Suggest New Password" popover directly below a
   focused new-password field. Without room it lands on the submit
   button and swallows the click — a real bug from v1, fixed with space. */
.field-password-signup { margin-bottom: 56px; }

.btn {
  width: 100%; padding: 14px; border: 0; border-radius: var(--radius-sm);
  cursor: pointer; font-family: 'Sora', sans-serif; font-size: 15px;
  font-weight: 700; background: var(--accent); color: #fff;
  transition: transform .12s ease, filter .2s ease;
}
.btn:hover:not(:disabled) { filter: brightness(1.15); transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-quiet {
  background: #fff; color: var(--ink); border: 1px solid var(--line);
}
.btn-auto { width: auto; padding: 11px 20px; }

.linkbtn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--accent-warm); font-weight: 700; font-size: 14px; font-family: inherit;
}

/* --- Tournament search confirmation ------------------------------- */

.found-card {
  padding: 16px 14px; margin-bottom: 10px; border: 1.5px solid var(--line);
  border-radius: 13px; background: #fff;
}
.found-name { font-family: 'Sora', sans-serif; font-size: 17px; font-weight: 700; color: var(--ink); }
.found-meta { font-size: 13px; color: var(--muted); margin: 2px 0 12px; }
.manual-entry { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.manual-entry summary {
  cursor: pointer; color: var(--accent-warm); font-weight: 700; font-size: 14px;
}

/* --- Superadmin ------------------------------------------------------ */

.admin-banner {
  margin: 12px 0 0; padding: 11px 14px; border-radius: var(--radius-sm);
  background: #FBF1EE; border: 1.5px solid var(--accent-warm); color: var(--ink);
  font-size: 14px; line-height: 1.45;
}
.admin-banner .linkbtn { margin-left: 6px; }
.admin-bar .appbar-title { color: var(--accent-warm); }
#adminContent { margin-top: 16px; }
.admin-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.admin-tabs .btn { flex: 1 1 auto; }
.admin-row {
  padding: 14px 0; border-top: 1px solid var(--line);
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap;
}
.admin-row:first-of-type { border-top: 0; }
.admin-row-main { flex: 1 1 260px; min-width: 0; }
.admin-row-name { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 16px; }
.admin-row-meta { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.5; overflow-wrap: anywhere; }
.admin-row-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.admin-row-actions .linkbtn { color: var(--ink); }
.admin-row-actions .linkbtn.admin-danger, .admin-danger { color: var(--miss) !important; }
/* Labels are uppercased; a name someone must type exactly is shown as-is. */
label .exact { text-transform: none; letter-spacing: 0; color: var(--ink); font-weight: 700; }
.admin-log { font-size: 13px; line-height: 1.5; }
.admin-log .when { color: var(--muted); }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(20, 49, 42, .45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal { width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal .warn {
  background: #FBF1EE; border: 1.5px solid var(--accent-warm); border-radius: var(--radius-sm);
  padding: 12px 14px; margin: 12px 0 16px; font-size: 14px; line-height: 1.5;
}
.modal .warn ul { margin: 6px 0 0; padding-left: 18px; }
.btn-danger { background: var(--miss); }

/* --- Messages -------------------------------------------------------- */

.msg { border-radius: var(--radius-sm); padding: 11px 13px; font-size: 14px; margin-bottom: 16px; }
.msg-error   { background: #FBF1EE; color: var(--miss); border: 1px solid #EFD8CE; }
.msg-success { background: #EFF7F2; color: var(--win); border: 1px solid #CDE7DA; }
.msg-info    { background: #FBF2EE; color: var(--ink); border: 1px solid #EFD8CE; }
[hidden] { display: none !important; }

/* --- Auth screens ---------------------------------------------------- */

.centered {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 32px 20px;
}
.auth-card {
  width: 100%; max-width: 400px; border-radius: 20px; padding: 38px 34px;
}
.swap { text-align: center; margin-top: 20px; font-size: 14px; color: var(--muted); }

/* --- Choice screen ---------------------------------------------------- */

.choice-wrap { width: 100%; max-width: 620px; }
.choice-head { text-align: center; margin-bottom: 30px; }
.choice {
  display: flex; align-items: center; gap: 18px; width: 100%;
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 14px;
  cursor: pointer; text-align: left; color: var(--ink); font-family: inherit;
  transition: transform .12s ease, background .2s ease;
}
.choice:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .78); }
.choice-mark {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; display: flex;
  align-items: center; justify-content: center;
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 16px;
}
.choice-title { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 16px; margin-bottom: 3px; }
.choice-desc { font-size: 13.5px; color: var(--ink-soft); line-height: 1.45; }

/* --- App shell -------------------------------------------------------- */

.shell { max-width: 1320px; margin: 0 auto; padding: 24px 20px 60px; }

.appbar {
  border-radius: var(--radius); padding: 14px 18px;
  display: flex; align-items: center; gap: 16px; margin-bottom: 18px;
}
.appbar-title { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 15px; }
.appbar-meta { margin-left: auto; font-size: 13px; color: var(--muted); }

/* --- Account menu: the same button on every signed-in screen --------- */

.account-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .7); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px 4px 4px; cursor: pointer; font-family: inherit; font-size: 13.5px;
  font-weight: 600; color: var(--ink); max-width: 220px;
}
.account-btn:hover { background: #fff; }
.account-btn .avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: 'Sora', sans-serif; font-weight: 700; font-size: 13px;
}
.account-btn.is-admin .avatar { background: var(--accent-warm); }
.account-btn .account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-btn .caret { color: var(--muted); flex-shrink: 0; }
.choice-account { position: absolute; top: 20px; right: 20px; z-index: 5; }
#view-choice { position: relative; }
.account-menu {
  position: fixed; z-index: 60; min-width: 230px; max-width: calc(100vw - 32px);
  border-radius: var(--radius-sm); padding: 6px; background: rgba(255, 255, 255, .96);
}
.account-menu .who { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.account-menu .who strong { display: block; font-size: 14px; }
.account-menu .who span { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.account-menu button {
  display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none;
  border-radius: 8px; font-family: inherit; font-size: 14.5px; color: var(--ink); cursor: pointer;
}
.account-menu button:hover, .account-menu button:focus-visible { background: rgba(20, 49, 42, .07); outline: none; }
.account-menu .logout { color: var(--miss); font-weight: 600; }

.burger {
  background: none; border: 0; cursor: pointer; padding: 6px;
  display: none; flex-direction: column; gap: 4px;
}
.burger span { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; }

.layout { display: grid; grid-template-columns: 216px 1fr; gap: 18px; align-items: start; }

.sidenav { border-radius: var(--radius); padding: 10px; position: sticky; top: 24px; }
.navlink {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 11px 13px; border: 0; border-radius: 10px; background: none;
  color: var(--ink-soft); font-size: 14.5px; font-weight: 500;
  text-align: left; font-family: inherit; cursor: pointer;
}
.navlink:hover { background: rgba(20, 49, 42, .07); color: var(--ink); }
.navlink.on { background: var(--accent); color: #fff; font-weight: 600; }
.navlink .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; }
.nav-sep { height: 1px; background: var(--line); margin: 8px 12px; }
.nav-tag {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); padding: 8px 13px 4px;
}

/* Content panels are solid — this is where dense text lives. */
.panel {
  background: var(--surface); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-solid);
}
.panel + .panel { margin-top: 18px; }
.panel-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  margin-left: auto; background: #F2F7F4; border: 1px solid #D3E2DB;
  border-radius: 20px; padding: 8px 15px; font-size: 13px;
  font-weight: 600; color: var(--accent); white-space: nowrap;
}

/* --- Tables ------------------------------------------------------------ */

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); padding: 0 10px 10px; font-weight: 600;
}
td { padding: 13px 10px; border-top: 1px solid #EAEDEB; font-size: 14.5px; }
tr.you td { background: #F5F9F7; font-weight: 600; }
.rank { font-family: 'Sora', sans-serif; font-weight: 700; color: var(--muted); width: 34px; }
.pts { text-align: right; font-family: 'Sora', sans-serif; font-weight: 700; }
.role-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 20px; margin-left: 8px;
  background: rgba(20, 49, 42, .1); color: var(--accent);
}

.invite {
  margin-top: 22px; padding: 16px 18px; border-radius: 12px;
  background: #F5F9F7; border: 1px dashed #C9D8D2;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.invite-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.invite-code { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 21px; letter-spacing: .13em; color: var(--accent); }

/* Personal tiebreak guess — its own box wherever it shows up (desktop's
   Semis & Final step, mobile's Final pick card, mobile overview), never
   folded into a pick card. */
.tiebreak-box {
  padding: 16px 18px; border-radius: 12px;
  background: #F5F9F7; border: 1px solid #D3E2DB;
}

/* --- Bracket: shared ---------------------------------------------------- */

.stepper { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.step {
  flex: 1; min-width: 88px; padding: 11px 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 600;
  color: var(--ink-soft); position: relative;
}
.step:hover { border-color: var(--accent); color: var(--ink); }
.step.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.step .count { display: block; font-size: 11px; font-weight: 500; opacity: .7; margin-top: 2px; font-family: 'Inter', sans-serif; }
.step.done::after { content: '✓'; position: absolute; top: 6px; right: 8px; font-size: 11px; color: var(--win); font-weight: 700; }
.step.on.done::after { color: #8FE3B4; }

.rank-badge {
  font-family: 'Sora', sans-serif; font-size: 10.5px; font-weight: 700;
  color: var(--muted); background: #F2F4F3; border-radius: 4px;
  padding: 1px 5px; min-width: 20px; text-align: center;
}
/* A tournament seed, when the draw provides one — distinct from
   .rank-badge (raw ranking, shown only when there's no seed) so the two
   are never mistaken for each other at a glance. */
.seed-badge {
  font-family: 'Sora', sans-serif; font-size: 10.5px; font-weight: 700;
  color: var(--accent); background: rgba(20, 49, 42, .10); border-radius: 4px;
  padding: 1px 5px; min-width: 20px; text-align: center;
}
.entry-tag {
  font-size: 9px; font-weight: 700; padding: 1px 4px; border-radius: 3px;
  background: rgba(181, 83, 58, .13); color: var(--accent-warm); text-transform: uppercase;
}
.mark { font-weight: 800; font-size: 12px; }
.mark.w { color: var(--win); }
.mark.l { color: var(--miss); }

/* --- Bracket: desktop tree ---------------------------------------------- */

.bracket-scroll { overflow-x: auto; padding-bottom: 8px; }
.bracket-canvas { position: relative; }
.bracket-canvas svg.wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.col-heads { display: flex; margin-bottom: 10px; }
.col-head {
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; white-space: nowrap;
}
.col-head .pts-label { color: var(--accent-warm); }

.tie { position: absolute; width: 200px; }
.tie-slots { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.slot {
  display: flex; align-items: center; gap: 7px; width: 100%;
  padding: 9px 10px; border: 0; background: none; cursor: pointer;
  text-align: left; font-family: inherit; font-size: 13.5px;
  color: var(--ink); line-height: 1.25;
}
.slot + .slot { border-top: 1px solid #EDF0EE; }
.slot:hover:not(.empty):not(.pending) { background: #F7FAF8; }
.slot.chosen { background: #EFF7F2; font-weight: 600; }
.slot.won { background: #EAF6EF; font-weight: 600; }
.slot.lost { background: #FBF1EE; color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.slot.empty { color: var(--muted); font-style: italic; font-size: 12.5px; cursor: default; background: #FCFCFB; }
.slot.pending { cursor: default; background: #FCFCFB; }
.slot:disabled:not(.empty):not(.pending) { opacity: .6; cursor: default; }
.pname { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tie-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 5px 2px 0; font-size: 10.5px; }
/* Head-to-head chip: the at-a-glance record; tap to open the meetings. */
.h2h-wrap { position: relative; min-width: 0; }
.h2h-chip {
  border: 1px solid var(--line); background: #F4F8F6; color: var(--accent);
  border-radius: 999px; padding: 2px 8px; cursor: pointer;
  font-family: 'Sora', sans-serif; font-size: 10.5px; font-weight: 600;
  max-width: 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.h2h-chip:hover { border-color: var(--accent); }
.h2h-chip.loading { color: var(--muted); animation: h2hPulse 1.2s ease-in-out infinite; }
.h2h-chip.error { color: var(--muted); background: #FCFCFB; }
.h2h-chip[aria-expanded="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
@keyframes h2hPulse { 50% { opacity: .45; } }
.h2h-panel {
  /* Desktop cards are pinned in the tree, so the panel floats just
     below the chip, over whatever sits under the card. */
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 260px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-solid); padding: 8px 10px; font-size: 12px; line-height: 1.45;
  font-family: 'Inter', sans-serif; color: var(--ink); text-align: left; white-space: normal;
}
.tie.h2h-open { z-index: 25; }
.h2h-row { padding: 6px 0; border-top: 1px solid var(--line); }
.h2h-row:first-child { border-top: 0; }
.h2h-score { font-family: 'Sora', sans-serif; font-weight: 600; font-size: 11.5px; margin-left: 2px; }
.h2h-meta { color: var(--muted); font-size: 11px; margin-top: 1px; }
.h2h-note { margin: 4px 0 2px; color: var(--muted); font-size: 11.5px; }
.ptag { color: var(--muted); }
.ptag.earned { color: var(--win); font-weight: 700; }

/* --- Bracket: mobile ------------------------------------------------------ */

.mobile-only { display: none; }

/* List view / Bracket view switch — same pill language as .stepper/.step
   so it doesn't read as a new UI pattern, just a smaller version of one
   already on the page. */
.view-toggle { display: flex; gap: 6px; margin-bottom: 16px; }
.vt-btn {
  flex: 1; padding: 10px 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 600;
  color: var(--ink-soft);
}
.vt-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }

.rail { padding: 13px 0 11px; }
.rail-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.rail-round { font-family: 'Sora', sans-serif; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.rail-count { font-size: 12px; color: var(--muted); font-weight: 500; }
.rail-bar { height: 5px; background: rgba(20, 49, 42, .12); border-radius: 3px; overflow: hidden; }
.rail-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .25s ease; }

.mcard {
  background: #fff; border-radius: 18px; padding: 18px;
  box-shadow: 0 4px 20px rgba(20, 49, 42, .1); margin-bottom: 14px;
}
.mcard-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 15px; padding-bottom: 13px; border-bottom: 1px solid #EFF2F0;
}
.mcard-tag { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.mcard-pts { font-family: 'Sora', sans-serif; font-size: 12px; font-weight: 700; color: var(--accent-warm); }

.mpick {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 16px 14px; margin-bottom: 10px; border: 1.5px solid var(--line);
  border-radius: 13px; background: #fff; cursor: pointer;
  font-family: inherit; font-size: 16px; text-align: left; color: var(--ink);
}
.mpick.chosen { border-color: var(--accent); background: #EFF7F2; font-weight: 600; }
.mpick.chosen .mradio { border-color: var(--accent); background: var(--accent); }
.mpick.chosen .mradio::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.mpick:disabled { opacity: .6; cursor: default; }
.mradio {
  width: 21px; height: 21px; border-radius: 50%; border: 2px solid var(--line);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
/* On the phone pick card everything stacks, so the chip is full width
   and the panel opens inline beneath it. */
.h2h-wrap.mobile { display: block; margin-top: 2px; }
.h2h-wrap.mobile .h2h-chip {
  display: block; width: 100%; max-width: none; text-align: center; padding: 11px;
  border-radius: 10px; font-size: 13.5px;
}
.h2h-wrap.mobile .h2h-panel {
  position: static; width: auto; margin-top: 8px; box-shadow: none; font-size: 13.5px; padding: 6px 12px;
}
.h2h-wrap.mobile .h2h-score { font-size: 13px; }
.h2h-wrap.mobile .h2h-meta { font-size: 12.5px; }
.mnav { display: flex; gap: 10px; margin-top: 4px; }
.mnav .btn { flex: 1; }
.mnav .btn-auto { flex: 0 0 auto; }

/* Overview rows: both players visible, so a row reads as ONE match.
   The earlier design listed single names and looked like opponents. */
.mrow {
  background: #fff; border-radius: 12px; margin-bottom: 9px; overflow: hidden;
  border: 1px solid transparent; box-shadow: 0 2px 8px rgba(20, 49, 42, .06);
  display: flex; width: 100%; padding: 0; cursor: pointer; font-family: inherit;
}
.mrow.todo { border-color: var(--accent-warm); }
.mrow-players { flex: 1; }
.mrow-p { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 14px; text-align: left; }
.mrow-p + .mrow-p { border-top: 1px solid #F0F3F1; }
.mrow-p.picked { font-weight: 700; }
.mrow-p.picked .vsdot { background: var(--accent); border-color: var(--accent); }
.mrow-p.picked .vsdot::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #fff; }
.mrow-p.not { color: var(--muted); }
.mrow-p.beaten { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.vsdot {
  width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--line);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.mrow-side {
  width: 58px; flex-shrink: 0; border-left: 1px solid #F0F3F1;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Sora', sans-serif; font-size: 11.5px; font-weight: 700; color: var(--muted);
}
.mrow-side.hit { color: var(--win); background: #F3FAF6; }
.mrow-side.missed { color: var(--miss); background: #FDF4F1; }
.mrow.todo .mrow-side { color: var(--accent-warm); background: #FDF6F3; font-size: 10.5px; }

.round-group { margin-bottom: 18px; }
.round-group-label {
  font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin-bottom: 9px;
  display: flex; justify-content: space-between;
}

/* --- Responsive ------------------------------------------------------------ */

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .burger { display: flex; }
  .mobile-only { display: block; }
  .desktop-only { display: none; }

  .sidenav {
    position: fixed; top: 0; left: 0; bottom: 0; width: 250px; z-index: 50;
    border-radius: 0; padding: 20px 12px; transform: translateX(-100%);
    transition: transform .22s ease; background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(24px);
  }
  .sidenav.open { transform: translateX(0); }
  .scrim { position: fixed; inset: 0; background: rgba(20, 49, 42, .3); z-index: 49; }

  .shell { padding: 16px 14px 40px; }
  .panel { padding: 18px 16px; }
  h1 { font-size: 25px; }
}

/* Decided matches on the phone read the same as on desktop:
   green for the player who actually won, struck-through red for
   the one who lost. Without these the only colour on a phone was
   the points tag. */
.mpick.won { border-color: var(--win); background: #EAF6EF; font-weight: 600; }
.mpick.lost {
  background: #FBF1EE; color: var(--muted);
  text-decoration: line-through; text-decoration-thickness: 1px;
}
.mpick .mark { margin-left: auto; text-decoration: none; }

/* Chrome paints saved credentials in its own pale blue — the only cool
   colour in the product. Repaint it to match the input. The absurd
   transition delay is the standard trick: Chrome overrides background
   directly, so we out-wait it rather than fight it. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #FFFDF9 inset;
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  transition: background-color 9999s ease-out 0s;
}

/* No global anchor colour existed, so any <a> not covered by a component
   rule fell through to the browser default blue — visible on the mobile
   pools list where the same title renders forest on desktop. */
a, a:visited { color: var(--accent-warm); text-decoration: none; }
a:hover { text-decoration: underline; }
