:root,
[data-theme="light"] {
  --bg: #f3f6f5;
  --fg: #14201e;
  --surface: #ffffff;
  --surface-2: #e8f0ed;
  --border: #c9d9d4;
  --muted: #5b6f6a;
  --accent: #0f766e;
  --danger: #b91c1c;
  --ok: #047857;
  --shadow: 0 10px 30px rgba(15, 40, 35, 0.08);
  --input-bg: #ffffff;
}

[data-theme="dark"] {
  --bg: #0b1412;
  --fg: #e7f2ef;
  --surface: #13201d;
  --surface-2: #1b2c28;
  --border: #2a403a;
  --muted: #9bb0aa;
  --accent: #2dd4bf;
  --danger: #f87171;
  --ok: #34d399;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --input-bg: #0f1a18;
}

body {
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(15, 118, 110, 0.12), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(13, 148, 136, 0.10), transparent 55%),
    var(--bg);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 0.75rem;
  padding: 0.7rem 1rem;
  font-weight: 600;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
[data-theme="dark"] .btn-primary { color: #042f2e; }
.btn-ghost {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--fg);
  border-radius: 0.75rem;
  padding: 0.55rem 0.8rem;
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}

.input, .select {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--fg);
  border-radius: 0.75rem;
  padding: 0.75rem 0.9rem;
  font-size: 1rem;
}
.input:focus, .select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 1px;
}

.nav-link {
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0.35rem 0.6rem;
  border-radius: 0.5rem;
}
.nav-link:hover { color: var(--fg); background: var(--surface-2); }

.tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}
.tab.active {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}
[data-theme="dark"] .tab.active { color: #042f2e; }

.table-wrap { overflow-x: auto; }
table.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
table.score-table th,
table.score-table td {
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
table.score-table th {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.place {
  font-weight: 800;
  color: var(--accent);
}

.score-pad .input {
  font-size: 1.35rem;
  text-align: center;
  padding: 1rem;
}

[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: inline; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 50;
}
