:root {
  color-scheme: light;

  --bg: #f7f2ec;
  --surface: #ffffff;
  --surface-2: #fbf7f2;
  --ink: #241c14;
  --ink-soft: #4c4036;
  --muted: #8d8076;
  --line: rgba(46, 33, 22, 0.10);
  --line-strong: rgba(46, 33, 22, 0.16);

  --accent: #c75d36;
  --accent-strong: #a8431f;
  --accent-ink: #813415;
  --accent-soft: #f6e4d9;
  --accent-tint: #fbf1ea;
  --amber: #e0a03c;
  --ok: #2f875e;

  --gold: #e7b13c;
  --gold-deep: #b07f1e;
  --silver: #adb4bb;
  --silver-deep: #79808a;
  --bronze: #c5824d;
  --bronze-deep: #8f5526;

  --radius: 18px;
  --radius-sm: 13px;
  --shadow-sm: 0 2px 6px rgba(46, 33, 22, 0.05);
  --shadow: 0 16px 40px rgba(46, 33, 22, 0.09);

  --font-body: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Unbounded", var(--font-body);
}

[data-theme="paper"] {
  --bg: #ece0d1;
  --surface: #fffaf3;
  --surface-2: #f7eee1;
  --ink: #2a2016;
  --ink-soft: #4f4135;
  --muted: #897868;
  --line: rgba(62, 42, 22, 0.13);
  --line-strong: rgba(62, 42, 22, 0.2);
  --accent-tint: #f6ece1;
  --accent-soft: #f0ddcd;
  --shadow: 0 18px 42px rgba(62, 42, 22, 0.13);
}

[data-theme="bold"] {
  --bg: #f5ece5;
  --surface: #ffffff;
  --surface-2: #fbf2ec;
  --ink: #1c1209;
  --ink-soft: #46382c;
  --muted: #8a7c70;
  --line: rgba(40, 20, 8, 0.16);
  --line-strong: rgba(40, 20, 8, 0.26);
  --accent: #b94a22;
  --accent-strong: #8f360f;
  --accent-ink: #6f2a0c;
  --accent-soft: #f3ddd0;
  --accent-tint: #fbede5;
  --shadow: 0 20px 46px rgba(40, 20, 8, 0.14);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

@media (min-width: 680px) {
  html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
  }
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(120% 60% at 100% -10%, var(--accent-tint) 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s ease;
}

button, input { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }

.app-shell {
  width: min(640px, calc(100% - 28px));
  margin: 0 auto;
  padding: 16px 0 40px;
}

/* ---------- Topbar ---------- */
.topbar {
  display: grid;
  gap: 20px;
  padding: 22px 22px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.mark {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 30%;
  box-shadow: 1px 4px 13px rgba(46, 33, 22, 0.22), 0 0 0 1px var(--line);
}

.brand-text { min-width: 0; }

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-ink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 5.9vw, 2.6rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

@media (max-width: 430px) {
  .topbar { padding: 18px 16px 16px; }
  .brand { gap: 13px; }
  .mark { width: 50px; height: 50px; flex: 0 0 50px; }
}

/* segmented theme control */
.theme-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.theme-switch button {
  padding: 9px 6px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.theme-switch button[aria-pressed="true"] {
  color: var(--accent-ink);
  background: var(--surface);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
}

/* ---------- Workspace / transitions ---------- */
.workspace { margin-top: 16px; }

#tournamentFlow { display: grid; gap: 14px; }

#tournamentFlow.nav-enter > * {
  animation: pageIn .42s cubic-bezier(.22,.7,.3,1) both;
}
#tournamentFlow.nav-enter.stagger > * {
  animation: none;
}
#tournamentFlow.nav-enter.stagger > * > * {
  animation: pageIn .44s cubic-bezier(.22,.7,.3,1) both;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Home menu ---------- */
.menu-section { display: grid; gap: 12px; }

.stage-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 2px 2px;
  color: var(--accent-ink);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.stage-label:first-child { margin-top: 2px; }
.stage-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.menu-button {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease;
}
.menu-button:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.menu-button:active { transform: scale(0.99); }
.menu-button.locked { opacity: 0.62; }

.menu-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent-tint);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}
.menu-button.is-results .menu-icon { background: var(--surface-2); font-size: 1.4rem; }

.menu-main { min-width: 0; display: grid; gap: 3px; }
.menu-title {
  min-width: 0;
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: 0;
}
.menu-meta {
  min-width: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.menu-right { display: flex; align-items: center; gap: 12px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}
.status-pill.done { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, var(--surface)); }
.status-pill.progress { color: var(--accent-ink); background: var(--accent-tint); }
.status-pill.locked { color: var(--muted); background: var(--surface-2); }
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
}
.menu-chevron { color: var(--muted); font-size: 1.1rem; line-height: 1; }

/* ---------- Section shell ---------- */
.tournament-section {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.back-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink-soft);
  background: var(--surface-2);
  font-size: 1.2rem;
  transition: background-color .18s ease, border-color .18s ease;
}
.back-button:hover { background: var(--accent-tint); border-color: var(--line-strong); }

.section-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0;
}

.section-body { display: grid; gap: 18px; }

.section-note {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-tint);
  color: var(--accent-ink);
  font-size: 0.88rem;
  font-weight: 600;
}
.section-note .emoji { font-size: 1.1rem; }

/* ---------- Registration ---------- */
.registration-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.summary-item {
  display: grid;
  gap: 3px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.summary-item b {
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.registration-block {
  display: grid;
  gap: 10px;
}

.participant-list,
.pair-list {
  display: grid;
  gap: 10px;
}

.participant-card,
.pair-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.participant-card .team-avatar {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  font-size: 0.82rem;
  border-color: var(--surface);
}

.participant-body,
.pair-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.participant-name,
.pair-name {
  min-width: 0;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.participant-meta,
.pair-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.pair-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 11px;
  color: #fff;
  background: var(--accent);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
}

.pair-body {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 9px;
}

.pair-body .pair-meta {
  grid-column: 2;
}

/* ---------- Match cards ---------- */
.block-label {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.match-list { display: grid; gap: 12px; }

.match-card {
  position: relative;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.match-card.complete { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.match-card.waiting { opacity: 0.7; }
.match-card.is-final {
  border-color: color-mix(in srgb, var(--gold) 55%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 9%, var(--surface)), var(--surface));
}

.match-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.match-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0;
}
.match-title .pin { font-size: 1.05rem; }

.match-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.match-state.done { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, var(--surface)); }
.match-state.ready { color: var(--accent-ink); background: var(--accent-tint); }
.match-state.wait { color: var(--muted); background: var(--surface-2); }

.match-teams { display: grid; gap: 8px; }

.match-team {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 7px 10px 7px 7px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1.5px solid transparent;
  transition: background-color .25s ease, border-color .25s ease;
}
.match-team.winner {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-tint);
}

.team-check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  color: #fff;
  font-size: 0.72rem;
  background: transparent;
  transition: background-color .2s ease, border-color .2s ease;
}
.match-team.winner .team-check {
  background: var(--accent);
  border-color: var(--accent);
}
#tournamentFlow.nav-enter .match-team.winner .team-check {
  animation: pop .4s cubic-bezier(.2,1.5,.5,1) both;
}
@keyframes pop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.team-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
  font-size: 0.97rem;
}
.match-team.winner .team-name { color: var(--accent-ink); }
.team-name.placeholder { color: var(--muted); font-weight: 600; font-style: italic; }

.score-input {
  width: 58px;
  height: 42px;
  padding: 0;
  text-align: center;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  -moz-appearance: textfield;
}
.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.score-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.score-input:disabled {
  color: #b3a99f;
  background: var(--surface-2);
  cursor: not-allowed;
}

/* ---------- Group table ---------- */
.table-block { display: grid; gap: 9px; }

.group-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.group-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 32px 32px 46px;
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  font-weight: 700;
}
.group-row:first-child { border-top: 0; }
.group-row.head {
  min-height: 38px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.group-row span { min-width: 0; overflow-wrap: anywhere; }
.group-row .num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 0.82rem;
  font-weight: 800;
}
.group-row.lead .num { background: var(--accent); color: #fff; }
.group-row .col-c { text-align: center; color: var(--ink-soft); }
.group-row .col-diff { text-align: right; font-variant-numeric: tabular-nums; }
.group-row .pos { color: var(--ok); }
.group-row .neg { color: var(--accent-strong); }

/* ---------- Team avatars ---------- */
.team-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.team-cell .team-cell-name { min-width: 0; overflow-wrap: anywhere; }
.team-avatars {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.team-avatars .team-avatar + .team-avatar { margin-left: -8px; }
.team-avatar {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #fff;
  object-fit: cover;
  object-position: 50% 28%;
  background: var(--surface-2);
  border: 2px solid var(--surface);
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(46, 33, 22, 0.18);
}
.team-avatar.is-placeholder { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28), 0 1px 2px rgba(46, 33, 22, 0.18); }
.group-row.head .team-avatars { visibility: hidden; }

/* ---------- Results / podium ---------- */
.podium { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }

.podium li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
#tournamentFlow.nav-enter .podium li {
  animation: pageIn .5s cubic-bezier(.22,.7,.3,1) both;
}
#tournamentFlow.nav-enter .podium li:nth-child(1) { animation-delay: .02s; }
  #tournamentFlow.nav-enter .podium li:nth-child(2) { animation-delay: .09s; }
  #tournamentFlow.nav-enter .podium li:nth-child(3) { animation-delay: .16s; }
#tournamentFlow.nav-enter .podium li:nth-child(4) { animation-delay: .23s; }
#tournamentFlow.nav-enter .podium li:nth-child(5) { animation-delay: .30s; }
#tournamentFlow.nav-enter .podium li:nth-child(6) { animation-delay: .37s; }
#tournamentFlow.nav-enter .podium li:nth-child(7) { animation-delay: .44s; }
#tournamentFlow.nav-enter .podium li:nth-child(8) { animation-delay: .51s; }
#tournamentFlow.nav-enter .podium li:nth-child(9) { animation-delay: .58s; }

.medal {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 1.9rem;
  line-height: 1;
  background: var(--surface-2);
}
#tournamentFlow.nav-enter .podium .medal.has-medal {
  animation: medalPop .55s cubic-bezier(.2,1.6,.45,1) both;
}
#tournamentFlow.nav-enter .podium li:nth-child(1) .medal { animation-delay: .12s; }
#tournamentFlow.nav-enter .podium li:nth-child(2) .medal { animation-delay: .2s; }
#tournamentFlow.nav-enter .podium li:nth-child(3) .medal { animation-delay: .28s; }
@keyframes medalPop {
  0% { transform: scale(0) rotate(-18deg); opacity: 0; }
  60% { transform: scale(1.18) rotate(6deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.rank-num {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}

.podium-body { min-width: 0; display: grid; gap: 3px; }
.podium-team {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.podium-team .team-avatars {
  flex: 0 0 auto;
}
.podium-eyebrow {
  color: var(--accent-ink);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.podium-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: 0;
}
.podium-name.pending { color: var(--muted); font-weight: 600; font-style: italic; }
.podium-place {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

/* champion + medal accents */
.podium li.gold {
  border-color: color-mix(in srgb, var(--gold) 55%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 16%, var(--surface)), var(--surface));
}
.podium li.gold .medal { background: color-mix(in srgb, var(--gold) 26%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold-deep) 40%, transparent); }
.podium li.gold .podium-name { font-size: 1.18rem; }
.podium li.silver { border-color: color-mix(in srgb, var(--silver) 65%, var(--line)); }
.podium li.silver .medal { background: color-mix(in srgb, var(--silver) 30%, var(--surface)); }
.podium li.bronze { border-color: color-mix(in srgb, var(--bronze) 50%, var(--line)); }
.podium li.bronze .medal { background: color-mix(in srgb, var(--bronze) 26%, var(--surface)); }

.podium-trophy { font-size: 1.4rem; opacity: 0.9; }

/* ---------- Empty state ---------- */
.empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 34px 20px;
  text-align: center;
}
.empty-emoji {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--accent-tint);
  font-size: 2.1rem;
}
@media (prefers-reduced-motion: no-preference) {
  #tournamentFlow.nav-enter .empty-emoji { animation: floaty 2.6s ease-in-out infinite; }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-7px) rotate(4deg); }
}
.empty-title { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.empty-text { max-width: 26ch; color: var(--muted); font-weight: 600; font-size: 0.9rem; }

.empty-progress {
  display: flex;
  gap: 7px;
  margin-top: 6px;
}
.empty-progress i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--line-strong);
}
.empty-progress i.on { background: var(--accent); }

.app-foot {
  margin: 22px 4px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

@media (min-width: 680px) {
  .app-shell { width: min(680px, calc(100% - 40px)); padding-top: 26px; }
  .topbar { padding: 26px 26px 20px; }
  h1 { font-size: 2.7rem; }
}
  

/* ---------- Server/admin compatibility ---------- */
.hero { display: grid; gap: 20px; padding: 22px 22px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.hero .back-link { width: max-content; }
.back-link { display: inline-grid; place-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px; color: var(--accent-ink); background: var(--surface-2); border: 1px solid var(--line); text-decoration: none; font-size: .88rem; font-weight: 800; }
.panel { display: grid; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.compact-panel { gap: 10px; }
.admin-flow, .section-body, .match-list { display: grid; gap: 12px; }
.admin-section-head { display: grid; gap: 6px; }
.admin-section-head h2, .compact-panel h2, .login-panel h2 { margin: 0; font-family: var(--font-display); font-size: 1.12rem; font-weight: 700; line-height: 1.1; letter-spacing: 0; }
.admin-section-head p { margin: 0; color: var(--muted); font-size: .88rem; font-weight: 700; }
.primary-button, .ghost-button { min-height: 42px; padding: 0 14px; border-radius: 999px; font-weight: 800; }
.primary-button { color: #fff; background: var(--accent); }
.ghost-button { color: var(--accent-ink); background: var(--surface-2); border: 1px solid var(--line); }
.login-panel { gap: 12px; }
.field { display: grid; gap: 6px; color: var(--muted); font-size: .88rem; font-weight: 800; }
.field input, .edit-card input, .pair-edit-card select { width: 100%; min-height: 42px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 11px; color: var(--ink); background: var(--surface); outline: none; }
.field input:focus, .edit-card input:focus, .pair-edit-card select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.form-message { margin: 0; color: var(--accent-strong); font-weight: 800; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.edit-card, .pair-edit-card { display: grid; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.photo-preview, .photo-placeholder { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; color: #fff; background: var(--accent); object-fit: cover; font-weight: 900; }
.photo-actions { display: grid; gap: 7px; }
.photo-button { display: grid; place-items: center; min-height: 38px; border-radius: 999px; color: var(--accent-ink); background: var(--accent-tint); font-weight: 900; }
.photo-delete { color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); }
.file-input { display: none; }
.pairs-grid { display: grid; gap: 10px; }
.pair-edit-card h3 { margin: 0; font-size: 1rem; }
.score-badge { display: grid; place-items: center; width: 52px; height: 40px; border: 1.5px solid var(--line); border-radius: 11px; background: var(--surface); font-family: var(--font-display); font-size: .95rem; font-weight: 700; text-align: center; }
@media (min-width: 680px) { .admin-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pairs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

