:root {
  font-family: system-ui, sans-serif;
  color: #38291f;
  background: #fcf8f4;
  line-height: 1.6;
  --ink: #38291f;
  --accent: #794c35;
  --line: #ede0d6;
  --muted: #6d594c;
  --tint: #f4e8dc;
  --radius: 20px;
  --padding: clamp(16px, 4vw, 28px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, textarea { font: inherit; }
a { color: var(--accent); }
.top { background: #fff; border-bottom: 1px solid var(--line); }
.shell { max-width: 1000px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
.nav { min-height: 64px; display: flex; justify-content: space-between; align-items: center; }
.nav a { color: var(--ink); text-decoration: none; }
.brand { font-weight: 800; font-size: 1.05rem; display: flex; gap: 10px; align-items: center; }
.brand span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: #efddcc; color: var(--accent); }
main { display: grid; gap: 16px; padding-block: clamp(24px, 5vw, 48px) 56px; }
form { display: grid; gap: 16px; margin: 0; }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.65rem, 4vw, 2.6rem); line-height: 1.27; letter-spacing: -.025em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
.hero, .card { display: grid; gap: 16px; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.hero { background: linear-gradient(125deg, #f6e9dc, #fdf0f4); padding: clamp(24px, 5vw, 44px); justify-items: start; }
.hero p { color: var(--muted); max-width: 54ch; }
.card { background: #fff; padding: var(--padding); }
.player { width: 100%; max-width: 680px; margin-inline: auto; display: grid; gap: 16px; }
.row, .card.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: grid; gap: 12px; }
.stack > * { min-width: 0; }
button, .button {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px 14px;
  min-height: 44px;
  background: var(--tint);
  color: #69452f;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button:hover:not(:disabled), .button:hover { border-color: currentColor; }
.primary { background: var(--accent); color: #fff; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #a67856; outline-offset: 3px; }
.muted, small { color: var(--muted); }
label { display: grid; gap: 5px; font-size: .9375rem; font-weight: 650; }
input, textarea { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #d7c5b7; border-radius: 10px; background: #fff; color: var(--ink); font-size: 1rem; font-weight: 400; }
textarea { resize: vertical; min-height: 86px; }
.option { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; gap: 10px; align-items: end; }
.question { background: #fdfaf7; border-radius: 14px; }
.choice { width: 100%; min-height: 50px; text-align: left; justify-content: flex-start; background: #fcf7f2; color: var(--ink); border-color: var(--line); overflow-wrap: anywhere; }
.choice[aria-pressed=true] { border-color: var(--accent); background: #f1dfd0; opacity: 1; }
.choice:disabled { opacity: .72; }
progress { width: 100%; height: 9px; border: 0; border-radius: 99px; overflow: hidden; background: #f0e5db; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: #f0e5db; }
progress::-webkit-progress-value { background: #a66e4b; }
progress::-moz-progress-bar { background: #a66e4b; }
.feedback { background: #f8eee5; border-radius: 12px; padding: 14px 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.card .actions { margin-top: 4px; }
.result { background: linear-gradient(135deg, #f3e4d6, #fdf0f4); }
.score { color: var(--accent); font-size: clamp(3rem, 13vw, 5.75rem); font-weight: 850; line-height: 1.05; }
.badge { display: inline-block; background: var(--tint); color: #69452f; border-radius: 100px; padding: 4px 10px; font-size: .875rem; }
.error { color: #982044; }
.error:empty { display: none; }
#toast { position: fixed; inset: auto 16px 16px auto; padding: 10px 16px; border-radius: 12px; color: #fff; background: var(--ink); max-width: calc(100% - 32px); }
#toast:empty { display: none; }
@media (max-width: 480px) {
  .option { grid-template-columns: minmax(0, 1fr) 74px; }
  .option button { justify-self: start; }
  .between { align-items: flex-start; }
}
