:root {
  color-scheme: light dark;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1c1c1e;
  --muted: #6b6b70;
  --border: #e2e2e0;
  --accent: #2f6f4f;
  --accent-hover: #255a40;
  --danger: #b3261e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181a;
    --surface: #222325;
    --text: #f0f0f0;
    --muted: #9a9a9e;
    --border: #34363a;
    --accent: #4caf7d;
    --accent-hover: #5fc490;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

header h1 {
  font-size: 1.25rem;
  margin: 0;
}

.today {
  color: var(--muted);
  font-size: 0.9rem;
  flex: 1;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem;
}

.add-player {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.add-player input {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

th, td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tbody tr:last-child td { border-bottom: none; }

.player-name-btn {
  background: none;
  border: none;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: 0.95rem;
  text-decoration: underline dotted;
}

.distance {
  font-weight: 700;
  color: var(--accent);
}

button {
  border: none;
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  background: var(--accent);
  color: white;
}

button:hover { background: var(--accent-hover); }

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

button.checked-in {
  background: var(--muted);
  cursor: default;
}

button.remove {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--border);
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

dialog {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 1.5rem;
  min-width: 300px;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

dialog label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

dialog input {
  width: 100px;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 1.5rem;
}

.add-session {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.add-session input {
  width: auto;
  flex: 1;
}
