:root {
  color-scheme: light;
  --page: #f3eee2;
  --page-soft: #ebe3d3;
  --surface: #fffaf0;
  --surface-strong: #e7dcc7;
  --ink: #182923;
  --muted: #58665f;
  --green: #21483b;
  --green-soft: #d9e5d9;
  --terracotta: #a84431;
  --gold: #edc36d;
  --line: #beb5a5;
  --shadow: rgba(37, 31, 23, 0.14);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-synthesis: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #151d1a;
  --page-soft: #1d2824;
  --surface: #202c28;
  --surface-strong: #2a3832;
  --ink: #f3ecdf;
  --muted: #bec9c3;
  --green: #abd0bb;
  --green-soft: #293e35;
  --terracotta: #ef9a82;
  --gold: #f0ca78;
  --line: #56645e;
  --shadow: rgba(0, 0, 0, 0.28);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #151d1a;
    --page-soft: #1d2824;
    --surface: #202c28;
    --surface-strong: #2a3832;
    --ink: #f3ecdf;
    --muted: #bec9c3;
    --green: #abd0bb;
    --green-soft: #293e35;
    --terracotta: #ef9a82;
    --gold: #f0ca78;
    --line: #56645e;
    --shadow: rgba(0, 0, 0, 0.28);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@view-transition { navigation: auto; }

::view-transition-old(page-content) { animation: 140ms ease-in both page-leave; }
::view-transition-new(page-content) { animation: 220ms ease-out both page-enter; }

@keyframes page-leave { to { opacity: 0; transform: translateY(-4px); } }
@keyframes page-enter { from { opacity: 0; transform: translateY(8px); } }
@keyframes reveal { from { opacity: 0; transform: translateY(-5px); } }
@keyframes target-pulse { 50% { border-color: var(--terracotta); box-shadow: 0 0 0 4px color-mix(in srgb, var(--terracotta) 18%, transparent); } }

@supports not (view-transition-name: root) {
  main { animation: 220ms ease-out both page-enter; }
}
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  line-height: 1.5;
}

a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a, button, summary, input, select { transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease; }
:focus-visible { outline: 3px solid var(--terracotta); outline-offset: 4px; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  padding: 12px 16px;
  color: var(--page);
  background: var(--ink);
  border-radius: 8px;
  transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  view-transition-name: site-header;
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(20px, 5vw, 72px);
  background: color-mix(in srgb, var(--page) 94%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 750;
  text-decoration: none;
  letter-spacing: -0.015em;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #172a23;
  background: var(--gold);
  border: 2px solid currentColor;
  border-radius: 13px 9px 14px 8px;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  transform: rotate(-2deg);
}

.header-tools { display: flex; align-items: center; gap: 18px; }
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}
.status span { width: 8px; height: 8px; background: var(--terracotta); border-radius: 50%; }

.theme-toggle {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--page-soft); }
.theme-icon { font-size: 1.15rem; }

main { view-transition-name: page-content; overflow: hidden; }
.hero {
  position: relative;
  width: min(1120px, calc(100% - 40px));
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(310px, 0.72fr);
  grid-template-areas: "copy note";
  align-content: center;
  gap: 36px clamp(46px, 8vw, 120px);
  margin: 0 auto;
  padding: 84px 0 78px;
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 280px;
  height: 230px;
  right: -130px;
  top: 72px;
  background: var(--green-soft);
  border-radius: 42% 58% 67% 33% / 55% 36% 64% 45%;
  transform: rotate(9deg);
}

.hero-copy-block { grid-area: copy; align-self: center; }
.kicker {
  margin: 0 0 12px;
  color: var(--terracotta);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1, h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.04em;
}
h1 {
  max-width: 700px;
  margin: 0;
  font-size: clamp(3.2rem, 7.2vw, 6rem);
  line-height: 0.96;
}
.hero-copy {
  max-width: 630px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: clamp(1.06rem, 1.8vw, 1.3rem);
  line-height: 1.65;
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 34px; }
.button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 2px solid var(--green);
  border-radius: 14px 10px 15px 9px;
  font-weight: 750;
  cursor: pointer;
}
.button-primary { color: var(--page); background: var(--green); box-shadow: 4px 4px 0 var(--gold); }
:root[data-theme="dark"] .button-primary { color: #15251f; }
.button-primary:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--gold); }
.text-link { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-weight: 750; text-underline-offset: 5px; }

.result-note {
  grid-area: note;
  position: relative;
  align-self: center;
  padding: 78px 34px 32px;
  color: #1c2924;
  background: #fff8e9;
  border: 1px solid #bcae95;
  border-radius: 8px 17px 10px 20px;
  box-shadow: 12px 14px 0 var(--shadow);
  transform: rotate(1.4deg);
}
.result-note::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 24px;
  top: -9px;
  left: calc(50% - 45px);
  background: rgba(231, 195, 109, 0.72);
  transform: rotate(-3deg);
}
.tile-row { position: absolute; top: 24px; left: 32px; display: flex; gap: 6px; }
.tile-row span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: #e7c778;
  border: 1px solid #7d6840;
  border-radius: 5px 7px 4px 6px;
  box-shadow: 2px 2px 0 #a98c53;
  font-family: Georgia, serif;
  font-weight: 700;
}
.tile-row span:nth-child(2) { transform: translateY(3px) rotate(-2deg); }
.tile-row span:nth-child(3) { transform: translateY(-2px) rotate(2deg); }
.note-overline { margin: 0 0 14px; color: #8b3e30; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.result-note ol { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.result-note li { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 10px; font-weight: 700; }
.result-note li span { width: 27px; height: 27px; display: grid; place-items: center; color: #fff8e9; background: #285041; border-radius: 50%; font-size: 0.75rem; }
.note-caption { margin: 20px 0 0; padding-top: 15px; color: #5a635e; border-top: 1px dashed #b8aa93; font-size: 0.84rem; }

.how-it-works {
  padding: 96px max(20px, calc((100vw - 1120px) / 2));
  background: var(--surface);
  border-block: 1px solid var(--line);
}
.section-intro { display: grid; grid-template-columns: 90px minmax(0, 720px); gap: 28px; align-items: start; }
.section-mark {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  color: var(--page);
  background: var(--terracotta);
  border-radius: 48% 52% 43% 57% / 59% 44% 56% 41%;
  font-family: Georgia, serif;
  font-size: 1.2rem;
  transform: rotate(-5deg);
}
.section-intro h2, .choice-copy h2, .preview-copy h2 {
  margin: 0;
  font-size: clamp(2.3rem, 4.8vw, 4.4rem);
  line-height: 1.03;
}
.journey { position: relative; max-width: 900px; margin: 72px auto 0; }
.journey::before { content: ""; position: absolute; left: 50%; top: 8px; bottom: 8px; border-left: 2px dashed var(--line); }
.journey-step { position: relative; width: 45%; margin-bottom: 30px; padding: 26px 28px; background: var(--page); border: 1px solid var(--line); border-radius: 20px 9px 24px 12px; }
.journey-step-right { margin-left: 55%; border-radius: 9px 20px 12px 24px; }
.journey-step-final { margin-bottom: 0; }
.step-dot { position: absolute; top: 34px; right: -12.8%; width: 15px; height: 15px; background: var(--gold); border: 3px solid var(--green); border-radius: 50%; }
.journey-step-right .step-dot { right: auto; left: -12.8%; }
.step-label { margin: 0 0 7px; color: var(--terracotta); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
.journey-step h3 { margin: 0 0 8px; font-family: Georgia, serif; font-size: 1.45rem; }
.journey-step p:last-child { margin: 0; color: var(--muted); }

.choice-section {
  position: relative;
  width: min(1120px, calc(100% - 40px));
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(40px, 8vw, 110px);
  align-items: center;
  margin: 0 auto;
  padding: 112px 0;
}
.choice-shape { position: absolute; z-index: -1; width: 210px; height: 170px; left: -120px; bottom: 45px; background: var(--green-soft); border-radius: 63% 37% 44% 56% / 39% 58% 42% 61%; transform: rotate(-12deg); }
.choice-copy > p:last-child { max-width: 680px; margin: 24px 0 0; color: var(--muted); font-size: 1.05rem; line-height: 1.7; }
.choice-list { display: grid; grid-auto-rows: 1fr; gap: 14px; }
.choice-list > div { min-height: 104px; display: grid; grid-template-columns: 48px 1fr; align-content: center; column-gap: 14px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px 18px 11px 20px; }
.choice-list > div:nth-child(2) { border-radius: 18px 9px 20px 11px; }
.choice-list span { grid-row: span 2; width: 46px; height: 46px; display: grid; place-items: center; color: #192820; background: var(--gold); border-radius: 50%; font-size: 1.3rem; }
.choice-list strong { align-self: end; }
.choice-list small { color: var(--muted); font-size: 0.84rem; }

.league-preview {
  width: min(1120px, calc(100% - 40px));
  display: grid;
  grid-template-columns: 1fr 0.72fr;
  gap: clamp(34px, 7vw, 90px);
  align-items: center;
  margin: 0 auto 90px;
  padding: clamp(34px, 6vw, 68px);
  color: #f8f0e2;
  background: #21483b;
  border-radius: 34px 12px 38px 15px;
}
.preview-copy .kicker { color: #f0ca78; }
.preview-copy p:last-child { max-width: 580px; color: #d4e2da; }
.empty-panel { min-height: 150px; display: flex; align-items: center; gap: 18px; padding: 24px; color: #182923; background: #fff8e9; border-radius: 13px 25px 15px 20px; transform: rotate(-1deg); }
.empty-icon { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 48px; color: #fff8e9; background: #a84431; border-radius: 50%; font-size: 1.5rem; }
.empty-panel strong, .empty-panel span { display: block; }
.empty-panel div span { margin-top: 4px; color: #58665f; font-size: 0.85rem; }

.home-statistics { width: min(1120px, calc(100% - 40px)); display: grid; grid-template-columns: 0.75fr 1.25fr; align-items: center; gap: clamp(32px, 7vw, 90px); margin: 0 auto 100px; padding-top: 30px; }
.home-statistics h2 { margin: 0 0 24px; font-size: clamp(2.3rem, 5vw, 4rem); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: stretch; gap: 10px; }
.stat-grid article { height: 130px; display: flex; flex-direction: column; justify-content: space-between; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px 8px 20px 10px; }
.stat-grid article:nth-child(even) { border-radius: 9px 20px 11px 18px; }
.stat-grid strong { font-family: Georgia, serif; font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 500; line-height: 1; }
.stat-grid span { color: var(--muted); font-size: 0.78rem; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 30px clamp(20px, 5vw, 72px); color: var(--muted); border-top: 1px solid var(--line); font-size: 0.76rem; }
.privacy-banner { position: fixed; z-index: 30; right: 20px; bottom: 20px; width: min(460px, calc(100% - 40px)); display: flex; align-items: center; gap: 18px; padding: 18px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 18px 8px 20px 10px; box-shadow: 8px 10px 24px var(--shadow); }
.privacy-banner p { margin: 0; font-size: 0.86rem; }
.privacy-banner a { color: var(--green); font-weight: 700; }
.privacy-banner .button { flex: 0 0 auto; }

.public-nav { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.public-nav a, .quiet-link { min-height: 44px; display: inline-flex; align-items: center; color: var(--green); font-weight: 700; text-underline-offset: 4px; }
.public-nav .nav-emphasis { padding: 0 14px; color: var(--page); background: var(--green); border-radius: 12px 8px 13px 9px; text-decoration: none; }
.signed-in { color: var(--green); font-size: 0.88rem; font-weight: 700; text-underline-offset: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.icon-control { width: 44px; height: 44px; display: inline-grid; place-items: center; flex: 0 0 44px; padding: 0; color: var(--green); background: transparent; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; }
.icon-control:hover { color: var(--ink); background: var(--green-soft); border-color: var(--green); }
.language-picker { position: relative; flex: 0 0 44px; background: transparent; border: 0; border-radius: 50%; }
.language-picker > summary { list-style: none; }
.language-picker > summary::-webkit-details-marker { display: none; }
.language-picker[open] > summary { color: var(--ink); background: var(--green-soft); border-color: var(--green); }
.language-menu { position: absolute; z-index: 40; top: calc(100% + 9px); right: 0; width: max-content; min-width: 170px; display: grid; gap: 3px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px 8px 16px 10px; box-shadow: 8px 10px 24px var(--shadow); }
.language-menu form { margin: 0; }
.language-menu button { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.language-menu button:hover, .language-menu button[aria-current="true"] { background: var(--green-soft); }
.language-menu button[aria-current="true"] { font-weight: 750; }
.language-menu button span:first-child { font-size: 1.2rem; }
.quiet-button {
  min-height: 44px;
  padding: 5px 10px;
  color: var(--green);
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.button:hover, .quiet-button:hover, summary:hover { box-shadow: 0 3px 0 color-mix(in srgb, var(--ink) 18%, transparent); }
details[open] > :not(summary) { animation: 160ms ease-out both reveal; }
.back-link { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--green); font-weight: 750; text-underline-offset: 4px; }
.button-danger { min-height: 44px; padding: 0 14px; color: #fff7ef; background: var(--terracotta); border: 1px solid color-mix(in srgb, var(--terracotta) 75%, black); border-radius: 10px 7px 11px 8px; font: inherit; font-weight: 750; cursor: pointer; }
.danger-zone summary { color: var(--terracotta); }
.danger-zone p { color: var(--muted); font-size: 0.84rem; }

.auth-main { min-height: calc(100vh - 78px); display: grid; place-items: center; padding: 48px 20px 72px; }
.auth-card { width: min(100%, 520px); padding: clamp(28px, 6vw, 54px); background: var(--surface); border: 1px solid var(--line); border-radius: 28px 12px 32px 16px; box-shadow: 12px 14px 0 var(--shadow); }
.auth-card h1 { font-size: clamp(2.7rem, 8vw, 4.5rem); }
.auth-switch { margin: 26px 0 0; color: var(--muted); }
.auth-switch a { color: var(--green); font-weight: 700; text-underline-offset: 4px; }
.forgot-link, .secondary-form { margin: 18px 0 0; text-align: center; }
.forgot-link a { color: var(--green); font-weight: 700; text-underline-offset: 4px; }

.form-stack { display: grid; gap: 18px; margin-top: 28px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .button { align-self: end; }
label { display: grid; gap: 7px; color: var(--ink); font-size: 0.86rem; font-weight: 750; }
label small { color: var(--muted); font-size: 0.76rem; font-weight: 450; }
input, select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 10px 7px 11px 8px;
  font: inherit;
  font-weight: 450;
}
input:hover, select:hover { border-color: var(--green); }
input:focus-visible, select:focus-visible { border-color: var(--terracotta); }

.message { width: min(100%, 1120px); margin: 0 auto 24px; padding: 14px 18px; border: 1px solid; border-radius: 13px 8px 14px 9px; }
.message-error { color: #721f18; background: #fbe5de; border-color: #c66b5a; }
.message-success { color: #194531; background: #dcecdf; border-color: #77a88d; }
:root[data-theme="dark"] .message-error { color: #ffd9d0; background: #4c241f; border-color: #d68472; }
:root[data-theme="dark"] .message-success { color: #d8f3df; background: #1c3a2b; border-color: #73a789; }

.app-main { width: min(1120px, calc(100% - 40px)); min-height: calc(100vh - 78px); margin: 0 auto; padding: 68px 0 100px; }
.app-title-row, .league-heading, .season-header, .division-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.app-title-row { margin-bottom: 42px; }
.app-title-row h1, .league-heading h1 { font-size: clamp(3.2rem, 7vw, 6rem); }
.league-heading { margin-bottom: 34px; }
.member-count { padding: 8px 13px; color: var(--green); border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.league-focus { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.55fr); gap: 18px; margin-bottom: 22px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--gold); border-radius: 18px 9px 20px 11px; box-shadow: 6px 7px 0 var(--shadow); }
.league-focus.focus-single { grid-template-columns: 1fr; }
.focus-action h2 { margin: 0; overflow-wrap: anywhere; font-size: clamp(1.65rem, 3vw, 2.5rem); line-height: 1.05; }
.focus-context { margin: 9px 0 16px; color: var(--muted); font-size: 0.82rem; }
.focus-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; max-width: 560px; margin: 14px 0; text-align: center; }
.focus-score strong:first-child { text-align: right; }
.focus-score strong:last-child { text-align: left; }
.focus-score span { font-family: Georgia, serif; font-size: 1.3rem; }
.focus-buttons { display: flex; align-items: center; gap: 10px; }
.focus-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: center; gap: 8px; }
.focus-stats > div { min-height: 84px; display: flex; flex-direction: column; justify-content: space-between; padding: 12px; background: var(--page); border: 1px solid var(--line); border-radius: 12px 7px 13px 8px; }
.focus-stats strong { font-family: Georgia, serif; font-size: 1.7rem; font-weight: 500; line-height: 1; }
.focus-stats span { color: var(--muted); font-size: 0.75rem; }
.focus-stats .focus-warning { border-color: color-mix(in srgb, var(--terracotta) 55%, var(--line)); }
.focus-warning strong { color: var(--terracotta); }

.league-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 80px; }
.league-card { min-height: 110px; display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 16px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px 24px 15px 19px; text-decoration: none; }
.league-card:hover { border-color: var(--green); transform: translateY(-2px); }
.league-card-mark { width: 50px; height: 50px; display: grid; place-items: center; color: #172a23; background: var(--gold); border: 1px solid #7d6840; border-radius: 8px 11px 7px 10px; font-family: Georgia, serif; font-size: 1.35rem; }
.league-card strong, .league-card small { display: block; }
.league-card strong { font-family: Georgia, serif; font-size: 1.35rem; }
.league-card small { margin-top: 4px; color: var(--muted); }
.empty-state { grid-column: 1 / -1; min-height: 150px; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 30px; color: var(--muted); border: 1px dashed var(--line); border-radius: 20px 10px 24px 14px; }
.empty-state > span { width: 48px; height: 48px; display: grid; place-items: center; color: var(--page); background: var(--green); border-radius: 50%; font-size: 1.4rem; }
.empty-state strong { color: var(--ink); }
.empty-state p { margin: 4px 0 0; }

.panel { padding: clamp(28px, 5vw, 54px); background: var(--surface); border: 1px solid var(--line); border-radius: 28px 12px 34px 16px; }
.form-panel { display: grid; grid-template-columns: 0.75fr 1.25fr; gap: clamp(32px, 7vw, 80px); }
.form-panel h2 { margin: 0; font-size: clamp(2.2rem, 4vw, 3.5rem); }
.form-panel > div > p:last-child { color: var(--muted); }

.organizer-tools { margin-bottom: 34px; padding: 22px; background: var(--green-soft); border-radius: 20px 10px 22px 12px; }
.section-label { display: flex; align-items: center; gap: 10px; }
.section-label > span { width: 38px; height: 38px; display: grid; place-items: center; color: #192820; background: var(--gold); border-radius: 50%; }
.section-label h2 { margin: 0; font-size: 1.3rem; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px 8px 14px 9px; }
summary { min-height: 48px; display: flex; align-items: center; padding: 10px 14px; color: var(--green); font-weight: 750; cursor: pointer; }
.compact-form { margin: 0; padding: 4px 14px 16px; }
.edit-list { padding: 4px 0; }
.edit-list form + form { border-top: 1px solid var(--line); }
.invitation-form { display: grid; grid-template-columns: 1fr auto auto; align-items: end; gap: 10px; padding: 10px 14px 14px; }
.member-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 14px; }
.member-row > span { min-width: 0; overflow-wrap: anywhere; }
.member-row span, .member-row strong, .member-row small { display: block; }
.member-row small { margin-top: 2px; color: var(--muted); }
.tool-help { margin: 6px 14px 12px; color: var(--muted); font-size: 0.8rem; }
.button-small { min-height: 44px; padding: 0 14px; color: var(--page); background: var(--green); border-width: 1px; border-radius: 10px 7px 11px 8px; }
:root[data-theme="dark"] .button-small { color: #15251f; }

.member-strip, .division-members { display: flex; flex-wrap: wrap; gap: 8px; }
.member-strip { margin-bottom: 50px; }
.member-strip > span, .division-members > span { padding: 7px 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 0.85rem; }
.division-members > span { display: inline-flex; align-items: center; gap: 5px; }
.division-members form { display: inline; }
.division-members button { width: 22px; height: 22px; padding: 0; color: var(--terracotta); background: transparent; border: 0; border-radius: 50%; font-weight: 800; cursor: pointer; }
.division-members button:hover { background: var(--page-soft); }
.member-strip small { color: var(--muted); }
.season { margin-top: 14px; overflow: clip; border-radius: 18px 9px 20px 11px; }
.season-header { min-height: 74px; justify-content: space-between; padding: 14px 18px; background: var(--surface); }
.season-header > span { display: grid; gap: 3px; }
.season-header strong { font-family: Georgia, serif; font-size: clamp(1.55rem, 3vw, 2.25rem); font-weight: 500; line-height: 1; }
.season-header > small { margin-left: auto; color: var(--muted); font-weight: 600; }
.season-body { padding: 14px; border-top: 1px solid var(--line); }
.season-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-bottom: 12px; }
.season-actions .compact-tool { width: min(100%, 310px); }
.season-actions .button-primary { min-height: 44px; }
.status-badge { color: var(--muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.status-active { color: var(--terracotta); }
.inline-tool { width: min(100%, 440px); margin: 0 0 24px auto; }
.inline-form { display: flex; align-items: end; gap: 10px; padding: 10px 14px 14px; }
.inline-form label { flex: 1; }
.division { scroll-margin-top: 110px; margin-top: 10px; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px 8px 16px 10px; }
.division:target { animation: 900ms ease-out target-pulse; }
.division-heading { min-height: 54px; align-items: center; padding: 9px 13px; }
.division-heading strong { font-family: Georgia, serif; font-size: 1.25rem; font-weight: 600; }
.division-heading > span { margin-left: auto; color: var(--muted); font-size: 0.8rem; font-weight: 550; }
.division-body { padding: 0 14px 16px; border-top: 1px solid var(--line); }
.assign-form { max-width: 620px; margin: 16px 0; padding-inline: 0; }
.division-delete-form { margin: -10px 0 10px; }
.danger-link { color: var(--terracotta); }
.division-members { margin: 18px 0 24px; }
.division-empty { margin-top: 20px; padding: 18px; color: var(--muted); background: var(--page); border: 1px dashed var(--line); border-radius: 12px; }

.table-wrap { margin-top: 28px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
caption { padding: 0 0 10px; text-align: left; color: var(--muted); font-size: 0.82rem; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: right; }
th:nth-child(2), td:nth-child(2) { text-align: left; }
thead th { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; }
tbody th { font-weight: 750; }

.fixtures { margin-top: 26px; }
.fixture-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.fixtures h4 { margin: 0; font-family: Georgia, serif; font-size: 1.35rem; }
.fixture-filters { display: inline-flex; gap: 3px; padding: 3px; background: var(--page); border: 1px solid var(--line); border-radius: 999px; }
.fixture-filters button { min-height: 32px; padding: 3px 10px; color: var(--muted); background: transparent; border: 0; border-radius: 999px; font-size: 0.76rem; font-weight: 700; cursor: pointer; }
.fixture-filters button[aria-pressed="true"] { color: var(--page); background: var(--green); }
:root[data-theme="dark"] .fixture-filters button[aria-pressed="true"] { color: #15251f; }
.fixture-list { display: grid; gap: 6px; }
.fixture { padding: 9px 12px; background: var(--page); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px 13px 9px 11px; }
.fixture[hidden] { display: none; }
.fixture-confirmed { border-left-color: #4f8a68; }
.fixture-pending_confirmation { border-left-color: var(--gold); }
.fixture-disputed { border-left-color: var(--terracotta); }
.fixture-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 0.76rem; }
.fixture-players { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 3px; text-align: center; }
.fixture-players strong:first-child { text-align: right; }
.fixture-players strong:last-child { text-align: left; }
.fixture-players span { font-family: Georgia, serif; font-size: 1.05rem; }
.score-form { display: flex; align-items: end; justify-content: center; gap: 9px; margin-top: 16px; }
.score-form label { width: min(160px, 35%); }
.score-form input { text-align: center; }
.score-form > span { padding-bottom: 12px; }
.review-actions { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 16px; }
.report-result, .correction { width: min(100%, 560px); margin: 8px auto 0; background: transparent; }
.report-result summary, .correction summary { min-height: 36px; justify-content: center; padding: 4px 10px; font-size: 0.8rem; }
.fixture-filter-empty { margin: 12px 0 0; padding: 18px; color: var(--muted); background: var(--page); border: 1px dashed var(--line); border-radius: 10px; text-align: center; }

.statistics-main { max-width: 1240px; }
.statistics-heading { display: grid; grid-template-columns: 1fr minmax(280px, 0.55fr); align-items: end; gap: 48px; margin-bottom: 52px; }
.statistics-heading h1 { font-size: clamp(3.4rem, 8vw, 7rem); }
.statistics-heading p:last-child { color: var(--muted); }
.statistics-filter { display: flex; align-items: end; gap: 10px; padding: 18px; background: var(--green-soft); border-radius: 18px 8px 20px 10px; }
.statistics-filter label { flex: 1; }
.statistics-main > .stat-grid { margin-bottom: 90px; }
.statistics-section { margin-top: 80px; }
.compact-intro { margin-bottom: 28px; }
.statistics-section table th:first-child, .statistics-section table td:first-child { text-align: left; }
.recent-match-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.recent-match-list article { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px 18px 12px 16px; }
.recent-match-list strong, .recent-match-list small { display: block; }
.recent-match-list strong span { color: var(--terracotta); font-family: Georgia, serif; font-size: 1.2rem; }
.recent-match-list small, .recent-match-list time, .muted-copy { color: var(--muted); font-size: 0.78rem; }
.public-league-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.public-league-grid a { display: grid; gap: 6px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px 8px 18px 10px; text-decoration: none; }
.public-league-grid a:hover { border-color: var(--green); transform: translateY(-2px); }
.public-league-grid strong { font-family: Georgia, serif; font-size: 1.25rem; }
.public-league-grid span { color: var(--muted); font-size: 0.8rem; }
.privacy-main { max-width: 1040px; }
.privacy-main > header { max-width: 820px; margin-bottom: 54px; }
.privacy-main h1 { font-size: clamp(3.2rem, 8vw, 6.8rem); }
.privacy-main > header > p:last-child { color: var(--muted); }
.privacy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.privacy-grid section { padding: clamp(24px, 4vw, 38px); background: var(--surface); border: 1px solid var(--line); border-radius: 18px 8px 20px 10px; }
.privacy-grid section:nth-child(even) { border-radius: 9px 20px 11px 18px; }
.privacy-grid h2 { margin: 0 0 14px; font-size: 1.8rem; }
.privacy-grid p { margin: 0; color: var(--muted); line-height: 1.7; }

@supports not (color: color-mix(in srgb, black, white)) {
  .site-header { background: var(--page); }
}

@media (max-width: 820px) {
  .status { display: none; }
  .hero { grid-template-columns: 1fr; grid-template-areas: "copy" "note"; padding-top: 68px; }
  .result-note { max-width: 470px; margin: 8px auto 0; }
  .section-intro { grid-template-columns: 62px 1fr; gap: 18px; }
  .section-mark { width: 54px; height: 54px; }
  .choice-section, .league-preview, .home-statistics, .statistics-heading { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recent-match-list { grid-template-columns: 1fr; }
  .public-league-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice-list { max-width: 560px; }
  .form-panel { grid-template-columns: 1fr; }
  .league-list { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
  .league-focus { grid-template-columns: 1fr; }
}

@media (min-width: 821px) {
  body { font-size: 0.94rem; }
  .site-header { min-height: 66px; gap: 18px; padding-block: 9px; }
  .brand { min-height: 42px; }
  .brand-mark { width: 38px; height: 38px; }
  .header-tools { gap: 12px; }
  .icon-control, .language-picker { width: 40px; height: 40px; flex-basis: 40px; }
  .public-nav a, .quiet-link, .quiet-button { min-height: 40px; }
  .app-main { min-height: calc(100vh - 66px); padding: 44px 0 70px; }
  .app-title-row { margin-bottom: 28px; }
  .app-title-row h1, .league-heading h1 { font-size: clamp(2.8rem, 5vw, 4.8rem); }
  .league-heading { margin-bottom: 24px; }
  .league-list { margin-bottom: 48px; }
  .league-card { min-height: 90px; padding: 14px 16px; }
  .panel { padding: clamp(24px, 3.5vw, 40px); }
  .organizer-tools { margin-bottom: 24px; padding: 16px; }
  .tool-grid { margin-top: 12px; }
  summary { min-height: 44px; padding: 8px 12px; }
  .form-stack { gap: 14px; margin-top: 20px; }
  input, select { min-height: 44px; padding: 8px 10px; }
  .member-strip { margin-bottom: 32px; }
  .season { margin-top: 10px; }
  .division { margin-top: 8px; }
  .table-wrap { margin-top: 20px; }
  th, td { padding: 8px; }
  .fixtures { margin-top: 28px; }
  .fixture { padding: 14px; }
}

@media (max-width: 580px) {
  .site-header { flex-wrap: wrap; gap: 8px 12px; padding-inline: 16px; }
  .brand > span:last-child { display: none; }
  .public-nav { order: 3; width: 100%; justify-content: center; margin: 0; padding-top: 4px; border-top: 1px solid var(--line); }
  .header-tools { margin-left: auto; gap: 8px; }
  .signed-in { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .language-menu { position: fixed; top: 70px; right: 12px; }
  .hero { width: min(100% - 32px, 1120px); min-height: auto; padding-bottom: 64px; }
  h1 { font-size: clamp(3rem, 15vw, 4.4rem); }
  .hero-actions { align-items: flex-start; flex-direction: column; }
  .result-note { padding-inline: 24px; transform: rotate(0.5deg); }
  .how-it-works { padding: 74px 20px; }
  .section-intro { grid-template-columns: 1fr; }
  .journey { margin-top: 46px; padding-left: 24px; }
  .journey::before { left: 7px; }
  .journey-step, .journey-step-right { width: 100%; margin: 0 0 18px; }
  .step-dot, .journey-step-right .step-dot { left: -24px; right: auto; top: 32px; }
  .choice-section { width: min(100% - 32px, 1120px); padding: 82px 0; }
  .privacy-grid { grid-template-columns: 1fr; }
  .league-preview { width: min(100% - 32px, 1120px); margin-bottom: 56px; padding: 28px 22px; }
  .home-statistics { width: min(100% - 32px, 1120px); margin-bottom: 64px; }
  footer { flex-direction: column; }
  .public-nav { gap: 8px; }
  .public-nav a { font-size: 0.82rem; }
  .public-nav .nav-emphasis { display: none; }
  .app-main { width: min(100% - 32px, 1120px); padding-top: 46px; }
  .public-league-grid { grid-template-columns: 1fr; }
  .app-title-row, .league-heading, .season-header { align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .inline-form, .score-form { align-items: stretch; flex-direction: column; }
  .invitation-form { grid-template-columns: 1fr; }
  .member-row { align-items: stretch; flex-direction: column; }
  .member-row .button-danger { width: 100%; }
  .score-form label { width: 100%; }
  .score-form > span { display: none; }
  .fixture-players { grid-template-columns: 1fr; }
  .fixture-players strong:first-child, .fixture-players strong:last-child { text-align: center; }
  .fixture-meta { flex-direction: column; gap: 2px; }
  .league-focus { padding: 16px; }
  .focus-score { grid-template-columns: 1fr; }
  .focus-score strong:first-child, .focus-score strong:last-child { text-align: center; }
  .focus-buttons { align-items: stretch; flex-direction: column; }
  .focus-buttons form, .focus-buttons button { width: 100%; }
  .fixture-toolbar { align-items: stretch; flex-direction: column; }
  .fixture-filters { display: grid; grid-template-columns: repeat(3, 1fr); }
  .review-actions { align-items: stretch; flex-direction: column; }
  .review-actions form, .review-actions button { width: 100%; }
  .privacy-banner { align-items: stretch; flex-direction: column; }
  .privacy-banner .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  html { scroll-behavior: auto; }
  .site-header, main { view-transition-name: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media (forced-colors: active) {
  .brand-mark, .section-mark, .choice-list span, .empty-icon, .result-note li span { border: 2px solid currentColor; }
  .hero::before, .choice-shape { display: none; }
}
