@font-face { font-family: "Yuji Syuku"; src: url(assets/yuji.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Reggae One"; src: url(assets/reggae.woff2) format("woff2"); font-display: swap; }
:root { color-scheme: dark; --ink: #f2eee4; --dim: #aaa69e; --rim: #6e6a64; --red: #781822; --btn: #18181a; --glow: #e0a040; --warm: #e8b878; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #000; color: var(--ink); }
body { font: 19px/1.4 "Yuji Syuku", "Hiragino Mincho ProN", "Noto Serif CJK JP", serif; overflow: hidden; }
#page { position: relative; height: 100vh; height: 100dvh; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; background: #000; }
#scene { position: relative; flex: none; overflow: hidden; background: #000; }
#street, #ninja { position: absolute; display: block; }
#fade { position: absolute; left: 0; right: 0; bottom: 0; height: 70px; background: linear-gradient(transparent, #000); }
#title { position: absolute; left: 16px; top: 12px; text-shadow: 0 0 6px #000, 0 0 3px #000; font-family: "Reggae One", serif; }
#kanji { font-size: 40px; line-height: 1.1; }
h1 { margin: 0; font-size: 16px; font-weight: 400; color: #dcd8cf; }
#credits { position: absolute; right: 12px; top: 12px; min-height: 36px; padding: 0 12px; font-size: 14px; background: rgba(0, 0, 0, .75); }
#box { position: relative; flex: 1 1 auto; min-height: 190px; margin: 0 14px; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; overflow: hidden; background: rgba(13, 13, 14, .94); border: 2px solid #96918a; border-radius: 14px; }
#speech { margin: 0; flex: 0 1 auto; min-height: 2.8em; padding-bottom: 2px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #555 transparent; }
em { font-style: italic; color: var(--warm); }
#choices { display: flex; gap: 8px; flex: none; }
#choices button { flex: 1 1 0; min-width: 0; font-size: 15px; letter-spacing: .02em; }
#choices:empty { display: none; }
#input, #message, #records { flex: 1 1 0; min-height: 44px; width: 100%; overflow-y: auto; border-radius: 8px; scrollbar-width: thin; scrollbar-color: #555 transparent; }
#input { resize: none; padding: 8px 10px; color: var(--ink); background: #101012; border: 1px solid var(--rim); font: 16px/1.4 "Yuji Syuku", "Hiragino Mincho ProN", "Noto Serif CJK JP", serif; }
#message { padding: 8px 10px; background: #101012; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
#records { display: flex; flex-direction: column; gap: 8px; }
#records button { flex: none; text-align: left; min-height: 54px; padding: 6px 12px; background: #101012; border-color: #2a2a2e; }
.name { display: block; font-size: 18px; overflow-wrap: anywhere; }
.when { display: block; font: 13px/1.3 system-ui, sans-serif; color: var(--dim); }
#more { position: absolute; right: 12px; bottom: 6px; font-size: 14px; color: var(--dim); }
#buttons { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); }
button, .primary { min-height: 48px; color: var(--ink); background: var(--btn); border: 1px solid var(--rim); border-radius: 9px; font: 17px/1.2 "Yuji Syuku", serif; letter-spacing: .06em; cursor: pointer; padding: 4px 10px; }
button:hover, .primary:hover { filter: brightness(1.3); }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 2px solid var(--glow); outline-offset: 1px; }
#decode { background: var(--red); }
button.strong, .primary { background: var(--red); }
#decode.glow { border-color: var(--glow); animation: glow .8s ease-in-out infinite alternate; }
@keyframes glow { from { box-shadow: 0 0 2px var(--glow); } to { box-shadow: 0 0 14px var(--glow); } }
@media (prefers-reduced-motion: reduce) { #decode.glow { animation: none; box-shadow: 0 0 10px var(--glow); } }
.popup { position: fixed; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0, 0, 0, .7); }
.card { width: 100%; max-width: 420px; max-height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 18px; background: #0d0d0e; border: 2px solid #96918a; border-radius: 14px; }
.card p { margin: 0; }
.card button, .primary { flex: none; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.card.small { font-size: 15px; }
.card h2 { margin: 4px 0 0; font-size: 17px; font-weight: 400; color: var(--warm); }
a { color: var(--warm); }
a.primary { color: var(--ink); }
