:root {
  --ink: #0f172a;
  --soft: #475569;
  --paper: #fff7ed;
  --card: #ffffff;
  --ocean: #1d4ed8;
  --ocean-deep: #1e3a8a;
  --land: #4ade80;
  --land-dark: #15803d;
  --eq: #f59e0b;
  --lat: #f43f5e;
  --lon: #7c3aed;
  --hot: #ea580c;
  --line: #fed7aa;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(900px 400px at -10% -20%, #fdba74 0%, transparent 50%),
    radial-gradient(700px 380px at 110% 0%, #93c5fd 0%, transparent 46%),
    var(--paper);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  padding-bottom: 96px;
}

.top {
  background: linear-gradient(135deg, #1e3a8a 0%, #0369a1 55%, #0ea5e9 100%);
  color: #fff;
  padding: 1.25rem 1.1rem 1rem;
  box-shadow: 0 8px 24px rgba(30, 58, 138, .28);
}
.kicker {
  margin: 0 0 .2rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .72rem;
  opacity: .85;
  font-weight: 700;
}
.top h1 { margin: 0 0 .3rem; font-size: 1.7rem; letter-spacing: -.03em; }
.sub { margin: 0 0 .9rem; color: #dbeafe; font-size: .95rem; }

.progress-wrap { margin-bottom: .7rem; }
.progress-label { font-size: .8rem; font-weight: 700; margin-bottom: .35rem; }
.bar {
  height: 10px;
  background: rgba(255,255,255,.22);
  border-radius: 999px;
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  width: 12.5%;
  background: linear-gradient(90deg, #fbbf24, #fb7185);
  border-radius: 999px;
  transition: width .25s ease;
}

.dots {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}
.dots button {
  width: 28px; height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  color: #fff;
  font-weight: 800;
  font-size: .75rem;
  cursor: pointer;
}
.dots button.on { background: #fbbf24; color: #0f172a; }
.dots button.done { background: #86efac; color: #14532d; }

main { max-width: 760px; margin: 0 auto; padding: 1.1rem; }
.step { display: none; }
.step.on { display: block; animation: in .25s ease; }
@keyframes in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.badge {
  display: inline-block;
  background: #dbeafe;
  color: #1e3a8a;
  font-weight: 800;
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .28rem .65rem;
  border-radius: 999px;
  margin: 0 0 .5rem;
}
.badge.pink { background: #ffe4e6; color: #9f1239; }
.badge.gold { background: #fef3c7; color: #92400e; }
.hot-badge { background: #ffedd5; color: #c2410c; }
.teal-badge { background: #ccfbf1; color: #115e59; }

h2 { margin: 0 0 .55rem; font-size: 1.35rem; letter-spacing: -.02em; }
h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
p { margin: .45rem 0 .7rem; }

.points {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin: 1rem 0;
}
.points div {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .7rem .8rem;
  font-size: .92rem;
}
.points b { display: block; color: var(--ocean-deep); }
.points span { color: var(--soft); font-size: .82rem; }
.points .hot {
  background: #fff7ed;
  border-color: #fdba74;
}
.points .hot b { color: var(--hot); }

.trap, .tip, .big, .sketch {
  border-radius: 14px;
  padding: .9rem 1rem;
  margin: 1rem 0;
}
.trap { background: #fff1f2; border: 1px solid #fecdd3; }
.trap b, .tip b, .big b, .sketch b { display: block; margin-bottom: .25rem; }
.trap b { color: #be123c; }
.tip { background: #fef3c7; border: 1px solid #fcd34d; }
.tip b { color: #92400e; }
.big { background: #e0f2fe; border: 1px solid #7dd3fc; }
.sketch { background: #f0fdf4; border: 1px dashed #86efac; }

.pair {
  display: grid;
  gap: .7rem;
}
@media (min-width: 640px) {
  .pair { grid-template-columns: 1fr 1fr; }
}
.flash {
  border-radius: 16px;
  padding: 1rem;
  color: #fff;
}
.flash.lat { background: linear-gradient(160deg, #f43f5e, #fb7185); }
.flash.lon { background: linear-gradient(160deg, #6d28d9, #a78bfa); }
.flash ul { margin: .3rem 0 .6rem; padding-left: 1.1rem; }
.memory {
  background: rgba(255,255,255,.18);
  border-radius: 10px;
  padding: .55rem .7rem;
  font-size: .9rem;
}

.moves { list-style: none; padding: 0; margin: .4rem 0 1rem; }
.moves li {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  margin: .45rem 0;
}
.moves .n {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  font-size: .85rem;
  display: grid;
  place-items: center;
}
.eq { color: #b45309; }
.pm { color: #6d28d9; }

.map-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: .7rem;
  margin: .8rem 0;
}
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  font-size: .8rem;
  color: var(--soft);
  font-weight: 700;
  padding: .2rem .3rem .55rem;
}
.swatch {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 3px;
  margin-right: .25rem;
  vertical-align: -1px;
}
.swatch.eq { background: var(--eq); }
.swatch.pm { background: var(--lon); }
.swatch.pin { background: #ef4444; }
.map-slot svg { width: 100%; height: auto; display: block; border-radius: 10px; }

.coord-list, .quiz-rows, .city-grid { display: grid; gap: .55rem; margin: .8rem 0; }
.coord, .city {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .75rem .85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
}
.coord b, .city b { font-size: 1.02rem; }
.coord .where, .city .where { color: var(--soft); font-size: .85rem; font-weight: 600; }
.btn.tiny {
  padding: .4rem .7rem;
  font-size: .8rem;
}

.qrow {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .8rem;
}
.qrow .choices { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.choices button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: .35rem .7rem;
  font-weight: 700;
  cursor: pointer;
  font-size: .85rem;
}
.choices button.right { background: #dcfce7; border-color: #86efac; color: #166534; }
.choices button.wrong { background: #ffe4e6; border-color: #fda4af; color: #9f1239; }
.feedback { margin: .45rem 0 0; font-size: .9rem; font-weight: 600; min-height: 1.2em; }

.template {
  background: #fff;
  border: 2px dashed #fdba74;
  border-radius: 16px;
  padding: .9rem 1rem;
  margin: 1rem 0;
}
.template-label {
  margin: 0 0 .4rem;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--hot);
}
blockquote {
  margin: 0;
  font-size: .98rem;
  line-height: 1.6;
}

.checklist {
  display: grid;
  gap: .45rem;
  margin: 1rem 0;
}
.checklist label {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .7rem .8rem;
  display: flex;
  gap: .55rem;
  align-items: flex-start;
  font-weight: 600;
}
.checklist input { margin-top: .2rem; width: 1.1rem; height: 1.1rem; }

.hint { color: var(--soft); font-size: .9rem; }
.row { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .7rem; }

.btn {
  border: 0;
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: .7rem 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(15, 23, 42, .08);
}
.btn.ghost { background: #ffedd5; color: #9a3412; }
.btn.primary {
  background: linear-gradient(90deg, #f97316, #ef4444);
  color: #fff;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }

.paper {
  margin: 1.25rem 0 0;
}
.paper-tag {
  display: inline-block;
  background: #fb7185;
  color: #fff;
  font-weight: 800;
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .28rem .7rem;
  border-radius: 999px 999px 12px 0;
  margin: 0 0 .45rem .4rem;
}
.sheet {
  background:
    repeating-linear-gradient(transparent, transparent 27px, #e0e7ff 28px),
    linear-gradient(90deg, transparent 36px, #fecaca 36px, #fecaca 38px, #fff 38px);
  background-color: #fffef8;
  border-radius: 4px 12px 12px 12px;
  padding: 1rem 1rem 1rem 2.6rem;
  box-shadow:
    0 1px 0 #e2e8f0,
    0 18px 40px rgba(15, 23, 42, .16);
  transform: rotate(-0.6deg);
  position: relative;
}
.sheet::before {
  content: "";
  position: absolute;
  top: -10px; right: 28px;
  width: 64px; height: 22px;
  background: rgba(253, 224, 71, .55);
  transform: rotate(6deg);
  border-radius: 2px;
}
.sheet h4 {
  font-family: "Times New Roman", Times, serif;
  margin: 0 0 .35rem;
  font-size: 1.05rem;
  background: #fff;
}
.printed {
  font-size: .82rem;
  color: #334155;
  margin: 0 0 .45rem;
  background: #fff;
}
.sheet .mini-map { margin: .4rem 0 .7rem; background: #fff; padding: .25rem; border: 1px solid #cbd5e1; }
.sheet .mini-map svg { width: 100%; height: auto; display: block; }
.chart {
  background: #fff;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  margin: .4rem 0 .7rem;
  font-size: .82rem;
}
.chart .head, .chart .row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 0;
}
.chart.two .head, .chart.two .row { grid-template-columns: 1.3fr 1fr; }
.chart .head { background: #e2e8f0; font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.chart .head span, .chart .row span {
  padding: .35rem .5rem;
  border-bottom: 1px solid #cbd5e1;
  border-right: 1px solid #cbd5e1;
}
.hw {
  font-family: "Patrick Hand", "Segoe Print", "Comic Sans MS", cursive;
  color: #1d4ed8;
  font-size: 1.12rem;
  line-height: 1.35;
  letter-spacing: .01em;
}
.blank {
  color: transparent;
  border-bottom: 1px solid #94a3b8;
  display: inline-block;
  min-width: 7rem;
}
.fresh {
  background: #fef08a;
  box-shadow: 0 0 0 3px #fef08a;
  border-radius: 4px;
}
.write-block {
  background: #fff;
  min-height: 4.2rem;
  margin: .35rem 0 .6rem;
  padding: .2rem .1rem;
}
.sketch-box {
  width: 88px;
  height: 88px;
  border: 1px dashed #64748b;
  border-radius: 8px;
  float: right;
  margin: 0 0 .4rem .6rem;
  background: #fff;
}
.paper figcaption {
  margin: .55rem 4px 0;
  font-size: .88rem;
  color: var(--soft);
  font-weight: 600;
}

.nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  gap: .6rem;
  justify-content: space-between;
  padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
  background: rgba(255, 247, 237, .92);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.nav .btn { min-width: 44%; }

.pin-label {
  font-size: 9px;
  font-weight: 800;
  fill: #fff;
  paint-order: stroke;
  stroke: #0f172a;
  stroke-width: 3px;
}
.drop { animation: drop .45s ease; }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes drop {
  from { transform: translateY(-14px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: .4; }
  50% { opacity: 1; }
}
