﻿:root {
  --ink: #2a211c;
  --ink-soft: #6b5d53;
  --cream: #f3e9dc;
  --paper: #fffdf9;
  --line: #2a211c;
  --accent: #b5653b;
  --accent-soft: #f4e6d8;
  --shopee: #ee4d2d;
  --radius: 18px;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --font-display: 'Fredoka', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

#scene {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#scene.dragging { cursor: grabbing; }

/* ---------- shared bits ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 14px;
  background: var(--paper);
  border: 2.5px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-display);
  font-weight: 600; font-size: 15px;
  white-space: nowrap;
}
.chip-btn { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.chip-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.chip-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.chip-icon { width: 40px; padding: 0; justify-content: center; font-size: 18px; }
.chip-store { background: var(--accent); color: #fff; }
.chip-store .chip-logo { height: 26px; width: auto; display: block; }
.chip-zone { transition: background .25s, color .25s; }
.chip-count svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chip-count.done { background: #c9e7b8; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px;
  border: 2.5px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-family: var(--font-display); font-weight: 600; font-size: 18px;
  text-decoration: none; color: var(--ink);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .2s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; box-shadow: var(--shadow); }
.btn-primary { background: #f6c94c; }
.btn-shopee { background: var(--shopee); color: #fff; }
.btn-ghost { background: var(--paper); }
.btn svg { width: 20px; height: 20px; flex: none; }

.link {
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
  color: var(--ink-soft);
}
.link:hover { color: var(--ink); }
.eyebrow {
  display: block;
  font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft);
}
kbd {
  display: inline-grid; place-items: center;
  min-width: 28px; height: 28px; padding: 0 7px;
  background: #f6c94c;
  border: 2px solid var(--ink); border-radius: 7px;
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
}

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; }
.overlay-welcome {
  /* flex + margin:auto centres the pass but still lets it scroll when taller than the screen */
  display: flex;
  padding: 24px 16px;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(243,233,220,.15), rgba(243,233,220,.55));
  transition: opacity .45s ease;
}
.overlay-welcome.leaving { opacity: 0; pointer-events: none; }

.pass { position: relative; width: min(420px, 100%); margin: auto; padding-top: 54px; animation: swing 4.5s ease-in-out infinite; transform-origin: 50% 0; }
.pass-strap {
  position: absolute; top: -40px; left: 50%; width: 92px; height: 104px; transform: translateX(-50%);
  background:
    linear-gradient(62deg, transparent 43%, var(--ink) 43%, var(--ink) 46%, var(--accent) 46%, var(--accent) 60%, var(--ink) 60%, var(--ink) 63%, transparent 63%),
    linear-gradient(-62deg, transparent 43%, var(--ink) 43%, var(--ink) 46%, var(--accent) 46%, var(--accent) 60%, var(--ink) 60%, var(--ink) 63%, transparent 63%);
}
.pass-card {
  position: relative;
  background: var(--paper);
  border: 3px solid var(--line);
  border-radius: 22px;
  box-shadow: 6px 6px 0 var(--ink);
  overflow: hidden;
}
.pass-card::before {
  content: ''; position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 64px; height: 12px; border-radius: 99px;
  background: var(--cream); border: 2.5px solid var(--ink); z-index: 2;
}
.pass-head {
  display: flex; align-items: center; gap: 10px;
  padding: 34px 20px 14px;
  background: var(--accent); color: #fff;
  border-bottom: 3px solid var(--ink);
}
.pass-logo { height: 60px; width: auto; display: block; margin: -8px 0; }
.pass-label { font-family: var(--font-display); font-weight: 600; letter-spacing: .1em; font-size: 14px; }
.pass-no { margin-left: auto; font-family: var(--font-display); font-weight: 600; color: #f6c94c; font-size: 14px; }
.pass-body { padding: 18px 22px 20px; }
.pass-body h1 {
  margin: 0;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(30px, 8vw, 40px); line-height: 1;
}
.pass-body h1 span { color: var(--accent); font-size: .72em; }
.pass-lead { margin: 10px 0 14px; font-size: 14.5px; line-height: 1.5; color: var(--ink-soft); }

.tenants {
  list-style: none; margin: 0 0 14px; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.tenants li {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border: 2px solid var(--line); border-radius: 10px;
  background: var(--t-soft, #fff);
  font-size: 12.5px; font-weight: 700; line-height: 1.2;
}
.tenants .no {
  flex: none; display: grid; place-items: center; width: 22px; height: 22px;
  border-radius: 6px; border: 2px solid var(--ink);
  background: var(--t, #ccc); color: #fff;
  font-family: var(--font-display); font-size: 11px;
}

.outfit { margin-bottom: 16px; }
.outfit-row { display: flex; gap: 10px; margin-top: 8px; }
.outfit-opt {
  flex: 1; display: grid; justify-items: center; gap: 4px;
  padding: 8px 4px 6px;
  border: 2px solid var(--line); border-radius: 12px;
  background: var(--paper);
  cursor: pointer;
  font-size: 11.5px; font-weight: 700;
  transition: transform .12s, box-shadow .12s, background .15s;
}
.outfit-opt .mini { width: 26px; height: 34px; display: grid; grid-template-rows: 10px 13px 11px; justify-items: center; }
.outfit-opt .mini i { display: block; border: 1.5px solid var(--ink); border-radius: 2px; }
.outfit-opt .mini .h { width: 12px; background: #f2c9a0; border-top: 4px solid var(--hair, #2a211c); }
.outfit-opt .mini.long .h { box-shadow: -3px 2px 0 -1px var(--hair), 3px 2px 0 -1px var(--hair); }
.outfit-opt .mini .s { width: 24px; height: 9px; clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%); border: 0; }
.outfit-opt .mini .t { width: 22px; }
.outfit-opt .mini .l { width: 14px; }
.outfit-opt[aria-checked="true"] { background: #fff4cf; box-shadow: var(--shadow-sm); transform: translate(-1px, -1px); }
.btn-enter { width: 100%; }
.pass-foot { margin: 12px 0 4px; font-size: 12.5px; color: var(--ink-soft); text-align: center; }
.pass-body .link { display: block; margin: 0 auto; }

@keyframes swing { 0%, 100% { transform: rotate(-.8deg); } 50% { transform: rotate(.8deg); } }

/* ---------- HUD ---------- */
.hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-tl, .hud-tr {
  position: absolute; top: max(14px, env(safe-area-inset-top));
  display: flex; gap: 10px; flex-wrap: wrap;
}
.hud-tl { left: 16px; }
.hud-tr { right: 16px; justify-content: flex-end; }

#minimap {
  position: absolute; left: 16px; bottom: 16px;
  width: 180px; height: 150px;
  border: 2.5px solid var(--line); border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}

.prompt {
  /* left/right + auto margins (not left:50%) so it can use the full width before wrapping */
  position: absolute; left: 0; right: 0; bottom: 34px; margin-inline: auto; width: fit-content;
  display: flex; align-items: center; gap: 16px;
  max-width: calc(100% - 32px);
  padding: 14px 28px 14px 14px;
  background: var(--paper);
  border: 3px solid var(--line); border-radius: 20px;
  box-shadow: 5px 5px 0 var(--ink);
  font-size: 17px; font-weight: 600; text-align: left;
  cursor: pointer;
  animation: pop .25s ease-out;
}
.prompt .swatch { flex: none; width: 60px; height: 60px; border-radius: 14px; border: 2.5px solid var(--ink); display: grid; place-items: center; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 28px; }
.prompt b { font-family: var(--font-display); font-weight: 700; font-size: 25px; display: block; line-height: 1.15; }
.prompt small { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; color: var(--ink); font-size: 17px; font-weight: 700; }
.prompt small kbd { min-width: 32px; height: 32px; font-size: 17px; }
@keyframes pop { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

.toast {
  position: absolute; left: 0; right: 0; top: 76px; margin-inline: auto; width: fit-content; transform: translateY(-10px);
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  background: var(--ink); color: #fff;
  border-radius: 12px;
  font-family: var(--font-display); font-weight: 500; font-size: 16px; text-align: center;
  opacity: 0; transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }

.joystick {
  position: absolute; left: 24px; bottom: max(24px, env(safe-area-inset-bottom));
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,253,249,.55);
  border: 2.5px solid var(--line);
  touch-action: none;
}
.joystick .knob {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%; background: #f6c94c; border: 2.5px solid var(--line); box-shadow: var(--shadow-sm);
}
.btn-jump {
  position: absolute; right: 24px; bottom: max(28px, env(safe-area-inset-bottom));
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--paper); border: 2.5px solid var(--line); box-shadow: var(--shadow-sm);
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  touch-action: none;
}

/* ---------- modal ---------- */
.overlay-modal { z-index: 30; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(42,33,28,.42); animation: fade .2s ease-out; }
.modal-slot { position: relative; width: 100%; display: grid; place-items: center; max-height: 100%; }
@keyframes fade { from { opacity: 0; } }

.sheet {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 3px solid var(--line); border-radius: 22px;
  box-shadow: 6px 6px 0 var(--ink);
  overflow: hidden;
  animation: rise .28s cubic-bezier(.2,.9,.3,1.2);
}
.sheet-sm { width: min(480px, 100%); }
@keyframes rise { from { transform: translateY(24px) scale(.97); opacity: 0; } }
.close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--paper); border: 2.5px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-sm);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.close:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.catalog-head {
  position: relative;
  padding: 22px 70px 20px 24px;
  background: var(--b);
  color: #fff;
  border-bottom: 3px solid var(--line);
}
.booth-no {
  display: inline-block; margin-bottom: 8px; padding: 3px 10px;
  background: var(--paper); color: var(--b-ink);
  border: 2px solid var(--line); border-radius: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 12.5px; letter-spacing: .06em;
}
.catalog-head h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 5vw, 34px); line-height: 1.05; }
.catalog-head p { margin: 6px 0 0; font-size: 14.5px; opacity: .95; }

.catalog-body { overflow-y: auto; padding: 20px 24px; background: var(--b-soft); }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.product {
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 2.5px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  text-decoration: none; color: var(--ink);
  transition: transform .14s, box-shadow .14s;
}
.product:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.product:focus-visible { outline: 3px solid var(--b); outline-offset: 2px; }
.product-img {
  aspect-ratio: 1 / 1;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 42%, #fff 0 46%, var(--b-soft) 47%);
  border-bottom: 2.5px solid var(--line);
}
.product-img svg { width: 74%; height: 74%; transition: transform .25s; }
.product:hover .product-img svg { transform: rotate(-4deg) scale(1.04); }
.product-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.product-img.has-photo { background: var(--b-soft); overflow: hidden; }
.product:hover .product-img img { transform: scale(1.05); }
.product-info { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; }
.product-name { font-weight: 700; font-size: 14px; line-height: 1.3; }
.product-price { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--b-ink); }
.product-go { margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--shopee); }

.catalog-foot {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  padding: 16px 24px 18px;
  border-top: 3px solid var(--line);
  background: var(--paper);
}
.catalog-foot .btn { flex: 1 1 200px; }
.catalog-foot .hint { flex-basis: 100%; margin: 0; font-size: 12.5px; color: var(--ink-soft); }

/* directory */
.dir-head { padding: 22px 70px 16px 24px; border-bottom: 3px solid var(--line); background: #f6c94c; }
.dir-head h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 28px; }
.dir-head p { margin: 4px 0 0; font-size: 14px; color: var(--ink); }
.dir-body {
  overflow-y: auto; padding: 18px 24px 22px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-auto-rows: max-content; align-content: start; gap: 16px;
  background: var(--cream);
}
.dir-card {
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 2.5px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm);
}
.dir-card-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--b-soft); border-bottom: 2.5px solid var(--line); border-radius: 13px 13px 0 0; }
.dir-card-top .no { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 2.5px solid var(--line); background: var(--b); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.dir-card-top h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 19px; line-height: 1.1; }
.dir-card-top span { font-size: 12.5px; font-weight: 700; color: var(--b-ink); }
.dir-card p { flex: 1; margin: 0; padding: 12px 16px 0; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.dir-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 14px 16px 16px;
}
.dir-actions.no3d { grid-template-columns: 1fr; }
.dir-title { flex: 1; min-width: 0; }
.dir-social { display: flex; gap: 6px; }
.dir-social .btn { min-height: 34px; width: 34px; padding: 0; border-radius: 10px; box-shadow: 2px 2px 0 var(--ink); }
.dir-social .btn svg { width: 16px; height: 16px; }
.dir-actions .btn {
  width: 100%; min-height: 44px; padding: 0 10px; gap: 7px;
  font-size: 15px; box-shadow: var(--shadow-sm); white-space: nowrap;
}
.dir-actions .btn svg { width: 18px; height: 18px; }
.dir-actions .btn-cat { grid-column: 1 / -1; background: var(--b); color: #fff; }
.dir-actions .btn-sq { width: 44px; padding: 0; }

/* help */
.help-body { padding: 24px; }
.help-body h2 { margin: 0 0 14px; font-family: var(--font-display); font-weight: 700; font-size: 26px; }
.help-body ul { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.help-body li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; }
.help-body .btn { width: 100%; }

.help-body h3 { margin: 4px 0 10px; font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.help-body .games li { flex-wrap: nowrap; font-size: 14px; line-height: 1.35; }
.gi { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid var(--ink); border-radius: 9px; }
.gi svg { width: 17px; height: 17px; }
.help-body.center { text-align: center; }
.badge-big {
  display: grid; place-items: center; width: 104px; height: 104px; margin: 4px auto 14px;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 50%; box-shadow: var(--shadow);
}
.badge-big img { width: 68%; height: auto; }
.muted { color: var(--ink-soft); font-size: 15px; line-height: 1.5; margin: 6px 0 18px; }
.stack { display: grid; gap: 10px; }
.btn-sq { flex: 0 0 auto !important; width: 42px; padding: 0 !important; }

.noscript { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; font-weight: 700; }

/* ---------- HUD additions ---------- */
.hud-tl { flex-direction: column; align-items: flex-start; }
.hud-row { display: flex; gap: 10px; }
.chip svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
#btn-night[aria-pressed="true"] { background: #2a2550; color: #ffe8a3; }
.is-night .chip, .is-night .quests, .is-night #minimap { box-shadow: 3px 3px 0 #000; }

.quests {
  width: 240px;
  background: var(--paper);
  border: 2.5px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.quests-head {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 12px; background: #f6c94c; border: 0; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 15px; text-align: left;
}
.q-count { margin-left: auto; font-size: 13px; padding: 1px 8px; border-radius: 99px; background: var(--paper); border: 2px solid var(--ink); }
.chev { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.quests.collapsed .chev { transform: rotate(-90deg); }
.quests.collapsed ul { display: none; }
.quests ul { list-style: none; margin: 0; padding: 8px 10px 10px; display: grid; gap: 6px; border-top: 2.5px solid var(--line); }
.quests li { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; line-height: 1.25; }
.q-box { flex: none; display: grid; place-items: center; width: 18px; height: 18px; border: 2px solid var(--ink); border-radius: 5px; background: var(--paper); }
.q-box svg { width: 13px; height: 13px; }
.quests li.ok .q-box { background: #8fd18b; }
.quests li.ok .q-label { text-decoration: line-through; color: var(--ink-soft); }
.q-n { margin-left: auto; font-family: var(--font-display); font-size: 13px; color: var(--ink-soft); }

.prompt .swatch svg { width: 32px; height: 32px; }
.prompt.passive { cursor: default; }

.btn-emote { bottom: calc(max(28px, env(safe-area-inset-bottom)) + 90px); background: #ff9fb2; }

.flash { position: fixed; inset: 0; z-index: 25; background: #fff; opacity: 0; pointer-events: none; }
.flash.go { animation: flash .5s ease-out; }
@keyframes flash { 0% { opacity: .9; } 100% { opacity: 0; } }
.confetti { position: fixed; inset: 0; z-index: 40; pointer-events: none; }

.tenants li > span:last-child { display: grid; }
.tenants small { font-size: 10.5px; font-weight: 700; color: var(--ink-soft); letter-spacing: .04em; text-transform: uppercase; }

/* quiz */
.quiz-body { padding: 18px 22px 22px; overflow-y: auto; }
.quiz-top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.quiz-bar { height: 10px; margin: 8px 0 16px; border: 2px solid var(--ink); border-radius: 99px; overflow: hidden; background: var(--cream); }
.quiz-bar i { display: block; height: 100%; background: #f6c94c; transition: width .3s; }
.quiz-q { margin: 0 0 14px; font-family: var(--font-display); font-weight: 600; font-size: 21px; line-height: 1.25; }
.quiz-opts { display: grid; gap: 10px; }
.quiz-opt {
  min-height: 48px; padding: 10px 14px; text-align: left;
  background: var(--paper); border: 2.5px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm);
  font-weight: 700; font-size: 15px; cursor: pointer; transition: transform .1s, background .15s;
}
.quiz-opt:hover:not(:disabled) { background: #fff4cf; transform: translate(-1px, -1px); }
.quiz-opt:disabled { cursor: default; }
.quiz-opt.right { background: #8fd18b; }
.quiz-opt.wrong { background: #f2a49a; }
.quiz-end { text-align: center; }
.quiz-score { font-family: var(--font-display); font-weight: 700; font-size: 64px; line-height: 1; margin: 6px 0; }
.quiz-score small { font-size: 28px; color: var(--ink-soft); }
.quiz-end p { margin: 8px 0 18px; color: var(--ink-soft); }

/* claw game */
.game-head { background: #e0503f; color: #fff; }
.game-head p { color: #fff; }
.claw-wrap { padding: 14px 16px 0; background: var(--cream); }
.claw-wrap canvas { display: block; width: 100%; height: auto; border: 2.5px solid var(--line); border-radius: 14px; }
.game-foot { display: flex; align-items: center; gap: 12px; padding: 14px 16px 16px; background: var(--cream); }
.game-foot span { font-weight: 700; }
.game-foot .btn { margin-left: auto; min-width: 140px; }

.catalog-foot .btn { white-space: nowrap; }
.catalog-foot .btn-shopee { flex: 1 1 100%; }
.catalog-foot .btn-ghost { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 12px; font-size: 16px; }

/* fitting room */
.fit-body { display: grid; grid-template-columns: 1fr; grid-auto-rows: max-content; gap: 0; overflow-y: auto; background: var(--b-soft); }
.fit-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; padding: 18px 22px; align-items: center; }
.fit-photo { aspect-ratio: 1; border: 2.5px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--paper); box-shadow: var(--shadow-sm); }
.fit-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fit-tag { display: inline-block; padding: 2px 10px; border: 2px solid var(--ink); border-radius: 99px; background: #f6c94c; font-size: 12px; font-weight: 800; }
.fit-meta h3 { margin: 10px 0 4px; font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 1.2; }
.fit-price { font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--b-ink); }
.fit-actions { display: grid; gap: 10px; margin-top: 16px; }
.fit-actions .btn { min-height: 46px; font-size: 16px; }
.fit-list { display: flex; gap: 10px; padding: 14px 22px 18px; overflow-x: auto; border-top: 2.5px solid var(--line); background: var(--paper); }
.fit-item {
  flex: none; width: 76px; height: 76px; padding: 0; overflow: hidden; cursor: pointer;
  border: 2.5px solid var(--line); border-radius: 12px; background: var(--b-soft);
  transition: transform .12s, box-shadow .12s;
}
.fit-item img, .fit-item svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.fit-item:hover { transform: translateY(-2px); }
.fit-item[aria-selected="true"] { box-shadow: 0 0 0 3px var(--b), var(--shadow-sm); transform: translateY(-2px); }
@media (max-width: 640px) {
  .fit-stage { grid-template-columns: 118px minmax(0, 1fr); gap: 12px; padding: 14px; align-items: start; }
  .fit-meta h3 { font-size: 17px; margin-top: 6px; }
  .fit-price { font-size: 16px; }
  .fit-actions { gap: 8px; margin-top: 10px; }
  .fit-actions .btn { min-height: 40px; font-size: 14px; padding: 0 10px; }
  .fit-list { padding: 12px 14px 14px; }
  .fit-item { width: 64px; height: 64px; }
}

/* loader */
.loader {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 24px;
  background: var(--cream);
  transition: opacity .4s ease;
}
.loader.done { opacity: 0; pointer-events: none; }
.loader-card { width: min(340px, 100%); text-align: center; }
.loader-logo {
  display: block; width: 104px; height: auto; margin: 0 auto 16px;
  animation: bob 1.6s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-6px); } }
.loader-title { margin: 0 0 14px; font-family: var(--font-display); font-weight: 700; font-size: 24px; }
.loader-bar { height: 18px; border: 2.5px solid var(--ink); border-radius: 99px; background: var(--paper); overflow: hidden; box-shadow: var(--shadow-sm); }
.loader-bar i {
  display: block; height: 100%; width: 0%;
  background: repeating-linear-gradient(-45deg, #b5653b 0 10px, #c97a4f 10px 20px);
  transition: width .35s ease;
}
.loader-step { margin: 12px 0 0; font-size: 14px; font-weight: 600; color: var(--ink-soft); }

#btn-sound[aria-pressed="true"] { background: #f2a49a; }

/* photo */
.photo-sheet { width: min(860px, 100%); }
.photo-wrap { padding: 16px; background: var(--cream); overflow: auto; }
.photo-wrap img { display: block; width: 100%; height: auto; border: 2.5px solid var(--line); border-radius: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .chip { height: 36px; padding: 0 11px; font-size: 13.5px; border-radius: 10px; }
  .chip-icon { width: 36px; }
  .hud-tl, .hud-tr { top: max(12px, env(safe-area-inset-top)); }
  .hud-tl { left: 12px; max-width: 48%; }
  .hud-tr { right: 12px; max-width: 50%; }
  .chip-store { display: none; }
  #btn-dir { width: 36px; padding: 0; justify-content: center; }
  .hud-tr { max-width: none; gap: 6px; }
  .hud-tl { max-width: 42%; }
  #btn-dir .lbl { display: none; }
  .quests { width: 200px; }
  .hud-tl { max-width: 60%; }
  #minimap { left: auto; right: 12px; top: 60px; bottom: auto; width: 120px; height: 100px; border-radius: 12px; }
  /* sits above the joystick + Joget/Lompat buttons */
  .prompt { bottom: calc(max(28px, env(safe-area-inset-bottom)) + 182px); padding: 12px 18px 12px 12px; gap: 12px; }
  .prompt .swatch { width: 50px; height: 50px; font-size: 24px; }
  .prompt b { font-size: 20px; }
  .prompt small { font-size: 15px; }
  .prompt small kbd { min-width: 28px; height: 28px; font-size: 15px; }
  .toast { top: 112px; font-size: 14px; }
  .catalog-head { padding: 18px 64px 16px 18px; }
  .catalog-body { padding: 14px; }
  .products { grid-template-columns: 1fr 1fr; gap: 10px; }
  .product-info { padding: 8px 10px 10px; }
  .product-name { font-size: 13px; }
  .catalog-foot { padding: 12px 14px 14px; }
  .dir-body { padding: 14px; grid-template-columns: 1fr; gap: 14px; }
  .dir-head { padding: 16px 64px 12px 16px; }
  .dir-head h2 { font-size: 22px; }
  .dir-head p { font-size: 13px; }
  .dir-card-top { flex-wrap: wrap; row-gap: 10px; }
  .dir-title { flex: 1 1 160px; }
  .dir-social { flex: 0 0 100%; margin-left: 54px; }
  .sheet { max-height: calc(100dvh - 24px); }
  .pass { padding-top: 46px; }
  .pass-body { padding: 16px 16px 18px; }
}

@media (max-height: 640px) {
  #minimap { width: 132px; height: 110px; }
  .quests-open #minimap { visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .pass { animation: none; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
