html, body { height: 100%; }
[hidden] { display: none !important; }
body {
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; min-height: 100dvh; overflow-x: hidden;
  background:
    radial-gradient(60% 55% at 70% 58%, rgba(132, 204, 22, 0.16), transparent 70%),
    radial-gradient(40% 30% at 68% 96%, rgba(132, 204, 22, 0.20), transparent 70%),
    var(--stage);
}
.top { display: flex; align-items: center; gap: 16px; padding: 16px clamp(16px, 4vw, 40px); }
.top .demo-tag { margin-left: auto; }
.top .cta { min-height: 40px; padding: 0 18px; font-size: 14px; }

.layout {
  display: grid; grid-template-columns: minmax(320px, 460px) 1fr; gap: clamp(16px, 3vw, 48px);
  padding: 0 clamp(16px, 4vw, 40px); align-items: center; min-height: 0; min-width: 0;
  width: 100%; max-width: 1760px; margin: 0 auto;
}
.panel, .stage { min-width: 0; }
.panel { display: grid; gap: 14px; align-content: center; padding: 12px 0; }
.panel h1 { font-size: clamp(30px, 3.4vw, 46px); font-weight: 700; }
.panel .body { color: var(--text-2); font-size: 16px; }
.points { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; color: var(--text); }
.points li { display: flex; gap: 10px; align-items: baseline; }
.points li::before { content: ''; flex: none; width: 14px; height: 2px; background: var(--brand); transform: translateY(-4px); }

.screen-card { margin-top: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(12, 16, 11, 0.72); backdrop-filter: blur(10px); padding: 14px; display: grid; gap: 10px; }
.screen-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.screen-label { display: block; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }
.screen-head strong { font-family: var(--font-brand); font-size: 16px; }
.hint { font-size: 13px; color: var(--text-3); }
.spots { display: flex; flex-wrap: wrap; gap: 8px; }
.spot-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; font-size: 14px; font-weight: 500; cursor: pointer; text-align: left;
  transition: border-color .2s, background .2s;
}
.spot-btn:hover, .spot-btn.hover { border-color: var(--brand-bright); background: rgba(132, 204, 22, 0.10); }
.spot-btn i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }
.spot-btn.info i { background: transparent; box-shadow: inset 0 0 0 2px var(--brand); }
.spot-btn[aria-pressed="true"] { border-color: var(--brand); background: rgba(132, 204, 22, 0.14); }
.note { font-size: 14px; color: var(--text); border-left: 2px solid var(--brand); padding: 4px 0 4px 12px; }
.caveat { font-size: 12px; color: var(--text-3); }

.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover:not(:disabled) { border-color: var(--brand-bright); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.text-btn { border: 0; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 500; padding: 10px 8px; cursor: pointer; border-radius: 8px; }
.text-btn:hover { color: var(--brand-bright); }

.stage { position: relative; height: min(76dvh, 820px); min-height: 440px; touch-action: pan-y; }
.stage::before { content: ''; position: absolute; left: 50%; bottom: 34px; width: min(70%, 520px); height: 70px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(132, 204, 22, 0.42), rgba(132, 204, 22, 0.10) 60%, transparent); filter: blur(14px); }
.stage canvas { touch-action: pan-y; position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; outline: none; }
.stage canvas.dragging { cursor: grabbing; }
.hot-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hot {
  position: absolute; left: 0; top: 0; width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 0; padding: 0; background: transparent;
  border-radius: 50%; cursor: pointer; pointer-events: auto; will-change: transform, opacity;
}
.hot::before, .hot::after { content: ''; position: absolute; inset: 12px; border-radius: 50%; }
.hot::before { background: var(--brand); box-shadow: 0 0 0 3px rgba(5, 7, 5, 0.55), 0 0 18px rgba(163, 230, 53, 0.9); }
.hot.info::before { background: rgba(5, 7, 5, 0.7); box-shadow: inset 0 0 0 3px var(--brand), 0 0 14px rgba(163, 230, 53, 0.7); }
.hot::after { border: 2px solid var(--brand-bright); animation: ping 1.8s ease-out infinite; }
.hot span {
  position: absolute; left: 50%; bottom: 44px; transform: translateX(-50%) translateY(4px); white-space: nowrap;
  background: rgba(5, 7, 5, 0.92); border: 1px solid var(--line-strong); color: var(--text); font-size: 12px; font-weight: 600;
  padding: 5px 10px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s;
}
.hot:hover span, .hot:focus-visible span, .hot.hover span { opacity: 1; transform: translateX(-50%); }
@keyframes ping { from { transform: scale(1); opacity: 0.9; } to { transform: scale(2.4); opacity: 0; } }

.stage-tools { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.drag-hint { font-size: 12px; color: var(--text-3); letter-spacing: 0.08em; text-transform: uppercase; padding-right: 8px; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 14px; pointer-events: none; }
.flat { position: absolute; inset: 0 0 44px; display: flex; align-items: center; justify-content: center; }
.flat img { height: 100%; width: auto; max-width: 100%; box-sizing: border-box; border-radius: 28px; border: 8px solid #1b1d1c; box-shadow: 0 30px 80px rgba(0,0,0,0.6); }

.chapters { display: flex; align-items: center; gap: 10px; padding: 12px clamp(16px, 4vw, 40px) calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(5, 7, 5, 0.7); backdrop-filter: blur(12px); }
.chapters ol { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.chapters ol::-webkit-scrollbar { display: none; }
.chapters li { flex: 1 0 auto; }
.chap {
  width: 100%; min-height: 44px; display: grid; gap: 6px; padding: 8px 10px 6px; border: 0; background: transparent; cursor: pointer; text-align: left;
  color: var(--text-3); font-size: 13px; font-weight: 600; white-space: nowrap; border-radius: 8px;
}
.chap::before { content: ''; height: 3px; border-radius: 2px; background: var(--line-strong); transition: background .3s; }
.chap:hover { color: var(--text); }
.chap[aria-current="true"] { color: var(--text); }
.chap[aria-current="true"]::before { background: var(--brand); }
.chap.done::before { background: var(--brand-deep); }
.chap em { font-style: normal; color: var(--brand-bright); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; margin-left: 6px; }

@media (min-width: 1500px) {
  .layout { grid-template-columns: minmax(420px, 600px) 1fr; }
  .panel { gap: 18px; }
  .panel h1 { font-size: clamp(46px, 3.3vw, 64px); }
  .panel .body { font-size: 19px; }
  .points { font-size: 16px; gap: 9px; }
  .stage { height: min(78dvh, 980px); }
  .top, .chapters { padding-left: max(40px, calc((100vw - 1760px) / 2 + 40px)); padding-right: max(40px, calc((100vw - 1760px) / 2 + 40px)); }
}
@media (max-width: 860px) {
  body { grid-template-rows: auto auto auto; }
  .top { padding-top: 12px; padding-bottom: 4px; }
  .top .demo-tag { display: none; }
  .top .cta { margin-left: auto; min-height: 44px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .stage { order: -1; height: 60dvh; min-height: 400px; margin: 0 calc(-1 * clamp(16px, 4vw, 40px)); }
  .panel { padding: 6px 0 28px; gap: 12px; }
  .panel h1 { font-size: clamp(28px, 7.6vw, 38px); }
  .screen-card { padding: 12px; }
  .spot-btn { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .chapters { position: sticky; bottom: 0; z-index: 5; gap: 6px; padding-top: 6px; }
  .chapters .icon-btn { display: none; }
  .chap { min-height: 48px; }
  .drag-hint { display: none; }
  .hot span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hot::after { animation: none; opacity: 0.5; transform: scale(1.5); }
  * { transition: none !important; }
}
