:root {
  --void: #07060c;
  --mist: #f4efe8;
  --ember: #ff4d6d;
  --gold: #e7c36a;
  --spirit: #8ef6ea;
  --paper: #efe8dc;
  --paper-deep: #e4d9c8;
  --ink: #1a1714;
  --copper: #8d4e2b;
  --signal: #0e6b4f;
  --split: 50%;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--mist);
  font-family: Outfit, "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1.5;
  overflow-x: hidden;
}

body[data-world="system"] {
  background: #e7dfd2;
  color: var(--ink);
  color-scheme: light;
  font-family: "Public Sans", "Segoe UI", sans-serif;
}

img { max-width: 100%; }

button, input { font: inherit; color: inherit; }

a { color: inherit; }

h1, h2, h3, p { margin: 0; }

::selection { background: var(--ember); color: #1a0a10; }
body[data-world="system"] ::selection { background: var(--ink); color: var(--paper); }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 80;
  background: var(--mist);
  color: var(--void);
  padding: 8px 12px;
  border-radius: 4px;
}

.skip:focus { top: 12px; }

.veil {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  background: var(--gold);
  transform: scaleY(0);
}

.veil.is-on { animation: veil 0.72s cubic-bezier(.2, .7, .2, 1); }
.veil[data-to="game"] { background: var(--void); }
.veil[data-to="system"] { background: var(--paper); }
.veil[data-to="threshold"] { background: var(--gold); }

@keyframes veil {
  0% { transform: scaleY(0); }
  42% { transform: scaleY(1); }
  100% { transform: scaleY(0); }
}

.topbar {
  position: fixed;
  z-index: 30;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(760px, calc(100% - 20px));
  padding: 6px 8px 6px 10px;
  border-radius: 999px;
  background: rgba(8, 7, 12, 0.78);
  color: var(--mist);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: Syne, sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 6px 8px;
}

.mark { width: 22px; height: 22px; display: block; }

.world-nav, .top-links { display: flex; align-items: center; gap: 2px; }

.world-nav { margin-inline: auto; }

.topbar button,
.top-links a {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.92rem;
}

.topbar button[aria-current="page"] {
  background: rgba(255, 255, 255, 0.12);
}

body[data-world="game"] .topbar,
body[data-world="system"] .topbar {
  top: 0;
  left: 0;
  transform: none;
  width: 100%;
  border-radius: 0;
  border: 0;
  padding: 12px 28px;
  justify-content: space-between;
}

body[data-world="game"] .topbar {
  background: rgba(7, 6, 12, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body[data-world="system"] .topbar {
  background: rgba(239, 232, 220, 0.94);
  color: var(--ink);
  border-bottom: 1px solid #d9cfc0;
  backdrop-filter: blur(10px);
}

body[data-world="system"] .topbar button,
body[data-world="system"] .top-links a { border-radius: 2px; }

body[data-world="system"] .topbar button[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
}

.threshold {
  --split: 50%;
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: 100vh;
  transition: grid-template-columns 0.65s cubic-bezier(.2, .7, .2, 1);
}

.threshold:has(.pane-game:hover) { grid-template-columns: 1.38fr 0.62fr; }
.threshold:has(.pane-system:hover) { grid-template-columns: 0.62fr 1.38fr; }

.threshold::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split);
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(var(--ember), var(--gold), var(--ink));
  box-shadow: 0 0 28px var(--gold);
  z-index: 4;
  pointer-events: none;
}

.pane {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 118px 48px 48px;
  overflow: hidden;
}

.pane-bg { position: absolute; inset: 0; z-index: 0; }

.pane-game .pane-bg {
  background:
    radial-gradient(ellipse at 20% 80%, rgba(255, 77, 109, 0.38), transparent 52%),
    radial-gradient(ellipse at 80% 10%, rgba(142, 246, 234, 0.16), transparent 46%),
    linear-gradient(160deg, #120814, #07060c 55%);
}

.pane-game .pane-bg::after,
.pane-system .pane-bg::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  filter: blur(8px);
  animation: drift 14s ease-in-out infinite;
}

.pane-game .pane-bg::after {
  background: rgba(255, 77, 109, 0.25);
  left: 12%;
  bottom: 18%;
}

.pane-system .pane-bg {
  background:
    linear-gradient(180deg, rgba(26, 23, 20, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 23, 20, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, #f7f3ec, #e7dfd2);
  background-size: 28px 28px, 28px 28px, auto;
}

.pane-system .pane-bg::after {
  background: rgba(141, 78, 43, 0.18);
  right: 10%;
  top: 22%;
  animation-direction: reverse;
}

@keyframes drift {
  50% { transform: translate(24px, -30px); }
}

.pane-top, .pane-bottom, .marquee { position: relative; z-index: 1; }

.pane-top {
  display: flex;
  align-items: baseline;
  gap: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.pane-index {
  font-family: Syne, sans-serif;
  font-weight: 700;
}

.pane-game { color: var(--mist); }
.pane-system { color: var(--ink); text-align: right; }
.pane-system .pane-top { justify-content: flex-end; }
.pane-system .pane-bottom { margin-left: auto; }

/* Dipersempit dari 420px agar potret punya koridor di tengah. */
.pane-bottom { max-width: 360px; }

/* Potret berdiri di garis pemisah dan ikut bergeser bersama --split, tetapi
   dikurung di koridor antara kedua blok teks: saat panel di-hover garisnya
   melesat sampai 69% dan potretnya akan menabrak paragraf di seberang.
   Koridor itu melebar sendiri di layar besar, sehingga potret ikut melesat
   jauh ke garis batas. Geserannya dipatok 0.4 lebar potret agar langkahnya
   terasa sama di layar mana pun; 18px di belakangnya tetap jadi batas keras. */
.portrait {
  --pw: min(26vh, calc(100vw - 864px));
  --travel: max(0px, min(calc(var(--pw) * 0.4), calc(50vw - 408px - var(--pw) / 2 - 18px)));
  position: absolute;
  z-index: 3;
  bottom: 0;
  left: clamp(calc(50% - var(--travel)), var(--split), calc(50% + var(--travel)));
  transform: translateX(-50%);
  width: var(--pw);
  aspect-ratio: 616 / 876;
  pointer-events: none;
}

/* Kedua pose ditumpuk pada kotak yang sama; keduanya dirender di atas kanvas
   yang simetris terhadap kepala, jadi pergantian dan pencerminan tidak
   menggeser wajah sedikit pun. */
.portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Jas hitam nyaris lenyap di paruh gelap, jadi siluetnya diberi tepi tipis. */
  filter: drop-shadow(0 0 2px rgba(244, 239, 232, 0.5)) drop-shadow(0 16px 28px rgba(7, 6, 12, 0.3));
  transition: opacity 0.2s ease;
}

/* Saat satu panel disorot, ia berganti pose dan menunjuk ke panel tersebut. */
.portrait-point { opacity: 0; }
.threshold:has(.pane:hover) .portrait-rest { opacity: 0; }
.threshold:has(.pane:hover) .portrait-point { opacity: 1; }
.threshold:has(.pane-game:hover) .portrait-point { transform: scaleX(-1); }

/* Koridor tengah terlalu sempit untuk potret pada laptop kecil. */
@media (min-width: 861px) and (max-width: 1099px) {
  .portrait { display: none; }
}

.pane h2 {
  font-family: Syne, sans-serif;
  font-weight: 700;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin-bottom: 12px;
}

.pane-system h2 { font-family: Fraunces, Georgia, serif; font-weight: 560; letter-spacing: -0.03em; }

.pane-bottom p { margin-bottom: 18px; font-size: 1.02rem; }
.pane-game .pane-bottom p { color: rgba(244, 239, 232, 0.82); }
.pane-system .pane-bottom p { color: rgba(26, 23, 20, 0.78); }

.marquee {
  position: absolute;
  left: 0;
  right: 0;
  top: 168px;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  gap: 0;
  animation: slide 42s linear infinite;
  font-family: Syne, sans-serif;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  opacity: 0.28;
  white-space: nowrap;
}

.pane-system .marquee-track {
  animation-direction: reverse;
  font-family: Fraunces, Georgia, serif;
  font-weight: 500;
  font-style: italic;
  opacity: 0.35;
}

@keyframes slide {
  to { transform: translateX(-50%); }
}

.identity {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  width: min(920px, 92vw);
  text-align: center;
  pointer-events: none;
}

.identity-kicker {
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.75rem;
  margin-bottom: 8px;
}

.split-text {
  --cut: 50%;
  background-image: linear-gradient(90deg, var(--mist) 0 var(--cut), var(--ink) var(--cut) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.identity h1 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 560;
  font-size: clamp(3rem, 7vw, 6.4rem);
  letter-spacing: -0.045em;
  line-height: 0.9;
}

.degree {
  font-size: 0.42em;
  letter-spacing: 0;
  font-style: italic;
}

.identity-role {
  margin-top: 12px;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.identity-links {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 16px;
  pointer-events: auto;
  font-size: 0.92rem;
}

.identity-links a {
  color: var(--mist);
  background: rgba(8, 7, 12, 0.82);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.85rem 1.15rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}

.pane-game .btn {
  border-radius: 999px;
  background: var(--ember);
  color: #1a0a10;
  font-weight: 600;
}

.pane-system .btn {
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}

.world { display: none; }
body[data-world="threshold"] .world { display: none; }
body[data-world="game"] .threshold,
body[data-world="system"] .threshold { display: none; }
body[data-world="game"] .world-game,
body[data-world="system"] .world-system {
  display: block;
  padding: 108px 0 72px;
  animation: rise 0.55s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.wrap { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.wrap-system { width: min(1180px, calc(100% - 40px)); }

.eyebrow {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.75rem;
  margin-bottom: 12px;
}

.world-game .eyebrow span {
  color: var(--gold);
  margin-right: 10px;
}

.hero-game h1,
.section-head h2,
.bridge h2,
.world-game h3 {
  font-family: Syne, sans-serif;
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 0.96;
}

.hero-game h1 {
  font-size: clamp(2.8rem, 6vw, 5.4rem);
  max-width: 16ch;
  margin-bottom: 18px;
}

.lede {
  max-width: 62ch;
  font-size: 1.12rem;
  font-weight: 300;
}

.world-game .lede { color: rgba(244, 239, 232, 0.8); }

.section-head { margin: 72px 0 28px; max-width: 68ch; }
.section-head h2 { font-size: clamp(2rem, 4vw, 3.2rem); margin-bottom: 10px; }
.section-head p { color: rgba(244, 239, 232, 0.74); }
.section-head a { color: var(--gold); }

.cabinets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(236px, 1fr));
  gap: 16px;
}

.cabinet button {
  width: 100%;
  height: 100%;
  text-align: left;
  background: #100d16;
  color: var(--mist);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.cabinet button:hover {
  transform: translateY(-4px);
  border-color: rgba(231, 195, 106, 0.7);
}

/* Tangkapan layar aslinya punya rasio yang berbeda-beda — potret dari ponsel,
   lanskap dari tablet — jadi kotaknya yang menentukan bentuk, bukan gambarnya. */
.art {
  display: block;
  width: 100%;
  /* Atribut width/height di <img> ada untuk menahan pergeseran tata letak, tetapi
     atribut height itu juga mengunci tinggi elemen dan membuat aspect-ratio di
     bawah ini diabaikan. height: auto melepas kuncinya. */
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 14px;
  background: #07060c;
}

.cabinet-copy { display: grid; gap: 4px; padding: 4px 8px 10px; }
.cabinet-kicker { color: var(--gold); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; }
.cabinet-title { font-family: Syne, sans-serif; font-size: 1.55rem; font-weight: 700; letter-spacing: -0.04em; }
.cabinet-text { color: rgba(244, 239, 232, 0.72); font-size: 0.95rem; }
.cabinet-best { margin-top: 6px; font-variant-numeric: tabular-nums; color: var(--spirit); font-size: 0.88rem; }

/* Deretan tangkapan layar digeser ke samping: tingginya disamakan dan lebarnya
   dibiarkan mengikuti rasio asli, supaya potret dan lanskap bisa berjajar. */
.shots {
  list-style: none;
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding-bottom: 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.shots li { scroll-snap-align: start; flex: 0 0 auto; }

.shot {
  display: block;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: #07060c;
  cursor: zoom-in;
  overflow: hidden;
  line-height: 0;
}

.shot:hover, .shot:focus-visible { border-color: var(--gold); }

.shot img {
  display: block;
  height: 132px;
  width: auto;
  max-width: 320px;
  object-fit: contain;
}

.work-note {
  margin-top: 18px;
  color: rgba(244, 239, 232, 0.6);
  font-size: 0.92rem;
}

.work-note a { color: var(--gold); }

.work-list { border-bottom: 1px solid rgba(255, 255, 255, 0.12); }

.work {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr) 8.5rem auto;
  gap: 12px 18px;
  align-items: start;
  padding: 22px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.work-idx {
  font-family: Syne, sans-serif;
  color: var(--gold);
  padding-top: 4px;
}

.work h3 { font-size: 1.45rem; margin-bottom: 6px; }
.work-main p, .work-kind { color: rgba(244, 239, 232, 0.72); }
.work-kind { margin: 0; padding-top: 6px; font-size: 0.92rem; }
.work-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.world-game .btn-ghost,
.world-game .btn-solid {
  border-radius: 999px;
  padding: 0.65rem 0.9rem;
  font-size: 0.92rem;
}

.world-game .btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--mist);
}

.world-game .btn-solid { background: var(--mist); color: var(--void); font-weight: 600; }
.world-game .btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.bridge {
  margin-top: 88px;
  padding: 36px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.bridge h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  max-width: 18ch;
  margin-bottom: 18px;
}

.bridge-to-system .btn-solid {
  background: var(--paper);
  color: var(--ink);
  border-radius: 2px;
}

.colophon { margin-top: 48px; display: grid; gap: 6px; }
.fine { color: rgba(244, 239, 232, 0.6); font-size: 0.92rem; }
.colophon a { margin-right: 14px; }

.hero-system h1,
.world-system .section-head h2,
.world-system .bridge h2,
.world-system .work h3,
.spine-lead,
.principle-list h3 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

.hero-system h1 {
  font-size: clamp(2.6rem, 5.4vw, 4.8rem);
  max-width: 16ch;
  font-variation-settings: "opsz" 72, "SOFT" 40;
  margin-bottom: 16px;
}

.world-system .lede,
.world-system .section-head p { color: rgba(26, 23, 20, 0.78); }
.world-system .eyebrow { color: var(--copper); letter-spacing: 0.14em; }
.world-system .section-head a { color: var(--copper); }

.world-system .work-list { border-bottom-color: #cfc3b2; }
.world-system .work { border-top-color: #cfc3b2; }
.world-system .work-idx { color: var(--copper); }
.world-system .work-main p,
.world-system .work-kind { color: rgba(26, 23, 20, 0.74); }

.world-system .btn-ghost,
.world-system .btn-solid {
  border-radius: 2px;
  padding: 0.65rem 0.9rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.world-system .btn-ghost {
  background: transparent;
  border-color: #b5a791;
  color: var(--ink);
}

.world-system .btn-ghost:hover { border-color: var(--ink); background: #e3d9c8; }
.world-system .btn-solid { background: var(--ink); color: var(--paper); }

.spine {
  margin-top: 34px;
  padding: 24px;
  background: #f3ece1;
  border: 1px solid #d9cfc0;
}

.spine-lead { font-size: 1.45rem; margin-bottom: 18px; }

.spine-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.spine-list li {
  display: grid;
  gap: 6px;
  padding-top: 12px;
  border-top: 2px solid var(--copper);
  font-size: 0.95rem;
}

.spine-list strong { letter-spacing: -0.01em; }
.spine-list span { color: rgba(26, 23, 20, 0.74); }

.principle-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 28px;
}

.principle-list li {
  padding-top: 16px;
  border-top: 1px solid #cfc3b2;
}

.principle-list h3 { font-size: 1.7rem; margin-bottom: 8px; }
.principle-list p { margin: 0; color: rgba(26, 23, 20, 0.78); }

.terminal-section { scroll-margin-top: 76px; }

.terminal {
  background: #221e1a;
  color: var(--ink);
  border-radius: 28px;
  padding: 14px;
  box-shadow: 0 30px 70px rgba(40, 24, 10, 0.18);
}

.term-screen {
  background: #fbf8f3;
  border-radius: 18px;
  min-height: 520px;
  display: flex;
  flex-direction: column;
}

.term-head, .term-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
}

.term-head { border-bottom: 1px solid var(--paper-deep); }
.term-foot { border-top: 1px solid var(--paper-deep); margin-top: auto; font-size: 0.92rem; }

.term-brand {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
}

.term-meta { display: flex; gap: 14px; font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.shift-open { color: var(--signal); }
.shift-closed { color: #8d2e2e; }

.term-tabs { display: flex; gap: 6px; }
.term-tabs button, .term-actions button, .sku, .line button, .pay-box button, .code-row button {
  cursor: pointer;
}

.term-tabs button {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 2px;
  padding: 6px 8px;
}

.term-tabs button[aria-current="true"] {
  background: var(--ink);
  color: var(--paper);
}

.term-body {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  min-height: 420px;
}

.sku-list, .cart-pane, .sheet { padding: 8px 18px 18px; }

.sku {
  width: 100%;
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #eadfce;
  padding: 12px 2px;
}

.sku:hover { background: #f3ebdf; }
.sku:disabled, .term-actions button:disabled { opacity: 0.4; cursor: not-allowed; }
.terminal h3 { font-family: Fraunces, Georgia, serif; font-size: 1.5rem; font-weight: 560; }
.sku small { display: block; color: rgba(26, 23, 20, 0.62); }
.swatch { width: 10px; height: 10px; border-radius: 1px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.price { font-variant-numeric: tabular-nums; }

.cart-pane {
  border-left: 1px solid var(--paper-deep);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-pane h3 { font-family: Fraunces, Georgia, serif; font-size: 1.4rem; }

.line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #eadfce;
  font-size: 0.95rem;
}

.stepper { display: flex; gap: 6px; align-items: center; }
.stepper button, .textish {
  border: 1px solid #d9cfc0;
  background: transparent;
  border-radius: 2px;
  min-width: 28px;
  padding: 4px 6px;
}

.empty { color: rgba(26, 23, 20, 0.6); }

.totals { margin-top: auto; display: grid; gap: 4px; font-variant-numeric: tabular-nums; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-family: Fraunces, Georgia, serif; font-size: 1.35rem; margin-top: 6px; }

.code-row, .pay-row { display: flex; gap: 8px; }
.code-row input, .pay-box input {
  flex: 1;
  border: 1px solid #d9cfc0;
  background: white;
  border-radius: 2px;
  padding: 8px 10px;
}

.term-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.term-actions button, .pay-box button, .code-row button, .sheet .primary {
  border-radius: 2px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 12px;
}

.term-actions .alt, .pay-box .alt, .code-row button {
  background: transparent;
  color: var(--ink);
}

.note { min-height: 1.2em; font-size: 0.88rem; color: var(--copper); }
.sheet { display: grid; gap: 10px; }
.receipt {
  width: min(420px, 100%);
  margin: 10px auto;
  background: #fffdf8;
  border: 1px dashed #c9bba6;
  padding: 18px 16px;
  font-variant-numeric: tabular-nums;
}
.receipt h3 { font-family: Fraunces, Georgia, serif; text-align: center; font-size: 1.6rem; }
.receipt .center { text-align: center; color: rgba(26,23,20,.65); margin-bottom: 10px; }
.receipt div { display: flex; justify-content: space-between; gap: 12px; }
.receipt hr { border: 0; border-top: 1px dashed #c9bba6; margin: 10px 0; }

.history-item {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #eadfce;
  background: transparent;
  padding: 12px 0;
  display: flex;
  justify-content: space-between;
  cursor: pointer;
}

.world-system .bridge { border-top-color: #cfc3b2; }
.world-system .bridge .btn-solid {
  border-radius: 999px;
  background: var(--void);
  color: var(--mist);
}
.world-system .fine { color: rgba(26, 23, 20, 0.62); }
.world-system .fine a { color: var(--ink); }

dialog {
  width: min(1040px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  border: 0;
  padding: 0;
  border-radius: 20px;
  background: #0c0a12;
  color: var(--mist);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

dialog::backdrop { background: rgba(0, 0, 0, 0.72); }

/* Kedua dialog adalah anak langsung body, di luar pembungkus .world-*, jadi
   aturan tombol per dunia tidak menjangkaunya dan tombolnya kembali ke gaya
   bawaan peramban: kotak abu-abu terang di atas panel gelap. */
dialog .btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--mist);
  border-radius: 999px;
  padding: 0.65rem 0.9rem;
  font-size: 0.92rem;
}

dialog .btn-ghost:hover,
dialog .btn-ghost:focus-visible { border-color: var(--gold); color: var(--gold); }

.stage-top, .stage-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
}

#stage-title {
  font-family: Syne, sans-serif;
  font-size: 1.3rem;
  letter-spacing: -0.04em;
}

#stage-canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  display: block;
  background: #05040a;
  touch-action: none;
}

/* Kanvas difokuskan lewat skrip agar spasi masuk ke permainan; cincin fokusnya
   tidak perlu terlihat karena bukan pengguna yang mengarahkannya ke sini. */
#stage-canvas:focus { outline: none; }

.stage-bottom { align-items: flex-end; }
#stage-ui { display: grid; gap: 8px; max-width: 62ch; }
#stage-ui .help, #stage-ui .status { color: rgba(244, 239, 232, 0.78); font-size: 0.92rem; }
#stage-ui button {
  width: fit-content;
  border-radius: 999px;
  border: 0;
  background: var(--mist);
  color: var(--void);
  padding: 8px 12px;
  cursor: pointer;
}

.pad { display: flex; gap: 8px; }
.pad button {
  min-width: 52px;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #1a1522;
  color: var(--mist);
  display: none;
  cursor: pointer;
}

/* Tiap permainan hanya memunculkan tombol yang benar-benar dipakainya. */
dialog[data-game="jarwo"] .pad [data-hold="jump"],
dialog[data-game="ninja"] .pad [data-hold="jump"],
dialog[data-game="tuyul2d"] .pad [data-hold="jump"],
dialog[data-game="sipesia"] .pad [data-hold="jump"],
dialog[data-game="sipesia"] .pad [data-hold="up"],
dialog[data-game="sipesia"] .pad [data-hold="down"],
dialog[data-game="offroad"] .pad [data-hold="left"],
dialog[data-game="offroad"] .pad [data-hold="right"],
dialog[data-game="kimia"] .pad [data-hold="jump"],
dialog[data-game="kimia"] .pad [data-hold="left"],
dialog[data-game="kimia"] .pad [data-hold="right"],
dialog[data-game="kimia"] .pad [data-hold="up"],
dialog[data-game="kimia"] .pad [data-hold="down"],
dialog[data-game="monusa"] .pad [data-hold="left"],
dialog[data-game="monusa"] .pad [data-hold="right"],
dialog[data-game="monusa"] .pad [data-hold="up"],
dialog[data-game="monusa"] .pad [data-hold="down"],
dialog[data-game="tuyul3d"] .pad [data-hold="left"],
dialog[data-game="tuyul3d"] .pad [data-hold="right"],
dialog[data-game="tuyul3d"] .pad [data-hold="up"],
dialog[data-game="tuyul3d"] .pad [data-hold="down"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#shot {
  width: fit-content;
  max-width: calc(100vw - 24px);
  background: #0b0910;
  padding: 12px;
  display: none;
  gap: 10px;
  justify-items: end;
}

#shot[open] { display: grid; }

#shot img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 110px);
  width: auto;
  height: auto;
  border-radius: 8px;
}

.noscript {
  padding: 24px;
  background: var(--gold);
  color: var(--ink);
}

@media (max-width: 980px) {
  /* .cabinets tidak ikut dipaksa satu kolom: auto-fit sudah menurunkan
     jumlahnya sendiri, dan delapan kabinet selebar layar terlalu panjang. */
  .principle-list, .term-body { grid-template-columns: 1fr; }
  .spine-list { grid-template-columns: 1fr 1fr; }
  .cart-pane { border-left: 0; border-top: 1px solid var(--paper-deep); }
  .work { grid-template-columns: 2.4rem minmax(0, 1fr); }
  .work-kind, .work-actions { grid-column: 2; justify-content: flex-start; }
}

@media (max-width: 860px) {
  .threshold {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
  }
  .threshold:has(.pane-game:hover),
  .threshold:has(.pane-system:hover) { grid-template-columns: 1fr; }
  .threshold::after { display: none; }
  .identity {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-row: 1;
    padding: 96px 20px 28px;
    background: #100e16;
    pointer-events: auto;
  }
  .identity h1 {
    font-size: clamp(1.85rem, 8.4vw, 2.7rem);
    line-height: 1.05;
  }
  .split-text {
    background: none;
    color: var(--mist);
    -webkit-text-fill-color: var(--mist);
  }
  .identity-links { flex-wrap: wrap; row-gap: 8px; width: 100%; }
  .portrait {
    position: static;
    grid-row: 2;
    width: 100%;
    aspect-ratio: auto;
    transform: none;
    background: #100e16;
  }
  /* Tanpa kursor tidak ada yang bisa disorot, jadi pose menunjuk tak dipakai. */
  .portrait-point { display: none; }
  .portrait img {
    position: static;
    /* block, bukan inline: margin auto tidak memusatkan elemen inline. */
    display: block;
    width: min(58vw, 250px);
    height: auto;
    margin-inline: auto;
    filter: none;
    /* Di layar lebar potretnya habis di lipatan halaman; di sini ia berhenti
       di tengah kolom, jadi dadanya dilebur ke latar alih-alih dipotong. */
    -webkit-mask-image: linear-gradient(#000 74%, transparent);
    mask-image: linear-gradient(#000 74%, transparent);
  }
  body[data-world="threshold"] .brand span { display: none; }
  body[data-world="threshold"] .topbar { width: calc(100% - 16px); }
  .world-nav button { padding: 8px 8px; font-size: 0.84rem; }
  .identity-links a { color: var(--gold); }
  .pane { min-height: 70vh; padding: 28px 22px 32px; }
  .pane-game { grid-row: 3; }
  .pane-system { grid-row: 4; text-align: left; }
  .pane-system .pane-top { justify-content: flex-start; }
  .pane-system .pane-bottom { margin-left: 0; }
  .marquee { top: 72px; }
  .shot img { height: 108px; max-width: 70vw; }
  .spine { padding: 18px; }
  .spine-list { grid-template-columns: 1fr; }
  .top-links { display: none; }
  .topbar { gap: 0; }
  body[data-world="game"] .topbar,
  body[data-world="system"] .topbar { padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  html { scroll-behavior: auto; }
}
