:root {
  color-scheme: light;
  --blue: #2959ff;
  --blue-dark: #1f48d6;
  --bg: #f3f5f9;
  --card-bg: #ffffff;
  --text: #17233a;
  --muted: #6b7897;
  --border: #d8dde8;
  --green: #1db86b;
  --red: #e53935;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
}

/* Screens */
.screen {
  display: none;
  width: 100%;
  max-width: 480px;
}
.screen.active {
  display: block;
}

/* Card */
.card {
  background: var(--card-bg);
  border-radius: 1rem;
  padding: 1.5rem 1.25rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-top: 1rem;
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
  color: var(--blue);
}

h2 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--blue);
}

h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--muted);
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

/* Player input */
.player-input-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.player-input-row input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 0.6rem;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s;
}

.player-input-row input:focus {
  border-color: var(--blue);
}

.player-input-row button {
  padding: 0 1rem;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 0.6rem;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}

.player-input-row button:active {
  background: var(--blue-dark);
}

/* Player list */
.player-list {
  list-style: none;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.player-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border-radius: 0.6rem;
  padding: 0.55rem 0.85rem;
  font-size: 1rem;
}

.player-list li .remove-btn {
  background: none;
  border: none;
  color: var(--red);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}

.field-label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.category-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 0.6rem;
  font-size: 1rem;
  margin-bottom: 1rem;
  background: #fff;
}

.category-select:focus {
  outline: none;
  border-color: var(--blue);
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 0.85rem;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 0.7rem;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--blue-dark);
}

.btn-primary:disabled {
  background: var(--border);
  color: var(--muted);
  cursor: not-allowed;
}

.btn-secondary {
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
  border-radius: 0.7rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  border-color: var(--muted);
  color: var(--text);
}

/* Round label */
.round-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Instruction text */
.instruction {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

/* Word list */
.word-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.word-list li {
  padding: 0.7rem 1rem;
  background: var(--bg);
  border-radius: 0.65rem;
  border: 2px solid transparent;
  font-size: 1.05rem;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s;
}

.word-list li:hover {
  border-color: var(--blue);
}

.word-list li.selected {
  border-color: var(--blue);
  background: #e8edff;
  font-weight: 600;
  color: var(--blue);
}

/* Score list (checkboxes) */
.score-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.score-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg);
  border-radius: 0.65rem;
  font-size: 1rem;
  cursor: pointer;
  user-select: none;
}

.score-list li input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--green);
  cursor: pointer;
  flex-shrink: 0;
}

/* Divider */
.divider {
  border: none;
  border-top: 1.5px solid var(--border);
  margin: 1rem 0;
}

/* Leaderboard */
.leaderboard-title {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.leaderboard {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.leaderboard li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  background: var(--bg);
  border-radius: 0.6rem;
  font-size: 1rem;
}

.leaderboard li .rank {
  color: var(--muted);
  min-width: 1.5rem;
  font-size: 0.9rem;
}

.leaderboard li .name {
  flex: 1;
  padding: 0 0.5rem;
}

.leaderboard li .pts {
  font-weight: 700;
  color: var(--blue);
}

/* Back link */
.back-link-wrap {
  margin-top: 1rem;
  text-align: center;
}

.button-link {
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.button-link:hover {
  color: var(--text);
  text-decoration: underline;
}
