:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f7f7f7;
  --bg-tertiary: #ececec;
  --text-primary: #000000;
  --text-secondary: #666666;
  --border-color: #ccc;
  --button-bg: #fff;
  --button-border: #ccc;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-primary: #1e1e1e;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --border-color: #444;
    --button-bg: #2d2d2d;
    --button-border: #555;
  }
}

html[data-theme="dark"] {
  --bg-primary: #1e1e1e;
  --bg-secondary: #2d2d2d;
  --bg-tertiary: #3a3a3a;
  --text-primary: #e0e0e0;
  --text-secondary: #b0b0b0;
  --border-color: #444;
  --button-bg: #2d2d2d;
  --button-border: #555;
}

html[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f7f7f7;
  --bg-tertiary: #ececec;
  --text-primary: #000000;
  --text-secondary: #666666;
  --border-color: #ccc;
  --button-bg: #fff;
  --button-border: #ccc;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

#scores {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  align-items: flex-start;
  overflow-x: auto;
}

.player-column {
  min-width: 160px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
  text-align: left;
  font-weight: 600;
}

.player-name {
  margin: 0;
  font-size: 1.1rem;
}

.cumulative-score {
  margin: 4px 0 10px;
  font-size: 1.5rem;
}

.turns-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 60vh;
}

.turn-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

.turn-input {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  box-sizing: border-box;
}

.turn-input:read-only {
  background: var(--bg-tertiary);
}

.turn-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.turn-action {
  border: 1px solid var(--button-border);
  background: var(--button-bg);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.turn-action svg {
  width: 14px;
  height: 14px;
}

.delete {
  color: red;
}

.edit {
  color: #007bff;
}

@media (max-width: 600px) {
  #scores {
    scroll-snap-type: x mandatory;
    gap: 6px;
  }

  .player-column {
    min-width: 90%;
    scroll-snap-align: center;
  }
}
