﻿:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #111111;
  --muted: #2b2f35;
  --accent: #0047ff;
  --accent-dark: #0033b3;
  --border: #b6bdc8;
  --shadow: rgba(0, 0, 0, 0.14);
  --highlight: #d6e5ff;
  --highlight-next: #e4efff;
}

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

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.header {
  margin-bottom: 24px;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-icon {
  font-size: 28px;
}

.badge {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
}

.header h1 {
  font-size: 32px;
  font-weight: 700;
}

.subhead {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.legend {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 18px;
}

.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
}

.card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 6px 18px var(--shadow);
  padding: 20px;
  border: 1px solid var(--border);
}

.card h2 {
  font-size: 20px;
  margin-bottom: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.icon-field {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 10px;
}

.icon-label {
  font-size: 18px;
  text-align: center;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #ffffff;
  color: var(--text);
}

button {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  background: #dde3ee;
  color: var(--text);
  cursor: pointer;
}

button.primary {
  background: var(--accent);
  color: white;
  font-weight: 600;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent-dark);
  outline-offset: 2px;
}

.hint {
  font-size: 12px;
  color: var(--muted);
}

.players {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.players-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.players-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.player-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f4f7fb;
}

.player-item span::before {
  content: "◯";
  margin-right: 8px;
  color: var(--accent);
}

.count-chip {
  background: var(--highlight);
  color: #163a8a;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
}

.players-add {
  display: flex;
  gap: 8px;
}

.players-add input {
  flex: 1;
}

.actions {
  display: flex;
  justify-content: flex-end;
}

.error {
  color: #6b0012;
  background: #ffd5dc;
  padding: 10px 12px;
  border-radius: 10px;
}

.results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.round-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.round-label {
  font-weight: 600;
  color: var(--muted);
}

.summary {
  color: var(--muted);
  font-size: 14px;
}

.rounds {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.round-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  background: #ffffff;
}

.round-card.current {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(47, 107, 255, 0.25);
  background: var(--highlight);
}

.round-card.next {
  border-style: dashed;
  background: var(--highlight-next);
}

.round-card h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.round-card .court-line {
  margin-bottom: 6px;
}

.round-card .rest {
  margin-top: 8px;
  font-weight: 600;
}

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

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