:root {
  --blue: #0f7fc4;
  --blue-deep: #0b5f93;
  --green: #0e9f4f;
  --orange: #e8541e;
  --gold: #e3a11b;
  --ink: #243447;
  --muted: #5d6d80;
  --paper: #fffdf8;
  --sky: #eef7ff;
  --line: #d7e4f0;
  --ok: #128a45;
  --bad: #c63b1e;
  --shadow: 0 14px 36px rgba(36, 52, 71, 0.12);
  --radius: 22px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Be Vietnam Pro", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 110% -8%, #ffe4c8 0%, transparent 55%),
    radial-gradient(800px 380px at -10% 108%, #cceeff 0%, transparent 55%),
    #eef3f8;
}

button, input, select { font: inherit; }

.app {
  max-width: 1080px;
  margin: 18px auto;
  background: var(--paper);
  border-radius: 28px;
  box-shadow: var(--shadow);
  height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px 14px;
  background: linear-gradient(120deg, #0f7fc4 0%, #0e9f4f 70%, #e3a11b 140%);
  color: #fff;
  border-radius: 28px 28px 0 0;
  flex: 0 0 auto;
}

.back-list {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.28);
  padding: 7px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.back-list:hover { background: rgba(255,255,255,.28); }

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.brand-mark {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: #fff;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.16);
}
.eyebrow {
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .9;
  font-weight: 700;
}
.brand h1 {
  font-family: "Baloo 2", sans-serif;
  font-size: 26px;
  line-height: 1.05;
  font-weight: 800;
}

.hud { display: flex; align-items: center; gap: 14px; }
.stars {
  background: #fff;
  color: #c47a00;
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: 20px;
  padding: 4px 12px;
  border-radius: 999px;
  min-width: 64px;
  text-align: center;
}
.progress-wrap { min-width: 150px; }
.progress-label { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.progress-bar {
  height: 8px;
  background: rgba(255,255,255,.28);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: #ffe08a;
  border-radius: inherit;
  transition: width .35s ease;
}

.path {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 12px 16px 8px;
  background: #f6fbff;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  z-index: 4;
}
.path button {
  border: 0;
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.path button.done { background: #e7f8ee; color: var(--green); border-color: #b7e7c8; }
.path button.current { background: var(--blue); color: #fff; border-color: var(--blue); }
.path button:disabled { opacity: .45; cursor: not-allowed; }

.stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 22px 28px 16px;
}

.screen { animation: rise .35s ease; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #e8f4fc;
  color: var(--blue-deep);
  font-weight: 700;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.screen h2 {
  font-family: "Baloo 2", sans-serif;
  font-size: 32px;
  line-height: 1.15;
  margin-bottom: 8px;
}
.lead { color: var(--muted); font-size: 16px; margin-bottom: 18px; max-width: 70ch; }

.hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 22px;
  align-items: start;
}
.goals { display: grid; gap: 10px; }
.goal {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 6px 16px rgba(36,52,71,.05);
}
.goal b {
  flex: 0 0 36px;
  height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  font-family: "Baloo 2", sans-serif;
  font-size: 18px;
}
.goal:nth-child(1) b { background: var(--orange); }
.goal:nth-child(2) b { background: var(--blue); }
.goal:nth-child(3) b { background: var(--green); }
.goal:nth-child(4) b { background: var(--gold); }

.welcome-card {
  background: linear-gradient(180deg, #fff 0%, #f3f9ff 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.bit {
  width: 120px; height: 120px;
  margin: 0 auto 8px;
  filter: drop-shadow(0 10px 16px rgba(15,127,196,.25));
}
.welcome-card label {
  display: block;
  font-weight: 700;
  margin: 10px 0 6px;
}
.welcome-card input {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 18px;
  text-align: center;
}
.welcome-card input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(15,127,196,.15);
}

.comic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.panel {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.panel h3 {
  font-family: "Baloo 2", sans-serif;
  font-size: 20px;
}
.panel .art {
  height: 96px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 48px;
  background: var(--sky);
}
.tag {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
}
.tag.info { background: #d9efff; color: var(--blue-deep); }
.tag.decide { background: #ffe4d4; color: #b63a12; }
.reveal-btn {
  margin-top: auto;
  border: 0;
  background: var(--blue);
  color: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 700;
  cursor: pointer;
}
.panel.opened { border-color: #9fd0ef; background: #f7fcff; }

.choice-row { display: grid; gap: 10px; margin-top: 16px; }
.choice {
  text-align: left;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 600;
}
.choice:hover { border-color: var(--blue); }
.choice.ok { border-color: var(--ok); background: #e9f8ef; }
.choice.bad { border-color: var(--bad); background: #ffece8; }
.choice:disabled { cursor: default; }

.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.idea {
  border-radius: 20px;
  padding: 18px;
  color: #fff;
  min-height: 210px;
}
.idea.info { background: linear-gradient(160deg, #0f7fc4, #1aa0d8); }
.idea.decide { background: linear-gradient(160deg, #e8541e, #f08a2a); }
.idea h3 { font-family: "Baloo 2", sans-serif; font-size: 28px; }
.idea p { margin: 8px 0 12px; opacity: .95; }
.idea ul { padding-left: 18px; display: grid; gap: 6px; }
.rhyme {
  margin-top: 16px;
  background: #fff8e6;
  border: 2px dashed #f0c56a;
  border-radius: 16px;
  padding: 14px 16px;
  font-family: "Baloo 2", sans-serif;
  font-size: 22px;
  text-align: center;
}

.grid-cards { display: grid; gap: 12px; }
.task-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
}
.task-card p { font-size: 17px; font-weight: 600; }
.task-card .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
}
.chip.info { background: var(--blue); }
.chip.decide { background: var(--orange); }
.chip.form { background: #5b4db0; }
.chip.img { background: var(--green); }
.chip.snd { background: var(--gold); color: #3a2a00; }
.chip:disabled { opacity: .55; cursor: default; }
.task-card.ok { background: #eefbf3; border-color: #b7e7c8; }
.task-card.bad { animation: shake .3s ease; }
@keyframes shake {
  0%, 100% { transform: none; }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.scene-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.scene {
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 18px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}
.scene.active { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(15,127,196,.12); }
.scene .ico { font-size: 36px; }
.scene h3 { font-family: "Baloo 2", sans-serif; font-size: 20px; }
.scene p { color: var(--muted); font-size: 14px; margin-top: 4px; }

.lab {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
}
.lab-nav { display: grid; gap: 8px; align-content: start; }
.lab-nav button {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
}
.lab-nav button.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.lab-nav button.done { outline: 2px solid #b7e7c8; }
.lab-body {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}
.info-box {
  background: #e8f4fc;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 10px 0 14px;
  font-weight: 600;
}
.result {
  margin-top: 12px;
  border-radius: 12px;
  padding: 12px;
  font-weight: 600;
}
.result.ok { background: #e9f8ef; color: #0d6b36; }
.result.bad { background: #ffece8; color: #8d2612; }
.result.warn { background: #fff4d8; color: #7a5600; }

.quiz { display: grid; gap: 12px; }
.q-meta { color: var(--muted); font-weight: 700; font-size: 14px; }

.apply-box {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}
.apply-box select {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.summary {
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}
.cert {
  margin: 16px auto;
  border: 4px double #f0c56a;
  border-radius: 20px;
  padding: 22px 18px;
  background: linear-gradient(180deg, #fff, #fff8e8);
}
.cert h3 { font-family: "Baloo 2", sans-serif; font-size: 30px; color: var(--orange); }
.cert .who { font-size: 28px; font-family: "Baloo 2", sans-serif; margin: 6px 0; }
.points { display: flex; justify-content: center; gap: 16px; margin: 14px 0; flex-wrap: wrap; }
.point {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  min-width: 120px;
}
.point b { display: block; font-family: "Baloo 2", sans-serif; font-size: 26px; color: var(--blue); }
.takeaways { text-align: left; display: grid; gap: 8px; margin-top: 8px; }
.takeaways li { background: #f6fbff; border-radius: 12px; padding: 10px 12px; }

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
  flex: 0 0 auto;
  z-index: 5;
}
.hint { color: var(--muted); font-size: 14px; text-align: center; flex: 1; }
.btn {
  border: 0;
  border-radius: 14px;
  padding: 11px 18px;
  font-weight: 800;
  cursor: pointer;
  min-width: 140px;
}
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-deep); }
.btn.primary:disabled { background: #9bb8cc; cursor: not-allowed; }
.btn.ghost { background: #eef3f8; color: var(--ink); }
.btn.ghost:disabled { opacity: .4; cursor: not-allowed; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  z-index: 20;
}
#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
}

.feedback {
  margin-top: 14px;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 600;
}
.feedback.ok { background: #e9f8ef; color: #0d6b36; }
.feedback.bad { background: #ffece8; color: #8d2612; }
.feedback.tip { background: #e8f4fc; color: var(--blue-deep); }

.world {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
}
.tile .ico { font-size: 40px; line-height: 1; }
.tile h3 { font-family: "Baloo 2", sans-serif; font-size: 22px; margin: 4px 0; }

@media (max-width: 860px) {
  .app { margin: 0; border-radius: 0; height: 100vh; }
  .topbar { border-radius: 0; }
  .hero, .duo, .comic, .lab, .scene-grid, .world { grid-template-columns: 1fr; }
  .brand h1 { font-size: 20px; }
  .stage { padding: 16px; }
  .task-card { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .btn { min-width: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  .screen, .task-card.bad { animation: none; }
  .progress-bar span { transition: none; }
}
