/* 流れ寿司防衛線 */
:root { --accent: #24476e; --accent-ink: #fff; --accent-soft: #e2ebf5; --bg: #f6f1e6; --surface: #fffdf7; --line: #e2d8c3; --text: #1d1f24; --text-sub: #6b665a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --accent: #8fb8ea; --accent-ink: #0f1722; --accent-soft: #1d2b3d; --bg: #11161d; --surface: #18202a; --surface-2: #212b37; --line: #2f3c4c; --text: #eef2f6; --text-sub: #a7b2c0; } }
body { background: var(--bg); }
.mn-app { max-width: 560px; padding-top: 10px; }
.sb-title { display: grid; gap: 14px; }
.sb-hero { margin: 0 -16px; aspect-ratio: 16 / 9; overflow: hidden; background: #2b2117; }
.sb-hero img, .sb-hero video { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (min-width: 600px) { .sb-hero { margin: 0; border-radius: 18px; } }
.sb-h1 { font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", var(--font); font-size: clamp(30px, 8.5vw, 42px); font-weight: 900; line-height: 1.15; margin: 4px 0 0; color: var(--accent); text-align: center; letter-spacing: .02em; }
.sb-h1 small { display: block; font-size: .45em; color: var(--text); margin-top: 6px; letter-spacing: .1em; }
.sb-lead { margin: 0; line-height: 1.75; }
.sb-meta { margin: 0; text-align: center; color: var(--text-sub); font-size: 13px; font-weight: 700; }
.sb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sb-daily { display: grid; gap: 8px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.sb-daily p { margin: 0; }
.sb-friend { text-align: center; }
.sb-h2 { font-size: 22px; margin: 6px 0; }
.sb-stages { display: grid; gap: 8px; margin: 12px 0; }
.sb-stage { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-family: inherit; cursor: pointer; }
.sb-stage:hover:not(:disabled) { border-color: var(--accent); }
.sb-stage.is-lock { opacity: .5; cursor: default; }
.sb-stage-n { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: var(--accent-soft); color: var(--accent); }
.sb-stage-b b { display: block; font-size: 16px; }
.sb-stage-b small { color: var(--text-sub); }
.sb-stage-s { color: #e8a21b; font-size: 18px; letter-spacing: 1px; }

/* プレイ */
.sb-play { display: grid; gap: 8px; justify-items: center; }
.sb-hud { width: 100%; display: grid; grid-template-columns: auto auto 1fr auto auto; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px 10px; }
.sb-hud-c, .sb-hud-w { display: grid; line-height: 1.15; }
.sb-hud small { font-size: 10px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.sb-pts, .sb-clock { font-size: 20px; font-variant-numeric: tabular-nums; }
.sb-pts { color: #b8860b; }
.sb-warm { display: block; height: 12px; border-radius: 99px; background: rgba(127,127,127,.25); overflow: hidden; margin-top: 3px; }
.sb-warm i { display: block; height: 100%; background: linear-gradient(90deg, #ff9a52, #e2402e); transition: width .25s; }
.sb-warm.is-low i { background: linear-gradient(90deg, #8ac4ff, #4b7ad8); }
.sb-doze, .sb-spd { font-family: inherit; font-weight: 800; font-size: 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); padding: 8px 10px; cursor: pointer; white-space: nowrap; }
.sb-doze { --p: 0%; background: linear-gradient(90deg, rgba(110,130,230,.35) var(--p), var(--surface-2) var(--p)); }
.sb-doze.is-ready { background: #5865d8; color: #fff; border-color: #5865d8; animation: kb-pulse 1.2s infinite; }
.sb-doze:disabled { cursor: default; }
@keyframes kb-pulse { 50% { transform: scale(1.06); } }
.sb-stagebox { position: relative; line-height: 0; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); touch-action: manipulation; }
.sb-canvas { display: block; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.sb-start { position: absolute; inset: 0; display: grid; place-content: center; gap: 10px; text-align: center; padding: 24px; background: rgba(30,18,12,.55); color: #fff; line-height: 1.6; cursor: pointer; }
.sb-start b { font-size: 22px; }
.sb-start p { margin: 0; }
.sb-start-go { font-weight: 900; font-size: 18px; animation: kb-pulse 1.4s infinite; }
.sb-pal { width: 100%; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.sb-pb { display: grid; justify-items: center; gap: 0; width: 58px; padding: 4px 0 4px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--text); font-family: inherit; font-weight: 800; cursor: pointer; }
.sb-pb small { font-size: 12px; line-height: 1.2; color: #b8860b; }
.sb-pb.is-sel { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.sb-pb.is-poor { opacity: .45; }
.sb-pb-ic { font-size: 26px; line-height: 44px; height: 44px; }
.sb-hint { margin: 0; font-size: 12px; color: var(--text-sub); text-align: center; }

/* 結果 */
.sb-result { display: grid; gap: 12px; text-align: center; }
.sb-r-head { margin: 0; font-weight: 800; color: var(--text-sub); }
.sb-rface { margin: 0 auto; border-radius: 50%; background: #2b2117; }
.sb-r-line { margin: 0; font-size: clamp(24px, 7vw, 34px); font-weight: 900; line-height: 1.3; color: var(--accent); }
.sb-r-stars { margin: 0; font-size: 30px; color: #e8a21b; letter-spacing: 4px; }
.sb-r-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sb-r-stats .mn-stat { display: grid; grid-template-columns: 1fr; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px; }
.sb-r-stats .mn-stat small { color: var(--text-sub); font-size: 11px; }
.sb-r-stats .mn-stat b { font-size: 18px; }
.sb-tail { display: grid; gap: 12px; }

/* 図鑑 */
.sb-zgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.sb-z { display: grid; justify-items: center; gap: 2px; text-align: center; padding: 8px; border-radius: 12px; background: var(--surface-2); }
.sb-z b { font-size: 14px; }
.sb-z p { margin: 0; font-size: 11px; color: var(--text-sub); line-height: 1.5; }
.sb-z.is-unseen { opacity: .6; }
.sb-z-q { width: 64px; height: 64px; display: grid; place-items: center; font-size: 30px; font-weight: 900; color: var(--text-sub); }
@media (prefers-reduced-motion: reduce) { .sb-doze.is-ready, .sb-start-go { animation: none; } }
.sb-hud { grid-template-columns: auto auto 1fr auto auto; }
.sb-coin, .sb-wave { font-size: 18px; font-variant-numeric: tabular-nums; }
.sb-coin { color: #b8860b; }
.sb-toro { font-size: 10px; letter-spacing: -1px; color: #e0503a; white-space: nowrap; line-height: 1.6; }
.sb-toro.is-low { animation: kb-pulse 1s infinite; }
.sb-stop { font-family: inherit; font-weight: 800; font-size: 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); padding: 8px 10px; cursor: pointer; white-space: nowrap; }
.sb-stop:disabled { opacity: .45; cursor: default; }
.sb-rface { border-radius: 50%; }
@media (max-width: 420px) {
  .sb-hud { gap: 6px; padding: 5px 8px; }
  .sb-hud small { font-size: 9px; max-width: 86px; }
  .sb-hint { display: none; }
  .sb-pb { width: 52px; }
}
.sb-spd { min-width: 40px; }
/* お知らせは画面の上に1つだけ（下のボタンを隠さない） */
body.pui-playing .mn-toast { bottom: auto; top: 12px; border-radius: 14px; text-align: center; line-height: 1.5; width: max-content; max-width: min(90vw, 420px); }
/* v2：波の予告・お店のしかけ・得意苦手の表 */
.sb-next { position: absolute; left: 50%; top: 10px; transform: translate(-50%, -12px) scale(.9); opacity: 0; pointer-events: none; cursor: pointer; display: grid; justify-items: center; gap: 2px; padding: 10px 16px 12px; border-radius: 16px; background: rgba(15, 30, 50, .9); color: #fff; border: 3px solid #ffd36a; box-shadow: 0 8px 24px rgba(0,0,0,.35); transition: opacity .25s, transform .25s; text-align: center; min-width: 220px; line-height: 1.4; }
.sb-next.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
.sb-next-go { font-style: normal; font-size: 12px; font-weight: 900; margin-top: 4px; padding: 3px 10px; border-radius: 999px; background: #ffd36a; color: #1d2b3a; animation: sbBlink 1.2s ease-in-out infinite; }
@keyframes sbBlink { 50% { opacity: .55; } }
.sb-next b { font-size: 19px; color: #ffd36a; }
.sb-next small { font-size: 12px; font-weight: 800; }
.sb-fnote { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; text-align: left; font-size: 12.5px; }
.sb-fnote b { display: inline-block; padding: 1px 7px; border-radius: 8px; color: #fff; font-size: 11.5px; margin-right: 4px; }
.sb-f-gate { background: #c83c32; } .sb-f-chef { background: #b8862a; } .sb-f-fast { background: #2f6fb0; }
.sb-aff { border-collapse: collapse; width: 100%; font-size: 12px; text-align: center; }
.sb-aff th, .sb-aff td { border: 1px solid rgba(0,0,0,.12); padding: 4px 2px; }
.sb-aff th { font-weight: 800; font-size: 11px; }
.sb-aff td.is-good { background: rgba(232,74,60,.15); font-weight: 900; color: #c0392b; }
.sb-aff td.is-bad { background: rgba(80,110,160,.12); color: #46638f; }
/* 7つのボタンを1列に（フィールドを広く） */
.sb-pal { display: flex; flex-wrap: nowrap; max-width: 460px; margin: 0 auto; gap: 4px; }
.sb-pb, .sb-pb:is(*) { flex: 1 1 0; width: auto; min-width: 0; max-width: 64px; padding: 3px 0; border-radius: 12px; }
.sb-pb canvas { width: 38px !important; height: 38px !important; }
.sb-pb-ic { font-size: 22px; line-height: 38px; height: 38px; }
/* v3：板前の操作盤・カメラ */
.sb-canvas { display: block; touch-action: none; cursor: pointer; }
.sb-stagebox { touch-action: none; }
.sb-panel { display: grid; gap: 6px; margin-top: 6px; }
.sb-panel-r { display: flex; align-items: center; gap: 6px; }
.sb-hand-l { flex: 1; min-width: 0; font-size: 13px; font-weight: 800; background: var(--surface); border: 2px solid var(--line); border-radius: 12px; padding: 6px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-hand { color: #c0392b; }
.sb-cancel, .sb-zoom button { font: inherit; font-weight: 800; font-size: 12px; padding: 7px 9px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.sb-cancel:disabled { opacity: .4; }
.sb-zoom { display: inline-flex; gap: 3px; }
.sb-recipes { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.sb-rc { display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px 2px 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 11.5px; font-weight: 800; }
.sb-toroN.is-low { color: #c0392b; }
.sb-rface { display: block; margin: 0 auto; }
/* 物語の会話（紙芝居） */
.sb-talk { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 10px; background: linear-gradient(180deg, rgba(30,20,14,.9), rgba(20,14,10,.96)); color: #fff; line-height: 1.6; cursor: pointer; }
.sb-talk.is-full { position: fixed; z-index: 1000; justify-content: center; align-items: center; background: rgba(20,14,10,.92); padding: 16px; }
.sb-talk-head { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; font-weight: 900; font-size: 14px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.sb-talk.is-full .sb-talk-head { position: static; width: min(100%, 560px); }
.sb-talk-skip { font: inherit; font-size: 12px; font-weight: 800; padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.6); background: rgba(0,0,0,.35); color: #fff; cursor: pointer; }
.sb-talk-img { width: min(100%, 560px); border-radius: 14px; display: block; }
.sb-talk-box { display: flex; gap: 10px; align-items: flex-end; background: #fffaf0; color: #3a2a22; border-radius: 16px; padding: 10px 12px; border: 3px solid #b07a44; box-shadow: 0 8px 20px rgba(0,0,0,.35); width: min(100%, 560px); box-sizing: border-box; }
.sb-talk-face { flex: 0 0 auto; width: 92px; height: 92px; border-radius: 12px; background: #f1dcb6; display: grid; place-items: center; overflow: hidden; }
.sb-talk-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.sb-talk-who { font-size: 13px; color: #b0461f; }
.sb-talk-txt { margin: 0; font-size: 15px; font-weight: 700; }
.sb-talk-txt.is-narr { font-weight: 600; color: #5a4a3a; font-style: normal; }
.sb-talk-step { font-size: 11px; color: #8a7a6a; }
/* 遊んでいる間は横幅いっぱい・全画面ではヘッダーも隠して画面いっぱい */
body.sb-playing #app { max-width: 1200px; padding-left: 8px; padding-right: 8px; }
body.sb-playing .sb-stagebox { width: 100%; }
.sb-fs { min-width: 40px; font: inherit; font-weight: 900; font-size: 16px; padding: 6px 8px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
body.sb-playing.pui-full .mn-header { display: none !important; }
body.sb-playing.pui-full { overflow: hidden; }
body.sb-playing.pui-full #app { position: fixed; inset: 0; z-index: 50; max-width: none; margin: 0; padding: max(4px, env(safe-area-inset-top)) 4px max(4px, env(safe-area-inset-bottom)); min-height: 0; background: var(--bg, #f6efe2); overflow: hidden; }
body.sb-playing.pui-full .sb-play { display: flex; flex-direction: column; height: 100%; gap: 4px; }
body.sb-playing.pui-full .sb-hud { margin: 0; padding: 4px 8px; }
body.sb-playing.pui-full .sb-hud small { font-size: 9px; }
body.sb-playing.pui-full .sb-stagebox { flex: 1; min-height: 0; border-radius: 10px; }
body.sb-playing.pui-full .sb-panel { margin-top: 0; gap: 4px; }
body.sb-playing.pui-full .sb-recipes { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; }
body.sb-playing.pui-full .sb-rc { flex: 0 0 auto; }
.sb-hud, .sb-hud:is(*) { grid-template-columns: auto auto 1fr auto auto auto; }
/* 寿司えらび */
.sb-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sb-pick-b { display: grid; justify-items: center; gap: 2px; padding: 8px 6px 10px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; text-align: center; }
.sb-pick-b b { font-size: 14px; }
.sb-pick-b small { font-size: 11px; color: var(--muted, #7a6a5a); }
.sb-pick-b .sb-pick-d { color: #b0461f; font-weight: 700; min-height: 1.2em; }
.sb-pick-b.is-on { border-color: #e25a3c; background: #fff1ea; box-shadow: 0 0 0 3px rgba(226,90,60,.18); }
@media (min-width: 640px) { .sb-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sb-rev { font: inherit; font-weight: 900; font-size: 12px; padding: 7px 9px; border-radius: 12px; border: 2px solid #2f6fb0; background: #eaf2fb; color: #1f4f80; cursor: pointer; white-space: nowrap; }
.sb-rev:disabled { opacity: .45; }
/* 調理場の場所えらび */
.sb-kitbar { margin-top: 8px; display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 12px; border-radius: 14px; background: rgba(255,251,240,.96); box-shadow: 0 4px 16px rgba(60,30,10,.25); }
.sb-kitbar p { margin: 0; font-size: 13px; line-height: 1.45; flex: 1 1 220px; }
.sb-kitbar small { color: #6d5a48; }
.sb-kitbar-r { display: flex; gap: 6px; flex: 0 0 auto; }
.sb-kitbar .mn-btn { padding: 8px 12px; font-size: 13px; min-height: 40px; }

/* プレイ中の短いお知らせは、下のボタンのじゃまをしない */
body.sb-playing .mn-toast { pointer-events: none; opacity: .92; }
.sb-next-desc { max-width: 280px; font-weight: 700 !important; opacity: .92; }
