:root {
  color-scheme: light dark;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.4;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-border: #d7deed;
  --primary: #2455f5;
  --primary-dark: #1840c4;
  --text: #172036;
  --text-muted: #596080;
  --muted: var(--text-muted);
  --success: #1f9d55;
  --danger: #e53e3e;
  --accent: #f5ca34;
}

body.theme-light {
  color-scheme: light;
}

body.theme-dark {
  color-scheme: dark;
  --bg: #0b1220;
  --surface: #111c2f;
  --surface-border: rgba(148, 163, 184, 0.3);
  --primary: #4f83ff;
  --primary-dark: #345de6;
  --text: #f6f8ff;
  --text-muted: #a5b4d5;
  --muted: var(--text-muted);
  --success: #34d399;
  --danger: #f87171;
  --accent: #facc15;
}

body.theme-dark .card {
  box-shadow: 0 16px 38px rgba(3, 7, 18, 0.55);
}

body.theme-dark .app-footer {
  border-top-color: rgba(148, 163, 184, 0.35);
  color: rgba(226, 232, 240, 0.72);
}

body.theme-dark .tagline {
  color: rgba(226, 232, 240, 0.75);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header,
.app-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--surface-border);
}

.app-header {
  position: relative;
  isolation: isolate;
  padding: 3.5rem 1rem 2.75rem;
  color: #fff;
  background: linear-gradient(135deg,
      rgba(15, 22, 40, 0.7),
    rgba(36, 85, 245, 0.5)),
    url("image.png") center/cover no-repeat;
  border-bottom: none;
  box-shadow: 0 18px 40px rgba(23, 32, 54, 0.18);
  z-index: 20;
}

.app-header>* {
  position: relative;
  z-index: 1;
}

.app-footer {
  border-top: 1px solid var(--surface-border);
  border-bottom: none;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.app-main {
  width: min(1100px, 95vw);
  margin: 1.5rem auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

body.layout-desktop .app-main {
  width: min(1600px, 98vw);
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

body.layout-desktop.play-view .app-main,
body.play-view.layout-desktop .app-main {
  grid-template-columns: minmax(0, 62%) minmax(0, 38%);
}

body.layout-mobile .app-main {
  width: min(640px, 96vw);
  grid-template-columns: 1fr;
}

body.layout-mobile.play-view .app-main,
body.play-view.layout-mobile .app-main {
  grid-template-columns: 1fr;
}

body.layout-mobile.play-view .scoreboard,
body.play-view.layout-mobile .scoreboard {
  grid-column: 1;
}

body.layout-mobile.play-view .scoreboard-detail,
body.play-view.layout-mobile .scoreboard-detail {
  grid-column: 1;
  grid-row: auto;
  margin-top: 1rem;
}

body.layout-mobile.play-view .voice-console,
body.play-view.layout-mobile .voice-console {
  grid-column: 1;
}

body.layout-mobile .card {
  padding: 1rem;
}

body.layout-mobile .scoreboard-grid {
  grid-template-columns: 1fr;
}

body.layout-mobile .profile-list {
  grid-template-columns: 1fr;
}

body.layout-desktop .profile-list {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

body.layout-mobile .profile-card {
  flex-direction: column;
}

body.layout-mobile .profile-card img,
body.layout-mobile .profile-card .profile-avatar-fallback {
  width: 56px;
  height: 56px;
}

body.layout-mobile .view-toggle,
body.layout-mobile .layout-toggle {
  width: 100%;
  flex-wrap: wrap;
  justify-content: flex-start;
  overflow-x: auto;
}

body.layout-mobile .view-toggle-btn,
body.layout-mobile .layout-toggle-btn {
  flex: 1 1 calc(50% - 0.4rem);
  text-align: center;
}

body.layout-mobile .scoreboard-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.play-view .app-main,
body.play-view .app-main {
  width: min(1500px, 98vw);
  grid-template-columns: minmax(0, 58%) minmax(0, 42%);
  gap: 1.5rem;
  align-items: start;
}

.play-view .setup-card,
body.play-view .setup-card {
  display: none;
}

.play-view .active-player-banner,
body.play-view .active-player-banner {
  display: block;
}

.play-view .scoreboard,
body.play-view .scoreboard {
  order: 1;
  grid-column: 1 / 2;
  height: 100%;
}

.play-view .scoreboard-detail,
body.play-view .scoreboard-detail {
  order: 1;
  grid-column: 2 / 3;
  grid-row: 1;
  align-self: stretch;
  margin-top: 0;
  align-items: center;
}

.play-view .voice-console,
body.play-view .voice-console {
  order: 2;
  grid-column: 1 / span 2;
}

.training-view .app-main,
body.training-view .app-main {
  width: min(900px, 96vw);
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.training-view .card:not(.training-card),
body.training-view .card:not(.training-card) {
  display: none;
}

.training-view .training-card,
body.training-view .training-card {
  display: block;
}

.training-view .voice-console,
body.training-view .voice-console {
  display: none;
}

.camera-card {
  display: none;
}

.camera-card[hidden] {
  display: none !important;
}

.camera-view .app-main,
body.camera-view .app-main {
  width: min(1100px, 96vw);
  grid-template-columns: 1fr;
}

.camera-view .card:not(.camera-card),
body.camera-view .card:not(.camera-card) {
  display: none;
}

.camera-view .camera-card,
body.camera-view .camera-card {
  display: block;
}

.tournament-card {
  display: none;
}

.tournament-view .tournament-card,
body.tournament-view .tournament-card {
  display: block;
  grid-column: span 2;
}

.tournament-view .setup-card,
.tournament-view .scoreboard,
.tournament-view .scoreboard-detail,
.tournament-view .voice-console,
.tournament-view .history,
.tournament-view .profile-manager,
.tournament-view .leaderboard-card,
body.tournament-view .setup-card,
body.tournament-view .scoreboard,
body.tournament-view .scoreboard-detail,
body.tournament-view .voice-console,
body.tournament-view .history,
body.tournament-view .profile-manager,
body.tournament-view .leaderboard-card {
  display: none;
}

.tournament-view .app-main,
body.tournament-view .app-main {
  width: min(1200px, 96vw);
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.play-view .scoreboard-grid,
body.play-view .scoreboard-grid {
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.play-view .player-card,
body.play-view .player-card {
  padding: 1.5rem;
  gap: 0.8rem;
}

.play-view .player-card header,
body.play-view .player-card header {
  font-size: 1.05rem;
}

.play-view .player-stats,
body.play-view .player-stats {
  gap: 2.25rem;
}

.play-view .player-stats dd,
body.play-view .player-stats dd {
  font-size: 2.3rem;
}

.play-view .dart-picker,
body.play-view .dart-picker {
  padding: 0.75rem;
}

.play-view .dart-mode-switch,
body.play-view .dart-mode-switch {
  align-self: stretch;
  justify-content: space-between;
}

.play-view .dart-combos,
body.play-view .dart-combos {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.play-view .combo-button,
body.play-view .combo-button {
  font-size: 1.05rem;
  padding: 0.8rem 0.6rem;
}

.profile-manager {
  display: none;
}

.profiles-view .app-main,
body.profiles-view .app-main {
  width: min(900px, 94vw);
  grid-template-columns: 1fr;
}

.profiles-view .setup-card,
.profiles-view .scoreboard,
.profiles-view .scoreboard-detail,
.profiles-view .voice-console,
.profiles-view .history {
  display: none;
}

.profiles-view .profile-manager,
body.profiles-view .profile-manager {
  display: block;
  grid-column: 1 / -1;
}

.leaderboard-card {
  display: none;
}

.leaderboard-view .app-main,
body.leaderboard-view .app-main {
  width: min(900px, 94vw);
  grid-template-columns: 1fr;
}

.leaderboard-view .setup-card,
.leaderboard-view .scoreboard,
.leaderboard-view .scoreboard-detail,
.leaderboard-view .voice-console,
.leaderboard-view .history,
.leaderboard-view .profile-manager {
  display: none;
}

.leaderboard-view .leaderboard-card,
body.leaderboard-view .leaderboard-card {
  display: block;
  grid-column: 1 / -1;
}

.leaderboard-controls {
  display: inline-flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.leaderboard-sort-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.leaderboard-sort-btn.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.leaderboard-table-wrapper {
  position: relative;
  overflow-x: auto;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1020px;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.leaderboard-table tbody tr:nth-child(odd) {
  background: rgba(36, 85, 245, 0.05);
}

.leaderboard-table tbody tr:first-child td {
  font-weight: 700;
}

@media (max-width: 960px) {
  .leaderboard-table-wrapper {
    overflow: visible;
  }

  .leaderboard-table {
    min-width: 0;
  }

  .leaderboard-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }

  .leaderboard-table,
  .leaderboard-table tbody,
  .leaderboard-table tr,
  .leaderboard-table td {
    display: block;
    width: 100%;
  }

  .leaderboard-table tbody tr {
    margin-bottom: 1rem;
    border: 1px solid var(--surface-border);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    background: rgba(36, 85, 245, 0.04);
    box-shadow: 0 10px 22px rgba(7, 11, 26, 0.12);
  }

  .leaderboard-table td {
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--surface-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .leaderboard-table td:last-child {
    border-bottom: none;
  }

  .leaderboard-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    flex: 1 1 45%;
  }

  .leaderboard-table td[data-label="Spieler"] {
    display: block;
    border-bottom: 1px solid var(--surface-border);
    padding-top: 0;
    padding-bottom: 0.75rem;
  }

  .leaderboard-table td[data-label="Spieler"]::before {
    display: none;
  }

  .leaderboard-player-cell {
    width: 100%;
  }

  .leaderboard-table td[data-label="Platz"]::before {
    flex: 0 0 auto;
    min-width: 70px;
  }

  .leaderboard-table td[data-label="Spiele"] {
    border-bottom: none;
  }
}

.leaderboard-player-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.leaderboard-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(36, 85, 245, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-weight: 700;
  color: var(--primary);
}

.leaderboard-avatar.has-photo {
  background: transparent;
}

.leaderboard-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.leaderboard-avatar-fallback {
  text-transform: uppercase;
}

.leaderboard-player-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.leaderboard-player-name {
  font-weight: 600;
  color: var(--text);
}

.leaderboard-player-full {
  font-size: 0.85rem;
  color: var(--muted);
}

.leaderboard-empty {
  margin-top: 1rem;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgba(23, 32, 54, 0.08);
}

h1,
h2,
h3 {
  margin: 0 0 0.75rem;
  color: var(--text);
}

.app-header h1 {
  color: #fff;
}

.tagline {
  margin: 0;
  color: var(--text-muted);
}

.app-header .tagline {
  color: rgba(255, 255, 255, 0.85);
}

.main-menu-bar {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  position: relative;
}

.main-menu-trigger {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 18, 35, 0.4);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.main-menu-trigger:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.65);
}

.main-menu-trigger .burger-line {
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

body.main-menu-open .main-menu-trigger .burger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

body.main-menu-open .main-menu-trigger .burger-line:nth-child(2) {
  opacity: 0;
}

body.main-menu-open .main-menu-trigger .burger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.main-menu {
  position: absolute;
  top: calc(100% + 0.75rem);
  left: 50%;
  width: min(420px, 88vw);
  padding: 1.4rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(circle at top, rgba(63, 76, 119, 0.55), rgba(32, 40, 72, 0.9));
  box-shadow: 0 28px 55px rgba(3, 7, 18, 0.55);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px) scale(0.96);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 25;
}

body.main-menu-open .main-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

body.main-menu-open {
  overflow: hidden;
}

body.main-menu-open::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(5, 9, 20, 0.55);
  z-index: 15;
}

.main-menu-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.main-menu-section + .main-menu-section {
  padding-top: 0.85rem;
  border-top: 1px solid var(--surface-border);
}

.main-menu-label {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.theme-toggle {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.85rem 0.45rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 18, 35, 0.45);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: rgba(255, 255, 255, 0.45);
  outline: none;
}

.theme-toggle-track {
  position: relative;
  width: 46px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  transition: background 0.2s ease;
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.35);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.theme-toggle-label {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
}

.theme-toggle-label::before {
  content: "🌙";
  font-size: 1.05rem;
}

.theme-toggle-description {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.02em;
}

.theme-toggle:focus-visible .theme-toggle-track {
  box-shadow: 0 0 0 3px rgba(79, 129, 255, 0.35);
}

body.theme-dark .theme-toggle {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.65);
  color: #e2e8f0;
}

body.theme-dark .theme-toggle:hover,
body.theme-dark .theme-toggle:focus-visible {
  border-color: rgba(226, 232, 240, 0.6);
}

body.theme-dark .theme-toggle-track {
  background: rgba(148, 163, 184, 0.3);
}

body.theme-dark .theme-toggle-thumb {
  transform: translateX(22px);
  background: #0f172a;
  box-shadow: 0 6px 16px rgba(2, 6, 23, 0.55);
}

body.theme-dark .theme-toggle-label::before {
  content: "☀️";
}

body.theme-dark .theme-toggle-description {
  color: rgba(226, 232, 240, 0.65);
}

body.theme-dark .main-menu-section + .main-menu-section {
  border-top-color: rgba(148, 163, 184, 0.35);
}

body.theme-dark .main-menu .view-toggle-btn,
body.theme-dark .main-menu .layout-toggle-btn {
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.55);
  color: rgba(226, 232, 240, 0.9);
  box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.25);
}

body.theme-dark .main-menu .view-toggle-btn.active,
body.theme-dark .main-menu .layout-toggle-btn.active {
  background: linear-gradient(120deg, rgba(79, 129, 255, 0.9), rgba(14, 165, 233, 0.85));
  border-color: rgba(129, 178, 255, 0.7);
  color: #0b1220;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.55);
}

.view-toggle,
.layout-toggle {
  display: inline-flex;
  gap: 0.5rem;
  margin-top: 1rem;
  background: rgba(36, 85, 245, 0.08);
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid rgba(36, 85, 245, 0.2);
}

.layout-toggle {
  margin-top: 0.65rem;
}

.main-menu .view-toggle,
.main-menu .layout-toggle {
  width: 100%;
  margin-top: 0;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.45rem;
  background: transparent;
  border: none;
}

.main-menu .view-toggle-btn,
.main-menu .layout-toggle-btn {
  width: 100%;
  text-align: center;
  white-space: normal;
  line-height: 1.35;
  padding: 0.65rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
}

.app-header .view-toggle,
.app-header .layout-toggle {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(2px);
}

.view-toggle-btn,
.layout-toggle-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.view-toggle-btn:hover,
.layout-toggle-btn:hover {
  color: var(--text);
}

.view-toggle-btn.active,
.layout-toggle-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 20px rgba(36, 85, 245, 0.25);
}

.main-menu .view-toggle-btn.active,
.main-menu .layout-toggle-btn.active {
  background: linear-gradient(120deg, rgba(59, 130, 246, 0.85), rgba(14, 165, 233, 0.8));
  border-color: rgba(125, 211, 252, 0.6);
  color: #f8fbff;
  box-shadow: 0 10px 25px rgba(14, 165, 233, 0.35);
}

.app-header .view-toggle-btn,
.app-header .layout-toggle-btn {
  color: rgba(255, 255, 255, 0.8);
}

.app-header .view-toggle-btn:hover,
.app-header .layout-toggle-btn:hover {
  color: #fff;
}

.app-header .view-toggle-btn.active,
.app-header .layout-toggle-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 14px 28px rgba(17, 24, 39, 0.25);
}

.setup-form {
  display: grid;
  gap: 0.75rem;
}

.form-divider {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.form-row.optional label {
  color: var(--text-muted);
  font-weight: 500;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-row input,
.form-row select {
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--surface-border);
  font-size: 1rem;
}

.game-meta {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.active-player-banner {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  display: none;
}

.active-player-banner:empty {
  display: none !important;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tournament-intro {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.tournament-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tournament-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem 1rem;
}

.tournament-player-row {
  gap: 0.35rem;
}

.tournament-player-fields {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tournament-player-fields input {
  flex: 1 1 auto;
  min-width: 140px;
}

.tournament-player-fields select {
  flex: 0 1 45%;
  min-width: 130px;
}

.tournament-grid .form-row {
  margin: 0;
}

.tournament-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.tournament-actions {
  justify-content: flex-start;
}

.tournament-status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  font-weight: 600;
  color: var(--text);
  background: rgba(36, 85, 245, 0.07);
}

.tournament-status[data-state="idle"] {
  background: rgba(89, 96, 128, 0.08);
  color: var(--text-muted);
}

.tournament-status[data-state="pending"] {
  border-color: rgba(36, 85, 245, 0.4);
  color: var(--primary);
}

.tournament-status[data-state="in-progress"] {
  background: rgba(36, 85, 245, 0.12);
  border-color: var(--primary);
  color: var(--primary);
}

.tournament-status[data-state="error"] {
  background: rgba(229, 62, 62, 0.12);
  border-color: var(--danger);
  color: var(--danger);
}

.tournament-status[data-state="complete"] {
  background: rgba(31, 157, 85, 0.12);
  border-color: var(--success);
  color: var(--success);
}

.tournament-bracket-wrapper {
  margin-top: 1.5rem;
}

.tournament-bracket {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}

.tournament-round {
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  background: var(--surface);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 10px 24px rgba(23, 32, 54, 0.05);
}

.tournament-round-title {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.tournament-match-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tournament-match {
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 0.75rem;
  background: rgba(245, 247, 251, 0.8);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tournament-match-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.tournament-match.in-progress {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(36, 85, 245, 0.12);
}

.tournament-match.completed {
  border-color: var(--success);
  background: rgba(31, 157, 85, 0.08);
}

.tournament-match.auto-advanced {
  border-style: dashed;
}

.tournament-match.empty {
  color: var(--text-muted);
  font-style: italic;
}

.tournament-player-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 600;
}

.tournament-player-slot span {
  display: inline-block;
}

.tournament-player-slot .seed {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tournament-player-slot.empty {
  font-weight: 400;
  color: var(--text-muted);
  font-style: italic;
}

.tournament-player-slot.winner {
  color: var(--success);
}

.tournament-match-status {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.tournament-empty {
  margin: 0;
  padding: 1rem;
  border: 1px dashed var(--surface-border);
  border-radius: 10px;
  text-align: center;
  color: var(--text-muted);
  background: rgba(245, 247, 251, 0.45);
}

button {
  cursor: pointer;
  border-radius: 999px;
  border: none;
  font-size: 0.95rem;
  padding: 0.6rem 1.6rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

button.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(36, 85, 245, 0.25);
}

button.primary:hover {
  background: var(--primary-dark);
}

button.ghost {
  background: transparent;
  border: 1px solid var(--surface-border);
  color: var(--text);
}

.scoreboard-grid {
  display: grid;
  gap: 0.75rem;
}

.scoreboard-detail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
  align-items: stretch;
}

.scoreboard-detail > .card {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
}

.scoreboard-detail .history {
  display: flex;
  flex-direction: column;
}

.scoreboard-detail .history-log {
  flex: 1 1 auto;
  overflow-y: auto;
}

@media (max-width: 1100px) {
  .play-view .app-main,
  body.play-view .app-main {
    grid-template-columns: 1fr;
  }

  .play-view .scoreboard,
  body.play-view .scoreboard {
    grid-column: 1;
  }

  .play-view .scoreboard-detail,
  body.play-view .scoreboard-detail {
    grid-column: 1;
    grid-row: auto;
    margin-top: 1rem;
  }

  .play-view .voice-console,
  body.play-view .voice-console {
    grid-column: 1;
  }

  .dartboard-picker {
    width: 100%;
    max-width: 460px;
  }
}

@media (max-width: 900px) {
  .app-main {
    width: min(760px, 95vw);
    grid-template-columns: 1fr;
  }

  .app-header {
    padding: 3rem 1rem 2.25rem;
  }

  .card {
    padding: 1.1rem;
  }

  .view-toggle,
  .layout-toggle {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }

  .view-toggle-btn,
  .layout-toggle-btn {
    flex: 1 1 calc(50% - 0.5rem);
    text-align: center;
  }

  .profile-list {
    grid-template-columns: 1fr;
  }

  .scoreboard-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .app-header {
    padding: 2.6rem 0.75rem 1.75rem;
  }

  .main-menu {
    left: 0.5rem;
    right: 0.5rem;
    transform: translate(0, -8px) scale(0.96);
    width: auto;
  }

  body.main-menu-open .main-menu {
    transform: translate(0, 0) scale(1);
  }

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

  .player-card {
    padding: 0.85rem;
  }

  .player-stats {
    gap: 0.75rem;
  }

  .view-toggle,
  .layout-toggle {
    justify-content: flex-start;
  }

  .view-toggle-btn,
  .layout-toggle-btn {
    flex: 1 1 100%;
  }

  .profile-card {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .app-header h1 {
    font-size: 1.85rem;
  }

  .scoreboard-undo {
    width: 100%;
    text-align: center;
  }

  .player-stats dd {
    font-size: 1.35rem;
  }

  .player-last,
  .player-checkout-wrapper dd {
    font-size: 1.05rem;
  }

  .manual-actions button {
    width: 100%;
  }
}

.scoreboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.scoreboard-header h2 {
  margin: 0;
}

.scoreboard-actions {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.scoreboard-rematch {
  background: transparent;
  border: 1px solid var(--surface-border);
  color: var(--text);
  border-radius: 999px;
  font-weight: 600;
  padding: 0.5rem 1.2rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.scoreboard-rematch:hover:not(:disabled) {
  background: rgba(36, 85, 245, 0.08);
  border-color: rgba(36, 85, 245, 0.35);
  color: var(--primary);
}

.scoreboard-rematch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.scoreboard-undo {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-weight: 600;
  padding: 0.55rem 1.2rem;
  box-shadow: 0 8px 20px rgba(36, 85, 245, 0.2);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.scoreboard-undo:hover {
  background: var(--primary-dark);
  box-shadow: 0 12px 24px rgba(36, 85, 245, 0.25);
}

.scoreboard-undo:active {
  transform: translateY(1px);
}

.scoreboard-undo:focus-visible {
  outline: 3px solid rgba(36, 85, 245, 0.45);
  outline-offset: 3px;
}

.player-card {
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(36, 85, 245, 0.05), rgba(36, 85, 245, 0));
  border: 1px solid rgba(36, 85, 245, 0.15);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.player-card-heatmap {
  flex: 0 0 auto;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  pointer-events: none;
}

.player-card-heatmap svg {
  width: 110px;
  height: 110px;
}

.player-card-heatmap .board-outline {
  stroke: rgba(36, 85, 245, 0.35);
}

.training-card[hidden] {
  display: none !important;
}

.training-card {
  display: none;
  flex-direction: column;
  gap: 1rem;
}

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

.training-mode-pill {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(36, 85, 245, 0.12);
  color: var(--primary);
  border: 1px solid rgba(36, 85, 245, 0.25);
}

.training-description {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

.training-mode-select {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.training-mode-select label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.training-mode-select select {
  border: 1px solid var(--surface-border);
  border-radius: 0.65rem;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
}

.training-mode-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.training-mode-controls .training-mode-select {
  flex: 1 1 220px;
}

.training-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.training-players {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.training-player {
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 1.25rem;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.training-player-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.training-player-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.training-player-config {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.training-player-config .form-row {
  margin: 0;
}

.training-player-board {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 1rem;
}

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

.training-target-panel,
.training-stats-panel {
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 1.15rem;
  background: rgba(36, 85, 245, 0.03);
}

.training-stats-panel {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.training-panel-label {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.training-target-value {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
}

.training-target-meta {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-weight: 500;
}

.training-target-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(38px, 1fr));
  gap: 0.4rem;
}

.training-target {
  border-radius: 8px;
  padding: 0.35rem 0.25rem;
  text-align: center;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
}

.training-target.completed {
  background: rgba(31, 157, 85, 0.12);
  border-color: rgba(31, 157, 85, 0.4);
  color: var(--success);
}

.training-target.active {
  background: rgba(36, 85, 245, 0.14);
  border-color: rgba(36, 85, 245, 0.4);
  color: var(--primary);
}

.training-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--surface-border);
}

.training-stat:last-child {
  border-bottom: none;
}

.training-stat-label {
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.training-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.training-hit-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.training-status-message {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.training-status-message[data-tone="success"] {
  color: var(--success);
}

.training-status-message[data-tone="warning"] {
  color: var(--accent);
}

.training-status-message[data-tone="danger"] {
  color: var(--danger);
}

.training-history,
.training-player-history {
  margin-top: 0.75rem;
}

.training-history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.training-history-list li {
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  background: var(--surface);
}

.training-history-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: 0.35rem;
}

.training-history-empty {
  text-align: center;
  font-style: italic;
  border-style: dashed;
  color: var(--text-muted);
}

.player-header-content {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-weight: 600;
}

.player-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.player-avatar-wrapper {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
}

.player-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(36, 85, 245, 0.25);
  background: rgba(36, 85, 245, 0.08);
  display: block;
}

.player-avatar[hidden] {
  display: none;
}

.player-avatar-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(36, 85, 245, 0.08);
  color: var(--primary);
  font-weight: 700;
  font-size: 1.05rem;
  border: 2px dashed rgba(36, 85, 245, 0.2);
}

.player-avatar-wrapper.has-photo .player-avatar-fallback {
  display: none;
}

.player-avatar-wrapper.has-photo .player-avatar {
  display: block;
}

.player-name-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.player-name-wrapper h3 {
  margin: 0;
}

.player-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.player-indicator {
  color: transparent;
  border-radius: 50%;
  width: 0.75rem;
  height: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-border);
}

.player-card.active .player-indicator {
  background: var(--accent);
}

.player-card.winner {
  border-color: var(--success);
  background: linear-gradient(135deg, rgba(31, 157, 85, 0.1), rgba(31, 157, 85, 0));
}

.play-view .player-card.active,
body.play-view .player-card.active {
  border-color: var(--primary);
  box-shadow: 0 14px 30px rgba(36, 85, 245, 0.2);
}

.player-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 0;
}

.player-stats>div {
  flex: 1 1 140px;
  min-width: 120px;
}

.player-stats dt {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.player-stats dd {
  margin: 0.15rem 0 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.player-last-wrapper {
  flex: 0 1 128px;
  min-width: 110px;
  margin-left: -0.65rem;
}

.player-last-wrapper dt {
  margin-left: 0;
}

.player-last {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-muted);
  white-space: normal;
  letter-spacing: 0.01em;
}

.player-checkout-wrapper dd {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-muted);
  white-space: normal;
}

.play-view .player-checkout-wrapper dd,
body.play-view .player-checkout-wrapper dd {
  font-size: 1.5rem;
}

.player-checkout[data-state="ready"] {
  color: var(--primary-dark);
}

.player-checkout[data-state="none"] {
  color: var(--text-muted);
}

.scoreboard-heatmap {
  margin-top: 0;
  padding: 1.25rem;
  border: none;
  border-radius: 12px;
  background: rgba(36, 85, 245, 0.06);
}

.scoreboard-heatmap .profile-heatmap {
  margin-top: 0;
}

.heatmap-empty {
  margin: 0;
  text-align: center;
  color: var(--text-muted);
  font-weight: 600;
}

body:not(.sets-mode) .player-sets-wrapper,
body:not(.sets-mode) .player-legs-wrapper {
  display: none;
}

.voice-console {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.voice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status {
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status.offline {
  background: var(--surface-border);
  color: var(--text-muted);
}

.status.listening {
  background: var(--primary);
  color: #fff;
}

.status.error {
  background: var(--danger);
  color: #fff;
}

.voice-tip {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.voice-controls {
  display: flex;
  gap: 0.5rem;
}

.voice-readout {
  background: rgba(36, 85, 245, 0.05);
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.95rem;
  border: 1px dashed rgba(36, 85, 245, 0.25);
}

.voice-readout strong {
  font-weight: 600;
}

.fallback-manual {
  border-top: 1px solid var(--surface-border);
  padding-top: 0.75rem;
}

.manual-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}

.manual-row label {
  justify-self: flex-start;
}

.manual-row input {
  width: 100%;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--surface-border);
}

.manual-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  width: 100%;
}

.manual-actions-primary {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.manual-actions button {
  white-space: nowrap;
}

.scoreboard-quick {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--surface-border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.scoreboard-quick h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}

.dart-combos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
}

.dart-number-order {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.dart-number-order-btn {
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: transparent;
  padding: 0.45rem 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dart-number-order-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.dart-number-order-btn:not(.active):hover {
  background: rgba(36, 85, 245, 0.08);
  border-color: rgba(36, 85, 245, 0.4);
}

.dart-number-order-btn:focus-visible {
  outline: 3px solid rgba(36, 85, 245, 0.35);
  outline-offset: 2px;
}

.dart-picker.board-mode {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dart-picker.board-mode .dartboard-picker {
  width: 100%;
  max-width: clamp(520px, 48vw, 680px);
  margin-top: 0.5rem;
}

.dart-picker.board-mode .dart-number-order {
  width: 100%;
  justify-content: center;
}

.dartboard-picker {
  position: relative;
  width: clamp(360px, 42vw, 640px);
  aspect-ratio: 1 / 1;
  margin: 0.75rem auto 0;
}

.dartboard-picker svg {
  width: 100%;
  height: 100%;
  display: block;
}

.dartboard-segment,
.dartboard-bull {
  cursor: pointer;
  transition: opacity 0.15s ease;
  stroke: #0b1220;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.dartboard-segment.single {
  stroke-width: 1;
}

.dartboard-picker [data-dart-segment]:hover {
  opacity: 0.85;
}

.dartboard-numbers {
  fill: #f3f4f6;
  font-weight: 600;
  font-size: 18px;
  text-anchor: middle;
  pointer-events: none;
}

.combo-button {
  border-radius: 10px;
  border: 1px solid rgba(36, 85, 245, 0.2);
  background: rgba(36, 85, 245, 0.08);
  color: var(--text);
  font-weight: 600;
  padding: 0.65rem 0.5rem;
  font-size: 0.95rem;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
  cursor: pointer;
}

.combo-button:hover {
  background: rgba(36, 85, 245, 0.18);
  border-color: rgba(36, 85, 245, 0.45);
}

.combo-button:active {
  transform: translateY(1px);
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.profile-image-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-image-preview img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(36, 85, 245, 0.2);
  background: rgba(36, 85, 245, 0.05);
}

.profile-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.profile-actions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.profile-actions button,
.profile-actions-inline button {
  flex: 1 1 140px;
  min-width: 120px;
}

.profile-icon-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 1.35rem;
}

.profile-icon-btn span[aria-hidden="true"] {
  line-height: 1;
}

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

.profile-data-actions {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-storage-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.profile-storage-switch label {
  font-weight: 600;
}

.profile-storage-switch select {
  min-width: 9rem;
}

.profile-storage-indicator {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.audio-controls {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.audio-controls button {
  align-self: flex-start;
}

.audio-controls-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.profile-data-status {
  min-height: 1.25rem;
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.profile-data-status.success {
  color: var(--success);
}

.profile-data-status.error {
  color: var(--danger);
}

.profile-list-container {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.profile-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.9rem;
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  background: rgba(23, 32, 54, 0.02);
  align-items: flex-start;
}

.profile-card img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(36, 85, 245, 0.15);
  background: rgba(36, 85, 245, 0.05);
}

.profile-card .profile-avatar-fallback {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
  background: rgba(36, 85, 245, 0.08);
  border: 2px dashed rgba(36, 85, 245, 0.2);
}

.profile-card .profile-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-card .profile-info h4 {
  margin: 0;
  font-size: 1rem;
}

.profile-card .profile-info span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.profile-card .profile-stats {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.profile-card .profile-stats.secondary {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.profile-card .profile-history {
  margin: 0.5rem 0 0;
  padding-left: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.profile-card .profile-history li {
  margin-bottom: 0.25rem;
}

.profile-heatmap {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: center;
}

.profile-heatmap-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.profile-dartboard {
  width: 220px;
  max-width: 100%;
  height: auto;
  display: block;
}

.profile-dartboard .board-background {
  fill: rgba(15, 23, 42, 0.6);
}

.profile-dartboard .board-outline,
.profile-dartboard path.board-segment,
.profile-dartboard .board-bull {
  stroke: rgba(15, 23, 42, 0.4);
  stroke-width: 0.6;
  paint-order: stroke;
}

.profile-dartboard path.board-segment {
  transition: fill 0.2s ease;
}

.profile-dartboard .board-bull {
  stroke-width: 0.8;
}

.profile-dartboard .board-outline {
  fill: none;
  stroke: rgba(15, 23, 42, 0.4);
  stroke-width: 1.2;
}

.heatmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  justify-content: center;
}

.heatmap-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.heatmap-legend-item.total {
  font-weight: 600;
  color: var(--text);
}

.heatmap-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.heatmap-swatch.singles {
  background: rgba(36, 85, 245, 0.7);
}

.heatmap-swatch.doubles {
  background: rgba(244, 63, 94, 0.7);
}

.heatmap-swatch.triples {
  background: rgba(16, 185, 129, 0.7);
}

.heatmap-swatch.bulls {
  background: rgba(253, 224, 71, 0.8);
  border: 1px solid rgba(15, 23, 42, 0.2);
}

.dart-mode-switch {
  display: inline-flex;
  align-self: flex-start;
  border-radius: 999px;
  border: 1px solid rgba(36, 85, 245, 0.2);
  background: rgba(36, 85, 245, 0.08);
  padding: 0.2rem;
  gap: 0.2rem;
}

.dart-mode-button {
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.dart-mode-button:hover {
  background: rgba(36, 85, 245, 0.18);
  color: var(--text);
}

.dart-mode-button.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(36, 85, 245, 0.25);
}

.dart-picker {
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 0.5rem;
  background: rgba(23, 32, 54, 0.03);
  display: grid;
  gap: 0.6rem;
}

.dart-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
}

.dart-numbers {
  grid-template-columns: repeat(3, 1fr);
}

.dart-button {
  border-radius: 8px;
  border: 1px solid rgba(36, 85, 245, 0.25);
  background: rgba(36, 85, 245, 0.08);
  color: var(--text);
  font-weight: 600;
  padding: 0.45rem 0.2rem;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
  width: 100%;
  touch-action: pan-y;
}

.dart-number {
  position: relative;
  padding-bottom: 1.85rem;
}

.dart-number::before,
.dart-number::after {
  position: absolute;
  bottom: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  opacity: 0.95;
  pointer-events: none;
  letter-spacing: 0.02em;
}

.dart-number::before {
  content: attr(data-swipe-left);
  left: 0.2rem;
}

.dart-number::after {
  content: attr(data-swipe-right);
  right: 0.2rem;
}

.dart-number .value {
  font-size: clamp(3rem, 6vw + 1rem, 4.2rem);
  font-weight: 800;
  line-height: 0.9;
}

.dart-button:hover {
  background: rgba(36, 85, 245, 0.18);
  border-color: rgba(36, 85, 245, 0.45);
}

.dart-button:active {
  transform: translateY(1px);
}

.dart-button[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

.dart-button.swipe-double,
.dart-button.swipe-triple {
  transform: translateX(var(--dart-swipe-offset, 0));
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.dart-button.swipe-preview-double {
  background: rgba(46, 204, 113, 0.22);
  border-color: rgba(46, 204, 113, 0.55);
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.2);
}

.dart-button.swipe-preview-triple {
  background: rgba(246, 173, 85, 0.22);
  border-color: rgba(246, 173, 85, 0.55);
  box-shadow: 0 0 0 3px rgba(246, 173, 85, 0.2);
}

.dart-button.swipe-double {
  background: rgba(46, 204, 113, 0.3);
  border-color: rgba(46, 204, 113, 0.65);
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.24);
}

.dart-button.swipe-triple {
  background: rgba(246, 173, 85, 0.3);
  border-color: rgba(246, 173, 85, 0.65);
  box-shadow: 0 0 0 3px rgba(246, 173, 85, 0.24);
}

.dart-bull {
  grid-template-columns: repeat(3, minmax(54px, 1fr));
}

.dart-button span {
  display: block;
  line-height: 1.1;
}

.dart-button .value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
}

.history-log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 320px;
  overflow-y: auto;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(120px, 1fr) minmax(140px, 1fr) minmax(120px, 1fr);
  gap: 0.5rem;
  padding: 0.6rem;
  border-radius: 8px;
  background: rgba(23, 32, 54, 0.05);
  align-items: center;
}

.history-item .player {
  font-weight: 600;
}

.history-item .summary {
  color: var(--text-muted);
}

.history-item .remaining {
  justify-self: end;
  font-weight: 600;
}

.history-item .leg-info {
  font-size: 0.85rem;
  color: var(--muted);
}

.history-item.bust {
  background: rgba(229, 62, 62, 0.08);
}

@media (max-width: 640px) {
  .manual-row {
    grid-template-columns: 1fr;
  }

  .history-item {
    grid-template-columns: 1fr;
  }
}
.hot-board {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hot-board.inline {
  margin: 0.75rem 0;
  padding: 0.85rem;
  background: rgba(36, 85, 245, 0.06);
  border: 1px dashed rgba(36, 85, 245, 0.25);
}

.hot-board-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.hot-board-header p {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hot-board-mode {
  display: inline-flex;
  gap: 0.4rem;
  align-self: flex-start;
  background: rgba(36, 85, 245, 0.08);
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid rgba(36, 85, 245, 0.2);
}

.hot-board-mode-btn {
  border: none;
  background: transparent;
  color: var(--text);
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.hot-board-mode-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 18px rgba(36, 85, 245, 0.25);
}

.hot-number-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-start;
}

.hot-number-button {
  flex: 1 1 240px;
  min-width: 220px;
  max-width: 320px;
  padding: 0.8rem 1.1rem;
  min-height: 90px;
  align-items: flex-start;
}

.hot-number-button .value {
  font-size: 1.35rem;
  font-weight: 800;
}

.hot-number-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Profil-Detailseite */

.profile-detail-body {
  background: var(--bg);
}

.profile-detail-shell {
  flex: 1;
  width: min(960px, 94vw);
  margin: 2.5rem auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.profile-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(23, 32, 54, 0.12);
}

.profile-back-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  background: rgba(36, 85, 245, 0.08);
  transition: background 0.2s ease, transform 0.2s ease;
}

.profile-back-link:hover {
  background: rgba(36, 85, 245, 0.16);
  transform: translateY(-1px);
}

.profile-header-text {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: right;
}

.profile-nickname-tag {
  align-self: flex-end;
  background: rgba(36, 85, 245, 0.14);
  color: var(--primary);
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.profile-detail {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.profile-loading,
.profile-error {
  padding: 1.2rem 1.6rem;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(23, 32, 54, 0.12);
  font-weight: 600;
}

.profile-error {
  color: var(--danger);
}

.profile-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-radius: 18px;
  padding: 1.75rem;
  box-shadow: 0 18px 40px rgba(23, 32, 54, 0.12);
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.profile-detail-avatar {
  width: 90px;
  height: 90px;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(23, 32, 54, 0.18);
}

.profile-detail-avatar.fallback {
  display: grid;
  place-items: center;
  background: rgba(23, 32, 54, 0.08);
  color: var(--text);
  font-size: 2rem;
  font-weight: 700;
}

.profile-identity-text h2 {
  margin: 0;
  font-size: 1.6rem;
}

.profile-full-name {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.best-set-card {
  min-width: 240px;
  background: linear-gradient(135deg, rgba(36, 85, 245, 0.1), rgba(36, 85, 245, 0.45));
  color: var(--text);
  border-radius: 18px;
  padding: 1.2rem 1.4rem;
  box-shadow: 0 16px 36px rgba(36, 85, 245, 0.22);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 320px;
}

.best-set-card.is-empty {
  background: linear-gradient(135deg, rgba(23, 32, 54, 0.08), rgba(23, 32, 54, 0.12));
  box-shadow: 0 12px 24px rgba(23, 32, 54, 0.18);
}

.best-set-label {
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(23, 32, 54, 0.75);
}

.best-set-value {
  font-size: 1.8rem;
  letter-spacing: 0.04em;
}

.best-set-score,
.best-set-meta {
  font-size: 0.95rem;
  color: rgba(23, 32, 54, 0.75);
}

.profile-section {
  background: var(--surface);
  border-radius: 18px;
  padding: 1.6rem 1.75rem;
  box-shadow: 0 18px 40px rgba(23, 32, 54, 0.08);
}

.profile-section h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.metrics-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.metric-card {
  background: rgba(23, 32, 54, 0.04);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.metric-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

.metric-value {
  font-size: 1.3rem;
}

.profile-top-hits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.top-hit-item {
  background: rgba(36, 85, 245, 0.08);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.top-hit-label {
  font-variant: tabular-nums;
}

.top-hit-value {
  color: var(--primary);
}

.profile-empty {
  margin: 0;
  color: var(--text-muted);
}

.profile-history-wrapper {
  overflow-x: auto;
}

.profile-history-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.profile-history-table th,
.profile-history-table td {
  padding: 0.75rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid rgba(23, 32, 54, 0.08);
}

.profile-history-table th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.profile-history-table tbody tr:hover {
  background: rgba(23, 32, 54, 0.04);
}

@media (max-width: 768px) {
  .profile-detail-shell {
    width: min(600px, 94vw);
    margin-top: 1.5rem;
  }

  .profile-overview {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-header-text {
    text-align: left;
  }

  .best-set-card {
    width: 100%;
    max-width: none;
  }
}

.camera-card {
  padding: 2rem;
}

.camera-header {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.camera-eyebrow {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.camera-subtitle {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  max-width: 580px;
}

.camera-header-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.camera-support-indicator {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(36, 85, 245, 0.08);
  color: var(--text);
  font-size: 0.9rem;
}

.camera-grid {
  margin-top: 1.5rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: flex-start;
}

@media (max-width: 1100px) {
  .camera-grid {
    grid-template-columns: 1fr;
  }
}

.camera-preview-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 1rem;
  --camera-calibration-zoom: 1;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(23, 32, 54, 0.12);
  min-height: 320px;
}

#camera-video,
#camera-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#camera-video {
  pointer-events: none;
}

#camera-overlay {
  pointer-events: auto;
}

.camera-overlay-hidden {
  opacity: 0;
  pointer-events: none !important;
}

.camera-preview-wrapper.has-calibration-zoom #camera-video,
.camera-preview-wrapper.has-calibration-zoom #camera-overlay {
  transform-origin: center center;
  transform: scale(var(--camera-calibration-zoom));
  transition: transform 160ms ease;
}

.camera-preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding: 1rem 1rem 2rem;
  background: transparent;
  backdrop-filter: none;
  color: #fff;
  font-weight: 600;
  gap: 0.25rem;
}

.camera-preview-controls {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.camera-auto-commit {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.camera-auto-commit input {
  width: 1rem;
  height: 1rem;
}

.camera-preview-advanced {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.camera-resolution-control {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.camera-resolution-control select {
  border: 1px solid var(--surface-border);
  border-radius: 0.5rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  min-width: 160px;
  background: var(--surface);
  color: var(--text);
}

.camera-overlay-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.camera-overlay-toggle input {
  width: 1rem;
  height: 1rem;
}

.camera-status-line {
  margin-top: 0.75rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.camera-calibration-status {
  font-weight: 600;
  color: var(--danger);
}

.camera-calibration-status.ready {
  color: var(--success);
}

.camera-log {
  margin-top: 1rem;
  background: rgba(23, 32, 54, 0.04);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  max-height: 180px;
  overflow-y: auto;
  font-size: 0.9rem;
}

.camera-log-entry {
  display: flex;
  gap: 0.4rem;
  margin: 0.2rem 0;
  align-items: baseline;
}

.camera-log-time {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.camera-log-entry[data-level="error"] span:last-child {
  color: var(--danger);
}

.camera-log-entry[data-level="success"] span:last-child {
  color: var(--success);
}

.camera-info-panel section + section {
  margin-top: 1.5rem;
}

.camera-calibration-hint {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.camera-calibration-tools {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.camera-calibration-tool {
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  background: rgba(23, 32, 54, 0.04);
  border: 1px solid rgba(23, 32, 54, 0.08);
}

.camera-calibration-tool-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.camera-calibration-tool-hint {
  font-weight: 400;
  font-size: 0.8rem;
}

#camera-calibration-zoom-value {
  font-size: 0.85rem;
  color: var(--text);
}

.camera-zoom-controls {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

#camera-calibration-zoom {
  flex: 1;
  accent-color: var(--primary);
}

.camera-calibration-fine {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.camera-calibration-dpad {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.camera-calibration-dpad-middle {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
}

.camera-calibration-fine button {
  border-radius: 0.6rem;
  border: 1px solid rgba(23, 32, 54, 0.16);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.camera-calibration-fine button:hover {
  background: rgba(36, 85, 245, 0.12);
  color: var(--primary);
}

.camera-radius-fine {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.camera-pipeline-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.camera-pipeline-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  background: rgba(23, 32, 54, 0.04);
  border: 1px solid rgba(23, 32, 54, 0.08);
}

.camera-pipeline-list p {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.camera-step-status {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  align-self: flex-start;
  background: rgba(23, 32, 54, 0.08);
}

.camera-step-status[data-status="done"] {
  background: rgba(31, 157, 85, 0.15);
  color: var(--success);
}

.camera-step-status[data-status="running"] {
  background: rgba(36, 85, 245, 0.12);
  color: var(--primary);
}

.camera-step-status[data-status="error"] {
  background: rgba(229, 62, 62, 0.15);
  color: var(--danger);
}

.camera-calibration-grid {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.camera-calibration-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.camera-calibration-grid input {
  border: 1px solid var(--surface-border);
  border-radius: 0.6rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.95rem;
}

.camera-detections-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.camera-detection-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.camera-detection-entry {
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(23, 32, 54, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.02);
}

.camera-detection-entry[data-committed="true"] {
  border-color: rgba(31, 157, 85, 0.4);
  background: rgba(31, 157, 85, 0.08);
}

.camera-detection-entry header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 600;
}

.camera-detection-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.camera-detection-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.camera-detection-entry button {
  font-size: 0.85rem;
  padding: 0.35rem 0.85rem;
}

.camera-detection-empty {
  padding: 1rem;
  border: 1px dashed rgba(23, 32, 54, 0.2);
  border-radius: 0.9rem;
  text-align: center;
  color: var(--text-muted);
}

.camera-instructions ul {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.camera-instructions code {
  background: rgba(23, 32, 54, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 0.4rem;
  font-size: 0.85rem;
}
