:root {
  color-scheme: light;
  --ink: #18342d;
  --forest: #173c32;
  --forest-2: #235c4b;
  --forest-3: #2e755f;
  --clay: #d75f3b;
  --clay-dark: #ae4328;
  --lime: #d9ed74;
  --cream: #f3f0e8;
  --paper: #fffdf8;
  --white: #ffffff;
  --muted: #6d7c76;
  --line: #dce1d9;
  --line-dark: #c8d0c5;
  --danger: #b53d31;
  --success: #28745d;
  --shadow-sm: 0 1px 2px rgba(23, 60, 50, 0.06), 0 8px 24px rgba(23, 60, 50, 0.05);
  --shadow-lg: 0 24px 60px rgba(23, 60, 50, 0.15);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --shell: 1180px;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Iowan Old Style, Baskerville, Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  clip-path: inset(50%) !important;
}

.shell {
  width: min(var(--shell), calc(100% - 40px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--lime);
  color: var(--forest);
  font-weight: 800;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(23, 60, 50, 0.95);
  color: var(--white);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
}

.brand-mark svg {
  width: 29px;
  height: 29px;
}

.brand-mark circle {
  fill: var(--lime);
  stroke: var(--forest);
  stroke-width: 2;
}

.brand-mark path {
  fill: none;
  stroke: var(--forest);
  stroke-width: 2;
  stroke-linecap: round;
}

.header-actions,
.schedule-actions,
.export-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.save-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 5px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  font-weight: 650;
}

.save-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(217, 237, 116, 0.1);
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 760;
  line-height: 1;
  text-decoration: none;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, opacity 150ms ease, box-shadow 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.reset-button:focus-visible,
.dialog-close:focus-visible {
  outline: 3px solid rgba(215, 95, 59, 0.3);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button-quiet {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--white);
}

.button-quiet:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.button-light {
  background: var(--lime);
  color: var(--forest);
}

.button-light:hover:not(:disabled) {
  background: #e5f58e;
}

.button-primary {
  background: var(--clay);
  color: var(--white);
  box-shadow: 0 8px 22px rgba(174, 67, 40, 0.18);
}

.button-primary:hover:not(:disabled) {
  background: var(--clay-dark);
  box-shadow: 0 10px 28px rgba(174, 67, 40, 0.24);
}

.button-outline {
  border-color: var(--line-dark);
  background: rgba(255, 255, 255, 0.55);
  color: var(--forest);
}

.button-outline:hover:not(:disabled) {
  border-color: var(--forest-2);
  background: var(--white);
}

.button-outline-dark {
  border-color: rgba(23, 60, 50, 0.3);
  color: var(--forest);
}

.button-outline-dark:hover:not(:disabled) {
  border-color: var(--forest);
  background: rgba(23, 60, 50, 0.06);
}

.button-large {
  min-height: 56px;
  padding-inline: 26px;
  font-size: 16px;
}

.hero {
  position: relative;
  overflow: hidden;
  background: var(--forest);
  color: var(--white);
}

.hero::before {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 0.8px, transparent 0.8px);
  background-size: 17px 17px;
  content: "";
  mask-image: linear-gradient(to right, black, transparent 70%);
}

.hero::after {
  position: absolute;
  right: -180px;
  bottom: -260px;
  width: 620px;
  height: 620px;
  border: 1px solid rgba(217, 237, 116, 0.13);
  border-radius: 50%;
  content: "";
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 510px;
  align-items: center;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: 80px;
  padding-block: 72px 82px;
}

.eyebrow,
.step-label,
.mini-label {
  color: var(--clay);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--lime);
}

.eyebrow span {
  width: 26px;
  height: 1px;
  background: currentColor;
}

.hero h1 {
  max-width: 720px;
  margin: 18px 0 18px;
  font-family: var(--serif);
  font-size: clamp(48px, 6vw, 78px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.96;
}

.hero h1 em {
  color: var(--lime);
  font-weight: 500;
}

.hero-copy > p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 18px;
  line-height: 1.65;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.hero-facts span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 680;
}

.hero-facts svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--lime);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.court-visual {
  position: relative;
  display: grid;
  min-height: 360px;
  place-items: center;
}

.court-sun {
  position: absolute;
  top: 5px;
  right: 8px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: var(--lime);
  opacity: 0.92;
}

.court-card {
  position: relative;
  width: min(100%, 390px);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-lg);
  transform: rotate(2deg);
  backdrop-filter: blur(6px);
}

.court-label {
  display: block;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mini-court {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1.55;
  border: 3px solid var(--paper);
  border-radius: 5px;
  background: var(--clay);
  box-shadow: inset 0 0 0 1px rgba(23, 60, 50, 0.08);
}

.mini-court::before,
.mini-court::after {
  position: absolute;
  top: 18%;
  bottom: 18%;
  width: 1px;
  background: rgba(255, 255, 255, 0.85);
  content: "";
}

.mini-court::before { left: 23%; }
.mini-court::after { right: 23%; }

.court-line {
  position: absolute;
  background: rgba(255, 255, 255, 0.9);
}

.court-line-v {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
}

.court-line-h {
  top: 50%;
  right: 23%;
  left: 23%;
  height: 1px;
}

.court-number {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  color: rgba(255, 255, 255, 0.19);
  font-family: var(--serif);
  font-size: 74px;
  font-weight: 800;
  letter-spacing: -0.08em;
  transform: translate(-50%, -50%);
}

.ball {
  position: absolute;
  z-index: 3;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 3px 7px rgba(23, 60, 50, 0.25);
}

.ball-one { top: 25%; left: 31%; }
.ball-two { right: 28%; bottom: 22%; }

.court-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 3px 2px;
}

.court-caption strong {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
}

.court-caption span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 650;
}

.setup-section,
.schedule-section {
  padding-block: 86px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 34px;
}

.section-heading h2 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: clamp(36px, 4vw, 50px);
  font-weight: 550;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.section-heading > p {
  max-width: 440px;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.event-panel {
  display: grid;
  align-items: center;
  grid-template-columns: 220px 1fr;
  gap: 30px;
  margin-bottom: 20px;
  padding: 28px;
}

.panel-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.panel-title-row h3,
.export-copy h3 {
  margin: 1px 0 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.panel-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
}

.panel-icon-dark {
  background: var(--forest);
  color: var(--lime);
}

.panel-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.event-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.event-fields .field-wide { grid-column: span 2; }

.field,
.names-field,
.share-url {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.field > span,
.names-field > span,
.share-url > span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 780;
}

.field input,
.field select,
.names-field textarea,
.share-url input {
  width: 100%;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.field input,
.field select {
  height: 46px;
  padding: 0 13px;
}

.field input:hover,
.field select:hover,
.names-field textarea:hover,
.share-url input:hover {
  border-color: #aab7ad;
}

.field input:focus,
.field select:focus,
.names-field textarea:focus,
.share-url input:focus {
  border-color: var(--forest-2);
  box-shadow: 0 0 0 3px rgba(35, 92, 75, 0.09);
}

.field small { color: var(--muted); line-height: 1.4; }
.checkbox-field { display: flex; flex-direction: row; align-items: center; gap: 10px; padding-top: 25px; }
.checkbox-field input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--forest); }
.checkbox-field span { font-weight: 700; line-height: 1.35; }

body[data-mode="participant"] .setup-section,
body[data-mode="participant"] .hero,
body[data-mode="participant"] .export-panel,
body[data-mode="participant"] .reset-button,
body[data-mode="participant"] #share-button { display: none !important; }
body[data-mode="participant"] .schedule-section { padding-top: 42px; }
body[data-mode="participant"] .site-header { position: sticky; top: 0; z-index: 20; }
body[data-mode="participant"] select:disabled { opacity: .72; cursor: not-allowed; }

.group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.group-panel {
  position: relative;
  overflow: hidden;
  padding: 28px;
}

.group-topline {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 5px;
}

.group-middis .group-topline { background: var(--clay); }
.group-maxis .group-topline { background: var(--forest-2); }

.group-heading {
  margin-bottom: 24px;
}

.group-badge {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 800;
}

.group-middis .group-badge { background: var(--clay); }
.group-maxis .group-badge { background: var(--forest-2); }

.group-heading .player-count {
  margin-left: auto;
}

.player-count,
.court-pill,
.status-pill,
.dirty-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.player-count {
  padding: 8px 10px;
  background: #eef1ec;
  color: var(--muted);
}

.court-pill {
  margin-top: 5px;
  padding: 5px 8px;
  background: #eef1ec;
  color: var(--forest-2);
}

.names-field textarea {
  min-height: 190px;
  padding: 14px 15px;
  resize: vertical;
  line-height: 1.65;
}

.names-field textarea::placeholder,
.field input::placeholder {
  color: #a2aca6;
}

.names-field small {
  color: var(--muted);
  font-size: 11px;
}

.field-message {
  min-height: 20px;
  margin-top: 8px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 650;
}

.field-message.is-ok {
  color: var(--success);
}

.minis-note {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 15px 18px;
  border: 1px dashed #b9c5ba;
  border-radius: 14px;
  color: var(--muted);
}

.minis-note > div {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 3px 10px;
  font-size: 13px;
}

.minis-note strong {
  color: var(--forest);
}

.minis-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  color: var(--forest);
  font-weight: 900;
}

.minis-check {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  margin-left: auto;
  place-items: center;
  border-radius: 50%;
  background: rgba(35, 92, 75, 0.1);
  color: var(--success);
  font-size: 14px;
  font-weight: 900;
}

.generate-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 30px;
}

.generate-area > span {
  max-width: 220px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.schedule-section {
  border-top: 1px solid var(--line);
  background: #ece9e0;
}

.schedule-heading {
  align-items: center;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.summary-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
}

.summary-card-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: rgba(35, 92, 75, 0.09);
  color: var(--forest-2);
}

.summary-card-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.summary-card span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.summary-card strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-groups {
  display: grid;
  gap: 24px;
}

.schedule-group {
  scroll-margin-top: 90px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.schedule-group-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 23px 26px;
  border-bottom: 1px solid var(--line);
}

.schedule-group-header h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1;
}

.schedule-group-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.schedule-group-header .group-badge {
  width: 48px;
  height: 48px;
  font-size: 22px;
}

.group-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.dirty-pill {
  padding: 7px 9px;
  background: #fff2e9;
  color: var(--clay-dark);
}

.group-match-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.schedule-content {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(330px, 0.8fr);
  gap: 26px;
  padding: 26px;
}

.subsection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.subsection-heading h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subsection-heading span {
  color: var(--muted);
  font-size: 11px;
}

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

.slot-block {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
}

.slot-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line);
  background: #f4f5f0;
}

.slot-header strong {
  font-size: 12px;
}

.slot-header span {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.slot-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--forest-2);
  font-size: 12px;
  font-weight: 850;
}

.slot-time svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.match-row {
  display: grid;
  min-height: 70px;
  align-items: center;
  grid-template-columns: 58px minmax(100px, 1fr) auto minmax(100px, 1fr) 76px;
  gap: 10px;
  padding: 10px 13px;
}

.match-row + .match-row {
  border-top: 1px solid #edf0eb;
}

.court-tag {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #eef1ec;
  color: var(--forest-2);
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.player-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-name.player-b {
  text-align: right;
}

.score-control {
  display: flex;
  align-items: center;
  gap: 5px;
}

.score-control label {
  display: block;
}

.score-control select {
  width: 44px;
  height: 42px;
  padding: 0 5px;
  border: 1px solid var(--line-dark);
  border-radius: 9px;
  background: var(--white);
  color: var(--forest);
  font-size: 15px;
  font-weight: 850;
  text-align: center;
}

.score-separator {
  color: var(--muted);
  font-weight: 800;
}

.status-pill {
  min-width: 68px;
  padding: 7px 8px;
  text-align: center;
}

.status-open {
  background: #f0f2ee;
  color: var(--muted);
}

.status-valid {
  background: #e3f3ec;
  color: var(--success);
}

.status-invalid {
  background: #fff0ec;
  color: var(--danger);
}

.standings-card {
  position: sticky;
  top: 90px;
  align-self: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
}

.standings-card .subsection-heading {
  margin: 0;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: #f4f5f0;
}

.table-wrap {
  overflow-x: auto;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.standings-table th,
.standings-table td {
  padding: 10px 7px;
  border-bottom: 1px solid #edf0eb;
  text-align: center;
  white-space: nowrap;
}

.standings-table th {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.standings-table th:nth-child(2),
.standings-table td:nth-child(2) {
  width: 100%;
  max-width: 140px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
}

.standings-table tbody tr:last-child td {
  border-bottom: 0;
}

.standings-table tbody tr:first-child {
  background: rgba(217, 237, 116, 0.18);
}

.rank-cell {
  color: var(--muted);
  font-weight: 850;
}

.standings-name {
  font-weight: 750;
}

.standings-diff.positive { color: var(--success); }
.standings-diff.negative { color: var(--danger); }

.standings-note {
  margin: 0;
  padding: 10px 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.empty-group {
  padding: 34px 26px;
  color: var(--muted);
  text-align: center;
}

.empty-group strong {
  display: block;
  margin-bottom: 5px;
  color: var(--forest);
}

.export-panel {
  position: relative;
  display: grid;
  overflow: hidden;
  align-items: center;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  margin-top: 24px;
  padding: 28px 30px;
  border-radius: var(--radius);
  background: var(--forest);
  color: var(--white);
}

.export-panel::after {
  position: absolute;
  right: -40px;
  bottom: -100px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(217, 237, 116, 0.15);
  border-radius: 50%;
  content: "";
}

.export-art {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 16px;
  background: var(--lime);
  color: var(--forest);
}

.export-art svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.export-copy {
  position: relative;
  z-index: 1;
}

.export-copy .mini-label {
  color: var(--lime);
}

.export-copy h3 {
  margin-top: 4px;
  font-size: 27px;
}

.export-copy p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
}

.export-buttons {
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.export-panel .button-outline-dark {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--white);
}

.export-panel .button-outline-dark:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.reset-button {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 24px auto 0;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.reset-button:hover {
  color: var(--danger);
}

.reset-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-footer {
  padding-block: 32px;
  background: #112e27;
  color: var(--white);
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-brand {
  margin-right: auto;
}

.footer-inner p,
.footer-inner > span {
  margin: 0;
  color: rgba(255, 255, 255, 0.54);
  font-size: 11px;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100% - 44px));
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: var(--forest);
  color: var(--white);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.share-dialog {
  width: min(520px, calc(100% - 30px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(10, 30, 24, 0.35);
}

.share-dialog::backdrop {
  background: rgba(12, 34, 28, 0.68);
  backdrop-filter: blur(3px);
}

.share-dialog form {
  position: relative;
  padding: 30px;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #eef1ec;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.dialog-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 14px;
  background: var(--lime);
  color: var(--forest);
}

.dialog-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.share-dialog h2 {
  margin: 17px 0 7px;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.share-dialog p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.share-url input {
  height: 46px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.share-dialog menu {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
}

.share-dialog .button-quiet {
  border-color: var(--line-dark);
  color: var(--muted);
}

@media (max-width: 1050px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 40px;
  }

  .event-panel {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .event-fields {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .event-fields .field:nth-child(1),
  .event-fields .field:nth-child(2) {
    grid-column: span 3;
  }

  .event-fields .field:nth-child(n+3) {
    grid-column: span 2;
  }

  .schedule-content {
    grid-template-columns: 1fr;
  }

  .standings-card {
    position: static;
  }

  .export-panel {
    grid-template-columns: auto 1fr;
  }

  .export-buttons {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 800px) {
  .shell {
    width: min(100% - 28px, var(--shell));
  }

  .save-state {
    display: none;
  }

  .hero-grid {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 38px;
    padding-block: 58px 68px;
  }

  .hero-copy {
    max-width: 640px;
  }

  .court-visual {
    display: none;
  }

  .setup-section,
  .schedule-section {
    padding-block: 62px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 14px;
  }

  .group-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-heading {
    align-items: flex-start;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .footer-brand {
    margin-bottom: 4px;
  }
}

@media (max-width: 620px) {
  .header-inner {
    min-height: 62px;
  }

  .brand {
    font-size: 18px;
  }

  .brand-mark {
    width: 31px;
    height: 31px;
  }

  .header-button {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
  }

  .header-button svg {
    width: 19px;
    height: 19px;
  }

  .header-button {
    font-size: 0;
  }

  .hero h1 {
    font-size: clamp(42px, 13vw, 58px);
  }

  .hero-copy > p {
    font-size: 16px;
  }

  .hero-facts span {
    padding: 7px 9px;
    font-size: 11px;
  }

  .event-panel,
  .group-panel {
    padding: 22px 18px;
  }

  .event-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .event-fields .field:nth-child(1),
  .event-fields .field:nth-child(2),
  .event-fields .field:nth-child(3) {
    grid-column: 1 / -1;
  }

  .event-fields .field:nth-child(n+4) {
    grid-column: span 1;
  }

  .group-heading {
    align-items: flex-start;
  }

  .group-heading .player-count {
    position: absolute;
    top: 20px;
    right: 18px;
  }

  .generate-area {
    align-items: stretch;
    flex-direction: column;
    text-align: center;
  }

  .generate-area > span {
    max-width: none;
  }

  .summary-grid {
    gap: 9px;
  }

  .summary-card {
    padding: 13px;
  }

  .summary-card-icon {
    display: none;
  }

  .summary-card strong {
    font-size: 18px;
  }

  .schedule-group-header {
    align-items: flex-start;
    padding: 19px 16px;
  }

  .group-header-meta {
    align-items: flex-end;
    flex-direction: column;
    gap: 6px;
  }

  .schedule-content {
    gap: 22px;
    padding: 16px;
  }

  .match-row {
    grid-template-columns: 45px minmax(68px, 1fr) auto minmax(68px, 1fr);
    gap: 6px;
    padding: 10px 8px;
  }

  .match-row .status-pill {
    display: none;
  }

  .court-tag {
    padding-inline: 6px;
    font-size: 9px;
  }

  .player-name {
    font-size: 11px;
  }

  .score-control {
    gap: 3px;
  }

  .score-control select {
    width: 37px;
    height: 39px;
    padding: 0 2px;
  }

  .export-panel {
    grid-template-columns: 1fr;
    padding: 24px 20px;
  }

  .export-art {
    width: 50px;
    height: 50px;
  }

  .export-buttons {
    grid-column: auto;
    align-items: stretch;
    flex-direction: column;
  }

  .export-buttons .button {
    width: 100%;
  }

  .share-dialog form {
    padding: 26px 20px 20px;
  }

  .share-dialog menu {
    align-items: stretch;
    flex-direction: column-reverse;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .hero,
  .setup-section,
  .site-footer,
  .schedule-actions,
  .summary-grid,
  .export-panel,
  .reset-button,
  .toast {
    display: none !important;
  }

  body,
  .schedule-section {
    background: white;
  }

  .schedule-section {
    padding: 0;
  }

  .schedule-group {
    break-inside: avoid;
    box-shadow: none;
  }
}
