/* Squad Stars — the club's identity: a stadium at night.
   The club's colours, from its crest: night black, club blue #0062b0, club yellow
   #ffc72c, chalk-white lines. Dark is the default; the light theme is a daylight matchday. Display: Bebas Neue (stadium board);
   text: Barlow. No emoji anywhere: the SVG set of icons.py. */

@import url("fonts/fonts.css");

:root {
  --bg: #06080d;
  --bg-soft: #0a0f1a;
  --card: #0d1422;
  --card-edge: #1f3150;
  --line: #172539;
  --ink: #eef3fb;
  --muted-ink: #9eb0c9;
  --primary: #f4f1e6;            /* hard chalk white: the action colour */
  --primary-ink: #06080d;        /* text on a white button */
  --gold: #ffc72c;
  --gold-soft: rgba(255, 199, 44, 0.15);
  --good: #58c98a;
  --bad: #e05656;
  --chip: #121c2e;
  --star-off: #2c3f5e;
  --tier-bronze: #b0793f;
  --tier-argent: #c3ccd6;
  --tier-or: #ffc72c;
  --tier-special: #3d9bff;
  --shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  --radius: 4px;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #e6edf7;
  --bg-soft: #f4f7fc;
  --card: #ffffff;
  --card-edge: #c3d1e6;
  --line: #d3ddec;
  --ink: #0d1626;
  --muted-ink: #4b5a72;
  --primary: #0062b0;            /* club blue: the action colour in daylight */
  --primary-ink: #ffffff;
  --gold: #8a6400;
  --gold-soft: rgba(255, 199, 44, 0.22);
  --good: #1d7a4a;
  --bad: #c03030;
  --chip: #edf2fa;
  --star-off: #c7d4e8;
  --tier-bronze: #96652f;
  --tier-argent: #7d8894;
  --tier-or: #a07d1d;
  --tier-special: #0062b0;
  --shadow: 0 8px 20px rgba(13, 34, 70, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: "Barlow", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(900px 380px at 108% -12%, rgba(244, 241, 230, 0.09), transparent 62%),
    radial-gradient(700px 320px at -8% -6%, rgba(0, 98, 176, 0.22), transparent 58%),
    repeating-linear-gradient(90deg,
      rgba(255, 255, 255, 0.012) 0 56px, rgba(0, 0, 0, 0.05) 56px 112px),
    var(--bg);
  min-height: 100dvh;
  position: relative;
}

/* the centre circle, chalked on the pitch */
body::before {
  content: "";
  position: fixed;
  right: -55vmin;
  top: 12vh;
  width: 110vmin;
  height: 110vmin;
  border: 2px solid rgba(244, 241, 230, 0.05);
  border-radius: 50%;
  pointer-events: none;
}
[data-theme="light"] body::before { border-color: rgba(0, 98, 176, 0.08); }

h1, h2, h3, .btn, .tab, .brand, .board-value, .podium-score, .fcard-rating-num,
.score-num, .stat b, .fstat b, .level-name, .code-input, .league th, .big-code {
  font-family: "Bebas Neue", "Barlow Condensed", "Arial Narrow", sans-serif;
  font-weight: 400;
  letter-spacing: 0.04em;
}

h1 { font-size: 1.9rem; margin: 0 0 0.3rem; line-height: 1.05; text-transform: uppercase; }
h2 { font-size: 1.35rem; margin: 0 0 0.55rem; text-transform: uppercase; letter-spacing: 0.06em; }
h3 { font-size: 1.1rem; margin: 1rem 0 0.3rem; text-transform: uppercase; }
a { color: var(--gold); text-decoration: none; }
[data-theme="light"] a { color: var(--gold); }
.muted { color: var(--muted-ink); font-size: 0.92em; }

.icon { width: 1.15em; height: 1.15em; vertical-align: -0.22em; }
h2 .icon, .page-title .icon { width: 1.05em; height: 1.05em; }
.badge-ic { width: 1em; height: 1em; vertical-align: -0.15em; }

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

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 1rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--card-edge);
}
.brand {
  display: flex; align-items: center; gap: 0.55rem;
  font-size: 1.35rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink);
}
.brand-crest { width: 30px; height: 35px; display: block; }
.topbar-actions { display: flex; gap: 0.5rem; align-items: center; }
.icon-btn {
  border: 2px solid var(--card-edge); background: var(--card); color: var(--ink);
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.icon-btn .icon { width: 20px; height: 20px; }
.icon-btn .theme-light { display: none; }
[data-theme="light"] .icon-btn .theme-light { display: inline; }
[data-theme="light"] .icon-btn .theme-dark { display: none; }

.page { max-width: 760px; margin: 0 auto; padding: 1rem 1rem 6.5rem; }
.page-center { max-width: 430px; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding-bottom: 2rem; }

.page-title { margin-top: 0.2rem; }
.page-title::after {
  content: ""; display: block; width: 64px; height: 4px; margin-top: 0.35rem;
  background: linear-gradient(90deg, var(--gold), transparent);
  transform: skewX(-20deg);
}
.page-sub { margin: 0 0 1rem; color: var(--muted-ink); }

/* --- bottom tab bar (the vote happens on phones) -------------------------------------- */

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--card) 94%, transparent);
  backdrop-filter: blur(10px);
  border-top: 2px solid var(--card-edge);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 0.55rem 0 0.5rem; font-size: 0.72rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted-ink);
}
.tab .tab-ic .icon { width: 22px; height: 22px; }
.tab.active { color: var(--gold); }
.tab.active .tab-ic {
  transform: skewX(-8deg);
  border-bottom: 3px solid var(--gold);
  padding: 0 0.35rem 2px;
}
.tab-vote .tab-ic { color: var(--gold); }

/* --- cards ------------------------------------------------------------------------------ */

.card {
  background: var(--card);
  border: 2px solid var(--card-edge);
  box-shadow: var(--shadow);
  padding: 1rem 1rem 0.9rem;
  margin-bottom: 1rem;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border: 2px solid var(--card-edge); cursor: pointer;
  background: var(--bg-soft); color: var(--ink);
  font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.07em;
  padding: 0.55rem 1rem; line-height: 1.1;
}
.btn .icon { width: 1em; height: 1em; }
.btn-primary {
  background: var(--primary); color: var(--primary-ink);
  border-color: var(--primary);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }
.btn-big { font-size: 1.25rem; padding: 0.8rem 1.3rem; width: 100%; }
.btn-small { padding: 0.3rem 0.7rem; font-size: 0.95rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: var(--chip); border: 1px solid var(--card-edge);
  color: var(--ink); padding: 0.2rem 0.6rem; font-size: 0.82rem;
}
.chip .icon { width: 0.95em; height: 0.95em; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip-admin { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); }
.chip-ok { background: color-mix(in srgb, var(--good) 16%, var(--card)); }
.chip-warn { background: var(--gold-soft); }
.chip-btn { cursor: pointer; }
.chip-btn:hover { border-color: var(--gold); }

.flash {
  background: var(--gold-soft);
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--card));
  padding: 0.6rem 0.8rem; margin-bottom: 0.8rem; font-weight: 600;
}
.flash-error, .flash-error-card {
  background: color-mix(in srgb, var(--bad) 12%, var(--card));
  border-color: color-mix(in srgb, var(--bad) 40%, var(--card));
}

/* --- auth ------------------------------------------------------------------------------ */

.auth-card { text-align: center; }
.auth-crest { width: 96px; height: 112px; margin: 0 auto 0.6rem; display: block; }
.auth-card h1 { font-size: 1.7rem; margin-bottom: 0; }
.auth-town { margin: 0 0 0.6rem; color: var(--gold); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.85rem; }
.auth-alt { margin-top: 1rem; }
.code-input { letter-spacing: 0.35em; text-transform: uppercase; text-align: center; font-size: 1.4rem; }

/* --- forms ----------------------------------------------------------------------------- */

.stack { display: flex; flex-direction: column; gap: 0.45rem; text-align: left; }
.stack label { font-weight: 700; font-size: 0.88rem; margin-top: 0.35rem; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea {
  font: inherit; color: var(--ink);
  background: var(--bg-soft); border: 2px solid var(--card-edge);
  padding: 0.55rem 0.7rem; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 0.8rem; }
.form-grid label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem; font-weight: 700; }
.check-line { flex-direction: row !important; align-items: center; gap: 0.45rem !important; }
.inline-form { display: inline-flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }

/* --- the trading card ------------------------------------------------------------------ */

.fcard { margin-bottom: 1rem; }
.fcard-frame {
  position: relative;
  background:
    linear-gradient(160deg, rgba(244, 241, 230, 0.04), transparent 40%),
    var(--card);
  border: 3px solid var(--tier-bronze);
  outline: 1px solid var(--card-edge);
  outline-offset: 3px;
  padding: 1rem 1rem 0.9rem;
  box-shadow: var(--shadow);
}
.fcard.tier-argent .fcard-frame { border-color: var(--tier-argent); }
.fcard.tier-or .fcard-frame { border-color: var(--tier-or); }
.fcard.tier-special .fcard-frame {
  border-color: var(--tier-special);
  background:
    linear-gradient(120deg, rgba(255, 199, 44, 0.10), transparent 35%, transparent 65%, rgba(255, 199, 44, 0.08)),
    var(--card);
}
.fcard-rating {
  position: absolute; top: 12px; right: 12px;
  background: var(--tier-bronze); color: #14100a;
  padding: 0.35rem 0.6rem 0.3rem; text-align: center; line-height: 1;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
}
.fcard.tier-argent .fcard-rating { background: var(--tier-argent); }
.fcard.tier-or .fcard-rating { background: var(--tier-or); }
.fcard.tier-special .fcard-rating { background: var(--tier-special); }
.fcard-rating-num { display: block; font-size: 1.5rem; }
.fcard-rating-tier { display: block; font-size: 0.6rem; font-family: "Barlow", sans-serif; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.fcard-head { display: flex; gap: 0.8rem; align-items: center; padding-right: 4.5rem; }
.fcard-id h1 { margin-bottom: 0; }
.fcard-sub { margin: 0.1rem 0 0; color: var(--muted-ink); font-size: 0.9rem; }

.avatar {
  width: 46px; height: 46px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: "Bebas Neue", sans-serif; font-size: 1.3rem;
  background: linear-gradient(150deg, var(--gold), #b88600);
  color: #14100a;
  border: 2px solid rgba(244, 241, 230, 0.25);
}
[data-theme="light"] .avatar { color: #ffffff; background: linear-gradient(150deg, #0062b0, #062a52); }
.avatar.big { width: 64px; height: 64px; font-size: 1.7rem; }

.xp-bar {
  height: 14px; background: var(--bg-soft);
  border: 1px solid var(--card-edge); overflow: hidden; position: relative; margin-top: 0.8rem;
}
.xp-bar.slim { height: 8px; flex: 1; margin-top: 0; }
.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #ffe08a);
  transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.xp-text { margin: 0.3rem 0 0; font-size: 0.85rem; color: var(--muted-ink); }

.fcard-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; margin-top: 0.9rem;
  background: var(--card-edge); border: 1px solid var(--card-edge);
}
.fstat {
  background: var(--card); padding: 0.5rem 0.2rem 0.4rem; text-align: center;
  display: flex; flex-direction: column; gap: 1px;
}
.fstat b { font-size: 1.45rem; line-height: 1; color: var(--ink); }
.fstat span { font-size: 0.66rem; color: var(--muted-ink); text-transform: uppercase; letter-spacing: 0.08em; }
.fstat-pts b { color: var(--gold); }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-bottom: 1rem; }
.stat {
  background: var(--card); border: 2px solid var(--card-edge);
  padding: 0.5rem 0.2rem; text-align: center;
  display: flex; flex-direction: column;
}
.stat b { font-size: 1.4rem; }
.stat span { font-size: 0.68rem; color: var(--muted-ink); display: inline-flex; align-items: center; gap: 0.25rem; justify-content: center; }
.stat .icon { width: 0.95em; height: 0.95em; }

/* the card-upgrade reveal: a shine sweeps the frame, the rating pops */
.fcard.card-upgrade .fcard-frame { animation: upgrade-shine 1.4s ease-out; }
.fcard.card-upgrade .fcard-rating { animation: rating-pop 0.7s cubic-bezier(0.2, 1.6, 0.4, 1); }

/* --- badges: embroidered patches ------------------------------------------------------- */

.badges { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: color-mix(in srgb, var(--gold) 14%, var(--card));
  color: var(--ink);
  border: 2px dashed color-mix(in srgb, var(--gold) 65%, var(--card-edge));
  outline: 2px solid var(--card-edge);
  padding: 0.3rem 0.7rem; font-weight: 700; font-size: 0.85rem;
  animation: badge-pop 0.5s cubic-bezier(0.2, 1.8, 0.4, 1) backwards;
}
.badge .badge-ic { color: var(--gold); }
.badge:nth-child(n) { animation-delay: calc(var(--i, 0) * 60ms); }

/* --- home --------------------------------------------------------------------------------- */

.banner {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.8rem 0.9rem; margin-bottom: 1rem;
  color: var(--ink); font-weight: 600;
  background: linear-gradient(100deg, var(--gold-soft), var(--card) 55%);
  border: 2px solid var(--gold);
  transform: skewX(-3deg);
}
.banner > * { transform: skewX(3deg); }
.banner-ic .icon { width: 26px; height: 26px; color: var(--gold); }
.banner-arrow { margin-left: auto; color: var(--muted-ink); }
.banner-arrow .icon { width: 22px; height: 22px; }
.banner-vote { box-shadow: 0 0 22px var(--gold-soft); }

.next-row, .history-row {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  padding: 0.45rem 0; border-bottom: 1px dashed var(--line);
}
.next-row:last-child, .history-row:last-child { border-bottom: 0; }
.history-row { justify-content: space-between; font-size: 0.93rem; }

.home-links { display: grid; gap: 0.8rem; }
.link-card { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0; font-weight: 700; color: var(--ink); }
.link-ic .icon { width: 22px; height: 22px; color: var(--gold); }

/* --- the vote ------------------------------------------------------------------------------ */

.criterion { padding-top: 0.8rem; }
.criterion-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.criterion-head h2 { margin: 0; }
.criterion-desc { margin: 0.35rem 0 0.5rem; }
.budget-pill {
  background: var(--chip); border: 1px solid var(--card-edge);
  padding: 0.15rem 0.6rem; font-size: 1.05rem;
  font-family: "Bebas Neue", sans-serif; letter-spacing: 0.08em;
}
.budget-pill.over { background: color-mix(in srgb, var(--bad) 20%, var(--card)); color: var(--bad); border-color: var(--bad); }
.criterion.over .recipient-row { opacity: 0.55; }

.recipient-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0; border-bottom: 1px dashed var(--line);
}
.recipient-row:last-child { border-bottom: 0; }
.recipient-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

.star-picker { display: flex; gap: 0.3rem; }
.star-opt input { position: absolute; opacity: 0; pointer-events: none; }
.star-opt span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 46px; min-height: 40px; padding: 0.25rem 0.4rem;
  border: 2px solid var(--card-edge);
  font-size: 0.8rem; cursor: pointer; user-select: none;
  background: var(--bg-soft); color: var(--muted-ink);
  transition: transform 0.1s ease;
}
.star-opt span .icon { width: 15px; height: 15px; }
.star-opt input:checked + span {
  background: var(--gold-soft);
  border-color: var(--gold); color: var(--gold);
}
.star-opt input:disabled + span { opacity: 0.4; cursor: not-allowed; }
.star-opt span:active { transform: scale(0.92); }

.vote-submit { margin: 1.2rem 0 1rem; }
.vote-rules { margin-bottom: 1rem; }

/* the goal celebration */
.save-burst { position: relative; overflow: hidden; text-align: center; border-color: var(--good); }
.goal-flash {
  font-family: "Bebas Neue", sans-serif; font-size: 2.6rem; letter-spacing: 0.12em;
  color: var(--gold); line-height: 1;
  animation: goal-in 0.9s cubic-bezier(0.2, 1.5, 0.4, 1);
}
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti span {
  position: absolute; top: -12px; width: 8px; height: 14px;
  animation: confetti-fall 1.4s ease-in forwards;
}
.confetti .c0 { background: var(--gold); }
.confetti .c1 { background: var(--ink); }
.confetti .c2 { background: var(--good); }
.confetti span:nth-child(3n) { left: 6%; animation-delay: 0.05s; transform: rotate(20deg); }
.confetti span:nth-child(3n+1) { left: 24%; animation-delay: 0.22s; transform: rotate(-15deg); }
.confetti span:nth-child(3n+2) { left: 44%; animation-delay: 0.1s; transform: rotate(40deg); }
.confetti span:nth-child(4n) { left: 62%; animation-delay: 0.3s; }
.confetti span:nth-child(5n) { left: 78%; animation-delay: 0.15s; transform: rotate(-30deg); }
.confetti span:nth-child(7n) { left: 90%; animation-delay: 0.25s; }

.secret-card { text-align: center; }

/* --- session: the scoreboard ---------------------------------------------------------------- */

.motm-card { border-color: var(--gold); background: linear-gradient(120deg, var(--gold-soft), var(--card) 45%); }
.motm-row { display: flex; align-items: center; gap: 0.7rem; }
.motm-row > div { flex: 1; font-weight: 700; }
.motm-row .board-value { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 1.6rem; color: var(--gold); }

.top-row, .eleven-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.top-row:last-child, .eleven-row:last-child { border-bottom: 0; }
.top-criterion { flex: 1; font-weight: 700; display: inline-flex; align-items: center; gap: 0.35rem; min-width: 9.5rem; }
.top-count { font-family: "Bebas Neue", sans-serif; font-size: 1.1rem; color: var(--gold); display: inline-flex; align-items: center; gap: 0.25rem; }
.top-players a { font-weight: 700; }

.scoreboard { display: flex; gap: 1px; background: var(--card-edge); border: 2px solid var(--card-edge); margin-bottom: 0.8rem; }
.score-cell { flex: 1; background: var(--bg-soft); text-align: center; padding: 0.7rem 0 0.5rem; }
.score-num { display: block; font-size: 2.6rem; line-height: 1; color: var(--gold); perspective: 200px; }
.score-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted-ink); }
.present-row { margin-bottom: 0.6rem; }

/* the results reveal: the numbers flip in like a stadium board */
.flip { animation: flip-in 0.6s cubic-bezier(0.2, 0.8, 0.3, 1) backwards; }
.flip:nth-child(2) { animation-delay: 0.18s; }

/* --- the league table ------------------------------------------------------------------------- */

.tabs { display: flex; gap: 0.45rem; overflow-x: auto; padding: 0.25rem 0.1rem 0.6rem; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab-pill {
  flex: none; padding: 0.4rem 0.8rem; font-weight: 700; font-size: 0.85rem;
  background: var(--card); border: 2px solid var(--card-edge); color: var(--muted-ink);
  display: inline-flex; align-items: center; gap: 0.35rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.tab-pill .icon { width: 15px; height: 15px; }
.tab-pill.active {
  background: var(--gold); border-color: var(--gold); color: #14100a;
  transform: skewX(-8deg);
}
.tab-pill.active > * { transform: skewX(8deg); }
.admin-tabs { margin: 0.4rem 0 1rem; }

.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 0.5rem; align-items: end; margin-bottom: 1rem; }
.podium-step {
  background: var(--card); border: 2px solid var(--card-edge);
  border-top: 4px solid var(--card-edge);
  padding: 0.7rem 0.3rem 0.5rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
}
.podium-step.step-1 { padding-top: 1.1rem; border-top-color: var(--gold); transform: translateY(-6px); }
.podium-step.step-2 { border-top-color: var(--tier-argent); }
.podium-step.step-3 { border-top-color: var(--tier-bronze); }
.podium-rank { font-family: "Bebas Neue", sans-serif; font-size: 1.2rem; color: var(--muted-ink); }
.step-1 .podium-rank { color: var(--gold); }
.podium-name { font-size: 0.78rem; font-weight: 700; line-height: 1.2; }
.podium-score { font-size: 1.5rem; color: var(--gold); }

.league { width: 100%; border-collapse: collapse; background: var(--card); border: 2px solid var(--card-edge); }
.league th {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted-ink); text-align: left; padding: 0.5rem 0.55rem;
  border-bottom: 2px solid var(--card-edge);
}
.league td { padding: 0.5rem 0.55rem; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.league tr:last-child td { border-bottom: 0; }
.league .pos { font-family: "Bebas Neue", sans-serif; font-size: 1.1rem; color: var(--muted-ink); width: 2.4rem; }
.league .player a { color: var(--ink); font-weight: 600; }
.league .num { text-align: right; font-family: "Bebas Neue", sans-serif; font-size: 1.05rem; }
.league .pts { color: var(--gold); width: 3rem; }
.league .stars-col { color: var(--muted-ink); width: 3.4rem; }
.league th.num, .league th.pts, .league th.stars-col { text-align: right; }
.league tr.me td { background: var(--gold-soft); }
.league tr.me td:first-child { box-shadow: inset 4px 0 0 var(--gold); }

.eleven-card { margin-top: 1rem; }

.board { list-style: none; margin: 0; padding: 0; }
.board-row {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--card); border: 2px solid var(--card-edge);
  padding: 0.5rem 0.7rem; margin-bottom: 0.5rem;
}
.board-row.me { border-color: var(--gold); }
.board-rank {
  font-family: "Bebas Neue", sans-serif; width: 1.6rem; text-align: center;
  color: var(--muted-ink); font-size: 1.05rem;
}
.board-player { display: flex; align-items: center; gap: 0.55rem; flex: 1; min-width: 0; color: var(--ink); font-weight: 600; }
.board-player .avatar { width: 34px; height: 34px; font-size: 0.95rem; }
.board-value { font-size: 1.3rem; color: var(--gold); }

/* --- profile ------------------------------------------------------------------------------------ */

.criterion-totals { display: flex; flex-direction: column; gap: 0.45rem; }
.criterion-total { display: flex; align-items: center; gap: 0.7rem; }
.criterion-total span:first-child { width: 9.5rem; font-weight: 600; font-size: 0.9rem; }
.criterion-total b { width: 2rem; text-align: right; }

.anonymity-note { text-align: center; margin-top: 1rem; font-size: 0.82rem; display: flex; align-items: center; justify-content: center; gap: 0.4rem; }

/* --- admin ---------------------------------------------------------------------------------------- */

.admin-head h1 { margin-bottom: 0.2rem; }
.admin-stats { margin-bottom: 1rem; }
.member-row { border: 2px solid var(--card-edge); margin-bottom: 0.5rem; background: var(--bg-soft); }
.member-row summary {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.55rem 0.7rem; cursor: pointer; list-style: none;
}
.member-row summary::-webkit-details-marker { display: none; }
.member-row.inactive { opacity: 0.6; }
.member-name { font-weight: 700; }
.member-actions { padding: 0.7rem; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 0.7rem; }
.code-box code.big-code { font-size: 1.3rem; letter-spacing: 0.25em; background: var(--chip); padding: 0.3rem 0.7rem; border: 1px solid var(--card-edge); }

.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.5rem; }
.roster-tile {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  border: 2px solid var(--card-edge); background: var(--bg-soft);
  padding: 0.6rem 0.4rem; cursor: pointer; font: inherit; color: var(--ink); font-weight: 700; font-size: 0.85rem;
  transition: transform 0.1s ease;
}
.roster-tile:active { transform: scale(0.96); }
.roster-tile.on {
  border-color: var(--good);
  background: color-mix(in srgb, var(--good) 14%, var(--card));
}
.roster-mark { font-size: 0.72rem; color: var(--muted-ink); }
.roster-tile.on .roster-mark { color: var(--good); font-weight: 700; }

.unresolved-card { border-color: color-mix(in srgb, var(--bad) 45%, var(--card-edge)); }
.unresolved-row { padding: 0.5rem 0; border-bottom: 1px dashed var(--line); }
.unresolved-row:last-child { border-bottom: 0; }
.proposal-list { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.session-row.cancelled { opacity: 0.55; text-decoration: line-through; }
.session-row { justify-content: flex-start; }
.session-row .session-date { min-width: 12.5rem; }

/* the import preview table */
.import-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.import-table th {
  text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted-ink); border-bottom: 2px solid var(--card-edge); padding: 0.4rem 0.4rem;
}
.import-table td { padding: 0.45rem 0.4rem; border-bottom: 1px solid var(--line); }
.import-table .num { color: var(--muted-ink); width: 3rem; }
.import-status { white-space: nowrap; display: inline-flex; align-items: center; gap: 0.3rem; }
.import-new .import-status { color: var(--good); font-weight: 700; }
.import-update .import-status { color: var(--gold); font-weight: 700; }
.import-error .import-status { color: var(--bad); font-weight: 700; }
.import-member .import-status { color: var(--muted-ink); }
.import-error td { background: color-mix(in srgb, var(--bad) 7%, var(--card)); }

.code-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.6rem; }
.code-row { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; flex-wrap: wrap; }
.flash-copy { margin-top: 0.6rem; }
.hidden { display: none; }
.print-only { display: none; }

/* --- animations ------------------------------------------------------------------------------------ */

@keyframes goal-in {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(320px) rotate(240deg); opacity: 0; }
}
@keyframes flip-in {
  0% { transform: rotateX(95deg); opacity: 0; }
  100% { transform: rotateX(0); opacity: 1; }
}
@keyframes upgrade-shine {
  0% { box-shadow: var(--shadow), inset 0 0 0 0 rgba(255, 199, 44, 0); }
  35% { box-shadow: 0 0 34px var(--gold), inset 0 0 24px rgba(255, 199, 44, 0.25); }
  100% { box-shadow: var(--shadow); }
}
@keyframes rating-pop {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes pop-in {
  0% { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes badge-pop {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.pop-in { animation: pop-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.shake { animation: shake 0.3s ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* --- printing the import result ----------------------------------------------------- */

@media print {
  .topbar, .tabbar, .no-print { display: none !important; }
  .print-only { display: block !important; }
  body { background: #fff; color: #000; }
  .page { padding: 0; max-width: none; }
}

/* --- wider screens --------------------------------------------------------------------- */

@media (min-width: 720px) {
  .page { padding-bottom: 3rem; }
  .tabbar {
    top: auto; bottom: auto; position: static; grid-template-columns: none;
    display: flex; justify-content: center; gap: 1.2rem;
    background: transparent; border-top: 0; backdrop-filter: none;
    margin: 0 auto 1rem; max-width: 760px; padding: 0.6rem 1rem 0;
  }
  .tab { position: relative; }
  .form-grid { grid-template-columns: repeat(4, 1fr); }
  .recipient-row { padding: 0.55rem 0; }
  .league .pos { width: 3rem; }
}
