:root {
  --bg: #eef4f7;
  --ink: #101827;
  --muted: #596579;
  --card: #ffffff;
  --line: #dbe4eb;
  --teal: #10a79b;
  --purple: #6b46c1;
  --navy: #08142d;
  --shadow: 0 22px 55px rgba(8, 20, 45, 0.16);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #ffffff 0, var(--bg) 42%, #e9e3f5 100%);
  display: grid;
  place-items: center;
  padding: 22px;
}

.app {
  width: min(430px, 100%);
  min-height: 780px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(255,255,255,0.85);
  border-radius: 34px;
  box-shadow: var(--shadow);
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.topbar, .footer, .controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar { padding: 6px 4px 18px; }
.brand { font-weight: 800; letter-spacing: -0.02em; }
.path { font-size: 12px; color: var(--muted); text-align: right; }
.icon-button, .secondary, .choice {
  border: 0;
  cursor: pointer;
  font: inherit;
}
.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #f4f7fb;
  color: var(--navy);
  font-size: 22px;
}

.hero {
  min-height: 500px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 34px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  box-shadow: 0 10px 30px rgba(8,20,45,0.08);
  touch-action: pan-y;
  transition: transform 180ms ease, opacity 180ms ease;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 18px 18px auto auto;
  width: 92px;
  height: 92px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(16,167,155,.13), rgba(107,70,193,.16));
}

.kicker {
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef8f7;
  color: #08756d;
  font-weight: 800;
  font-size: 13px;
  margin: 0 0 22px;
}

h1 {
  margin: 0 0 18px;
  line-height: 1.05;
  letter-spacing: -0.045em;
  font-size: clamp(34px, 9vw, 48px);
}

.body {
  margin: 0;
  font-size: 18px;
  line-height: 1.45;
  color: #20293a;
}

.caption {
  margin: 28px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.controls { padding: 18px 0 12px; }
.choice {
  min-height: 70px;
  width: 40%;
  padding: 12px;
  border-radius: 20px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.12;
}
.choice span { font-size: 22px; }
.choice.left { background: var(--teal); }
.choice.right { background: var(--purple); }
.counter {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f7f8fb;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.footer { padding-top: 12px; }
.secondary {
  background: #f4f6fa;
  color: var(--ink);
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 700;
}
.secondary:hover, .icon-button:hover { background: #e8edf5; }
.choice:active, .secondary:active, .icon-button:active { transform: translateY(1px); }

.tree-panel {
  position: absolute;
  inset: 74px 18px 18px;
  background: rgba(255,255,255,0.97);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 22px;
  box-shadow: var(--shadow);
  overflow: auto;
}
.tree-panel h2 { margin: 0 0 14px; }
.tree { display: grid; gap: 10px; margin-bottom: 18px; }
.node {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #fbfcfe;
}
.node.visited { border-color: rgba(16,167,155,.5); background: #eef8f7; }
.node.current { border-color: rgba(107,70,193,.6); background: #f2eefa; }
.node strong { display: block; margin-bottom: 4px; }
.node small { color: var(--muted); }

@media (max-width: 420px) {
  body { padding: 0; }
  .app { min-height: 100vh; border-radius: 0; }
  .hero { min-height: 52vh; }
  .choice { font-size: 13px; }
}
