:root {
  --bg: #f4f1ea;
  --card: #ffffff;
  --ink: #1f2430;
  --muted: #6b7280;
  --accent: #2f5d50;
  --accent-ink: #ffffff;
  --good: #2e7d4f;
  --bad: #b3372f;
  --line: #e3ded2;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16191f;
    --card: #1f242c;
    --ink: #e8e6e1;
    --muted: #98a0ab;
    --accent: #6fb39f;
    --accent-ink: #10201a;
    --good: #6fcf97;
    --bad: #f28b82;
    --line: #333a45;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
}

.card {
  width: 100%;
  max-width: 520px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

h1 { margin: 0 0 4px; font-size: 2rem; }
h2 { font-size: 2.4rem; text-align: center; margin: 28px 0 20px; letter-spacing: 0.02em; }

.sub { color: var(--muted); margin: 0 0 20px; }
.hidden { display: none !important; }

label { display: block; margin-bottom: 14px; font-size: 0.95rem; color: var(--muted); }

select, input[type="text"] {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}

input[type="text"] { text-align: center; font-size: 1.4rem; }

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

button.primary {
  width: 100%;
  margin-top: 8px;
  padding: 13px;
  font: inherit;
  font-size: 1.05rem;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

button.primary:hover { filter: brightness(1.08); }

.topbar { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.9rem; margin-bottom: 8px; }
.bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
#barFill { height: 100%; width: 0; background: var(--accent); transition: width 0.25s ease; }

.feedback { min-height: 1.5em; text-align: center; margin: 14px 0 0; font-weight: bold; }
.feedback.good { color: var(--good); }
.feedback.bad { color: var(--bad); }

.score { font-size: 3rem; margin: 8px 0; text-align: center; }
#summary { text-align: center; }

#review { list-style: none; padding: 0; margin: 0 0 16px; max-height: 280px; overflow-y: auto; }
#review li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
#review .ok { color: var(--good); }
#review .no { color: var(--bad); }
