:root {
  --ink: #f5f0fb; --muted: #b9adc9; --bg: #08060d; --panel: #17121f; --line: #4b3d5a;
  --pink: #ff4fa3; --pink2: #ff9fd0; --cyan: #57e6ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }

.screen { position: fixed; inset: 0; }
.card-screen { display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 50% 30%, #2a1838, var(--bg)); }
.card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 24px; text-align: center; line-height: 1.55; }
.card h1, .card h2 { margin: 0 0 10px; font-size: 22px; }
.card p { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.btn { display: block; width: 100%; min-height: 48px; margin-top: 10px; border: 1px solid var(--line); border-radius: 999px; background: #2a2236; font-weight: 700; font-size: 16px; cursor: pointer; }
.btn.primary { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn:focus-visible, .icon:focus-visible, .choice:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.small-link { display: inline-block; margin-top: 16px; color: var(--pink2); font-size: 14px; text-underline-offset: 3px; }

/* title */
.title-bg { position: absolute; inset: 0; background: var(--art) center 30% / cover no-repeat; filter: brightness(.55); }
.title-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 30%, #08060dee 75%); }
/* the 18+ card over the title picture (owner, 2026-10-21): the game's picture shows from the first screen */
.gate-bg { filter: brightness(.45); }
.gate-bg + .card { position: relative; background: #120d1ad9; backdrop-filter: blur(6px); }
.title-box { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 420px; padding: 0 20px max(28px, env(safe-area-inset-bottom)); text-align: center; }
.title-kicker { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--pink2); }
.title-name { margin: 4px 0 0; font-size: 84px; line-height: 1; letter-spacing: .08em; font-weight: 900; color: #fff;
  text-shadow: 0 0 18px #ff4fa3aa, 3px 3px 0 #ff1f6b, -2px -2px 0 #2fd8ff88; }
.title-sub { margin: 6px 0 14px; font-size: 18px; font-weight: 700; }

/* stage */
.bg { position: absolute; inset: -60px; background: var(--art, none) center / cover no-repeat; filter: blur(26px) brightness(.38) saturate(1.1); transition: background-image .3s; }
.pic { position: absolute; left: 50%; top: 0; transform: translateX(-50%); overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.pic img, .pic video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; }
.pic img { transition: opacity .35s; }
.pic.fade img { opacity: 0; }
.pic.dim img, .pic.dim video { filter: brightness(.35) blur(2px); }
.pic canvas.live { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; opacity: 0; transition: opacity .35s; }
.pic canvas.live.on { opacity: 1; }
.pic.fade canvas.live { opacity: 0; }
.pic.dim canvas.live { filter: brightness(.35) blur(2px); }
.live-debug { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.live-debug span { position: absolute; transform: translate(-50%, -50%); font: 700 11px system-ui; color: #fff; background: #000a; padding: 1px 5px; border-radius: 6px; white-space: nowrap; }
.pic.jiggle { animation: jiggle .32s ease-out; }
@keyframes jiggle { 0% { transform: translateX(-50%) scale(1); } 35% { transform: translateX(-50%) scale(1.018); } 100% { transform: translateX(-50%) scale(1); } }
.pic.touchable .spot { cursor: none; }
@media (hover: none) { .pic.touchable .spot { cursor: auto; } }

.spots { position: absolute; inset: 0; }
.spot { position: absolute; transform: translate(-50%, -50%); width: 56px; height: 56px; border: 0; padding: 0; background: none; cursor: pointer; }
.spot::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 14px var(--pink), inset 0 0 10px var(--pink); animation: pulse 1.4s ease-in-out infinite; }
.spot span { position: absolute; left: 50%; top: 100%; transform: translate(-50%, -4px); white-space: nowrap; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: #000a; text-shadow: 0 1px 2px #000; }
.spot.done::before { border-color: var(--pink2); opacity: .7; }
@keyframes pulse { 0%, 100% { transform: scale(.9); opacity: .85; } 50% { transform: scale(1.12); opacity: 1; } }
.target { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; border: 3px dashed #fff8; box-shadow: 0 0 22px var(--pink); animation: tpulse 1.4s ease-in-out infinite; pointer-events: none; }
@keyframes tpulse { 0%, 100% { transform: translate(-50%, -50%) scale(.92); } 50% { transform: translate(-50%, -50%) scale(1.06); } }
.target.ready { border-color: var(--cyan); box-shadow: 0 0 30px var(--cyan); }
.ripple { position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; border: 3px solid #fff; pointer-events: none; animation: ripple .5s ease-out forwards; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
.say { position: absolute; transform: translate(-50%, -100%); max-width: 70%; padding: 8px 12px; border-radius: 14px; background: #fff; color: #17121f; font-weight: 700; font-size: 15px; line-height: 1.35; pointer-events: none; box-shadow: 0 4px 14px #0007; animation: pop .18s ease-out; z-index: 3; }
@keyframes pop { from { transform: translate(-50%, -90%) scale(.9); opacity: 0; } }
.hand { position: fixed; z-index: 50; pointer-events: none; display: none; transition: transform .08s; filter: drop-shadow(0 2px 3px #0008); }
.hand.press { transform: scale(.85) rotate(-8deg); }

/* text box */
.top-btns { position: absolute; top: max(10px, env(safe-area-inset-top)); right: 10px; display: flex; gap: 8px; z-index: 5; }
.icon { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #fff3; background: #0008; font-size: 18px; cursor: pointer; }
.box { position: absolute; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(560px, calc(100vw - 20px));
  padding: 14px 16px 18px; border-radius: 18px; background: #0d0a14e6; border: 1px solid #ffffff24; backdrop-filter: blur(6px); z-index: 4; cursor: pointer; min-height: 92px; }
.box.choosing { cursor: default; }
.box.gone { opacity: 0; pointer-events: none; }
.who { display: inline-block; margin-bottom: 4px; font-size: 15px; font-weight: 800; letter-spacing: .04em; color: var(--pink2); min-height: 1em; }
.who[data-who="Shion"] { color: #ff5d6c; } .who[data-who="You"] { color: var(--cyan); } .who[data-who="Goblin"] { color: #9be36a; }
.who[data-who="Reika"], .who[data-who="Natsu"] { color: #d6c2ff; }
.line { font-size: 20px; line-height: 1.45; animation: rise .22s ease-out; }
.line.narr { color: #e2d9ee; font-style: italic; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.hint:empty { display: none; }
.tap { position: absolute; right: 14px; bottom: 6px; font-size: 11px; color: var(--pink2); animation: bob 1s infinite; }
.box.choosing .tap, .box.busy .tap { display: none; }
@keyframes bob { 50% { transform: translateY(3px); } }
.choices { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.choices:empty { display: none; }
.choice { min-height: 46px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--pink); background: #ff4fa31f; text-align: left; font-weight: 700; font-size: 18px; cursor: pointer; }
.choice:hover { background: #ff4fa340; }
.choice.next { border-color: #fff4; background: #ffffff14; text-align: center; }
.dock { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.slot { width: 58px; height: 58px; flex: none; display: grid; place-items: center; border-radius: 14px; border: 2px dashed var(--cyan); background: #57e6ff1a; font-size: 30px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.slot.picked { background: #57e6ff55; border-style: solid; }
.ghost { position: fixed; z-index: 60; pointer-events: none; font-size: 40px; transform: translate(-50%, -50%); filter: drop-shadow(0 0 10px var(--cyan)); }

/* modal + end card */
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: #000c; overflow: auto; }
.end-kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--pink2); }
.end-list { list-style: none; margin: 10px 0 14px; padding: 0; text-align: left; }
.end-list li { padding: 8px 12px; border-radius: 10px; background: #ffffff0d; margin-top: 6px; font-weight: 700; }
.end-list li.locked { color: var(--muted); font-weight: 400; }
.cta { margin-top: 14px; padding: 16px; border-radius: 16px; background: linear-gradient(135deg, #3a1230, #1b1f3a); border: 1px solid #ff4fa366; }
.cta p { color: var(--ink); margin: 0 0 4px; }
.cta a.btn { text-decoration: none; display: grid; place-items: center; }
.toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); padding: 8px 14px; border-radius: 999px; background: #000d; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 30; }
.toast.on { opacity: 1; }

/* memories: old VHS footage (the pictures carry their own stamp) */
.pic.memory::after { content: "◀◀ " attr(data-mem); position: absolute; left: 10px; top: calc(3.6% + 8px); /* top-left of the picture */ font: 700 12px ui-monospace, Menlo, monospace; letter-spacing: .12em; color: #fff; text-shadow: 0 0 6px #000, 1px 1px 0 #000; opacity: .85; pointer-events: none; z-index: 2; }
.spot.body::before { inset: 16px; opacity: .8; }
.end-go, .title-go { display: grid; place-items: center; text-decoration: none; }
.end-sub { margin: 4px 0 6px; font-size: 13px; color: var(--muted); }

/* body markers: small tap markers, each on the part it names */
.spot.body { width: 40px; height: 40px; }
.spot.body::before { inset: 10px; border-width: 2px; opacity: .75; }
.spot.body span { font-size: 11px; padding: 1px 6px; }
.title-go { color: inherit; }

/* v0.2 demo additions */
.who[data-who="Chief"], .who[data-who="Scar"], .who[data-who="Runt"] { color: #9be36a; }
.title-note { margin-top: 12px; font-size: 13px; color: var(--muted); }
.stop-where { color: var(--ink) !important; font-style: italic; }
.credits { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); line-height: 1.6; }
.credits-title { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--pink2); margin-bottom: 4px; }
.credits-link { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--muted); text-underline-offset: 3px; }
#game { cursor: pointer; }

/* v0.2: top bar (small, above the picture), log, slots, settings */
.top-btns { display: none; }
.topbar { position: absolute; top: max(6px, env(safe-area-inset-top)); left: 6px; right: 6px; height: 34px; display: flex; align-items: center; gap: 5px; z-index: 6; }
.tb-gap { flex: 1; }
.tb { height: 30px; min-width: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid #ffffff2e; background: #0d0a14b8; color: #f1e9fa; font-size: 12px; font-weight: 700; letter-spacing: .02em; cursor: pointer; backdrop-filter: blur(4px); }
.tb.icon-tb { padding: 0; width: 30px; font-size: 14px; }
.tb.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.tb:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 380px) { .tb { padding: 0 8px; font-size: 11px; } }
.card.wide { max-width: 560px; text-align: left; }
.card.wide h2 { text-align: center; }
.log { max-height: min(62vh, 520px); overflow-y: auto; padding-right: 4px; -webkit-overflow-scrolling: touch; }
.log-row { padding: 7px 0; border-bottom: 1px solid #ffffff12; font-size: 17px; line-height: 1.45; }
.log-row b { display: block; font-size: 12px; color: var(--pink2); }
.log-row b[data-who="Shion"] { color: #ff5d6c; } .log-row b[data-who="You"] { color: var(--cyan); }
.log-row b[data-who="Goblin"], .log-row b[data-who="Chief"], .log-row b[data-who="Scar"], .log-row b[data-who="Runt"] { color: #9be36a; }
.log-row .narr { color: #d8cfe4; font-style: italic; }
.slot-btn { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding: 8px 16px; border-radius: 14px; text-align: left; min-height: 56px; }
.slot-btn span { font-size: 12px; font-weight: 400; color: var(--muted); }
.slot-btn:disabled { opacity: .45; cursor: default; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.set-row { margin: 12px 0; text-align: left; }
.set-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.seg { display: flex; gap: 6px; }
.seg-btn { flex: 1; min-height: 40px; border-radius: 12px; border: 1px solid var(--line); background: #2a2236; font-weight: 700; cursor: pointer; text-transform: capitalize; }
.seg-btn.on { background: var(--pink); border-color: var(--pink); color: #fff; }

/* languages (html lang, set by game.js): system CJK fonts per script, no fake italics, CJK line breaking */
html:lang(ja) body { font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif; }
html:lang(zh-Hans) body { font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei", system-ui, sans-serif; }
html:lang(zh-Hant) body { font-family: "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Source Han Sans TC", "Microsoft JhengHei", system-ui, sans-serif; }
html:not(:lang(en)) .line.narr, html:not(:lang(en)) .log-row .narr, html:not(:lang(en)) .stop-where { font-style: normal; }
html:not(:lang(en)) .line, html:not(:lang(en)) .choice, html:not(:lang(en)) .say, html:not(:lang(en)) .log-row { line-break: strict; overflow-wrap: anywhere; }
html:not(:lang(en)) .line { font-size: 19px; line-height: 1.6; }
html:not(:lang(en)) .seg-btn, html:not(:lang(en)) .title-kicker, html:not(:lang(en)) .credits-title, html:not(:lang(en)) .end-kicker { letter-spacing: .04em; }
.seg-lang { flex-wrap: wrap; }
.seg-lang .seg-btn { flex: 1 1 calc(50% - 3px); text-transform: none; }
.lang-pick { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; margin-top: 12px; }
.lang-pick:empty { display: none; }
.lang-btn { padding: 4px 9px; border-radius: 999px; border: 1px solid #ffffff26; background: #0006; color: var(--muted); font-size: 12px; cursor: pointer; }
.lang-btn.on { color: #fff; border-color: var(--pink); background: #ff4fa333; }
.lang-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.stop-name { margin: 6px 0 2px; font-size: 15px; font-weight: 800; color: var(--pink2); letter-spacing: .06em; }

/* supporter lock (the site's copy): the code field */
.lock input { width: 100%; box-sizing: border-box; padding: 12px; margin: 4px 0 8px; border-radius: 12px; border: 1px solid var(--line); background: #0d0a12; color: inherit; font: 700 18px/1.2 ui-monospace, Consolas, monospace; text-align: center; letter-spacing: .08em; text-transform: uppercase; }
.lock-err { color: #ff8fb3; font-size: 14px; margin: 0 0 8px; }
.title-box a.btn[hidden] { display: none; }
.card a.btn, .title-box a.btn { display: grid; place-items: center; text-decoration: none; color: inherit; }
