:root {
  --green: #1b5e3a;
  --green-dark: #123f27;
  --bg: #f4f6f4;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #e2e5e2;
  --gold: #b8860b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 2rem;
}

header {
  background: var(--green);
  color: white;
  padding: 1.1rem 1rem;
  padding-top: max(1.1rem, env(safe-area-inset-top));
  text-align: center;
}

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

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.card h2 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status {
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  line-height: 1.4;
}

.status .accuracy-good { color: #1b7a3d; font-weight: 600; }
.status .accuracy-ok { color: #b8860b; font-weight: 600; }
.status .accuracy-bad { color: #c0392b; font-weight: 600; }

input[type="text"] {
  width: 100%;
  padding: 0.7rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.7rem;
}

.btn {
  display: block;
  width: 100%;
  padding: 0.9rem;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  touch-action: manipulation;
}

.btn-primary {
  background: var(--green);
  color: white;
}

.btn-primary:disabled {
  background: #a9b8ae;
  cursor: not-allowed;
}

.btn-secondary {
  background: white;
  color: var(--green);
  border: 2px solid var(--green);
  max-width: 480px;
  margin: 0 auto 1rem;
  display: block;
  width: calc(100% - 2rem);
}

.hint {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

#progress-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

.results-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.results-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.results-list li:last-child { border-bottom: none; }

.results-list li.empty {
  color: var(--muted);
  justify-content: center;
}

.results-list .rank {
  font-weight: 700;
  color: var(--muted);
  width: 1.6rem;
}

.results-list li.first .rank { color: var(--gold); }
.results-list li.first .distance { color: var(--gold); font-weight: 700; }

.results-list .label {
  flex: 1;
  padding: 0 0.5rem;
}

.results-list .meta {
  font-size: 0.75rem;
  color: var(--muted);
  display: block;
}

.results-list .distance {
  font-weight: 600;
  white-space: nowrap;
}

.note {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}
