/* 夜のタクシー。近づく = 緑、遠ざかる = 橙、バレる = 赤。色以外の印（旗、曲がり矢印、点線、チェック、バツ）も必ず付ける。 */
:root { --bg: #0b1020; --closer: #3ddc84; --farther: #ff8a2b; --bust: #ff4d4d; --taxi: #ffcc1a; --lamp: #ffb84d; --panel: #141c33; --line: #3b4a6b; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: radial-gradient(ellipse at 20% 10%, #1a2140 0, #070a14 60%); color: #e8ecf5; font-family: "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif; overflow: hidden; overscroll-behavior: none; }
button { font: inherit; color: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; }
#app { position: relative; display: flex; flex-direction: column; height: 100dvh; width: min(100vw, calc(100dvh * 0.62)); max-width: 460px; margin: 0 auto; background: var(--bg);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); overflow: hidden; box-shadow: 0 0 60px #000a; }
#app.shake { animation: shake-app .22s; }
@keyframes shake-app { 20% { transform: translate(-6px, 2px); } 40% { transform: translate(6px, -2px); } 60% { transform: translate(-4px, 1px); } 80% { transform: translate(3px, 0); } }

/* 上の帯: 左に言語・音・ヘルプ。右上は「作った話と感想」（widget）の場所 */
#topbar { flex: none; height: 44px; display: flex; align-items: center; padding: 0 8px; gap: 6px; }
#topbar button { height: 28px; min-width: 40px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; }
#sound-btn .slash { display: none; } #sound-btn[aria-pressed="false"] .slash { display: block; } #sound-btn[aria-pressed="false"] { color: #7d8aa8; } #sound-btn[aria-pressed="false"] .waves { opacity: .3; }
#sound-btn { padding: 0 8px; }

/* ミラーとメーター */
#hud { flex: none; height: 112px; display: flex; gap: 8px; padding: 0 8px 6px; }
#mirror { flex: 6; position: relative; border-radius: 14px; background: #0d1120; overflow: hidden; border: 4px solid #1b2236; transition: border-color .12s, transform .3s; box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #3b4258; }
#mirror-svg, #cust { width: 100%; height: 100%; display: block; }
#mirror-cap { position: absolute; left: 6px; bottom: 3px; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; background: #000a; color: #dfe6f5; pointer-events: none; }
#mirror.eye-TELL { border-color: #fff; animation: rim-blink .24s steps(2) infinite; }
#mirror.eye-LOOK { border-color: var(--farther); border-width: 6px; }
#mirror.susp-1 { box-shadow: inset 0 0 14px #ff4d4d55, 0 0 0 1px #3b4258; }
#mirror.susp-2 { animation: rim-pulse .6s ease-in-out infinite; }
#mirror.susp-3, #mirror.bust { border-color: var(--bust); animation: rim-pulse .3s ease-in-out infinite; }
#mirror.bust { transform: scale(1.12); z-index: 3; animation: none; box-shadow: 0 0 24px #ff4d4d; }
#mirror.saved { border-color: var(--closer); box-shadow: 0 0 18px #3ddc84aa; }
@keyframes rim-blink { 50% { border-color: #1b2236; } }
@keyframes rim-pulse { 50% { box-shadow: inset 0 0 20px #ff4d4d99, 0 0 10px #ff4d4d99; } }

/* 客の部品 */
#cust .skin { fill: var(--skin, #f1c9a0); } #cust .neck { fill: var(--skin-d, #d9aa80); } #cust .hand { fill: var(--skin, #f1c9a0); }
#cust[data-kind="tourist"] { --skin: #f1c9a0; --skin-d: #d9aa80; --shirt: #9be15d; --sleeve: #8bd04f; }
#cust[data-kind="local"] { --skin: #e6b98f; --skin-d: #c99c73; --shirt: #2b3347; --sleeve: #2b3347; }
#cust[data-kind="drunk"] { --skin: #e9a38a; --skin-d: #cf8a73; --shirt: #c9d4e8; --sleeve: #c9d4e8; }
#cust .shirt { fill: var(--shirt); } #cust .sleeve { stroke: var(--sleeve, #888); }
#cust .hat, #cust .hair-local, #cust .hair-drunk, #cust .hair-tourist, #cust .glasses, #cust .tie, #cust .collar-v, #cust .strap, #cust .camera, #cust .bag, #cust .watch { display: none; }
#cust[data-kind="tourist"] .hat, #cust[data-kind="tourist"] .hair-tourist, #cust[data-kind="tourist"] .strap, #cust[data-kind="tourist"] .camera { display: inline; }
#cust[data-kind="local"] .hair-local, #cust[data-kind="local"] .glasses, #cust[data-kind="local"] .tie, #cust[data-kind="local"] .collar-v, #cust[data-kind="local"] .watch { display: inline; }
#cust[data-kind="drunk"] .hair-drunk, #cust[data-kind="drunk"] .tie, #cust[data-kind="drunk"] .bag { display: inline; }
#cust .tie { fill: #c0392b; } #cust[data-kind="drunk"] .tie { transform: rotate(14deg) translateX(8px); transform-origin: 80px 84px; fill: #6d3a8f; }
#cust .glasses circle, #cust .glasses path { fill: none; stroke: #8a93a8; stroke-width: 1.4; }
#cust .blush { fill: #ff6a6a; opacity: calc(var(--s, 0) * .5 + var(--b0, 0)); transition: opacity .3s; }
#cust[data-kind="drunk"] { --b0: .55; }
#cust .lid { fill: var(--skin); transform-box: fill-box; transform-origin: top; transform: scaleY(.55); transition: transform .12s; }
#cust .pupil { transition: transform .15s; }
#cust .brow path { stroke: #2a1c12; stroke-width: 2.4; stroke-linecap: round; fill: none; }
#cust[data-kind="local"] .brow path { stroke-width: 3.4; }
#cust .brow { transform-box: fill-box; transform-origin: center; transition: transform .2s; }
#cust .brow-l { transform: rotate(calc(var(--s, 0) * 22deg)); } #cust .brow-r { transform: rotate(calc(var(--s, 0) * -22deg)); }
#cust .mouth path, #cust .mouth ellipse { opacity: 0; fill: none; stroke: #5a2a22; stroke-width: 2; stroke-linecap: round; transition: opacity .1s; }
#cust .mouth .m-closed { opacity: 1; }
#cust .m-yawn, #cust .m-shout, #cust .m-sleep { fill: #5a1d1d !important; }
#cust .sweat path { fill: #8fd3ff; opacity: 0; transition: opacity .2s; }
#cust.l1 .sw1, #cust.l2 .sw1, #cust.l2 .sw2, #cust.l2 .sw3, #cust.l3 .sweat path { opacity: .95; }
#cust.l3 .sweat path { animation: drip .8s linear infinite; } @keyframes drip { from { transform: translateY(0); } to { transform: translateY(6px); opacity: 0; } }
#cust .head { transform-origin: 80px 64px; transition: transform .25s; transform: rotate(14deg) translateY(4px); }
#cust .arm { transition: transform .3s cubic-bezier(.2, .8, .3, 1); }
#cust .screen { fill: #cfe9ff; transition: opacity .12s; } #cust .scr-lines { transition: opacity .12s; }
#cust .phone-light, #cust .face-light { opacity: 0; transition: opacity .12s; }
#cust .point { opacity: 0; transition: opacity .1s; } #cust .point .hand { fill: var(--skin); } #cust .point .finger { stroke: var(--skin); }
#cust .zs, #cust .tellmark { opacity: 0; transition: opacity .1s; }
#cust .tellmark circle { fill: #fff; } #cust .tellmark text { font: 800 15px sans-serif; fill: #111; }
#cust .z { font: 800 11px sans-serif; fill: #bcd; } #cust .zs .z { animation: zfloat 2s ease-out infinite; } #cust .z2 { animation-delay: .6s !important; } #cust .z3 { animation-delay: 1.2s !important; }
@keyframes zfloat { from { transform: translateY(8px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(-6px); opacity: 0; } }
#cust .flow-in { animation: flow 3.5s linear infinite; animation-play-state: paused; } #cust.moving .flow-in { animation-play-state: running; } @keyframes flow { to { transform: translateX(-146px); } }
#cust .body { transition: transform .3s; }
/* 状態ごとの目標の値。変わったら 0.12〜0.3 秒で動く */
#cust.s-PHONE .arm { transform: translateY(0); } #cust.s-PHONE .phone-light, #cust.s-PHONE .face-light { opacity: 1; }
#cust.s-PHONE .head { transform: rotate(14deg) translateY(4px); }
#cust.s-PHONE .pupil { transform: translateY(1.6px); }
#cust.s-SLEEP .arm, #cust.s-TELL .arm, #cust.s-LOOK .arm, #cust.s-BUST .arm { transform: translateY(44px); }
#cust.s-SLEEP .screen, #cust.s-SLEEP .scr-lines, #cust.s-TELL .screen, #cust.s-TELL .scr-lines, #cust.s-LOOK .screen, #cust.s-LOOK .scr-lines { opacity: 0; }
#cust.s-SLEEP .head { transform: rotate(-20deg) translate(-4px, 6px); } #cust.s-SLEEP .lid { transform: scaleY(1); }
#cust.s-SLEEP .zs { opacity: 1; } #cust.s-SLEEP .mouth .m-closed { opacity: 0; } #cust.s-SLEEP .mouth .m-sleep { opacity: 1; }
#cust.s-SLEEP .body { animation: breathe 2.4s ease-in-out infinite; } @keyframes breathe { 50% { transform: translateY(-2px); } }
#cust.s-PHONE .lid { transform: scaleY(.55); }
#cust.s-TELL .head { transform: rotate(0) translateY(-2px); animation: head-up .45s ease-out; } @keyframes head-up { from { transform: rotate(14deg) translateY(4px); } }
#cust.s-TELL .lid { transform: scaleY(.1); } #cust.s-TELL .tellmark { opacity: 1; animation: pop .3s ease-out; } @keyframes pop { from { transform: scale(.4); } } #cust .tellmark { transform-origin: 140px 20px; }
#cust.s-TELL .mouth .m-closed { opacity: 0; } #cust.s-TELL .mouth .m-yawn { opacity: 1; animation: yawn .9s ease-in-out infinite; transform-origin: 80px 67px; } @keyframes yawn { 50% { transform: scale(1.18); } }
#cust.s-TELL .brow { transform: translateY(-2px) rotate(0deg); }
#cust.s-LOOK .head { transform: rotate(-8deg) translateY(-4px); } #cust.s-LOOK .lid { transform: scaleY(0); }
#cust.s-LOOK .pupil { animation: glance 1.1s ease-in-out infinite; } @keyframes glance { 0%, 100% { transform: translateX(-2.2px); } 50% { transform: translateX(2.2px); } }
#cust.l1.s-PHONE .lid, #cust.l2.s-PHONE .lid { transform: scaleY(.4); }
#cust.l1.s-LOOK .lid, #cust.l2.s-LOOK .lid, #cust.l3.s-LOOK .lid { transform: scaleY(.28); }
#cust.l2 .mouth .m-closed, #cust.l3 .mouth .m-closed { opacity: 0; } #cust.l2 .mouth .m-frown, #cust.l3 .mouth .m-frown { opacity: 1; }
#cust.s-BUST .head { transform: scale(1.1) rotate(0) translateY(0); } #cust.s-BUST .lid { transform: scaleY(0); }
#cust.s-BUST .mouth .m-closed, #cust.s-BUST .mouth .m-frown, #cust.s-BUST .mouth .m-sleep { opacity: 0; } #cust.s-BUST .mouth .m-shout { opacity: 1; animation: shout .25s ease-in-out infinite; transform-origin: 80px 68px; } @keyframes shout { 50% { transform: scale(1.12); } }
#cust.s-BUST .brow-l { transform: rotate(28deg) translateY(-1px); } #cust.s-BUST .brow-r { transform: rotate(-28deg) translateY(-1px); }
#cust.s-BUST .point { opacity: 1; } #cust.s-BUST .sweat path { opacity: .95; } #cust.s-BUST .blush { opacity: .8; }
#cust .head { transform-box: view-box; }

/* メーター */
#meter { flex: 4; position: relative; display: flex; flex-direction: column; justify-content: center; border-radius: 10px; background: #000; border: 2px solid #333; padding: 4px 6px; box-shadow: inset 0 0 0 1px #000; min-width: 0; }
#meter-svg { width: 100%; } .meter-art { width: 100%; display: block; }
.meter-art .seg { fill: #ff5a2b; opacity: .07; transition: opacity .05s; } .meter-art .seg.on { opacity: 1; filter: drop-shadow(0 0 2px #ff5a2b); }
.meter-art .yen-sign { fill: #ff5a2b; font: 700 14px "Courier New", monospace; }
.meter-art .lamp-dot { fill: #3a0f0a; } .meter-art.running .lamp-dot { fill: #ff3b30; filter: drop-shadow(0 0 3px #ff3b30); }
.meter-art .lamp-text { fill: #a8442f; font: 700 8px "Hiragino Sans", "Noto Sans JP", sans-serif; letter-spacing: .08em; } .meter-art.running .lamp-text { fill: #ff7a55; }
#meter-km { text-align: center; font: 700 11px "Courier New", monospace; color: #ff8a65; letter-spacing: .05em; }
#meter.tick .meter-art { animation: tickf .18s ease-out; } @keyframes tickf { 0% { filter: brightness(2); } 100% { filter: none; } }
#meter.farther { border-color: var(--farther); box-shadow: 0 0 10px #ff8a2b66; } #meter.farther .seg.on { fill: var(--farther); }
#meter.drop .meter-art { animation: dropm .5s ease-in; } @keyframes dropm { from { transform: translateY(-6px); } }

/* 地図 */
#map-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
#map { width: 100%; height: 100%; display: block; }
#map .wave { animation: wave 6s linear infinite; } @keyframes wave { to { transform: translateX(-60px); } }
#map .cur-road .glow { stroke-width: 12; stroke-linecap: round; opacity: .28; } #map .cur-road .core { stroke-width: 4; stroke-linecap: round; opacity: .95; }
#map .cur-road.rel-closer .glow, #map .cur-road.rel-closer .core { stroke: var(--closer); }
#map .cur-road.rel-farther .glow, #map .cur-road.rel-farther .core { stroke: var(--farther); } #map .cur-road.rel-farther .core { stroke-dasharray: 8 5; }
#map .trail-seg { stroke: #fff; stroke-width: 3; opacity: .22; stroke-linecap: round; }
#map .dest-ring { fill: none; stroke-width: 2; transform-origin: 0 0; } #map .dest.rel-closer .dest-ring { stroke: var(--closer); animation: pulse .9s ease-out infinite; }
#map .dest.rel-farther .dest-ring { stroke: var(--farther); animation: pulse 2.2s ease-out infinite; } #map .dest-ring.r2 { animation-delay: -.45s !important; }
@keyframes pulse { from { opacity: 1; transform: scale(.6); } to { opacity: 0; transform: scale(1.7); } }
#map .arrow .shaft-bg { stroke: #000c; stroke-width: 9; stroke-linecap: round; } #map .arrow .shaft { stroke-width: 5; stroke-linecap: round; }
#map .arrow.rel-closer .shaft { stroke: var(--closer); } #map .arrow.rel-closer .head { fill: var(--closer); } #map .arrow.rel-closer .badge circle { fill: #0c2a1c; stroke: var(--closer); }
#map .arrow.rel-farther .shaft { stroke: var(--farther); stroke-dasharray: 5 4; } #map .arrow.rel-farther .head { fill: var(--farther); } #map .arrow.rel-farther .badge circle { fill: #33200b; stroke: var(--farther); }
#map .arrow .badge circle { stroke-width: 1.6; } #map .arrow .ic { fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; } #map .arrow.rel-closer .ic { fill: #fff; }
#map .arrow:not(.chosen) { opacity: .62; } #map .arrow.chosen .shaft { stroke-width: 8; } #map .arrow.chosen .head { transform-box: fill-box; }
#map .arrow .halo { fill: #fff2; stroke: #fff; stroke-width: 1.2; stroke-dasharray: 3 3; animation: halo 1.4s ease-in-out infinite; } @keyframes halo { 50% { opacity: .35; } }
#map .arrow .auto rect { fill: #e8ecf5; } #map .arrow .auto text { font: 700 8.5px "Hiragino Sans", "Noto Sans JP", sans-serif; fill: #0b1020; }
#map .arrow .hit { fill: transparent; cursor: pointer; }
#map .bust-mark { animation: mark-in .3s ease-out; } @keyframes mark-in { from { opacity: 0; transform-box: fill-box; transform-origin: center; } }
#map .float { font: 800 11px "Courier New", monospace; fill: var(--taxi); stroke: #000; stroke-width: .5; paint-order: stroke; animation: floatup 1s ease-out forwards; } @keyframes floatup { to { transform: translateY(-16px); opacity: 0; } }
#map .taxi .headlight { opacity: .8; }
#hint { position: absolute; left: 8px; right: 8px; top: 6px; padding: 5px 10px; border-radius: 8px; background: #05080fdd; border: 1px solid #fff4; font-size: 13px; font-weight: 700; line-height: 1.3; text-align: center; pointer-events: none; z-index: 2; }
#speech { position: absolute; left: 10px; right: 10px; top: 8px; padding: 8px 12px; border-radius: 12px; background: #f7f3e8; color: #1b1b1b; font-size: 14px; font-weight: 700; line-height: 1.35; z-index: 4; pointer-events: none; box-shadow: 0 4px 14px #000a; }
#speech::before { content: ""; position: absolute; left: 24px; top: -8px; border: 8px solid transparent; border-top: 0; border-bottom-color: #f7f3e8; }
#speech.bust { background: #ffe9e4; color: #8a1d12; border: 2px solid var(--bust); }
#dest-info { position: absolute; left: 8px; bottom: 6px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 8px; background: #05080fcc; color: #cdd6e8; pointer-events: none; max-width: 70%; }

/* 矢印のボタン（いつも出ている） */
#dpad { flex: none; display: grid; grid-template-columns: repeat(3, 82px); grid-template-rows: 60px 60px; gap: 8px; justify-content: center; padding: 6px 0 12px;
  grid-template-areas: ". n ." "w s e"; }
#dpad .dir[data-dir="N"] { grid-area: n; } #dpad .dir[data-dir="W"] { grid-area: w; } #dpad .dir[data-dir="S"] { grid-area: s; } #dpad .dir[data-dir="E"] { grid-area: e; }
.dir { position: relative; min-height: 60px; border-radius: 14px; border: 3px solid var(--line); background: #1a2340; padding: 0; display: flex; align-items: center; justify-content: center; transition: transform .08s, background .12s; }
.dir-arrow { width: 36px; height: 36px; fill: #e8ecf5; }
.dir-badge { position: absolute; right: 3px; top: 3px; width: 20px; height: 20px; } .dir-badge circle { fill: #222b45; stroke: #7d8aa8; stroke-width: 1.4; } .dir-badge path { fill: none; stroke: #fff; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transform: scale(.95); }
.keycap { display: none; position: absolute; left: 4px; bottom: 3px; font: 700 10px sans-serif; padding: 0 4px; border: 1px solid #5d6c8d; border-radius: 3px; color: #9fb0d0; }
@media (hover: hover) and (pointer: fine) { .keycap { display: block; } }
.dir.rel-closer { border-color: var(--closer); background: #12301f; } .dir.rel-closer .dir-arrow { fill: var(--closer); } .dir.rel-closer .dir-badge circle { fill: #0c2a1c; stroke: var(--closer); } .dir.rel-closer .dir-badge path { fill: #fff; }
.dir.rel-farther { border-color: var(--farther); background: #35200c; border-style: solid; } .dir.rel-farther .dir-arrow { fill: var(--farther); } .dir.rel-farther .dir-badge circle { fill: #33200b; stroke: var(--farther); }
.dir.blocked { opacity: .4; border-style: dashed; background: #10162a; } .dir.blocked .dir-arrow { fill: #6b7690; }
.dir.chosen { border-width: 6px; box-shadow: 0 0 0 2px #fff4, 0 0 14px currentColor; } .dir.chosen.rel-closer { background: #1c5a38; color: #3ddc8466; } .dir.chosen.rel-farther { background: #6a3a10; color: #ff8a2b66; } .dir.chosen .dir-arrow { fill: #fff; }
.dir.chosen .check { position: absolute; left: 4px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: #fff; } .dir.chosen .check::after { content: ""; position: absolute; left: 4px; top: 2px; width: 4px; height: 7px; border: solid #111; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.dir.nudge { animation: nudge 1s ease-in-out infinite; } @keyframes nudge { 50% { box-shadow: 0 0 0 4px #fffc, 0 0 18px #fff8; } }
.dir:active { transform: scale(.94); } .dir.shake { animation: shake .22s; } @keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.dir:focus-visible, #topbar button:focus-visible, .card button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* 領収書と1日の結果 */
#overlay { position: absolute; inset: 44px 0 0 0; display: flex; align-items: flex-start; justify-content: center; background: rgba(5, 8, 16, .82); z-index: 5; overflow: hidden; padding-top: 8px; }
#overlay[hidden] { display: none; }
.paper { position: relative; width: min(300px, 92%); max-height: calc(100% - 12px); overflow: hidden; background: #f7f3e8; color: #2a2a2a; font-family: "Courier New", "Noto Sans Mono CJK JP", monospace; padding: 16px 16px 20px; text-align: left;
  filter: drop-shadow(0 8px 14px #000a); animation: paper-in .45s cubic-bezier(.2, .9, .3, 1);
  --z: 8px; -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 12px 100%; mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 12px 100%; padding-bottom: 28px; }
@keyframes paper-in { from { transform: translateY(40px); opacity: 0; } }
.paper .logo { text-align: center; font: 800 13px "Courier New", monospace; letter-spacing: .12em; border-bottom: 2px solid #2a2a2a; padding-bottom: 6px; }
.paper .ttl { text-align: center; font-weight: 800; font-size: 15px; margin: 8px 0 2px; letter-spacing: .1em; }
.paper .for { text-align: center; font-size: 13px; margin-bottom: 6px; }
.paper hr { border: 0; border-top: 2px dashed #2a2a2a88; margin: 8px 0; }
.paper .row { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 13px; margin: 3px 0; }
.paper .row .old { text-decoration: line-through; color: #777; } .paper .row .big { font-size: 22px; font-weight: 800; }
.paper .arrow-to { color: #888; }
.paper .stars { display: flex; gap: 3px; justify-content: center; margin: 6px 0; } .paper .stars svg { width: 22px; height: 22px; }
.paper .stars .on, .paper .mini-stars .on { fill: #e0a01a; stroke: #7a5a0a; stroke-width: 1; } .paper .stars .off, .paper .mini-stars .off { fill: none; stroke: #aaa; stroke-width: 1.2; }
.paper .quote { font-size: 13px; text-align: center; margin: 6px 0; font-weight: 700; }
.paper .routemap { width: 100%; height: auto; display: block; margin: 0 auto; background: #e9e3d2; border: 1px solid #2a2a2a44; border-radius: 3px; }
.paper .stamp-row { text-align: center; margin: 4px 0; }
.paper .stamp { display: inline-block; border: 3px solid #d02a1d; color: #d02a1d; font: 800 18px "Courier New", "Noto Sans Mono CJK JP", monospace; padding: 2px 10px; transform: rotate(-6deg); letter-spacing: .1em; opacity: .9; animation: stamp .3s ease-in .6s backwards; }
@keyframes stamp { from { transform: rotate(-6deg) scale(2.2); opacity: 0; } }
.paper .routes { display: flex; gap: 6px; } .paper .routes svg { flex: 1; min-width: 0; width: 0; }
.paper .cust-row .amt { min-width: 76px; text-align: right; font-weight: 800; }
.paper .stamp.ok { border-color: #1b8a4a; color: #1b8a4a; }
.paper .barcode { height: 22px; margin-top: 8px; background: repeating-linear-gradient(90deg, #2a2a2a 0 2px, #0000 2px 4px, #2a2a2a 4px 5px, #0000 5px 8px, #2a2a2a 8px 11px, #0000 11px 12px); opacity: .7; }
.paper .line-in { animation: print .25s ease-out backwards; } @keyframes print { from { opacity: 0; transform: translateY(-4px); } }
.paper .new { display: inline-block; background: #d02a1d; color: #fff; padding: 0 6px; font-size: 11px; border-radius: 3px; margin-left: 6px; }
.paper .cust-row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 5px 0; } .paper .cust-row .who { flex: 1; } .paper .mini-stars { display: flex; } .paper .mini-stars svg { width: 12px; height: 12px; }
.paper .mult { text-align: center; font-size: 18px; font-weight: 800; margin: 6px 0 2px; } .paper .title-big { text-align: center; font-size: 15px; font-weight: 800; }
.paper-btn { display: block; width: 100%; margin-top: 10px; min-height: 48px; border: 0; border-radius: 10px; background: #1b1b1b; color: #fff; font-size: 16px; font-weight: 800; font-family: inherit; }
.paper-btn.sub { background: #fff; color: #1b1b1b; border: 2px solid #1b1b1b; min-height: 40px; font-size: 14px; margin-top: 6px; }
.paper-btn .cd { font-size: 11px; font-weight: 600; opacity: .7; margin-left: 6px; }
.paper.day { max-height: calc(100% - 46px); }
@media (max-height: 700px) { #hud { height: 92px; } #topbar { height: 44px; } #topbar button { height: 26px; } #dpad { grid-template-rows: 54px 54px; gap: 6px; padding: 4px 0 8px; } .dir { min-height: 54px; } .paper { padding: 10px 12px 22px; } .paper .big { font-size: 18px !important; } .paper .stars svg { width: 18px; height: 18px; } .paper .routemap { max-height: 120px; } }
@media (prefers-reduced-motion: reduce) { #app.shake, #mirror.bust { animation: none; } #cust * { animation-duration: 0s !important; } .paper { animation: none; } #map .wave { animation: none; } }

/* ---- 工程7 ---- */
/* 縦に長い窓: 本体を中央に寄せる（上下に大きな隙間を作らない） */
body { display: flex; align-items: center; justify-content: center; }
#app { height: min(100dvh, 900px); margin: 0 auto; }
/* 目的: 今日の売上とノルマ（遊んでいる間ずっと） */
#goal { flex: none; height: 28px; padding: 0 10px 4px; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
#goal-text { font-size: 13px; font-weight: 800; letter-spacing: .02em; color: #e8ecf5; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#goal-bar { height: 5px; border-radius: 3px; background: #223055; overflow: hidden; }
#goal-fill { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--farther); transition: width .25s; }
#goal.met #goal-fill { background: var(--closer); } #goal.met #goal-text { color: var(--closer); }
/* 手がかりの行（地図の下。吹き出しとは別の場所） */
#hint { position: static; flex: none; height: 30px; margin: 0 8px 2px; padding: 0 8px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: #05080fdd; border: 1px solid #fff4; font-size: 13px; font-weight: 800; line-height: 1.2; text-align: center; white-space: nowrap; overflow: hidden; pointer-events: none; }
#hint.empty { visibility: hidden; }
#hint.info { border-color: var(--farther); color: #ffd9b3; }
#hint.tell { border-color: #fff; background: #fff; color: #111; animation: rim-blink .5s steps(2) infinite; }
#hint.bad { border-color: var(--bust); background: #5a0f0f; color: #fff; }
#hint.ok { border-color: var(--closer); background: #0f3a22; color: #b9ffd6; }
@media (max-width: 380px) { #hint { font-size: 12px; } }
/* メーターの +100 */
#meter-plus { position: absolute; right: 6px; top: -4px; font: 900 26px "Courier New", monospace; color: #fff; text-shadow: 0 0 6px #000, 0 0 2px #000; -webkit-text-stroke: 1px #000; pointer-events: none; opacity: 0; z-index: 3; }
#meter-plus.go { animation: plus-pop .9s ease-out; } #meter-plus.farther { color: var(--farther); text-shadow: 0 0 10px #ff8a2b, 0 0 2px #000; font-size: 30px; } #meter-plus.closer { color: #c9ffe0; }
@keyframes plus-pop { 0% { opacity: 0; transform: translateY(8px) scale(.6); } 15% { opacity: 1; transform: translateY(0) scale(1.15); } 60% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px) scale(1); } }
.meter-art .lamp-text { font-size: 10px; fill: #d0624a; } .meter-art.running .lamp-text { fill: #ff9a78; }
#map .float { font-size: 17px; stroke-width: .8; }
/* 走った道（領収書の橙の線と同じ色）。バレた所のひとこと */
#map .trail-seg { stroke: #ff8a2b; stroke-width: 4; opacity: .55; }
#map .seen-label rect { fill: #fff; stroke: var(--bust); stroke-width: 1.5; } #map .seen-label text { font: 800 10px "Hiragino Sans", "Noto Sans JP", sans-serif; fill: #b3130d; }
#map .seen-label { animation: mark-in .3s ease-out; }
/* 「おさないと」の札: 既定の向き（いつも緑） */
#map .arrow .auto.rel-closer rect { fill: var(--closer); } #map .arrow .auto.rel-closer text { fill: #052; }
#map .arrow:not(.chosen) { opacity: .7; }
/* 最初の1回だけ、橙の矢印のボタンをゆっくり光らせる */
.dir.nudge { animation: nudge-o 1.1s ease-in-out infinite; }
@keyframes nudge-o { 50% { box-shadow: 0 0 0 5px #ff8a2bcc, 0 0 22px #ff8a2b; background: #5a3410; } }
/* 領収書: 凡例、★が減った理由 */
.paper { overflow-y: auto; scrollbar-width: none; } .paper::-webkit-scrollbar { display: none; }
.paper .legend { display: flex; flex-wrap: wrap; gap: 2px 10px; justify-content: center; font-size: 10.5px; font-weight: 700; color: #555; margin: 3px 0 4px; }
.paper .legend span { display: inline-flex; align-items: center; gap: 4px; } .paper .legend svg { width: 22px; height: 8px; overflow: visible; }
.paper .reasons { font-size: 12px; font-weight: 700; margin: 2px 0 4px; } .paper .reasons div { display: flex; gap: 6px; align-items: baseline; } .paper .reasons .rx { color: #d02a1d; font-weight: 900; }
.paper .mult-note { text-align: center; font-size: 13px; font-weight: 700; margin: 0 0 4px; } .paper .quota-line { text-align: center; font-size: 14px; font-weight: 800; margin: 2px 0 6px; }
.paper .quota-line.ok { color: #1b8a4a; } .paper .quota-line.no { color: #d02a1d; }
.paper .line-in { animation-duration: .18s; }
.paper .routemap { max-height: 150px; }
@media (max-height: 700px) { .paper .routemap { max-height: 100px; } .dir { min-height: 56px !important; } #dpad { grid-template-rows: 56px 56px !important; } #goal-text { font-size: 12px; } .paper .reasons { font-size: 11px; } }
#hint { font-size: 12.5px; padding: 0 4px; letter-spacing: -.01em; }
@media (max-width: 380px) { #hint { font-size: 11.5px; } }
#meter-plus { top: 2px; right: 10px; }
#meter-plus { top: auto; bottom: 1px; left: 8px; right: auto; font-size: 24px; } #meter-plus.farther { font-size: 28px; }
#meter-km { text-align: right; padding-right: 4px; }

/* ---- 周回1（ux） ---- */
/* ミラーの札: 上の左（顔は真ん中。一言は下の帯） */
#mirror-cap { left: 5px; top: 4px; bottom: auto; right: auto; max-width: calc(100% - 34px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10px; line-height: 1.25; padding: 1px 6px; background: #000b; z-index: 2; }
#mirror.eye-TELL #mirror-cap { background: #fff; color: #111; }
#mirror.eye-LOOK #mirror-cap { background: var(--farther); color: #1a0d00; }
/* 客の一言: ミラーの下の帯の中（地図の道を隠さない） */
#speech { position: absolute; left: 4px; right: 4px; top: auto; bottom: 4px; padding: 3px 7px; border-radius: 8px; background: #f7f3e8; color: #1b1b1b; font-size: 10.5px; font-weight: 800; line-height: 1.25; z-index: 4; pointer-events: none; box-shadow: 0 2px 8px #000a; max-height: 3.1em; overflow: hidden; }
#speech::before { display: none; }
#speech.bust { background: #ffe9e4; color: #8a1d12; border: 1.5px solid var(--bust); }
/* 「セーフ」の札（0.6 秒）とミラーの枠の緑の光 */
#mirror-tag { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; padding: 2px 14px; border-radius: 10px; background: var(--closer); color: #052; font-size: 20px; font-weight: 900; letter-spacing: .06em; box-shadow: 0 0 18px #3ddc84cc; pointer-events: none; animation: tag-pop .6s ease-out both; }
#mirror-tag[hidden] { display: none; }
@keyframes tag-pop { 0% { transform: translate(-50%, -50%) scale(.5); opacity: 0; } 25% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
#mirror.saved { animation: safe-glow .6s ease-out; }
@keyframes safe-glow { 0% { box-shadow: 0 0 0 0 #3ddc84, inset 0 0 22px #3ddc84cc; } 100% { box-shadow: 0 0 22px 2px #3ddc8400, inset 0 0 0 #3ddc8400; } }
/* バレた: ミラーが寄って客の顔が大きくなる */
#mirror.bust { transform: scale(1.22); transform-origin: 40% 0; }
#mirror.bust #cust { transform: scale(1.28); transform-origin: 50% 36%; transition: transform .12s ease-out; }
#mirror.bust #mirror-cap { display: none; }
/* メーター: 下の行に +N と km（賃走/FARE の行と重ならない） */
#meter-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; min-height: 17px; padding: 0 4px; }
#meter-plus, #meter-plus.farther { position: static; top: auto; left: auto; right: auto; bottom: auto; font: 900 15px "Courier New", monospace; -webkit-text-stroke: 0; text-shadow: none; opacity: 0; pointer-events: none; }
#meter-plus.closer { color: #c9ffe0; } #meter-plus.farther { color: var(--farther); font-size: 17px; text-shadow: 0 0 8px #ff8a2b88; }
#meter-plus.go { animation: plus-pop2 1.1s ease-out; }
@keyframes plus-pop2 { 0% { opacity: 0; transform: translateY(6px) scale(.6); } 15% { opacity: 1; transform: translateY(0) scale(1.2); } 65% { opacity: 1; } 100% { opacity: 0; transform: translateY(-3px) scale(1); } }
#meter-km { text-align: right; padding-right: 0; margin-left: auto; }
/* 売上の帯の右: まもなく発車 / 目的地から +N 区画 */
#goal { position: relative; }
#goal-aux { position: absolute; right: 8px; top: -2px; max-width: 48%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; font-weight: 900; padding: 1px 8px; border-radius: 9px; background: #1a2340; border: 1.5px solid #5d6c8d; color: #cdd6e8; font-variant-numeric: tabular-nums; }
#goal-aux[hidden] { display: none; }
#goal-aux.depart { background: var(--farther); border-color: var(--farther); color: #1a0d00; animation: depart-blink 1s ease-in-out infinite; }
@keyframes depart-blink { 50% { box-shadow: 0 0 10px #ff8a2bcc; } }
#goal-aux.far1 { border-color: #ffd34d; color: #ffe9a0; } #goal-aux.far2 { border-color: #ff8a2b; background: #35200c; color: #ffd0a0; } #goal-aux.far3 { border-color: var(--bust); background: #5a0f0f; color: #fff; }
/* 手がかりの行: 走り出すまでの細い棒 */
#hint { position: relative; }
#hint-text { display: block; max-width: 100%; overflow: hidden; text-overflow: clip; }
#hint-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--farther); border-radius: 0 2px 2px 0; transition: width .2s linear; }
#hint.info { color: #ffd9b3; }
/* 下の矢印のボタンの上の空き: 次の交差点の小さな絵と「あと N秒」 */
#dpad { grid-template-areas: "pic n eta" "w s e"; }
#node-pic { grid-area: pic; display: flex; align-items: center; justify-content: center; }
.node-art { width: 52px; height: 52px; }
.node-art .arm-bg { stroke: #0b1020; stroke-width: 10; stroke-linecap: round; } .node-art .arm { stroke-width: 6; stroke-linecap: round; stroke: #3b4a6b; }
.node-art .arm.rel-closer { stroke: var(--closer); } .node-art .arm.rel-farther { stroke: var(--farther); stroke-dasharray: 5 4; } .node-art .arm.blocked { stroke: #2a3350; stroke-dasharray: 2 4; }
.node-art .arm.chosen { stroke-width: 9; stroke-dasharray: none; filter: drop-shadow(0 0 3px #fff); }
.node-art .hub { fill: #e8ecf5; stroke: #0b1020; stroke-width: 2; }
#node-eta { grid-area: eta; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; text-align: center; font-weight: 800; color: #9fb0d0; min-width: 0; }
#node-eta-label { font-size: 11px; white-space: nowrap; } #node-eta-n { font-size: 17px; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
#node-eta.none { visibility: hidden; } #node-eta.soon #node-eta-n { color: #ffd34d; }
/* 交差点を過ぎて中身が替わった瞬間、ボタンの列を短く光らせる */
#dpad.newnode .dir { animation: newnode .6s ease-out; }
#dpad.newnode #node-pic { animation: newnode-pic .6s ease-out; }
@keyframes newnode { 0% { filter: brightness(2.1); box-shadow: 0 0 0 4px #fffd, 0 0 22px #fff; } 100% { filter: none; } }
@keyframes newnode-pic { 0% { transform: scale(1.3); filter: brightness(2); } 100% { transform: none; } }
@media (max-width: 380px) { #node-eta-label { font-size: 10px; } #node-eta-n { font-size: 15px; } .node-art { width: 46px; height: 46px; } }
@media (prefers-reduced-motion: reduce) { #dpad.newnode .dir, #dpad.newnode #node-pic, #mirror.saved, #mirror-tag { animation: none; } }
.paper .next-title { text-align: center; font-size: 12.5px; font-weight: 800; color: #7a4a00; margin: 0 0 4px; }
#mirror.bust { transform: scale(1.14); transform-origin: 15% 0; }
/* PO の指摘: 手がかりの行が 390 幅で右にはみ出す（旧の left/right/top が position: relative で効いていた）。札と吹き出しが顔を隠さない */
#hint { left: auto; right: auto; top: auto; width: auto; }
#mirror-svg { position: absolute; left: 0; right: 0; top: -9px; bottom: 0; }
#mirror-cap { top: 3px; font-size: 9.5px; line-height: 1.2; padding: 0 5px; }
#speech { bottom: 3px; padding: 2px 6px; font-size: 10px; line-height: 1.2; max-height: 2.6em; border-radius: 7px; background: #f7f3e8ee; }
