:root {
  --sky: #ece4ff;
  --ink: #1b2a4a;
  --muted: #4d6284;
  --card: #fffdf8;
  --line: #c5daf0;
  --blue: #5b3cc4;
  --blue-dark: #3e278f;
  --green: #1e8a4c;
  --gold: #e3a008;
  --soft: #eef5ff;
  --shadow: 0 12px 30px rgba(27, 42, 74, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
body {
  min-height: 100vh;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, #fff 0, transparent 42%),
    linear-gradient(180deg, #f7f4ff, var(--sky));
}
button { font: inherit; color: inherit; cursor: pointer; }
h1, p { margin: 0; }

.screen {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

.card {
  background: var(--card);
  border: 3px solid #fff;
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 1.25rem 1rem 1.4rem;
}

.kicker {
  margin: 0 0 0.35rem;
  text-align: center;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}
h1 {
  text-align: center;
  font-size: clamp(2.2rem, 9vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.lede {
  margin-top: 0.6rem;
  text-align: center;
  font-size: 1.35rem;
  line-height: 1.35;
  color: var(--muted);
}

.trail {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin: 0.2rem 0 0.85rem;
}
.stone {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background: #d5e4f5;
  box-shadow: inset 0 0 0 2px #b7cce4;
}
.stone.is-done { background: var(--gold); box-shadow: none; }
.stone.is-now { box-shadow: inset 0 0 0 3px var(--blue); background: #fff; }

.prompt {
  text-align: center;
  font-size: clamp(1.7rem, 9vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0.2rem 0 0.8rem;
}
.prompt.is-long {
  font-size: clamp(1.2rem, 5vw, 1.85rem);
  line-height: 1.25;
  letter-spacing: 0;
}

.picture {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-height: 4.5rem;
  margin-bottom: 0.4rem;
}
.cluster { display: flex; justify-content: center; width: 100%; }
.sign {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}
.dots {
  display: grid;
  grid-template-columns: repeat(5, 2.35rem);
  gap: 0.45rem;
  justify-content: center;
}
.dot, .cell {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12);
}
.frames { display: flex; flex-direction: column; gap: 0.45rem; align-items: center; }
.ten-frame {
  display: grid;
  grid-template-columns: repeat(5, 2.35rem);
  gap: 0.35rem;
  padding: 0.45rem;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: #fff;
}
.cell { background: #fff; box-shadow: inset 0 0 0 2px #c5d4e8; }
.cell.is-filled { background: var(--blue); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12); }
.dot.is-leaving, .cell.is-leaving {
  background:
    linear-gradient(45deg, transparent 44%, #c23b3b 44%, #c23b3b 56%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, #c23b3b 44%, #c23b3b 56%, transparent 56%),
    #fff;
  box-shadow: inset 0 0 0 3px #c23b3b;
}

.hint {
  min-height: 2rem;
  margin: 0.35rem 0 0.7rem;
  text-align: center;
  font-size: 1.45rem;
  font-weight: 800;
  color: #9a3412;
}

.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.answers button, .go, .grades button {
  min-height: 4.6rem;
  border-radius: 18px;
  border: 3px solid var(--line);
  background: #fff;
  font-size: 2.4rem;
  font-weight: 800;
}
.answers.is-text button {
  font-size: 1.2rem;
  line-height: 1.25;
  padding: 0.45rem;
}
.grades {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1rem;
}
.grades button {
  min-height: 4.4rem;
  font-size: 1.15rem;
  line-height: 1.2;
}
.grades button small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}
.ghost {
  display: block;
  width: 100%;
  margin-top: 0.65rem;
  min-height: 3.2rem;
  border-radius: 16px;
  border: 3px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 800;
}
.answers button:hover, .go:hover { border-color: var(--blue); }
.answers button:focus-visible, .go:focus-visible {
  outline: 4px solid var(--gold);
  outline-offset: 2px;
}
.answers button:disabled { opacity: 0.45; }
.answers button.is-right {
  opacity: 1;
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.go, .next {
  display: block;
  width: 100%;
  margin-top: 1rem;
  min-height: 4.2rem;
  border: 0;
  border-radius: 18px;
  background: var(--blue);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
}
.go:hover, .next:hover { background: var(--blue-dark); }
.start-dots { margin: 1.2rem auto 0.2rem; }

.home {
  display: block;
  width: fit-content;
  margin: 1rem auto 0;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  border: 3px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
}
.home:hover, .home:focus-visible { border-color: var(--blue); }
.home:focus-visible { outline: 4px solid var(--gold); outline-offset: 2px; }

.stars {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin: 0.8rem 0 0.2rem;
  font-size: 2.2rem;
  line-height: 1;
}
.stars span { color: #d5deea; }
.stars span.is-earned { color: var(--gold); }
.score {
  text-align: center;
  font-size: clamp(1.8rem, 7vw, 2.4rem);
  font-weight: 800;
  line-height: 1.2;
  margin-top: 0.4rem;
}

@media (max-width: 360px) {
  .dot, .cell { width: 2rem; height: 2rem; }
  .dots, .ten-frame { grid-template-columns: repeat(5, 2rem); }
  .answers button { font-size: 2rem; min-height: 4rem; }
}
