/* Which Line? — 390×800 の座標の店を、JS（main.js の fit）で画面に合わせて拡縮する。HTML の部品も同じ座標（px）で書く。 */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; width: 100%; position: fixed; inset: 0; background: #2b3445; color: #2a2118; font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Segoe UI", sans-serif; overflow: hidden; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
body { background: radial-gradient(120% 80% at 50% 0%, #3a4660, #232b3a); }
body.narrow { background: #f4ecd8; }
#app { position: absolute; left: 0; top: 0; width: 390px; height: 800px; transform-origin: 0 0; overflow: hidden; user-select: none; -webkit-user-select: none; background: #f4ecd8; border-radius: 0; }
@media (min-width: 520px) { #app { border-radius: 14px; box-shadow: 0 10px 50px #0008; } }
#store { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lane { cursor: pointer; outline: none; }
.lane .hit { transition: fill .15s; }
@media (hover: hover) { .lane:hover .hit { fill: #f5b70026; } }
.lane:focus-visible .hit { fill: #f5b70033; stroke: #2b6fd6; stroke-width: 3; }
.lane.mine .hit { fill: #f5b70018; }
.lane.flash .hit { fill: #f5b70055; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #2b6fd6; outline-offset: 2px; }

/* ---- HUD ---- */
#hud { position: absolute; left: 0; right: 0; top: 0; height: 56px; display: flex; align-items: center; gap: 6px; padding: 0 6px 0 8px; pointer-events: none; }
#theme-icon { width: 54px; height: 44px; flex: none; filter: drop-shadow(0 1px 0 #fff8); }
#hud-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
#hud-time { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; font-weight: 800; }
#clock { font-size: 18px; letter-spacing: .02em; background: #1f2a37; color: #7dffb0; border-radius: 5px; padding: 0 6px; font-family: ui-monospace, "SF Mono", Menlo, monospace; line-height: 22px; }
#arrow { font-size: 12px; color: #6b7280; }
#deadline { font-size: 14px; border: 2.5px solid #e53935; border-radius: 6px; padding: 0 5px; line-height: 18px; background: #fff; color: #c62828; }
#bar { position: relative; height: 10px; border-radius: 5px; background: #0003; overflow: visible; }
#bar-fill { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #7cb342, #f2c94c 60%, #e65c3c); width: 100%; transition: width .1s linear; }
#bar-icon { position: absolute; right: -4px; top: -9px; width: 26px; height: 22px; }
#dots { display: flex; gap: 6px; padding-left: 2px; }
#dots i { width: 9px; height: 9px; border-radius: 50%; background: #0003; border: 1.5px solid #3a2f2a66; }
#dots i.now { background: #fff; border-color: #f5b700; box-shadow: 0 0 0 2px #f5b70088; animation: pulse 1.2s ease-in-out infinite; }
#dots i.g1 { background: #f2c94c; } #dots i.g2 { background: #cfd5dd; } #dots i.g3 { background: #e0955a; } #dots i.g4 { background: #7fd68a; } #dots i.g0 { background: #9aa0aa; }
#hud button { pointer-events: auto; flex: none; height: 44px; min-width: 44px; border-radius: 12px; border: 2px solid #3a2f2a; background: #fffffff2; color: #3a2f2a; font-weight: 800; font-size: 14px; box-shadow: 0 2px 0 #3a2f2a55; display: flex; align-items: center; justify-content: center; padding: 0 6px; }
#hud button svg { width: 22px; height: 22px; }
#hud button:active { transform: translateY(1px); }
#caption { position: absolute; left: 10px; top: 60px; max-width: 262px; padding: 8px 12px; border-radius: 14px; background: #fff; border: 2.5px solid #3a2f2a; font-weight: 800; font-size: 15px; line-height: 1.3; box-shadow: 0 3px 0 #3a2f2a44; pointer-events: none; animation: popin .35s cubic-bezier(.3,1.6,.5,1) both; }
#caption::after { content: ""; position: absolute; left: 22px; bottom: -9px; width: 14px; height: 14px; background: #fff; border-right: 2.5px solid #3a2f2a; border-bottom: 2.5px solid #3a2f2a; transform: rotate(45deg); }
#caption[hidden] { display: none; }
#toast { position: absolute; left: 20px; right: 20px; top: 626px; text-align: center; pointer-events: none; }
#toast span { display: inline-block; padding: 6px 12px; border-radius: 12px; background: #3a2f2aef; color: #fff; font-size: 13px; font-weight: 700; animation: popin .25s both; }

/* ---- お題の札 ---- */
#intro { position: absolute; left: 36px; right: 36px; top: 300px; padding: 16px 14px 14px; border-radius: 22px; background: #fffffff5; border: 3px solid #3a2f2a; box-shadow: 0 8px 0 #3a2f2a33, 0 14px 40px #0004; text-align: center; animation: popin .4s cubic-bezier(.3,1.5,.5,1) both; pointer-events: none; }
#intro[hidden] { display: none; }
#intro svg { width: 112px; height: 90px; }
#intro .i-title { font-size: 19px; font-weight: 800; margin: 4px 0 2px; }
#intro .i-dead { display: inline-block; font-size: 24px; font-weight: 800; border: 3px solid #e53935; border-radius: 10px; padding: 0 10px; color: #c62828; background: #fff; font-variant-numeric: tabular-nums; }
#intro.leaving { animation: introout .35s ease-in forwards; }

/* ---- 回の結果（下 60%。上 40% で列が見える） ---- */
#overlay { position: absolute; left: 8px; right: 8px; bottom: 8px; max-height: 58%; padding: 10px 12px 12px; border-radius: 22px 22px 16px 16px; background: #fffffff7; border: 3px solid #3a2f2a; box-shadow: 0 -6px 30px #0004; animation: sheetup .4s cubic-bezier(.2,.9,.3,1.1) both; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
#overlay[hidden] { display: none; }
.r-top { display: flex; align-items: center; gap: 10px; }
.r-top .medal-svg { width: 86px; height: 86px; flex: none; animation: stamp .5s .15s cubic-bezier(.3,1.7,.5,1) both; }
.r-top .r-side { flex: 1; min-width: 0; }
.r-top .r-theme { width: 64px; height: 50px; float: right; }
.r-end { font-size: 20px; font-weight: 800; line-height: 1.2; }
.r-head { font-size: 13px; color: #5a4a3a; line-height: 1.3; margin-top: 2px; }
.r-lanes { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; height: 54px; padding: 0 4px; position: relative; }
.rl { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.rl i { display: block; width: 100%; min-height: 6px; border-radius: 5px 5px 2px 2px; background: #c9d1dc; border: 2px solid #3a2f2a; transform-origin: bottom; animation: grow .5s both; }
.rl.fast i { background: #f2c94c; } .rl.first i::after { content: ""; display: block; width: 8px; height: 8px; margin: 2px auto; border-radius: 50%; background: #3a86c8; }
.rl b { font-size: 11px; color: #5a4a3a; line-height: 1; margin-top: 2px; }
.r-diff { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.r-diff .pill { padding: 2px 10px; border-radius: 99px; background: #e5eaf1; border: 2px solid #3a2f2a; }
.r-diff .pill.early { background: #c9f0d2; } .r-diff .pill.late { background: #ffd9cf; }
.r-cause { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 12px; background: #fff3d6; border: 2px solid #e3c26a; font-size: 14px; font-weight: 700; min-height: 44px; }
.r-cause svg { width: 44px; height: 38px; flex: none; }
.r-btns { display: flex; gap: 8px; margin-top: 2px; }
.btn { min-height: 54px; border-radius: 16px; border: 3px solid #3a2f2a; background: #fff; color: #3a2f2a; font-weight: 800; font-size: 17px; box-shadow: 0 4px 0 #3a2f2a; flex: 1; padding: 0 10px; }
.btn.primary { background: linear-gradient(#ffd54a, #f2b705); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #3a2f2a; }
.btn.pulse { animation: btnpulse 1.1s ease-in-out infinite; }
.tipline { font-size: 12px; color: #6a5a48; text-align: center; }

/* ---- 種明かし / 1日の結果（全面） ---- */
#screen { position: absolute; inset: 0; background: linear-gradient(#fbf6e8, #f1e6c8); display: flex; flex-direction: column; padding: 10px 10px 10px; gap: 6px; animation: fadein .3s both; }
#screen[hidden] { display: none; }
.sc-top { display: flex; align-items: center; gap: 8px; min-height: 52px; padding-right: 0; }
.sc-top h2 { margin: 0; font-size: 18px; font-weight: 800; flex: 1; line-height: 1.2; padding-right: 0; }
.sc-top .medal-svg { width: 52px; height: 52px; flex: none; }
.sc-chart { flex: 1; min-height: 0; width: 100%; border-radius: 14px; background: #fffdf5; border: 2px solid #3a2f2a33; }
.sc-chart .bar { transform-box: fill-box; transform-origin: 50% 0; animation: growy .5s both; }
.sc-rows { font-size: 13px; line-height: 1.35; display: flex; flex-direction: column; gap: 3px; }
.sc-rows .row { display: flex; gap: 6px; align-items: center; }
.sc-rows .dotc { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.sc-bottom { display: flex; gap: 8px; }
.day { align-items: stretch; overflow: hidden; }
.day-title { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 52px; }
.day-title svg { width: 96px; height: 80px; animation: stamp .5s both; }
.day-title h2 { margin: 0; font-size: 24px; font-weight: 800; text-align: center; }
.day-mini { width: 100%; height: 52px; }
.day-medals { display: flex; justify-content: center; gap: 4px; }
.day-medals svg { width: 56px; height: 62px; animation: stamp .45s both; }
.day-stats { display: flex; justify-content: center; gap: 8px; text-align: center; }
.day-stats > div { flex: 1; padding: 6px 4px; border-radius: 14px; background: #fff; border: 2.5px solid #3a2f2a; font-size: 12px; color: #5a4a3a; }
.day-stats b { display: block; font-size: 22px; color: #2a2118; line-height: 1.1; font-variant-numeric: tabular-nums; }
.day-share { display: flex; gap: 6px; align-items: stretch; }
.day-share .line { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 12px; background: #1f2a37; color: #fff; font-size: 15px; font-weight: 700; word-break: break-all; display: flex; align-items: center; }
.day-share .btn { flex: none; width: 92px; min-height: 48px; font-size: 14px; }
.day-best { text-align: center; font-size: 13px; color: #5a4a3a; min-height: 18px; }
.day-best .new { color: #c62828; font-weight: 800; }
.day-btns { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.day-btns .btn { flex: none; }

/* ---- 動き ---- */
.cust { will-change: transform; }
.cust.enter { animation: none; }   /* 半透明の入場はやめる（後ろの席の客が数えにくい） */
.cust.leaving { transition: opacity .5s ease-out, margin .5s ease-out; opacity: 0; }
.cust.leaving .cust-in { transform: translate(var(--dx, 30px), -6px); transition: transform .5s ease-out; }
.cust-in { transform-box: fill-box; }
.cust .bob { animation: bob 1.8s ease-in-out infinite; }
.cust:nth-child(2n) .bob { animation-delay: -.6s; } .cust:nth-child(3n) .bob { animation-delay: -1.1s; } .cust:nth-child(5n) .bob { animation-delay: -.3s; }
.cust.walking .bob { animation: walkbob .3s ease-in-out infinite; }
.cust.waiting .bob { animation: bounce .9s ease-in-out infinite; }
.cust.me .me-marker { animation: markbob 1s ease-in-out infinite; }
/* しぐさ（config の gesture id と同じ） */
.prop { transform-box: fill-box; transform-origin: 50% 50%; }
.g-on .g-scroll .prop { animation: g-scroll .5s ease-in-out infinite; }
.g-on .g-peek .prop { animation: g-peek .6s ease-in-out infinite; }
.g-on .g-flip .prop, .g-on .g-flipLick .prop { animation: g-flip .35s ease-in-out infinite; }
.g-on .g-point .prop .kid-arm { animation: g-point .3s ease-in-out infinite; transform-box: fill-box; transform-origin: 0 100%; }
.g-on .g-point .prop { animation: g-hop .35s ease-in-out infinite; }
.g-on .g-turn .prop { animation: g-turn .9s linear infinite; }
.g-on .g-wave .prop { animation: g-wave .4s ease-in-out infinite; }
.g-on .g-rummage .prop { animation: g-rummage .25s ease-in-out infinite; }
.g-on .g-shake .prop { animation: g-shake .2s ease-in-out infinite; }
.g-on .g-hold .prop { animation: g-hold 1s ease-in-out infinite; }
@keyframes g-scroll { 50% { transform: translateY(3px); } }
@keyframes g-peek { 50% { transform: rotate(-14deg) translateY(2px); } }
@keyframes g-flip { 50% { transform: rotate(10deg) translateY(-2px); } }
@keyframes g-point { 50% { transform: rotate(-22deg); } }
@keyframes g-hop { 50% { transform: translateY(-3px); } }
@keyframes g-turn { to { transform: rotate(360deg); } }
@keyframes g-wave { 50% { transform: rotate(14deg) translateX(2px); } }
@keyframes g-rummage { 50% { transform: translate(2px, 2px) rotate(6deg); } }
@keyframes g-shake { 50% { transform: translateX(3px) rotate(8deg); } }
@keyframes g-hold { 50% { transform: translateY(1px); } }
@keyframes bob { 50% { transform: translateY(-2px); } }
@keyframes walkbob { 50% { transform: translateY(-4px); } }
@keyframes bounce { 50% { transform: translateY(-5px); } }
@keyframes markbob { 50% { transform: translateY(4px); } }
@keyframes custin { to { opacity: 1; } }
@keyframes pulse { 50% { transform: scale(1.35); } }
@keyframes popin { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
@keyframes introout { to { opacity: 0; transform: translateY(-120px) scale(.4); } }
@keyframes sheetup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes stamp { from { transform: scale(2.2); opacity: 0; } 70% { transform: scale(.92); opacity: 1; } to { transform: scale(1); } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes growy { from { transform: scaleY(0); } }
@keyframes fadein { from { opacity: 0; } }
@keyframes btnpulse { 50% { transform: scale(1.04); } }
@keyframes beam { 50% { opacity: .55; } }
/* 足あと（入口の印。出し続ける） */
.foot-in { animation: footpulse 1.2s ease-in-out infinite; transform-box: fill-box; }
.foot-in.mode-join .feet path, .foot-in.mode-join .feet ellipse { fill: #fffbe0; stroke: #e0a800; }
.foot-in.mode-move .feet path, .foot-in.mode-move .feet ellipse { fill: #e5f0ff; stroke: #2b6fd6; }
.foot-in.mode-walk, .foot-in.mode-lock { animation: none; opacity: .5; }
.foot-in.mode-mine { opacity: 0; }
.foot-in .arrow { animation: arrowmove 1.2s ease-in-out infinite; }
.dimfeet { opacity: .8; filter: grayscale(1); }
.keycap { display: none; }
@media (hover: hover) and (pointer: fine) { .keycap { display: block; } }
@keyframes footpulse { 50% { opacity: .55; } }
@keyframes arrowmove { 50% { transform: translateX(4px); } }
.lane:active .foot-in { transform: scale(.9); }
/* レジ */
.desk .lamp { transition: fill .1s; }
.desk.is-lamp .lamp { fill: #ff2d2d; animation: lampblink .5s steps(2) infinite; }
@keyframes lampblink { 50% { fill: #ffd0d0; } }
.desk .closed-sign { display: none; } .desk.is-closed .closed-sign { display: block; }
.desk.is-closed .scr, .desk.is-closed .scan { display: none; }
.desk .scan { animation: scan 1.2s ease-in-out infinite alternate; }
@keyframes scan { from { transform: translateY(-2px); } to { transform: translateY(2px); } }
.desk .belt { animation: none; }
.desk.is-serving .belt path { animation: beltmove .5s linear infinite; }
@keyframes beltmove { to { transform: translateY(10px); } }
.desk.is-paying .scr rect { animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.desk .numlight { r: 5; fill: #7fd68a; } .desk.is-closed .numlight { fill: #8a8f99; }
.cashier.trainee .notebook { animation: g-flip 1s ease-in-out infinite; transform-box: fill-box; }
.bubble { animation: popin .3s cubic-bezier(.3,1.7,.5,1) both; transform-box: fill-box; }
.bubble.big .bubble-in { transform: scale(1.2); }
.bubble .coin { animation: coinpop .35s cubic-bezier(.3,1.8,.5,1) both; transform-box: fill-box; transform-origin: center; }
.bubble .coin:nth-child(2) { animation-delay: .3s; } .bubble .coin:nth-child(3) { animation-delay: .6s; } .bubble .coin:nth-child(4) { animation-delay: .9s; } .bubble .coin:nth-child(5) { animation-delay: 1.2s; } .bubble .coin:nth-child(6) { animation-delay: 1.5s; }
@keyframes coinpop { from { transform: scale(0); } }
.conf { animation: conf 1.4s var(--d) ease-in forwards; transform-box: fill-box; }
@keyframes conf { to { transform: translateY(820px) rotate(var(--r)); opacity: .9; } }
.evt { opacity: 1; }

/* ウィジェット（作った話と感想）の位置の調整は data-* で行う */
@media (prefers-reduced-motion: reduce) {
  .cust .bob, .cust.waiting .bob, .cust.me .me-marker, .g-on .prop, .foot-in, .foot-in .arrow, #dots i.now, .desk .scan, .desk.is-serving .belt path { animation: none !important; }
  .conf { display: none; }
  .cust.enter { animation-duration: .01s; }
}

/* ---- 工程7 ux の修正 ---- */
#intro { background: #fff; }
#intro.tap { pointer-events: auto; cursor: pointer; }
#intro.tap::after { content: ""; position: absolute; inset: -30px; }
#intro.leaving { pointer-events: none; }
#intro .i-hint { font-size: 15px; font-weight: 800; color: #2a2118; margin: 6px 0 2px; line-height: 1.3; }
#intro .i-go { display: inline-block; margin-top: 6px; padding: 8px 18px; border-radius: 14px; border: 3px solid #3a2f2a; background: linear-gradient(#ffd54a, #f2b705); font-size: 18px; font-weight: 800; color: #2a2118; box-shadow: 0 3px 0 #3a2f2a; animation: btnpulse 1.1s ease-in-out infinite; }
#round-lbl { font-style: normal; font-size: 11px; font-weight: 800; color: #3a2f2a; margin-left: 4px; line-height: 9px; }
#dots { align-items: center; }
.r-top .r-end .rk { display: inline-block; margin-left: 4px; padding: 0 8px; border-radius: 99px; background: #e5eaf1; border: 1.5px solid #3a2f2a66; font-size: 12px; font-weight: 800; color: #5a4a3a; vertical-align: 2px; }
.r-lanes { height: 74px; }
.r-top .r-end { font-size: 17px; line-height: 1.25; }
.r-top .r-end .big { font-size: 38px; line-height: 1; margin: 0 2px; font-variant-numeric: tabular-nums; }
.r-top .r-end .ok { color: #1f7a33; } .r-top .r-end .ng { color: #c62828; }
.r-diff { flex-direction: column; align-items: flex-start; gap: 1px; }
.r-rk { font-size: 15px; font-weight: 800; }
.r-rk2 { font-size: 12.5px; font-weight: 700; color: #5a4a3a; line-height: 1.3; }
.r-rk2.mv { color: #1f5fa8; }
.rl .tg { text-decoration: none; display: block; font-size: 10px; font-weight: 800; line-height: 1.15; white-space: nowrap; }
.rl .tg.fast { color: #8a6400; } .rl .tg.me { color: #1f5fa8; }
.rl.first i::after { background: #3a86c8; }
.sc-chart .bar0 { transform-box: view-box; transform-origin: 0 78px; animation: growy .7s ease-out both; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 10px; font-size: 11px; font-weight: 700; color: #3a2f2a; }
.legend .lg { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.legend .lg i { display: inline-block; width: 14px; height: 10px; border: 2px solid #3a2f2a; border-radius: 2px; }
.legend2 { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 700; color: #5a4a3a; }
.legend2 svg { width: 14px; height: 14px; }
.day-share .line { user-select: text; -webkit-user-select: text; }
body.tight .r-btns, body.tight .sc-bottom { padding-right: 36px; }
body.tight .day-btns { padding-right: 36px; }
/* 最初の1手までの足あと（並ぶ前だけ。目立たせる） */
.foot-in.mode-join { animation: footpulse .9s ease-in-out infinite; }
.foot-in.mode-join .tapring { animation: tapring 1.1s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes tapring { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }
.lbl-lock { font-size: 11px; font-weight: 800; }

/* ---- 周回2 ux: 結果の札の棒（秒に比例。締め切りの位置に線） ---- */
.r-lanes { display: block; height: auto; padding: 0; }
.rl-head { font-size: 11px; font-weight: 700; color: #5a4a3a; line-height: 1.2; margin-bottom: 2px; }
.rl-rows { display: flex; flex-direction: column; gap: 2px; }
.rl { flex-direction: row; align-items: center; justify-content: flex-start; height: auto; gap: 6px; min-height: 18px; }
.rl b { width: 40px; flex: none; text-align: right; font-size: 12px; margin: 0; color: #3a2f2a; white-space: nowrap; }
.rl .tr { position: relative; flex: 1; height: 14px; min-width: 0; }
.rl .tr::after { content: ""; position: absolute; top: -3px; bottom: -3px; left: var(--dl); border-left: 2.5px dashed #e53935; }
.rl .tr i { display: block; height: 100%; min-height: 0; border-radius: 3px; transform-origin: left; animation: growx .5s both; }
.rl.fast .tr i { background: #f2c94c; }
.rl.you .tr i { border-color: #e0a800; } .rl.you.ok .tr i { background: #7fd68a; } .rl.you.ng .tr i { background: #ef8a7e; }
.rl em { font-style: normal; font-size: 13px; font-weight: 800; width: 40px; flex: none; font-variant-numeric: tabular-nums; }
.rl .tg { font-size: 10.5px; flex: none; }
.rl.first .tr i::after { display: none; }
@keyframes growx { from { transform: scaleX(0); } }
.rl .tgs { width: 96px; flex: none; display: flex; flex-direction: column; align-items: flex-start; overflow: hidden; }
.rl .tgs .tg { font-size: 10px; letter-spacing: -.02em; }
.rl .tgs .tg { white-space: normal; }
/* お題の札の手がかり（R2 から） */
#intro .i-clues { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 2px; text-align: left; }
#intro .i-clue { display: flex; gap: 6px; }
#intro .i-clue > span { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 10px; background: #f6efd9; border: 1.5px solid #3a2f2a33; }
#intro .clue-i { width: 34px; height: 34px; flex: none; }
#intro .i-clue em { font-style: normal; font-size: 12.5px; font-weight: 800; line-height: 1.25; color: #2a2118; }
/* 周回2 ux: 種明かしの凡例の字を大きく、感想のボタンを札の角から逃がす */
.legend { font-size: 13px; gap: 3px 10px; }
.legend2 { font-size: 12.5px; }
.legend2 svg { width: 16px; height: 16px; }
body.tight #overlay { bottom: var(--wb, 52px); }
body.tight #screen { padding-bottom: var(--wb, 52px); }
body.tight .r-btns, body.tight .sc-bottom, body.tight .day-btns { padding-right: 0; }
.r-rk2.nostay { color: #8a4b00; }
.sc-rows .row.best { background: #e8f3ff; border: 2px solid #8fb8e8; border-radius: 12px; padding: 4px 8px; font-weight: 800; }
.sc-rows .row.best svg { width: 34px; height: 30px; flex: none; }
.sc-rows .row.r-cause svg { width: 40px; height: 34px; flex: none; }
/* 手ほどきの吹き出しは、レジ係の顔の上でなく、入口の上の空いた所に出す（PC で棚と顔に重なって読みにくかった） */
#caption { top: 62px; left: 50%; transform: translateX(-50%); max-width: 330px; text-align: center; box-shadow: 0 3px 0 #3a2f2a44, 0 0 0 4px #fffc; }
#caption::after { left: 50%; margin-left: -7px; }
#caption { left: 0; right: 0; transform: none; margin: 0 auto; width: fit-content; }
/* 幕: 札が出ている間と、札や次へのボタンを押した指の一連（離れた後 350ms まで）、店全体の押しを受けて止める。列の .hit より上、札・HUD より下 */
#curtain { position: absolute; inset: 0; background: transparent; touch-action: none; }
#curtain[hidden] { display: none; }

/* 周回3: 結果と種明かしは店の絵の上に重ねる（#rscene）。下の札は小さく */
#rscene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#rscene[hidden] { display: none; }
#rscene .rs-in { animation: fadein .35s both; }
#overlay { max-height: 46%; padding: 8px 12px 10px; gap: 4px; }
#overlay .r-top .medal-svg { width: 54px; height: 54px; }
#overlay .r-top .r-end .big { font-size: 32px; }
#overlay .r-cause { min-height: 36px; padding: 3px 8px; font-size: 13px; }
#overlay .r-cause svg { width: 34px; height: 30px; }
.r-lg { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; font-size: 10.5px; font-weight: 700; color: #5a4a3a; white-space: nowrap; vertical-align: 1px; }
.r-lg i { display: inline-block; width: 16px; height: 8px; border: 1.2px solid #3a2f2a; margin-left: 4px; }
.r-lg .b-scan { background: #a9cdf2; margin-left: 0; }
.r-lg .b-extra { background: repeating-linear-gradient(135deg, #a8480f 0 2px, #f2a35e 2px 5px); }
.r-ttl {font-size: 13px; font-weight: 800; color: #5a4a3a; }
#overlay .sc-rows { font-size: 13px; }
#overlay .sc-rows .row.best { font-size: 13px; padding: 3px 8px; }
#screen .sc-bottom { gap: 8px; }

/* 周回3 修正: 結果の札は店の3割以内。締め切りの秒は札に1回だけ */
.r-dl { font-size: 12.5px; font-weight: 700; color: #5a4a3a; line-height: 1.2; }
#overlay { padding: 6px 12px 8px; gap: 3px; }
#overlay .r-top .medal-svg { width: 46px; height: 46px; }
#overlay .r-top .r-end { font-size: 15px; line-height: 1.15; }
#overlay .r-top .r-end .big { font-size: 28px; }
#overlay .r-rk { font-size: 14px; }
#overlay .r-rk2 { font-size: 11.5px; line-height: 1.2; }
#overlay .r-cause { min-height: 0; font-size: 12px; line-height: 1.25; padding: 3px 7px; }
#overlay .r-cause svg { width: 28px; height: 26px; }
#overlay .r-btns .btn { min-height: 44px; font-size: 16px; }

/* 周回4: 結果の札は紙の値札。1位から順に 0.15秒ずつぽんと出る */
@keyframes tagpop { from { opacity: 0; transform: translateY(-10px) scale(.6); } 70% { opacity: 1; transform: translateY(1px) scale(1.06); } to { opacity: 1; transform: none; } }
#rscene .rs-tag { transform-box: fill-box; transform-origin: center; animation: tagpop .32s cubic-bezier(.3,1.5,.5,1) both; }
@media (prefers-reduced-motion: reduce) { #rscene .rs-tag, #rscene .rs-in { animation: none; } }

/* 周回4: 1日の結果。称号の段と今日読めた手がかり */
.day { overflow-y: auto; }
.day-title { margin-top: 44px; }
.day-title svg { width: 64px; height: 54px; }
.day-title h2 { font-size: 21px; }
.day-ladder ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; align-items: flex-end; justify-content: center; }
.day-ladder .st { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 14px 2px 4px; margin-top: calc((4 - var(--h)) * 4px); border: 2px solid #3a2f2a55; border-radius: 10px; background: #fff; opacity: .78; text-align: center; }
.day-ladder .st svg { width: 32px; height: 34px; filter: grayscale(.8); }
.day-ladder .st.done svg { filter: none; }
.day-ladder .st.now { opacity: 1; border: 3px solid #e0a800; background: #fff3c4; box-shadow: 0 3px 0 #3a2f2a33; }
.day-ladder .st.now svg { filter: none; width: 38px; height: 40px; }
.day-ladder .st-f { position: absolute; top: -2px; left: 0; right: 0; font-style: normal; font-size: 11px; font-weight: 800; color: #8a6400; line-height: 14px; }
.day-ladder .st-n { font-size: 9px; line-height: 1.15; font-weight: 800; color: #3a2f2a; overflow-wrap: break-word; max-width: 100%; }
.day-ladder .st-c { display: flex; flex-direction: column; font-size: 10px; line-height: 1.2; color: #5a4a3a; }
.day-ladder .st-c em { font-style: normal; font-weight: 700; }
.day-ladder .st u { text-decoration: none; font-size: 9px; font-weight: 800; color: #8a6400; line-height: 1.1; }
.day-ladder .next-line { margin-top: 4px; text-align: center; font-size: 13px; font-weight: 800; color: #1f5fa8; line-height: 1.25; }
.day-clues h3 { margin: 0 0 2px; font-size: 13px; color: #5a4a3a; }
.day-clues ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.day-clues .cl { display: flex; align-items: center; gap: 6px; padding: 2px 8px 2px 6px; border-radius: 10px; background: #fff; border: 2px solid #3a2f2a33; min-height: 34px; font-size: 13px; font-weight: 700; line-height: 1.2; }
.day-clues .cl.ok { border-color: #7fb98a; }
.day-clues .cl.no { background: #eceef2; border-color: #aab2bd; color: #5a5f6b; }
.day-clues .cl-n { flex: none; width: 16px; text-align: center; font-weight: 800; color: #8a8f99; }
.day-clues .cl-m svg { width: 30px; height: 30px; animation: none; display: block; }
.day-clues .cl-i { flex: none; position: relative; width: 36px; height: 30px; display: flex; align-items: center; justify-content: center; }
.day-clues .cl-i svg { width: 34px; height: 28px; }
.day-clues .cl-i.gray svg { filter: grayscale(1); opacity: .6; }
.day-clues .cl-i .q { position: absolute; right: -2px; top: -4px; width: 16px; height: 16px; border-radius: 50%; background: #8a8f99; color: #fff; font-size: 12px; line-height: 16px; text-align: center; }
.day-clues .cl-t { flex: 1; min-width: 0; }
.day-clues .cl-t small { display: block; font-size: 10.5px; color: #8a6400; font-weight: 800; }
@media (max-height: 700px) { .day-title { margin-top: 36px; } .day-title svg { display: none; } .day-clues .cl { min-height: 30px; } .day-clues .cl-m svg { width: 26px; height: 26px; } }
/* 周回6: 結果の文の頭の四角（種明かしで太い赤枠の吹き出しと同じ客）。列ごとの一言は「くわしく」だけ */
.mk-top { display: inline-block; width: 13px; height: 10px; border: 3px solid #c62828; border-radius: 3px; background: #fff; margin-right: 5px; vertical-align: -1px; box-sizing: content-box; }
.sc-rows .row.lane-tops { background: #f6f1e7; border: 2px solid #d8cfba; border-radius: 12px; padding: 4px 8px; font-size: 12px; font-weight: 700; display: block; }
.sc-rows .row.lane-tops ul { margin: 2px 0 0; padding-left: 16px; }
.sc-rows .row.lane-tops li { margin: 1px 0; line-height: 1.3; }
/* 周回5: 種明かしの札を低く（最下段の棒と「ほか」の行が札に隠れない）。字は12px、絵は小さく */
#overlay .sc-rows { font-size: 12px; line-height: 1.2; gap: 2px; }
#overlay .sc-rows .row.best { font-size: 11.5px; padding: 2px 7px; }
#overlay .sc-rows .row.best svg { width: 28px; height: 24px; }
#overlay .sc-rows .row.r-cause { min-height: 0; padding: 2px 7px; font-size: 11.5px; }
#overlay .sc-rows .row.r-cause svg { width: 30px; height: 26px; }
