:root {
  --paper: #f3eada; --card: #fbf7ee; --ink: #2b2a26; --ink-soft: #5d574c; --muted: #766e5f;
  --wax: #8f1d1f; --navy: #2e3b57; --sage: #5f6b4e; --gold: #a8874f; --line: #d9ccb2;
  --serif: "Cormorant Garamond", Georgia, serif; --script: "Great Vibes", cursive; --sans: Jost, system-ui, sans-serif; --type: "Special Elite", "Courier New", monospace; --pix: "Pixelify Sans", "Courier New", monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2b3125; color: var(--ink); font-family: var(--sans); color-scheme: only light; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; image-rendering: pixelated; image-rendering: crisp-edges; }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; }

.screen { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; z-index: 10; }
#intro, #queue { background: radial-gradient(ellipse at 50% 30%, rgba(38, 43, 33, .35), rgba(38, 43, 33, .75)); }
.sheet { place-items: end center; padding: 0; pointer-events: none; }
.sheet .card { pointer-events: auto; }
.card { width: min(100%, 420px); background: var(--card); border-radius: 18px; padding: 22px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.intro-card { text-align: center; }
.intro-card img { display: block; margin: 0 auto; }
.eyebrow { margin: 10px 0 0; font-family: var(--type); font-size: 13px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.script { font-family: var(--script); font-weight: 400; color: var(--wax); font-size: 58px; line-height: 1.05; margin: 4px 0; }
.type { font-family: var(--type); letter-spacing: .15em; color: var(--ink-soft); margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 15px; }
.tiny { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; line-height: 1.45; }
h2 { font-family: var(--serif); font-size: 36px; margin: 4px 0; }
.btn { display: inline-block; border: 2px solid var(--ink); background: var(--ink); color: #fff8ec; border-radius: 999px; padding: 13px 22px; font-family: var(--type); letter-spacing: .12em; text-transform: uppercase; font-size: 14px; }
.btn:disabled { opacity: .45; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.wax { background: var(--wax); border-color: var(--wax); }
.btn.wide { display: block; width: 100%; margin-top: 12px; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

.desk-card { width: min(100%, 520px); border-radius: 22px 22px 0 0; max-height: 62dvh; overflow-y: auto; padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); }
.budi { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.budi img { border-radius: 50%; border: 2px solid var(--line); }
.budi b { display: block; }
.budi small { color: var(--muted); font-size: 12px; }
.say { background: #f3e8d0; border-radius: 4px 14px 14px 14px; padding: 12px 14px; margin: 0 0 10px; line-height: 1.45; font-size: 15.5px; }
input { width: 100%; font: 500 17px var(--sans); padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
input:focus { outline: none; border-color: var(--wax); }
.err { color: var(--wax); font-size: 14px; min-height: 18px; margin: 6px 0 0; }
.selfie-wrap { position: relative; width: 210px; height: 210px; margin: 6px auto 0; border-radius: 50%; overflow: hidden; background: #222; border: 4px solid var(--gold); }
.selfie-wrap video, .selfie-wrap img { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.selfie-wrap img { transform: none; }
.selfie-msg { position: absolute; inset: 0; display: grid; place-items: center; color: #f3e8d0; font-size: 14px; text-align: center; padding: 20px; margin: 0; pointer-events: none; }
.lbl { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.lbl input { margin-top: 4px; }
.opts { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.opts::-webkit-scrollbar { display: none; }
.opts span { flex: none; align-self: center; font-size: 12px; color: var(--muted); width: 58px; }
.opts button { flex: none; border: 1.5px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 7px 12px; font-size: 13.5px; }
.opts button.on { border-color: var(--wax); background: var(--wax); color: #fff; }
.opts.swatch button { width: 34px; height: 34px; padding: 0; border-width: 3px; }
.opts.swatch button.on { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 4px 0; }
.check input { width: 20px; height: 20px; }

.queue-budi { height: 160px; }

#hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
#hud > * { pointer-events: auto; }
.hud-top { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; gap: 6px; align-items: center; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.pill { background: rgba(251, 247, 238, .92); border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 600; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); border: 0; color: var(--ink); }
#hud-menu { margin-left: auto; }
.panel-back { position: fixed; inset: 0; z-index: 20; background: rgba(20, 18, 14, .55); display: grid; place-items: end center; }
.panel { position: relative; width: min(100%, 560px); max-height: 82dvh; overflow-y: auto; background: var(--paper); border-radius: 22px 22px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); animation: up .28s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 700px) { .panel-back { place-items: center; } .panel { border-radius: 22px; } }
.x { position: sticky; top: 0; float: right; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--ink); color: #f3e8d0; font-size: 20px; z-index: 2; }
.p-head { text-align: center; margin-bottom: 14px; }
.p-head h3 { font-family: var(--serif); font-size: 34px; margin: 2px 0 0; font-weight: 600; }
.story { border-left: 2px dashed var(--line); margin-left: 8px; padding-left: 16px; }
.story article { position: relative; margin-bottom: 18px; }
.story article::before { content: ""; position: absolute; left: -24px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--wax); }
.story .d { font-family: var(--type); font-size: 12px; letter-spacing: .14em; color: var(--wax); text-transform: uppercase; }
.story h4 { font-family: var(--serif); font-size: 24px; margin: 2px 0 4px; }
.story p { margin: 0; line-height: 1.55; color: var(--ink-soft); }
.gal { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gal figure { margin: 0; background: #fff; padding: 6px 6px 10px; box-shadow: 0 6px 14px rgba(0, 0, 0, .12); }
.gal img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; }
.gal figcaption { font-family: var(--type); font-size: 11.5px; color: var(--muted); margin-top: 6px; text-align: center; }
.lightbox { position: fixed; inset: 0; z-index: 40; background: rgba(10, 9, 7, .92); display: grid; place-items: center; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 90dvh; }
.couple { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.couple > div { background: var(--card); border-radius: 14px; padding: 12px; text-align: center; }
.couple img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; background: #e8dcc4; }
.couple .nn { font-family: var(--script); color: var(--wax); font-size: 38px; line-height: 1.1; margin-top: 6px; }
.couple .fn { font-family: var(--serif); font-weight: 600; font-size: 17px; }
.couple .par { font-size: 12.5px; color: var(--muted); line-height: 1.4; margin-top: 4px; }
.gift-card { background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.gift-card .lab { font-family: var(--type); font-size: 12px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.gift-card .num { font-family: var(--type); font-size: 24px; letter-spacing: .06em; margin: 6px 0; word-break: break-all; }
.mini { border: 1.5px solid var(--ink); background: transparent; border-radius: 999px; padding: 6px 12px; font-size: 13px; }
textarea { width: 100%; min-height: 110px; font: 16px/1.5 var(--sans); padding: 12px; border: 2px solid var(--line); border-radius: 12px; resize: vertical; background: #fff; }
.rec { text-align: center; background: var(--card); border-radius: 14px; padding: 16px; margin-top: 12px; border: 1.5px solid var(--line); }
.rec-btn { width: 76px; height: 76px; border-radius: 50%; border: 5px solid #fff; background: var(--wax); color: #fff; font-size: 30px; box-shadow: 0 0 0 3px var(--wax); }
.rec-btn.on { animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(143, 29, 31, .25); } }
.rec-time { font-family: var(--type); font-size: 20px; margin-top: 8px; }
.rec audio { width: 100%; margin-top: 10px; }
.booth-stage { position: relative; width: min(100%, 360px); margin: 0 auto; aspect-ratio: 3 / 4; background: #111; border-radius: 6px; overflow: hidden; }
.booth-stage video, .booth-stage canvas, .booth-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.booth-stage video { transform: scaleX(-1); }
.ok-note { color: var(--sage); font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: calc(180px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; background: var(--ink); color: #f3e8d0; padding: 11px 18px; border-radius: 999px; font-size: 14px; max-width: calc(100% - 32px); width: max-content; text-align: center; box-shadow: 0 10px 24px rgba(0, 0, 0, .3); }
.menu-list button { display: block; width: 100%; text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 14px; margin-bottom: 8px; font-size: 15.5px; }

/* ================= gaya RPG retro (kotak dialog piksel) ================= */
.card, .panel, .gift-card, .rec, .couple > div, .menu-list button, .say {
  border-radius: 0 !important;
  border: 4px solid #2b2a26 !important;
  box-shadow: inset 0 0 0 3px #fbf7ee, inset 0 0 0 5px #c9a96a, 6px 6px 0 rgba(0,0,0,.35) !important;
}
.card, .panel { background: #fbf7ee; }
.say { background: #fff !important; font-family: var(--pix); font-size: 17px; line-height: 1.4; padding: 14px 16px !important; position: relative; }
.say::after { content: "▼"; position: absolute; right: 12px; bottom: 4px; font-size: 11px; color: var(--wax); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.btn, .mini, .opts button, .pill, .x { border-radius: 0 !important; font-family: var(--pix) !important; letter-spacing: .04em !important; }
.btn { box-shadow: 4px 4px 0 rgba(0,0,0,.35); text-transform: none; font-size: 17px; font-weight: 600; }
.btn:active, .key:active, .mini:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 rgba(0,0,0,.35); }
input, textarea { border-radius: 0 !important; border: 3px solid #2b2a26 !important; font-family: var(--pix) !important; }
.eyebrow, .type, .story .d, .gift-card .lab, .rec-time { font-family: var(--pix) !important; letter-spacing: .12em; }
.p-head h3, h2, .story h4 { font-family: var(--pix) !important; font-weight: 700; }
.opts span, .lbl, .budi small, .tiny, .muted { font-family: var(--pix); }
.budi img { border-radius: 0 !important; border: 3px solid #2b2a26 !important; image-rendering: pixelated; }
.selfie-wrap { border-radius: 0 !important; border: 4px solid #2b2a26 !important; }
.desk-card { max-height: 66dvh; }

/* HUD */
.hud-top { font-family: var(--pix); }
.pill { background: #fbf7ee !important; border: 3px solid #2b2a26 !important; box-shadow: 3px 3px 0 rgba(0,0,0,.35) !important; font-weight: 600; }
.hint { position: absolute; left: 50%; top: calc(56px + env(safe-area-inset-top)); transform: translateX(-50%); background: #2b2a26; color: #fbf7ee; border: 3px solid #fbf7ee; outline: 3px solid #2b2a26; padding: 6px 12px; font: 15px var(--pix); width: max-content; max-width: calc(100% - 30px); text-align: center; pointer-events: none !important; transition: opacity .6s; }
.prompt { position: absolute; left: 50%; bottom: calc(196px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #fff; color: #2b2a26; border: 4px solid #2b2a26; box-shadow: inset 0 0 0 3px #fbf7ee, inset 0 0 0 5px #c9a96a, 5px 5px 0 rgba(0,0,0,.35); padding: 10px 16px; font: 600 17px var(--pix); white-space: nowrap; animation: pop .25s steps(3); }
.prompt i { font-style: normal; display: inline-grid; place-items: center; width: 24px; height: 24px; background: var(--wax); color: #fff; border-radius: 50%; margin-right: 4px; font-size: 14px; }
@keyframes pop { from { transform: translateX(-50%) scale(.6); } }

.dpad { position: absolute; left: 16px; bottom: calc(22px + env(safe-area-inset-bottom)); width: 150px; height: 150px; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); touch-action: none; user-select: none; -webkit-user-select: none; }
.dpad span { display: grid; place-items: center; background: #3a3833; color: #9d978a; font-size: 18px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.35); }
.d-u { grid-area: 1 / 2; border-radius: 6px 6px 0 0; } .d-l { grid-area: 2 / 1; border-radius: 6px 0 0 6px; }
.d-c { grid-area: 2 / 2; } .d-r { grid-area: 2 / 3; border-radius: 0 6px 6px 0; } .d-d { grid-area: 3 / 2; border-radius: 0 0 6px 6px; }
.dpad[data-dir="u"] .d-u, .dpad[data-dir="d"] .d-d, .dpad[data-dir="l"] .d-l, .dpad[data-dir="r"] .d-r { background: #24221e; color: #fbf7ee; box-shadow: none; }
.ab { position: absolute; right: 14px; bottom: calc(26px + env(safe-area-inset-bottom)); width: 160px; height: 150px; }
.key { position: absolute; width: 66px; height: 66px; border-radius: 50%; border: 0; font: 700 24px var(--pix); color: #fbf7ee; box-shadow: inset 0 -5px 0 rgba(0,0,0,.3), 3px 4px 0 rgba(0,0,0,.35); }
.key.a { right: 0; top: 26px; background: var(--wax); }
.key.b { left: 8px; top: 70px; background: #4a4fa0; }
.sel { position: absolute; left: 10px; top: 0; padding: 5px 10px; border: 0; border-radius: 999px; background: #3a3833; color: #fbf7ee; font: 600 12px var(--pix); letter-spacing: .1em; box-shadow: inset 0 -3px 0 rgba(0,0,0,.35); }
@media (hover: hover) and (pointer: fine) { .dpad, .ab .key { opacity: .85; } }
.emotes { position: absolute; right: 14px; bottom: calc(184px + env(safe-area-inset-bottom)); display: flex; gap: 6px; background: #fbf7ee; border: 4px solid #2b2a26; padding: 6px; box-shadow: 5px 5px 0 rgba(0,0,0,.35); }
.emotes button { width: 42px; height: 42px; border: 0; background: transparent; font-size: 22px; }

/* label nama di atas kepala */
.labels { position: fixed; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.lbl-name { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; will-change: transform; }
.lbl-name b { font: 600 13px var(--pix); color: #fff; background: rgba(43,42,38,.78); padding: 1px 6px; white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.lbl-name.me b { background: var(--wax); }
.bubble { font-size: 24px; background: #fff; border: 3px solid #2b2a26; padding: 2px 6px; margin-bottom: 4px; animation: pop2 .25s steps(3); }
@keyframes pop2 { from { transform: scale(.5); } }
.toast { border-radius: 0 !important; border: 3px solid #fbf7ee; outline: 3px solid #2b2a26; font-family: var(--pix) !important; font-size: 15px !important; bottom: calc(200px + env(safe-area-inset-bottom)) !important; }
