:root {
  --bg: #0f1020; --panel: #171932; --ink: #f4f1ea; --muted: #a9a7b8; --line: #2b2e4d;
  --accent: #ff8fab; --accent-2: #ffd166; --ok: #7bd389; --bad: #e63946;
  --pixel: "Press Start 2P", monospace; --serif: Georgia, "Times New Roman", serif; --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--serif); font-size: 17px; line-height: 1.5; }
a { color: var(--accent-2); }
.wrap { max-width: 880px; margin: 0 auto; padding: 24px 16px 80px; }
.brand { font-family: var(--pixel); font-size: 14px; letter-spacing: 1px; color: var(--ink); text-decoration: none; }
.brand small { color: var(--muted); font-family: var(--serif); font-size: 13px; letter-spacing: 0; margin-left: 10px; }
h1 { font-family: var(--pixel); font-size: 22px; line-height: 1.5; margin: 24px 0 12px; }
h2 { font-family: var(--pixel); font-size: 14px; line-height: 1.6; margin: 32px 0 8px; color: var(--accent-2); }
h3 { font-family: var(--sans); font-size: 15px; margin: 20px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
p.lead { font-size: 20px; color: var(--ink); }
.muted { color: var(--muted); }
.panel { background: var(--panel); border: 2px solid var(--line); padding: 20px; margin: 16px 0; }
.btn { display: inline-block; font-family: var(--pixel); font-size: 12px; padding: 14px 18px; background: var(--accent); color: #1a0b12; border: 0; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
label { display: block; font-family: var(--sans); font-size: 14px; color: var(--muted); margin: 14px 0 4px; }
label b { color: var(--ink); font-weight: 600; }
input[type=text], input[type=email], input[type=month], input[type=number], select, textarea {
  width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; background: #0c0d1c; color: var(--ink); border: 2px solid var(--line); border-radius: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-2); border-color: var(--accent-2); }
textarea { min-height: 70px; resize: vertical; }
.hint { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-top: 4px; }
.cap { font-family: var(--sans); font-size: 12px; color: var(--muted); text-align: right; }
.cap.over { color: var(--bad); }
.choices { display: flex; gap: 8px; flex-wrap: wrap; }
.choices label { margin: 0; }
.choices input { display: none; }
.choices span { display: inline-block; padding: 8px 12px; border: 2px solid var(--line); font-family: var(--sans); font-size: 14px; cursor: pointer; color: var(--ink); }
.choices input:checked + span { border-color: var(--accent); background: rgba(255,143,171,.12); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .two { grid-template-columns: 1fr; } }
.photo-box { border: 2px dashed var(--line); padding: 12px; text-align: center; cursor: pointer; min-height: 120px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; }
.photo-box img { width: 96px; height: 96px; object-fit: cover; image-rendering: pixelated; }
.photo-box input { display: none; }
.swatches { display: flex; gap: 6px; justify-content: center; }
.swatches i { width: 18px; height: 18px; display: inline-block; border: 1px solid #000; }
.error { color: var(--bad); font-family: var(--sans); font-size: 14px; margin-top: 8px; }
.steps { font-family: var(--sans); font-size: 13px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.price { font-family: var(--pixel); font-size: 14px; color: var(--accent-2); }
footer { margin-top: 60px; font-family: var(--sans); font-size: 13px; color: var(--muted); }
footer a { color: var(--muted); }

/* hero scene */
.hero { position: relative; border: 2px solid var(--line); overflow: hidden; margin: 20px 0; aspect-ratio: 16/9; background: #000; }
.hero img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; display: block; }
.hero .caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 16px; background: linear-gradient(transparent, rgba(0,0,0,.8)); font-family: var(--pixel); font-size: 11px; line-height: 1.8; }

/* game */
.tw-game { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; overflow: hidden; display: flex; align-items: center; justify-content: center; user-select: none; touch-action: none; }
.tw-canvas { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
.tw-hud { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; font-family: var(--pixel); font-size: 10px; color: #fff; text-shadow: 1px 1px 0 #000; pointer-events: none; }
.tw-meter { display: flex; align-items: center; gap: 8px; }
.tw-meter-bar { width: 90px; height: 8px; border: 2px solid #fff; background: rgba(0,0,0,.4); }
.tw-meter-bar i { display: block; height: 100%; width: 60%; background: var(--accent); transition: width .3s; }
.tw-act { opacity: .85; max-width: 50%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-timer { min-width: 40px; text-align: right; color: var(--accent-2); }
.tw-toast { position: absolute; left: 50%; bottom: 14%; transform: translate(-50%, 8px); background: rgba(0,0,0,.75); color: #fff; font-family: var(--pixel); font-size: 10px; line-height: 1.7; padding: 8px 12px; border: 2px solid #fff; max-width: 80%; text-align: center; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.tw-toast.show { opacity: 1; transform: translate(-50%, 0); }
.tw-overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(8,8,20,.86); padding: 16px; }
.tw-overlay.show { display: flex; }
.tw-card { max-width: 560px; width: 100%; text-align: center; color: #fff; font-family: var(--serif); }
.tw-card h1 { font-family: var(--pixel); font-size: 16px; line-height: 1.6; margin: 8px 0; color: #fff; }
.tw-card h2 { font-family: var(--pixel); font-size: 10px; color: var(--accent-2); margin: 0; }
.tw-card p { font-size: 17px; margin: 8px 0; }
.tw-card .tw-hint { font-family: var(--pixel); font-size: 8px; color: var(--muted); margin-top: 18px; animation: blink 1.2s steps(2) infinite; }
.tw-scene { width: 100%; aspect-ratio: 20/11; background-size: cover; background-position: center; image-rendering: pixelated; margin-bottom: 10px; border: 2px solid #fff; display: none; }
.tw-scene[style] { display: block; }
.tw-sign { font-family: var(--pixel); font-size: 11px; line-height: 1.9; background: #f0dfae; color: #4a3520; padding: 14px 18px; border: 3px solid #6b5030; }
.tw-outro, .tw-final, .tw-defeat { font-size: 19px; line-height: 1.55; }
.tw-final { text-align: left; white-space: pre-wrap; }
.tw-photo { width: 168px; image-rendering: pixelated; border: 3px solid #fff; margin-top: 6px; }
.tw-who { color: var(--accent-2); font-family: var(--pixel); font-size: 9px; }
.tw-controls { color: var(--muted); font-size: 14px; }
.tw-door { width: 36px; height: 60px; margin: 12px auto 0; background: #2b2d42; border: 3px solid var(--accent-2); }
.tw-inter { font-family: var(--pixel); font-size: 11px; line-height: 2; color: var(--muted); }
@keyframes blink { 50% { opacity: .2; } }
@media (max-width: 640px) { .tw-card p, .tw-outro, .tw-final { font-size: 15px; } .tw-hud { font-size: 8px; } }
