@font-face { font-family: "Space Grotesk"; src: url("fonts/space-grotesk.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Pixelify Sans"; src: url("fonts/pixelify-sans.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --ink: #14161f; --paper: #fdfdfb; --blue: #2b4fe0; --blue-d: #1b36a8; --yellow: #ffd23f; --green: #3ccf6e; --red: #ff5a4e;
  --b: 3px solid var(--ink); --sh: 5px 5px 0 var(--ink);
  --pixel: "Pixelify Sans", ui-monospace, monospace; --sans: "Space Grotesk", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #bfe3ff; color: var(--ink); font-family: var(--sans); -webkit-tap-highlight-color: transparent; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px;
  background: var(--paper); border: var(--b); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); font-weight: 700; text-decoration: none;
  transition: transform 0.1s, box-shadow 0.1s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: none; }
.btn.big { padding: 14px 20px; font-family: var(--pixel); font-size: 22px; background: var(--yellow); }
.btn.blue { background: var(--blue); color: #fff; }
.btn:disabled { opacity: 0.6; cursor: progress; }

/* ---------- layar pembuka: visitor pass ---------- */
.loader {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; overflow: auto;
  background: radial-gradient(ellipse at 50% 30%, rgba(20, 22, 31, 0.05), rgba(20, 22, 31, 0.45));
}
.loader.out { animation: fadeOut 0.6s ease forwards; }
.loader.out .pass-wrap { animation: passAway 0.6s cubic-bezier(.5, 0, .8, .4) forwards; }
@keyframes fadeOut { to { opacity: 0; visibility: hidden; } }
@keyframes passAway { to { transform: translateY(-110vh) rotate(-8deg); } }
.pass-wrap { position: relative; width: min(430px, calc(100vw - 32px)); padding-top: 64px; animation: swingIn 1.1s cubic-bezier(.3, 1.4, .5, 1); transform-origin: 50% 0; }
@keyframes swingIn { from { transform: translateY(-60vh) rotate(6deg); } 70% { transform: rotate(-1.5deg); } }
.lanyard { position: absolute; top: -40px; left: 50%; width: 120px; height: 112px; transform: translateX(-50%); }
.lanyard::before, .lanyard::after { content: ""; position: absolute; top: 0; width: 22px; height: 100%; background: repeating-linear-gradient(0deg, var(--blue) 0 14px, var(--yellow) 14px 18px); border: 3px solid var(--ink); }
.lanyard::before { left: 18px; transform: skewX(18deg); }
.lanyard::after { right: 18px; transform: skewX(-18deg); }
.lanyard i { position: absolute; bottom: -6px; left: 50%; width: 46px; height: 26px; transform: translateX(-50%); background: #c4c9d3; border: 3px solid var(--ink); border-radius: 8px; z-index: 1; }
.pass {
  position: relative; padding: 0 24px 18px; background: var(--paper); border: 4px solid var(--ink); border-radius: 22px; box-shadow: 8px 8px 0 var(--ink); overflow: hidden;
}
.pass-hole { position: absolute; top: 12px; left: 50%; width: 54px; height: 12px; margin-left: -27px; border-radius: 99px; background: rgba(20, 22, 31, 0.15); border: 2.5px solid var(--ink); }
.pass-head {
  display: flex; align-items: center; gap: 10px; margin: 0 -24px 16px; padding: 34px 24px 12px; background: var(--blue); color: #fff; border-bottom: 4px solid var(--ink);
  font-family: var(--pixel); font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em;
}
.pass-logo { display: grid; place-items: center; width: 34px; height: 34px; color: var(--ink); background: var(--yellow); border: 3px solid var(--ink); border-radius: 9px; font-size: 15px; }
.pass-no { margin-left: auto; color: var(--yellow); }
.pass h1 { margin: 0 0 4px; font-family: var(--pixel); font-size: clamp(30px, 8vw, 40px); line-height: 1; }
.pass h1 span { color: var(--blue); }
.pass-sub { margin: 0 0 14px; font-weight: 500; color: #3a3d4a; }
.pass-host { display: flex; align-items: center; gap: 12px; padding: 10px; margin-bottom: 12px; border: var(--b); border-radius: 14px; background: #eef3ff; text-align: left; }
.pass-host img { width: 64px; height: 64px; object-fit: cover; border: var(--b); border-radius: 12px; flex: none; }
.pass-host small, .pass-check small { display: block; font-family: var(--pixel); font-size: 12px; text-transform: uppercase; color: #5a5d6a; }
.pass-host b { display: block; font-size: 17px; }
.pass-host span { font-size: 13px; font-weight: 500; color: #3a3d4a; }
.pass-check { text-align: left; margin-bottom: 14px; }
.pass-check ul { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 13px; font-weight: 600; }
.pass-check li { display: flex; align-items: center; gap: 7px; color: #8a8d99; transition: color 0.2s; }
.pass-check li::before { content: ""; width: 16px; height: 16px; flex: none; border: 2.5px solid var(--ink); border-radius: 5px; background: #fff; }
.pass-check li.ok { color: var(--ink); }
.pass-check li.ok::before { content: "✓"; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--green); animation: pop 0.35s cubic-bezier(.3, 1.6, .5, 1); }
.ld-bar { height: 14px; padding: 2px; border: var(--b); border-radius: 999px; background: #e7ecf7; overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: repeating-linear-gradient(-45deg, var(--green) 0 8px, #6ee493 8px 16px); transition: width 0.25s; }
.pass .btn.big { width: 100%; }
.ld-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 14px; font-size: 13px; font-weight: 600; }
.ld-keys { color: #5a5d6a; }
.punch {
  position: absolute; left: 50%; top: 46%; padding: 8px 16px; font-family: var(--pixel); font-size: 26px; color: var(--red); white-space: nowrap;
  border: 5px solid var(--red); border-radius: 12px; background: rgba(253, 253, 251, 0.85); transform: translate(-50%, -50%) rotate(-14deg) scale(2.6); opacity: 0; pointer-events: none;
}
.punch b { color: var(--ink); font-family: var(--sans); }
.loader.punched .punch { animation: punch 0.35s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes punch { to { opacity: 1; transform: translate(-50%, -50%) rotate(-14deg) scale(1); } }

/* ---------- intro sinematik ---------- */
.cine { position: fixed; inset: 0; z-index: 45; pointer-events: none; }
.cine .bar { position: absolute; left: 0; right: 0; height: 11vh; background: var(--ink); animation: barIn 0.7s cubic-bezier(.3, 1, .4, 1); }
.cine .bar.top { top: 0; }
.cine .bar.bot { bottom: 0; }
@keyframes barIn { from { transform: scaleY(0); } }
.cine .bar.top { transform-origin: top; }
.cine .bar.bot { transform-origin: bottom; }
.cine-cap {
  position: absolute; left: 50%; bottom: calc(11vh + 22px); margin: 0; padding: 8px 16px; transform: translateX(-50%); max-width: calc(100vw - 32px); text-align: center;
  font-family: var(--pixel); font-size: clamp(17px, 3.2vw, 26px); color: var(--ink); background: var(--yellow); border: var(--b); border-radius: 12px; box-shadow: 4px 4px 0 var(--ink);
}
.cine-cap.in { animation: capIn 0.5s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes capIn { from { transform: translate(-50%, 16px); opacity: 0; } }
.cine-skip {
  position: absolute; right: 16px; bottom: calc(11vh - 52px); pointer-events: auto; padding: 6px 12px; font-family: var(--pixel); font-size: 15px;
  color: #fff; background: transparent; border: 2px solid rgba(255, 255, 255, 0.6); border-radius: 10px;
}

/* ---------- balon obrolan NPC ---------- */
.bubble { position: fixed; z-index: 11; left: 0; top: 0; pointer-events: none; will-change: transform; }
.bubble-in {
  position: absolute; left: 0; bottom: 0; width: max-content; max-width: min(300px, 70vw); transform: translateX(-50%); padding: 10px 14px 8px;
  background: var(--paper); border: var(--b); border-radius: 14px; box-shadow: 4px 4px 0 var(--ink); font-size: 14px; font-weight: 500; line-height: 1.45;
}
.bubble-in::after { content: ""; position: absolute; left: 50%; bottom: -11px; width: 16px; height: 16px; margin-left: -8px; background: var(--paper); border-right: var(--b); border-bottom: var(--b); transform: rotate(45deg); }
.bubble-in b { display: block; font-family: var(--pixel); font-size: 13px; color: #c25400; }
.bubble-in small { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 4px; font-size: 11px; font-weight: 700; color: #5a5d6a; }
.bubble-in small kbd { min-width: 20px; height: 20px; font-size: 11px; border-width: 2px; box-shadow: 1px 1px 0 var(--ink); }
.bubble-in.in { animation: bubbleIn 0.3s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bubbleIn { from { transform: translateX(-50%) scale(0.7); opacity: 0; } }

/* ---------- mini-game QC ---------- */
.qc-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.qc-bar span { padding: 4px 12px; font-size: 14px; font-weight: 600; background: #eef3ff; border: 2.5px solid var(--ink); border-radius: 999px; }
.qc-bar b { font-variant-numeric: tabular-nums; }
.qc-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 10px; background: #2f8f5b; border: var(--b); border-radius: 14px; }
.qc-part { position: relative; display: grid; place-items: center; aspect-ratio: 1; padding: 6px; background: rgba(255, 255, 255, 0.12); border: 2px solid rgba(20, 22, 31, 0.35); border-radius: 10px; }
.qc-part svg { width: 100%; height: 100%; }
.qc-part.ghost { opacity: 0.35; }
.qc-grid.live .qc-part { cursor: crosshair; }
.qc-grid.live .qc-part:hover { background: rgba(255, 255, 255, 0.3); }
.qc-part.ng::after, .qc-part.miss::after {
  content: "NG"; position: absolute; inset: 8%; display: grid; place-items: center; font-family: var(--pixel); font-size: 20px; color: var(--red);
  border: 4px solid var(--red); border-radius: 50%; background: rgba(255, 255, 255, 0.55); transform: rotate(-12deg); animation: stampIn 0.3s cubic-bezier(.2, 1.4, .4, 1);
}
.qc-part.miss::after { content: ""; background: none; border-style: dashed; color: transparent; }
.qc-part.bad { animation: shake 0.3s; background: rgba(255, 90, 78, 0.45); }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ---------- kartu Faquloh Store ---------- */
.card .plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.card .plans > li { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px 12px 12px; background: #fff; border: var(--b); border-radius: 14px; box-shadow: 4px 4px 0 var(--c); }
.card .plans > li > b { font-family: var(--pixel); font-size: 20px; }
.card .plans .pick { position: absolute; top: -12px; right: 10px; padding: 2px 8px; font-size: 11px; font-weight: 700; background: var(--yellow); border: 2px solid var(--ink); border-radius: 999px; }
.card .plans .price { margin: 0; line-height: 1.2; }
.card .plans .price strong { font-size: 19px; }
.card .plans .price s { color: #8a8d99; font-size: 13px; }
.card .plans .price small { font-size: 12px; font-weight: 600; }
.card .plans .desc { font-size: 13px; color: #4a4d5a; line-height: 1.4; }
.card .plans ul { margin: 0; padding-left: 16px; font-size: 12.5px; line-height: 1.5; flex: 1; }
.card .plans .btn { margin-top: 4px; padding: 8px 10px; font-size: 13px; background: var(--c); }

/* ---------- photo mode ---------- */
body.photo .hud, body.photo .minimap, body.photo .prompt, body.photo .touch, body.photo .bubble { display: none !important; }

/* ---------- minimap ---------- */
.minimap {
  position: fixed; z-index: 10; left: 16px; bottom: 16px; background: var(--ink); border: var(--b); border-radius: 14px; box-shadow: 4px 4px 0 var(--ink);
}

/* ---------- sertifikat ---------- */
.cert-wrap { position: fixed; inset: 0; z-index: 42; display: grid; place-items: center; padding: 16px; background: rgba(20, 22, 31, 0.5); }
.cert {
  position: relative; width: min(560px, 100%); padding: 30px 28px 24px; text-align: center; animation: cardIn 0.4s cubic-bezier(.3, 1.4, .5, 1);
  background: #fffbea; border: 4px solid var(--ink); border-radius: 18px; box-shadow: 8px 8px 0 var(--ink), inset 0 0 0 8px #fffbea, inset 0 0 0 11px var(--ink);
}
.cert-kicker { font-family: var(--pixel); font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); }
.cert h2 { margin: 6px 0 10px; font-family: var(--pixel); font-size: clamp(26px, 6vw, 36px); line-height: 1.05; }
.cert p { margin: 0 auto 16px; max-width: 420px; line-height: 1.55; }
.cert-meta { display: flex; justify-content: center; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.cert-meta li { display: grid; padding: 6px 12px; border: 2.5px solid var(--ink); border-radius: 10px; background: #fff; }
.cert-meta span { font-size: 11px; font-weight: 600; color: #5a5d6a; text-transform: uppercase; }
.cert-meta b { font-size: 15px; }
.cert-meta b.ok { color: #1f9d4f; }
.cert-sign { display: grid; margin: 0 auto 18px; width: 220px; padding-top: 2px; border-top: 2.5px solid var(--ink); }
.cert-sign span { order: -1; margin-bottom: 4px; font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 30px; transform: rotate(-4deg); }
.cert-sign small { font-size: 12px; font-weight: 600; color: #5a5d6a; }
.cert-seal {
  position: absolute; top: -26px; right: -14px; display: grid; place-items: center; width: 86px; height: 86px; font-family: var(--pixel); font-size: 17px; line-height: 1;
  color: var(--ink); background: var(--green); border: 4px solid var(--ink); border-radius: 50%; box-shadow: 3px 3px 0 var(--ink); transform: rotate(12deg);
  animation: stampIn 0.5s cubic-bezier(.2, 1.4, .4, 1) 0.35s backwards;
}
.cert .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.confetti { position: fixed; inset: 0; z-index: 48; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border: 2px solid var(--ink); animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--x), 110vh) rotate(var(--r)); } }

/* ---------- HUD ---------- */
.hud {
  position: fixed; z-index: 10; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; gap: 8px; padding: 14px;
  padding-top: max(14px, env(safe-area-inset-top)); pointer-events: none;
}
.hud > div { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.hud-right { justify-content: flex-end; }
.chip {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px;
  background: var(--paper); border: var(--b); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap;
}
.chip.brand { font-family: var(--pixel); font-size: 17px; background: var(--yellow); }
.chip.zone { background: var(--blue); color: #fff; }
.chip.zone.pop { animation: pop 0.45s cubic-bezier(.3, 1.6, .5, 1); }
.chip.stat b { font-family: var(--sans); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.chip.icon { width: 40px; padding: 0; justify-content: center; font-size: 17px; }
.chip.icon[aria-pressed="true"] { background: var(--green); }
#nightBtn[aria-pressed="true"] { background: #1d2547; color: var(--yellow); }
.stamp-ico { color: var(--green); }
.bolt-ico { color: #e0a800; }
.chip.bump { animation: pop 0.45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 40% { transform: scale(1.18) rotate(-4deg); } }

.prompt {
  position: fixed; z-index: 10; left: 50%; bottom: 34px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: var(--paper); border: var(--b); border-radius: 14px; box-shadow: var(--sh); font-weight: 700; white-space: nowrap;
  animation: rise 0.25s cubic-bezier(.3, 1.5, .5, 1);
}
@keyframes rise { from { transform: translate(-50%, 12px); opacity: 0; } }
kbd { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; font-family: var(--pixel); font-size: 15px; background: var(--yellow); border: 2.5px solid var(--ink); border-radius: 8px; box-shadow: 2px 2px 0 var(--ink); }

.toast {
  position: fixed; z-index: 30; left: 50%; top: 74px; transform: translate(-50%, -20px); padding: 10px 16px; max-width: calc(100vw - 32px); text-align: center;
  background: var(--ink); color: #fff; border-radius: 12px; font-weight: 700; opacity: 0; transition: opacity 0.2s, transform 0.3s cubic-bezier(.3, 1.5, .5, 1); pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- kartu ---------- */
.card-wrap { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(20, 22, 31, 0.45); }
.card {
  position: relative; width: min(640px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 26px;
  background: var(--paper); border: 4px solid var(--ink); border-radius: 20px; box-shadow: 8px 8px 0 var(--ink); animation: cardIn 0.32s cubic-bezier(.3, 1.4, .5, 1);
}
@keyframes cardIn { from { transform: translateY(18px) scale(0.96); opacity: 0; } }
.card-x { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border: var(--b); border-radius: 10px; background: var(--paper); box-shadow: 2px 2px 0 var(--ink); font-weight: 700; z-index: 2; }
.card .kicker { display: inline-block; margin-bottom: 8px; padding: 3px 10px; font-family: var(--pixel); font-size: 14px; background: var(--yellow); border: 2.5px solid var(--ink); border-radius: 999px; }
.card h2 { margin: 0 44px 6px 0; font-family: var(--pixel); font-size: clamp(26px, 5vw, 34px); line-height: 1.05; }
.card .meta { margin: 0 0 12px; font-weight: 600; color: #4a4d5a; }
.card p { line-height: 1.55; }
.card ul.notes { margin: 10px 0 0; padding-left: 20px; line-height: 1.55; }
.card ul.notes li { margin: 4px 0; }
.card .shot { position: relative; margin: 6px 0 14px; border: var(--b); border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 10; background: #eef3ff; }
a.shot { display: block; }
.card .shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.card .tags li { padding: 3px 10px; font-size: 13px; font-weight: 700; background: #eef3ff; border: 2px solid var(--ink); border-radius: 999px; }
.card .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.card .grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.card .grid2 li { padding: 8px 10px; border: 2.5px solid var(--ink); border-radius: 12px; background: #fff; font-size: 14px; }
.card .grid2 li b { display: block; }
.card .grid2 li span { color: #5a5d6a; font-size: 13px; }
.card h3 { margin: 18px 0 6px; font-family: var(--pixel); font-size: 19px; }
.stamp {
  position: absolute; right: 16px; bottom: 16px; padding: 6px 14px; font-family: var(--pixel); font-size: 22px; color: var(--green);
  border: 4px solid var(--green); border-radius: 10px; background: rgba(255, 255, 255, 0.9); transform: rotate(-12deg);
  animation: stampIn 0.45s cubic-bezier(.2, 1.4, .4, 1) 0.15s backwards;
}
@keyframes stampIn { from { transform: rotate(-12deg) scale(2.4); opacity: 0; } }

/* ---------- bantuan ---------- */
.help {
  position: fixed; z-index: 35; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 32px)); padding: 22px;
  background: var(--paper); border: 4px solid var(--ink); border-radius: 20px; box-shadow: 8px 8px 0 var(--ink);
}
.help { max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; }
.help h2 { margin: 0 0 10px; font-family: var(--pixel); }
.help #helpClose { position: sticky; bottom: 0; width: 100%; }
.help ul { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 8px; font-weight: 500; }
.help .touch-only { display: none; }                      /* daftar sentuh cuma di layar sentuh */
.is-touch .help .touch-only { display: grid; }
.is-touch .help .keys-only { display: none; }
.help p { margin: 0 0 14px; line-height: 1.5; }

/* ---------- kontrol HP ---------- */
.touch { position: fixed; inset: auto 0 0 0; z-index: 12; height: 0; }
.joy {
  position: fixed; left: max(22px, env(safe-area-inset-left)); bottom: max(26px, env(safe-area-inset-bottom)); width: 124px; height: 124px;
  border: 3px solid rgba(20, 22, 31, 0.7); border-radius: 50%; background: rgba(255, 255, 255, 0.35); touch-action: none;
}
.joy i { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px; border: var(--b); border-radius: 50%; background: var(--yellow); box-shadow: 2px 2px 0 var(--ink); }
.tbtn {
  position: fixed; bottom: max(32px, env(safe-area-inset-bottom)); width: 68px; height: 68px; border: 4px solid var(--ink); border-radius: 50%;
  background: var(--paper); box-shadow: 4px 4px 0 var(--ink); font-family: var(--pixel); font-size: 26px; touch-action: manipulation;
}
.tbtn.jump { right: max(22px, env(safe-area-inset-right)); }
.tbtn.act { right: calc(max(22px, env(safe-area-inset-right)) + 82px); background: var(--yellow); }
.tbtn:active { transform: translate(4px, 4px); box-shadow: none; }

/* ---------- teks buat mesin pencari (nggak kelihatan pas game jalan) ---------- */
.seo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.no-webgl { overflow: auto; background: var(--paper); }
body.no-webgl .seo { position: static; width: auto; height: auto; clip: auto; white-space: normal; max-width: 680px; margin: 40px auto; padding: 0 16px; }
body.no-webgl #game, body.no-webgl .loader { display: none; }

/* ---------- menu HP, subtitle obrolan, tombol aksi ---------- */
.menu-btn, .touch-only, .photo-exit, .link2d { display: none; }
.sheet { position: fixed; inset: 0; z-index: 44; display: flex; align-items: flex-end; justify-content: center; padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); background: rgba(20, 22, 31, 0.4); }
.sheet-in {
  width: min(460px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px; background: var(--paper);
  border: 4px solid var(--ink); border-radius: 20px; box-shadow: 6px 6px 0 var(--ink); animation: sheetIn 0.28s cubic-bezier(.3, 1.3, .5, 1);
}
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0; } }
.sheet-title { grid-column: 1 / -1; font-family: var(--pixel); font-size: 20px; }
.sheet-in button, .sheet-in a {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 12px; font: 700 15px var(--sans); color: var(--ink); text-decoration: none; text-align: left;
  background: #fff; border: 3px solid var(--ink); border-radius: 14px; box-shadow: 3px 3px 0 var(--ink);
}
.sheet-in i { display: grid; place-items: center; width: 28px; height: 28px; font-style: normal; background: var(--yellow); border: 2px solid var(--ink); border-radius: 8px; flex: none; font-size: 14px; }
.sheet-in [aria-pressed="true"] { background: #dff7e7; }
.sheet-in [aria-pressed="true"] i { background: var(--green); }
.sheet-in button:active, .sheet-in a:active { transform: translate(3px, 3px); box-shadow: none; }
body.photo .photo-exit { display: grid; place-items: center; position: fixed; z-index: 20; top: max(12px, env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; font-weight: 700; background: var(--paper); border: var(--b); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); }
.ti { display: inline-grid; place-items: center; width: 26px; }

.is-touch .menu-btn, .is-touch .link2d { display: inline-flex; }
.chip.link2d { font-family: var(--pixel); font-size: 15px; background: #ff90e8; width: auto; padding: 0 10px; }
/* ===== tata letak HP ===== */
.is-touch .hud { padding: 10px; padding-top: max(10px, env(safe-area-inset-top)); gap: 6px; }
.is-touch .chip { height: 38px; padding: 0 10px; font-size: 14px; box-shadow: 2px 2px 0 var(--ink); }
.is-touch .chip.icon { width: 38px; padding: 0; }
.is-touch .chip.link2d { width: auto; padding: 0 10px; }
.is-touch .chip.stat { gap: 4px; }
.is-touch .chip.stat b { font-size: 15px; }
/* nama zona turun jadi label kecil di bawah HUD */
.is-touch .chip.zone { position: fixed; left: 10px; top: calc(max(10px, env(safe-area-inset-top)) + 46px); height: 28px; padding: 0 10px; font-size: 12px; border-width: 2.5px; }
.is-touch .minimap { left: auto; right: 10px; bottom: auto; top: calc(max(10px, env(safe-area-inset-top)) + 46px); border-width: 2.5px; box-shadow: 2px 2px 0 var(--ink); }
.is-touch .toast { top: calc(max(10px, env(safe-area-inset-top)) + 84px); max-width: calc(100vw - 140px); font-size: 13px; padding: 8px 12px; }
/* joystick: samar sebagai petunjuk, nyala pas dipegang (bisa muncul di mana aja di kiri bawah) */
.is-touch .joy { opacity: 0.55; transition: opacity 0.15s; }
.is-touch .joy.live { opacity: 1; }
/* tombol: aksi numpuk di atas lompat biar nggak nabrak joystick */
.is-touch .tbtn { width: 64px; height: 64px; font-size: 24px; bottom: max(26px, env(safe-area-inset-bottom)); }
.is-touch .tbtn.jump { right: max(16px, env(safe-area-inset-right)); }
.is-touch .tbtn.act { right: max(16px, env(safe-area-inset-right)); bottom: calc(max(26px, env(safe-area-inset-bottom)) + 76px); height: 54px; font-size: 18px; }
.is-touch #musicBtn, .is-touch #spinBtn, .is-touch #nightBtn, .is-touch #helpBtn, .is-touch .chip.link, .is-touch .chip.brand { display: none; }
.is-touch .keys-only { display: none; }
.is-touch .ld-keys.keys-only { display: none; }
.is-touch .ld-keys.touch-only { display: inline; }
.is-touch .touch-only { display: grid; }

/* obrolan jadi subtitle di atas tombol, bukan balon ngambang */
.is-touch .bubble { left: 50%; top: auto; bottom: calc(max(26px, env(safe-area-inset-bottom)) + 150px); transform: none !important; }
.is-touch .bubble-in { width: min(360px, calc(100vw - 32px)); max-width: none; font-size: 15px; }
.is-touch .bubble-in::after { display: none; }
.is-touch .bubble-in small kbd { display: none; }
/* tombol aksi kontekstual */
.tbtn.act { width: auto; min-width: 68px; padding: 0 18px; border-radius: 999px; font-family: var(--pixel); font-size: 19px; }
/* kartu jadi bottom sheet */
.is-touch .card-wrap { align-items: end; padding: 0; }
.is-touch .card { width: 100%; max-height: 88dvh; border-radius: 22px 22px 0 0; border-bottom: none; box-shadow: none; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); animation: sheetIn 0.32s cubic-bezier(.3, 1.2, .5, 1); }
.is-touch .card::before { content: ""; display: block; width: 44px; height: 5px; margin: -8px auto 12px; border-radius: 9px; background: #c4c9d3; }

@media (max-width: 640px) {
  .hud { padding: 10px; }
  .chip { height: 36px; padding: 0 10px; font-size: 13px; }
  .chip.brand, .chip.link { display: none; }
  .chip.icon { width: 36px; }
  .prompt { bottom: 128px; }
  .minimap { left: auto; right: 10px; bottom: auto; top: calc(max(10px, env(safe-area-inset-top)) + 48px); }
  .toast { top: calc(max(10px, env(safe-area-inset-top)) + 50px); font-size: 14px; }
  .pass { padding: 0 18px 16px; }
  .pass-head { margin: 0 -18px 14px; padding-left: 18px; padding-right: 18px; }
  .pass-check ul { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  .ld-stats li { min-width: 0; flex: 1; }
}
/* ===== HP landscape: layar pendek ===== */
@media (max-height: 520px) {
  .is-touch .bubble { bottom: max(14px, env(safe-area-inset-bottom)); }
  .is-touch .bubble-in { width: min(420px, calc(100vw - 400px)); min-width: 240px; font-size: 13.5px; padding: 8px 12px 6px; }
  .is-touch .tbtn.act { bottom: max(26px, env(safe-area-inset-bottom)); right: calc(max(16px, env(safe-area-inset-right)) + 76px); }
  .is-touch .minimap { width: 92px !important; height: 92px !important; }
  .is-touch .card { max-height: 94dvh; }
  .card .shot { max-height: 42vh; aspect-ratio: auto; }
  .card .shot img { height: 42vh; }
  /* visitor pass versi pendek */
  .loader { place-items: start center; }
  .pass-wrap { padding-top: 8px; width: min(560px, calc(100vw - 32px)); }
  .lanyard, .pass-hole, .pass-host, .pass-sub { display: none; }
  .pass-head { padding-top: 12px; margin-bottom: 10px; }
  .pass h1 { font-size: 30px; margin-bottom: 8px; }
  .pass-check ul { grid-template-columns: repeat(4, auto) !important; justify-content: space-between; font-size: 12px; }
  .ld-foot { margin-top: 8px; }
  .help { max-height: calc(100dvh - 24px); overflow: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .loader.out { display: none; } .punch { display: none; } }

/* ---------- The Shelf: penelusur di kartu ---------- */
.sh-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.sh-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; font: 700 13.5px var(--sans); background: var(--paper); border: 2.5px solid var(--ink); border-radius: 999px; }
.sh-chip b { font-weight: 700; color: #5a5d6a; }
.sh-chip[aria-pressed="true"] { background: var(--yellow); box-shadow: 2px 2px 0 var(--ink); }
.sh-q { width: 100%; margin: 0 0 12px; padding: 10px 14px; font: 500 16px var(--sans); background: #fff; border: 3px solid var(--ink); border-radius: 12px; }
.sh-q:focus { outline: none; box-shadow: 3px 3px 0 var(--ink); }
.sh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px 8px; margin: 0; padding: 0; list-style: none; }
.sh-grid li[hidden] { display: none; }
.sh-b { display: grid; justify-items: center; gap: 5px; width: 100%; padding: 4px; background: none; border: 2.5px solid transparent; border-radius: 10px; text-align: center; }
.sh-b:hover, .sh-b:focus-visible { background: #fff1c9; border-color: var(--ink); transform: translateY(-2px); }
.sh-th { display: block; border: 2.5px solid var(--ink); border-radius: 4px; background-color: var(--ink); background-repeat: no-repeat; box-shadow: 3px 3px 0 var(--ink); }
.sh-t { font-size: 11.5px; font-weight: 700; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sh-none { margin: 12px 0; font-weight: 600; color: #5a5d6a; }
.sh-back { margin-bottom: 12px; }
.sh-det { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); gap: 18px; align-items: start; }
.sh-det img { width: 100%; height: auto; border: 3px solid var(--ink); border-radius: 6px; box-shadow: 5px 5px 0 var(--ink); }
.sh-cap { margin: 8px 0 0; font-style: italic; line-height: 1.5; }
.sh-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; font-weight: 700; font-size: 14px; }
.sh-nav .btn:disabled { opacity: .35; }
@media (max-width: 520px) { .sh-det { grid-template-columns: minmax(0, 1fr); } .sh-det img { max-width: 170px; margin: 0 auto; } .sh-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); } }
