/* ─────────────────────────────────────────────
   3ASEM · a sketchbook left on an arcade cabinet
   ───────────────────────────────────────────── */

:root {
  --paper:   oklch(97% 0.012 92);
  --paper-2: oklch(94.5% 0.016 90);
  --rule:    oklch(87% 0.02 245);
  --frame:   oklch(64% 0.006 260);
  --frame-l: oklch(74% 0.006 260);
  --ink:     oklch(21% 0.012 60);
  --ink-2:   oklch(29% 0.014 60);
  --ink-3:   oklch(42% 0.012 60);
  --muted:   oklch(52% 0.012 60);
  --cream:   oklch(95% 0.035 90);

  --yellow:  oklch(84% 0.16 87);
  --butter:  oklch(90% 0.09 92);
  --green:   oklch(63% 0.15 155);
  --mint:    oklch(88% 0.07 165);
  --pink:    oklch(66% 0.21 2);
  --blue:    oklch(50% 0.2 266);
  --orange:  oklch(68% 0.18 42);

  --f-pixel: "Jersey 10", "Silkscreen", ui-monospace, monospace;
  --f-hand:  "Gochi Hand", "Comic Sans MS", cursive;
  --f-sans:  "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --f-mono:  "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --f-ar:    "Readex Pro", "Geeza Pro", sans-serif;
  --f-ar-d:  "Lalezar", "Readex Pro", sans-serif;

  --gutter: clamp(8px, 3.2vw, 52px);
  --pad: clamp(20px, 5vw, 88px);
  --hud-h: 46px;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-quart: cubic-bezier(.25, 1, .5, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.55;
  background-color: var(--paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.is-booting { overflow: hidden; }
::selection { background: var(--yellow); color: var(--ink); }
a { color: inherit; }
img, canvas, svg { display: block; }
button { font: inherit; color: inherit; }

.hand { font-family: var(--f-hand); }
.muted-ink { color: var(--ink-3); }
.dark .muted-ink { color: oklch(70% 0.012 80); }

/* lucide sizing */
[data-lucide], .lucide { width: 1em; height: 1em; stroke-width: 2.25; flex: none; }

/* ───────── SHEET ───────── */
.sheet {
  position: relative;
  width: 100%;
  background: var(--paper);
}

.lvl { position: relative; }
.dark { background: var(--ink); color: var(--paper); }

.lvl-start, .lvl-dilemma, .lvl-world, .lvl-inventory, .lvl-quests {
  background-color: var(--paper);
  background-image: repeating-linear-gradient(180deg, transparent 0 31px, var(--rule) 31px 32px);
}
.graph {
  background-color: var(--paper);
  background-image:
    linear-gradient(oklch(89% 0.025 200 / .7) 1px, transparent 1px),
    linear-gradient(90deg, oklch(89% 0.025 200 / .7) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ───────── shared type ───────── */
.lvl-kicker {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 22px;
  font: 500 12px/1 var(--f-mono);
  letter-spacing: .14em;
}
.kick-chip {
  display: inline-block;
  padding: 6px 8px 5px;
  background: var(--yellow); color: var(--ink);
  font: 500 11px/1 var(--f-mono); letter-spacing: .12em;
}
.lvl-title {
  margin: 0 0 22px;
  font-family: var(--f-sans);
  font-weight: 700;
  font-size: clamp(32px, 4.6vw, 66px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-variation-settings: "opsz" 96;
  text-wrap: balance;
}
.lvl-lede {
  margin: 0;
  max-width: 56ch;
  font-size: clamp(16px, 1.25vw, 19px);
  color: var(--ink-3);
  text-wrap: pretty;
}
.dark .lvl-lede { color: oklch(78% 0.012 80); }

/* ───────── BOOT ───────── */
.boot {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--ink); color: var(--paper);
}
.boot-inner { text-align: center; }
.boot-name {
  margin: 0;
  font: 400 clamp(84px, 16vw, 200px)/.8 var(--f-pixel);
  letter-spacing: .02em;
}
.boot-bar {
  width: min(320px, 70vw); height: 14px; margin: 26px auto 12px;
  border: 2px solid var(--paper); padding: 2px;
}
.boot-bar span { display: block; height: 100%; width: 0; background: var(--yellow); }
.boot-label, .boot-start { margin: 0; font: 500 12px/1 var(--f-mono); letter-spacing: .2em; }
.boot-start { margin-top: 18px; opacity: 0; color: var(--yellow); }
.boot-start.on { animation: blink .5s steps(1) 3; opacity: 1; }
.boot-wipe { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }
.boot.done { background: transparent; }
.boot.done .boot-inner { visibility: hidden; }
.boot.gone { display: none; }

@keyframes blink { 50% { opacity: 0; } }
.blink { animation: blink 1s steps(1) infinite; }

/* ───────── HUD ───────── */
.hud {
  position: fixed; z-index: 50;
  top: 10px; left: 50%; translate: -50% 0;
  width: calc(100% - 24px);
  max-width: 1560px;
  height: var(--hud-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 8px 0 6px;
  background: oklch(98.5% 0.008 92);
  border: 1.5px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font: 500 11px/1 var(--f-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.hud-logo {
  display: grid; place-items: center;
  width: 32px; height: 32px; flex: none;
  background: var(--pink); color: var(--paper);
  border-radius: 50%;
  text-decoration: none;
  font: 400 26px/1 var(--f-pixel);
}
.hud-logo span { translate: 0 1px; }
.hud-nav { display: flex; align-items: stretch; height: 100%; overflow-x: auto; scrollbar-width: none; }
.hud-nav::-webkit-scrollbar { display: none; }
.hud-nav a {
  display: flex; align-items: center; gap: 6px;
  padding: 0 12px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .25s var(--ease-out), color .25s var(--ease-out);
}
.hud-nav a:hover { color: var(--blue); }
.hud-nav a.is-active { background: var(--yellow); color: var(--ink); }
.hud-nav a.is-done:not(.is-active) .lucide { color: var(--green); }
.hud-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.hud-xp { display: flex; align-items: center; gap: 8px; }
.hud-lvl b { font: 400 18px/1 var(--f-pixel); margin-left: 2px; letter-spacing: 0; }
.hud-xpbar {
  position: relative; width: 92px; height: 12px;
  border: 1.5px solid var(--ink); padding: 1.5px;
}
.hud-xpbar i {
  display: block; height: 100%; width: 100%;
  transform-origin: left; transform: scaleX(0);
  background: repeating-linear-gradient(90deg, var(--green) 0 6px, transparent 6px 8px);
}
.hud-xp-n { font-variant-numeric: tabular-nums; min-width: 4ch; }
.hud-trophy {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; border: 0; background: var(--mint); cursor: pointer;
  font: inherit;
}
.hud-trophy.bump { animation: bump .6s var(--ease-out); }
@keyframes bump { 0% { background: var(--yellow); } 100% { background: var(--mint); } }
.hud-contact {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px; border: 1.5px solid var(--ink);
  text-decoration: none;
  transition: background-color .25s var(--ease-out), color .25s var(--ease-out);
}
.hud-contact:hover { background: var(--ink); color: var(--paper); }

/* achievements */
.ach-panel {
  position: fixed; z-index: 51; top: calc(10px + var(--hud-h) + 8px); right: 16px;
  width: 290px; padding: 14px;
  background: var(--ink); color: var(--paper);
  box-shadow: 4px 4px 0 var(--pink);
  font: 500 11px/1.3 var(--f-mono); letter-spacing: .06em;
}
.ach-panel-title { margin: 0 0 10px; color: var(--yellow); letter-spacing: .16em; }
.ach-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ach-list li { display: flex; gap: 8px; align-items: center; opacity: .38; }
.ach-list li.got { opacity: 1; }
.ach-list li .lucide { color: var(--yellow); }
.ach-list li:not(.got) .lucide { color: var(--paper); }

.toasts { position: fixed; z-index: 60; left: 16px; bottom: 16px; display: grid; gap: 8px; pointer-events: none; }
.toast {
  display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center;
  min-width: 250px; padding: 10px 14px 10px 10px;
  background: var(--ink); color: var(--paper);
  border: 2px solid var(--paper); outline: 2px solid var(--ink);
  font: 500 11px/1.25 var(--f-mono); letter-spacing: .08em;
}
.toast-ic { display: grid; place-items: center; width: 40px; height: 40px; background: var(--yellow); color: var(--ink); font-size: 20px; }
.toast b { display: block; font: 400 22px/1 var(--f-pixel); letter-spacing: .02em; margin-top: 2px; }
.toast em { font-style: normal; color: var(--green); }

/* ═════════ LEVEL 01 · START ═════════ */
.lvl-start { height: 100vh; height: 100svh; }
.start-pin { position: relative; height: 100vh; height: 100svh; overflow: hidden; }
.start-stage {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(var(--hud-h) + 40px) 20px 40px;
  text-align: center;
}
.name-block { position: relative; display: flex; flex-direction: column; align-items: center; }
.my-name { margin: 0; font-size: 17px; line-height: 1; }
.my-squiggle { width: 44px; height: 8px; margin: 2px 0 10px; }
.my-squiggle path, .name-rect path, .arrow path, .hl-under path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.my-squiggle path { stroke: var(--ink); stroke-width: 1.6; }

.name-box { position: relative; padding: clamp(10px, 1.6vw, 22px) clamp(22px, 3vw, 44px) clamp(4px, .8vw, 12px); }
.name-rect { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.name-rect path { stroke: var(--orange); stroke-width: 2.4; }
.pixel-name {
  margin: 0;
  font: 400 clamp(110px, 17vw, 250px)/.78 var(--f-pixel);
  letter-spacing: .015em;
  color: var(--ink);
  display: flex;
}
.pixel-name span { display: inline-block; }

.tag {
  position: absolute; white-space: nowrap;
  padding: 7px 10px 6px;
  font: 500 10.5px/1 var(--f-mono); letter-spacing: .14em;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1.5px oklch(21% 0.012 60 / .12);
}
.tag-mint { background: var(--mint); }
.tag-butter { background: var(--butter); }
.tag-a { left: -14%; top: 4%; rotate: -4deg; }
.tag-b { right: -16%; top: 6%; rotate: 3deg; }
.note {
  position: absolute; padding: 9px 12px 8px;
  font-size: 15px; line-height: 1.12; text-align: left; white-space: nowrap;
  box-shadow: 0 1px 0 oklch(21% 0.012 60 / .1);
}
.note-yellow { background: var(--yellow); }
.note-mint { background: var(--mint); }
.note-c { left: -22%; bottom: 8%; rotate: -2deg; }
.note-d { right: -20%; bottom: 10%; rotate: 2.5deg; }
.arrow { position: absolute; width: 36px; height: 28px; }
.arrow path { stroke: var(--ink); stroke-width: 1.6; }
.arrow-c { left: -3%; bottom: 17%; }
.arrow-d { right: -1%; bottom: 20%; }

.status {
  display: flex; align-items: center; gap: 8px;
  margin: 16px 0 0;
  font: 500 10.5px/1 var(--f-mono); letter-spacing: .16em;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px oklch(50% 0.2 266 / .18); animation: blink 1.6s steps(1) infinite; }

.headline {
  margin: clamp(28px, 4.5vh, 48px) 0 26px;
  font-weight: 650;
  font-size: clamp(30px, 3.6vw, 54px);
  line-height: 1.06;
  letter-spacing: -0.035em;
}
.hl-word { position: relative; display: inline-block; color: var(--blue); }
.hl-under { position: absolute; left: -2%; right: 0; bottom: -10px; width: 104%; height: 14px; }
.hl-under path { stroke: var(--pink); stroke-width: 3.5; }

.btn-start {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 16px 6px 6px;
  background: var(--ink); color: var(--paper);
  text-decoration: none;
  font: 500 11px/1 var(--f-mono); letter-spacing: .18em; text-transform: uppercase;
  box-shadow: 3px 3px 0 var(--pink);
  transition: box-shadow .25s var(--ease-out), translate .25s var(--ease-out);
}
.btn-start:hover { box-shadow: 0 0 0 var(--pink); translate: 3px 3px; }
.btn-start-key { display: grid; place-items: center; width: 24px; height: 24px; background: var(--blue); font-size: 10px; }
.scroll-hint { display: flex; align-items: center; gap: 6px; margin: 22px 0 0; font-size: 16px; color: var(--ink-3); }

/* stickers */
.stickers { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.sticker {
  position: absolute;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
  will-change: transform;
}
.sticker:active { cursor: grabbing; }
.sk-inner {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 10px 7px;
  background: oklch(99% 0.006 92);
  border-radius: 14px;
  box-shadow: 0 0 0 1px oklch(21% 0.012 60 / .08), 0 2px 0 oklch(21% 0.012 60 / .14);
}
.sk-label { font: 15px/1 var(--f-hand); white-space: nowrap; color: var(--ink); }
.sk-ic {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 10px;
  font-size: 24px;
}
.sk-round .sk-ic { background: none !important; width: 36px; height: 30px; }
.sk-tag .sk-inner {
  flex-direction: row; border-radius: 0; padding: 10px 14px;
  -webkit-mask: var(--zig); mask: var(--zig);
}
.sk-tag .sk-ic { width: 26px; height: 26px; font-size: 18px; background: none !important; }
.sk-tag .sk-label { font: 600 15px/1 var(--f-sans); letter-spacing: -.01em; }
.sk-note .tape { top: -10px; z-index: 2; }
.sticker .tape { position: absolute; left: 50%; translate: -50% 0; width: 46px; height: 16px; background: oklch(92% 0.04 240 / .75); rotate: -4deg; }

:root {
  --zig:
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% 100% / 10px 51% repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) 50% 0 / 10px 51% repeat-x;
}

.mini-cube { display: grid; grid-template-columns: repeat(3, 12px); gap: 2px; padding: 3px; background: var(--ink); }
.mini-cube i { width: 12px; height: 12px; }
.mini-matrix { display: grid; grid-template-columns: repeat(2, 22px); gap: 2px; font: 700 9px/1 var(--f-mono); }
.mini-matrix i { display: grid; place-items: center; height: 18px; background: var(--paper-2); font-style: normal; }
.mini-matrix i:first-child { background: var(--mint); }
.phi { font: 700 34px/1 var(--f-sans); font-style: italic; }
.sk-bust { width: 40px; height: 48px; image-rendering: pixelated; }

.burst {
  position: absolute; inset: 0; z-index: 5;
  width: 100%; height: 100%;
  image-rendering: pixelated;
  pointer-events: none;
}
.stage-clear {
  position: absolute; z-index: 6; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin: 0; pointer-events: none;
  color: var(--paper); opacity: 0;
}
.stage-clear span { font: 500 13px/1 var(--f-mono); letter-spacing: .4em; margin-bottom: 8px; }
.stage-clear b { font: 400 clamp(64px, 10vw, 168px)/.82 var(--f-pixel); font-weight: 400; letter-spacing: .01em; text-align: center; }
.stage-clear span { color: var(--yellow); }

/* ═════════ LEVEL 02 · CUBE ═════════ */
.lvl-cube { overflow: hidden; }
.cube-pin {
  position: relative;
  height: 100vh; height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(20px, 3vw, 60px);
  padding: calc(var(--hud-h) + 52px) var(--pad) 40px;
  align-items: center;
}
.cube-copy .lvl-title { font-size: clamp(28px, 3.3vw, 50px); }
.cube-copy .lvl-title:first-line { font-variant-numeric: tabular-nums; }
.cube-copy .lvl-lede { margin-bottom: 26px; }

.faces { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; }
.faces li {
  display: grid; grid-template-columns: 14px 1fr; column-gap: 10px; align-items: baseline;
  padding: 9px 0;
  border-top: 1px solid oklch(100% 0 0 / .12);
  opacity: .28;
  transition: opacity .5s var(--ease-out);
}
.faces li.on { opacity: 1; }
.face-sw { width: 12px; height: 12px; border-radius: 3px; background: var(--c); translate: 0 1px; }
.faces b { font-weight: 600; font-size: 15px; }
.faces em { grid-column: 2; font-style: normal; font-size: 13px; color: oklch(72% 0.012 80); }

.cube-stage { position: relative; height: 100%; min-height: 0; display: flex; flex-direction: column; }
.cube-canvas-wrap { position: relative; flex: 1; min-height: 0; }
.cube-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.cube-canvas:active { cursor: grabbing; }
.cube-hud { padding-top: 10px; border-top: 1px dashed oklch(100% 0 0 / .2); }
.cube-moves {
  display: flex; gap: 6px; flex-wrap: wrap;
  font: 400 26px/1 var(--f-pixel);
  min-height: 30px;
}
.cube-moves span { padding: 2px 6px 0; color: oklch(55% 0.01 80); transition: color .3s, background-color .3s; }
.cube-moves span.done { color: var(--paper); }
.cube-moves span.now { background: var(--yellow); color: var(--ink); }
.cube-meta { display: flex; gap: 22px; align-items: center; margin-top: 10px; font: 500 11px/1 var(--f-mono); letter-spacing: .14em; color: oklch(72% 0.012 80); }
.cube-meta b { color: var(--paper); font-weight: 500; }
.cube-timer { font-variant-numeric: tabular-nums; color: var(--yellow); }
.cube-drag { margin-left: auto; display: flex; gap: 6px; align-items: center; font-size: 16px; letter-spacing: 0; color: var(--paper); }
.cube-solved {
  position: absolute; left: 50%; top: 44%; translate: -50% -50%;
  margin: 0; pointer-events: none;
  padding: 2px 18px 0;
  font: 400 clamp(54px, 7vw, 110px)/1 var(--f-pixel);
  background: var(--green); color: var(--ink);
  rotate: -6deg; scale: 0; opacity: 0;
}

/* ═════════ LEVEL 03 · PROOF ═════════ */
.lvl-proof { padding: clamp(90px, 12vh, 150px) var(--pad) clamp(70px, 10vh, 130px); }
.proof-head { max-width: 760px; }
.golden { margin: clamp(30px, 6vh, 70px) 0 0; position: relative; }
.golden-svg { width: min(100%, 980px); height: auto; margin-left: auto; overflow: visible; }
.golden figcaption { text-align: right; font-size: 19px; color: var(--ink-3); max-width: 980px; margin-left: auto; margin-top: 8px; }
.g-frame, .g-line { fill: none; stroke: var(--ink); stroke-width: 2.4; }
.g-circ, .g-diag { fill: none; stroke: var(--blue); stroke-width: 1; stroke-dasharray: 4 6; opacity: .45; }
.g-spiral { fill: none; stroke: var(--pink); stroke-width: 5; stroke-linecap: round; }
.g-labels text { font: 400 54px/1 var(--f-pixel); fill: var(--ink); text-anchor: middle; }
.g-labels text.sm { font-size: 36px; }
.g-labels text.xs { font-size: 22px; }
.hand-svg { font: 24px var(--f-hand); fill: var(--blue); }
.g-arrow { fill: none; stroke: var(--blue); stroke-width: 1.6; stroke-linecap: round; }

/* ═════════ LEVEL 04 · DILEMMA ═════════ */
.lvl-dilemma { padding: clamp(90px, 12vh, 150px) var(--pad); border-top: 2px solid var(--ink); }
.dilemma-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(30px, 5vw, 90px); align-items: center; }
.dilemma-rules { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 8px; font-size: 15px; color: var(--ink-3); }
.dilemma-rules b { display: inline-block; min-width: 54px; font: 400 24px/1 var(--f-pixel); color: var(--ink); }

.cabinet {
  position: relative;
  padding: 16px;
  background: var(--blue);
  color: var(--paper);
  box-shadow: 8px 8px 0 var(--ink);
  border: 2px solid var(--ink);
}
.cab-top { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 12px; font: 500 11px/1 var(--f-mono); letter-spacing: .16em; }
.cab-round b { font: 400 22px/1 var(--f-pixel); color: var(--yellow); }
.cab-screen {
  position: relative;
  padding: 18px;
  background: var(--ink);
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px oklch(100% 0 0 / .06), inset 0 0 40px oklch(0% 0 0 / .5);
  overflow: hidden;
}
.cab-screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(180deg, oklch(100% 0 0 / .035) 0 1px, transparent 1px 3px); }
.pd-players { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-bottom: 16px; }
.pd-p { display: flex; flex-direction: column; gap: 4px; }
.pd-them { text-align: right; align-items: flex-end; }
.pd-label { font: 500 10.5px/1 var(--f-mono); letter-spacing: .18em; color: oklch(72% 0.012 80); }
.pd-score { font: 400 64px/.8 var(--f-pixel); font-weight: 400; font-variant-numeric: tabular-nums; }
.pd-you .pd-score { color: var(--yellow); }
.pd-them .pd-score { color: var(--pink); }
.pd-vs { font: 400 28px/1 var(--f-pixel); color: oklch(55% 0.01 80); }
.pd-matrix {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  margin: 26px 0 14px 26px;
}
.pd-axis { position: absolute; font: 500 9.5px/1 var(--f-mono); letter-spacing: .16em; color: oklch(65% 0.012 80); }
.pd-axis-top { top: -16px; left: 0; }
.pd-axis-side { left: -24px; top: 50%; writing-mode: vertical-rl; rotate: 180deg; translate: 0 -50%; }
.pd-cell {
  display: flex; align-items: baseline; justify-content: center; gap: 2px;
  padding: 12px 0 8px;
  background: oklch(28% 0.014 60);
  font: 400 30px/1 var(--f-pixel);
  color: oklch(70% 0.012 80);
  transition: background-color .3s var(--ease-out), color .3s var(--ease-out);
}
.pd-cell b { font-weight: 400; color: var(--yellow); }
.pd-cell i { font-style: normal; color: var(--pink); }
.pd-cell.hit { background: var(--paper); color: var(--ink); }
.pd-history { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 0; margin: 0 0 12px; }
.pd-history li { height: 26px; display: grid; grid-template-rows: 1fr 1fr; gap: 2px; background: oklch(28% 0.014 60); }
.pd-history li span { display: block; }
.pd-history li .C { background: var(--green); }
.pd-history li .D { background: var(--pink); }
.pd-msg { margin: 0; min-height: 3.1em; font: 500 12px/1.5 var(--f-mono); letter-spacing: .04em; color: var(--paper); }
.pd-msg b { color: var(--yellow); font-weight: 500; }
.cab-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.pd-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 10px;
  border: 2px solid var(--ink);
  font: 500 12px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--ink);
  transition: translate .12s var(--ease-out), box-shadow .12s var(--ease-out);
}
.pd-btn span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--paper); font: 400 20px/1 var(--f-pixel); }
.pd-btn:active, .pd-btn.press { translate: 0 4px; box-shadow: 0 1px 0 var(--ink); }
.pd-btn:disabled { opacity: .45; cursor: not-allowed; }
.pd-c { background: var(--green); color: var(--ink); }
.pd-d { background: var(--pink); color: var(--ink); }
.pd-reset {
  display: flex; align-items: center; gap: 8px; margin: 12px auto 0;
  padding: 8px 12px; border: 0; background: var(--yellow); color: var(--ink);
  font: 500 11px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; cursor: pointer;
}
.pd-reset[hidden] { display: none; }

/* ═════════ LEVEL 06 · WORLD ═════════ */
.lvl-world { padding: clamp(90px, 12vh, 150px) var(--pad); overflow: hidden; }
.world-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(20px, 4vw, 70px); align-items: center; }
.world-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 34px; }
.world-h { margin: 0 0 10px; font: 500 10.5px/1 var(--f-mono); letter-spacing: .18em; color: var(--ink-3); }
.places { list-style: none; margin: 0; padding: 0; }
.places li {
  display: flex; align-items: baseline; gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed oklch(21% 0.012 60 / .2);
  font-weight: 600; font-size: 19px; letter-spacing: -.015em;
  cursor: pointer;
  transition: color .2s var(--ease-out);
}
.places li em { margin-left: auto; font: 500 10px/1 var(--f-mono); letter-spacing: .1em; font-style: normal; color: var(--muted); text-transform: uppercase; }
.places li:hover, .places li.on { color: var(--blue); }
.pin { width: 9px; height: 9px; flex: none; translate: 0 -1px; }
.pin-pink { background: var(--pink); }
.pin-blue { background: var(--blue); }
.langs { margin-top: 30px; display: grid; gap: 8px; }
.lang { display: grid; grid-template-columns: 96px 1fr 60px; gap: 12px; align-items: center; }
.lang-word { font-weight: 600; font-size: 18px; }
.lang-word[lang="ar"] { font-family: var(--f-ar); text-align: left; }
.lang em { font: 500 10px/1 var(--f-mono); letter-spacing: .14em; font-style: normal; text-transform: uppercase; color: var(--green); }
.meter { height: 10px; border: 1.5px solid var(--ink); padding: 1.5px; }
.meter i { display: block; height: 100%; width: calc(var(--v, 0) * 100%); background: repeating-linear-gradient(90deg, var(--ink) 0 5px, transparent 5px 7px); transform-origin: left; }

.globe-wrap { position: relative; }
.globe { cursor: grab; touch-action: pan-y; }
.globe:active { cursor: grabbing; }
.globe-hint { position: absolute; top: 6%; right: 2%; display: flex; gap: 6px; align-items: center; margin: 0; font-size: 17px; color: var(--ink-3); rotate: 4deg; }
.globe-readout { position: absolute; left: 0; bottom: 2%; margin: 0; font: 500 10.5px/1 var(--f-mono); letter-spacing: .14em; color: var(--ink-3); }

/* ═════════ LEVEL 07 · QUESTS ═════════ */
.lvl-quests { padding: clamp(90px, 12vh, 150px) var(--pad) clamp(60px, 10vh, 120px); border-top: 2px solid var(--ink); }
.quests-head { margin-bottom: clamp(30px, 5vh, 60px); }
.quest-stack { display: grid; gap: clamp(26px, 4vh, 44px); }
.quest { position: sticky; top: calc(var(--hud-h) + 26px); }
.q-main { --qbg: var(--ink); --qfg: var(--paper); }
.q-aaa { --qbg: var(--yellow); --qfg: var(--ink); top: calc(var(--hud-h) + 46px); }
.q-glitch { --qbg: var(--pink); --qfg: var(--ink); top: calc(var(--hud-h) + 66px); }
.q-tabs { display: flex; align-items: flex-end; height: 34px; }
.q-tab {
  display: flex; align-items: center; height: 100%;
  padding: 0 28px 0 16px;
  font: 500 11px/1 var(--f-mono); letter-spacing: .16em;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 100%, 0 100%);
}
.q-tab-blue { background: var(--blue); color: var(--paper); }
.q-tab-ink { background: var(--ink); color: var(--paper); }
.q-tab-yellow { background: var(--yellow); color: var(--ink); }
.q-tab-ghost {
  display: flex; align-items: center; height: 100%;
  margin-left: -10px; padding: 0 30px 0 26px;
  background: var(--qbg); color: var(--qfg);
  font: 500 11px/1 var(--f-mono); letter-spacing: .16em;
  clip-path: polygon(14px 0, calc(100% - 18px) 0, 100% 100%, 0 100%);
}
.q-body {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 56px);
  min-height: min(68vh, 600px);
  padding: clamp(24px, 3.4vw, 48px);
  background: var(--qbg); color: var(--qfg);
}
.q-date { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; font: 500 10.5px/1 var(--f-mono); letter-spacing: .16em; }
.q-date .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.q-name { margin: 0 0 18px; font-weight: 700; font-size: clamp(44px, 5.4vw, 84px); line-height: .92; letter-spacing: -0.045em; }
.q-name [lang="ar"] { font-family: var(--f-ar-d); font-weight: 400; letter-spacing: 0; color: var(--yellow); font-size: .82em; margin-left: .2em; }
.q-text { margin: 0 0 22px; max-width: 54ch; font-size: clamp(15px, 1.15vw, 17.5px); line-height: 1.55; opacity: .88; text-wrap: pretty; }
.q-objectives { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 7px; font: 500 12px/1.3 var(--f-mono); letter-spacing: .04em; }
.q-objectives li { display: flex; gap: 10px; align-items: center; }
.q-objectives li::before { content: ""; flex: none; width: 12px; height: 12px; border: 1.5px solid currentColor; }
.q-objectives li.done { opacity: .6; text-decoration: line-through; text-decoration-thickness: 1px; }
.q-objectives li.done::before { background: currentColor; box-shadow: inset 0 0 0 2px var(--qbg); }
.q-objectives li.live::before { background: var(--green); border-color: var(--green); animation: blink 1.2s steps(1) infinite; }
.q-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding-bottom: 3px; border-bottom: 1.5px solid currentColor;
  font: 500 11px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; text-decoration: none;
}
.q-link:hover { color: var(--blue); }
.q-main .q-link:hover { color: var(--yellow); }

.q-visual { position: relative; min-height: 320px; overflow: hidden; }

/* Nefelha visual */
.nef-visual { display: grid; place-items: center; background: var(--blue); }
.nef-visual::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(oklch(100% 0 0 / .18) 1.2px, transparent 1.4px); background-size: 18px 18px; }
.nef-card { position: relative; width: min(78%, 330px); padding: 18px; background: var(--paper); color: var(--ink); border-radius: 18px; rotate: -3deg; box-shadow: 8px 8px 0 var(--ink); }
.nef-top { display: flex; justify-content: space-between; align-items: center; font: 500 12px/1 var(--f-ar); }
.nef-streak { display: flex; align-items: center; gap: 4px; padding: 5px 8px; background: var(--yellow); border-radius: 99px; font: 400 18px/1 var(--f-pixel); }
.nef-word { margin: 16px 0 14px; font: 400 clamp(54px, 6vw, 80px)/1 var(--f-ar-d); text-align: center; color: var(--blue); }
.nef-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; direction: rtl; }
.nef-opts span { padding: 10px; text-align: center; border: 2px solid var(--ink); border-radius: 10px; font: 600 16px/1 var(--f-ar); }
.nef-opts span.ok { background: var(--green); color: var(--paper); border-color: var(--green); }
.nef-xp { margin-top: 14px; height: 10px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.nef-xp i { display: block; height: 100%; width: 64%; background: var(--pink); border-radius: 99px; }
.nef-board { position: absolute; right: 6%; bottom: 7%; width: 168px; padding: 12px; background: var(--ink); color: var(--paper); rotate: 4deg; font: 500 10px/1 var(--f-mono); letter-spacing: .1em; box-shadow: 5px 5px 0 var(--yellow); }
.nef-board p { margin: 0 0 8px; color: var(--yellow); }
.nef-board ol { margin: 0; padding-left: 16px; display: grid; gap: 6px; }
.nef-board li { display: list-item; }
.nef-board li b { font-weight: 500; }
.nef-board li i { float: right; font-style: normal; color: var(--mint); }

/* AAA visual */
.aaa-visual { background: var(--ink); }
.dunes { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.aaa-load { position: absolute; left: 18px; right: 18px; bottom: 16px; display: flex; align-items: center; gap: 12px; color: var(--paper); font: 500 10.5px/1 var(--f-mono); letter-spacing: .18em; }
.aaa-load i { flex: 1; height: 8px; border: 1.5px solid var(--paper); position: relative; overflow: hidden; }
.aaa-load i::after { content: ""; position: absolute; inset: 1.5px; right: auto; width: 30%; background: var(--yellow); animation: load 3.4s steps(14) infinite; }
@keyframes load { from { width: 0; } to { width: calc(100% - 3px); } }

/* Glitch visual */
.glitch-word { position: relative; }
.glitch-word::before, .glitch-word::after { content: attr(data-text); position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.q-glitch.is-glitching .glitch-word::before { opacity: 1; color: var(--blue); translate: -3px 0; clip-path: inset(10% 0 55% 0); }
.q-glitch.is-glitching .glitch-word::after { opacity: 1; color: var(--yellow); translate: 3px 0; clip-path: inset(60% 0 8% 0); }
.glitch-visual { display: grid; place-items: center; background: var(--ink); }
.glitch-visual::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 22px, oklch(100% 0 0 / .04) 22px 23px); }
.bar { position: relative; width: min(76%, 330px); rotate: 6deg; }
.bar-wrap {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 118px; background: var(--yellow); color: var(--ink);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 94% 88%, 88% 100%, 82% 88%, 76% 100%, 70% 88%, 64% 100%, 58% 90%, 0 100%);
  transition: translate .8s var(--ease-out);
}
.bar-brand { position: relative; font: 400 64px/.8 var(--f-pixel); letter-spacing: .04em; }
.bar-brand::before, .bar-brand::after { content: attr(data-text); position: absolute; inset: 0; mix-blend-mode: multiply; }
.bar-brand::before { color: var(--pink); translate: -3px 0; clip-path: inset(0 0 60% 0); }
.bar-brand::after { color: var(--blue); translate: 3px 0; clip-path: inset(55% 0 0 0); }
.bar-sub { margin-top: 8px; font: 500 10px/1 var(--f-mono); letter-spacing: .2em; }
.bar-squares {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  margin-top: -50px; padding: 56px 10px 10px;
  background: oklch(32% 0.05 45); border-radius: 0 0 8px 8px;
}
.bar-sq { aspect-ratio: 1; background: oklch(38% 0.06 45); border-radius: 4px; box-shadow: inset 2px 2px 0 oklch(46% 0.06 45), inset -2px -2px 0 oklch(26% 0.05 45); display: grid; place-items: center; }
.bar-sq canvas { width: 62%; image-rendering: pixelated; opacity: .82; }
.glitch-visual:hover .bar-wrap { translate: 0 -46px; }

/* ═════════ LEVEL 08 · INVENTORY ═════════ */
.lvl-inventory { padding: clamp(90px, 12vh, 150px) var(--pad); border-top: 2px solid var(--ink); }
.inv-head { margin-bottom: clamp(30px, 5vh, 54px); }
.inv-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 44px); align-items: start; }
.inv-slots {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
  padding: 12px; background: var(--ink-2);
  box-shadow: 6px 6px 0 var(--ink);
}
.inv-slot {
  position: relative; aspect-ratio: 1;
  display: grid; place-items: center;
  padding: 0; border: 0; cursor: pointer;
  background: oklch(35% 0.014 60);
  box-shadow: inset 2px 2px 0 oklch(25% 0.012 60), inset -2px -2px 0 oklch(44% 0.014 60);
  color: var(--paper);
  transition: background-color .2s var(--ease-out);
}
.inv-slot .lucide { width: 32px; height: 32px; stroke-width: 1.8; }
.inv-slot::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 6px; height: 3px; background: var(--r, transparent); }
.inv-slot:hover { background: oklch(40% 0.014 60); }
.inv-slot.on { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 3px var(--yellow); }
.inv-slot.locked { cursor: default; color: oklch(50% 0.012 60); }
.inv-slot.locked .lucide { width: 22px; height: 22px; }
.inv-slot .mini-cube { transform: scale(.95); }
.inv-detail { position: sticky; top: calc(var(--hud-h) + 30px); padding: 22px; background: var(--paper); border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--r, var(--yellow)); }
.inv-d-icon { display: grid; place-items: center; width: 72px; height: 72px; background: var(--ink); color: var(--paper); margin-bottom: 16px; }
.inv-d-icon .lucide { width: 38px; height: 38px; stroke-width: 1.8; }
.inv-d-rarity { margin: 0 0 6px; font: 500 10.5px/1 var(--f-mono); letter-spacing: .2em; color: var(--rt, var(--ink)); }
.inv-d-name { margin: 0 0 14px; font-weight: 700; font-size: clamp(26px, 2.5vw, 36px); letter-spacing: -.03em; line-height: 1; }
.inv-d-lv { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; margin-bottom: 16px; font: 400 20px/1 var(--f-pixel); }
.inv-d-lv .meter i { width: 100%; transform: scaleX(var(--v, 0)); transition: transform .6s var(--ease-out); }
.inv-d-text { margin: 0; font-size: 16px; color: var(--ink-3); text-wrap: pretty; }

/* ═════════ ENDING ═════════ */
.lvl-end { padding: clamp(100px, 16vh, 180px) var(--pad) 0; text-align: center; overflow: hidden; }
.end-kicker { margin: 0; font: 500 11px/1 var(--f-mono); letter-spacing: .24em; color: oklch(70% 0.012 80); }
.end-title { margin: 14px 0 0; font: 400 clamp(90px, 17vw, 260px)/.78 var(--f-pixel); letter-spacing: .02em; color: var(--paper); }
.end-count { margin: 6px 0 0; font: 400 clamp(70px, 9vw, 140px)/1 var(--f-pixel); color: var(--yellow); font-variant-numeric: tabular-nums; }
.end-btns { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 24px; }
.end-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 20px 8px 8px;
  text-decoration: none;
  font: 500 12px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase;
  border: 2px solid var(--paper);
  transition: background-color .25s var(--ease-out), color .25s var(--ease-out);
}
.end-btn span { display: grid; place-items: center; min-width: 46px; height: 34px; padding: 2px 6px 0; font: 400 26px/1 var(--f-pixel); letter-spacing: .02em; }
.end-yes { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.end-yes span { background: var(--ink); color: var(--yellow); }
.end-ng span { background: var(--pink); color: var(--ink); }
.end-btn:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.end-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 0; margin: clamp(40px, 7vh, 70px) auto 0; max-width: 760px; border: 1.5px solid oklch(100% 0 0 / .18); }
.end-stats div { flex: 1 1 150px; padding: 16px 10px; border-right: 1.5px solid oklch(100% 0 0 / .18); }
.end-stats div:last-child { border-right: 0; }
.end-stats dt { font: 500 10px/1 var(--f-mono); letter-spacing: .2em; color: oklch(65% 0.012 80); }
.end-stats dd { margin: 8px 0 0; font: 400 34px/1 var(--f-pixel); font-variant-numeric: tabular-nums; }
.credits { position: relative; height: 340px; margin-top: 60px; overflow: hidden; -webkit-mask: linear-gradient(transparent, #000 25%, #000 75%, transparent); mask: linear-gradient(transparent, #000 25%, #000 75%, transparent); }
.credits-roll { position: absolute; left: 0; right: 0; top: 100%; animation: roll 22s linear infinite; }
.credits-roll p { margin: 0 0 30px; font-weight: 600; font-size: 22px; letter-spacing: -.01em; }
.credits-roll span { display: block; margin-bottom: 6px; font: 500 10px/1 var(--f-mono); letter-spacing: .24em; color: var(--yellow); }
@keyframes roll { to { transform: translateY(calc(-100% - 340px)); } }
.foot { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 22px 0 26px; border-top: 1.5px solid oklch(100% 0 0 / .14); font: 500 10.5px/1 var(--f-mono); letter-spacing: .16em; color: oklch(68% 0.012 80); }
.foot-links { display: flex; gap: 18px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--yellow); }

/* ───────── reveal helpers ───────── */
[data-reveal] { opacity: 0; translate: 0 26px; }

/* ═════════ RESPONSIVE ═════════ */
@media (max-width: 1100px) {
  .hud-nav a { padding: 0 9px; }
  .hud-nav a .lucide { display: none; }
}
@media (max-width: 900px) {
  :root { --hud-h: 44px; }
  .hud-nav { display: none; }
  .hud-xpbar { width: 64px; }
  .cube-pin { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); padding-top: calc(var(--hud-h) + 34px); gap: 8px; align-items: stretch; }
  .cube-copy .lvl-lede { display: none; }
  .cube-copy .lvl-title { font-size: clamp(22px, 6vw, 34px); margin-bottom: 14px; }
  .faces { grid-template-columns: 1fr 1fr; gap: 0 12px; }
  .faces li { padding: 6px 0; }
  .faces em { display: none; }
  .faces b { font-size: 13px; }
  .cube-moves { font-size: 20px; min-height: 22px; }
  .dilemma-grid, .world-grid, .inv-grid { grid-template-columns: 1fr; }
  .q-body { grid-template-columns: 1fr; min-height: 0; }
  .q-visual { min-height: 260px; }
  .quest, .q-aaa, .q-glitch { position: relative; top: auto; }
  .inv-detail { position: relative; top: auto; }
  .tag-a { left: -4%; top: -14%; }
  .tag-b { right: -2%; top: -4%; }
  .tag-a { left: -2%; top: -4%; }
  .my-name { margin-top: 30px; }
  .note-c, .note-d, .arrow { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hud-xp-n, .hud-lvl { display: none; }
  .hud-contact { padding: 7px 8px; }
  .world-lists { grid-template-columns: 1fr; }
  .lang { grid-template-columns: 84px 1fr 54px; }
  .sk-round .sk-face { width: 80px; height: 80px; }
  .sk-ic { width: 38px; height: 38px; font-size: 20px; }
  .end-stats div { flex-basis: 50%; border-bottom: 1.5px solid oklch(100% 0 0 / .18); }
}

@media (prefers-reduced-motion: reduce) {
  .credits-roll { animation: none; position: relative; top: 0; }
  .credits { height: auto; -webkit-mask: none; mask: none; }
  .blink, .status-dot, .boot-start.on, .q-objectives li.live::before, .aaa-load i::after { animation: none; }
}

/* ═════════ CUTSCENE · SISYPHUS ═════════ */
.cutscene { position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; background: oklch(12% 0.006 60); }
.cut-corner { position: absolute; z-index: 3; width: 44px; height: 44px; border: 0 solid oklch(100% 0 0 / .35); }
.cut-corner.tl { top: 64px; left: 18px; border-top-width: 2px; border-left-width: 2px; }
.cut-corner.tr { top: 64px; right: 18px; border-top-width: 2px; border-right-width: 2px; }
.cut-corner.bl { bottom: 70px; left: 18px; border-bottom-width: 2px; border-left-width: 2px; }
.cut-corner.br { bottom: 70px; right: 18px; border-bottom-width: 2px; border-right-width: 2px; }
.cut-bar {
  position: absolute; z-index: 3; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 12px var(--pad);
  font: 500 10px/1 var(--f-mono); letter-spacing: .2em; color: oklch(100% 0 0 / .55);
}
.cut-bar-top { top: calc(var(--hud-h) + 14px); border-bottom: 1px solid oklch(100% 0 0 / .14); }
.cut-bar-bottom { bottom: 0; border-top: 1px solid oklch(100% 0 0 / .14); background: oklch(12% 0.006 60 / .9); }
.cut-skip { color: var(--yellow); }
.cut-dots { display: flex; gap: 4px; }
.cut-dots i { width: 4px; height: 4px; background: var(--paper); animation: blink 1.2s steps(1) infinite; }
.cut-dots i:nth-child(2) { animation-delay: .4s; } .cut-dots i:nth-child(3) { animation-delay: .8s; }
.cut-copy {
  position: absolute; z-index: 2; right: var(--pad); top: 50%; translate: 0 -46%;
  width: min(480px, calc(100% - 2 * var(--pad)));
  color: var(--paper);
}
.cut-line { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font: 500 12px/1 var(--f-mono); opacity: .6; }
.cut-line i { flex: 1; height: 1px; background: currentColor; }
.cut-title { margin: 0 0 18px; font: 400 clamp(64px, 8vw, 120px)/.8 var(--f-pixel); letter-spacing: .03em; }
.cut-text { margin: 0 0 22px; font: 400 14px/1.7 var(--f-mono); color: oklch(84% 0.008 80); }
.cut-quote { margin: 0; padding: 14px 0 0; border-top: 1px dashed oklch(100% 0 0 / .3); font: 26px/1.15 var(--f-hand); color: var(--yellow); }
.cut-quote cite { display: block; margin-top: 8px; font: 500 10px/1 var(--f-mono); letter-spacing: .2em; font-style: normal; color: oklch(100% 0 0 / .5); text-transform: uppercase; }
@media (max-width: 900px) {
  .cut-copy { left: var(--pad); right: var(--pad); width: auto; top: auto; bottom: 90px; translate: none; }
  .cut-copy::before { content: ""; position: absolute; inset: -18px; z-index: -1; background: oklch(12% 0.006 60 / .72); }
}

/* cobe globe */
.globe-sq { position: relative; width: 100%; aspect-ratio: 1; max-width: 700px; margin: 0 auto; }
.globe-sq .globe { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .9s var(--ease-out); contain: layout paint size; }
.globe-sq .globe.ready { opacity: 1; }
.globe-labels { position: absolute; inset: 0; pointer-events: none; }
.g-tag {
  position: absolute; left: 0; top: 0;
  padding: 4px 7px 3px; white-space: nowrap;
  font: 500 10px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
  background: var(--ink); color: var(--paper);
  translate: 10px -50%;
  transition: opacity .25s var(--ease-out);
}
.g-tag::before { content: ""; position: absolute; left: -10px; top: 50%; width: 10px; height: 1.5px; background: var(--ink); }
.g-tag.base { background: var(--pink); color: var(--ink); }
.g-tag.base::before { background: var(--pink); }
.g-tag.school { background: var(--blue); }
.g-tag.school::before { background: var(--blue); }
.g-tag.on { outline: 2px solid var(--yellow); }
.g-tag.up { translate: 10px -130%; }
.g-tag.down { translate: 10px 30%; }
@media (max-width: 640px) { .inv-slots { grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 8px; } .inv-slot .lucide { width: 26px; height: 26px; } }
@media (max-width: 640px) {
  .tag-b { display: none; }
  .tag-a { left: 50%; translate: -50% 0; top: -6%; }
  .toast { min-width: 0; grid-template-columns: 32px 1fr; padding: 8px 12px 8px 8px; }
  .toast-ic { width: 32px; height: 32px; font-size: 16px; }
  .toast b { font-size: 18px; }
}

/* ═════════ PIXEL FRAMES ═════════ */
:root {
  --px-corner: polygon(0px 8px, 4px 8px, 4px 4px, 8px 4px, 8px 0px, calc(100% - 8px) 0px, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, calc(100% - 0px) 8px, calc(100% - 0px) calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) calc(100% - 0px), 8px calc(100% - 0px), 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0px calc(100% - 8px));
  --px-small: polygon(0px 4px, 4px 4px, 4px 0px, calc(100% - 4px) 0px, calc(100% - 4px) 4px, calc(100% - 0px) 4px, calc(100% - 0px) calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) calc(100% - 0px), 4px calc(100% - 0px), 4px calc(100% - 4px), 0px calc(100% - 4px));
  --px-circle: polygon(0px 36px, 6px 36px, 6px 24px, 12px 24px, 12px 12px, 24px 12px, 24px 6px, 36px 6px, 36px 0px, calc(100% - 36px) 0px, calc(100% - 36px) 6px, calc(100% - 24px) 6px, calc(100% - 24px) 12px, calc(100% - 12px) 12px, calc(100% - 12px) 24px, calc(100% - 6px) 24px, calc(100% - 6px) 36px, calc(100% - 0px) 36px, calc(100% - 0px) calc(100% - 36px), calc(100% - 6px) calc(100% - 36px), calc(100% - 6px) calc(100% - 24px), calc(100% - 12px) calc(100% - 24px), calc(100% - 12px) calc(100% - 12px), calc(100% - 24px) calc(100% - 12px), calc(100% - 24px) calc(100% - 6px), calc(100% - 36px) calc(100% - 6px), calc(100% - 36px) calc(100% - 0px), 36px calc(100% - 0px), 36px calc(100% - 6px), 24px calc(100% - 6px), 24px calc(100% - 12px), 12px calc(100% - 12px), 12px calc(100% - 24px), 6px calc(100% - 24px), 6px calc(100% - 36px), 0px calc(100% - 36px));
}

/* pixel-framed stickers (cards, rounds, notes). Tags keep their zigzag coupon edge */
.sk-card .sk-inner, .sk-round .sk-inner, .sk-note .sk-inner {
  position: relative;
  padding: 0; background: none; border-radius: 0; box-shadow: none;
  filter:
    drop-shadow(2px 0 0 var(--ink)) drop-shadow(-2px 0 0 var(--ink))
    drop-shadow(0 2px 0 var(--ink)) drop-shadow(0 -2px 0 var(--ink))
    drop-shadow(4px 4px 0 oklch(21% 0.012 60 / .2));
}
.sk-face {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 12px 14px 9px;
  background: oklch(99% 0.006 92);
  clip-path: var(--px-corner);
}
.sk-face .sk-label { font: 400 21px/.85 var(--f-pixel); letter-spacing: .02em; }
.sk-face .sk-ic { border-radius: 0; clip-path: var(--px-small); }
.sk-round .sk-face { width: 100px; height: 100px; justify-content: center; padding: 6px; clip-path: var(--px-circle); }
.sk-note .sk-face { background: var(--butter); padding-top: 16px; }
.sk-note .sk-label { color: var(--ink); }

/* ═════════ CUTSCENE · PLAYER ONE ═════════ */
.cutscene .runner { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.cut-copy { left: var(--pad); right: auto; top: calc(var(--hud-h) + 90px); translate: none; width: min(620px, calc(100% - 2 * var(--pad))); pointer-events: none; }
.cut-title { font-size: clamp(72px, 10vw, 150px); }
.cut-text { margin: 0 0 14px; font: 400 15px/1.7 var(--f-sans); color: oklch(86% 0.008 80); max-width: 52ch; }
.cut-quote { margin: 22px 0 0; padding: 14px 0 0; border-top: 1px dashed oklch(100% 0 0 / .3); font: 28px/1.15 var(--f-hand); color: var(--yellow); }
.cut-bar b { font-weight: 500; color: var(--paper); font-variant-numeric: tabular-nums; }

/* ═════════ HUD socials ═════════ */
.hud-social { display: flex; gap: 6px; }
.soc { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--ink); text-decoration: none; transition: background-color .2s var(--ease-out), color .2s var(--ease-out); }
.soc .lucide { width: 14px; height: 14px; }
.soc-yellow { background: var(--yellow); }
.soc-pink { background: var(--pink); }
.soc-green { background: var(--green); }
.soc:hover { background: var(--ink); color: var(--paper); }
@media (max-width: 1320px) { .hud-social { display: none; } }

/* ═════════ ENDING: socials + party ═════════ */
.end-social { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.end-social a {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border: 1.5px solid oklch(100% 0 0 / .22);
  font: 500 11.5px/1 var(--f-mono); letter-spacing: .06em; text-decoration: none;
  transition: border-color .2s var(--ease-out), color .2s var(--ease-out);
}
.end-social a:hover { border-color: var(--yellow); color: var(--yellow); }
.party { max-width: 860px; margin: clamp(40px, 7vh, 64px) auto 0; text-align: left; }
.party-h { margin: 0 0 12px; font: 500 10.5px/1 var(--f-mono); letter-spacing: .22em; color: var(--yellow); text-align: center; }
.party-list { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid oklch(100% 0 0 / .18); }
.party-list a {
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 12px; row-gap: 4px; align-items: center;
  padding: 16px 18px; text-decoration: none;
  border-bottom: 1.5px solid oklch(100% 0 0 / .18);
  transition: background-color .2s var(--ease-out), color .2s var(--ease-out);
}
.party-list a:nth-child(odd) { border-right: 1.5px solid oklch(100% 0 0 / .18); }
.party-list a:nth-last-child(-n + 2) { border-bottom: 0; }
.party-list b { font-weight: 600; font-size: 18px; letter-spacing: -.01em; }
.party-list em { grid-row: 2; font: 500 10.5px/1.3 var(--f-mono); font-style: normal; letter-spacing: .08em; color: oklch(68% 0.012 80); }
.party-list em[lang="ar"] { font-family: var(--f-ar); font-size: 13px; letter-spacing: 0; justify-self: start; }
.party-list .lucide { grid-row: 1 / 3; grid-column: 2; color: oklch(68% 0.012 80); }
.party-list a:hover { background: var(--paper); color: var(--ink); }
.party-list a:hover em, .party-list a:hover .lucide { color: var(--ink-3); }

/* inventory code badges */
.mono-badge { font: 400 30px/1 var(--f-pixel); letter-spacing: .02em; }
.inv-d-icon .mono-badge { font-size: 36px; }

@media (max-width: 900px) {
  .cut-copy { top: calc(var(--hud-h) + 70px); bottom: auto; }
  .cut-copy::before { display: none; }
}
@media (max-width: 640px) {
  .party-list { grid-template-columns: 1fr; }
  .party-list a:nth-child(odd) { border-right: 0; }
  .party-list a:nth-last-child(2) { border-bottom: 1.5px solid oklch(100% 0 0 / .18); }
  .cut-text { font-size: 14px; }
}
.sk-round .sk-face { width: 112px; height: 112px; }
.sk-round .sk-face .sk-label { font-size: 18px; }
@media (max-width: 640px) { .sk-round .sk-face { width: 92px; height: 92px; } .sk-round .sk-face .sk-label { font-size: 16px; } }
@media (max-width: 640px) {
  .sticker { scale: .74; }
}

/* ═════════ LEVEL 05 · HOUSE RULES (card deck) ═════════ */
.lvl-wisdom {
  padding: clamp(90px, 12vh, 150px) var(--pad);
  border-top: 2px solid var(--ink);
  overflow: hidden;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(180deg, transparent 0 31px, var(--rule) 31px 32px);
}
.wisdom-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(30px, 5vw, 90px); align-items: center; }
.deck-meta { display: flex; align-items: center; gap: 18px; margin-top: 30px; }
.deck-count { font: 500 11px/1 var(--f-mono); letter-spacing: .18em; color: var(--ink-3); }
.deck-count b { font: 400 30px/1 var(--f-pixel); color: var(--ink); letter-spacing: .02em; }
.deck-next {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border: 0; cursor: pointer;
  background: var(--ink); color: var(--paper);
  font: 500 11px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase;
  box-shadow: 3px 3px 0 var(--pink);
  transition: box-shadow .2s var(--ease-out), translate .2s var(--ease-out);
}
.deck-next:hover { box-shadow: 0 0 0 var(--pink); translate: 3px 3px; }

.deck { position: relative; height: clamp(440px, 62vh, 600px); touch-action: pan-y; }
.rcard {
  position: absolute; left: 50%; top: 50%;
  width: min(400px, 78vw); aspect-ratio: 4 / 5;
  cursor: grab; user-select: none;
  filter:
    drop-shadow(3px 0 0 var(--ink)) drop-shadow(-3px 0 0 var(--ink))
    drop-shadow(0 3px 0 var(--ink)) drop-shadow(0 -3px 0 var(--ink))
    drop-shadow(9px 9px 0 oklch(21% 0.012 60 / .9));
  will-change: transform;
}
.rcard:active { cursor: grabbing; }
.rc-face {
  position: relative; height: 100%;
  display: flex; flex-direction: column;
  padding: 26px 26px 22px;
  background: var(--cc); color: var(--cf);
  clip-path: var(--px-corner);
}
.rc-face::before { content: ""; position: absolute; inset: 12px; border: 2px dashed currentColor; opacity: .28; pointer-events: none; }
.rc-head, .rc-foot { position: relative; display: flex; justify-content: space-between; align-items: center; font: 500 10.5px/1 var(--f-mono); letter-spacing: .18em; }
.rc-head b { font: 400 26px/1 var(--f-pixel); letter-spacing: .02em; }
.rc-quote { position: relative; flex: 1; display: grid; align-content: center; margin: 0; font: 400 clamp(40px, 4.4vw, 62px)/.88 var(--f-pixel); letter-spacing: .01em; text-wrap: balance; }
.rc-quote[data-len="s"] { font-size: clamp(56px, 6.4vw, 92px); }
.rc-quote[data-len="l"] { font-size: clamp(30px, 3.2vw, 44px); line-height: .92; }
.rc-pips { display: flex; gap: 4px; }
.rc-pips i { width: 9px; height: 9px; background: currentColor; }

@media (max-width: 900px) {
  .wisdom-grid { grid-template-columns: 1fr; }
  .deck { height: min(560px, 118vw); }
  .rc-quote { font-size: clamp(38px, 10vw, 58px); }
  .rc-quote[data-len="s"] { font-size: clamp(52px, 14vw, 80px); }
  .rc-quote[data-len="l"] { font-size: clamp(28px, 7.4vw, 40px); }
}
.g-tag.left { translate: calc(-100% - 10px) -50%; }
.g-tag.left::before { left: auto; right: -10px; }
/* full school names need room: home bases as a 2x2 grid, save points full width below */
.world-lists { grid-template-columns: 1fr; gap: 26px; }
.world-lists > div:first-child .places { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.note-c { bottom: -6%; left: -24%; }
