/* onegoal — the Classic design in dark and day modes, with team palettes (FR-UI-5).
   Read docs/DESIGN.md and docs/UI_TOKENS.md for the current direction.
   Each feature area owns a hue (경기=green, 포메이션=blue, Goald=gold,
   뱃지=purple); a page sets `--section`/`--section-soft` once (via
   body[data-section]) and every accented element in it — h1, primary
   button, card rail — reads that variable instead of hardcoding a color.
   That's what keeps a multi-color palette from turning into random
   decoration: the color always means "which feature area is this."

   Two type voices: Pretendard (Korean-native variable webfont) carries
   every word — body and headings both, differentiated by weight/size,
   not a second family. Oswald — a condensed sports-scoreboard face —
   carries general numerals. It has no Hangul glyphs, so it only ever touches Latin/numeral runs.

   See .claude/skills/onegoal-ui/SKILL.md before adding a new pattern. */

@font-face {
  font-family: "Pretendard Variable";
  src: url("../fonts/pretendard/PretendardVariable.302ec55f5b43.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Oswald";
  src: url("../fonts/oswald/Oswald.ffe9883ec811.ttf") format("truetype");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

/* Classic design tokens (ADR-0037): one design, dark by default. */
:root {
  color-scheme: dark;
  --bg: #151a20;
  --surface: #202730;
  --surface-raised: #2b3440;
  --surface-recessed: #1a2028;
  --ink: #eef2f7;
  --muted: #adb9c8;
  --line: #3b4654;
  --line-strong: #7d8c9f;
  --frame: var(--line);
  --shadow-color: #15121d;
  --green: #75c991;
  --green-soft: #253d30;
  --green-ink: #a0e0b4;
  --blue: #80aafa;
  --blue-soft: #243550;
  --blue-ink: #b2ceff;
  --gold: #e5bf64;
  --gold-soft: #3e3625;
  --gold-ink: #efd69c;
  --purple: #bba0f3;
  --purple-soft: #362d49;
  --purple-ink: #d9c7ff;
  --teal: #67cbbc;
  --teal-soft: #203d39;
  --teal-ink: #a4e4d9;
  --red: #f09292;
  --red-soft: #442d33;
  --red-ink: #ffc0c0;
  --silver: #94a3b8;
  --bronze: #b4783c;
  --pitch: #295844;
  --pitch-stripe: #244d3c;
  --control-ink: #15201b;
  --focus-ring: var(--blue-ink);
  --score-bg: var(--surface);
  --score-ink: var(--ink);
  --seal-ink: var(--green-ink);
  --seal-paper: var(--green-soft);
  --brand: var(--green);
  --brand-soft: var(--green-soft);
  --brand-ink: var(--green-ink);
  --section: var(--brand);
  --section-soft: var(--brand-soft);
  --section-ink: var(--brand-ink);
  --font-body: "Pretendard Variable", Pretendard, -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 20px;
  --space-5: 32px;
  --space-6: 48px;
  --radius-sm: 8px;
  --radius-field: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .12);
  --shadow: 0 8px 24px rgba(0, 0, 0, .22);
  --depth: 0 2px 8px rgba(0, 0, 0, .12);
  --content-width: 1360px;
  --content-width-focused: 1120px;
  --content-width-reading: 920px;
  /* Finite motion (ADR-0038): the only durations and easing a page may use. */
  --motion-quick: 160ms;
  --motion-reveal: 320ms;
  --motion-draw: 700ms;
  --ease-out: cubic-bezier(.22, .61, .36, 1);
  /* Where a cropped photo keeps its subject: a face sits in the upper part of a
     portrait, so every round avatar crops towards it (FR-PROFILE-1, FR-TEAM-18). */
  --avatar-focus: 50% 30%;
  /* The live scoreboard (FR-MATCH-29): a stadium board, dark in both modes. */
  --scoreboard-bg: #11161c;
  --scoreboard-ink: #f3f5f7;
  --scoreboard-muted: #9aa4b1;
  --scoreboard-line: #2a333d;
  --scoreboard-accent: #ffd166;
}

:root[data-theme="day"] {
  color-scheme: light;
  --shadow-color: #b7a7bc;
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-raised: #edf0f5;
  --surface-recessed: #f8f9fc;
  --ink: #12151c;
  --muted: #626d7c;
  --line: #e4e7ee;
  --line-strong: #8792a2;
  --green: #15803d;
  --green-soft: #dcfce7;
  --green-ink: #166534;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --blue-ink: #1d4ed8;
  --gold: #a16207;
  --gold-soft: #fef3c7;
  --gold-ink: #854d0e;
  --purple: #7c3aed;
  --purple-soft: #ede9fe;
  --purple-ink: #6d28d9;
  --teal: #0f766e;
  --teal-soft: #ccfbf1;
  --teal-ink: #0f766e;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --red-ink: #b91c1c;
  --control-ink: #ffffff;
  --shadow-sm: 0 1px 2px rgba(18, 21, 28, .05);
  --shadow: 0 2px 4px rgba(18, 21, 28, .04), 0 8px 20px rgba(18, 21, 28, .10);
  --depth: 0 1px 2px rgba(18, 21, 28, .04), 0 4px 12px rgba(18, 21, 28, .06);
}
/* No-JS fallback: follow a light device preference until theme.js runs; an explicit
   selection always wins over device preference. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --shadow-color: #b7a7bc;
    --bg: #f5f6fa;
    --surface: #ffffff;
    --surface-raised: #edf0f5;
    --surface-recessed: #f8f9fc;
    --ink: #12151c;
    --muted: #626d7c;
    --line: #e4e7ee;
    --line-strong: #8792a2;
    --green: #15803d;
    --green-soft: #dcfce7;
    --green-ink: #166534;
    --blue: #2563eb;
    --blue-soft: #dbeafe;
    --blue-ink: #1d4ed8;
    --gold: #a16207;
    --gold-soft: #fef3c7;
    --gold-ink: #854d0e;
    --purple: #7c3aed;
    --purple-soft: #ede9fe;
    --purple-ink: #6d28d9;
    --teal: #0f766e;
    --teal-soft: #ccfbf1;
    --teal-ink: #0f766e;
    --red: #dc2626;
    --red-soft: #fee2e2;
    --red-ink: #b91c1c;
    --control-ink: #ffffff;
    --shadow-sm: 0 1px 2px rgba(18, 21, 28, .05);
    --shadow: 0 2px 4px rgba(18, 21, 28, .04), 0 8px 20px rgba(18, 21, 28, .10);
    --depth: 0 1px 2px rgba(18, 21, 28, .04), 0 4px 12px rgba(18, 21, 28, .06);
}
}

/* FR-UI-5: signed-in team palettes (BD1G home kit: maroon/orange;
   away crest: navy/white). They change
   surfaces and the brand color only; results, sections and rewards keep meaning. */
:root[data-palette="home"]:not([data-theme="day"]) {
  --bg: #1a0f12; --surface: #261619; --surface-raised: #331e22; --surface-recessed: #1f1215;
  --ink: #f7eeee; --muted: #c9b3b6; --line: #45292f; --line-strong: #93747a;
  --brand: #e07b39; --brand-soft: #3f2218; --brand-ink: #f4a874;
  --control-ink: #24100a; --focus-ring: #f4a874;
}
:root[data-palette="home"][data-theme="day"] {
  --bg: #f8f5f4; --surface: #ffffff; --surface-raised: #f2ebea; --surface-recessed: #fcfaf9;
  --ink: #22151a; --muted: #6f5b60; --line: #ebe1e1; --line-strong: #9b8489;
  --brand: #6b1f2e; --brand-soft: #f6e4e3; --brand-ink: #6b1f2e;
  --control-ink: #ffffff; --focus-ring: #c4581a;
}
:root[data-palette="away"]:not([data-theme="day"]) {
  --bg: #000f24; --surface: #0a1d3a; --surface-raised: #13284a; --surface-recessed: #061630;
  --ink: #eef3fb; --muted: #a9b6cc; --line: #20365a; --line-strong: #6d82a5;
  --brand: #f4f7fc; --brand-soft: #1b3159; --brand-ink: #dce7fa;
  --control-ink: #001838; --focus-ring: #ffffff;
}
:root[data-palette="away"][data-theme="day"] {
  --bg: #f1f4f9; --surface: #ffffff; --surface-raised: #e7edf6; --surface-recessed: #f7f9fc;
  --ink: #0b1a33; --muted: #56657d; --line: #dce3ee; --line-strong: #7c8ba4;
  --brand: #0b2a5e; --brand-soft: #e3eaf6; --brand-ink: #0b2a5e;
  --control-ink: #ffffff; --focus-ring: #3b5b9a;
}

body[data-section="formations"] { --section: var(--blue); --section-soft: var(--blue-soft); --section-ink: var(--blue-ink); }
body[data-section="goald"] { --section: var(--gold); --section-soft: var(--gold-soft); --section-ink: var(--gold-ink); }
body[data-section="badges"] { --section: var(--purple); --section-soft: var(--purple-soft); --section-ink: var(--purple-ink); }
body[data-section="attendance"] { --section: var(--teal); --section-soft: var(--teal-soft); --section-ink: var(--teal-ink); }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--font-body);
}

h1, h2, h3 { line-height: 1.3; margin: 0 0 var(--space-3); font-weight: 700; letter-spacing: -.025em; }
h1 { font-size: 24px; }
h2 { font-size: 17px; margin-top: var(--space-6); }
.hero { font-size: 30px; }

p { margin: 0 0 var(--space-3); }

a { color: var(--section-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }

/* numerals — scores, balances, quarter counts, etc. */
.num {
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
td.num, th.num { text-align: right; }
.num.pos { color: var(--green-ink); }
.num.neg { color: var(--red-ink); }

/* --- icons --- */
.icon-sprite { display: none; }
.icon {
  width: 1em;
  height: 1em;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -.15em;
  flex: none;
}

/* --- header --- */
header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface-recessed);
  border-bottom: 2px solid var(--frame);
  box-shadow: 0 3px 0 var(--shadow-color);
}
/* Identity stays in the top bar. FR-UI-2 moves navigation into a persistent
   desktop sidebar or the mobile full menu, keeping labels comfortably sized. */
header.site .bar {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
header.site .brand { font-size: 22px; font-weight: 900; letter-spacing: -.045em; color: var(--ink); display: flex; align-items: center; min-height: 44px; gap: var(--space-2); flex: none; }
.brand-logo { display: flex; align-items: center; gap: 4%; width: 176px; }
.brand-symbol { display: block; width: 26%; height: auto; }
.brand-wordmark { display: block; width: 70%; height: auto; filter: brightness(0) invert(1); }
/* FR-UI-5: the app header shows the neutral wordmark only, so it suits every team palette. */
header.site .brand-symbol { display: none; }
header.site .brand-logo { width: 128px; }
header.site .brand-wordmark { width: 100%; }
:root[data-theme="day"] .brand-wordmark { filter: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .brand-wordmark { filter: none; }
}
header.site .brand { padding: 12px 0; }
header.site .bar-team {
  font-size: 14px; font-weight: 700; color: var(--section-ink);
  background: transparent; padding: 3px 10px; border: 0; border-radius: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw;
}
header.site .spacer { flex: 1 1 auto; }

header.site .site-nav { border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
header.site .site-nav::-webkit-scrollbar { display: none; }
header.site .nav-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-2) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
header.site nav a {
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 48px;
  font-size: 16px;
  font-weight: 600;
  padding: 10px var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
header.site nav a:hover { color: var(--ink); background: var(--surface-raised); text-decoration: none; }
header.site nav a.active { color: var(--nav-tone, var(--brand-ink)); background: var(--nav-tone-soft, var(--brand-soft)); border-color: currentColor; box-shadow: 2px 2px 0 var(--shadow-color); font-weight: 800; }
header.site nav a.active .icon { color: inherit; }
header.site nav a .icon { width: 22px; height: 22px; color: var(--nav-tone, currentColor); }
header.site .nav-sep { width: 1px; height: 18px; background: var(--line); margin: 0 var(--space-2); flex: none; }
header.site nav a.n-matches { --nav-tone: var(--brand-ink); --nav-tone-soft: var(--brand-soft); }
header.site nav a.n-formations { --nav-tone: var(--blue-ink); --nav-tone-soft: var(--blue-soft); }
header.site nav a.n-attendance { --nav-tone: var(--teal-ink); --nav-tone-soft: var(--teal-soft); }
header.site nav a.n-goald { --nav-tone: var(--gold-ink); --nav-tone-soft: var(--gold-soft); }
header.site nav a.n-badges { --nav-tone: var(--purple-ink); --nav-tone-soft: var(--purple-soft); }
header.site nav a.n-card, header.site nav a.n-members { --nav-tone: var(--ink); --nav-tone-soft: var(--line); }

/* --- account entry --- */
.usermenu { position: relative; flex: none; }
.u-trigger {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  padding: 5px var(--space-2) 5px 5px;
  gap: var(--space-2);
  border-radius: var(--radius-sm);
}
.u-trigger:hover { background: var(--bg); text-decoration: none; }
.u-avatar {
  width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex: none;
  background: var(--line); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.u-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: var(--avatar-focus); }
.u-avatar .icon { width: 20px; height: 20px; }
.u-name { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-caption { display: none; }
.u-caret { width: 14px; height: 14px; color: var(--muted); transition: transform .15s ease; }
.u-trigger[aria-expanded="true"] .u-caret { transform: rotate(180deg); }
.u-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  border: 1px solid var(--line-strong);
  z-index: 20;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--depth);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
}
.u-menu[hidden] { display: none; }
.u-menu a { color: var(--ink); font-size: 14px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); }
.u-menu a:hover { background: var(--bg); text-decoration: none; }

@media (max-width: 560px) {
  .u-name { display: none; }
  .u-caption { display: inline; }
  .u-trigger[data-account-open] .u-caret { display: none; }
  .notification-trigger { position: relative; width: 48px; }
  .notification-trigger .notification-count { position: absolute; top: -4px; right: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

main {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-6);
}

/* --- flash messages (allauth etc.) - FR-UI-1 --- */
ul.messages { list-style: none; margin: 0 0 var(--space-4); padding: 0; }
ul.messages li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--section-soft);
  color: var(--section-ink);
  font-size: 13px;
  margin-bottom: var(--space-2);
  transition: opacity .2s ease, transform .2s ease;
}
ul.messages li.error { border-left: 3px solid var(--red); }
ul.messages li.leaving { opacity: 0; transform: translateY(-4px); }
ul.messages .msg-text { flex: 1; }
ul.messages .msg-close {
  flex: none;
  background: none;
  border: 0;
  padding: 0 var(--space-1);
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: .6;
}
ul.messages .msg-close:hover,
ul.messages .msg-close:focus-visible { opacity: 1; }

/* --- tables (dense data: History) --- */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
}

/* --- empty state --- */
.empty {
  text-align: center;
  color: var(--muted);
  padding: var(--space-6) var(--space-4);
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px dashed var(--line);
  box-shadow: none;
}

/* --- buttons / forms --- */
button, .btn {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  border: 2px solid var(--frame);
  background: var(--section);
  color: var(--control-ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
button.secondary, .btn.secondary { background: var(--surface-raised); color: var(--ink); border-color: var(--line-strong); }
:is(button, .btn).danger { background: var(--red); border-color: var(--frame); }
button:disabled { opacity: 1; background: var(--surface-raised); color: var(--muted); border-color: var(--line); cursor: default; }
button[hidden], .btn[hidden] { display: none; }

/* Owner request 2026-10-23 F3: onegoal's own controls. Fields share one shape -
   a 10px-cornered surface with a thin strong border that turns brand on hover
   and focus with a soft brand ring; selects draw their own thin chevron;
   checkboxes are rounded squares and radios rings that fill with the brand
   colour. Every colour is a token, so dark/day and the team palettes follow. */
input, select, textarea {
  font: inherit;
  font-size: 14px;
  padding: var(--space-2) var(--space-3);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-field);
  background: var(--surface);
  color: var(--ink);
  transition: border-color .12s ease, box-shadow .12s ease;
}
:is(input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"]), select, textarea):hover { border-color: var(--muted); }
:is(input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"]), select, textarea):focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); outline: none; }
:is(input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"]), select, textarea):focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"]), select { min-height: 44px; }
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
select:focus { background-image: linear-gradient(45deg, transparent 50%, var(--brand) 50%), linear-gradient(135deg, var(--brand) 50%, transparent 50%); }
input[type="checkbox"], input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  flex: none; width: 20px; height: 20px; min-height: 0; margin: 0; padding: 0;
  border: 1.5px solid var(--line-strong); background: var(--surface);
  display: inline-grid; place-content: center; vertical-align: middle; cursor: pointer;
}
input[type="checkbox"] { border-radius: 6px; }
input[type="radio"] { border-radius: 50%; }
:is(input[type="checkbox"], input[type="radio"]):hover { border-color: var(--brand); }
input[type="checkbox"]::before {
  content: ""; width: 11px; height: 11px; background: var(--control-ink); transform: scale(0);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); transition: transform .1s ease;
}
input[type="checkbox"]:checked { border-color: var(--brand); background-color: var(--brand); }
input[type="checkbox"]:checked::before { transform: scale(1); }
input[type="radio"]:checked { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 4px var(--surface); }
:is(input[type="checkbox"], input[type="radio"]):focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
:is(input[type="checkbox"], input[type="radio"]):disabled { opacity: .5; cursor: default; }
@media (forced-colors: active) { input[type="checkbox"], input[type="radio"] { appearance: auto; -webkit-appearance: auto; } input[type="checkbox"]::before { content: none; } }

input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
::selection { background: var(--brand); color: var(--control-ink); }
button:not(:disabled):hover, .btn:hover { text-decoration: none; }
:where(button, .btn):not(:where(:disabled, .msg-close, .modal-close, .u-trigger, .auth-password-toggle)) { box-shadow: 0 3px 0 var(--shadow-color); transition: transform .1s ease, box-shadow .1s ease; }
:where(button, .btn):not(:where(:disabled, .msg-close, .modal-close, .u-trigger, .auth-password-toggle)):active { transform: translateY(2px); box-shadow: 0 1px 0 var(--shadow-color); }

label {
  font-size: 13px;
  color: var(--muted);
  display: inline-flex;
  flex-direction: column;
  gap: var(--space-1);
}

form.inline, div.inline { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: end; margin: var(--space-3) 0; }
/* Keep secondary links on the same row height as fields and buttons. */
:where(form.inline, div.inline) > a { display: inline-flex; align-items: center; min-height: 44px; }

/* --- plain lists --- */
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: var(--space-2) 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: none; }

/* --- surface card + grid --- */
.surface {
  background: var(--surface);
  border: 2px solid var(--frame);
  border-radius: var(--radius);
  box-shadow: var(--depth);
  padding: var(--space-4);
  position: relative;
  overflow: hidden;
}
.surface::before { content: none; }

.grid { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
.hero-cta { max-width: 420px; }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2); }
@media (min-width: 620px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* Workflow colors are independent of collectible badges and card tiers. */
:root { --status-success-bg: #203f3d; --status-success-ink: #a9e4d4; --status-pending-bg: #4b3431; --status-pending-ink: #ffd0ae; --status-live-bg: #432f53; --status-live-ink: #e7c5ff; }
:root[data-theme="day"] { --status-success-bg: #d9eee7; --status-success-ink: #236052; --status-pending-bg: #fae4d4; --status-pending-ink: #854729; --status-live-bg: #eee1f6; --status-live-ink: #70438c; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) { --status-success-bg: #d9eee7; --status-success-ink: #236052; --status-pending-bg: #fae4d4; --status-pending-ink: #854729; --status-live-bg: #eee1f6; --status-live-ink: #70438c; }
}
/* --- status tabs; the .pill name preserves existing template/JS hooks --- */
.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid currentColor;
  border-bottom-width: 3px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 700;
  background: var(--pill-bg, var(--surface-raised));
  color: var(--pill-fg, var(--ink));
  white-space: nowrap;
}
.pill-win { --pill-bg: var(--green-soft); --pill-fg: var(--green-ink); }
.pill-draw { --pill-bg: var(--gold-soft); --pill-fg: var(--gold-ink); }
.pill-loss { --pill-bg: var(--red-soft); --pill-fg: var(--red-ink); }
.pill-pending { --pill-bg: var(--status-pending-bg); --pill-fg: var(--status-pending-ink); }
.pill-approved { --pill-bg: var(--status-success-bg); --pill-fg: var(--status-success-ink); }
.pill-rejected { --pill-bg: var(--red-soft); --pill-fg: var(--red-ink); }
.pill-badge { --pill-bg: var(--purple-soft); --pill-fg: var(--purple-ink); }
.pill-live { --pill-bg: var(--status-live-bg); --pill-fg: var(--status-live-ink); }
.pill-group { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.pill-live::before {
  content: "";
  width: 5px; height: 9px;
  background: var(--red);
}

/* Match result tiles are intentionally different from workflow status tabs.
   W/D/L are decorative HTML beside a real Korean result label. */
.result-mark {
  --result-color: var(--gold);
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 9px 3px 5px; min-height: 32px;
  border: 2px solid var(--frame); border-radius: 5px;
  background: var(--result-color); color: var(--control-ink);
  box-shadow: 2px 2px 0 var(--shadow-color);
  font-size: 12px; font-weight: 800; line-height: 1.25; white-space: nowrap;
}
.result-mark.pill-win { --result-color: var(--green); }
.result-mark.pill-loss { --result-color: var(--red); }
.result-mark b {
  min-width: 22px; padding-right: 7px; border-right: 2px solid currentColor;
  font: 700 20px/1.2 var(--font-display); text-align: center;
}
.record-seal {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border: 2px dashed var(--seal-ink);
  border-radius: 4px; background: var(--seal-paper); color: var(--seal-ink);
  font-size: 12px; font-weight: 800; line-height: 1.5; white-space: nowrap;
}
.record-seal .icon { width: 14px; height: 14px; stroke-width: 3; }

/* --- match card --- */
.match-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-left: 4px solid var(--card-accent, var(--line));
}
a.match-card, a.review-card { color: inherit; text-decoration: none; }
a.match-card { transition: background .15s ease, border-color .15s ease; }
a.match-card:hover { background: var(--surface-raised); box-shadow: var(--depth), 0 0 0 1px var(--card-accent, var(--line)) inset; }
/* The whole card is the control: highlight its frame on hover, darken it
   on press, and show where it leads. */
.match-card.tappable { cursor: pointer; }
.match-card.tappable:hover { border-color: var(--card-accent, var(--line-strong)); }
.match-card.tappable:hover .m-go { transform: translateX(3px); color: var(--card-accent, var(--section)); }
.match-card.tappable:active { background: var(--surface-recessed); box-shadow: var(--shadow-sm); }
.match-card .m-go { width: 20px; height: 20px; color: var(--line); flex: none; transition: transform .15s ease, color .15s ease; }
.match-card .m-hint { color: var(--muted); font-size: 13px; }
.match-card .m-info { flex: 1 1 auto; min-width: 0; }
.match-card .m-opponent { font-weight: 700; margin-bottom: 2px; }
.match-card .m-date { color: var(--muted); font-size: 13px; }
.match-card .m-action { margin-top: var(--space-1); font-size: 13px; }
.match-card .m-score { font-family: var(--font-display); font-size: 26px; text-align: right; }
/* FR-MATCH-33: confirmed attendance has no implied win/draw/loss. */
.match-card[data-record-state="unarchived"] { --card-accent: var(--line-strong); }
.historical-result-label { color: var(--muted); font-size: 13px; white-space: nowrap; }
.historical-match { margin-block: var(--space-4); }
.historical-attendees { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-4); }
.historical-attendees li { display: flex; align-items: center; gap: var(--space-2); }
.historical-identity { margin-top: var(--space-4); }
.historical-match-list li + li { border-top: 1px solid var(--line); }
.historical-match-list a { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-2); min-height: 48px; padding-block: var(--space-2); }
.match-card .m-quarter { color: var(--muted); font-size: 12px; text-align: right; }
.match-card.win, .match-card.team-link { --card-accent: var(--green); }
.match-card.draw { --card-accent: var(--gold); }
.match-card.loss { --card-accent: var(--red); }

/* --- review card --- */
.review-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-left: 4px solid var(--gold);
}
.review-card .r-info { flex: 1 1 auto; min-width: 0; }
.review-card .r-title { font-weight: 700; margin-bottom: 2px; }
.review-card .r-meta { color: var(--muted); font-size: 13px; }
.review-card .r-actions { display: flex; gap: var(--space-2); align-items: center; flex: none; }
/* FR-MATCH-37: the schedule notice reuses .r-actions with one plain POST form per action, side by side. */
.schedule-notice .r-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-top: var(--space-3); }
.schedule-notice .r-actions form { display: contents; }

/* --- stat card row --- */
.stat-row { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-bottom: var(--space-5); }
.stat-card {
  flex: 1 1 120px;
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
/* the dashboard's bento `.cell.stat` is the same component in a grid cell
   instead of a flex row, so it shares every rule below except the sizing. */
.stat-card .icon, .cell.stat .icon { width: 28px; height: 28px; padding: 6px; border-radius: var(--radius-sm); background: var(--section-soft); color: var(--section-ink); box-sizing: content-box; }
.stat-card.tone-gold .icon, .cell.stat.tone-gold .icon { background: var(--gold-soft); color: var(--gold-ink); }
.stat-card.tone-purple .icon, .cell.stat.tone-purple .icon { background: var(--purple-soft); color: var(--purple-ink); }
.stat-card .s-value, .cell.stat .s-value { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1; }
.stat-card .s-label, .cell.stat .s-label { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* --- player card --- */
.card {
  width: 200px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  box-shadow: var(--depth);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  text-align: center;
  color: var(--ink);
  border: 2px solid var(--frame);
  background: linear-gradient(180deg, var(--tier-color) 0 28%, var(--surface) 28%);
}
.card .avatar, .mini-card .avatar {
  position: relative;
  z-index: 1;
  border-radius: 50%;
  border: 2px solid var(--frame);
  box-shadow: 2px 2px 0 var(--shadow-color);
  overflow: hidden;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.card .avatar { width: 30%; aspect-ratio: 1; margin-bottom: var(--space-1); }
.mini-card .avatar { width: 40%; aspect-ratio: 1; margin-bottom: 2px; }
.card .avatar svg, .mini-card .avatar svg { width: 60%; height: 60%; color: var(--muted); }
.card .avatar img, .mini-card .avatar img { width: 100%; height: 100%; object-fit: cover; object-position: var(--avatar-focus); }
.card.tier-bronze { --tier-color: var(--bronze); }
.card.tier-silver { --tier-color: var(--silver); }
.card.tier-gold { --tier-color: var(--gold); }
.card.tier-emerald { --tier-color: var(--teal); }
.card::before { content: none; }
.card .icon { width: 22px; height: 22px; opacity: .85; }
.card .label { font-size: 12px; letter-spacing: .04em; opacity: .85; }
.card .level { font-family: var(--font-display); font-size: 64px; font-weight: 600; line-height: 1; }

/* --- the card face (FR-BADGE-5): who, level and tier, three contribution marks.
   Ornaments open per tier; every one is an opaque line, face or icon. --- */
.card { gap: 2px; padding: var(--space-3) var(--space-2); }
.card .card-name { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 700; max-width: 100%; }
.card .card-name .shirt { font-size: 11px; min-width: 20px; height: 20px; }
.card .card-team { position: relative; z-index: 1; font-size: 11px; color: var(--muted); }
.card .card-level { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; margin-top: var(--space-1); }
.card .card-level .level { font-size: 40px; }
.card .card-tier { position: relative; z-index: 1; font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--tier-color); }
.card .card-marks { position: relative; z-index: 1; display: flex; gap: var(--space-3); margin-top: var(--space-1); }
.card .card-marks li { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; color: var(--muted); border-bottom: 0; padding: 0; }
.card .card-marks .icon { width: 14px; height: 14px; opacity: 1; color: var(--muted); }
.card .card-marks .num { color: var(--ink); }
/* the celebration band (ADR-0038): off-card at rest, moved by my-card.mjs on upgrade */
.card .card-sweep { position: absolute; top: 0; bottom: 0; left: 0; width: 40%; background: var(--tier-color); opacity: .3; transform: translateX(-150%); pointer-events: none; }
/* silver: the avatar ring and an inner line take the tier colour */
.card.tier-silver .avatar, .card.tier-gold .avatar, .card.tier-emerald .avatar { border-color: var(--tier-color); }
.card.tier-silver::after, .card.tier-gold::after, .card.tier-emerald::after {
  content: ""; position: absolute; inset: 6px; border: 1px solid var(--tier-color);
  border-radius: calc(var(--radius) - 6px); pointer-events: none;
}
/* gold: corner marks and an underlined tier name */
.card .card-corner { display: none; position: absolute; width: 10px; height: 10px; border: 2px solid var(--tier-color); pointer-events: none; }
.card.tier-gold .card-corner, .card.tier-emerald .card-corner { display: block; }
.card .card-corner.tl { top: 12px; left: 10px; border-right: 0; border-bottom: 0; }
.card .card-corner.tr { top: 12px; right: 10px; border-left: 0; border-bottom: 0; }
.card .card-corner.bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; }
.card .card-corner.br { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }
.card.tier-gold .card-tier { border-bottom: 2px solid var(--tier-color); }
/* emerald: a thicker rail, a heavier avatar ring and the tier name as a soft pill */
.card.tier-emerald { border-top-width: 10px; }
.card.tier-emerald .avatar { border-width: 3px; }
.card.tier-emerald .card-tier { background: var(--teal-soft); color: var(--teal-ink); padding: 1px 8px; border-radius: 6px; }
/* mini: numbers only; the content sets the height (a fixed 3:4 box crushed it) */
.mini-card { width: 112px; aspect-ratio: auto; min-height: 136px; gap: 1px; padding: 8px 4px; }
.mini-card .avatar { width: 34%; }
.mini-card .card-name { font-size: 11px; gap: 2px; }
.mini-card .card-name .shirt { display: none; }
.mini-card .card-team, .mini-card .card-marks .icon { display: none; }
.mini-card .card-level { margin-top: 0; }
.mini-card .card-level .label { font-size: 9px; }
.mini-card .card-level .level { font-size: 24px; }
.mini-card .card-tier { font-size: 10px; }
.mini-card .card-marks { gap: 6px; margin-top: 0; }
.mini-card .card-marks li { font-size: 11px; }
.mini-card::after { inset: 4px; border-radius: calc(var(--radius-sm) - 4px); }
.mini-card .card-corner { width: 6px; height: 6px; }
.mini-card .card-corner.tl, .mini-card .card-corner.tr { top: 8px; }
.mini-card .card-corner.tl, .mini-card .card-corner.bl { left: 7px; }
.mini-card .card-corner.tr, .mini-card .card-corner.br { right: 7px; }
.mini-card .card-corner.bl, .mini-card .card-corner.br { bottom: 7px; }
.mini-card.tier-emerald { border-top-width: 8px; }
.profile-card-body .mini-card { width: 128px; }
/* Upgrade celebration (ADR-0038): my-card.mjs rewrites the face, sets data-motion="on"
   (start state) and two frames later "play"; the sweep crosses once, the number settles,
   newly opened ornaments fade in. Resting values above are the defaults. */
.card[data-motion="on"] .card-sweep { transform: translateX(-150%); }
.card[data-motion="on"] .card-level .level { transform: scale(1.25); }
.card[data-motion="on"] .card-corner, .card[data-motion="on"]::after { opacity: 0; }
.card[data-motion="play"] .card-sweep { transform: translateX(250%); transition: transform var(--motion-draw) var(--ease-out); }
.card[data-motion="play"] .card-level .level { transform: none; transition: transform var(--motion-reveal) var(--ease-out); }
.card[data-motion="play"] .card-corner, .card[data-motion="play"]::after { opacity: 1; transition: opacity var(--motion-reveal) var(--ease-out) 200ms; }

/* --- "어떻게 받나요?" disclosure (FR-BADGE-7): native details, no JS --- */
.explain { margin: 0 0 var(--space-4); }
.team-rules .rules-body { white-space: normal; line-height: 1.8; max-height: 60vh; overflow: auto; } /* FR-NOTICE-2 */
.explain summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 2px 12px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface-recessed); color: var(--ink);
  font-size: 13px; font-weight: 600; cursor: pointer; list-style: none;
}
.explain summary::-webkit-details-marker { display: none; }
.explain summary::before { content: "?"; display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; border-radius: 50%; background: var(--section-soft); color: var(--section-ink); font-size: 11px; }
.explain[open] summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.explain .explain-body { border: 1px solid var(--line); border-top: 0; border-radius: 0 6px 6px 6px; background: var(--surface-recessed); padding: var(--space-3) var(--space-4); font-size: 14px; }
.explain .explain-body li { border-bottom: 0; padding: 3px 0; }
.explain .explain-body .num { font-size: 15px; }

/* --- badge medallion (FR-BADGE-8): icon on a toned disc, a rarity ring, the name --- */
.medal-shelf { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.badge-shelf.medal-shelf { flex-direction: row; }
.badge-shelf.medal-shelf .badge-item { padding: 0; border-bottom: 0; }
.medal { --m-tone: var(--purple); --m-soft: var(--purple-soft); --m-ink: var(--purple-ink);
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.medal.tone-gold { --m-tone: var(--gold); --m-soft: var(--gold-soft); --m-ink: var(--gold-ink); }
.medal.tone-teal { --m-tone: var(--teal); --m-soft: var(--teal-soft); --m-ink: var(--teal-ink); }
.medal.tone-blue { --m-tone: var(--blue); --m-soft: var(--blue-soft); --m-ink: var(--blue-ink); }
.medal.tone-red { --m-tone: var(--red); --m-soft: var(--red-soft); --m-ink: var(--red-ink); }
.medal .m-disc {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--m-soft); color: var(--m-ink); border: 1px solid var(--line); box-sizing: border-box;
}
.medal.rarity-rare .m-disc { border: 2px solid var(--m-tone); }
.medal.rarity-epic .m-disc { border: 2px solid var(--m-tone); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--m-tone); }
.medal .m-name { font-size: 12px; font-weight: 700; color: var(--ink); max-width: 96px; }
.medal .m-meta { font-size: 11px; color: var(--muted); max-width: 120px; }
.medal.sm .m-disc { width: 40px; height: 40px; }
.medal.sm .m-disc .icon { width: 20px; height: 20px; }
.medal.sm .m-name { font-size: 11px; max-width: 72px; }
.medal.lg { width: 128px; }
.medal.lg .m-disc { width: 72px; height: 72px; }
.medal.lg .m-disc .icon { width: 34px; height: 34px; }
.medal.lg .m-name { font-size: 13px; max-width: 120px; }
.medal.locked .m-disc { background: var(--surface-recessed); color: var(--muted); border-color: var(--line); box-shadow: none; }
.medal.locked .m-name { color: var(--muted); }
.medal .medal-progress { width: 96px; height: 6px; margin-top: 2px; }
.medal .m-count { font-size: 11px; color: var(--muted); }
.medal .m-count .num { font-size: 12px; color: var(--ink); }
/* --- badge workshop (FR-BADGE-6): rows of medallion + condition + one action --- */
.form-error { color: var(--red-ink); background: var(--red-soft); border: 1px solid var(--red); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); font-size: 14px; }
.badge-admin-list { display: flex; flex-direction: column; gap: var(--space-2); }
.badge-admin-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--line); }
.badge-admin-row:last-child { border-bottom: 0; }
.badge-admin-row.off { opacity: .6; }
.badge-admin-row .ba-text { flex: 1 1 200px; min-width: 0; font-size: 14px; }
.badge-admin-row .ba-condition { font-weight: 600; }
.badge-admin-row form { margin-left: auto; }
.badge-form .badge-rule { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); margin-bottom: var(--space-3); }
.badge-form .badge-rule label { flex: 1 1 180px; }
.badge-form .badge-rule input[type="number"] { max-width: 120px; }
.chip-opt.chip-icon .icon { width: 18px; height: 18px; }
.chip-opt.tone-gold { color: var(--gold-ink); } .chip-opt.tone-purple { color: var(--purple-ink); } .chip-opt.tone-teal { color: var(--teal-ink); }
.chip-opt.tone-blue { color: var(--blue-ink); } .chip-opt.tone-red { color: var(--red-ink); }
.chip-radio:checked + .chip-opt.tone-gold { background: var(--gold-soft); border-color: var(--gold); }
.chip-radio:checked + .chip-opt.tone-purple { background: var(--purple-soft); border-color: var(--purple); }
.chip-radio:checked + .chip-opt.tone-teal { background: var(--teal-soft); border-color: var(--teal); }
.chip-radio:checked + .chip-opt.tone-blue { background: var(--blue-soft); border-color: var(--blue); }
.chip-radio:checked + .chip-opt.tone-red { background: var(--red-soft); border-color: var(--red); }

/* --- site-wide load motion (FR-UI-6, ADR-0038): onegoal.js flips html[data-motion]
   "on" (start states) then "play" (transitions to rest, the defaults above); the
   attribute is removed after 1.3 s so later DOM changes never transition. --- */
html[data-motion="on"] [data-reveal="ring"] .ring-arc { stroke-dasharray: 0 100; }
html[data-motion="play"] [data-reveal="ring"] .ring-arc { transition: stroke-dasharray var(--motion-draw) var(--ease-out); }
html[data-motion="play"] [data-reveal="ring"] .ring-arc.draw { transition-delay: 120ms; }
html[data-motion="play"] [data-reveal="ring"] .ring-arc.loss { transition-delay: 240ms; }
[data-reveal="bar"] progress, [data-reveal="bar"] .goal-chart rect { transform-box: fill-box; }
[data-reveal="bar"] progress { transform-origin: left center; }
[data-reveal="bar"] .goal-chart rect.bar-for { transform-origin: center bottom; }
[data-reveal="bar"] .goal-chart rect.bar-against { transform-origin: center top; }
html[data-motion="on"] [data-reveal="bar"] progress { transform: scaleX(0); }
html[data-motion="on"] [data-reveal="bar"] .goal-chart rect { transform: scaleY(0); }
html[data-motion="play"] [data-reveal="bar"] progress, html[data-motion="play"] [data-reveal="bar"] .goal-chart rect { transition: transform var(--motion-draw) var(--ease-out); }
html[data-motion="on"] [data-reveal="cells"] .grass i { opacity: 0; }
html[data-motion="play"] [data-reveal="cells"] .grass i { transition: opacity var(--motion-quick) var(--ease-out); transition-delay: min(calc(var(--i, 0) * var(--reveal-step, 25ms) + var(--j, 0) * 8ms), 1000ms); }
html[data-motion="on"] [data-reveal="rise"] > [data-rise] { transform: translateY(8px); opacity: 0; }
html[data-motion="play"] [data-reveal="rise"] > [data-rise] { transition: transform var(--motion-reveal) var(--ease-out), opacity var(--motion-reveal) var(--ease-out); transition-delay: min(calc(var(--i, 0) * var(--reveal-step, 25ms)), 880ms); }

/* Reviewed card leaves the queue once (ADR-0038): review-queue.mjs flips on -> play, then reloads. */
.review-card[data-motion="on"] { max-height: 600px; opacity: 1; }
.review-card[data-motion="play"] { max-height: 0; opacity: 0; margin-block: 0; padding-block: 0; border-width: 0; overflow: hidden;
  transition: max-height var(--motion-reveal) var(--ease-out), opacity var(--motion-quick) var(--ease-out), margin var(--motion-reveal) var(--ease-out), padding var(--motion-reveal) var(--ease-out); }

/* New-badge entrance (ADR-0038): my-badges.mjs flips data-motion once; rest is the default. */
.medal[data-motion="on"] .m-disc { transform: scale(.6); opacity: 0; }
.medal[data-motion="play"] .m-disc { transform: none; opacity: 1; transition: transform var(--motion-draw) var(--ease-out), opacity var(--motion-reveal) var(--ease-out); }

.badge-item { display: flex; align-items: center; gap: var(--space-3); }
.badge-item .icon { width: 28px; height: 28px; padding: 6px; border-radius: var(--radius-sm); background: var(--purple-soft); color: var(--purple-ink); box-sizing: content-box; }
.badge-item .b-name { font-weight: 700; }
.badge-item .b-meta { font-size: 13px; }

/* --- formation pitch --- */
.pitch-wrap { display: flex; justify-content: center; }
/* The pitch is a 100x150 viewBox, so every token dimension below is a
   percentage of pitch width, not pixels: a token circle of r=4.6 is 9.2%
   of the width. It used to be 6.5 (13%) on a 420px-wide pitch, which made
   eleven of them crowd the box and read as counters on a board game rather
   than players on a pitch. Bigger pitch, smaller tokens. */
#pitch { width: 100%; max-width: 500px; border-radius: var(--radius-sm); touch-action: none; display: block; }
.token circle { fill: var(--surface); stroke: var(--ink); stroke-width: 1; filter: drop-shadow(0 .7px .7px rgba(0, 0, 0, .35)); }
.token .token-num { font-family: var(--font-display); font-size: 5px; font-weight: 600; text-anchor: middle; dominant-baseline: central; fill: var(--ink); }
.token .token-name {
  font-family: var(--font-body);
  font-size: 3.6px;
  font-weight: 700;
  text-anchor: middle;
  fill: #fff;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, .55);
  stroke-width: .9px;
  stroke-linejoin: round;
}
.assign-row { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-1) 0; }
.assign-row span { width: 4.5rem; font-size: 13px; color: var(--muted); }

/* --- toast --- */
#toast-root {
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: calc(100vw - var(--space-4) * 2);
}
.toast {
  background: var(--surface-raised);
  color: var(--ink);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 13px;
  border-left: 4px solid var(--green);
  animation: toast-in .2s ease-out;
}
.toast.error { border-left-color: var(--red); }
.toast.warning { background: var(--gold-soft); color: var(--gold-ink); border-left-color: var(--gold); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* --- modal --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 16, .78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  z-index: 40;
}
.modal-backdrop[hidden] { display: none; }
.modal { width: 100%; max-width: 360px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.modal-head h2 { margin: 0; margin-top: 0; }
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  padding: var(--space-1);
  border-radius: var(--radius-sm);
}
.modal-close:hover { background: var(--bg); }

/* --- dashboard (logged-in home) --- */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.dash-head h1, .dash-head h2 { margin: 0; }
.dash-growth { display: flex; gap: var(--space-4); align-items: flex-start; }
.dash-badges { flex: 1 1 auto; min-width: 0; }
.dash-profile-link { margin-left: var(--space-3); }
.section-gap { margin-top: var(--space-6); }
.mini-card {
  width: 96px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-sm);
  box-shadow: var(--depth);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  border: 2px solid var(--frame);
  background: linear-gradient(180deg, var(--tier-color) 0 28%, var(--surface) 28%);
  flex: none;
  transform: none;
}
.mini-card::before { content: none; }
.mini-card .label, .mini-card .level { position: relative; z-index: 1; }
.mini-card .label { font-size: 10px; opacity: .85; }
.mini-card .level { font-family: var(--font-display); font-size: 32px; font-weight: 600; line-height: 1; }

/* --- feature list (logged-out landing) --- */
.feature-list { display: grid; gap: var(--space-3); grid-template-columns: 1fr; margin-top: var(--space-4); }
@media (min-width: 620px) { .feature-list { grid-template-columns: repeat(3, 1fr); } }
.feature-list .surface { display: flex; flex-direction: column; gap: var(--space-2); }
.feature-list .icon { width: 24px; height: 24px; padding: 6px; border-radius: var(--radius-sm); background: var(--green-soft); color: var(--green-ink); box-sizing: content-box; }
.feature-list h3 { margin: 0; font-size: 15px; }
.feature-list p { margin: 0; font-size: 13px; color: var(--muted); }

/* --- checkbox roster / record-submit form --- */
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--space-1) var(--space-3); }
.check-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
  color: var(--ink);
  padding: var(--space-1) 0;
}
.stat-input-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line);
}
.stat-input-row .p-name { flex: 1 1 auto; font-size: 14px; }
.stat-input-row input[type="number"] { width: 64px; }
#goal-log .goal-log-item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
#goal-log .empty-row { border-bottom: none; }

@media (max-width: 480px) {
  .match-card, .review-card { flex-wrap: wrap; }
  .review-card .r-actions { width: 100%; }
}

/* --- bento grid (dashboard) --- */
.bento { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.bento .cell { grid-column: span 2; }
.bento .cell.full { grid-column: 1 / -1; }
.bento .cell.stat { display: flex; align-items: center; gap: var(--space-3); }
@media (min-width: 620px) {
  .bento { grid-template-columns: repeat(4, 1fr); }
  .bento .cell.stat { grid-column: span 1; }
  .bento .cell.wide { grid-column: span 2; grid-row: span 2; }
}

/* --- "days since my last match" strip (dashboard) --- */
.dash-last {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-4) 0;
  flex-wrap: wrap;
}
.dash-last .l-figure {
  display: grid; grid-template-columns: auto auto; align-items: end; gap: 6px;
  min-width: 116px; padding: 12px;
  background: var(--score-bg); border: 2px solid var(--frame); border-radius: var(--radius-sm);
  box-shadow: 3px 3px 0 var(--shadow-color);
}
.dash-last .l-days { font-family: var(--font-display); font-size: 44px; font-weight: 700; line-height: 1; color: var(--score-ink); }
.dash-last .l-unit { font-size: 12px; color: var(--score-ink); font-weight: 700; padding-bottom: 2px; }
.dash-last .l-info { flex: 1 1 200px; min-width: 0; }
.dash-last .l-title { font-weight: 700; }
.dash-last .l-meta { color: var(--muted); font-size: 13px; }

/* FR-DASH-7: compact season / next fixture within the original card layout. */
.dash-season { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: var(--space-4); border-top: 3px solid var(--brand); }
.dash-season h2, .dash-next h2 { margin: 0; font-size: 15px; }
.dash-season-summary { flex: 1 1 180px; }
.dash-season-summary p { font-size: 12px; margin: 4px 0 0; color: var(--muted); }
.dash-season-record { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.dash-season-record > div { display: flex; align-items: center; gap: 8px; }
.dash-season-record dd { margin: 0; font-size: 24px; }
.dash-season > a, .dash-next > a { font-size: 13px; }
.dash-next { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-bottom: var(--space-4); }
.dash-next > div { flex: 1 1 200px; min-width: 0; }
.dash-next p { margin: 4px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.dash-next time { color: var(--section-ink); font-weight: 700; margin-right: 8px; }
.dash-result { display: flex; flex-direction: column; align-items: end; gap: 6px; }
.dash-result .m-score { white-space: nowrap; }
.dash-recent .m-opponent, .dash-last .l-meta { overflow-wrap: anywhere; }
.dash-recent .match-vote-status { display: flex; align-items: start; flex-direction: column; gap: 4px; }
.elapsed-time { display: inline-flex; align-items: center; border: 1px solid var(--frame); border-bottom-width: 3px; border-radius: 4px; background: var(--score-bg); color: var(--score-ink); }
.elapsed-time .num { padding: 1px 6px; font-size: 16px; }
.elapsed-time .elapsed-unit { padding: 2px 5px; border-left: 1px solid currentColor; color: var(--score-ink); font-size: 11px; }

/* --- attendance as a contribution graph ---
   One square per match played, oldest on the left, filled when the member was
   on that roster. A run of empty squares at the right-hand end is the thing
   worth seeing, so the recent-form label sits next to it rather than being
   something you count for yourself. */
.att-legend { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-3); }
.att-key { font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 1px; background: var(--surface-raised); color: var(--muted); }
.att-key.tier-top, .att-key.streak-hot { background: var(--green-soft); color: var(--green-ink); }
.att-key.tier-mid, .att-key.streak-cold { background: var(--gold-soft); color: var(--gold-ink); }
.att-key.tier-low, .att-key.streak-gone { background: var(--red-soft); color: var(--red-ink); }

.grass-wrap { overflow-x: auto; }
.grass-board { display: flex; flex-direction: column; gap: 3px; }
.grass-board.scroller { max-height: 420px; overflow-y: auto; padding-right: var(--space-2); }
/* FR-DASH-1/6: plain alternating row bands keep each name tied to its
   squares; a colour wash behind the grid competed with the attendance colours. */
.grass-data { min-width: max-content; flex: none; }
.grass-rows {
  --muted: var(--ink);
  display: flex; flex-direction: column; gap: 0;
  background: var(--surface);
  border-radius: var(--radius-sm);
}
.grass-rows .grass-row, .grass-row.head { padding-inline: var(--space-2); }
.grass-rows .grass-row { padding-block: 4px; border-radius: var(--radius-sm); }
.grass-rows .grass-row:nth-child(even) { background: var(--surface-recessed); }
.grass-rows .grass-row:hover { background: var(--section-soft); }
.grass-row {
  display: grid;
  grid-template-columns: 84px auto 46px;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
}
.grass-board.full .grass-row { grid-template-columns: 150px auto 52px 132px; }
.grass-row.head { color: var(--muted); font-size: 11px; font-weight: 700; padding-bottom: 2px; }
.grass-row .g-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.grass-row .g-count { color: var(--muted); font-size: 12px; text-align: right; }
.grass { display: flex; gap: 3px; }
.grass i {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  background: var(--line);
  flex: none;
}
/* Four steps of a run, not on/off: turning up three weeks straight should
   look different from turning up once, which is the whole point of reading
   the grid as a shape rather than counting squares.

   Opacity on one background, not `color-mix` on four. color-mix is a single
   declaration that an older browser drops whole - and dropping it does not
   fall back to a paler square, it falls back to `--line`, so every attended
   match turns grey and the graph stops saying anything at all. */
.grass i.lv1 { background: var(--section-ink); opacity: .42; }
.grass i.lv2 { background: var(--section-ink); opacity: .6; }
.grass i.lv3 { background: var(--section-ink); opacity: .8; }
.grass i.lv4 { background: var(--section-ink); opacity: 1; }
/* An absence is an empty outlined square, so it never reads as a pale attendance. */
.grass i.lv0 { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
/* Match dates above their column. Rotated because a date is ~28px of text
   over a 13px column: laid flat they would either overlap or force the
   squares apart until the grid stopped being a grid. */
.grass-row.dates { align-items: end; padding-bottom: var(--space-1); }
/* inside a scrolling board the dates have to stay put, or the columns lose
   their labels as soon as you look further down the squad */
.grass-board.scroller .grass-row.dates { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.grass i.g-date { background: none; height: 34px; position: relative; opacity: 1; }
.grass i.g-date b {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform-origin: left bottom;
  transform: rotate(-60deg);
  font: 500 10px/1 var(--font-display);
  color: var(--muted);
  white-space: nowrap;
}

/* FR-DASH-6 / FR-TEAM-9: rank colors are independent of reward tiers. */
:root {
  --podium-one: #69cdbb; --podium-one-soft: #233f3e; --podium-one-ink: #a7e7d7;
  --podium-two: #a5b0ed; --podium-two-soft: #333a55; --podium-two-ink: #d3d9ff;
  --podium-three: #dfa9c7; --podium-three-soft: #493448; --podium-three-ink: #f2cde6;
  --absence-ink: #c2b9d7;
}
:root[data-theme="day"] {
  --podium-one-soft: #dcf1eb; --podium-one-ink: #235f59;
  --podium-two-soft: #e8eafa; --podium-two-ink: #4e5588;
  --podium-three-soft: #f3e3ed; --podium-three-ink: #7a4766;
  --absence-ink: #6b587c;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --podium-one-soft: #dcf1eb; --podium-one-ink: #235f59;
    --podium-two-soft: #e8eafa; --podium-two-ink: #4e5588;
    --podium-three-soft: #f3e3ed; --podium-three-ink: #7a4766;
    --absence-ink: #6b587c;
  }
}
.hl-place.p1, .rank-tier.rank-1 { --place: var(--podium-one); --place-soft: var(--podium-one-soft); --place-ink: var(--podium-one-ink); }
.hl-place.p2, .rank-tier.rank-2 { --place: var(--podium-two); --place-soft: var(--podium-two-soft); --place-ink: var(--podium-two-ink); }
.hl-place.p3, .rank-tier.rank-3 { --place: var(--podium-three); --place-soft: var(--podium-three-soft); --place-ink: var(--podium-three-ink); }

/* Two things worth pulling out of the graph: who turns up, and who stopped.
   Three lists covering the whole squad was the roster again in another
   order - a summary works by leaving most of the team out of it. */
.att-highlights { display: grid; grid-template-columns: 1fr; gap: var(--space-3); margin-bottom: var(--space-4); }
@media (min-width: 720px) { .att-highlights { grid-template-columns: 1fr 1fr; } }
.hl-card { padding: var(--space-3) var(--space-4); }
.hl-head { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; margin-bottom: var(--space-2); }
.hl-head .icon { width: 16px; height: 16px; }
.hl-top .hl-head, .hl-top .hl-head .icon { color: var(--podium-one-ink); }
.hl-gone .hl-head, .hl-gone .hl-head .icon { color: var(--absence-ink); }
/* Long absences: a red rail and red day counts on the normal card face, so
   names keep full contrast instead of sitting on a tinted wash. */
.hl-gone.has-absences { --absence-ink: var(--red-ink); border-left: 4px solid var(--red); }
.hl-gone.has-absences .hl-ago { font-weight: 700; }
.hl-empty { font-size: 13px; color: var(--muted); margin: 0; }

.hl-podium { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.hl-place {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-2) var(--space-2) 0;
  font-size: 14px;
}
/* a rank is one line however many people share it, so the names wrap inside
   their cell rather than pushing the rate off the row */
.hl-name { display: flex; flex-wrap: wrap; gap: 2px var(--space-2); }
.hl-who { max-width: 100%; overflow-wrap: anywhere; }
.hl-place + .hl-place { border-top: 1px solid var(--line); }
.hl-name { font-weight: 600; min-width: 0; }
.hl-rate { font-size: 15px; font-weight: 700; color: var(--ink); }
.hl-count { font-size: 12px; color: var(--muted); }

/* Names stay readable; days away have their own quiet column. */
.hl-names { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 148px), 1fr)); gap: 4px 20px; }
.hl-chip {
  display: flex; align-items: baseline; gap: 10px; min-width: 0;
  padding: 10px 0; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--ink); font-size: 13px; font-weight: 600;
}
.hl-chip::before { content: ""; width: 6px; height: 6px; flex: none; align-self: center; border: 1px solid var(--absence-ink); }
.hl-absent-name { min-width: 0; overflow-wrap: anywhere; }
.hl-ago { flex: none; margin-left: auto; padding-left: 10px; border-left: 1px solid var(--line); font-size: 12px; font-weight: 400; color: var(--absence-ink); white-space: nowrap; }
:root .hl-chip::before { width: 8px; height: 2px; border: 0; background: var(--absence-ink); }
.g-streak { font-size: 11px; font-weight: 700; color: var(--muted); padding: 2px 8px; border-radius: var(--radius-sm); white-space: nowrap; }
.g-streak.streak-hot { background: var(--green-soft); color: var(--green-ink); }
.g-streak.streak-cold { background: var(--gold-soft); color: var(--gold-ink); }
.g-streak.streak-gone { background: var(--red-soft); color: var(--red-ink); }
@media (max-width: 620px) { .grass-board.full .grass-row { grid-template-columns: 110px auto 46px; } .grass-board.full .g-streak { display: none; } }
.att-board { display: flex; flex-direction: column; gap: var(--space-1); max-height: 460px; overflow-y: auto; }
.att-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--att-accent);
  background: var(--surface);
  font-size: 14px;
}
.att-row.tier-top { --att-accent: var(--green); }
.att-row.tier-mid { --att-accent: var(--gold); }
.att-row.tier-low { --att-accent: var(--red); }
.att-row .a-rank { width: 20px; color: var(--muted); font-size: 13px; }
.att-row .a-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.att-row .a-count { color: var(--muted); font-size: 13px; }
/* the standalone 출석 section shows the whole roster and one extra column */
.att-board.full { max-height: none; }
.att-row .a-name .pill { margin-left: var(--space-2); }
.att-row .a-last { color: var(--muted); font-size: 12px; white-space: nowrap; }
@media (max-width: 560px) { .att-row .a-last { display: none; } }


/* --- my page: table of contents + one panel at a time --- */
.mypage { display: grid; grid-template-columns: 1fr; gap: var(--space-4); align-items: start; }
@media (min-width: 720px) { .mypage { grid-template-columns: 232px 1fr; gap: var(--space-5); } }
.mp-toc {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  gap: var(--space-2);
  scrollbar-width: none;
}
.mp-toc::-webkit-scrollbar { display: none; }
@media (min-width: 720px) { .mp-toc { flex-direction: column; overflow: visible; gap: var(--space-1); position: sticky; top: 104px; } }
.mp-link {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 600;
  padding: var(--space-3);
  border-radius: var(--radius);
  gap: var(--space-3);
  white-space: nowrap;
}
.mp-link:hover { background: var(--surface-raised); }
.mp-link .icon { width: 18px; height: 18px; color: var(--muted); flex: none; }
.mp-link span { display: flex; flex-direction: column; }
.mp-title { font-size: 14px; color: var(--ink); }
.mp-sub { font-size: 12px; font-weight: 500; color: var(--muted); }
@media (max-width: 719px) { .mp-sub { display: none; } }
.mp-link.active { background: var(--surface); border-color: var(--line); }
.mp-link.active .icon, .mp-link.active .mp-title { color: var(--section-ink); }
.mp-panel[hidden] { display: none; }

/* --- quarter/appearance heatmap (lineup) --- */
.heatmap { overflow-x: auto; }
.h-row { display: grid; grid-template-columns: 140px repeat(var(--quarters, 5), 44px); align-items: center; gap: var(--space-2); padding: var(--space-2) 0; }
.h-row.head { color: var(--muted); font-size: 11px; font-weight: 700; }
.h-row + .h-row { border-top: 1px solid var(--line); }
.h-name { font-size: 13px; font-weight: 600; }
.h-cell { height: 32px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 12px; background: var(--bg); color: var(--muted); }
.h-cell.on { background: var(--section-soft); color: var(--section-ink); font-weight: 600; }
.h-cell.total { background: transparent; color: var(--ink); font-weight: 700; }

/* Editable variant (formation maker): each cell is a slot picker for that
   player's quarter - "휴식" or one of the formation's numbered slots - so
   benching and repositioning happen on the same grid that reports them. The
   columns are wider than the read-only heatmap because a cell now has to
   show "#10 MF" plus a dropdown arrow rather than two letters. */
.heatmap.editable .h-row { grid-template-columns: 140px repeat(var(--quarters, 5), 78px); }
.h-cell.pick { background: transparent; padding: 0; }
.h-cell.pick select {
  width: 100%;
  height: 32px;
  padding: 0 2px;
  font-size: 12px;
  text-align: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background-color: var(--bg);
  color: var(--muted);
  min-height: 0;
  padding-right: 20px;
  background-position: calc(100% - 13px) 52%, calc(100% - 8px) 52%;
}
.h-cell.pick.on select { background-color: var(--section-soft); color: var(--section-ink); border-color: transparent; font-weight: 600; }
.h-cell.pick.away select { background-color: var(--red-soft); color: var(--red-ink); border-color: transparent; font-weight: 600; }
.h-cell.pick select:disabled { opacity: .5; }

/* --- formation maker: quarter tabs + roster header --- */
h2.tight { margin-top: 0; }
.roster-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-4); }
.roster-head h3 { margin: 0; font-size: 14px; }
.roster-head .muted { font-size: 13px; }
.quarter-tabs { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-4) 0 var(--space-2); }
.quarter-tabs[hidden] { display: none; }
.q-tab { background: var(--surface); color: var(--muted); border-color: var(--line); padding: var(--space-2) var(--space-4); }
.q-tab.active { background: var(--section); border-color: var(--section); color: var(--control-ink); }
.board-note { font-size: 13px; margin-bottom: var(--space-3); }
p.board-note[hidden] { display: none; }
.save-hint { font-size: 13px; align-self: center; flex: 1 1 200px; }

/* Page title, its one line of context, and the actions that belong to the
   page - kept as a block on the left with the buttons beside it, so the
   button is next to what it acts on instead of pinned to the far edge of a
   wide screen with nothing between. */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.page-head h1 { margin: 0 0 var(--space-1); }
.page-head .ph-text { flex: 1 1 320px; min-width: 0; }
.page-head .ph-text p { margin: 0; font-size: 13px; }
.page-head .ph-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); flex: none; max-width: 100%; }

/* pitch and the current quarter's list, side by side */
.board-split { display: grid; grid-template-columns: 1fr; gap: var(--space-3); align-items: start; }
@media (min-width: 900px) { .board-split { grid-template-columns: minmax(0, 1fr) 300px; } }
.quarter-panel { padding: var(--space-3) var(--space-4); }
.qp-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.qp-head h3 { margin: 0; font-size: 14px; }
.qp-head .muted { font-size: 12px; }
.qp-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 84px;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) 0;
  font-size: 13px;
}
.qp-row + .qp-row { border-top: 1px solid var(--line); }
.qp-role {
  font-size: 11px;
  font-weight: 700;
  color: var(--section-ink);
  background: var(--section-soft);
  border-radius: var(--radius-sm);
  padding: 3px 0;
  text-align: center;
}
.qp-row.bench .qp-role { background: var(--bg); color: var(--muted); }
/* FR-FORM-8: role colors follow the assigned slot, including vacant places. */
.qp-row[data-position], .h-cell[data-position] {
  --position-GK-bg: #554718; --position-GK-ink: #ffe282;
  --position-DF-bg: #243b63; --position-DF-ink: #b9d5ff;
  --position-MF-bg: #203f30; --position-MF-ink: #a4e8b8;
  --position-FW-bg: #512b32; --position-FW-ink: #ffc0c8;
}
:root[data-theme="day"] :is(.qp-row, .h-cell)[data-position] {
  --position-GK-bg: #fff0ae; --position-GK-ink: #725600;
  --position-DF-bg: #dbeafe; --position-DF-ink: #1d4ed8;
  --position-MF-bg: #dcfce7; --position-MF-ink: #166534;
  --position-FW-bg: #ffe0e0; --position-FW-ink: #a12130;
}
:is(.qp-row, .h-cell)[data-position="GK"] { --position-bg: var(--position-GK-bg); --position-ink: var(--position-GK-ink); }
:is(.qp-row, .h-cell)[data-position="DF"] { --position-bg: var(--position-DF-bg); --position-ink: var(--position-DF-ink); }
:is(.qp-row, .h-cell)[data-position="MF"] { --position-bg: var(--position-MF-bg); --position-ink: var(--position-MF-ink); }
:is(.qp-row, .h-cell)[data-position="FW"] { --position-bg: var(--position-FW-bg); --position-ink: var(--position-FW-ink); }
.qp-row[data-position] .qp-role { background: var(--position-bg); color: var(--position-ink); }
.qp-row[data-position] select, .h-cell.pick.on[data-position] select { background-color: var(--position-bg); color: var(--position-ink); }
.qp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.qp-row.bench .qp-name, .qp-row.vacant .qp-name { color: var(--muted); font-weight: 500; }
.qp-row select { width: 100%; min-height: 0; padding: 4px 22px 4px 6px; font-size: 12px; background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%; }
.saved-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }

/* --- guests: a player for the day, with no membership behind them --- */
.shirt.guest { background: var(--gold-soft); color: var(--gold-ink); font-family: var(--font-body); font-weight: 700; min-width: 0; padding: 0 5px; }
.guest-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; background: var(--surface); }
.guest-remove { background: none; border: none; color: var(--muted); padding: 0 4px; font-size: 15px; line-height: 1; }
.guest-remove:hover { color: var(--red-ink); }
.guest-empty { font-size: 13px; margin: 0; }
.guest-add { margin-top: var(--space-2); }
.guest-add input { max-width: 150px; }
.token circle.guest { stroke: var(--gold); stroke-dasharray: 2 1.2; }
.locked-note { display: flex; align-items: center; gap: var(--space-3); font-size: 14px; color: var(--muted); }
.locked-note .icon { color: var(--section); flex: none; }

/* --- match record sheet, one section per quarter --- */
.page-head .m-score { font-family: var(--font-display); font-size: 34px; line-height: 1; }
.scoreline { display: flex; align-items: baseline; gap: 6px; font-family: var(--font-display); font-size: 34px; line-height: 1; }
.scoreline .s-sep { color: var(--muted); }
.quarter-logs { display: grid; grid-template-columns: 1fr; gap: var(--space-3); }
.qlog { padding: var(--space-4); min-width: 0; }
.qlog[hidden] { display: none; }
.qlog-body { display: grid; gap: var(--space-5); }
.qlog-lineup, .qlog-entry { min-width: 0; }
.qlog-entry > h3:not(:first-child) { margin-top: var(--space-5); }
.qlog-entry .qlog-add { gap: var(--space-3); margin-top: var(--space-4); }
.qlog-entry .qlog-add label { flex: 1 1 140px; min-width: 0; }
.qlog-entry .qlog-add select { max-width: none; width: 100%; }
.qlog .goal-row { flex-wrap: wrap; padding-block: var(--space-2); gap: var(--space-3); }
.qlog .qassess { margin-top: var(--space-5); }
.qlog .empty, .quarter-report .empty { padding: var(--space-4); box-shadow: none; background: var(--bg); }
.record-quarter-nav { margin-block: var(--space-4); }
.record-quarter-nav .quarter-tabs { gap: var(--space-2); flex-wrap: wrap; }
.record-quarter-nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.record-quarter-nav .add-quarter { flex: none; min-height: 44px; border-style: dashed; }  /* owner request 2026-10-23 F1 */
.record-quarter-pager { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin-block: var(--space-4) var(--space-5); }
.record-quarter-pager p { margin: 0; white-space: nowrap; }
.match-setup-controls { padding: var(--space-5); }
.match-setup-controls .roster-head { margin-top: var(--space-5); flex-wrap: wrap; }
.match-setup-controls .inline { gap: var(--space-4); }
.match-setup-controls .check-list { gap: var(--space-3); }
.match-setup-controls .guest-add { margin-top: var(--space-4); }
@media (min-width: 900px) {
  .qlog { padding: var(--space-5); }
  .qlog-body { grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr); }
}
@media (max-width: 480px) {
  .match-setup-controls { padding: var(--space-4); }
  .record-quarter-pager button { padding-inline: var(--space-2); }
}
.qlog-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); }
.qlog-score { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.qlog-score .qs-for { font-family: var(--font-display); font-size: 20px; color: var(--section-ink); }
.qlog-score .in-conceded { width: 62px; padding: 4px 6px; font-size: 13px; }
.goal-row { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; }
.goal-row .icon { color: var(--section); width: 16px; height: 16px; }
.goal-row .g-scorer { font-weight: 600; }
.goal-row .g-assist { color: var(--muted); flex: 1 1 auto; }
.goal-row .remove-goal, .goal-row .remove-event { padding: 2px 8px; font-size: 12px; }
.goal-empty { color: var(--muted); font-size: 13px; }
.qlog-add { margin: var(--space-2) 0 0; }
.qlog-add select { max-width: 130px; }
/* the submit button needs room of its own - it ends the page, and sat flush
   against the block above it with nothing to say what it does */
.submit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}
.submit-row .muted { font-size: 13px; }

/* --- match detail: per-quarter score, MOM --- */
.qscore-row { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.qscore { text-align: center; }
.qscore .q-label { font-size: 12px; color: var(--muted); }
.qscore .q-value { font-family: var(--font-display); font-size: 26px; line-height: 1.1; }
.qscore .q-sub { font-size: 11px; color: var(--muted); }
.mom-winner { display: flex; align-items: center; gap: var(--space-3); }
.mom-winner .icon { width: 26px; height: 26px; color: var(--gold); }
.mom-winner .mw-name { font-size: 17px; font-weight: 700; }
.mom-pick .submit-row { margin-top: var(--space-4); }
.match-result { padding: var(--space-5); margin-bottom: var(--space-5); }
.match-result-score { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: var(--space-4); align-items: center; text-align: center; margin-block: var(--space-5); }
.match-result-score > div { display: grid; gap: var(--space-2); overflow-wrap: anywhere; }
.match-result-score strong { font-size: clamp(64px, 12vw, 104px); line-height: 1.1; color: var(--section-ink); }
.match-result-score .result-separator { font-size: 40px; color: var(--muted); }
.match-scorers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--space-4); }
.match-scorers li { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); border-top: 1px solid var(--line); padding-top: var(--space-3); overflow-wrap: anywhere; }
.match-scorers strong { white-space: nowrap; color: var(--section-ink); }
.match-scorers strong .num { font-size: 28px; }
.match-card .m-action { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.match-card .m-action .pill { margin-left: var(--space-1); }
/* jersey number in front of a name, in rosters and the appearance board */
.shirt {
  display: inline-block;
  min-width: 1.6em;
  margin-right: 6px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--section-soft);
  color: var(--section-ink);
  font-size: 11px;
  text-align: center;
}

/* --- reward zone (card upgrade celebration) --- */
.reward-zone {
  position: relative;
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-4) var(--space-4);
  text-align: center;
  overflow: hidden;
  background: var(--gold-soft);
  box-shadow: var(--depth);
  border: 2px solid var(--frame);
}
.reward-zone .glow { display: none; }
.reward-zone .medallion {
  position: relative; z-index: 1;
  width: 96px; height: 96px; border-radius: 50%; margin: 0 auto var(--space-3);
  background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 4px 4px 0 var(--shadow-color); border: 2px solid var(--frame);
  color: var(--control-ink);
}
.reward-zone .medallion .icon { width: 42px; height: 42px; }
.reward-zone .r-title { position: relative; z-index: 1; font-size: 15px; color: var(--gold-ink); font-weight: 700; }
.reward-zone .r-levels { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: var(--space-2); margin-top: 2px; }
.reward-zone .r-levels .lv { font-family: var(--font-display); font-size: 32px; }
.reward-zone .r-levels .lv.before { color: var(--muted); font-size: 24px; }
.reward-zone button { position: relative; z-index: 1; margin-top: var(--space-4); background: var(--gold); border-color: var(--gold); }

/* --- entrance: shared login/signup/recovery presentation (FR-UI-3) --- */
.entrance-body { min-height: 100vh; min-height: 100dvh; background: var(--surface); }
.entrance-layout { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.entrance-story {
  display: flex; flex-direction: column; justify-content: center; gap: var(--space-6);
  padding: clamp(32px, 5vw, 88px); color: var(--ink); overflow: hidden;
  background: var(--bg); border-right: 2px solid var(--frame);
}
.entrance-brand { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 25px; font-weight: 800; letter-spacing: -.04em; color: inherit; align-self: flex-start; }
.entrance-brand:hover { text-decoration: none; }
.entrance-brand { padding: 16px 0; }
.entrance-brand .brand-logo { width: 224px; max-width: 100%; }
.entrance-story .entrance-brand { margin-bottom: auto; padding-bottom: var(--space-4); }
.entrance-story-copy h2 { margin: 0 0 var(--space-4); font-size: clamp(32px, 3.3vw, 56px); line-height: 1.2; letter-spacing: -.04em; word-break: keep-all; }
.entrance-story-copy p { color: var(--muted); line-height: 1.9; margin: 0; }
.entrance-pitch { width: 100%; max-width: 560px; align-self: center; }
.entrance-pitch svg { display: block; width: 100%; height: auto; }
.auth-pitch-grass { fill: var(--pitch); }
.auth-pitch-lines { fill: none; stroke: #f0f2ec; stroke-width: 1.2; opacity: .6; }
.auth-pitch-route { fill: none; stroke: var(--green); stroke-width: 2; stroke-dasharray: 5 6; }
.auth-pitch-player circle { fill: var(--surface); stroke: var(--green); stroke-width: 3; }
.auth-pitch-player text { fill: var(--green-ink); font: 500 22px var(--font-display); text-anchor: middle; }
.entrance-pitch-caption { display: flex; justify-content: center; align-items: center; gap: var(--space-2); color: var(--muted); font-size: 13px; margin-top: var(--space-3); }
.auth-team-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.entrance-features { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: auto; padding-top: var(--space-4); color: var(--muted); font-size: 13px; }
.entrance-features span { border-top: 1px solid var(--line-strong); padding-top: var(--space-3); flex: 1; white-space: nowrap; }
.entrance-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: var(--space-6) clamp(24px, 5vw, 80px); }
.entrance-card { width: 100%; max-width: 480px; margin: 0; padding: 32px; min-width: 0; }
.entrance-mobile-brand { display: none; }
.entrance-footer { margin: var(--space-5) 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.entrance-card h1 { font-size: 29px; line-height: 1.35; letter-spacing: -.035em; word-break: keep-all; }
.entrance-card p { font-size: 14px; color: var(--muted); }
.entrance-card form p { display: flex; flex-direction: column; gap: var(--space-2); text-align: left; margin: 0 0 var(--space-4); }
.entrance-card form label { font-size: 13px; color: var(--ink); font-weight: 600; }
.entrance-card input:not([type="checkbox"]):not([type="hidden"]) { min-height: 48px; width: 100%; min-width: 0; font-size: 16px; }
.entrance-card form input[type="checkbox"] { order: -1; }
.entrance-card form p:has(> input[type="checkbox"]) { flex-direction: row; align-items: center; }
.entrance-card button[type="submit"] { width: 100%; justify-content: center; margin-top: var(--space-2); min-height: 48px; }
.entrance-card .errorlist { list-style: none; padding: 0; margin: 0; color: var(--red-ink); font-size: 13px; }
.entrance-card hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-4) 0; }
.entrance-card ul { padding-left: var(--space-4); }
.auth-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-1); padding: var(--space-1); background: var(--bg); border-radius: var(--radius-sm); margin-bottom: var(--space-5); }
.auth-switch a { padding: 9px var(--space-3); text-align: center; color: var(--muted); font-weight: 600; font-size: 14px; border-radius: var(--radius-sm); }
.auth-switch a[aria-current="page"] { color: var(--control-ink); background: var(--green); box-shadow: var(--shadow-sm); }
.auth-switch a:not([aria-current="page"]):hover { text-decoration: none; color: var(--section-ink); }
.auth-heading { margin-bottom: var(--space-5); }
.auth-heading p { margin: 0; line-height: 1.7; }
.auth-field { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); min-width: 0; }
.auth-help { color: var(--muted); font-size: 12px; line-height: 1.6; }
.auth-help ul { margin: 0; }
.auth-field-invalid input { border-color: var(--red-ink); }
.auth-errors { color: var(--red-ink); font-size: 13px; }
/* Match delete page (FR-MATCH-34): what goes, the phrase to type, one field, one button. */
.delete-facts { margin: 0 0 var(--space-3); padding-left: 1.2em; }
.delete-facts li { border-bottom: 0; padding: 2px 0; }
.delete-phrase { display: block; margin: var(--space-2) 0 var(--space-3); padding: var(--space-3); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 16px; font-weight: 700; user-select: all; }
.delete-form .field input { width: 100%; max-width: 420px; }
.auth-form > .auth-errors { padding: var(--space-3); background: var(--red-soft); border-radius: var(--radius-sm); margin-bottom: var(--space-4); }
.auth-password { position: relative; display: flex; align-items: center; }
.auth-password input { padding-right: 68px; }
.auth-password-toggle { position: absolute; right: var(--space-2); padding: 8px; background: transparent; color: var(--muted); border: 0; box-shadow: none; font-size: 12px; min-height: 36px; }
.auth-password-toggle:hover { color: var(--section-ink); background: var(--section-soft); }
.auth-password-toggle[hidden] { display: none; }
.auth-field-check { margin-block: -4px 12px; }
.auth-field-check label { display: inline-flex; flex-direction: row; align-items: center; align-self: flex-start; min-height: 44px; gap: 10px; cursor: pointer; }
.auth-divider { display: flex; align-items: center; gap: var(--space-3); color: var(--muted); font-size: 12px; margin: var(--space-5) 0 var(--space-4); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.entrance-card .auth-social { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); padding: 0; margin: 0; }
/* FR-AUTH-2/4/5: POST forms start OAuth in one step (production keeps LOGIN_ON_GET off). */
.auth-social form { margin: 0; }
.auth-social button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); width: 100%; min-height: 76px; padding: var(--space-2); border-radius: var(--radius-sm); border: 1px solid var(--line); color: var(--ink); font-size: 12px; font-weight: 600; box-shadow: none; }
.auth-social button:hover { box-shadow: var(--shadow-sm); }
/* Neutral provider buttons; each brand color appears only in its small mark. */
.auth-social button { background: var(--surface); }
.auth-provider-mark { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; font-family: Arial, sans-serif; font-size: 14px; line-height: 1; font-weight: 800; }
.auth-provider-mark svg { width: 15px; height: 15px; fill: currentColor; }
.auth-social button[title="Google"] .auth-provider-mark { border: 1px solid #dadce0; border-radius: 50%; background: #fff; color: #4285f4; }
.auth-social button[title="Naver"] .auth-provider-mark { background: #03c75a; color: #fff; }
.auth-social button[title="Kakao"] .auth-provider-mark { background: #fee500; color: #191919; }
.entrance-card .auth-alternate { text-align: center; margin: var(--space-4) 0 0; font-size: 13px; }
.auth-alternate a { font-weight: 700; margin-left: var(--space-1); }
@media (max-width: 959px) {
  .entrance-layout { grid-template-columns: minmax(0, 1fr); }
  .entrance-story { display: none; }
  .entrance-panel { padding: var(--space-5) var(--space-4) max(var(--space-5), env(safe-area-inset-bottom, 0px)); justify-content: flex-start; }
  .entrance-mobile-brand { display: inline-flex; align-self: auto; width: 100%; max-width: 420px; margin-bottom: var(--space-5); }
  .entrance-card h1 { font-size: 27px; }
}
@media (max-width: 359px) {
  .entrance-panel { padding-inline: var(--space-3); }
  .entrance-card h1 { font-size: 24px; }
  .entrance-card .auth-social { gap: var(--space-2); }
}

/* --- mypage: profile hero, chip selector --- */
.profile-hero { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.avatar-lg {
  position: relative; z-index: 1; width: 84px; height: 84px; border-radius: 50%; flex: none;
  box-shadow: var(--shadow-sm); border: 3px solid var(--line-strong); background: var(--line);
  display: flex; align-items: center; justify-content: center;
}
.avatar-lg svg { width: 45%; height: 45%; color: var(--muted); }
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; object-position: var(--avatar-focus); border-radius: 50%; }
.avatar-lg .edit-badge {
  position: absolute; right: -6px; bottom: -6px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--section); color: var(--control-ink); display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); cursor: pointer; padding: 0;
}
.avatar-lg .edit-badge .icon { width: 15px; height: 15px; }
.profile-info { position: relative; z-index: 1; flex: 1 1 220px; min-width: 0; }

/* --- member page (FR-PROFILE-5): one teammate, read-only --- */
.profile-head { align-items: center; gap: var(--space-4); }
.avatar-xl {
  width: 112px; height: 112px; border-radius: 50%; flex: none;
  /* a surface gap, then a brand ring, then the ordinary shadow: the photo sits in the team's colour */
  box-shadow: 0 0 0 3px var(--brand), var(--shadow);
  border: 3px solid var(--surface); background: var(--surface-raised);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.avatar-xl svg { width: 45%; height: 45%; color: var(--muted); }
.avatar-xl img { width: 100%; height: 100%; object-fit: cover; object-position: var(--avatar-focus); }
.profile-head h1 { display: flex; align-items: center; gap: var(--space-2); }
.profile-head h1 .shirt { font-size: 15px; }
.profile-role { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin: var(--space-2) 0 0; }
.profile-traits { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
:is(.profile-traits, .tile-face) .trait {
  --position-GK-bg: #554718; --position-GK-ink: #ffe282;
  --position-DF-bg: #243b63; --position-DF-ink: #b9d5ff;
  --position-MF-bg: #203f30; --position-MF-ink: #a4e8b8;
  --position-FW-bg: #512b32; --position-FW-ink: #ffc0c8;
  display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface-recessed); font-size: 13px; font-weight: 600;
}
:root[data-theme="day"] :is(.profile-traits, .tile-face) .trait {
  --position-GK-bg: #fff0ae; --position-GK-ink: #725600;
  --position-DF-bg: #dbeafe; --position-DF-ink: #1d4ed8;
  --position-MF-bg: #dcfce7; --position-MF-ink: #166534;
  --position-FW-bg: #ffe0e0; --position-FW-ink: #a12130;
}
:is(.profile-traits, .tile-face) .trait[data-position="GK"] { background: var(--position-GK-bg); color: var(--position-GK-ink); border-color: transparent; }
:is(.profile-traits, .tile-face) .trait[data-position="DF"] { background: var(--position-DF-bg); color: var(--position-DF-ink); border-color: transparent; }
:is(.profile-traits, .tile-face) .trait[data-position="MF"] { background: var(--position-MF-bg); color: var(--position-MF-ink); border-color: transparent; }
:is(.profile-traits, .tile-face) .trait[data-position="FW"] { background: var(--position-FW-bg); color: var(--position-FW-ink); border-color: transparent; }
.profile section h2 { display: flex; align-items: center; gap: var(--space-2); font-size: 17px; margin-bottom: 2px; }
.profile section h2 .icon { color: var(--section); width: 20px; height: 20px; }
.profile section .team-card-caption { margin-bottom: var(--space-3); }
.profile-season { margin-bottom: var(--space-4); }
/* The season chips sit in the card head, beside the title, instead of floating between cards. */
.profile-season-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-3); }
.profile-season-head .team-card-caption, .profile-season-head .season-chips { margin-bottom: 0; }
.profile-season-body { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-5); }
.profile-season-body .season-ring-wrap { flex: 0 0 auto; }
.profile-stats { flex: 1 1 320px; margin-bottom: 0; gap: var(--space-3); }
.profile-stats .stat-card { flex: 1 1 120px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-3); box-shadow: none; }
/* One grid for the five blocks under the season card: the tall pitch spans three rows
   beside 출석, 뱃지 and 카드 (each at its natural height), and 동료 closes the page full
   width, so no card is left mostly empty. */
.profile-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); margin-bottom: var(--space-4); }
@media (min-width: 620px) {
  .profile-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "pitch attendance" "pitch badges" "pitch card" "partners partners"; }
  .profile-pitch { grid-area: pitch; }
  .profile-attendance { grid-area: attendance; }
  .profile-badges { grid-area: badges; }
  .profile-partners { grid-area: partners; }
  .profile-card { grid-area: card; }
}
.profile-pitch { display: flex; flex-direction: column; }
.profile-pitch .mini-pitch { margin: auto; } /* centred in whatever height the two rows give it */
/* The pitch: four horizontal bands FW→GK on grass, each with the role token
   coloured like the formation roster. CSS only, no SVG. */
.mini-pitch {
  --mini-line: rgba(255, 255, 255, .35);
  position: relative; display: grid; grid-template-rows: repeat(4, 1fr); gap: 0;
  width: 100%; max-width: 300px; aspect-ratio: 3 / 4; margin: 0 auto;
  border-radius: var(--radius-sm); border: 2px solid var(--mini-line);
  background: repeating-linear-gradient(180deg, var(--pitch) 0 25%, var(--pitch-stripe) 25% 50%);
  overflow: hidden;
}
.mini-pitch::before, .mini-pitch::after {
  content: ""; position: absolute; left: 25%; width: 50%; height: 14%; border: 2px solid var(--mini-line); pointer-events: none;
}
.mini-pitch::before { top: -2px; border-top: none; }
.mini-pitch::after { bottom: -2px; border-bottom: none; }
.pos-band {
  --position-GK-bg: #554718; --position-GK-ink: #ffe282;
  --position-DF-bg: #243b63; --position-DF-ink: #b9d5ff;
  --position-MF-bg: #203f30; --position-MF-ink: #a4e8b8;
  --position-FW-bg: #512b32; --position-FW-ink: #ffc0c8;
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  color: #fff;
}
.pos-band[data-position="GK"] { --position-bg: var(--position-GK-bg); --position-ink: var(--position-GK-ink); }
.pos-band[data-position="DF"] { --position-bg: var(--position-DF-bg); --position-ink: var(--position-DF-ink); }
.pos-band[data-position="MF"] { --position-bg: var(--position-MF-bg); --position-ink: var(--position-MF-ink); }
.pos-band[data-position="FW"] { --position-bg: var(--position-FW-bg); --position-ink: var(--position-FW-ink); }
.pos-token {
  width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--position-ink); color: var(--position-bg); font-family: var(--font-display); font-weight: 600; font-size: 14px;
  border: 2px solid #fff; box-shadow: var(--shadow-sm); flex: none;
}
.pos-text { font-size: 13px; font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
.pos-text .num { font-size: 16px; }
.pos-band.idle .pos-token { background: transparent; color: var(--mini-line); border-color: var(--mini-line); box-shadow: none; }
/* Attendance: the member's one row of the board, no name column. */
.profile-grass { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: var(--space-3); }
.profile-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); margin: 0; }
.profile-facts dt { font-size: 12px; color: var(--muted); }
.profile-facts dd { margin: 0; font-size: 13px; color: var(--muted); }
.profile-facts dd .num { font-size: 22px; color: var(--ink); }
.profile-facts dd.s-text { font-size: 14px; color: var(--ink); font-weight: 600; }
.profile-facts .streak-hot { color: var(--green-ink); }
.profile-facts .streak-cold, .profile-facts .streak-gone { color: var(--red-ink); }
.badge-shelf { display: flex; flex-direction: column; gap: var(--space-3); }
.badge-shelf .badge-item { border-bottom: none; padding: 0; }
.profile-card-body { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.profile-card-body .mini-card { margin: 0; }
.profile-card-note { flex: 1 1 160px; margin: 0; font-size: 13px; }
/* --- squad page (FR-TEAM-18): one grid of tiles, two orders, a flip to the mini card --- */
.squad-order { gap: var(--space-1); }
:root .squad-order button.on { background: var(--brand); border-color: var(--brand); color: var(--control-ink); } /* outranks the :root secondary face */
.squad-group { margin-bottom: var(--space-5); }
.squad-group-title { display: flex; align-items: center; gap: var(--space-3); font-size: 13px; letter-spacing: .04em; color: var(--muted); margin: 0 0 var(--space-3); }
.squad-group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.squad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-3); }
/* Number order: the groups dissolve into one grid and the tiles take their number index as `order`. */
.squad[data-order="number"] .squad-group, .squad[data-order="number"] .squad-grid { display: contents; }
.squad[data-order="number"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-3); }
.squad[data-order="number"] .squad-group-title { display: none; }
.squad-tile { position: relative; aspect-ratio: 3 / 4; perspective: 900px; outline-offset: 3px; }
.squad-tile .tile-face, .squad-tile .tile-back {
  position: absolute; inset: 0; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow-sm); backface-visibility: hidden; -webkit-backface-visibility: hidden; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-3);
  transition: transform var(--motion-reveal) var(--ease-out), translate var(--motion-quick) var(--ease-out), box-shadow var(--motion-quick) var(--ease-out);
}
.squad-tile .tile-back { transform: rotateY(180deg); gap: var(--space-1); }
.squad-tile[data-flipped] .tile-face { transform: rotateY(180deg); }
.squad-tile[data-flipped] .tile-back { transform: none; }
.squad-tile .tile-number { position: absolute; top: var(--space-2); left: var(--space-3); font-size: 20px; color: var(--brand-ink); }
/* A round photo-or-initial, used by the squad tiles (108px, 72px on a narrow screen) and the 팀 관리 rows (36px). */
.tile-avatar {
  width: 108px; height: 108px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; flex: none;
  background: var(--surface-raised); color: var(--muted); border: 2px solid var(--line); box-shadow: var(--shadow-sm);
  font-size: 18px; font-weight: 700;
}
.tile-avatar[data-photo] { border-color: var(--brand); }
.tile-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: var(--avatar-focus); }
.squad-tile .tile-name { flex: none; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* flex: none - a clipped line must not shrink to nothing under a tall avatar */
.squad-tile .tile-back { overflow: hidden; padding: var(--space-2); }
.squad-tile .tile-back .mini-card { min-height: 0; margin: 0; width: 128px; } /* the back is the card alone, sized to the 3:4 tile */
/* The hint is a small bubble above the tile, outside it, so the face keeps its layout while pointed at. */
.squad-tile .tile-hint {
  position: absolute; left: 50%; bottom: calc(100% + 6px); translate: -50% 0; width: max-content; max-width: 200px;
  padding: 4px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-raised); color: var(--ink);
  box-shadow: var(--shadow-sm); font-size: 11px; line-height: 1.4; text-align: center; opacity: 0; pointer-events: none;
  transition: opacity var(--motion-quick) var(--ease-out);
}
.squad-tile .tile-hint::after { content: ""; position: absolute; left: 50%; top: 100%; translate: -50% 0; border: 5px solid transparent; border-top-color: var(--line); }
@media (hover: hover) {
  .squad-tile:hover { z-index: 2; } /* the bubble rises above the tile in the row above */
  .squad-tile:hover .tile-face, .squad-tile:hover .tile-back { translate: 0 -4px; box-shadow: var(--shadow); }
  .squad-tile:hover .tile-hint { opacity: 1; }
}
@media (hover: none) { .squad-tile .tile-hint { display: none; } }
.squad-tile[data-flipped] .tile-hint { display: none; } /* the hint describes the face; the back is the card alone */
@media (max-width: 619px) {
  .squad-grid, .squad[data-order="number"] { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--space-2); }
  .squad-tile .tile-face { padding: var(--space-2); gap: var(--space-1); } /* 72px photo + name + chip inside the 3:4 tile */
  .squad-tile .tile-avatar { width: 72px; height: 72px; font-size: 16px; }
  .squad-tile .tile-number { font-size: 16px; }
  .squad-tile .tile-back .mini-card { width: 92px; }
  .squad-tile .tile-hint { display: none; } /* no room on a narrow tile; tapping is the hint */
}
@media (prefers-reduced-motion: reduce) {
  .squad-tile .tile-face, .squad-tile .tile-back, .squad-tile .tile-hint { transition: none; }
}
/* --- 팀 관리 roster (FR-TEAM-19): quiet rows, one 관리 menu per row --- */
.member-list { display: flex; flex-direction: column; }
.member-row { position: relative; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr) auto; grid-template-areas: "who tags act"; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-2); border-bottom: 1px solid var(--line); }
.mr-who { grid-area: who; } .mr-tags { grid-area: tags; } .mr-actions { grid-area: act; }
.member-row:not(:has(.mr-actions)) { grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr); grid-template-areas: "who tags"; }
.member-row:last-child { border-bottom: 0; }
.mr-who { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.mr-text { min-width: 0; }
.mr-name { display: flex; align-items: center; gap: var(--space-2); font-weight: 700; }
.mr-name .shirt { font-size: 11px; min-width: 20px; height: 20px; }
.mr-meta { font-size: 12px; margin-top: 2px; }
.mr-tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: 13px; }
.mr-note { font-size: 12px; }
.tile-avatar.tile-avatar-sm { width: 36px; height: 36px; font-size: 13px; border-width: 1px; box-shadow: none; }
.mr-actions { position: relative; }
.row-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; min-width: 240px;
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--depth); padding: var(--space-2); display: flex; flex-direction: column; gap: 2px;
}
.row-menu[hidden] { display: none; }
:root .row-menu .menu-item { display: flex; width: 100%; justify-content: flex-start; background: transparent; border: 0; box-shadow: none; color: var(--ink); font-size: 14px; font-weight: 500; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); }
:root .row-menu .menu-item:hover { background: var(--bg); }
:root .row-menu .menu-item.danger { color: var(--red-ink); }
.row-menu .menu-sep { border: 0; border-top: 1px solid var(--line); margin: var(--space-1) 0; }
.row-menu .menu-note { padding: var(--space-2) var(--space-3); font-size: 13px; }
.row-menu .menu-form { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-2) var(--space-3); }
.row-menu .menu-form label { font-size: 13px; }
.row-menu .menu-form input { width: 100%; }
@media (max-width: 719px) {
  .member-row, .member-row:not(:has(.mr-actions)) { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who act" "tags tags"; }
  .row-menu { right: 0; left: auto; max-width: calc(100vw - 2 * var(--space-4)); }
}
/* --- intra-squad record board (FR-MATCH-36): the two sides' tokens on a free pitch, per quarter --- */
.intra-board { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); margin: var(--space-3) 0; }
.intra-board-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-2) var(--space-3); font-size: 14px; }
.intra-board-head .intra-side-pick { display: inline-flex; align-items: center; gap: var(--space-2); flex-direction: row; }
.intra-board-head select { width: auto; min-width: 84px; }
.intra-matchup { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.intra-matchup .side-mark { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.side-mark.side-A { background: var(--brand); } .side-mark.side-B { background: var(--ink); } .side-mark.side-C { background: var(--purple); } .side-mark.side-D { background: var(--teal); }
.intra-board-hint { font-size: 12px; }
.intra-pitch { width: 100%; max-width: 420px; border-radius: var(--radius-sm); display: block; }
.intra-board.editable .intra-pitch { touch-action: none; }
.intra-board.editable .token { cursor: grab; }
.intra-pitch .token.side-A circle { stroke: var(--brand); stroke-width: 1.4; }
.intra-pitch .token.side-B circle { stroke: var(--ink); stroke-width: 1.4; }
.intra-pitch .token.side-C circle { stroke: var(--purple); stroke-width: 1.4; }
.intra-pitch .token.side-D circle { stroke: var(--teal); stroke-width: 1.4; }
.intra-pitch .token.side-A .token-num { fill: var(--brand-ink); } .intra-pitch .token.side-C .token-num { fill: var(--purple-ink); } .intra-pitch .token.side-D .token-num { fill: var(--teal-ink); }
/* Owner request 2026-10-23: a quarter's own 편 조정 - one row of buttons per person. */
.intra-quarter-sides { width: 100%; max-width: 560px; display: grid; gap: var(--space-2); }
.intra-quarter-sides-title { margin: var(--space-2) 0 0; font-size: 15px; }
.intra-sides-summary { margin: 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-field); background: var(--surface-recessed); font-size: 13px; font-weight: 700; color: var(--ink); }
.intra-pick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.intra-pick-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px var(--space-3); padding: 6px 0; border-bottom: 1px solid var(--line); }
.intra-pick-row:last-child { border-bottom: 0; }
.intra-pick-name { min-width: 0; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.intra-pick-name .shirt { margin-right: 4px; }
.intra-pick-buttons { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: calc(var(--radius-field) + 3px); background: var(--surface-recessed); }
.intra-pick { --pick: var(--line-strong); --pick-soft: var(--surface); --pick-ink: var(--ink);
  min-height: 44px; min-width: 44px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--radius-field);
  background: transparent; color: var(--muted); font-size: 13px; font-weight: 800; box-shadow: none; }
.intra-pick.side-A { --pick: var(--brand); --pick-soft: var(--brand-soft); --pick-ink: var(--brand-ink); }
.intra-pick.side-B { --pick: var(--ink); --pick-soft: var(--surface-raised); --pick-ink: var(--ink); }
.intra-pick.side-C { --pick: var(--purple); --pick-soft: var(--purple-soft); --pick-ink: var(--purple-ink); }
.intra-pick.side-D { --pick: var(--teal); --pick-soft: var(--teal-soft); --pick-ink: var(--teal-ink); }
.intra-pick:not(:disabled, [aria-pressed="true"]):hover { color: var(--pick-ink); background: var(--surface); }
.intra-pick[aria-pressed="true"] { color: var(--pick-ink); background: var(--pick-soft); border-color: var(--pick); }
.intra-pick.pick-rest[aria-pressed="true"] { --pick: var(--gold); --pick-soft: var(--gold-soft); --pick-ink: var(--gold-ink); border-style: dashed; }
.intra-pick.pick-out[aria-pressed="true"] { --pick: var(--line-strong); --pick-soft: var(--surface); --pick-ink: var(--muted); }
.intra-pick:disabled { opacity: .35; cursor: default; background: transparent; border-color: transparent; }
.intra-pick.rest-side { color: var(--pick-ink); border-color: var(--pick); border-style: dashed; }
.intra-pick:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
/* The side's name in the setup column head (owner request 2026-10-23). */
.intra-column-head h3:has(.intra-side-name) { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.intra-column-head .intra-side-name { width: 100%; max-width: 9em; min-width: 0; min-height: 44px; padding: 4px 8px; font-size: 15px; font-weight: 800; }
/* Owner request 2026-10-23 E2: the quarter's bench and its sides panel (move, rest, re-deal). */
.intra-pair-score { font-weight: 700; } .intra-pair-score .num { font-size: 18px; }
.intra-bench { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-1) var(--space-2); font-size: 13px; }
.intra-bench:empty { display: none; }
.intra-bench-label { color: var(--muted); font-weight: 700; }
.intra-bench-name { padding: 2px var(--space-2); border: 1px dashed var(--line); border-radius: 6px; }
.intra-sides-panel { width: 100%; max-width: 560px; border: 1px solid var(--line); border-radius: 8px; padding: var(--space-2) var(--space-3); background: var(--surface-recessed); }
.intra-sides-panel > summary { cursor: pointer; font-weight: 700; font-size: 14px; min-height: 32px; display: flex; align-items: center; }
.intra-regroup-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding-top: var(--space-2); border-top: 1px solid var(--line); font-size: 13px; }
.intra-regroup-row label { display: inline-flex; flex-direction: row; align-items: center; gap: var(--space-2); }
.intra-regroup-row select { width: auto; }
/* --- intra-squad setup board (FR-MATCH-36): a 대기 pool of chips and one column per side (2-4) --- */
.intra-board-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.intra-board-head .intra-count { flex: none; }
.intra-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); align-content: flex-start; min-height: 44px; }
.intra-chips:not(:has(.intra-item))::after { content: attr(data-empty); color: var(--muted); font-size: 13px; line-height: 44px; } /* the template leaves whitespace, so :empty would never match */
.intra-item { display: inline-flex; align-items: center; gap: 2px; }
.intra-item.moving { position: relative; z-index: 1; transition: transform var(--motion-reveal) var(--ease-out); transition-delay: min(calc(var(--i, 0) * 20ms), 300ms); }
.intra-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface-raised); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500;
}
.intra-chip .shirt { font-size: 12px; }
.intra-chip .pill { min-height: 20px; padding: 0 6px; font-size: 11px; }
.intra-chip[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); box-shadow: 0 0 0 2px var(--brand-soft); }
.intra-item.guest .intra-chip { border-style: dashed; }
.intra-item .guest-remove { width: 28px; height: 28px; min-height: 0; padding: 0; border-radius: 50%; border-color: transparent; background: transparent; color: var(--muted); }
.intra-item .guest-remove .icon { width: 14px; height: 14px; }
.intra-pool, .intra-column { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: var(--space-3); background: var(--surface); }
.intra-pool { margin-top: var(--space-3); }
.intra-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin-top: var(--space-3); }
.intra-columns[data-sides="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.intra-columns[data-sides="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.intra-column[hidden] { display: none; }
.intra-column { --side-color: var(--brand); min-height: 150px; }
.intra-column[data-side="B"] { --side-color: var(--ink); }
.intra-column[data-side="C"] { --side-color: var(--purple); }
.intra-column[data-side="D"] { --side-color: var(--teal); }
.intra-column .side-mark { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--side-color); margin-right: 6px; vertical-align: middle; }
.intra-column .intra-item .intra-chip { border-color: var(--side-color); }
.intra-column-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.intra-column-head h3 { margin: 0; font-size: 15px; }
.intra-pool[role="button"], .intra-column[role="button"] { cursor: pointer; }
.intra-pool[role="button"]:hover, .intra-column[role="button"]:hover { border-style: solid; border-color: var(--brand); }
.intra-pool[role="button"]:focus-visible, .intra-column[role="button"]:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
.intra-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-3); }
.intra-guest-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2); margin-left: auto; }
.intra-guest-add input { width: 160px; }
.scoreline .side-score { display: inline-flex; align-items: baseline; gap: 4px; }
.scoreline .side-score .muted { font-family: var(--font-body); font-size: 14px; } /* "A팀" is Korean: never Oswald */
.m-score.m-sides { display: flex; gap: var(--space-2); }
.m-score .m-side { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; }
.m-score .m-side small { font-size: 11px; color: var(--muted); }
.live-score-link.live-sides { flex-wrap: wrap; gap: var(--space-3); }
.live-score-link .live-side { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
@media (max-width: 719px) {
  .intra-columns, .intra-columns[data-sides="3"], .intra-columns[data-sides="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
  .intra-pool, .intra-column { padding: var(--space-2); }
  .intra-guest-add { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .intra-item.moving { transition: none; } }
.nm-kind, .nm-sides { flex-basis: 100%; }
.nm-sides[hidden] { display: none; }
/* A name that goes to a member page: plain until pointed at, so the lists it sits in keep their look. */
.member-link { color: inherit; text-decoration: none; }
.member-link:hover, .member-link:focus-visible { text-decoration: underline; }
/* Load motion (ADR-0038): resting values above are the defaults; the module sets
   data-motion="on" (start state) and then "play" (transition to rest). Under
   reduced motion the .app-shell rule cancels these transitions. */
.profile[data-motion="on"] .ring-arc { stroke-dasharray: 0 100; } /* dash 0: the arc draws from its start; an offset would only spin it */
.profile[data-motion="on"] .profile-grass i { opacity: 0; }
.profile[data-motion="on"] .pos-token { transform: scale(.6); opacity: 0; }
.profile[data-motion="on"] .badge-shelf .badge-item { transform: translateY(8px); opacity: 0; }
.profile[data-motion="play"] .ring-arc { transition: stroke-dasharray var(--motion-draw) var(--ease-out); }
.profile[data-motion="play"] .ring-arc.draw { transition-delay: 120ms; }
.profile[data-motion="play"] .ring-arc.loss { transition-delay: 240ms; }
.profile[data-motion="play"] .profile-grass i { transition: opacity var(--motion-quick) var(--ease-out); transition-delay: min(calc(var(--i, 0) * 25ms), 1000ms); }
.profile[data-motion="play"] .pos-token { transition: transform var(--motion-reveal) var(--ease-out), opacity var(--motion-reveal) var(--ease-out); }
.profile[data-motion="play"] .pos-band:nth-child(2) .pos-token { transition-delay: 90ms; }
.profile[data-motion="play"] .pos-band:nth-child(3) .pos-token { transition-delay: 180ms; }
.profile[data-motion="play"] .pos-band:nth-child(4) .pos-token { transition-delay: 270ms; }
.profile[data-motion="play"] .badge-shelf .badge-item { transition: transform var(--motion-reveal) var(--ease-out), opacity var(--motion-reveal) var(--ease-out); transition-delay: min(calc(var(--i, 0) * 60ms), 880ms); }
@media (max-width: 719px) {
  .profile-head { flex-direction: column; align-items: flex-start; }
  .profile-head .ph-text { flex-basis: auto; } /* a row basis of 320px would become height here */
  .avatar-xl { width: 96px; height: 96px; }
  .profile-season-body { gap: var(--space-4); }
  .mini-pitch { max-width: none; aspect-ratio: auto; height: 220px; }
  /* Name and total share the first line; the reason pills take the second. */
  .profile-partners .partner-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: var(--space-1); }
  .profile-partners .partner-list .p-name { grid-row: 1; grid-column: 1; }
  .profile-partners .partner-list .p-points { grid-row: 1; grid-column: 2; }
  .profile-partners .partner-list .p-why { grid-row: 2; grid-column: 1 / -1; }
}
.profile-info .p-name-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.profile-info .name-input { flex: 1 1 120px; min-width: 0; max-width: 260px; font-weight: 700; font-size: 17px; padding: 4px 8px; }
.profile-info .p-meta { color: var(--muted); font-size: 13px; margin-top: 3px; }

.field { margin-bottom: var(--space-4); }
.field:last-of-type { margin-bottom: 0; }
.field .f-label { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: var(--space-2); }
.chip-row { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: calc(var(--radius-field) + 4px); background: var(--surface-recessed); }
.chip-radio { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-opt {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px;
  font-size: 13px; font-weight: 700; padding: 8px 14px; border-radius: var(--radius-field);
  border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
}
.chip-opt:hover { color: var(--ink); background: var(--surface); }
.chip-radio:checked + .chip-opt { background: var(--brand); border-color: var(--brand); color: var(--control-ink); box-shadow: 0 1px 0 var(--shadow-color); }
.chip-radio:focus-visible + .chip-opt { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.save-row { margin-top: var(--space-4); text-align: right; }

/* --- team calendar (FR-CAL-1, FR-CAL-2) --- */
.calendar { margin-bottom: var(--space-5); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.cal-title { margin: 0; }
.cal-nav {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 999px; font-size: 22px; line-height: 1; color: var(--muted);
}
.cal-nav:hover { background: var(--line); color: var(--ink); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-weekdays span { text-align: center; font-size: 12px; color: var(--muted); padding: var(--space-1) 0; }
.cal-day {
  min-height: 78px; padding: var(--space-1); border: 1px solid var(--line);
  border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.cal-day.out { opacity: .45; }
.cal-day.today { border-color: var(--section); box-shadow: 0 0 0 1px var(--section) inset; }
.cal-num { font-size: 12px; color: var(--muted); }
.cal-create { width: 100%; min-height: 28px; justify-content: space-between; padding: var(--space-1); background: transparent; border: 0; box-shadow: none; }
.cal-create:hover, .cal-create:focus-visible { background: var(--section-soft); color: var(--section-ink); }
.team-logo { width: 32px; height: 32px; object-fit: contain; vertical-align: middle; flex-shrink: 0; }
.team-logo-preview { width: 72px; height: 72px; }
.live-scoreboard {
  margin-bottom: var(--space-4); background: var(--scoreboard-bg); color: var(--scoreboard-ink);
  border-color: var(--scoreboard-line); padding: var(--space-4);
}
.scoreboard-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); font-size: 13px; }
.scoreboard-live { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); letter-spacing: .18em; font-weight: 600; color: var(--scoreboard-accent); }
.scoreboard-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--scoreboard-accent); }
/* Owner request 2026-10-23 E1: the quarter being played heads the board; the
   running total (score so far, or a 내전's quarter wins) sits small top-right. */
.scoreboard-total { margin-left: auto; display: inline-flex; align-items: baseline; gap: var(--space-2); font-size: 12px; color: var(--scoreboard-muted); }
.scoreboard-total .num { font-size: 16px; color: var(--scoreboard-ink); }
.scoreboard-quarter { margin: 0 0 var(--space-2); text-align: center; font-size: 15px; font-weight: 700; color: var(--scoreboard-ink); }
.scoreboard-quarter .num { font-size: 26px; margin-right: 2px; }
.live-scoreboard .side-mark { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.live-scoreboard .side-mark.side-B { background: var(--scoreboard-ink); }
.live-team-name:has(.side-mark) { flex-direction: row; }
.scoreboard-more { color: var(--scoreboard-ink); }
.live-scoreboard .pill { background: transparent; color: var(--scoreboard-ink); border-color: var(--scoreboard-line); }
.live-score-link { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-3); color: var(--scoreboard-ink); text-decoration: none; text-align: center; }
.live-score-link > span { overflow-wrap: anywhere; min-width: 0; }
.live-team-name { font-weight: 700; font-size: 16px; display: inline-flex; flex-direction: column; align-items: center; gap: 6px; }
.live-scoreboard .team-logo { width: 40px; height: 40px; }
.live-opponent-icon { width: 36px; height: 36px; color: var(--scoreboard-muted); }
.live-score-number { font-size: clamp(44px, 8vw, 84px); line-height: 1; white-space: nowrap; letter-spacing: .04em; color: var(--scoreboard-accent); text-shadow: 0 0 1px var(--scoreboard-accent); }
.scoreboard-diff { margin: var(--space-2) 0 0; text-align: center; font-size: 14px; color: var(--scoreboard-muted); }
.scoreboard-diff .num { font-size: 20px; color: var(--scoreboard-ink); margin-left: 4px; }
.live-side .scoreboard-diff { margin: 0; }
.scoreboard-note { margin: var(--space-2) 0 0; font-size: 12px; color: var(--scoreboard-muted); text-align: center; }
.live-scoreboard .ph-actions { flex-wrap: wrap; justify-content: center; margin-top: var(--space-3); }
:root .live-scoreboard .btn.secondary { background: transparent; color: var(--scoreboard-ink); border-color: var(--scoreboard-muted); } /* outranks the :root secondary face */
.vote-window { margin-top: var(--space-4); margin-bottom: var(--space-4); }
.roster-link-form { min-width: 200px; }
.btn[hidden] { display: none; }

/* Team identity, review and communication (FR-TEAM-13, FR-MATCH-31/32, FR-NOTICE-1). */
.team-identity { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
/* FR-TEAM-21: the team code, a small Oswald chip beside the name wherever a team is identified. */
.team-code { display: inline-block; font-family: var(--font-display); font-size: 12px; font-weight: 500; letter-spacing: .04em; line-height: 1; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-raised); color: var(--muted); vertical-align: middle; white-space: nowrap; }
.team-settings form.inline { margin-top: var(--space-3); }
/* FR-TEAM-20: the fan pill in the header, the fan list in 팀 관리, the team front page. */
.bar-fan { align-self: center; margin-left: var(--space-2); }
.fan-list { display: flex; flex-direction: column; gap: var(--space-2); }
.fan-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--line); }
.fan-row:last-child { border-bottom: 0; }
.fan-row .fan-name { font-weight: 700; }
.fan-row form { margin-left: auto; }
.team-front-head { align-items: center; }
.front-next-date { margin: var(--space-2) 0 0; color: var(--muted); }
.front-next-opponent { margin: var(--space-1) 0 0; font-size: 20px; font-weight: 700; }
.review-card .r-actions form { display: contents; } /* follow buttons in find results sit beside the links */
.team-front-head h1 { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.team-front-head .ph-actions form { display: contents; }
.front-results li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-2) 0; border-bottom: 1px solid var(--line); }
.front-results li:last-child { border-bottom: 0; }
/* FR-TEAM-21: a team under review carries a banner on every one of its screens; the operator's review row. */
.team-pending-banner { margin-bottom: var(--space-4); }
.team-review-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.team-review-actions form { display: inline-flex; gap: var(--space-1); align-items: center; margin: 0; }
.team-review-actions input[name="note"] { width: 180px; }
.team-settings input[name="founded_year"] { width: 120px; }
.team-identity > div { min-width: 0; }
.team-management { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.team-management > *, .team-management .inline label { min-width: 0; }
.team-management .inline label, .team-management input { max-width: 100%; }
/* FR-TEAM-14: the invite link should be readable before it is copied. */
.team-management .invite-link label { flex: 1 1 320px; }
.team-management .invite-link input { width: 100%; }
.join-request .r-actions { flex-wrap: wrap; align-items: end; }
.join-request .r-actions form.inline { margin: 0; }
.join-request .r-actions button { white-space: nowrap; }
/* FR-UI-1: the access-denied page reads as guidance, not an error dump. */
.access-denied { padding: var(--space-6) var(--space-5); text-align: center; }
.access-denied > .icon { width: 40px; height: 40px; color: var(--muted); }
.access-denied h1 { margin: var(--space-3) 0 var(--space-2); }
.access-denied p { color: var(--muted); max-width: 46ch; margin: 0 auto; }
.access-denied .submit-row { justify-content: center; }
/* FR-TEAM-15: role change and removal stay together in one roster cell. */
.member-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.member-actions form { margin: 0; }
.logo-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: var(--space-3); }
.logo-options form { min-width: 0; }
.saved-logo { display: grid; grid-template-rows: 1fr auto; gap: var(--space-2); min-width: 0; }
#team-logo-settings h3 { margin-block: var(--space-4) var(--space-3); }
.saved-logo > form:last-child { justify-self: end; }
#team-logo-settings .saved-logo .logo-delete { width: auto; min-height: 36px; padding: 4px 8px; font-size: 12px; background: transparent; border: 0; box-shadow: none; color: var(--muted); }
#team-logo-settings .saved-logo .logo-delete:hover { color: var(--red-ink); text-decoration: underline; }
.formation-export { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-block: var(--space-4); }
.formation-export[hidden] { display: none; }
.formation-export p { flex-basis: 100%; margin: 0; }
.formation-export button { min-height: 44px; }
.logo-option { flex-direction: column; width: 100%; min-height: 172px; height: 100%; white-space: normal; overflow-wrap: anywhere; }
.logo-option img { width: 72px; height: 88px; object-fit: contain; }
.logo-option.selected { border: 1px solid var(--section); background: var(--section-soft); color: var(--section-ink); }
.logo-rules { padding-left: var(--space-4); line-height: 1.8; }
.live-team-name { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); font-size: clamp(18px, 2.2vw, 24px); font-weight: 800; line-height: 1.4; word-break: keep-all; }
.live-team-name .team-logo, .live-opponent-icon { width: 56px; height: 64px; object-fit: contain; }
.live-opponent-icon { color: var(--muted); }
/* Every quarter under the live board (FR-MATCH-29, E1). */
.live-quarters { margin-bottom: var(--space-4); }
.live-quarters-title { margin: 0 0 var(--space-3); font-size: 18px; }
.quarter-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.quarter-row { padding: var(--space-3); border: 1px solid var(--line); border-radius: 8px; background: var(--surface-recessed); }
.quarter-row.current { border-color: var(--brand); }
.qr-head { display: flex; align-items: center; gap: var(--space-2); font-weight: 700; }
.qr-label .num { font-size: 18px; margin-right: 2px; }
.qr-score { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-2); }
.qr-score strong .num { font-size: 22px; }
.qr-side { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; word-break: keep-all; }
.qr-diff { margin-left: auto; color: var(--muted); font-size: 13px; }
.qr-diff .num { color: var(--ink); font-size: 15px; }
.qr-people { margin: var(--space-2) 0 0; display: grid; gap: 2px; font-size: 13px; }
.qr-people > div { display: flex; gap: var(--space-2); }
.qr-people dt { flex: none; min-width: 44px; color: var(--muted); font-weight: 700; }
.qr-people dd { margin: 0; overflow-wrap: anywhere; }
.quarter-regroup { display: flex; align-items: center; gap: var(--space-2); color: var(--muted); font-size: 12px; font-weight: 700; }
.quarter-regroup::before, .quarter-regroup::after { content: ""; flex: 1; border-top: 1px dashed var(--line); }
.side-totals { list-style: none; margin: var(--space-3) 0 0; padding: var(--space-3) 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); font-size: 13px; }
.side-totals li { display: inline-flex; align-items: center; gap: 6px; }
.qr-side .side-mark, .side-totals .side-mark { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.result-team { display: flex; align-items: center; gap: var(--space-2); font-weight: 700; }
.review-notice { margin-bottom: var(--space-4); border-left: 4px solid var(--gold); }
.vote-window-open { border: 2px solid var(--gold); background: var(--gold-soft); }
.vote-clock { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-3); }
.vote-clock > div { display: flex; align-items: baseline; gap: var(--space-2); }
.vote-clock strong { font-size: clamp(34px, 7vw, 60px); line-height: 1.2; color: var(--gold-ink); }
.clock-separator { font-size: 28px; color: var(--gold-ink); }
.match-vote-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); color: var(--gold-ink); font-weight: 700; }
.m-action { flex-wrap: wrap; }
.notification-trigger { min-width: 48px; min-height: 48px; padding: var(--space-2) var(--space-3); justify-content: center; }
.notification-trigger .icon { width: 20px; height: 20px; }
.notification-count { padding: 1px 6px; border-radius: var(--radius-sm); background: var(--gold-soft); color: var(--gold-ink); font-size: 13px; }
.notification-menu { width: min(360px, calc(100vw - 32px)); max-height: 65vh; overflow-y: auto; }
.notification-heading { font-size: 18px; padding: var(--space-2) var(--space-3); margin: 0; }
.notification-item { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.notification-item:last-child { border-bottom: 0; }
.notice-list { display: grid; gap: var(--space-3); }
.notice-card { display: block; color: var(--ink); }
.notice-card:hover { text-decoration: none; border-color: var(--section); }
.notice-card h2 { margin: var(--space-3) 0 var(--space-2); }
.notice-excerpt, .notice-body { overflow-wrap: anywhere; }
.notice-body { margin: var(--space-4) 0; line-height: 1.9; }
.notice-form input:not([type=checkbox]), .notice-form textarea { width: 100%; }
.notice-form .errorlist { color: var(--red-ink); }
header.site .bar-team { display: inline-flex; align-items: center; min-width: 0; min-height: 76px; gap: 16px; padding: 4px 20px 4px 12px; flex-shrink: 1; font-size: 20px; color: var(--ink); box-shadow: none; }
header.site .bar-team .team-logo { width: 64px; height: 64px; }
header.site .bar-team-name { overflow: hidden; text-overflow: ellipsis; }
header.site .bar-team:hover { text-decoration: none; }
header.site .bar-team:hover .bar-team-name { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
/* Owner request 2026-10-23 E4: the header's team picker (a [data-dropdown]). */
header.site div.bar-team { position: relative; padding: 0; min-height: 0; overflow: visible; }
header.site .bar-team-trigger { display: inline-flex; align-items: center; gap: 12px; min-width: 0; max-width: 100%; min-height: 76px; padding: 4px 12px; font: inherit; font-size: 20px; font-weight: 700; color: var(--ink); background: transparent; border: 0; box-shadow: none; }
header.site .bar-team-trigger .team-logo { width: 64px; height: 64px; }
header.site .bar-team-trigger:hover .bar-team-name { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
header.site .bar-team-caret { width: 14px; height: 14px; flex: none; color: var(--muted); transition: transform .15s ease; }
header.site .bar-team-trigger[aria-expanded="true"] .bar-team-caret { transform: rotate(180deg); }
.team-menu { left: 0; right: auto; min-width: 260px; max-width: calc(100vw - 2 * var(--space-3)); }
.team-menu a { display: flex; align-items: center; gap: var(--space-2); }
.team-menu .team-logo { width: 24px; height: 24px; flex: none; }
.team-menu a.current { background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; }
.team-menu .team-manage-link { border-top: 1px solid var(--line); margin-top: var(--space-1); padding-top: var(--space-2); }
/* The menu's group titles and 마이페이지's panels (E7/E8). */
header.site .nav-group-title { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3) 2px; font-size: 12px; font-weight: 800; color: var(--muted); white-space: nowrap; }
header.site .nav-group-title .team-logo { width: 20px; height: 20px; }
header.site .nav-parent { display: flex; align-items: center; gap: var(--space-1); }
header.site .nav-parent > a { flex: 1 1 auto; }
header.site .nav-toggle { flex: none; width: 40px; min-height: 40px; padding: 0; justify-content: center; background: transparent; color: var(--muted); border: 1px solid transparent; box-shadow: none; }
header.site .nav-toggle .icon { width: 16px; height: 16px; transition: transform .15s ease; }
header.site .nav-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
header.site .nav-children { display: flex; flex-direction: column; padding-left: var(--space-5); }
header.site .nav-children[hidden] { display: none; }
header.site .nav-children a { min-height: 40px; font-size: 15px; font-weight: 600; padding: 6px var(--space-3); }
header.site .nav-children a[aria-current="true"] { color: var(--brand-ink); background: var(--brand-soft); font-weight: 800; }
@media (max-width: 559px) {
  header.site .bar-team-name { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .team-menu { position: fixed; top: calc(var(--header-height) + 2px); left: var(--space-3); right: var(--space-3); min-width: 0; }
}
@media (max-width: 359px) { header.site .bar-team-name { display: none; } }
@media (max-width: 560px) {
  header.site .bar { gap: var(--space-2); padding-inline: var(--space-3); }

  .notification-menu { position: fixed; top: calc(var(--header-height) + 2px); right: var(--space-3); left: var(--space-3); width: auto; }
  .vote-clock { gap: var(--space-2); }
  .vote-clock > div { flex-direction: column; gap: 0; }
  .live-team-name .team-logo, .live-opponent-icon { width: 40px; height: 48px; }
  .live-score-number { font-size: 44px; }
  .live-scoreboard { padding: var(--space-3); }
}
.cal-day.today .cal-num { color: var(--section-ink); }
.cal-match {
  display: flex; align-items: center; gap: 4px; padding: 2px 5px; border-radius: 6px;
  font-size: 11px; line-height: 1.3; min-width: 0;
  background: var(--surface-raised); color: var(--muted);
}
.cal-match.win { background: var(--green-soft); color: var(--green-ink); }
.cal-match.draw { background: var(--gold-soft); color: var(--gold-ink); }
.cal-match.loss { background: var(--red-soft); color: var(--red-ink); }
.cal-match:hover { filter: brightness(.96); }
.cal-dot, .cal-key {
  flex: none; width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid currentColor; box-sizing: border-box; display: inline-block;
}
.cal-dot.on, .cal-key.on { background: currentColor; }
.cal-opp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ul.plain.cal-legend {
  display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-3);
  font-size: 12px; color: var(--muted);
}
ul.plain.cal-legend li { display: flex; align-items: center; gap: var(--space-1); border-bottom: none; padding: 0; }
@media (max-width: 640px) {
  .cal-day { min-height: 52px; }
  .cal-opp { display: none; }
  .cal-match { justify-content: center; }
}

/* --- record sheet: guests and per-quarter events (FR-MATCH-17, FR-MATCH-18) --- */
.event-log { margin-top: var(--space-2); }
.event-log:empty { display: none; }
.event-hint { font-size: 12px; margin: var(--space-1) 0 0; }
.pill-hype { --pill-bg: var(--purple-soft); --pill-fg: var(--purple-ink); }
.pill-save { --pill-bg: var(--blue-soft); --pill-fg: var(--blue-ink); }

/* --- a rejected record and why (FR-MATCH-19) --- */
.reject-note { display: flex; align-items: flex-start; gap: var(--space-3); border-left: 4px solid var(--red); margin-bottom: var(--space-3); }
.reject-note .icon { color: var(--red); flex: none; margin-top: 3px; }
.reject-note p { margin: var(--space-1) 0 0; }
.reject-note .btn { margin-top: var(--space-2); }
textarea { width: 100%; resize: vertical; }
.modal textarea { margin-bottom: var(--space-2); }

/* --- a quarter's possession / activity assessment (FR-MATCH-21) --- */
.qassess { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); }
.assess-summary { display: flex; gap: var(--space-1); flex-wrap: wrap; font-size: 13px; }
.assess-none { font-size: 12px; }
.assess-panel { display: grid; gap: var(--space-2); margin-top: var(--space-2); }
.assess-panel[hidden] { display: none; }
.assess-group { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.assess-label { font-size: 12px; color: var(--muted); min-width: 3.6em; }

/* --- seasons and synergy partners (FR-MATCH-22, FR-MATCH-23) --- */
.season-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.season-chip {
  padding: 5px var(--space-3); border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted);
}
.season-chip:hover { text-decoration: none; color: var(--ink); }
.season-chip.on { background: var(--section); border-color: var(--section); color: var(--control-ink); }
.partner-list li { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.partner-list .p-name { font-weight: 600; flex: 1 1 10rem; }
.partner-list .p-why { display: flex; gap: var(--space-1); flex-wrap: wrap; }
.partner-list .p-points { font-size: 20px; color: var(--section-ink); min-width: 2.2em; text-align: right; }
.s-value.s-text { font-family: var(--font-body); font-size: 17px; font-weight: 700; letter-spacing: 0; }
.stat-card.stat-card-partner { flex-basis: 100%; min-width: 0; }
.stat-card-partner .icon { flex: none; }
.stat-card-partner > div { min-width: 0; }
.stat-card-partner .s-value, .stat-card-partner .s-label {
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* Quarter records share the pitch and token proportions with the formation maker. */
.quarter-reports { display: grid; gap: var(--space-5); align-items: start; }
@media (min-width: 800px) { .quarter-reports { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.quarter-report { min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
@media (min-width: 600px) { .quarter-report { padding: var(--space-5); } }
.quarter-report > .qlog-head, .quarter-report > .quarter-formation { margin: 0; }
.quarter-report-section { min-width: 0; border-top: 1px solid var(--line); padding-top: var(--space-4); }
.quarter-report-section > h3 { margin: 0 0 var(--space-4); }
.quarter-report-section > .empty, .quarter-report-section > .substitution-history { margin: 0; }
.quarter-report th, .quarter-report td { padding-block: var(--space-3); }
.quarter-report .synergy-player summary { padding: var(--space-4) var(--space-2); line-height: 1.6; }
.quarter-report .quarter-synergy ul.plain li { padding: var(--space-3); margin-bottom: var(--space-3); }
.quarter-report .substitution-history li { padding-block: var(--space-3); }
.quarter-report .substitution-history li + li { border-top: 1px solid var(--line); }
.quarter-report .substitution-history li > span { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-right: 0; }
.quarter-report .substitution-history li > span + span { margin-top: var(--space-2); }
.quarter-report .substitution-history .pill { flex-shrink: 0; }
.quarter-report .quarter-event-details, .quarter-report .quarter-assessment { margin-top: 0; }
.quarter-report .quarter-event-details summary { padding-block: var(--space-2); line-height: 1.6; }
.quarter-report .quarter-event-details ul { margin-top: var(--space-3); }
.quarter-report .quarter-event-details li { padding-block: var(--space-3); line-height: 1.8; overflow-wrap: anywhere; }
.quarter-formation { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); margin: var(--space-3) 0; }
.record-pitch { display: block; width: 100%; max-width: 300px; border-radius: var(--radius-sm); }
.quarter-substitutions { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: var(--space-3) 0; margin-bottom: var(--space-3); }
.substitution-history { padding-left: var(--space-4); }
.substitution-history li { padding: var(--space-2) 0; overflow-wrap: anywhere; }
.substitution-history li > span { display: inline-block; margin-right: var(--space-3); }
.sub-controls label { flex: 1 1 160px; min-width: 0; }
.sub-controls select { width: 100%; min-width: 0; }
.sub-empty[hidden] { display: none; }
.synergy-player { border-bottom: 1px solid var(--line); }
.synergy-player summary { cursor: pointer; padding: var(--space-3) 0; overflow-wrap: anywhere; }
.synergy-player summary::marker { color: var(--section-ink); }
.synergy-player summary > .muted { margin-left: var(--space-2); font-size: 12px; white-space: nowrap; }
.synergy-player summary:focus-visible { outline: 2px solid var(--section); outline-offset: 2px; }
.quarter-synergy ul.plain li { padding: var(--space-2) var(--space-3); margin-bottom: var(--space-2); border: none; border-radius: var(--radius-sm); background: var(--bg); }
.synergy-pair { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); }
.synergy-pair strong { overflow-wrap: anywhere; word-break: keep-all; }
.quarter-synergy .p-why, .quarter-assessment { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.quarter-assessment, .quarter-event-details { margin-top: var(--space-3); }
.quarter-event-details summary { cursor: pointer; color: var(--muted); }

/* --- team tab: the season at a glance, and rankings (FR-TEAM-9, FR-TEAM-10) --- */
.season-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-3); margin-bottom: var(--space-3); }
@media (min-width: 760px) { .season-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.season-card h3 { display: flex; align-items: center; gap: var(--space-2); font-size: 15px; margin-bottom: var(--space-3); }
.season-card h3 .icon { color: var(--section); }
.season-ring-wrap { display: flex; align-items: center; gap: var(--space-4); }
.season-ring { width: 128px; height: 128px; flex: none; transform: rotate(0deg); }
.season-ring circle { fill: none; stroke-width: 5.5; }
.ring-track { stroke: var(--line); }
.ring-arc { stroke-linecap: butt; }
.ring-arc.win { stroke: var(--green); }
.ring-arc.draw { stroke: var(--gold); }
.ring-arc.loss { stroke: var(--red); }
.season-ring .ring-total { font-size: 11px; font-weight: 600; fill: var(--ink); }
.season-ring .ring-sub { font-size: 3.6px; fill: var(--muted); }
.season-legend li { display: flex; align-items: center; gap: var(--space-2); border-bottom: none; padding: 3px 0; font-size: 14px; }
.season-legend .num { font-size: 18px; margin-left: auto; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.win, .dot.for { background: var(--green); }
.dot.draw { background: var(--gold); }
.dot.loss, .dot.against { background: var(--red); }
.season-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); margin: var(--space-3) 0 0; padding-top: var(--space-3); border-top: 1px solid var(--line); }
.season-stats dt { font-size: 12px; color: var(--muted); }
.season-stats dd { margin: 0; font-size: 13px; color: var(--muted); }
.season-stats dd .num { font-size: 22px; color: var(--ink); }
.season-stats dd .num.pos { color: var(--green-ink); }
.season-stats dd .num.neg { color: var(--red-ink); }
.chart-scroll { overflow-x: auto; }
.goal-chart { display: block; width: 100%; min-width: 280px; height: auto; max-height: 200px; }
.goal-chart a { cursor: pointer; }
.goal-chart a:hover rect { filter: brightness(.92); }
.chart-axis { stroke: var(--line); stroke-width: 1.5; }
.bar-for { fill: var(--green); }
.bar-against { fill: var(--red); opacity: .85; }
.chart-num { font-size: 10px; fill: var(--green-ink); }
.chart-num.against { fill: var(--red-ink); }
.chart-round { font-size: 10px; fill: var(--muted); }
.chart-round.win { fill: var(--green-ink); font-weight: 700; }
.chart-round.draw { fill: var(--gold-ink); font-weight: 700; }
.chart-round.loss { fill: var(--red-ink); font-weight: 700; }
.chart-key { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; font-size: 12px; color: var(--muted); margin: var(--space-2) 0 0; }
.chart-key span { display: inline-flex; align-items: center; gap: var(--space-1); }

.rank-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-3); margin-bottom: var(--space-4); }
@media (min-width: 760px) { .rank-grid { grid-template-columns: 1fr 1fr; } }
.rank-card h3 { display: flex; align-items: center; gap: var(--space-2); font-size: 15px; margin-bottom: var(--space-2); }
.rank-card h3 .icon { color: var(--section); }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  column-gap: var(--space-3); row-gap: 7px; padding: var(--space-3) 0; border-bottom: 1px solid var(--line);
  --bar: var(--section);
}
.rank-list li:last-child { border-bottom: none; }
/* Number tabs distinguish rank from the adjacent, smaller jersey numbers. */
.hl-rank, .rank-list .r-rank {
  width: 32px; height: 34px; flex: none; display: grid; place-items: center;
  font-size: 18px; font-weight: 600; line-height: 1;
  background: var(--place-soft, var(--surface-raised)); color: var(--place-ink, var(--muted));
  border: 0; border-bottom: 3px solid var(--place, var(--line-strong)); border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%);
}
:root :is(.hl-rank, .rank-list .r-rank) { border-radius: 6px 6px 2px 2px; border-bottom-width: 2px; clip-path: none; }
.rank-list .rank-tier { --bar: var(--place, var(--section)); }
.rank-list .r-members { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); min-width: 0; }
.rank-list .r-member { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rank-list .r-name { font-weight: 600; }
.rank-list .r-detail { font-size: 12px; color: var(--muted); }
.rank-list .shirt { background: var(--bg); color: var(--muted); border: 1px solid var(--line); border-radius: 4px; margin-right: 0; font-size: 12px; }
.rank-list .r-value { font-size: 14px; color: var(--ink); font-weight: 700; white-space: nowrap; }
.rank-list .r-value .num { font-size: 22px; margin-right: 1px; }
progress.r-bar { grid-column: 2 / -1; width: 100%; height: 6px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; overflow: hidden; background: var(--line); }
progress.r-bar::-webkit-progress-bar { background: var(--line); }
progress.r-bar::-webkit-progress-value { background: var(--bar); border-radius: 999px; }
progress.r-bar::-moz-progress-bar { background: var(--bar); border-radius: 999px; }

/* FR-UI-2: bounded desktop content, breathing room and mobile/PWA navigation. */
/* FR-TEAM-9/10: use the same semantic and ranking colors as the rest of the app. */
.team-records-head { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: var(--space-4); }
.team-season-crest { width: 76px; height: 84px; object-fit: contain; flex: none; }
.team-records .season-eyebrow { margin: 0 0 6px; font-size: 12px; color: var(--section-ink); letter-spacing: .05em; font-weight: 700; }
.team-records-head h1 { margin-bottom: 6px; }
.team-records .season-chip.on { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand); }
.team-card-caption { margin: 4px 0 var(--space-4); font-size: 12px; color: var(--muted); }
.team-records .season-card h3, .team-records .rank-card h3 { margin-bottom: 0; font-size: 17px; }
.team-records .season-ring { width: 148px; height: 148px; }
.team-records .season-ring circle { stroke-width: 4; }
.team-records .season-ring-wrap { justify-content: space-between; }
.team-records .season-legend { flex: 1; max-width: 156px; }
.team-records .season-legend li { padding-block: 7px; border-bottom: 1px solid var(--line); }
.team-records .season-stats { margin-top: var(--space-4); padding-top: var(--space-4); }
.team-records .season-stats dd .num { font-size: 30px; }
.season-recent { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.season-recent > .team-card-caption { display: block; margin-bottom: var(--space-2); }
.season-recent-results { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.recent-result { min-width: 44px; min-height: 52px; display: grid; justify-items: center; align-content: center; gap: 2px; padding: 4px 8px; background: var(--gold-soft); color: var(--gold-ink); border-radius: var(--radius-sm); font-size: 11px; border-bottom: 2px solid var(--gold); }
.recent-result.win { background: var(--green-soft); color: var(--green-ink); border-color: var(--green); }
.recent-result.loss { background: var(--red-soft); color: var(--red-ink); border-color: var(--red); }
.recent-result strong { font-size: 16px; }
.team-records .chart-scroll { margin-top: var(--space-5); }
.team-records .goal-chart { min-width: 340px; max-height: 240px; }
.team-records .goal-chart a.chart-selected rect { stroke: var(--ink); stroke-width: 1.5; }
.team-records .goal-chart a:focus { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.chart-inspector { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.chart-inspector label { display: flex; flex-direction: row; justify-content: space-between; font-size: 12px; color: var(--muted); }
.chart-inspector output { color: var(--ink); font-variant-numeric: tabular-nums; }
.chart-inspector input[type="range"] { width: 100%; min-height: 44px; padding: 0; accent-color: var(--brand); cursor: pointer; box-shadow: none; border: 0; }
.chart-inspector p { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.chart-detail-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--brand-ink); font-size: 12px; }
.team-records .rank-tier.rank-1 { padding: var(--space-3); margin-block: var(--space-3) var(--space-1); background: var(--brand-soft); border: 0; border-left: 3px solid var(--brand); border-radius: var(--radius-sm); }
.team-records .rank-1 .r-rank { background: transparent; border: 0; font-size: 28px; }
.team-records .rank-1 .r-value .num { font-size: 28px; }
.team-records .r-name { overflow-wrap: anywhere; }
.team-records .r-bar { height: 4px; }
.team-records .rank-card .empty { padding-block: var(--space-5); }
@media (max-width: 479px) {
  .team-records-head { flex-direction: row; align-items: center; gap: var(--space-3); }
  .team-season-crest { width: 52px; height: 64px; }
  .team-records-head h1 { font-size: 22px; }
  .team-records .season-ring { width: 124px; height: 124px; }
  .team-records .season-stats dd .num { font-size: 25px; }
}

.app-shell { --header-height: 96px; --sidebar-width: 240px; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
/* Owner request 2026-10-23 E3: the legal links sit in one footer at the page
   floor - at the bottom of a short page, after the content of a long one. */
.app-shell > main { flex: 1 0 auto; width: 100%; }
.site-footer { flex: none; padding: var(--space-3) var(--space-4) var(--space-4); border-top: 1px solid var(--line); background: var(--surface-recessed); }
.site-footer .legal-links { margin-block: 0 var(--space-2); }
.site-footer .install-help { margin-block: 0; }
.entrance-panel .site-footer { border: 0; background: transparent; padding: 0; }  /* the sign-in card's column already ends here */
.app-shell header.site .bar { height: var(--header-height); }
.app-shell main { min-width: 0; }
.skip-link { position: fixed; left: var(--space-3); top: -100px; z-index: 100; padding: var(--space-3); background: var(--surface); border: 2px solid var(--section); border-radius: var(--radius-sm); }
.skip-link:focus { top: var(--space-3); }
.mobile-navigation { display: none; }
.match-directory, .match-directory-list { min-width: 0; }
.match-directory-list > h2 { margin-bottom: var(--space-4); }
/* Owner request 2026-10-23 E5: a fan's dashboard, one group per followed team. */
.fan-teams { display: grid; gap: var(--space-4); margin-bottom: var(--space-4); }
@media (min-width: 900px) { .fan-teams { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fan-team { display: flex; flex-direction: column; gap: var(--space-2); }
.fan-team-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.fan-team-head h2 { font-size: 18px; }
.fan-team-head .team-logo { width: 32px; height: 32px; }
.fan-team .front-results a { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); color: var(--ink); }
.fan-next, .fan-season, .fan-notice { margin: 0; }
.fan-notice a { overflow-wrap: anywhere; }
/* Owner request 2026-10-23 E6: 일정 / 기록 tabs in one box, each scrolling inside it. */
.match-list-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-recessed); overflow: hidden; }
.match-tabs { display: flex; gap: var(--space-1); padding: var(--space-2) var(--space-2) 0; border-bottom: 1px solid var(--line); background: var(--surface); }
.match-list-box:not([data-tabs-ready]) .match-tabs { display: none; }
.match-tabs [role="tab"] { min-height: 44px; padding: 0 var(--space-4); background: transparent; color: var(--muted); border: 0; border-bottom: 3px solid transparent; border-radius: 0; box-shadow: none; font-weight: 700; }
.match-tabs [role="tab"][aria-selected="true"] { color: var(--brand-ink); border-bottom-color: var(--brand); }
.match-tabs [role="tab"] .num { margin-left: 4px; }
.match-tab-panel { padding: var(--space-3); overflow-y: auto; max-height: 60vh; max-height: 60dvh; }
.match-tab-panel[hidden] { display: none; }
.match-tab-panel:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.match-tab-panel > .grid { gap: var(--space-3); }
@media (min-width: 1100px) { .match-tab-panel { max-height: 470px; } }
.bento > *, .grid > *, .mypage > *, .board-split > * { min-width: 0; }
.operator-columns { align-items: start; }
.operator-list li { display: flex; flex-direction: column; gap: var(--space-1); overflow-wrap: anywhere; }
.operator-filters { margin-bottom: var(--space-4); }
.operator-filters label { flex: 1 1 180px; min-width: 0; }
.operator-filters input { width: 100%; }
.operator-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-3) var(--space-4); }
.operator-facts dt { color: var(--muted); }
.operator-facts dd { margin: 0; overflow-wrap: anywhere; }
.operator-status-form p { margin-top: var(--space-3); }
.operator-status-form label[for="id_confirm"] { display: inline; }
.operator-history { margin-top: var(--space-4); }
.operator-requests { margin-block: var(--space-4); }
.tablewrap.surface { overflow-x: auto; }
.pagination { display: flex; align-items: center; justify-content: center; gap: var(--space-4); margin-top: var(--space-4); }

@media (min-width: 1100px) {
  .app-shell header.site .bar { max-width: none; padding-inline: var(--space-5); }
  .app-shell main.content-focused { --content-width: var(--content-width-focused); }
  .app-shell main.content-reading { --content-width: var(--content-width-reading); }
  .app-shell.has-navigation main {
    width: calc(100% - var(--sidebar-width));
    margin-left: calc(var(--sidebar-width) + max(0px, (100% - var(--sidebar-width) - var(--content-width)) / 2));
  }
  .app-shell main { padding: var(--space-6) clamp(var(--space-5), 3vw, var(--space-6)) var(--space-6); }
  .app-shell.has-navigation .site-footer { margin-left: var(--sidebar-width); }
  .app-shell main :is(.bento, .grid-2, .rank-grid, .season-grid),
  .match-directory-list > .grid { gap: var(--space-4); }
  .bento > .cell:not(.stat), .team-management > .surface, .live-scoreboard { padding: var(--space-5); }
  .bento > .cell > h2:first-child, .team-management > .surface > h2:first-child { margin-top: 0; }
  .team-management { gap: var(--space-5); }
  .live-scoreboard { margin-bottom: var(--space-5); }
  .live-score-link { max-width: 760px; margin-inline: auto; }
  .page-head { margin-bottom: var(--space-5); }
  .app-shell header.site .site-nav {
    position: absolute; top: 100%; left: 0; width: var(--sidebar-width);
    height: calc(100vh - var(--header-height)); height: calc(100dvh - var(--header-height));
    background: var(--surface); border-top: 0; border-right: 1px solid var(--line); overflow-y: auto;
  }
  .app-shell header.site .nav-inner { flex-direction: column; align-items: stretch; padding: var(--space-4) var(--space-3); }
  .app-shell header.site nav a { border-radius: var(--radius-sm); }
  .app-shell header.site .nav-sep { width: auto; height: 1px; margin: var(--space-2) var(--space-3); }
  .match-directory { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
  .match-directory .calendar { margin-bottom: 0; }
  .mp-toc { top: calc(var(--header-height) + var(--space-4)); }
  .app-shell.has-navigation .mp-toc { display: none; }  /* the menu's 마이페이지 toggle lists the panels (E8) */
  .app-shell.has-navigation .mypage { grid-template-columns: 1fr; }
}

@media (max-width: 1099px) {
  .app-shell main { padding: var(--space-4) var(--space-3) var(--space-6); }
  .app-shell.navigation-ready main { padding-bottom: var(--space-5); }
  .app-shell.navigation-ready .site-footer { padding-bottom: calc(80px + var(--space-3) + env(safe-area-inset-bottom, 0px)); }
  .app-shell header.site .bar { padding-inline: max(var(--space-3), env(safe-area-inset-left, 0px)); }
  .app-shell.navigation-ready header.site .site-nav { display: none; }
  .app-shell.navigation-open header.site .site-nav {
    display: block; position: absolute; top: 100%; left: var(--space-3); right: var(--space-3);
    max-height: calc(100vh - 168px); max-height: calc(100dvh - 168px - env(safe-area-inset-bottom, 0px));
    overflow-y: auto; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--depth);
  }
  .app-shell.navigation-open header.site .nav-inner { flex-direction: column; align-items: stretch; padding: var(--space-3); }
  .app-shell.navigation-open header.site nav a { border-radius: var(--radius-sm); }
  .app-shell.navigation-open header.site .nav-sep { width: auto; height: 1px; margin: var(--space-1) var(--space-3); }
  .navigation-ready .mobile-navigation {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    padding: var(--space-1) max(var(--space-1), env(safe-area-inset-right, 0px)) calc(var(--space-1) + env(safe-area-inset-bottom, 0px)) max(var(--space-1), env(safe-area-inset-left, 0px));
    background: var(--surface); border-top: 2px solid var(--frame);
  }
  .mobile-navigation a, .mobile-navigation button {
    flex: 1 1 0; min-width: 0; min-height: 60px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: var(--space-1); padding: var(--space-1);
    font: 600 12px/1.4 var(--font-body); color: var(--ink); background: transparent;
    border: 0; border-radius: var(--radius-sm); box-shadow: none; text-decoration: none; white-space: nowrap;
  }
  .mobile-navigation .icon { width: 24px; height: 24px; }
  .mobile-navigation a:hover, .mobile-navigation button:hover { background: var(--surface-raised); }
  .mobile-navigation a.active, .mobile-navigation button[aria-expanded="true"] { color: var(--control-ink); background: var(--brand); box-shadow: inset 0 -3px 0 var(--frame); font-weight: 800; }
  .navigation-ready #toast-root { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  .navigation-ready .mp-toc { top: calc(var(--header-height) + var(--space-3)); }
}
/* FR-AUTH-8: readable public policy and account lifecycle screens. */
.install-help { max-width: 440px; margin: var(--space-3) auto; color: var(--muted); font-size: .85rem; text-align: center; }
.install-help summary { cursor: pointer; }
main.legal-content { max-width: 920px; }
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); margin-block: var(--space-4); font-size: .85rem; }
.legal-links a { color: var(--muted); }
.legal-document { padding: clamp(20px, 4vw, 40px); overflow-wrap: anywhere; }
.legal-document h2 { margin-top: var(--space-5); }
.legal-document p { line-height: 1.8; }
.legal-document form { display: grid; gap: var(--space-3); }
.legal-document label:has(input[type="checkbox"]) { display: flex; flex-direction: row; align-items: flex-start; gap: var(--space-2); }

/* Shared appearance menu: native disclosure and radios, opaque in every theme. */
.appearance { position: relative; flex: none; }
.appearance[hidden] { display: none; }
.appearance-trigger { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 600; cursor: pointer; list-style: none; }
.appearance-trigger::-webkit-details-marker { display: none; }
.appearance-trigger .icon { width: 18px; height: 18px; }
.appearance[open] .appearance-trigger { border-color: var(--section-ink); }
.appearance-panel { position: absolute; z-index: 20; top: calc(100% + 10px); right: 0; width: 256px; max-width: calc(100vw - 24px); padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.appearance-palettes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; min-width: 0; margin: 0 0 16px; padding: 0; border: 0; }
.appearance-palettes legend { padding: 0; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.appearance-palettes label { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 76px; padding: 10px 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-recessed); color: var(--ink); font-size: 14px; font-weight: 600; text-align: center; cursor: pointer; }
.appearance-palettes label:has(:checked) { border-color: var(--brand); background: var(--brand-soft); }
.appearance-palettes label:has(:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.appearance-palettes input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.appearance-palettes small { font-size: 11px; font-weight: 400; color: var(--muted); }
/* Fixed previews of each palette, independent of the active one. */
.palette-swatch { width: 40px; height: 16px; border: 1px solid var(--line-strong); border-radius: 8px; }
.palette-classic { background: linear-gradient(90deg, #15803d 50%, #202730 50%); }
.palette-home { background: linear-gradient(90deg, #6b1f2e 50%, #e07b39 50%); }
.palette-away { background: linear-gradient(90deg, #0b2a5e 50%, #ffffff 50%); }
.appearance-mode { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.theme-toggle { flex: none; min-width: 80px; min-height: 44px; justify-content: center; padding: 8px 10px; background: var(--surface-raised); color: var(--ink); border: 1px solid var(--line-strong); font-size: 12px; }
.theme-toggle .icon { width: 18px; height: 18px; }
.theme-sun, :root[data-theme="day"] .theme-moon { display: none; }
:root[data-theme="day"] .theme-sun { display: block; }
.entrance-panel { position: relative; padding-top: 100px; }
@media (max-width: 560px) {
  .app-shell .appearance-trigger { min-width: 44px; padding: 8px; }
  .app-shell .appearance-trigger > span { display: none; }
  .app-shell .appearance-panel { right: -72px; }
}
@media (max-width: 359px) {
  header.site .brand { font-size: 18px; gap: 6px; }
  header.site .bar { gap: 6px; }
}

/* FR-UI-2/5: account dialog shares the theme controls without a second popover. */
body.account-dialog-open { overflow: hidden; }
.account-dialog {
  width: min(480px, calc(100% - 32px)); max-width: none;
  max-height: calc(100dvh - 32px); margin: auto; padding: 0;
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  overflow-y: auto; overscroll-behavior: contain;
}
.account-dialog:not([open]) { display: none; }
.account-dialog::backdrop { background: rgb(0 0 0 / 58%); }
.account-dialog-content { padding: 24px; }
.account-dialog .modal-head { gap: 12px; margin-bottom: 20px; }
.account-dialog .modal-head h2 { font-size: 20px; line-height: 1.35; }
.account-dialog .modal-close { min-width: 44px; min-height: 44px; flex: none; }
.account-identity { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.account-identity .u-avatar { width: 44px; height: 44px; }
.account-identity > div { min-width: 0; }
.account-identity strong { display: block; font-size: 17px; overflow-wrap: anywhere; }
.account-identity div > span { display: block; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.account-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.account-links a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); font-size: 14px; font-weight: 600; }
.account-links a:hover { background: var(--surface-raised); border-color: var(--line-strong); text-decoration: none; }
.account-links .icon { width: 20px; height: 20px; flex: none; color: var(--muted); }
.account-links a:last-child:nth-child(odd) { grid-column: 1 / -1; }
/* FR-AUTH-7: allauth management panels (2-step login). */
.auth-panel { margin-bottom: var(--space-4); }
.auth-panel h2 { font-size: 17px; margin-bottom: var(--space-2); }
.auth-panel p { margin: 0; color: var(--muted); }
.auth-panel-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.account-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); }
.account-footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: 13px; }
.account-footer .account-logout { color: var(--red-ink); margin-left: auto; }
.account-dialog .appearance-embedded { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.account-dialog .appearance-trigger { justify-content: flex-start; gap: 8px; padding: 0; border: 0; background: none; font-size: 16px; font-weight: 700; }
.account-dialog .appearance-trigger > span { display: inline; }
.account-dialog .appearance-trigger::after { content: "−"; margin-left: auto; color: var(--muted); }
.account-dialog .appearance:not([open]) .appearance-trigger::after { content: "+"; }
.account-dialog .appearance-panel { position: static; width: auto; max-width: none; padding: 12px 0 0; border: 0; border-radius: 0; box-shadow: none; }
.account-dialog .appearance-mode { font-size: 14px; }
.account-dialog .theme-toggle { font-size: 14px; min-width: 96px; }
.appearance-note { margin: 12px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
@media (max-width: 390px) {
  .account-dialog-content { padding: 16px; }
  .account-dialog .modal-head h2 { font-size: 18px; }
  .account-links a { padding: 10px 8px; gap: 8px; }
}

/* Shared component details. */

.stat-card .icon, .cell.stat .icon { border: 1px solid var(--line); }
.dash-season-record dd { font-weight: 700; font-size: 30px; }
.dash-next { border-left: 3px solid var(--blue); }
.reward-zone .r-title { font-weight: 800; }

/* Status displays never pulse; respect reduced motion. */

@media (prefers-reduced-motion: reduce) {
  :where(.app-shell, .entrance-body) *, :where(.app-shell, .entrance-body) *::before, :where(.app-shell, .entrance-body) *::after { animation: none !important; transition: none !important; }
}

/* Component proportions; layouts and interaction hooks stay shared. */
:root h1 { font-size: 23px; }
:root .num { font-weight: 500; }
:root header.site { background: var(--surface); border-bottom-width: 1px; box-shadow: var(--shadow-sm); }
:root header.site nav a.active { background: var(--surface-raised); color: var(--nav-tone, var(--brand-ink)); border-color: var(--line); box-shadow: inset 3px 0 0 currentColor; font-weight: 700; }
:root .mobile-navigation { border-top-width: 1px; }
:root .mobile-navigation a.active, :root .mobile-navigation button[aria-expanded="true"] { background: var(--brand-soft); color: var(--brand-ink); box-shadow: inset 0 3px 0 var(--brand-ink); }
:root :where(button, .btn):not(:where(:disabled, .msg-close, .modal-close, .u-trigger, .auth-password-toggle)) { border-width: 1px; box-shadow: none; }
:root :where(button, .btn):active { transform: none; }
:root :is(button.secondary, .btn.secondary) { background: var(--surface); }
:root :is(button.secondary, .btn.secondary):hover { background: var(--surface-recessed); }
:root :where(input, select, textarea) { border-width: 1px; background: var(--surface); }
:root .surface { border-width: 1px; }
:root .match-card, :root .review-card { border-left-width: 4px; }
:root .pill { min-height: 26px; gap: 5px; padding: 3px 10px 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--pill-bg, var(--surface-recessed)); color: var(--pill-fg, var(--muted)); box-shadow: none; font-weight: 600; }
/* A CSS-only status rail survives live/vote textContent replacements. */
:root .pill::before { content: ""; flex: none; width: 2px; height: 10px; border-radius: 1px; background: currentColor; }
:root .pill-live::before { width: 5px; height: 5px; border-radius: 50%; }
:root .result-mark { min-width: 30px; min-height: 30px; justify-content: center; padding: 4px 9px; border: 1px solid currentColor; border-radius: var(--radius-sm); background: var(--pill-bg, var(--surface-raised)); color: var(--pill-fg, var(--muted)); box-shadow: none; font-weight: 700; }
:root .result-mark b { display: none; }
:root .record-seal { min-height: 26px; padding: 3px 0; border: 0; border-bottom: 1px solid currentColor; border-radius: 0; background: none; font-weight: 600; }
:root .elapsed-time { background: none; color: var(--ink); border: 0; gap: 4px; }
:root .elapsed-time .num { padding: 0; }
:root .elapsed-time .elapsed-unit { border: 0; padding: 0; color: var(--muted); }
:root .dash-last .l-figure { background: none; border: 0; padding: 0; box-shadow: none; }
:root .dash-last .l-days { font-weight: 500; }
:root .dash-season { border-top-width: 1px; }
:root .dash-next { border-left-width: 1px; }
:root .stat-card .icon, :root .cell.stat .icon { padding: 6px 12px 6px 0; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: none; }
:root .stat-card .s-value, :root .cell.stat .s-value { font-weight: 500; }
:root .card, :root .mini-card { border: 1px solid var(--tier-color); background: var(--surface); border-top: 6px solid var(--tier-color); }
:root .card .avatar, :root .mini-card .avatar { border: 1px solid var(--line); box-shadow: none; background: var(--surface-raised); }
:root .reward-zone { border: 1px solid var(--line); }
:root .reward-zone .medallion { box-shadow: none; border: 0; }
:root .entrance-story { border-right-width: 1px; }

/* FR-UI-2/3: identity hierarchy and breathing room across shared surfaces. */
.record-seal { --seal-paper: var(--status-success-bg); --seal-ink: var(--status-success-ink); }
.player-card-layout { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 40px; align-items: start; }
.player-card-preview { padding: 24px; display: flex; justify-content: center; background: var(--surface-recessed); border: 1px solid var(--line); border-radius: var(--radius); }
.player-card-preview .card { width: 100%; max-width: 232px; }
.player-card-details { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; min-width: 0; }
.player-card-details .stat-row { width: 100%; margin: 0; }
.player-card-details .stat-card { min-width: 0; flex-basis: 180px; }
.player-card-details .reward-zone { width: 100%; margin: 0; }
.surface > :is(h2, h3):first-child { margin-top: 0; }
.surface > :is(p, ul, .empty):last-child { margin-bottom: 0; }
@media (max-width: 719px) {
  .player-card-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .player-card-details { align-items: stretch; }
  .player-card-details > button { align-self: flex-start; }
}
@media (max-width: 959px) {
  .app-shell { --header-height: 72px; }  /* one row with the team picker (owner request 2026-10-23 E4) */
  .app-shell header.site .bar { gap: 8px; padding-block: 8px; }
  header.site .brand { padding: 8px 0; min-height: 48px; }
  header.site .brand .brand-logo { width: 120px; }
  header.site .u-trigger { width: 48px; padding: 6px; justify-content: center; }
  header.site .u-caption, header.site .u-name, header.site .u-caret { display: none; }
  header.site .notification-trigger { position: relative; width: 48px; }
  header.site .notification-count { position: absolute; top: -8px; right: -8px; min-width: 20px; height: 20px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 12px; line-height: 1; max-width: 40px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  header.site .bar-team, header.site .bar-team-trigger { min-height: 48px; gap: 8px; font-size: 15px; padding: 4px 6px; }
  header.site .bar-team .team-logo { width: 34px; height: 34px; }
  .entrance-card { padding: 24px 20px; }
  .entrance-mobile-brand .brand-logo { width: 176px; }
  .app-shell.navigation-open header.site .site-nav { max-height: calc(100dvh - var(--header-height) - 88px - env(safe-area-inset-bottom, 0px)); }
}
