/* Kindling — light, warm, beginner-friendly. */

:root {
  --bg: #FBF8F3;
  --paper-dot: #E3DACB;
  --card: #FFFFFF;
  --ink: #1E1B18;
  --ink-2: #57504A;
  --ink-3: #7A7168;
  --line: #E8E0D4;
  --accent: #C2410C;
  --accent-ink: #9A3412;
  --accent-soft: #FDEBDD;
  --ok: #1F7A45;
  --focus: #1D4ED8;
  --shadow-sm: 0 1px 2px rgb(60 40 20 / .08), 0 2px 6px rgb(60 40 20 / .06);
  --shadow: 0 2px 4px rgb(60 40 20 / .06), 0 10px 30px rgb(60 40 20 / .12);
  --r: 14px;
  --top: 64px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
body.page-map { overflow: hidden; overscroll-behavior: none; }
body.page-map.page-list { overflow: auto; }
a { color: var(--accent-ink); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 10px; }

/* ---------- top bar ---------- */

.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 20;
  display: flex; align-items: center; gap: 16px; padding: 0 16px;
  background: rgb(251 248 243 / .92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand img { border-radius: 8px; }
.brand span { font: 650 22px/1 var(--serif); letter-spacing: -.01em; }
.back { text-decoration: none; font-weight: 600; color: var(--ink-2); padding: 10px 12px; border-radius: 10px; }
.back:hover { background: #F2ECE3; color: var(--ink); }

.search { position: relative; flex: 1; max-width: 540px; margin: 0 auto; }
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search input {
  width: 100%; height: 44px; padding: 0 16px 0 42px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  font: 500 15px var(--sans); color: var(--ink); box-shadow: var(--shadow-sm);
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgb(29 78 216 / .18); }
.q-results {
  position: absolute; top: 52px; left: 0; right: 0; margin: 0; padding: 6px; list-style: none;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  max-height: 60vh; overflow: auto;
}
.q-results li { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.q-results li[aria-selected="true"], .q-results li:hover { background: #F5EFE6; }
.q-results li.none { color: var(--ink-2); cursor: default; }
.q-results .ico { font-size: 20px; width: 26px; text-align: center; }
.q-results b { display: block; font-weight: 600; }
.q-results small { color: var(--ink-2); font-size: 13px; }

.rules-btn { flex: none; border: 0; background: none; font-weight: 600; font-size: 14px; color: var(--ink-2); padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.rules-btn:hover { background: #F2ECE3; color: var(--ink); }
.rules-btn .short { display: none; }
.seg { display: flex; background: #F0E9DF; border-radius: 999px; padding: 4px; flex: none; }
.seg button { border: 0; background: none; padding: 8px 16px; min-height: 36px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- map ---------- */

.mapview { position: fixed; inset: var(--top) 0 0 0; }
.viewport {
  position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab;
  user-select: none; -webkit-user-select: none;
}
.viewport.is-dragging { cursor: grabbing; }
.viewport:focus-visible { outline-offset: -4px; }
.world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#dots circle { fill: var(--paper-dot); }
.core { fill: #fff; stroke: var(--line); stroke-width: 3; }
.wedge { transition: opacity .3s; }
.w-d1 { opacity: .06; }
.w-d3 { opacity: .8; }
.cat-name { font: 650 54px var(--serif); letter-spacing: -.01em; opacity: .9; transition: opacity .3s; pointer-events: none; }
.heat { transition: opacity .3s; }
.link { fill: none; stroke: #BFAF9A; stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linecap: round; transition: opacity .3s, stroke .2s; }
.link.is-empty { stroke: #D3C7B6; stroke-dasharray: 3 5; }
.link.is-off { opacity: 0; }
.link.is-on { stroke: var(--accent); stroke-width: 3.5; stroke-dasharray: none; opacity: 1; }

.cat-name.is-off { opacity: 0; }
.is-far .heat { opacity: .9; }

.overlay { position: absolute; inset: 0; pointer-events: none; }
.mk { position: absolute; left: 0; top: 0; will-change: transform; }
.mk > * { pointer-events: auto; animation: pop .28s cubic-bezier(.2, .9, .3, 1.3); }
.mk:has(.is-dim) { z-index: 0; }
.mk:has(.chip), .mk:has(.is-hit) { z-index: 2; }
@keyframes pop { from { opacity: 0; scale: .7; } }

/* Density bubbles (the deepest visible level) */
.bub {
  --s: 88px;
  position: absolute; left: 0; top: 0;
  transform: translate(-50%, calc(var(--s) / -2));
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content;
  border: 0; background: none; padding: 0; cursor: pointer;
}
.bub .dot {
  width: var(--s); height: var(--s); border-radius: 50%;
  display: grid; place-content: center; text-align: center;
  background: var(--c); color: #fff;
  box-shadow: 0 0 0 4px #fff, 0 0 0 12px color-mix(in srgb, var(--c) 16%, transparent), var(--shadow);
  transition: transform .18s ease;
}
.bub .dot b { font: 700 calc(var(--s) * .42)/1 var(--sans); }
.bub-d1 .dot b { font-size: 32px; }
.bub-d1 .dot small { font: 600 12px/1.2 var(--sans); opacity: .92; }
.bub:hover .dot, .bub:focus-visible .dot { transform: scale(1.08); }
.bub.is-open .dot { transform: scale(.8); }
.lbl {
  width: max-content; max-width: 170px; padding: 5px 10px; border-radius: 10px;
  background: rgb(255 255 255 / .95); box-shadow: var(--shadow-sm);
  font: 600 13px/1.3 var(--sans); color: var(--ink); text-align: center;
}
.lbl-sphere { max-width: 220px; font: 650 19px/1.2 var(--serif); color: var(--c); padding: 6px 14px; }

/* Hubs: visible branches above the deepest level */
.hub {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 8px; width: max-content; max-width: 220px;
  padding: 7px 12px; border-radius: 999px; border: 2px solid var(--c);
  background: #fff; color: var(--c); box-shadow: var(--shadow);
  font: 700 14px/1.2 var(--sans); cursor: pointer; text-align: center;
}
.hub small { font-size: 12px; font-weight: 700; background: var(--c); color: #fff; border-radius: 999px; padding: 1px 7px; }
.hub-d1 { font: 650 20px/1.15 var(--serif); padding: 9px 18px; background: var(--c); color: #fff; }
.hub-d1 small { background: #fff; color: var(--c); }
.hub.is-empty { border-style: dashed; color: var(--ink-2); }
.hub:hover { transform: translate(-50%, -50%) scale(1.04); }

/* Empty branches: the framework still shows where a topic belongs */
.empty {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -8px);
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: max-content;
  border: 0; background: none; padding: 0; cursor: pointer;
}
.empty .ring { width: 16px; height: 16px; border-radius: 50%; border: 2.5px dashed color-mix(in srgb, var(--c) 60%, #fff); background: #fff; }
.empty.has-kids .ring { width: 22px; height: 22px; }
.empty .lbl { background: rgb(255 255 255 / .7); box-shadow: none; color: var(--ink-2); font-weight: 500; }
.empty.e-d2 .lbl, .lbl-cat { font: 650 17px/1.2 var(--serif); color: var(--c); }
.empty.e-d2 .lbl { background: rgb(255 255 255 / .85); box-shadow: var(--shadow-sm); }
.empty:hover .lbl { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

.root-hub {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: max-content;
  border: 0; background: none; cursor: pointer; padding: 0;
  font: 700 12px var(--sans); color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em;
}
.root-hub img { border-radius: 12px; box-shadow: 0 0 0 5px #fff, var(--shadow); }

.is-dim { opacity: .3; }
.is-dim:hover, .is-dim:focus-visible { opacity: .9; }
.bub.is-hit .dot { animation: ring 1.6s ease-out infinite; }
.hub.is-hit { box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); border-color: var(--accent); }
@keyframes ring {
  0% { box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--accent), var(--shadow); }
  100% { box-shadow: 0 0 0 4px #fff, 0 0 0 22px rgb(194 65 12 / 0), var(--shadow); }
}

.chip {
  position: absolute; left: 0; top: 0; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  height: 38px; padding: 0 12px 0 8px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--c);
  box-shadow: var(--shadow); cursor: pointer; font-weight: 600; font-size: 14px;
  transition: transform .15s, box-shadow .15s;
}
.chip:hover { transform: translateX(-50%) translateY(-2px); box-shadow: 0 4px 8px rgb(60 40 20 / .1), 0 14px 30px rgb(60 40 20 / .16); }
.chip .ico { font-size: 18px; }
.chip.is-hit { border-color: var(--accent); border-left-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }

/* Map chrome */
.crumbs {
  position: absolute; top: 14px; left: 16px; z-index: 5;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; max-width: calc(100% - 32px);
  padding: 4px; border-radius: 12px; background: rgb(255 255 255 / .92); box-shadow: var(--shadow-sm);
  font-size: 14px; font-weight: 600;
}
.crumbs button { border: 0; background: none; padding: 6px 10px; border-radius: 8px; cursor: pointer; color: var(--ink-2); }
.crumbs button:hover { background: #F2ECE3; color: var(--ink); }
.crumbs span { padding: 6px 10px; color: var(--c, var(--ink)); }
.crumbs i { color: var(--ink-3); font-style: normal; }

.intro {
  position: absolute; top: 66px; left: 16px; z-index: 6; width: min(380px, calc(100% - 32px));
  background: var(--card); border-radius: 18px; padding: 22px; box-shadow: var(--shadow);
  border: 1px solid var(--line); animation: pop .35s ease-out;
}
.intro h1 { font: 650 24px/1.2 var(--serif); margin: 0 0 8px; letter-spacing: -.01em; }
.intro p { margin: 0 0 14px; color: var(--ink-2); }
.hints { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; }
.hints li { font-size: 13px; background: #F5EFE6; padding: 5px 10px; border-radius: 999px; color: var(--ink-2); }
.hints b { color: var(--ink); }

.zoom {
  position: absolute; right: 16px; bottom: 16px; z-index: 5;
  display: flex; flex-direction: column; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
}
.zoom button { width: 46px; height: 46px; border: 0; background: none; font-size: 22px; font-weight: 500; cursor: pointer; display: grid; place-items: center; }
.zoom button + button { border-top: 1px solid var(--line); }
.zoom button:hover { background: #F5EFE6; }
.zoom svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.minimap {
  position: absolute; left: 16px; bottom: 16px; z-index: 5; width: 186px; height: 124px;
  background: rgb(255 255 255 / .94); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; cursor: pointer;
}
#mini-view { fill: rgb(194 65 12 / .08); stroke: var(--accent); stroke-width: 14; }

/* ---------- side panel / bottom sheet ---------- */

.panel {
  position: fixed; z-index: 15; top: calc(var(--top) + 14px); right: 16px; bottom: 16px; width: 400px;
  background: var(--card); border-radius: 20px; box-shadow: var(--shadow); border: 1px solid var(--line);
  overflow: auto; padding: 26px 24px 28px; animation: slide .3s cubic-bezier(.2, .8, .2, 1);
  overscroll-behavior: contain;
}
@keyframes slide { from { opacity: 0; transform: translateX(24px); } }
.panel-close {
  position: sticky; top: 0; float: right; margin: -10px -8px 0 8px;
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: #F2ECE3; font-size: 22px; cursor: pointer;
}
.panel-close:hover { background: #E8E0D4; }
.panel h2 { font: 650 26px/1.15 var(--serif); margin: 6px 0 10px; letter-spacing: -.01em; outline: none; }
.big-ico { display: block; font-size: 40px; margin-bottom: 8px; }
.panel h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 26px 0 10px; }
.eyebrow { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; }
.area-eyebrow { color: var(--c); font-weight: 600; }
.area-eyebrow i, .tag i, .list-area h2 i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; flex: none; }
.lede { color: var(--ink-2); margin: 0; }

.lv { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; letter-spacing: .01em; }
.lv-Beginner { background: #E1F2E6; color: #1E6B3B; }
.lv-Intermediate { background: #E3EBFA; color: #234C92; }
.lv-Advanced { background: #EFE5F9; color: #5E3590; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 0; }
.stats div { background: #F8F4EE; border-radius: 12px; padding: 10px 12px; }
.stats dt { font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stats dd { margin: 2px 0 0; font-weight: 650; font-size: 15px; line-height: 1.3; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-weight: 650; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn:hover { background: #F7F2EB; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.is-done, .btn.primary.is-done { background: var(--ok); border-color: var(--ok); color: #fff; }
.actions .btn.primary { flex: 1; }
.tip { font-size: 14px; color: var(--ink-2); margin: 10px 0 0; }

.outcomes { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.outcomes li { position: relative; padding-left: 28px; }
.outcomes li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 800; display: grid; place-items: center; margin-top: 2px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); cursor: pointer;
  font-size: 14px; font-weight: 500; text-align: left; text-decoration: none; color: var(--ink);
}
.tag:hover { border-color: var(--c); background: #FCFAF7; }

.mini-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mini-card {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); cursor: pointer;
}
.mini-card:hover { border-color: #D6C9B6; background: #FCFAF7; }
.mini-card .ico { font-size: 28px; }
.mini-card .body { flex: 1; display: grid; gap: 4px; }
.mini-card b { font-size: 16px; }
.mini-card .meta { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mini-card .go { font-size: 24px; color: var(--ink-3); }

.path { flex-wrap: wrap; gap: 4px; }
.path i { font-style: normal; color: var(--ink-3); }
.pc { border: 0; background: none; padding: 2px 4px; border-radius: 6px; color: var(--c); font-weight: 600; font-size: 14px; cursor: pointer; }
.pc:hover { background: #F5EFE6; }
.panel h2[style] { color: var(--c); }
.h-note { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink-3); margin-left: 6px; }
.kids { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.kid {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); border-left: 4px solid var(--c); background: var(--card);
}
.kid:hover { background: #FCFAF7; }
.kid .body { flex: 1; display: grid; gap: 2px; }
.kid b { font-size: 15px; }
.kid small { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.kid .n { min-width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; background: var(--c); color: #fff; font-weight: 700; font-size: 14px; }
.kid.is-empty { border-left-style: dashed; }
.kid.is-empty .n { background: #F2ECE3; color: var(--ink-3); }
.empty-state { margin-top: 22px; padding: 18px; border-radius: 14px; border: 2px dashed var(--line); background: #FCFAF7; }
.empty-state b { font-size: 16px; }
.empty-state p { margin: 6px 0 14px; color: var(--ink-2); }
.rules { margin: 0; display: grid; gap: 12px; }
.rules dt { font-weight: 700; }
.rules dd { margin: 2px 0 0; color: var(--ink-2); font-size: 15px; }
.tags.col { flex-direction: column; align-items: stretch; }
.tag span { display: grid; }
.tag small { font-size: 12px; color: var(--ink-3); }

/* ---------- list view ---------- */

.listview { padding: calc(var(--top) + 28px) 16px 60px; }
.list-inner { max-width: 1000px; margin: 0 auto; }
.listview h1 { font: 650 clamp(28px, 4vw, 40px)/1.15 var(--serif); margin: 0 0 8px; letter-spacing: -.015em; }
.listview .lede { font-size: 17px; max-width: 680px; }
.list-area { margin-top: 36px; }
.list-area h2 { display: flex; align-items: center; gap: 10px; font: 650 26px var(--serif); color: var(--c); margin: 0 0 4px; }
.list-area h2 small { font: 600 14px var(--sans); color: var(--ink-3); }
.list-area > p { margin: 0 0 14px; color: var(--ink-2); }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.cat { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 14px; padding: 4px 16px 12px; }
.cat summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 10px 0 6px; font-size: 16px; }
.cat summary::-webkit-details-marker { display: none; }
.cat .n { min-width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; background: var(--t); color: var(--c); font-weight: 700; font-size: 13px; }
.cat .scope { margin: 0 0 8px; font-size: 13px; color: var(--ink-2); }
.outline, .outline ul { list-style: none; margin: 0; padding: 0; }
.outline ul { padding-left: 16px; border-left: 2px solid var(--line); margin: 4px 0 4px 4px; }
.outline li { padding: 4px 0; font-size: 14px; }
.o-name { font-weight: 600; }
.is-empty > .o-name { font-weight: 500; color: var(--ink-2); }
.o-none { color: var(--ink-3); font-size: 12px; margin-left: 6px; }
.o-prompt { display: block; margin: 4px 0 0 2px; font-weight: 600; text-decoration: none; color: var(--accent-ink); }
.o-prompt:hover { text-decoration: underline; }
.suggest { margin-top: 40px; color: var(--ink-2); }

/* ---------- prompt page ---------- */

.page-prompt main { padding: calc(var(--top) + 28px) 16px 80px; }
.prompt-page { max-width: 760px; margin: 0 auto; }
.p-hero { display: grid; gap: 10px; }
.p-icon { width: 76px; height: 76px; border-radius: 22px; background: var(--card); box-shadow: var(--shadow-sm); border: 1px solid var(--line); display: grid; place-items: center; font-size: 42px; }
.p-hero h1 { font: 650 clamp(32px, 5vw, 46px)/1.08 var(--serif); margin: 4px 0 0; letter-spacing: -.02em; }
.p-hero .lede { font-size: 18px; }
.p-hero .best { font-size: 15px; color: var(--ink-2); margin: 0; }
.p-hero .best b { color: var(--ink); }
.p-cta {
  margin-top: 26px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: var(--shadow-sm);
}
.p-cta .actions { margin-top: 0; }
.howto { list-style: none; counter-reset: s; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.howto li { counter-increment: s; font-size: 14px; color: var(--ink-2); background: #F8F4EE; border-radius: 12px; padding: 12px; }
.howto li::before { content: counter(s); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.howto b { color: var(--ink); }
.p-section { margin-top: 34px; }
.p-section h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 0 0 12px; }
.journey { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; counter-reset: j; }
.journey li { counter-increment: j; display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.journey li::before { content: counter(j); width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-size: 12px; font-weight: 800; }

.reveal { margin-top: 34px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.reveal > summary { list-style: none; cursor: pointer; padding: 16px 18px; font-weight: 650; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.reveal > summary::-webkit-details-marker { display: none; }
.reveal > summary::after { content: "Show"; font-size: 14px; color: var(--accent-ink); }
.reveal[open] > summary::after { content: "Hide"; }
.reveal > summary small { display: block; font-weight: 400; color: var(--ink-2); font-size: 14px; }
.reveal-body { padding: 0 18px 18px; }
.sec-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sec-row .btn { min-height: 36px; padding: 0 12px; font-size: 13px; font-weight: 600; }
.editor {
  width: 100%; min-height: 420px; resize: vertical; padding: 16px; border-radius: 12px;
  border: 1px solid var(--line); background: #FCFAF7; color: var(--ink);
  font: 14px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.editor:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgb(29 78 216 / .15); }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.foot { margin-top: 56px; color: var(--ink-3); font-size: 14px; }

/* ---------- small screens ---------- */

@media (max-width: 899px) {
  .panel {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 64vh;
    border-radius: 22px 22px 0 0; padding: 22px 18px calc(24px + env(safe-area-inset-bottom));
    animation-name: rise;
  }
  .panel::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: #DDD3C5; }
  @keyframes rise { from { transform: translateY(40px); opacity: 0; } }
  .minimap { display: none; }
}
@media (max-width: 640px) {
  :root { --top: 60px; }
  .topbar { gap: 10px; padding: 0 10px; }
  .brand span { display: none; }
  .seg button { padding: 8px 12px; }
  .intro { top: auto; bottom: 16px; left: 16px; padding: 18px; }
  .intro h1 { font-size: 21px; }
  .bub-d1 { --s: 66px; }
  .bub-d1 .dot b { font-size: 24px; }
  .bub-d1 .dot small { font-size: 10px; }
  .lbl-sphere { font-size: 15px; }
  .rules-btn { width: 36px; height: 36px; padding: 0; border-radius: 50%; background: #F0E9DF; font-weight: 700; }
  .rules-btn .full { display: none; }
  .rules-btn .short { display: inline; }
  .zoom { bottom: auto; top: 64px; right: 12px; }
  .howto { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr 1fr; }
  .stats dd { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
