:root {
  --theme-bg: #191C24;
  --theme-bg-soft: #20242e;
  --theme-surface: #232733;
  --theme-surface-alt: #2b3040;
  --theme-surface-muted: #1d202a;
  --theme-line: rgba(255, 255, 255, 0.14);
  --theme-line-strong: rgba(175, 23, 99, 0.58);
  --theme-border: rgba(255, 255, 255, 0.14);
  --theme-border-strong: rgba(175, 23, 99, 0.58);
  --theme-text: #F0F0F0;
  --theme-muted: rgba(240, 240, 240, 0.72);
  --theme-subtle: rgba(240, 240, 240, 0.48);
  --theme-primary: #AF1763;
  --theme-primary-soft: #0DCAF0;
  --theme-secondary: #0D6EFD;
  --theme-cta: #AF1763;
  --theme-cta-hover: #AB2E3C;
  --theme-hover: #0DCAF0;
  --theme-danger: #AB2E3C;
  --theme-success: #198754;
  --theme-warning: #FFC107;
  --theme-info: #0D6EFD;
  --theme-shadow: 0 22px 55px rgba(0, 0, 0, 0.36);
  --theme-radius: 1.1rem;
}

:root[data-theme="light"] {
  --theme-bg: #f5f7fa;
  --theme-bg-soft: #eef2f6;
  --theme-surface: #ffffff;
  --theme-surface-alt: #f8fafc;
  --theme-surface-muted: #f3f6f8;
  --theme-line: #dde5ec;
  --theme-line-strong: #c8d3dd;
  --theme-border: #dde5ec;
  --theme-border-strong: #c8d3dd;
  --theme-text: #101418;
  --theme-muted: #556271;
  --theme-subtle: #7a8794;
  --theme-cta: var(--theme-primary);
  --theme-cta-hover: var(--theme-primary-soft);
  --theme-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html { color-scheme: dark; overflow-x: hidden; }
html[data-theme="light"] { color-scheme: light; }

body.dartz-body {
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--theme-primary) 14%, transparent), transparent 28rem),
    linear-gradient(180deg, var(--theme-bg) 0%, var(--theme-bg-soft) 100%);
  color: var(--theme-text);
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.dartz-body,
.dartz-body .title,
.dartz-body .subtitle,
.dartz-body .label,
.dartz-body .navbar-item,
.dartz-body .content,
.dartz-body strong { color: var(--theme-text); }

.bebas,
.page-title,
.section-title,
.brand-wordmark,
.score-display,
.match-score-number { font-family: "Oswald", "Manrope", system-ui, sans-serif; font-weight: 600; letter-spacing: -0.015em; }
.mono { font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.text-muted-theme { color: var(--theme-muted) !important; }
.text-subtle-theme { color: var(--theme-subtle) !important; }
.text-primary-theme { color: var(--theme-primary) !important; }
.text-success { color: var(--theme-success) !important; }
.text-warning { color: var(--theme-warning) !important; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; max-width: 100vw; overflow-x: hidden; }
.app-main { flex: 1; padding-top: 1.25rem; padding-bottom: 2rem; min-width: 0; }
.dartz-body .container,
.dartz-body .columns,
.dartz-body .column,
.dartz-body .level,
.dartz-body .level-left,
.dartz-body .level-right,
.dartz-body .navbar,
.dartz-body .navbar-menu,
.dartz-body .navbar-start,
.dartz-body .navbar-end { min-width: 0; }
.dartz-body .columns { max-width: 100%; }
.dartz-body .level { gap: 1rem; flex-wrap: wrap; }
.dartz-body .level-left,
.dartz-body .level-right,
.dartz-body .buttons { flex-wrap: wrap; }
.dartz-body form { min-width: 0; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--theme-line);
  background: color-mix(in srgb, var(--theme-bg) 88%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.dartz-body .navbar { min-height: auto; background: transparent; }
.dartz-body .navbar > .container { min-height: 4.25rem; gap: 1rem; }
.app-navbar-menu { display: flex; align-items: center; flex: 1; background: transparent; box-shadow: none; }
.app-nav { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-left: 1rem; }
.app-actions { display: flex; align-items: center; margin-left: auto; gap: 0.35rem; }
.dartz-body .navbar-item { padding: 0.35rem; }

.brand-lockup { gap: 0.75rem; text-decoration: none; min-width: 0; max-width: 100%; }
.brand-mark {
  width: 2.55rem;
  height: 2.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.45rem;
  border: 1px solid var(--theme-line);
  background: var(--theme-surface);
}
.brand-wordmark { display: block; font-size: 1.18rem; line-height: 1; color: var(--theme-text); overflow: hidden; text-overflow: ellipsis; }
.brand-wordmark span { color: var(--theme-primary); }
.brand-subline { display: block; margin-top: 0.25rem; color: var(--theme-subtle); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.app-nav-link {
  border: 1px solid transparent;
  border-radius: 0.45rem;
  color: var(--theme-muted) !important;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  min-height: 2.15rem;
  text-transform: uppercase;
}
.app-nav-link:hover,
.app-nav-link.is-active {
  background: color-mix(in srgb, var(--theme-primary) 10%, var(--theme-surface));
  border-color: color-mix(in srgb, var(--theme-primary) 30%, var(--theme-line));
  color: var(--theme-text) !important;
}

.app-footer { border-top: 1px solid var(--theme-line); padding: 1.3rem 1rem; color: var(--theme-subtle); }
.footer-brand { color: var(--theme-subtle); font-family: ui-monospace, monospace; font-size: 0.8rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-links a,
.footer-link { color: var(--theme-muted); font-size: 0.85rem; text-decoration: none; }
.footer-links a:hover,
.footer-link:hover { color: var(--theme-text); }

.page-shell { width: 100%; }
.page-shell-narrow { max-width: 58rem; margin-inline: auto; }
.page-shell-compact { max-width: 72rem; margin-inline: auto; }
.stack-sm { display: grid; gap: 0.75rem; }
.stack-md { display: grid; gap: 1rem; }
.stack-lg { display: grid; gap: 1.5rem; }
.page-stack { display: grid; gap: 1rem; }
.font-semibold { font-weight: 750; }
.font-bold { font-weight: 700; }
.h-full { height: 100%; }
.break-all { word-break: break-all; }
.contents { display: contents; }

.theme-card,
.theme-hero,
.theme-panel,
.auth-card,
.theme-match-card,
.counter-list-card,
.counter-tournament-card,
.theme-score-card,
.counter-input-card,
.counter-pad-card,
.counter-summary-tile,
.game-over-stat-card,
.counter-standings-row,
.bracket-round-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--theme-text);
}

.theme-hero,
.theme-card,
.auth-card {
  border-bottom: 1px solid var(--theme-line);
}
.theme-panel,
.counter-list-card,
.counter-tournament-card,
.theme-match-card,
.counter-standings-row,
.bracket-round-card {
  border-top: 1px solid var(--theme-line);
}
.theme-card,
.theme-match-card,
.counter-list-card,
.counter-tournament-card { transition: color 0.14s ease, border-color 0.14s ease; }
a.theme-match-card,
a.counter-tournament-card { display: block; text-decoration: none; color: var(--theme-text); }
a.theme-match-card:hover,
a.counter-tournament-card:hover { border-color: var(--theme-primary); color: var(--theme-text); }

.page-header { display: grid; gap: 0.35rem; }
.theme-section-label,
.auth-label,
.eyebrow,
.score-mini-label,
.stats-block-title,
.bracket-column-title {
  color: var(--theme-subtle);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.page-title { font-size: clamp(2.1rem, 6vw, 4.5rem); line-height: 0.92; margin: 0; overflow-wrap: anywhere; }
.section-title { font-size: clamp(1.55rem, 4vw, 2.2rem); line-height: 1; margin: 0; overflow-wrap: anywhere; }
.page-copy,
.counter-section-copy,
.theme-subtitle,
.help-theme { color: var(--theme-muted); margin: 0; }
.help-theme { font-size: 0.8rem; }

.theme-chip,
.tag.theme-chip {
  align-items: center;
  border: 1px solid var(--theme-line);
  border-radius: 0.35rem;
  background: var(--theme-surface-muted);
  color: var(--theme-muted);
  display: inline-flex;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 600;
  gap: 0.35rem;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 0.45rem 0.7rem;
  text-transform: uppercase;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.theme-chip.is-live { border-color: color-mix(in srgb, var(--theme-success) 38%, var(--theme-line)); color: var(--theme-success); background: color-mix(in srgb, var(--theme-success) 10%, var(--theme-surface)); }
.theme-chip.is-finished { color: var(--theme-subtle); }

.dartz-body .button,
.dartz-body .btn {
  border-radius: 0.45rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 0.14s ease, filter 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.dartz-body .button:hover,
.dartz-body .btn:hover { transform: translateY(-1px); }
.dartz-body .rounded-pill { border-radius: 0.45rem !important; }
.theme-btn-primary { background: var(--theme-cta, var(--theme-primary)) !important; border-color: var(--theme-cta, var(--theme-primary)) !important; color: #fff !important; }
.theme-btn-primary:hover { background: var(--theme-cta-hover, var(--theme-primary-soft)) !important; border-color: var(--theme-cta-hover, var(--theme-primary-soft)) !important; }
.theme-btn-outline,
.btn-undo,
.mobile-view-switch .btn { background: var(--theme-surface) !important; border-color: var(--theme-line) !important; color: var(--theme-muted) !important; }
.theme-btn-outline:hover,
.btn-undo:hover,
.mobile-view-switch .btn:hover { background: var(--theme-surface-alt) !important; border-color: var(--theme-line-strong) !important; color: var(--theme-text) !important; }
.theme-btn-outline.is-selected,
.bot-choice-radio.is-selected,
.bot-choice-radio:has(input:checked),
.bot-level-btn.is-selected,
.bot-score-btn.is-selected,
.bot-legs-btn.is-selected,
.bot-sets-btn.is-selected,
.score-preset.is-selected,
.legs-preset.is-selected,
.sets-preset.is-selected { background: color-mix(in srgb, var(--theme-primary) 13%, var(--theme-surface-alt)) !important; border-color: color-mix(in srgb, var(--theme-primary) 45%, var(--theme-line)) !important; color: var(--theme-text) !important; }

.dartz-body .input,
.dartz-body .textarea,
.dartz-body .select select,
.theme-form-input,
.theme-form-input.form-control,
.theme-form-input.form-select,
.auth-input,
.throw-input,
.dartz-body .form-control,
.dartz-body .form-select {
  min-height: 3rem;
  border: 1px solid var(--theme-line);
  border-radius: 0.45rem;
  background: var(--theme-bg-soft);
  color: var(--theme-text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}
.dartz-body .input::placeholder,
.dartz-body .textarea::placeholder,
.theme-form-input::placeholder,
.auth-input::placeholder,
.throw-input::placeholder { color: var(--theme-subtle); }
.dartz-body .input:focus,
.dartz-body .textarea:focus,
.dartz-body .select select:focus,
.theme-form-input:focus,
.auth-input:focus,
.throw-input:focus {
  background: var(--theme-bg-soft);
  border-color: var(--theme-primary);
  color: var(--theme-text);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-primary) 14%, transparent);
  outline: none;
}
.auth-input { width: 100%; padding: 0.9rem 1rem; }
.panel-choice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--theme-line);
  border-radius: 0.45rem;
  background: var(--theme-surface-muted);
  color: var(--theme-muted);
  padding: 0.85rem 1rem;
  cursor: pointer;
}
.panel-choice input { accent-color: var(--theme-primary); }

.theme-notification,
.flash-theme { border: 1px solid var(--theme-line); border-radius: 0.45rem; background: var(--theme-surface); color: var(--theme-text); padding: 0.85rem 1rem; }
.theme-notification.is-success-light,
.flash-theme.notice { border-color: color-mix(in srgb, var(--theme-success) 38%, var(--theme-line)); color: var(--theme-success); }
.theme-notification.is-danger-light,
.flash-theme.alert { border-color: color-mix(in srgb, var(--theme-primary) 42%, var(--theme-line)); color: var(--theme-primary-soft); }

.profile-menu { position: relative; }
.profile-menu-summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--theme-line);
  border-radius: 0.45rem;
  background: var(--theme-surface);
  color: var(--theme-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 0.55rem 0.8rem;
  text-transform: uppercase;
}
.profile-menu-summary::-webkit-details-marker { display: none; }
.profile-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.65rem);
  z-index: 50;
  width: min(22rem, calc(100vw - 1rem));
  display: grid;
  gap: 0.9rem;
  border: 1px solid var(--theme-line);
  border-radius: 1rem;
  background: var(--theme-surface);
  box-shadow: var(--theme-shadow);
  padding: 1rem;
}
.profile-menu-panel hr { border: 0; border-top: 1px solid var(--theme-line); margin: 0; }
.profile-name { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.profile-email { margin: 0.35rem 0 0.7rem; color: var(--theme-subtle); font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.78rem; }
.profile-menu-divider { border-top: 1px solid var(--theme-line); }

.counter-list-grid { display: grid; gap: 0.85rem; }
.counter-summary-grid { display: grid; gap: 0.75rem; }
.counter-summary-tile { padding: 0.75rem 0; border-top: 1px solid var(--theme-line); }
.player-card-shell { border-top: 1px solid var(--theme-line); padding: 1rem 0 0; position: relative; }
.saved-btn { border: 0; border-radius: 999px; background: transparent; color: var(--theme-subtle); cursor: pointer; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; padding: .25rem .45rem; text-transform: uppercase; }
.saved-btn:hover { color: var(--theme-text); }
.saved-btn.has-saved-names { background: color-mix(in srgb, var(--theme-primary) 14%, transparent) !important; color: var(--theme-primary-soft) !important; }
.saved-btn.has-saved-names:hover { background: color-mix(in srgb, var(--theme-primary) 22%, transparent) !important; color: #fff !important; }
.saved-dropdown {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.45rem);
  left: 0;
  right: 0;
  max-height: 14rem;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--theme-line);
  background: var(--theme-bg-soft);
  box-shadow: var(--theme-shadow);
}
.saved-player-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--theme-line);
  cursor: pointer;
}
.saved-player-row:last-child { border-bottom: 0; }
.saved-player-row:hover { background: var(--theme-surface-alt); }
.saved-player-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--theme-text);
  font-size: 0.78rem;
}
.saved-player-remove {
  border: 0;
  background: transparent;
  color: var(--theme-subtle);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.2rem 0.35rem;
}
.saved-player-remove:hover { color: var(--theme-primary-soft); }
.saved-empty { padding: 0.75rem; color: var(--theme-subtle); font-size: 0.72rem; letter-spacing: 0.1em; text-align: center; text-transform: uppercase; }
.swap-badge { width: 2.7rem; height: 2.7rem; padding: 0 !important; }
.invite-starter-panel {
  padding: clamp(1rem, 3.5vw, 2rem) !important;
}
.invite-starter-panel .columns {
  align-items: stretch !important;
  gap: clamp(.75rem, 2vw, 1rem) !important;
  margin: .75rem 0 0 !important;
}
.invite-starter-panel .column {
  display: flex;
  align-items: stretch;
}
.invite-starter-panel .column.is-narrow {
  align-items: center;
  justify-content: center;
}
.invite-starter-panel .player-card-shell {
  width: 100%;
  border: 0 !important;
  border-radius: 1rem;
  padding: .85rem !important;
  background: color-mix(in srgb, var(--theme-text) 3%, transparent);
}
.invite-starter-panel .theme-form-input[aria-readonly="true"] {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.65rem;
  padding: .85rem 1rem !important;
  background: color-mix(in srgb, var(--theme-text) 4%, transparent) !important;
}
.invite-starter-panel .player-card-shell.is-selected {
  background: color-mix(in srgb, var(--theme-primary) 9%, transparent);
}
.invite-starter-panel .player-card-shell.is-selected .theme-form-input {
  outline: 2px solid color-mix(in srgb, var(--theme-primary) 46%, transparent);
  background: color-mix(in srgb, var(--theme-primary) 14%, transparent) !important;
}
.invite-starter-panel .button_to,
.invite-starter-swap-form {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}
.invite-starter-panel .swap-badge {
  flex: 0 0 auto;
}
.match-identifier { font-size: 1.55rem; line-height: 1; }
.player-line { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 0.65rem; align-items: baseline; }
.player-line .name { color: var(--theme-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-line .value { font-size: 1.35rem; }
.player-line .is-winner { color: var(--theme-success); }
.player-line .avg { color: var(--theme-subtle); font-size: 0.72rem; }
.progress-thin { height: 0.35rem; overflow: hidden; border-radius: 999px; background: var(--theme-surface-muted); }
.progress-thin span { display: block; height: 100%; border-radius: inherit; }

.theme-score-card { padding: 1rem 0; height: 100%; position: relative; overflow: hidden; border-top: 1px solid var(--theme-line); }
.theme-score-card.is-active { border-color: var(--theme-primary); }
.theme-score-card.is-active::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: var(--theme-primary); }
.score-display { font-size: clamp(4.8rem, 15vw, 9rem); line-height: 0.82; color: var(--theme-text); }
.score-display.is-active { color: var(--theme-primary-soft); }
.score-mini-value { font-size: 1.35rem; line-height: 1; }
.counter-score-grid { display: grid; gap: 0.7rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.counter-score-metric { border-top: 1px solid var(--theme-line); padding: 0.8rem 0 0; }
.throwing-indicator { display: inline-flex; flex-shrink: 0; border-radius: 0.35rem; background: var(--theme-primary); color: #fff; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em; line-height: 1; padding: 0.35rem 0.6rem; text-transform: uppercase; white-space: nowrap; }
.checkout-pill,
.throw-pill { border-radius: 0.35rem; border: 1px solid var(--theme-line); padding: 0.35rem 0.55rem; font-size: 0.72rem; color: var(--theme-muted); }
.checkout-pill.double,
.throw-pill.double { border-color: color-mix(in srgb, var(--theme-primary) 45%, var(--theme-line)); color: var(--theme-primary-soft); }
.checkout-pill.triple,
.throw-pill.triple { border-color: color-mix(in srgb, var(--theme-info) 45%, var(--theme-line)); color: var(--theme-info); }
.throw-pill.miss { color: var(--theme-subtle); }
.pip-track { display: flex; gap: 0.35rem; }
.pip-track span { width: 0.55rem; height: 0.55rem; border-radius: 999px; background: var(--theme-line); }
.pip-track span.is-on { background: var(--theme-primary); }

.counter-turn-panel { border-top: 1px solid var(--theme-line); padding-top: 1rem; }
.counter-input-field { min-height: 4.4rem; font-size: 1.8rem !important; font-weight: 700; }
.dart-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 0.32rem; min-width: 0; }
.dart-column { display: grid; gap: 0.32rem; min-width: 0; }
.dart-grid form,
.dart-footer-actions form { min-width: 0; }
.dart-footer-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.dart-btn { width: 100%; min-width: 0; border: 1px solid var(--theme-line); border-radius: 0.35rem; background: var(--theme-surface-muted); color: var(--theme-text); font-size: clamp(0.68rem, 2.4vw, 0.86rem); font-weight: 700; min-height: 2.45rem; padding-inline: 0.2rem; transition: all 0.12s ease; }
.dart-btn:hover { transform: translateY(-1px); border-color: var(--theme-line-strong); background: var(--theme-surface-alt); }
.dart-btn.double { color: var(--theme-secondary); }
.dart-btn.triple { color: var(--theme-info); }
.dart-btn.miss { color: var(--theme-subtle); }

.match-focus { display: grid; gap: 0.8rem; }
.match-focus-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; border-bottom: 1px solid var(--theme-line); padding-bottom: 0.65rem; }
.match-focus-title { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 0.65rem; color: var(--theme-muted); }
.match-focus-title strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-focus-bar-mobile { display: none; }
.match-score-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; row-gap: 0.8rem; }
.match-score-header { grid-column: 1 / -1; }
.match-score-card { min-width: 0; border-top: 1px solid var(--theme-line); padding-top: 0.75rem; padding-inline: 0.25rem; }
.match-score-card.is-active { border-color: var(--theme-primary); }
.match-score-name-row { display: flex; align-items: center; gap: 0.5rem; min-height: 1.35rem; min-width: 0; }
.match-score-name { color: var(--theme-muted); font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.12em; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.match-score-main-row { align-items: center; display: flex; gap: 0.75rem; justify-content: space-between; min-width: 0; }
.match-score-number { font-size: clamp(4.2rem, 14.5vw, 8rem); font-weight: 600; letter-spacing: -0.03em; line-height: 0.9; margin-top: 0.25rem; }
.match-score-number.is-active { color: var(--theme-primary-soft); }
.match-score-quick-stats { display: grid; gap: 0.2rem; margin: 0.65rem 0 0.45rem; max-width: 18rem; }
.match-score-stat { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 0.5rem; }
.match-score-stat dt { color: var(--theme-muted); font-size: 0.75rem; line-height: 1.35; overflow-wrap: anywhere; }
.match-score-stat dd { margin: 0; color: var(--theme-text); font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.9rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.35; }
.match-score-average dd { color: var(--theme-primary-soft); }
.match-checkout-line.is-empty { display: none; }
.match-score-meta { display: flex; flex-wrap: wrap; gap: 0.7rem; color: var(--theme-subtle); font-size: 0.8rem; margin-top: 0.25rem; }
.match-checkout-line { color: var(--theme-success); }
.match-play-area { display: grid; grid-template-columns: minmax(16rem, 0.62fr) minmax(0, 1.38fr); gap: 1rem; align-items: start; }
.match-input-panel,
.match-dart-pad { border-top: 1px solid var(--theme-line); padding-top: 0.8rem; }
.match-dart-pad-summary { display: none; }
.match-input-head,
.match-pad-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.8rem; margin-bottom: 0.75rem; }
.match-input-head h2 { font-size: clamp(1.35rem, 3.3vw, 2rem); font-weight: 600; line-height: 1; margin: 0.15rem 0 0; }
.match-score-entry-row { display: flex; gap: 0.6rem; align-items: stretch; }
.match-score-entry-row .match-score-input { flex: 1 1 auto; min-width: 0; }
.match-score-input { min-height: 2.45rem; font-size: clamp(1rem, 3vw, 1.3rem) !important; font-weight: 600; }
.match-score-submit { flex: 0 0 auto; min-height: 2.45rem; padding-left: 1rem; padding-right: 1rem; }
.match-stats-toggle { margin-top: 1rem; border-top: 1px solid var(--theme-line); padding-top: 0.8rem; }
.match-stats-toggle summary { color: var(--theme-subtle); cursor: pointer; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.match-stats-toggle[open] > summary { border-bottom: 1px solid var(--theme-line); margin-bottom: .8rem; padding-bottom: .8rem; }
.match-stats-panel { margin-top: 0; padding-top: 0; }

.stats-details { border-top: 1px solid var(--theme-line); overflow: hidden; }
.stats-summary { cursor: pointer; list-style: none; padding: 1rem 0; }
.stats-summary::-webkit-details-marker { display: none; }
.stats-details-body { border-top: 1px solid var(--theme-line); padding: 1rem; }
.compact-stats-list { display: grid; gap: 0.5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compact-stat { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--theme-line); padding: 0.65rem 0; color: var(--theme-muted); }
.compact-stat strong { color: var(--theme-text); }

.finish-popup-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; background: rgba(0,0,0,0.62); backdrop-filter: blur(8px); }
.finish-popup-card { width: min(28rem, 100%); border: 1px solid var(--theme-line); border-radius: 1.25rem; background: var(--theme-surface); box-shadow: var(--theme-shadow); padding: 1.35rem; }
.checkout-choice { display: grid; place-items: center; min-height: 4rem; border: 1px solid var(--theme-line); border-radius: 1rem; background: var(--theme-surface-muted); color: var(--theme-text); cursor: pointer; font-size: 1.6rem; font-weight: 700; }
.checkout-choice.active { border-color: var(--theme-primary); background: color-mix(in srgb, var(--theme-primary) 12%, var(--theme-surface)); }
.checkout-choice.is-disabled { background: color-mix(in srgb, var(--theme-surface-muted) 45%, #000); border-color: color-mix(in srgb, var(--theme-line) 55%, transparent); color: var(--theme-subtle); cursor: not-allowed; opacity: 0.42; text-decoration: line-through; }
.checkout-choice.is-disabled input { cursor: not-allowed; }
.absolute { position: absolute !important; }
.opacity-0 { opacity: 0 !important; }

.counter-standings-row { padding: 1rem 0; }
.bracket-scroll { overflow-x: auto; padding-bottom: 0.5rem; }
.bracket-board { display: flex; gap: 1rem; min-width: max-content; }
.bracket-column { width: min(22rem, 80vw); }
.bracket-column-title { margin-bottom: 0.75rem; }
.bracket-round-card { padding: 0.75rem 0; }
.bracket-match-card { background: transparent; }
.theme-blank-slate,
.counter-empty-card { border-top: 1px dashed var(--theme-line-strong); color: var(--theme-muted); padding: 1rem 0; }

.theme-legal-grid { display: grid; gap: 1rem; }
.theme-legal-card { border-top: 1px solid var(--theme-line); padding: 1rem 0; }
.theme-copy { color: var(--theme-muted); }
.theme-copy h2,
.theme-copy h3,
.theme-copy strong { color: var(--theme-text); }

@keyframes score-pulse { 0% { transform: scale(1); } 50% { transform: scale(1.06); } 100% { transform: scale(1); } }
.score-pulse { animation: score-pulse 300ms ease-out; }

@media (min-width: 769px) {
  .counter-list-grid.md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .counter-list-grid.xl\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .counter-summary-grid.sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .dartz-body .navbar > .container { display: block; padding: 0.65rem 1rem; }
  .app-navbar-menu { display: grid; gap: 0.65rem; }
  .app-nav { margin-left: 0; overflow-x: auto; padding-bottom: 0.15rem; }
  .app-actions { justify-content: space-between; margin-left: 0; }
}

@media (max-width: 760px) {
  .app-main { padding: 0.85rem 0.75rem 1.5rem; }
  .page-title { font-size: clamp(2.15rem, 13vw, 2.6rem); }
  .dart-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.35rem; }
  .dart-footer-actions { gap: 0.35rem; }
  .counter-score-grid,
  .compact-stats-list { grid-template-columns: 1fr; }
  .score-display { font-size: clamp(4.2rem, 25vw, 5.7rem); }
  .theme-chip { white-space: normal; }
  .profile-menu-panel { right: -0.25rem; }
  .match-nav-back { display: none; }
  .match-focus-bar-mobile { display: flex; }
  .match-focus-bar-desktop { display: none; }
  .match-focus-bar { align-items: flex-start; }
  .match-focus-title { justify-content: flex-start; flex-wrap: wrap; }
  .match-score-strip,
  .match-play-area { grid-template-columns: 1fr; }
  .match-score-strip { row-gap: 1rem; }
  .match-score-card { padding-inline: 0; }
  .match-score-number { font-size: clamp(3.7rem, 24vw, 5.3rem); }
  .match-pad-head { display: grid; }
  .match-input-head {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
  }

  .match-input-head > div {
    min-width: 0;
  }

  .match-input-head .btn-undo {
    flex: 0 0 auto;
  }

  .match-dart-pad-summary {
    color: var(--theme-subtle);
    cursor: pointer;
    display: list-item;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    padding-bottom: 0.8rem;
    text-transform: uppercase;
    user-select: none;
  }
}

/* Flowbite rebuild layer: replaces the flat Bulma-era chrome with a glassy, card-based console. */
:root {
  --theme-bg: #191C24;
  --theme-bg-soft: #20242e;
  --theme-surface: rgba(35, 39, 51, 0.88);
  --theme-surface-alt: rgba(43, 48, 64, 0.9);
  --theme-surface-muted: rgba(29, 32, 42, 0.76);
  --theme-line: rgba(255, 255, 255, 0.14);
  --theme-line-strong: rgba(175, 23, 99, 0.58);
  --theme-border: rgba(255, 255, 255, 0.14);
  --theme-border-strong: rgba(175, 23, 99, 0.58);
  --theme-text: #F0F0F0;
  --theme-muted: rgba(240, 240, 240, 0.72);
  --theme-subtle: rgba(240, 240, 240, 0.48);
  --theme-primary: #AF1763;
  --theme-primary-soft: #0DCAF0;
  --theme-secondary: #0D6EFD;
  --theme-cta: #AF1763;
  --theme-cta-hover: #AB2E3C;
  --theme-hover: #0DCAF0;
  --theme-danger: #AB2E3C;
  --theme-success: #198754;
  --theme-warning: #FFC107;
  --theme-info: #0D6EFD;
  --theme-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
  --theme-radius: 1.5rem;
}

:root[data-theme="light"] {
  --theme-bg: #f8fafc;
  --theme-bg-soft: #eef2ff;
  --theme-surface: rgba(255, 255, 255, 0.86);
  --theme-surface-alt: rgba(248, 250, 252, 0.94);
  --theme-surface-muted: rgba(241, 245, 249, 0.86);
  --theme-line: rgba(15, 23, 42, 0.12);
  --theme-line-strong: rgba(239, 68, 68, 0.34);
  --theme-text: #0f172a;
  --theme-muted: #475569;
  --theme-subtle: #64748b;
  --theme-primary: #ef4444;
  --theme-primary-soft: #fb7185;
  --theme-secondary: #f59e0b;
  --theme-cta: #ef4444;
  --theme-cta-hover: #f97316;
  --theme-hover: #f97316;
  --theme-danger: #ef4444;
}

body.dartz-body {
  background:
    radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--theme-primary) 30%, transparent), transparent 23rem),
    radial-gradient(circle at 88% 0%, color-mix(in srgb, var(--theme-secondary) 22%, transparent), transparent 27rem),
    linear-gradient(135deg, var(--theme-bg), var(--theme-bg-soft) 55%, var(--theme-bg));
}

body.dartz-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(148,163,184,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.app-header {
  background: color-mix(in srgb, var(--theme-bg) 72%, transparent);
  border-bottom: 1px solid var(--theme-line);
  backdrop-filter: blur(22px);
}

.app-nav-link {
  display: inline-flex;
  align-items: center;
  border-radius: 0.95rem;
  color: var(--theme-muted) !important;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.72rem 0.9rem;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}
.app-nav-link:hover,
.app-nav-link.is-active {
  background: var(--theme-primary);
  border-color: transparent;
  color: #fff !important;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--theme-primary) 28%, transparent);
}
.app-nav-link:hover {
  background: var(--theme-hover);
}

.theme-hero,
.theme-card,
.auth-card,
.theme-panel,
.theme-match-card,
.counter-list-card,
.counter-tournament-card,
.theme-score-card,
.counter-input-card,
.counter-pad-card,
.counter-summary-tile,
.game-over-stat-card,
.counter-standings-row,
.bracket-round-card,
.theme-legal-card,
.finish-popup-card {
  background: var(--theme-surface);
  border: 1px solid var(--theme-line);
  border-radius: var(--theme-radius);
  box-shadow: var(--theme-shadow);
  backdrop-filter: blur(18px);
}

.theme-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--theme-primary) 18%, transparent), transparent 42%),
    var(--theme-surface);
}
.theme-hero::after {
  content: "";
  position: absolute;
  right: -5rem;
  top: -5rem;
  width: 16rem;
  height: 16rem;
  border-radius: 999px;
  background: radial-gradient(circle, color-mix(in srgb, var(--theme-secondary) 32%, transparent), transparent 65%);
}

.theme-panel,
.theme-match-card,
.counter-tournament-card,
.counter-list-card,
.counter-standings-row,
.bracket-round-card,
.theme-score-card,
.theme-legal-card { padding: 1.15rem; }

a.theme-match-card:hover,
a.counter-tournament-card:hover {
  transform: translateY(-3px);
  border-color: var(--theme-line-strong);
  box-shadow: 0 28px 80px color-mix(in srgb, var(--theme-hover) 18%, transparent);
}

.page-title { font-size: clamp(2.6rem, 8vw, 6rem); line-height: .86; }
.section-title { font-size: clamp(1.75rem, 4vw, 2.75rem); }
.theme-section-label, .auth-label, .eyebrow, .score-mini-label, .stats-block-title, .bracket-column-title { color: var(--theme-primary-soft); }

.theme-chip,
.tag.theme-chip {
  border-color: var(--theme-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--theme-surface-alt) 82%, transparent);
  color: var(--theme-muted);
}
.theme-chip.is-live { background: rgba(34,197,94,.12); }

.theme-btn-primary,
.dartz-body .button.theme-btn-primary,
.dartz-body .btn.theme-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--theme-cta, var(--theme-primary)) !important;
  border: 0 !important;
  border-radius: .95rem !important;
  color: #fff !important;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--theme-cta, var(--theme-primary)) 30%, transparent);
  text-decoration: none;
}
.theme-btn-outline,
.dartz-body .button.theme-btn-outline,
.dartz-body .btn.theme-btn-outline,
.btn-undo,
.mobile-view-switch .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--theme-surface-alt) 72%, transparent) !important;
  border: 1px solid var(--theme-line) !important;
  border-radius: .95rem !important;
  color: var(--theme-muted) !important;
  text-decoration: none;
}
.theme-btn-primary:hover,
.dartz-body .button.theme-btn-primary:hover,
.dartz-body .btn.theme-btn-primary:hover { background: var(--theme-cta-hover, var(--theme-hover)) !important; }
.theme-btn-outline:hover,
.btn-undo:hover,
.mobile-view-switch .btn:hover { border-color: var(--theme-hover) !important; color: var(--theme-hover) !important; }

.theme-form-input,
.dartz-body .input,
.dartz-body .textarea,
.dartz-body .select select,
.dartz-body .form-control,
.dartz-body .form-select,
.auth-input,
.throw-input {
  border-radius: 1rem;
  background: color-mix(in srgb, var(--theme-bg-soft) 82%, transparent);
  border-color: var(--theme-line);
}

.panel-choice {
  border-radius: 1rem;
  background: var(--theme-surface);
  border-color: var(--theme-line);
}

/* Minimal Bulma layout compatibility now that Bulma CDN is gone. */
.columns { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0; }
.column { flex: 1 1 0; min-width: 0; }
.column.is-narrow { flex: 0 0 auto; }
.column.is-12-tablet { flex-basis: 100%; }
.level { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.level-left, .level-right, .buttons { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.buttons.are-small .button, .button.is-small { min-height: 2rem; padding: .45rem .75rem; font-size: .75rem; }
.button.is-medium { min-height: 3rem; padding: .75rem 1.1rem; }
.is-flex { display: flex !important; }
.is-flex-wrap-wrap { flex-wrap: wrap !important; }
.is-align-items-center { align-items: center !important; }
.is-align-items-flex-start { align-items: flex-start !important; }
.is-align-items-flex-end { align-items: flex-end !important; }
.is-justify-content-space-between { justify-content: space-between !important; }
.is-justify-content-flex-end { justify-content: flex-end !important; }
.has-text-centered { text-align: center !important; }
.is-hidden { display: none !important; }
.field { display: grid; gap: .45rem; }
.label { display: block; }
.notification { margin-bottom: 1rem; }

@media (min-width: 768px) {
  .column.is-6-tablet { flex: 0 0 calc(50% - .5rem); }
}
@media (min-width: 1024px) {
  .column.is-4-desktop { flex: 0 0 calc(33.333% - .67rem); }
  .column.is-6-desktop { flex: 0 0 calc(50% - .5rem); }
}
@media (max-width: 760px) {
  .columns { display: grid; }
  .column { width: 100%; }
  .app-nav-link { padding: .62rem .72rem; }
}

/* Sharp UI pass: remove card language and rounded shapes. */
.dartz-body *,
.dartz-body *::before,
.dartz-body *::after {
  border-radius: 0 !important;
}

:root {
  --theme-radius: 0;
  --theme-shadow: none;
}

.app-header {
  background: color-mix(in srgb, var(--theme-bg) 90%, transparent);
}

.theme-hero,
.theme-card,
.auth-card,
.theme-panel,
.theme-match-card,
.counter-list-card,
.counter-tournament-card,
.theme-score-card,
.counter-input-card,
.counter-pad-card,
.counter-summary-tile,
.game-over-stat-card,
.counter-standings-row,
.bracket-round-card,
.theme-legal-card,
.finish-popup-card,
.profile-menu-panel,
#profileMenu {
  background: transparent !important;
  border: 0 !important;
  border-top: 1px solid var(--theme-line) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.theme-hero,
.theme-card,
.auth-card {
  border-top: 0 !important;
  border-bottom: 1px solid var(--theme-line) !important;
}

.theme-hero::after,
body.dartz-body::before {
  display: none !important;
}

.theme-panel,
.theme-match-card,
.counter-tournament-card,
.counter-list-card,
.counter-standings-row,
.bracket-round-card,
.theme-score-card,
.theme-legal-card {
  padding-inline: 0 !important;
}

a.theme-match-card:hover,
a.counter-tournament-card:hover {
  transform: none !important;
  border-color: var(--theme-primary) !important;
  box-shadow: none !important;
}

.app-nav-link,
.theme-chip,
.tag.theme-chip,
.theme-btn-primary,
.dartz-body .button.theme-btn-primary,
.dartz-body .btn.theme-btn-primary,
.theme-btn-outline,
.dartz-body .button.theme-btn-outline,
.dartz-body .btn.theme-btn-outline,
.btn-undo,
.mobile-view-switch .btn,
.theme-form-input,
.dartz-body .input,
.dartz-body .textarea,
.dartz-body .select select,
.dartz-body .form-control,
.dartz-body .form-select,
.auth-input,
.throw-input,
.panel-choice,
.profile-menu-summary,
.saved-dropdown,
.saved-player-row,
.dart-btn,
.checkout-pill,
.throw-pill,
.throwing-indicator,
.finish-popup-overlay,
.checkout-choice {
  border-radius: 0 !important;
  box-shadow: none !important;
}

.theme-btn-primary,
.dartz-body .button.theme-btn-primary,
.dartz-body .btn.theme-btn-primary {
  background: var(--theme-cta, var(--theme-primary)) !important;
  box-shadow: none !important;
}

.app-nav-link.is-active,
.app-nav-link:hover {
  background: var(--theme-primary) !important;
  box-shadow: none !important;
}

.theme-chip,
.tag.theme-chip,
.theme-btn-outline,
.dartz-body .button.theme-btn-outline,
.dartz-body .btn.theme-btn-outline,
.panel-choice,
.theme-form-input,
.dartz-body .input,
.dartz-body .textarea,
.dartz-body .select select,
.dartz-body .form-control,
.dartz-body .form-select,
.auth-input,
.throw-input {
  background: transparent !important;
}

.dartz-body .button:hover,
.dartz-body .btn:hover,
.dart-btn:hover {
  transform: none !important;
}

.brand-mark,
.pip-track span,
.progress-thin,
.progress-thin span {
  border-radius: 0 !important;
}

body.dartz-body {
  background: linear-gradient(180deg, var(--theme-bg), var(--theme-bg-soft)) !important;
}

/* Account dropdown should be solid/readable, not translucent. */
#profileMenu,
.profile-menu-panel {
  background: var(--theme-bg-soft) !important;
  border: 1px solid var(--theme-line) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

:root[data-theme="light"] #profileMenu,
:root[data-theme="light"] .profile-menu-panel {
  background: #ffffff !important;
}

button.app-nav-link {
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

/* Make owned tournaments read as the primary list without returning to rounded cards. */
.tournament-owned-section {
  border-left: 3px solid var(--theme-primary);
  padding-left: 1rem;
}

.tournament-owned-card {
  background: color-mix(in srgb, var(--theme-primary) 8%, transparent) !important;
  border-top: 2px solid var(--theme-primary) !important;
  border-bottom: 1px solid var(--theme-line) !important;
  padding: 1.25rem 0 1.25rem 1rem !important;
}

.tournament-owned-card .section-title {
  color: var(--theme-text);
}

.tournament-owned-card .auth-label {
  color: var(--theme-primary-soft);
}

.tournament-owned-card:hover {
  background: color-mix(in srgb, var(--theme-primary) 14%, transparent) !important;
}

.tournament-guest-section {
  border-left: 3px solid var(--theme-line-strong);
  padding-left: 1rem;
}

.tournament-guest-card {
  background: color-mix(in srgb, var(--theme-line-strong) 10%, transparent) !important;
  border-top: 2px solid var(--theme-line-strong) !important;
  border-bottom: 1px solid var(--theme-line) !important;
  padding: 1.25rem 0 1.25rem 1rem !important;
}

.tournament-guest-card:hover {
  background: color-mix(in srgb, var(--theme-line-strong) 16%, transparent) !important;
}

.tournament-owned-card .section-title,
.tournament-guest-card .section-title {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.tournament-owned-card .auth-label,
.tournament-guest-card .auth-label,
.tournament-owned-card .theme-chip,
.tournament-guest-card .theme-chip {
  font-weight: 500;
}

/* Tournament detail readability pass. */
.tournament-link-panel {
  border-left: 2px solid var(--theme-line-strong);
  padding-left: 1rem;
}

.tournament-summary-toggle {
  cursor: pointer;
  list-style: none;
  border-bottom: 1px solid var(--theme-line);
  padding-bottom: .7rem;
}
.tournament-summary-toggle::-webkit-details-marker { display: none; }

.tournament-board {
  align-items: start;
}

.tournament-column > .theme-card,
.tournament-column .counter-list-card {
  border-top: 3px solid var(--theme-primary) !important;
}

.tournament-matches-column > .theme-card,
.tournament-matches-column .counter-list-card {
  border-top-color: var(--theme-line-strong) !important;
}

.tournament-section-head {
  border-bottom: 1px solid var(--theme-line);
  padding-bottom: .9rem;
}

.tournament-player-row,
.tournament-match-row {
  border-top: 0 !important;
  border-bottom: 1px solid var(--theme-line) !important;
  padding: 1rem 0 !important;
}

.tournament-player-row:first-child,
.tournament-match-row:first-child {
  padding-top: .35rem !important;
}

.tournament-rank {
  min-width: 3.2rem;
  color: var(--theme-primary-soft);
  font-size: .82rem;
  font-weight: 500;
}

.tournament-player-name,
.tournament-match-label {
  color: var(--theme-text);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.25;
}

.tournament-player-stats strong {
  font-weight: 600;
  color: var(--theme-text);
}

.tournament-status {
  border-left: 3px solid var(--theme-line-strong);
  color: var(--theme-muted);
  display: inline-flex;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .14em;
  line-height: 1;
  padding: .35rem 0 .35rem .55rem;
  text-transform: uppercase;
}

.tournament-status-complete {
  border-left-color: var(--theme-success);
  color: var(--theme-success);
}

.tournament-result-line {
  color: var(--theme-muted);
  font-size: .9rem;
}

.tournament-match-actions .btn,
.tournament-match-actions .button {
  min-width: 8rem;
}

.counter-admin-card {
  border-left: 3px solid var(--theme-primary) !important;
  padding-left: 1.25rem !important;
}

@media (max-width: 760px) {
  .tournament-link-panel,
  .counter-admin-card,
  .tournament-owned-section,
  .tournament-guest-section {
    padding-left: .75rem;
  }
  .tournament-player-stats {
    font-size: .78rem;
  }
}

/* Match stats readability pass. */
.stats-panel-head {
  border-bottom: 1px solid var(--theme-line);
  padding-bottom: .75rem;
}

.match-stats-player {
  border-top: 0 !important;
  border-bottom: 1px solid var(--theme-line) !important;
}

.match-stats-player .stats-summary {
  padding: 1rem 0 !important;
}

.stats-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, minmax(4.25rem, auto)) auto;
  gap: 1rem;
  align-items: center;
}

.stats-summary-number {
  border-left: 1px solid var(--theme-line);
  padding-left: .85rem;
}

.stats-summary-number span {
  display: block;
  color: var(--theme-subtle);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .65rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.stats-summary-number strong {
  color: var(--theme-text);
  font-size: 1.1rem;
  font-weight: 500;
}

.stats-expand-indicator {
  color: var(--theme-primary-soft);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.match-stats-player[open] .stats-expand-indicator {
  color: var(--theme-muted);
}
.match-stats-player[open] .stats-expand-indicator::before {
  content: "Close";
}
.match-stats-player[open] .stats-expand-indicator {
  font-size: 0;
}
.match-stats-player[open] .stats-expand-indicator::before {
  font-size: .7rem;
}

.match-stats-body {
  border-top: 1px solid var(--theme-line) !important;
  padding: 0 !important;
}

.match-stats-section {
  border-bottom: 1px solid var(--theme-line);
  padding: 1rem 0;
}
.match-stats-section:last-child { border-bottom: 0; }

.match-stats-section .stats-block-title {
  margin-bottom: .75rem;
}

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

.match-stats-grid .compact-stat {
  border-top: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--theme-line) 65%, transparent);
  padding: .7rem 0;
}

.match-stats-grid .compact-stat span {
  color: var(--theme-muted);
}

.match-stats-grid .compact-stat strong {
  color: var(--theme-text);
  font-weight: 500;
}

@media (max-width: 760px) {
  .stats-summary-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: .75rem;
  }
  .stats-summary-grid > :first-child,
  .stats-expand-indicator {
    grid-column: 1 / -1;
  }
  .stats-summary-number {
    border-left: 0;
    border-top: 1px solid var(--theme-line);
    padding: .65rem 0 0;
  }
  .match-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Give expanded match stats enough breathing room between columns. */
.match-stats-grid {
  column-gap: 2rem;
  row-gap: 0;
}

.match-stats-grid .compact-stat {
  gap: 1rem;
  padding-right: .75rem;
}

.match-stats-grid .compact-stat strong {
  flex-shrink: 0;
  margin-left: 1rem;
  min-width: 3.25rem;
  text-align: right;
}

@media (max-width: 760px) {
  .match-stats-grid {
    column-gap: 0;
  }
  .match-stats-grid .compact-stat {
    padding-right: 0;
  }
}

/* Header action buttons should be visually identical to header nav links. */
button.app-nav-link {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  min-height: auto;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 0.72rem 0.9rem;
  text-transform: uppercase;
}

button.app-nav-link span {
  line-height: 1;
}

button.app-nav-link [data-theme-mode-target="icon"] {
  display: inline-flex;
}

.current-dart-setup-card {
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--theme-primary) 38%, var(--theme-line));
  border-radius: 1rem;
  background: color-mix(in srgb, var(--theme-primary) 8%, transparent);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}

.current-dart-setup-card h2 {
  color: var(--theme-text);
  font-size: clamp(1.15rem, 3vw, 1.65rem);
  font-weight: 700;
  line-height: 1.1;
  margin: .2rem 0 0;
}

.current-dart-setup-metrics {
  display: flex;
  gap: .65rem;
  flex: 0 0 auto;
}

.current-dart-setup-metrics span {
  border-left: 1px solid var(--theme-line);
  color: var(--theme-muted);
  display: grid;
  gap: .15rem;
  min-width: 4rem;
  padding-left: .65rem;
  text-transform: uppercase;
  font-size: .62rem;
  letter-spacing: .1em;
}

.current-dart-setup-metrics strong {
  color: var(--theme-primary-soft);
  font-family: "Oswald", "Manrope", system-ui, sans-serif;
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
}

.dart-setup-section {
  border-top: 1px solid var(--theme-line);
  padding-top: .9rem;
}

.dart-option-grid,
.dart-preset-row {
  display: grid;
  gap: .55rem;
  margin-top: .65rem;
  /* Selected buttons use an outside outline; give it room so the
     first/left item is not clipped by the card/container edge. */
  padding: 3px;
}

.dart-manufacturer-grid {
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
}

.dart-shaft-grid {
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
}

.dart-preset-row {
  grid-template-columns: repeat(auto-fit, minmax(5.25rem, 1fr));
}

.dart-option,
.dart-preset-btn {
  height: auto;
  line-height: 1.15;
  min-height: 3.1rem;
  overflow: hidden;
  text-align: center;
  white-space: normal !important;
  width: 100%;
}

.dart-option span,
.dart-preset-btn span {
  display: block;
  max-width: 100%;
  hyphens: none;
  overflow-wrap: normal;
  word-break: keep-all;
}

.dart-option.is-selected,
.dart-preset-btn.is-selected {
  background: var(--theme-cta, var(--theme-primary)) !important;
  border-color: var(--theme-cta, var(--theme-primary)) !important;
  color: #fff !important;
  outline: 2px solid color-mix(in srgb, var(--theme-primary) 55%, #fff) !important;
  outline-offset: 2px !important;
  position: relative;
  z-index: 1;
}

.dart-setup-stats-card {
  display: grid;
  gap: 1rem;
}

.dart-setup-stats-head {
  align-items: flex-start;
  border-bottom: 1px solid var(--theme-line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .9rem;
}

.dart-setup-stats-head h3 {
  color: var(--theme-text);
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  font-weight: 700;
  line-height: 1.25;
  margin: .2rem 0 0;
}

.dart-setup-stats-actions {
  align-items: flex-end;
  display: grid;
  gap: .45rem;
  justify-items: end;
  flex: 0 0 auto;
}

.dart-setup-stats-actions form {
  margin: 0;
}

.dart-setup-stats-head .theme-chip {
  flex: 0 0 auto;
}

.bot-difficulty-panel {
  gap: .8rem !important;
}

.bot-level-group {
  border-top: 1px solid var(--theme-line);
  padding-top: .85rem;
}

.bot-level-group-head {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .6rem;
}

.bot-level-description {
  color: var(--theme-muted);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.bot-level-buttons {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(2.75rem, 1fr));
  gap: .5rem !important;
}

.bot-level-buttons .bot-choice-radio {
  width: 100%;
}

/* Bot setup selectable pills use the same selected state as the default match setup. */
.dartz-body .button.bot-choice-radio {
  position: relative;
  transition: transform .12s ease, background .12s ease, border-color .12s ease, color .12s ease;
}

.dartz-body .button.bot-choice-radio.is-selected,
.dartz-body .button.bot-choice-radio:has(input:checked) {
  background: var(--theme-cta, var(--theme-primary)) !important;
  border-color: var(--theme-cta, var(--theme-primary)) !important;
  box-shadow: none !important;
  color: #fff !important;
  outline: 2px solid color-mix(in srgb, var(--theme-primary) 55%, #fff) !important;
  outline-offset: 2px !important;
  transform: translateY(-1px);
}


/* Make multi-leg / multi-set progress visible on match score cards. */
.match-score-meta.has-leg-set-score {
  gap: .55rem;
  margin-top: .65rem;
}

.match-progress-pill {
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--theme-primary) 35%, var(--theme-line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--theme-primary) 10%, var(--theme-surface-muted));
  color: var(--theme-muted);
  display: inline-flex;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: clamp(.82rem, 2.5vw, 1rem);
  font-weight: 700;
  gap: .45rem;
  letter-spacing: .08em;
  line-height: 1;
  padding: .55rem .8rem;
  text-transform: uppercase;
}

.match-progress-pill strong {
  color: var(--theme-primary-soft);
  font-family: "Oswald", "Manrope", system-ui, sans-serif;
  font-size: clamp(1.45rem, 4vw, 2.1rem);
  letter-spacing: -.02em;
  line-height: .9;
}

.match-score-card.is-active .match-progress-pill {
  border-color: color-mix(in srgb, var(--theme-primary) 60%, var(--theme-line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--theme-primary) 18%, transparent);
}

/* Lock scoring controls while bot is taking its turn. */
.bot-turn-disabled {
  opacity: .48;
  filter: grayscale(.75);
}

.match-input-panel.bot-turn-disabled,
.match-dart-pad.bot-turn-disabled {
  position: relative;
}

.match-input-panel.bot-turn-disabled::after,
.match-dart-pad.bot-turn-disabled::after {
  content: "Bot turn";
  position: absolute;
  right: .9rem;
  top: .75rem;
  border: 1px solid var(--theme-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--theme-surface) 86%, transparent);
  color: var(--theme-muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  padding: .3rem .55rem;
  text-transform: uppercase;
}

.bot-turn-disabled input,
.bot-turn-disabled button,
.dart-btn:disabled {
  cursor: not-allowed !important;
}

.is-waiting-for-opponent .match-dart-pad {
  opacity: .45;
  filter: grayscale(.65);
  pointer-events: none;
}

.is-waiting-for-opponent .match-dart-pad button {
  cursor: not-allowed !important;
}

/* Tournament index delete affordance. */
.tournament-index-card-wrap {
  position: relative;
}

.tournament-index-card-wrap > .counter-tournament-card {
  display: block;
  height: 100%;
  padding-right: 3.25rem !important;
}

.tournament-index-delete-form {
  position: absolute;
  right: .75rem;
  top: .75rem;
  z-index: 2;
}

.tournament-index-delete {
  align-items: center;
  appearance: none;
  background: color-mix(in srgb, var(--theme-danger) 12%, var(--theme-surface));
  border: 1px solid color-mix(in srgb, var(--theme-danger) 45%, var(--theme-line));
  border-radius: 999px;
  color: color-mix(in srgb, var(--theme-danger) 78%, #fff);
  cursor: pointer;
  display: inline-flex;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 1.25rem;
  font-weight: 800;
  height: 2.1rem;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 2.1rem;
}

.tournament-index-delete:hover {
  background: color-mix(in srgb, var(--theme-hover) 22%, var(--theme-surface));
  border-color: color-mix(in srgb, var(--theme-hover) 70%, var(--theme-line));
  transform: translateY(-1px);
}

.tournament-index-card-wrap [data-controller="confirmation-modal"] {
  position: absolute;
  right: .75rem;
  top: .75rem;
  z-index: 2;
}

.tournament-delete-modal {
  width: min(30rem, calc(100vw - 2rem));
  border: 1px solid var(--theme-line);
  border-radius: 1.35rem;
  background: var(--theme-surface);
  color: var(--theme-text);
  padding: 0;
  box-shadow: var(--theme-shadow);
}

.tournament-delete-modal::backdrop {
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(8px);
}

.tournament-delete-modal-card {
  padding: 1.35rem;
}

.tournament-delete-confirm {
  background: color-mix(in srgb, var(--theme-danger) 22%, var(--theme-surface)) !important;
  border: 1px solid color-mix(in srgb, var(--theme-danger) 65%, var(--theme-line)) !important;
  color: var(--theme-text) !important;
}

.tournament-delete-confirm:hover {
  background: color-mix(in srgb, var(--theme-hover) 34%, var(--theme-surface)) !important;
}

/* Simple mobile-first redesign: flat, square, obvious. */
body.dartz-body {
  background: var(--theme-bg) !important;
  color: var(--theme-text);
}

.app-main,
.simple-nav,
.footer-inner {
  width: min(100%, 80rem);
  margin-inline: auto;
  padding-inline: clamp(.75rem, 3vw, 1.5rem);
}

.app-main {
  padding-top: .85rem;
  padding-bottom: 5rem;
}

.app-header {
  border-bottom: 2px solid var(--theme-line);
  background: var(--theme-bg) !important;
  backdrop-filter: none;
}

.simple-nav {
  position: relative;
  display: grid;
  gap: .65rem;
  padding-top: .65rem;
  padding-bottom: .65rem;
}

.simple-nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-width: 0;
}

.simple-nav-top-actions {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: .5rem;
  margin-left: auto;
}

.app-nav-auth-form {
  display: inline-flex;
  flex: 0 0 auto;
  margin: 0;
}

.app-nav-auth-inline {
  margin-left: auto;
}

.app-nav-auth-button {
  align-items: center;
  appearance: none;
  border: 1px solid var(--theme-primary) !important;
  border-radius: .35rem;
  display: inline-flex;
  font-size: .68rem;
  font-weight: 700;
  justify-content: center;
  letter-spacing: .08em;
  min-height: 2rem;
  padding: .42rem .62rem !important;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.app-nav-auth-button {
  background: transparent !important;
  color: var(--theme-primary-soft) !important;
}

.app-nav-auth-button.is-danger {
  background: var(--theme-cta, var(--theme-primary)) !important;
  color: #fff !important;
}

.app-nav-auth-button.is-danger:hover,
.app-nav-auth-button.is-danger.is-active {
  background: color-mix(in srgb, var(--theme-primary) 82%, #000) !important;
  border-color: color-mix(in srgb, var(--theme-primary) 82%, #000) !important;
  color: #fff !important;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
  color: var(--theme-text);
  text-decoration: none;
}

.brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid var(--theme-primary);
  background: transparent;
  color: var(--theme-primary-soft);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 1.4rem;
  font-weight: 800;
}

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

.simple-nav-scroll {
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding-bottom: .15rem;
}
.simple-nav-scroll::-webkit-scrollbar { display: none; }

.app-nav-locale-form {
  display: inline-flex;
  flex: 0 0 auto;
  margin: 0;
}

.app-nav-locale-select {
  appearance: none;
  min-height: 2.75rem;
  padding: .72rem 1.7rem .72rem .85rem;
  border: 1px solid var(--theme-line);
  border-radius: .45rem;
  background: var(--theme-bg) linear-gradient(45deg, transparent 50%, var(--theme-muted) 50%), linear-gradient(135deg, var(--theme-muted) 50%, transparent 50%);
  background-position: calc(100% - .9rem) 50%, calc(100% - .62rem) 50%;
  background-size: .28rem .28rem, .28rem .28rem;
  background-repeat: no-repeat;
  color: var(--theme-muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}

.app-nav-locale-select:hover,
.app-nav-locale-select:focus {
  border-color: var(--theme-primary);
  color: var(--theme-text);
  outline: none;
}

.app-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 2.75rem;
  padding: .72rem .85rem !important;
  border: 1px solid var(--theme-line) !important;
  background: transparent !important;
  color: var(--theme-muted) !important;
  text-decoration: none;
}

.app-nav-link.is-active,
.app-nav-link:hover,
button.app-nav-link:hover {
  background: var(--theme-cta, var(--theme-primary)) !important;
  border-color: var(--theme-cta, var(--theme-primary)) !important;
  color: #fff !important;
}

.profile-menu-panel,
#profileMenu {
  position: absolute;
  top: calc(100% + .25rem);
  right: .75rem;
  z-index: 60;
  width: min(24rem, calc(100vw - 1.5rem));
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 2px solid var(--theme-line) !important;
  background: var(--theme-bg-soft) !important;
}
#profileMenu.hidden { display: none !important; }
.profile-menu-panel hr { border: 0; border-top: 1px solid var(--theme-line); margin: 0; }

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
}

.page-shell,
.page-shell-narrow,
.page-shell-compact {
  max-width: none;
  width: 100%;
}

.theme-hero,
.theme-card,
.auth-card,
.theme-panel,
.counter-list-card,
.counter-tournament-card,
.theme-match-card,
.theme-legal-card,
.counter-admin-card {
  padding: 1rem 0 !important;
  border: 0 !important;
  border-top: 2px solid var(--theme-line) !important;
  background: transparent !important;
}

.theme-hero:first-child,
.page-shell > .theme-card:first-child,
.page-shell > .auth-card:first-child {
  border-top: 0 !important;
}

.page-title {
  font-size: clamp(2.25rem, 13vw, 4.25rem);
  line-height: .92;
}

.section-title {
  font-size: clamp(1.35rem, 6vw, 2rem);
}

.theme-section-label,
.auth-label,
.eyebrow {
  color: var(--theme-muted);
  letter-spacing: .11em;
}

.dartz-body .button,
.dartz-body .btn,
.theme-btn-primary,
.theme-btn-outline,
.saved-btn,
.panel-choice,
.theme-chip,
.tag.theme-chip,
.dartz-body .input,
.dartz-body .textarea,
.dartz-body .select select,
.theme-form-input,
.auth-input,
.throw-input {
  border-radius: 0 !important;
  box-shadow: none !important;
}

.dartz-body .button,
.dartz-body .btn,
.theme-btn-primary,
.theme-btn-outline {
  min-height: 3rem;
  border-width: 2px !important;
  font-weight: 800;
}

.theme-btn-primary,
.dartz-body .button.theme-btn-primary,
.dartz-body .btn.theme-btn-primary {
  background: var(--theme-cta, var(--theme-primary)) !important;
  border-color: var(--theme-cta, var(--theme-primary)) !important;
  color: #fff !important;
}

.theme-btn-outline,
.dartz-body .button.theme-btn-outline,
.dartz-body .btn.theme-btn-outline {
  background: transparent !important;
  border-color: var(--theme-line-strong) !important;
  color: var(--theme-text) !important;
}

.dartz-body .input,
.dartz-body .textarea,
.dartz-body .select select,
.theme-form-input,
.auth-input,
.throw-input {
  min-height: 3.25rem;
  border: 2px solid var(--theme-line-strong) !important;
  background: transparent !important;
  font-size: 1rem;
}

.dartz-body .input:focus,
.dartz-body .textarea:focus,
.theme-form-input:focus,
.auth-input:focus,
.throw-input:focus {
  border-color: var(--theme-primary) !important;
  outline: 3px solid color-mix(in srgb, var(--theme-primary) 28%, transparent) !important;
  box-shadow: none !important;
}

.panel-choice {
  min-height: 3.25rem;
  border: 2px solid var(--theme-line-strong) !important;
  background: transparent !important;
  color: var(--theme-text) !important;
}

.theme-chip,
.tag.theme-chip {
  border: 1px solid var(--theme-line-strong) !important;
  background: transparent !important;
}

.columns.is-variable,
.columns.is-multiline {
  row-gap: .75rem;
}

.simple-setup {
  counter-reset: setup-step;
}

.simple-step {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  gap: .8rem;
  align-items: start;
  padding: .85rem 0;
  border-top: 2px solid var(--theme-line);
}

.simple-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 2px solid var(--theme-primary);
  color: var(--theme-primary-soft);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 800;
}

.match-focus-bar {
  background: var(--theme-bg);
  border-bottom: 2px solid var(--theme-line);
  padding: .25rem 0 .45rem;
}

.match-focus-bar-mobile {
  position: sticky;
  top: 6.6rem;
  z-index: 20;
}

.match-score-header {
  align-items: center;
  border-bottom: 1px solid var(--theme-line);
  display: flex;
  gap: .6rem;
  justify-content: flex-end;
  margin-bottom: 0;
  padding: .22rem 0;
}

.match-score-header .button {
  min-height: 2rem;
  padding: .35rem .6rem !important;
}

.match-score-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: .75rem;
}

.match-score-card,
.theme-score-card {
  border-top: 2px solid var(--theme-line) !important;
  padding-top: .75rem !important;
}

.dart-grid,
.dart-footer-actions {
  gap: .35rem !important;
}

.dart-btn {
  min-height: 3rem;
  border-width: 2px !important;
}

.tournament-owned-card,
.tournament-guest-card {
  padding: 1rem 0 1rem .75rem !important;
  border-top-width: 2px !important;
}

.tournament-index-delete,
.tournament-delete-modal,
.tournament-delete-modal-card {
  border-radius: 0 !important;
  box-shadow: none !important;
}

@media (max-width: 760px) {
  .app-main {
    padding-inline: .75rem;
    padding-bottom: 6rem;
  }

  .simple-nav {
    padding-inline: .75rem;
  }

  .brand-subline { display: none; }

  .app-nav-link {
    min-height: 2.9rem;
    padding-inline: .8rem !important;
    font-size: .72rem;
  }

  .level,
  .level-left,
  .level-right,
  .buttons {
    display: flex;
    align-items: stretch;
    width: 100%;
  }

  .buttons .button,
  .level-right .button,
  .level-right .btn,
  input[type="submit"].button,
  .dartz-body .button.is-medium {
    width: 100%;
  }

  .columns {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .85rem !important;
  }

  .column {
    width: 100% !important;
    padding: 0 !important;
  }

  .theme-hero,
  .theme-card,
  .auth-card,
  .theme-panel,
  .counter-list-card,
  .counter-tournament-card,
  .theme-match-card {
    padding-block: .85rem !important;
  }

  .player-card-shell {
    padding-top: .8rem;
  }

  .swap-badge {
    width: 100% !important;
    height: 3rem !important;
  }

  .invite-starter-panel .column.is-narrow,
  .invite-starter-panel .button_to,
  .invite-starter-swap-form {
    width: 100%;
  }

  .invite-starter-panel .columns {
    gap: .75rem !important;
  }

  .match-focus-bar {
    top: 6.9rem;
  }

  .match-focus-title strong {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .score-display {
    font-size: clamp(4rem, 25vw, 6.5rem);
  }

  .dart-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  .dart-btn {
    min-height: 3.25rem;
    font-size: .95rem;
  }

  .dart-footer-actions {
    position: sticky;
    bottom: .5rem;
    z-index: 25;
    background: var(--theme-bg);
    padding-top: .5rem;
  }

  .footer-inner {
    align-items: flex-start;
    padding-inline: .75rem;
  }
}

/* Calm pass: fewer boxes, fewer dividers, simpler reading flow. */
.app-header {
  border-bottom: 1px solid color-mix(in srgb, var(--theme-line) 55%, transparent) !important;
}

.app-footer {
  border-top: 0 !important;
}

.simple-nav {
  gap: .5rem;
}

.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  border: 0 !important;
  background: var(--theme-cta, var(--theme-primary)) !important;
  color: #fff !important;
}

.simple-nav-scroll {
  gap: .25rem;
}

.app-nav-link {
  min-height: 2.45rem;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  padding: .58rem .65rem !important;
  color: var(--theme-muted) !important;
}

.app-nav-link.is-active,
.app-nav-link:hover,
button.app-nav-link:hover {
  background: transparent !important;
  border-color: var(--theme-primary) !important;
  color: var(--theme-text) !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.match-nav-back {
  margin-left: .5rem;
}

.app-nav-theme-toggle {
  margin-left: 0;
  min-width: 2.6rem;
  padding-inline: .75rem !important;
  white-space: nowrap;
}

button.app-nav-link.app-nav-theme-toggle .icon {
  align-items: center;
  color: var(--theme-text) !important;
  display: inline-flex !important;
  height: 1.25rem;
  justify-content: center;
  width: 1.25rem;
}

.theme-mode-icon {
  display: block;
  height: 1.25rem;
  width: 1.25rem;
}

.theme-mode-icon-moon,
html[data-theme="light"] .theme-mode-icon-sun {
  display: none;
}

html[data-theme="light"] .theme-mode-icon-moon {
  display: block;
}

.theme-hero,
.theme-card,
.auth-card,
.theme-panel,
.counter-list-card,
.counter-tournament-card,
.theme-match-card,
.theme-legal-card,
.counter-admin-card,
.theme-score-card,
.match-score-card,
.counter-standings-row,
.bracket-round-card,
.player-card-shell,
.counter-turn-panel,
.counter-score-metric,
.counter-summary-tile,
.theme-blank-slate,
.tournament-owned-card,
.tournament-guest-card {
  border-top: 0 !important;
  border-bottom: 0 !important;
}

.theme-hero,
.theme-card,
.auth-card {
  padding-top: .65rem !important;
  padding-bottom: 1rem !important;
}

.theme-panel,
.counter-list-card,
.counter-tournament-card,
.theme-match-card,
.theme-legal-card,
.counter-admin-card {
  padding-block: .65rem !important;
}

.page-shell.stack-lg,
.stack-lg {
  gap: 1rem;
}

.stack-md {
  gap: .75rem;
}

.simple-step {
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: .65rem;
  padding: .6rem 0;
  border-top: 0 !important;
}

.simple-step-number {
  width: 1.65rem;
  height: 1.65rem;
  border: 0 !important;
  background: color-mix(in srgb, var(--theme-primary) 16%, transparent);
  color: var(--theme-primary-soft);
  font-size: .82rem;
}

.dartz-body .button,
.dartz-body .btn,
.theme-btn-primary,
.theme-btn-outline {
  border-width: 0 !important;
  min-height: 2.9rem;
}

.theme-btn-outline,
.dartz-body .button.theme-btn-outline,
.dartz-body .btn.theme-btn-outline {
  background: color-mix(in srgb, var(--theme-text) 6%, transparent) !important;
  border-color: transparent !important;
}

.dartz-body .input,
.dartz-body .textarea,
.dartz-body .select select,
.theme-form-input,
.auth-input,
.throw-input {
  border: 0 !important;
  border-bottom: 2px solid var(--theme-line-strong) !important;
  background: color-mix(in srgb, var(--theme-text) 4%, transparent) !important;
}

.panel-choice {
  border: 0 !important;
  background: color-mix(in srgb, var(--theme-text) 5%, transparent) !important;
}

.theme-chip,
.tag.theme-chip {
  border: 0 !important;
  background: color-mix(in srgb, var(--theme-text) 6%, transparent) !important;
}

.progress-thin {
  height: .22rem;
  background: color-mix(in srgb, var(--theme-text) 10%, transparent) !important;
}

.match-focus-bar {
  border-bottom: 0 !important;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--theme-line) 45%, transparent);
}

.match-score-strip {
  gap: .5rem;
}

.tournament-owned-section,
.tournament-guest-section,
.tournament-link-panel {
  border-left: 0 !important;
  padding-left: 0 !important;
}

.tournament-owned-card,
.tournament-guest-card {
  background: transparent !important;
  padding-left: 0 !important;
}

.tournament-owned-card:hover,
.tournament-guest-card:hover,
a.theme-match-card:hover,
a.counter-tournament-card:hover {
  background: color-mix(in srgb, var(--theme-text) 4%, transparent) !important;
}

.profile-menu-panel,
#profileMenu,
.saved-dropdown,
.tournament-delete-modal {
  border: 0 !important;
  background: var(--theme-bg-soft) !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--theme-line) 55%, transparent) !important;
}

@media (max-width: 760px) {
  .app-nav-link {
    min-height: 2.55rem;
    padding-inline: .58rem !important;
  }

  .theme-hero,
  .theme-card,
  .auth-card,
  .theme-panel,
  .counter-list-card,
  .counter-tournament-card,
  .theme-match-card {
    padding-block: .55rem !important;
  }

  .dart-btn {
    border-width: 0 !important;
    background: color-mix(in srgb, var(--theme-text) 7%, transparent) !important;
  }
}

/* Minimal pass: remove the visible box/line clutter from setup screens. */
.simple-setup,
.simple-setup *,
.simple-setup *::before,
.simple-setup *::after {
  box-shadow: none !important;
}

.simple-setup .theme-panel,
.simple-setup .player-card-shell,
.simple-setup .panel-choice,
.simple-setup .theme-card,
.simple-setup .theme-hero,
.simple-setup .columns,
.simple-setup .column,
.simple-setup .level,
.simple-setup .level-left,
.simple-setup .level-right,
.simple-setup [style*="border"] {
  border: 0 !important;
}

.simple-setup .simple-step {
  padding: .35rem 0 .15rem;
  border: 0 !important;
}

.simple-setup .simple-step-number {
  background: transparent !important;
  color: var(--theme-primary-soft);
  width: 1.2rem;
  height: 1.2rem;
}

.simple-setup .input,
.simple-setup .theme-form-input,
.simple-setup input[type="number"],
.simple-setup input[type="text"] {
  border: 0 !important;
  background: color-mix(in srgb, var(--theme-text) 6%, transparent) !important;
}

.simple-setup .input:focus,
.simple-setup .theme-form-input:focus,
.simple-setup input[type="number"]:focus,
.simple-setup input[type="text"]:focus {
  border: 0 !important;
  outline: 2px solid color-mix(in srgb, var(--theme-primary) 42%, transparent) !important;
}

.simple-setup .button,
.simple-setup .btn,
.simple-setup .theme-btn-outline,
.simple-setup .panel-choice,
.simple-setup .theme-chip {
  border: 0 !important;
  background: color-mix(in srgb, var(--theme-text) 5%, transparent) !important;
}

.simple-setup .button.theme-btn-primary,
.simple-setup .btn.theme-btn-primary,
.simple-setup input[type="submit"].theme-btn-primary {
  background: var(--theme-cta, var(--theme-primary)) !important;
  color: #fff !important;
}

.simple-setup .button.is-selected,
.simple-setup .score-preset.is-selected,
.simple-setup .legs-preset.is-selected,
.simple-setup .sets-preset.is-selected,
.simple-setup .bot-choice-radio.is-selected,
.simple-setup .bot-choice-radio:has(input:checked) {
  background: color-mix(in srgb, var(--theme-primary) 22%, transparent) !important;
  color: var(--theme-text) !important;
}

.simple-setup .saved-btn {
  background: transparent !important;
  color: var(--theme-muted) !important;
}

/* Make the global shell quieter too: active nav is text color, not another line. */
.app-nav-link,
.app-nav-link.is-active,
.app-nav-link:hover,
button.app-nav-link:hover {
  border: 0 !important;
}

.app-nav-link.is-active {
  color: var(--theme-primary-soft) !important;
}

/* Airy pass: more breathing room, red only for primary action/state text. */
.app-main {
  padding-top: 0 !important;
}

.page-shell,
.simple-setup,
.stack-lg {
  gap: clamp(1.5rem, 5vw, 2.75rem) !important;
}

.stack-md {
  gap: clamp(1rem, 3vw, 1.75rem) !important;
}

.theme-hero,
.theme-card,
.auth-card,
.theme-panel,
.counter-list-card,
.counter-tournament-card,
.theme-match-card,
.theme-legal-card,
.counter-admin-card {
  padding-block: clamp(1rem, 3.5vw, 2rem) !important;
}

.simple-setup .simple-step {
  padding: 1.1rem 0 .35rem !important;
  margin-top: .35rem;
}

.simple-setup .simple-step:first-of-type {
  margin-top: 0;
}

.simple-setup .columns {
  margin-bottom: clamp(.75rem, 3vw, 1.5rem) !important;
}

.simple-setup .theme-panel,
.simple-setup .player-card-shell {
  padding-block: .85rem !important;
}

.simple-setup .input,
.simple-setup .theme-form-input,
.simple-setup input[type="number"],
.simple-setup input[type="text"] {
  min-height: 3.65rem !important;
  padding-inline: 1rem !important;
  background: color-mix(in srgb, var(--theme-text) 4%, transparent) !important;
}

.simple-setup .button,
.simple-setup .btn,
.simple-setup .theme-btn-outline,
.simple-setup .panel-choice {
  min-height: 3.35rem !important;
  background: color-mix(in srgb, var(--theme-text) 4%, transparent) !important;
}

.simple-setup .buttons {
  gap: .6rem !important;
}

.simple-setup #best_of_legs,
.simple-setup #best_of_sets {
  margin-top: .65rem;
}

.simple-setup .button.is-selected,
.simple-setup .score-preset.is-selected,
.simple-setup .legs-preset.is-selected,
.simple-setup .sets-preset.is-selected,
.simple-setup .bot-choice-radio.is-selected,
.simple-setup .bot-choice-radio:has(input:checked) {
  background: var(--theme-cta, var(--theme-primary)) !important;
  color: #fff !important;
  outline: 2px solid color-mix(in srgb, var(--theme-primary) 55%, #fff) !important;
  outline-offset: 2px !important;
  transform: translateY(-1px);
}

.simple-setup .button.theme-btn-primary,
.simple-setup .btn.theme-btn-primary,
.simple-setup input[type="submit"].theme-btn-primary {
  background: var(--theme-cta, var(--theme-primary)) !important;
  color: #fff !important;
}

.setup-heading {
  max-width: 38rem;
}

.setup-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.setup-primary-actions {
  justify-content: flex-end;
}

.setup-utility-actions {
  margin-top: .75rem;
  color: var(--theme-muted);
}

.setup-utility-actions summary {
  cursor: pointer;
  width: fit-content;
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.brand-mark {
  background: color-mix(in srgb, var(--theme-primary) 82%, #000) !important;
}

.theme-chip.is-live,
.theme-chip.is-finished,
.theme-chip,
.tag.theme-chip {
  border-color: transparent !important;
}

.dartz-body .input:focus,
.dartz-body .textarea:focus,
.theme-form-input:focus,
.auth-input:focus,
.throw-input:focus,
.simple-setup .input:focus,
.simple-setup .theme-form-input:focus,
.simple-setup input[type="number"]:focus,
.simple-setup input[type="text"]:focus {
  outline: none !important;
  background: color-mix(in srgb, var(--theme-text) 7%, transparent) !important;
}

.match-score-card.is-active,
.theme-score-card.is-active,
.counter-standings-row.is-active,
.tournament-owned-card,
.tournament-guest-card {
  border-color: transparent !important;
}

.theme-score-card.is-active::before {
  display: none !important;
}

@media (max-width: 760px) {
  .app-main {
    padding-top: .35rem !important;
  }

  .page-shell,
  .simple-setup,
  .stack-lg {
    gap: 1.15rem !important;
  }

  .simple-setup.theme-hero {
    padding: 1rem !important;
  }

  .setup-heading {
    margin-bottom: .5rem !important;
  }

  .setup-heading .page-title {
    font-size: clamp(1.6rem, 8vw, 2.15rem) !important;
    line-height: 1 !important;
  }

  .setup-heading .page-copy {
    margin-top: .35rem !important;
  }

  .current-dart-setup-card {
    align-items: flex-start;
    display: grid;
  }

  .current-dart-setup-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .current-dart-setup-metrics span {
    min-width: 0;
  }

  .dart-setup-stats-head {
    display: grid;
  }

  .dart-setup-stats-actions {
    align-items: start;
    display: flex;
    flex-wrap: wrap;
    justify-items: start;
    justify-content: flex-start;
  }

  .dart-manufacturer-grid,
  .dart-shaft-grid {
    grid-template-columns: 1fr;
  }

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

  .simple-setup .columns.is-vcentered {
    display: flex;
    flex-direction: column;
  }

  .simple-setup .columns.is-vcentered > .column:nth-child(2) {
    order: 3;
    width: 100%;
    text-align: right !important;
    margin-top: -.5rem;
  }

  .simple-setup .columns.is-vcentered .swap-badge {
    width: auto;
    min-width: 7rem;
    height: 2.6rem;
    padding-inline: .9rem !important;
  }

  .simple-setup .columns.is-vcentered .swap-badge::after {
    content: " Swap";
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .simple-setup .simple-step {
    padding-top: .55rem !important;
  }

  .simple-setup .buttons {
    gap: .5rem !important;
  }

  .simple-setup .button,
  .simple-setup .btn,
  .simple-setup .theme-btn-outline,
  .simple-setup .panel-choice {
    min-height: 3rem !important;
  }

  .simple-setup .input,
  .simple-setup .theme-form-input,
  .simple-setup input[type="number"],
  .simple-setup input[type="text"] {
    min-height: 3.2rem !important;
  }

  .setup-submit-row {
    display: block;
  }

  .setup-primary-actions .button,
  .setup-primary-actions input[type="submit"] {
    flex: 1 1 100%;
    width: 100%;
  }

  .setup-utility-actions {
    margin-top: .35rem;
  }
}

@media (max-width: 760px) {
  .match-score-card {
    padding-inline: 0 !important;
  }

  .match-score-main-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: .7rem;
  }

  .match-score-number {
    flex: 1 1 auto;
    min-width: 0;
    font-size: clamp(3.35rem, 21vw, 5.15rem);
  }
}

/* Clean tournament setup form */
.tournament-setup-page .theme-hero,
.tournament-setup-page .theme-card {
  border-radius: 1.25rem;
}

.tournament-setup-copy,
.tournament-required-note {
  color: var(--theme-muted);
}

.required-asterisk {
  color: var(--theme-secondary);
  font-weight: 900;
}

.tournament-form-section {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid color-mix(in srgb, var(--theme-text) 10%, transparent);
}

.tournament-form-section:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.tournament-setup-page .auth-label {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  margin-bottom: .45rem;
}

.tournament-setup-page .theme-form-input,
.tournament-setup-page textarea.theme-form-input,
.tournament-setup-page select.theme-form-input {
  width: 100%;
  min-height: 3rem;
}

.tournament-setup-page textarea.theme-form-input {
  min-height: 12rem;
  resize: vertical;
}

.tournament-advanced-options {
  border-radius: 1rem;
  background: color-mix(in srgb, var(--theme-text) 4%, transparent);
  padding: 1rem;
}

.tournament-advanced-options[open] .tournament-summary-toggle {
  margin-bottom: .25rem;
}

.tournament-summary-toggle {
  cursor: pointer;
  font-family: var(--font-display, inherit);
  font-size: 1.35rem;
  letter-spacing: .03em;
  color: var(--theme-text);
}

/* Tournament group management */
.tournament-group-overview {
  display: grid;
  gap: .85rem;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.tournament-group-card {
  border-radius: 1rem;
  padding: .9rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--theme-primary) 13%, transparent), color-mix(in srgb, var(--theme-text) 4%, transparent));
  border: 1px solid color-mix(in srgb, var(--theme-primary) 30%, transparent);
}

.tournament-group-player {
  display: flex;
  align-items: center;
  gap: .5rem;
  border-radius: .7rem;
  padding: .5rem .6rem;
  background: color-mix(in srgb, var(--theme-surface) 72%, transparent);
  color: var(--theme-muted);
}

.tournament-group-player strong {
  color: var(--theme-text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tournament-match-actions form,
.tournament-match-actions .button_to {
  display: inline-flex;
  margin: 0;
}

.tournament-match-actions .btn,
.tournament-match-actions .button,
.tournament-match-row input[type="submit"].btn {
  width: 8.5rem;
  min-width: 8.5rem;
  min-height: 2.75rem;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
}

.training-target {
  font-size: clamp(4rem, 16vw, 9rem);
  line-height: 1;
  font-weight: 800;
  color: var(--theme-primary);
  text-shadow: 0 0 24px color-mix(in srgb, var(--theme-primary) 30%, transparent);
}

.training-input-row .control:first-child {
  max-width: 9rem;
}

.training-play-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 13rem;
  gap: 1rem;
  align-items: start;
}

.training-focus-card {
  display: grid;
  gap: 1.25rem;
}

.training-target-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.training-progress-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: .65rem .9rem;
  background: color-mix(in srgb, var(--theme-primary) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--theme-primary) 40%, transparent);
  color: var(--theme-text);
  font-weight: 800;
  font-size: 1.15rem;
}

.training-progress-track {
  height: .85rem;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--theme-text) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--theme-primary) 20%, transparent);
}

.training-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--theme-primary), color-mix(in srgb, var(--theme-primary) 70%, white));
}

.training-target-rail {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.training-target-pill {
  min-width: 2.35rem;
  text-align: center;
  border-radius: .75rem;
  padding: .4rem .5rem;
  background: color-mix(in srgb, var(--theme-text) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--theme-text) 14%, transparent);
  color: var(--theme-muted);
  font-size: .82rem;
  font-weight: 700;
}

.training-target-pill.is-done {
  color: var(--theme-text);
  background: color-mix(in srgb, var(--theme-success, #22c55e) 18%, transparent);
  border-color: color-mix(in srgb, var(--theme-success, #22c55e) 35%, transparent);
}

.training-target-pill.is-current {
  transform: scale(1.08);
  color: var(--theme-bg);
  background: var(--theme-primary);
  border-color: var(--theme-primary);
  box-shadow: 0 0 18px color-mix(in srgb, var(--theme-primary) 35%, transparent);
}

.training-throw-form {
  border-radius: 1.25rem;
  padding: 1rem;
  background: color-mix(in srgb, var(--theme-surface) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--theme-primary) 20%, transparent);
}

.training-input-label {
  display: block;
  margin-bottom: .65rem;
  color: var(--theme-text);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.training-action-row {
  display: grid;
  grid-template-columns: 8rem minmax(10rem, 1fr) minmax(8rem, auto);
  gap: .75rem;
}

.training-misses-input,
.training-action-button {
  min-height: 4rem;
  font-size: 1.35rem;
  font-weight: 800;
}

.training-misses-input {
  text-align: center;
}

.training-key {
  display: inline-flex;
  margin-left: .5rem;
  border-radius: .5rem;
  padding: .15rem .4rem;
  background: color-mix(in srgb, black 20%, transparent);
  font-size: .72em;
}

.training-keyboard-hint {
  margin-top: .75rem;
  color: var(--theme-muted);
}

.training-stat-card strong {
  display: block;
  margin-top: .25rem;
  color: var(--theme-text);
  font-size: 2.4rem;
  line-height: 1;
}

.training-abandon-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .training-play-grid {
    grid-template-columns: 1fr;
  }

  .training-side-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
  }
}

@media (max-width: 640px) {
  .training-target-header,
  .training-action-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .training-side-panel {
    grid-template-columns: 1fr;
  }

  .training-progress-badge {
    width: max-content;
  }
}

.tournament-match-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
}

.tournament-match-content {
  display: grid;
  gap: .75rem;
}

.tournament-match-teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: .75rem;
  align-items: stretch;
}

.tournament-match-team {
  display: grid;
  gap: .25rem;
  min-width: 0;
  border-radius: .9rem;
  padding: .75rem .9rem;
  background: color-mix(in srgb, var(--theme-surface) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--theme-text) 12%, transparent);
}

.tournament-match-team strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--theme-text);
  font-size: 1.08rem;
  line-height: 1.15;
}

.tournament-match-team.is-winner {
  background: color-mix(in srgb, var(--theme-success) 14%, transparent);
  border-color: color-mix(in srgb, var(--theme-success) 42%, transparent);
  box-shadow: inset 4px 0 0 var(--theme-success);
}

.tournament-match-team.is-winner strong {
  color: var(--theme-success);
  font-weight: 900;
}

.tournament-team-side {
  color: var(--theme-muted);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.tournament-match-vs {
  align-self: center;
  border-radius: 999px;
  padding: .4rem .55rem;
  background: color-mix(in srgb, var(--theme-primary) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--theme-primary) 28%, transparent);
  color: var(--theme-muted);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tournament-match-meta-row,
.tournament-result-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}

.tournament-result-box {
  border-top: 1px solid color-mix(in srgb, var(--theme-text) 12%, transparent);
  padding-top: .65rem;
  color: var(--theme-muted);
}

.tournament-result-box strong {
  color: var(--theme-text);
  font-size: 1.1em;
}

.tournament-result-separator {
  width: 1px;
  height: 1rem;
  background: color-mix(in srgb, var(--theme-text) 22%, transparent);
}

.tournament-match-actions {
  align-items: center;
  justify-content: flex-end;
  min-width: 9rem;
}

@media (max-width: 760px) {
  .tournament-match-main,
  .tournament-match-teams {
    grid-template-columns: 1fr;
  }

  .tournament-match-vs {
    justify-self: start;
  }

  .tournament-match-actions {
    justify-content: stretch;
    min-width: 0;
  }

  .tournament-match-actions .button,
  .tournament-match-actions .btn {
    width: 100%;
  }
}

.tournament-report-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(5.5rem, 1fr)) auto repeat(2, minmax(5.5rem, 1fr)) auto;
  gap: .65rem;
  align-items: end;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed color-mix(in srgb, var(--theme-text) 18%, transparent);
}

.tournament-report-form label {
  display: grid;
  gap: .3rem;
  min-width: 0;
}

.tournament-report-form label span {
  color: var(--theme-muted);
  font-family: var(--font-mono, monospace);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tournament-report-form input[type="number"] {
  text-align: center;
  font-weight: 800;
}

.tournament-report-divider {
  width: 1px;
  align-self: stretch;
  background: color-mix(in srgb, var(--theme-primary) 25%, transparent);
  margin: 0 .1rem;
}

.tournament-report-save {
  min-height: 2.75rem;
}

@media (max-width: 760px) {
  .tournament-report-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tournament-report-divider {
    width: 100%;
    height: 1px;
    grid-column: 1 / -1;
    margin: .15rem 0;
  }

  .tournament-report-save {
    grid-column: 1 / -1;
  }
}

.training-center-grid {
  display: grid;
  grid-template-columns: minmax(18rem, .9fr) minmax(0, 1.1fr);
  gap: 1.25rem;
  align-items: start;
}

.training-mode-panel {
  position: sticky;
  top: 1rem;
}

.training-mode-card {
  display: grid;
  gap: 1rem;
  border-radius: 1.25rem;
  padding: 1rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--theme-primary) 9%, transparent), color-mix(in srgb, var(--theme-surface) 86%, transparent));
  border: 1px solid color-mix(in srgb, var(--theme-primary) 24%, transparent);
}

.training-mode-card + .training-mode-card {
  margin-top: .75rem;
}

.training-mode-copy {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: .9rem;
  align-items: start;
}

.training-mode-icon {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 1rem;
  background: color-mix(in srgb, var(--theme-primary) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--theme-primary) 36%, transparent);
  color: var(--theme-primary);
  font-size: 1.6rem;
  font-weight: 900;
}

.training-mode-targets {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding-top: .85rem;
  border-top: 1px dashed color-mix(in srgb, var(--theme-text) 16%, transparent);
}

.training-mode-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.training-active-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 1rem;
  align-items: center;
  border-radius: 1rem;
  padding: 1rem;
  background: color-mix(in srgb, var(--theme-primary) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--theme-primary) 28%, transparent);
}

.training-active-target {
  min-width: 4rem;
  text-align: center;
  border-radius: .9rem;
  padding: .65rem .8rem;
  background: var(--theme-primary);
  color: var(--theme-bg);
  font-size: 1.45rem;
  font-weight: 900;
}

.training-history-list {
  display: grid;
  gap: .75rem;
}

.training-history-card {
  display: grid;
  gap: .8rem;
  border-radius: 1rem;
  padding: 1rem;
  background: color-mix(in srgb, var(--theme-surface) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--theme-text) 12%, transparent);
}

.training-history-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid color-mix(in srgb, var(--theme-text) 11%, transparent);
}

.training-history-main strong {
  color: var(--theme-text);
}

.training-history-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
}

.training-history-stats div {
  display: grid;
  gap: .2rem;
}

.training-history-stats span {
  color: var(--theme-muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.training-history-stats strong {
  color: var(--theme-text);
  font-size: 1rem;
}

@media (max-width: 960px) {
  .training-center-grid {
    grid-template-columns: 1fr;
  }

  .training-mode-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .training-mode-copy,
  .training-active-card,
  .training-history-stats {
    grid-template-columns: 1fr;
  }

  .training-mode-actions,
  .training-history-main {
    align-items: stretch;
    flex-direction: column;
  }

  .training-active-target {
    justify-self: start;
  }
}

.training-clean-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 0.75fr) minmax(0, 1.25fr);
  gap: 2rem;
  align-items: start;
}

.training-clean-section {
  min-width: 0;
}

.training-clean-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--theme-text) 14%, transparent);
}

.training-clean-list {
  display: grid;
  gap: 0;
  border-top: 1px solid color-mix(in srgb, var(--theme-text) 10%, transparent);
}

.training-clean-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--theme-text) 10%, transparent);
}

.training-clean-row.is-active-session {
  border-left: 3px solid var(--theme-primary);
  padding-left: .9rem;
}

.training-clean-row-main h3 {
  margin: 0 0 .25rem;
  color: var(--theme-text);
  font-size: 1.1rem;
  font-weight: 800;
}

.training-clean-row-main p {
  margin: 0;
  color: var(--theme-muted);
  line-height: 1.45;
}

.training-clean-table-wrap {
  border-top: 1px solid color-mix(in srgb, var(--theme-text) 14%, transparent);
}

.training-clean-table {
  background: transparent;
}

.training-clean-table th {
  color: var(--theme-muted);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.training-clean-table td,
.training-clean-table th {
  border-color: color-mix(in srgb, var(--theme-text) 10%, transparent);
  vertical-align: middle;
}

@media (max-width: 860px) {
  .training-clean-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .training-clean-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

.training-clean-table th,
.training-clean-table td {
  padding-left: 1.15rem;
  padding-right: 1.15rem;
}

.training-clean-table th:first-child,
.training-clean-table td:first-child {
  padding-left: 0;
}

.training-clean-table th:last-child,
.training-clean-table td:last-child {
  padding-right: 0;
}

.training-stats-list {
  display: grid;
  gap: 0;
  border-top: 1px solid color-mix(in srgb, var(--theme-text) 10%, transparent);
}

.training-stats-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(5.5rem, .75fr));
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--theme-text) 10%, transparent);
}

.training-stats-row > div {
  display: grid;
  gap: .2rem;
}

.training-stats-row span,
.training-stats-row small {
  color: var(--theme-muted);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.training-stats-row strong {
  color: var(--theme-text);
}

.training-trend.is-improved strong,
.training-trend.is-improved small {
  color: var(--theme-success);
}

.training-trend.is-declined strong,
.training-trend.is-declined small {
  color: var(--theme-danger);
}

@media (max-width: 700px) {
  .training-stats-row {
    grid-template-columns: 1fr 1fr;
  }
}

.training-history-header {
  align-items: flex-end;
}

.training-history-filter {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: end;
  justify-content: flex-end;
}

.training-history-filter label {
  display: grid;
  gap: .25rem;
}

.training-history-filter label span {
  color: var(--theme-muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.training-history-filter select {
  min-height: 2.5rem;
  min-width: 8rem;
}

@media (max-width: 700px) {
  .training-history-header,
  .training-history-filter {
    align-items: stretch;
    flex-direction: column;
  }
}

.training-checkout-suggestion {
  display: grid;
  gap: .35rem;
  border-radius: 1rem;
  padding: 1rem;
  background: color-mix(in srgb, var(--theme-primary) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--theme-primary) 28%, transparent);
}

.training-checkout-suggestion span {
  color: var(--theme-muted);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.training-checkout-suggestion strong {
  color: var(--theme-text);
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.training-abandon-row {
  gap: .75rem;
}

.training-mode-picker {
  display: grid;
  gap: .35rem;
}

.training-mode-select-row {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1.15rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--theme-text) 11%, transparent);
}

.training-mode-select-row:first-child {
  border-top: 1px solid color-mix(in srgb, var(--theme-text) 11%, transparent);
}

.training-mode-select-row:hover {
  background: linear-gradient(90deg, color-mix(in srgb, var(--theme-primary) 7%, transparent), transparent 70%);
}

.training-mode-number {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--theme-primary) 28%, transparent);
  color: var(--theme-primary);
  font-weight: 900;
  font-size: .82rem;
}

.training-mode-select-main {
  display: grid;
  gap: .4rem;
  min-width: 0;
}

.training-mode-title-line {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
}

.training-mode-title-line h3 {
  margin: 0;
  color: var(--theme-text);
  font-size: 1.12rem;
  font-weight: 900;
}

.training-mode-select-main p {
  margin: 0;
  color: var(--theme-muted);
  line-height: 1.45;
}

.training-mode-tag {
  border-radius: 999px;
  padding: .18rem .5rem;
  background: color-mix(in srgb, var(--theme-primary) 12%, transparent);
  color: var(--theme-muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.training-mode-mini-route {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  color: var(--theme-muted);
  font-size: .78rem;
}

.training-mode-mini-route span:not(:nth-child(even)) {
  border-radius: .5rem;
  padding: .15rem .4rem;
  background: color-mix(in srgb, var(--theme-text) 6%, transparent);
}

.training-mode-start {
  min-width: 5.5rem;
}

@media (max-width: 620px) {
  .training-mode-select-row {
    grid-template-columns: 2.7rem minmax(0, 1fr);
  }

  .training-mode-select-row .button_to {
    grid-column: 2;
  }

  .training-mode-start {
    width: 100%;
  }
}

/* Clean replacement for the training mode picker. Keep it intentionally simple. */
.training-mode-simple-list {
  display: grid;
  gap: 0;
  border-top: 1px solid color-mix(in srgb, var(--theme-text) 12%, transparent);
}

.training-mode-simple-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: center;
  padding: 1.1rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--theme-text) 12%, transparent);
}

.training-mode-simple-row h3 {
  margin: 0 0 .3rem;
  color: var(--theme-text);
  font-size: 1.08rem;
  font-weight: 800;
}

.training-mode-simple-row p {
  margin: 0;
  color: var(--theme-muted);
  line-height: 1.45;
}

@media (max-width: 560px) {
  .training-mode-simple-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

/* Stats page readability refinements */
.stats-filter-card {
  background: color-mix(in srgb, var(--theme-surface) 82%, var(--theme-bg)) !important;
  border: 1px solid var(--theme-line) !important;
  border-radius: 1.25rem !important;
  padding: clamp(1rem, 3vw, 1.5rem) !important;
}

.stats-filter-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.stats-filter-grid label {
  display: grid;
  gap: 0.45rem;
}

.stats-filter-grid .is-flex {
  align-items: end !important;
}

.stats-filter-grid .theme-btn-primary {
  width: 100%;
  min-height: 3.15rem;
}

.stats-summary-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
}

.stats-metric-card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--theme-surface-alt) 78%, transparent), color-mix(in srgb, var(--theme-surface-muted) 88%, transparent));
  border: 1px solid var(--theme-line);
  border-radius: 1.1rem;
  min-height: 7.5rem;
  padding: 1rem;
}

.stats-metric-label,
.stats-chart-title {
  color: var(--theme-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.25;
  text-transform: uppercase;
}

.stats-metric-value {
  color: var(--theme-text);
  display: block;
  font-size: clamp(1.9rem, 5vw, 3.15rem);
  line-height: 1;
  margin-top: 0.75rem;
}

.stats-charts-card {
  background: color-mix(in srgb, var(--theme-surface) 84%, var(--theme-bg)) !important;
  border: 1px solid var(--theme-line) !important;
  border-radius: 1.25rem !important;
  padding: clamp(1rem, 3vw, 1.5rem) !important;
}

.stats-chart-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.stats-chart-panel {
  background: color-mix(in srgb, var(--theme-bg) 26%, transparent);
  border: 1px solid var(--theme-line);
  border-radius: 1rem;
  padding: 1rem;
}

.stats-chart-title {
  color: var(--theme-primary-soft);
  margin-bottom: 0.8rem;
}

.stats-chart-row {
  align-items: baseline;
  border-top: 1px solid var(--theme-line);
  color: var(--theme-muted);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.75rem 0 0.45rem;
}

.stats-chart-row strong {
  color: var(--theme-text);
  font-size: 1.1rem;
}

.stats-progress {
  height: 0.5rem;
  background: color-mix(in srgb, var(--theme-bg) 70%, var(--theme-surface-muted));
}

.stats-progress span {
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-primary-soft));
}

.advanced-stats-list {
  display: grid;
  gap: 0.65rem;
}

.advanced-stats-list > div {
  align-items: center;
  border-bottom: 1px solid var(--theme-line);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding-bottom: 0.65rem;
}

.advanced-stats-list dt { color: var(--theme-subtle); }
.advanced-stats-list dd { margin: 0; text-align: right; }
.stats-accessible-table { margin-top: 1rem; }

@media (max-width: 640px) {
  .stats-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-metric-card {
    min-height: 6.5rem;
    padding: 1rem;
  }

  .stats-metric-value {
    font-size: clamp(1.65rem, 10vw, 2.5rem);
  }
}

/* Shared line-based page style for match-adjacent tools: stats, training, dart setup. */
.unified-tool-page .theme-hero,
.unified-tool-page .theme-card,
.unified-tool-page .training-clean-section {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  border-top: 2px solid var(--theme-line) !important;
  box-shadow: none !important;
  padding: clamp(1rem, 3.5vw, 2rem) 0 !important;
}

.unified-tool-page > .theme-hero:first-child,
.unified-tool-page > .theme-card:first-child,
.unified-tool-page > .training-clean-section:first-child {
  border-top: 0 !important;
  padding-top: 0 !important;
}

.unified-tool-page .stats-filter-grid,
.unified-tool-page .stats-summary-grid,
.unified-tool-page .stats-chart-grid,
.unified-tool-page .training-clean-layout {
  gap: clamp(1rem, 3vw, 2rem);
}

.unified-tool-page .stats-metric-card,
.unified-tool-page .stats-chart-panel,
.unified-tool-page .dart-setup-stats-card {
  background: transparent !important;
  border: 0 !important;
  border-top: 2px solid var(--theme-line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 1rem 0 !important;
}

.unified-tool-page .current-dart-setup-card {
  background: color-mix(in srgb, var(--theme-primary) 7%, transparent) !important;
  border-color: color-mix(in srgb, var(--theme-primary) 40%, var(--theme-line)) !important;
  box-shadow: none !important;
}

.unified-tool-page .training-clean-header,
.unified-tool-page .stats-chart-row,
.unified-tool-page .compact-stat,
.unified-tool-page .dart-setup-section,
.unified-tool-page .training-mode-simple-list,
.unified-tool-page .training-clean-list,
.unified-tool-page .training-clean-table-wrap {
  border-color: var(--theme-line) !important;
}

.training-mode-config {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: flex-end;
}

.training-mode-config .input { max-width: 9rem; }

@media (max-width: 640px) {
  .training-mode-simple-row { align-items: stretch; flex-direction: column; }
  .training-mode-config { justify-content: stretch; }
  .training-mode-config .input, .training-mode-config .button { max-width: none; width: 100%; }

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

  .unified-tool-page .current-dart-setup-card {
    align-items: stretch;
    flex-direction: column;
  }
}
