/* 問いのシート、録画の再生、結果（ux）。#app の中の絶対配置。ロック画面の上の焼き付きの帯は、シートの上に見えたままにする */
/* 問いのシート: 高さは画面の 62%。上端に20秒の減る帯。上の絵は assets/scenes.jpg（3枚を縦に並べた物）*/
.sheet { position: absolute; left: 0; right: 0; bottom: 0; height: 62%; z-index: 6; display: flex; flex-direction: column; background: #14122c; border-radius: 24px 24px 0 0; box-shadow: 0 -12px 40px rgba(0,0,0,.55); overflow: hidden; }
.sheet[hidden] { display: none; }
.sheet.rise { animation: rise .24s ease-out; }
@keyframes rise { from { transform: translateY(100%); } }
.sheet .timebar { height: 5px; background: rgba(255,255,255,.12); flex: none; }
.sheet .timebar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb347, #ffd98a); transform-origin: left; transition: transform .25s linear; }
.sheet.low .timebar i { background: #ff6a5a; }
.sheet .scene { position: relative; flex: 0 0 34%; background: #2a2150 url(/assets/scenes.jpg) 0 0 / 100% auto no-repeat; }
.sheet .scene[data-scene="1"] { background-position: 0 50%; } .sheet .scene[data-scene="2"] { background-position: 0 100%; }
.sheet .scene::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,18,44,.1), rgba(20,18,44,.85)); }
.sheet .where { position: absolute; left: 16px; bottom: 8px; z-index: 1; font-size: 13px; font-weight: 700; letter-spacing: .06em; opacity: .9; }
.sheet .count { position: absolute; right: 16px; bottom: 8px; z-index: 1; font-size: 12px; opacity: .75; }
.sheet .lamp { position: absolute; right: 24px; top: 12px; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle, #ffe9a6, rgba(255,200,90,0) 70%); animation: hintpulse 3s infinite; z-index: 1; }
.sheet .q { flex: none; padding: 12px 18px 4px; font-size: 18px; font-weight: 700; line-height: 1.35; min-height: 62px; }
.sheet .choices { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 8px 14px 6px; align-content: start; }
.choice { min-height: 52px; border-radius: 14px; border: 1px solid rgba(255,255,255,.3); background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,.1)); color: #fff; font-size: 17px; font-weight: 700; cursor: pointer; padding: 6px 8px; touch-action: manipulation; }
.choice:active:not(:disabled) { background: rgba(255,255,255,.35); }
.choice:disabled { cursor: default; }
.choice.picked { border-color: #fff; }
.choice.correct { background: #1f8a62; border-color: #7be8b8; animation: bounce .3s; }
.choice.wrong { background: #8a2a2a; border-color: #ff8a7a; animation: wiggle .4s; }
@keyframes bounce { 40% { transform: scale(1.08); } }
@keyframes wiggle { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.sheet .note { flex: none; height: 24px; text-align: center; font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.sheet.ok .note { color: #7be8b8; } .sheet.ng .note { color: #ff8a7a; }

/* 録画の再生（居間のテレビ）と行き先(3)の場面 */
.replay { position: absolute; inset: 0; z-index: 7; background: #0a0814 url(/assets/tv-room.jpg) center / cover no-repeat; overflow: hidden; }
.replay::before { content: ""; position: absolute; inset: 0; background: rgba(6,4,16,.55); }
.replay .glow { position: absolute; left: 50%; top: 36%; width: 420px; height: 300px; margin: -150px 0 0 -210px; border-radius: 50%; background: radial-gradient(circle, rgba(90,200,120,.45), rgba(90,200,120,0) 70%); filter: blur(30px); animation: hintpulse 2s infinite; }
.replay.lit .glow { opacity: 1; filter: blur(22px) brightness(1.6); }
.replay .tv { position: absolute; left: 14px; right: 14px; top: 17%; z-index: 1; padding: 10px; border-radius: 18px; background: linear-gradient(180deg, #2c2c3a, #111119); box-shadow: 0 20px 50px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.2); }
.replay .tvbase { position: absolute; left: 30%; right: 30%; bottom: -14px; height: 8px; border-radius: 0 0 8px 8px; background: #1a1a24; }
.replay .screen { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: repeating-linear-gradient(90deg, #2c8a4a 0 12.5%, #2f9552 12.5% 25%); box-shadow: inset 0 0 30px rgba(0,0,0,.5); }
.replay .screen::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(255,255,255,.12), transparent 35%); pointer-events: none; }
.board { position: absolute; left: 8px; top: 8px; z-index: 2; display: flex; gap: 8px; align-items: center; padding: 3px 8px; border-radius: 4px; background: rgba(10,10,20,.82); font-size: 12px; }
.board .sc { font-size: 14px; letter-spacing: .08em; } .board .min { opacity: .8; }
.big { position: absolute; left: 0; right: 0; top: 34%; z-index: 3; text-align: center; font-size: 34px; font-weight: 900; text-shadow: 0 2px 0 #000, 0 0 18px rgba(255,220,100,.9); opacity: 0; padding: 0 10px; }
.big.pop { animation: bigpop 1.1s ease-out; }
@keyframes bigpop { 0% { transform: scale(.6); opacity: 0; } 15% { transform: scale(1.15); opacity: 1; } 75% { opacity: 1; } 100% { transform: scale(1); opacity: 0; } }
.cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 6px 10px; background: rgba(0,0,0,.78); font-size: 14px; font-weight: 700; min-height: 30px; }
.cf { position: absolute; top: 0; width: 7px; height: 11px; z-index: 4; }
.seen { position: absolute; right: 12%; top: 40%; z-index: 5; padding: 4px 14px; border: 4px solid #ff4d3d; color: #ff4d3d; font-size: 28px; font-weight: 900; border-radius: 6px; transform: rotate(-8deg); background: rgba(0,0,0,.3);
  -webkit-mask-image: radial-gradient(circle at 20% 30%, #000 60%, rgba(0,0,0,.7)); mask-image: radial-gradient(circle at 20% 30%, #000 60%, rgba(0,0,0,.7)); animation: inkin .4s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes inkin { from { transform: rotate(-8deg) scale(2.2); opacity: 0; } to { transform: rotate(-8deg) scale(1); opacity: 1; } }
.recap { position: absolute; left: 0; right: 0; top: 11%; text-align: center; z-index: 1; font-size: 13px; letter-spacing: .1em; opacity: .75; transition: opacity .4s; }
.skip, .toresult { position: absolute; z-index: 9; border: 0; cursor: pointer; font-weight: 800; color: #fff; }
.skip { right: 12px; top: 10px; min-width: 64px; height: 44px; padding: 0 14px; border-radius: 22px; background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.4); font-size: 14px; }
.toresult { left: 50%; bottom: 9%; transform: translateX(-50%); min-width: 200px; height: 56px; border-radius: 28px; background: #ffb347; color: #2a1a00; font-size: 18px; }
.scene-mode .tvwrap { position: absolute; left: 50%; bottom: 25%; width: 220px; height: 150px; margin-left: -110px; z-index: 2; border-radius: 10px; overflow: hidden; border: 6px solid #1a1a24; opacity: .9; }
.scene-mode .noise { width: 100%; height: 100%; display: block; }
.scene-mode .sline { position: absolute; left: 0; right: 0; top: 4%; text-align: center; z-index: 3; font-size: 20px; font-weight: 800; opacity: 0; transition: opacity .6s; padding: 0 16px; }
.scene-mode .sline.on { opacity: 1; }
.scene-mode.dark .tvwrap { opacity: .15; transition: opacity .6s; }

/* 結果。内側だけ縦に動く。下の操作の行は固定（左 64px は感想のボタン用） */
.result { position: absolute; inset: 0; z-index: 8; background: linear-gradient(180deg, #1b1a3a, #3a2a58 70%, #6a3d6b); display: flex; flex-direction: column; }
.result[hidden] { display: none; }
.rscroll { flex: 1; min-height: 0; overflow-y: auto; touch-action: pan-y; padding: 24px 18px 8px; display: flex; flex-direction: column; gap: 8px; }
.result .mode { margin: 0; font-size: 12px; opacity: .6; letter-spacing: .06em; }
.result .stamp { align-self: flex-start; padding: 6px 16px; border: 4px solid #ff5a4a; outline: 2px solid #ff5a4a; outline-offset: 3px; color: #ff5a4a; font-size: 28px; font-weight: 900; transform: rotate(-4deg); border-radius: 8px; margin: 20px 0 4px 4px; animation: inkin2 .38s cubic-bezier(.2,1.6,.4,1) both;
  -webkit-mask-image: radial-gradient(circle at 30% 40%, #000 70%, rgba(0,0,0,.78)); mask-image: radial-gradient(circle at 30% 40%, #000 70%, rgba(0,0,0,.78)); }
@keyframes inkin2 { from { transform: rotate(-4deg) scale(1.8); opacity: 0; } to { transform: rotate(-4deg) scale(1); opacity: 1; } }
.result .dest { margin: 2px 0 0; font-size: 16px; font-weight: 600; }
.result .nums { display: flex; gap: 10px; margin-top: 4px; }
.result .num { flex: 1; padding: 8px 12px; border-radius: 14px; background: rgba(0,0,0,.3); display: flex; align-items: baseline; justify-content: space-between; }
.result .num b { font-size: 30px; font-variant-numeric: tabular-nums; } .result .num span { font-size: 13px; opacity: .8; }
.result .num.errand b { color: var(--errand); } .result .num.spoil b { color: #ff6a5a; }
.result .why { margin: 0; font-size: 14px; opacity: .8; }
.result h2 { margin: 12px 0 2px; font-size: 14px; opacity: .85; font-weight: 700; }
.result ul.known { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.result ul.known li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; font-weight: 800; background: radial-gradient(120% 160% at 20% 0%, #6a1d17, #26090a); border: 1px solid #ff4d3d; box-shadow: 0 0 10px rgba(255,77,61,.35); color: #ffd9d3; }
.result ul.known li.none { background: rgba(0,0,0,.3); border-color: rgba(255,255,255,.3); color: #fff; box-shadow: none; font-size: 20px; justify-content: center; padding: 14px; }
.result .kfrom { font-size: 11px; opacity: .75; font-weight: 500; text-align: right; }
.result .closes { display: flex; flex-direction: column; gap: 8px; }
.result .card.mini { height: auto; min-height: 76px; }
.result .card.mini .body { min-height: 28px; max-height: none; align-items: center; gap: 6px; }
.result .near { font-size: 12px; opacity: .7; }
.result ul.lost { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.result ul.lost li { padding: 5px 12px; border-radius: 12px; background: rgba(0,0,0,.3); border: 1px solid var(--errand); font-weight: 700; }
.result .streak { margin: 8px 0 0; font-size: 13px; opacity: .85; }
.result .savenote { flex: none; margin: 0; padding: 0 18px; min-height: 0; font-size: 12px; opacity: .8; }
.result .actions { flex: none; display: flex; gap: 10px; padding: 8px 14px calc(10px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, transparent, rgba(20,16,44,.9) 40%); }
.result .fb-room { width: 50px; flex: none; }
.result .again { flex: 1.4; height: 56px; border-radius: 28px; border: 0; background: #ffb347; color: #2a1a00; font-size: 18px; font-weight: 800; cursor: pointer; }
.result .actions { gap: 8px; }
.result .sharebox { flex: none; width: calc(100% - 28px); box-sizing: border-box; margin: 6px 14px; font-size: 13px; padding: 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.4); background: rgba(0,0,0,.35); color: #fff; font-family: inherit; line-height: 1.4; height: 9em; resize: none; display: block; }
.replay .pkt { position: absolute; left: 0; top: 56px; z-index: 5; padding: 3px 10px 3px 12px; border-radius: 0 8px 8px 0; background: rgba(8,8,22,.9); color: #ffd23d; font-size: 14px; font-weight: 800; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.replay .pkt[hidden] { display: none; }
.result .asrecv { margin: -4px 0 8px; font-size: 12px; opacity: .75; }
.result ul.mixlist .m-half .mk { background: #ffb347; color: #2a1a00; }
.result .save { flex: 1; height: 56px; border-radius: 28px; border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.12); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; padding: 0 4px; line-height: 1.15; }
.imgview { position: fixed; inset: 0; z-index: 99; background: rgba(0,0,0,.9); display: grid; place-items: center; user-select: auto; -webkit-touch-callout: default; }
.imgview img { max-width: 92vw; max-height: 92vh; -webkit-touch-callout: default; user-select: auto; }
@media (prefers-reduced-motion: reduce) { .confetti, .cf, .seen, .result .stamp { animation: none; } }
.board .sc { display: inline-flex; gap: 6px; align-items: center; font-style: normal; font-size: 16px; font-weight: 800; }
.board .sc i, .board .sc u { font-style: normal; text-decoration: none; }
.board .sc.bump { animation: scbump .5s ease-out; } @keyframes scbump { 30% { transform: scale(1.5); color: #ffd23d; } }
.screen.gl { filter: brightness(1.5); transition: filter .15s; }
.screen.ft::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.35); z-index: 1; }
.final { position: absolute; left: 0; right: 0; top: 30%; z-index: 4; text-align: center; font-size: 56px; font-weight: 900; letter-spacing: .08em; text-shadow: 0 3px 0 #000, 0 0 24px rgba(255,220,100,.8); opacity: 0; transform: scale(.7); transition: opacity .35s, transform .35s cubic-bezier(.2,1.5,.4,1); }
.final.on { opacity: 1; transform: none; }
.result .closes .card.mini .body { min-height: 0; max-height: none; flex-wrap: wrap; align-content: flex-start; }
.result .closes .card.mini { padding-bottom: 8px; }
.result .closes .ck.nx { box-shadow: 0 0 0 1px var(--burn), 0 0 10px rgba(255,77,61,.5); animation: ember 2.6s ease-in-out infinite; }
.result .almost { margin: 4px 0 0; font-size: 12px; color: #ffb4aa; font-weight: 700; }
.result .keep { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 12px 14px; border-radius: 14px; background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.06)); border: 1px solid rgba(255,255,255,.28); }
.result .keep .kl { flex: 1 0 100%; font-size: 12px; opacity: .75; }
.result .keep b { font-size: 22px; } .result .keep .k-score { font-size: 34px; letter-spacing: .06em; }
.result .rlang { position: absolute; right: 10px; top: 6px; display: flex; z-index: 2; }
.result .rlang button { min-width: 44px; height: 44px; background: none; border: 0; color: #fff; font-size: 12px; font-weight: 700; opacity: .5; cursor: pointer; letter-spacing: .05em; }
.result .rlang button.on { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.result .rscroll { position: relative; }

/* 工程7: 問い（残り秒、入力の保留、入れ替わりの動き、時間切れ） */
.sheet .secs { position: absolute; left: 16px; top: 10px; z-index: 1; padding: 2px 10px; border-radius: 12px; background: rgba(0,0,0,.5); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sheet.low .secs { background: #a3281d; }
.sheet.guard .choice { opacity: .5; }
.sheet.swap .scene, .sheet.swap .q, .sheet.swap .choices { animation: qswap .42s ease-out both; }
@keyframes qswap { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.choice.reveal { border-color: #7be8b8; box-shadow: inset 0 0 0 2px #7be8b8; }
.sheet.ng .note { color: #ff8a7a; }

/* 工程7: 結果（理由は1行ずつ、開いた数、目盛りの進み） */
.result .why { display: flex; flex-direction: column; gap: 2px; }
.result .why p { margin: 0; }
.result .opened { margin: 0; font-size: 12px; opacity: .65; }
.result .kgauge { margin-left: auto; font-size: 12px; font-weight: 800; color: #ffb3a8; white-space: nowrap; }
.result .kgauge.full { opacity: .6; font-weight: 500; }
.result ul.known li { flex-wrap: wrap; }
.choice.correct.reveal { background: rgba(255,255,255,.1); border-color: #7be8b8; box-shadow: inset 0 0 0 2px #7be8b8; animation: none; }
#app > .langnote { position: absolute; left: 12px; right: 12px; top: 34px; z-index: 50; padding: 4px 10px; border-radius: 10px; background: rgba(0,0,0,.72); font-size: 11px; line-height: 15px; text-align: center; pointer-events: none; }
#app > .langnote[hidden] { display: none; }
.seen .seen-note { display: block; font-size: 11px; font-weight: 700; margin-top: 2px; letter-spacing: 0; white-space: nowrap; }
#app > .langnote.langnote { position: absolute !important; left: 64px; right: 12px; top: auto; bottom: 10px; }

/* 周回1: 正解の表示は選択肢のすぐ下。選択肢の高さを揃える（左下の札のずれ） */
.sheet .choices { flex: none; padding-bottom: 4px; }
.sheet .choice { box-sizing: border-box; }
.sheet .note { height: 30px; line-height: 30px; margin: 2px 0 0; }
.choice.wrong { animation: wiggle2 .4s; }
@keyframes wiggle2 { 20%, 60% { transform: translateX(-3px); } 40%, 80% { transform: translateX(3px); } }
.choice.wrong { animation: wrongflash .4s; }
@keyframes wrongflash { 30% { filter: brightness(1.5); } }

/* 周回2: 録画の再生を中継の絵にする。絵は tv-pitch/goal/crowd.jpg（届くまでは勾配）。板と字幕は大きく */
.replay .screen { aspect-ratio: 4 / 3; background: #0b1a12; }
.replay .screen::after { background: linear-gradient(120deg, rgba(255,255,255,.1), transparent 30%), radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(0,0,0,.55)); z-index: 1; }
.pic { position: absolute; inset: -6%; opacity: 0; transition: opacity .25s; animation: camdrift 18s ease-in-out both; background-size: cover; background-position: center; }
.screen[data-scene="pitch"] .p-pitch, .screen[data-scene="goal"] .p-goal, .screen[data-scene="crowd"] .p-crowd { opacity: 1; }
@keyframes camdrift { from { transform: scale(1) translateX(-1.5%); } to { transform: scale(1.1) translateX(1.5%); } }
.p-pitch { background-image: radial-gradient(circle at 10% 6%, #fff6cf 0 2%, rgba(255,246,207,0) 14%), radial-gradient(circle at 90% 6%, #fff6cf 0 2%, rgba(255,246,207,0) 14%), radial-gradient(circle, #d9a56b 0 1.2px, transparent 1.7px), linear-gradient(180deg, #17142e, #2b2150 36%, #1f6a3a 37%, #2f9552 100%); background-size: 100% 100%, 100% 100%, 8px 6px, 100% 100%; background-repeat: no-repeat, no-repeat, repeat, no-repeat; }
.p-pitch::after { content: ""; position: absolute; left: 14%; right: 14%; top: 48%; bottom: 14%; border: 2px solid rgba(255,255,255,.55); border-radius: 50% / 40%; }
.p-goal { background-image: radial-gradient(circle at 50% 46%, rgba(255,235,170,.9), rgba(255,170,60,.0) 55%), radial-gradient(circle, #ffd7a0 0 1.4px, transparent 2px), linear-gradient(180deg, #3a1c4a, #7a3a4a 40%, #2f9552 41%, #1d6a3a); background-size: 100% 100%, 8px 6px, 100% 100%; background-repeat: no-repeat, repeat, no-repeat; }
.p-goal::after { content: ""; position: absolute; left: 24%; right: 24%; top: 34%; height: 30%; border: 3px solid rgba(255,255,255,.85); border-bottom: 0; background: repeating-linear-gradient(45deg, rgba(255,255,255,.18) 0 2px, transparent 2px 9px); }
.p-crowd { background-image: radial-gradient(circle at 30% 20%, #ffd23d 0 5px, transparent 6px), radial-gradient(circle at 70% 35%, #ff6b8a 0 5px, transparent 6px), radial-gradient(circle, #ffb36b 0 2px, transparent 2.6px), linear-gradient(180deg, #120f2a, #3a2a58 70%, #6a3d6b); background-size: 100% 100%, 100% 100%, 10px 8px, 100% 100%; background-repeat: no-repeat, no-repeat, repeat, no-repeat; }
.pics-pitch .p-pitch { background-image: url(/assets/tv-pitch.jpg); background-size: cover; } .pics-goal .p-goal { background-image: url(/assets/tv-goal.jpg); background-size: cover; } .pics-crowd .p-crowd { background-image: url(/assets/tv-crowd.jpg); background-size: cover; }
.pics-pitch .p-pitch::before, .pics-pitch .p-pitch::after, .pics-goal .p-goal::before, .pics-goal .p-goal::after, .pics-crowd .p-crowd::before { display: none; }
.has-pics .pic::after { display: none; }
.flash { position: absolute; inset: 0; z-index: 3; background: #fff; opacity: 0; pointer-events: none; }
.flash.on { animation: flashgo .7s ease-out; } @keyframes flashgo { 0% { opacity: .6; } 100% { opacity: 0; } }
.hush { position: absolute; inset: 0; z-index: 3; background: rgba(0,0,0,.55); opacity: 0; transition: opacity .15s; pointer-events: none; }
.hush.on { opacity: 1; }
.screen.shake { animation: scshake .5s ease-out; } @keyframes scshake { 20% { transform: translate(-3px, 2px); } 40% { transform: translate(3px, -2px); } 60% { transform: translate(-2px, 1px); } 80% { transform: translate(1px, 0); } }
.board { left: 0; top: 10px; z-index: 5; gap: 0; align-items: stretch; padding: 0; border-radius: 0 8px 8px 0; background: rgba(8,8,22,.9); box-shadow: 0 2px 10px rgba(0,0,0,.5); font-size: 15px; font-weight: 800; overflow: hidden; }
.board b, .board span { display: flex; align-items: center; padding: 5px 8px; }
.board .chip { width: 6px; padding: 0; } .board .chip.ca { background: var(--ca); } .board .chip.cb { background: var(--cb); }
.board .sc { font-size: 26px; font-weight: 900; padding: 2px 10px; background: #fff; color: #10102a; gap: 6px; transition: background .2s; }
.board .sc.bump { animation: scbump2 .6s ease-out; }
@keyframes scbump2 { 0% { transform: scale(1.3); background: #ffd23d; box-shadow: 0 0 24px #ffd23d; } 60% { transform: scale(1.1); background: #ffd23d; } 100% { transform: scale(1); } }
.board .sc.hold { animation: hold .55s ease-in-out; background: #c8c8d4; } @keyframes hold { 50% { opacity: .45; } }
.board .min { font-size: 13px; font-weight: 700; background: #ffd23d; color: #2a1a00; opacity: 1; font-variant-numeric: tabular-nums; }
.cap { z-index: 4; padding: 8px 12px 8px 14px; font-size: 16px; line-height: 1.3; font-weight: 800; min-height: 38px; border-left: 6px solid var(--ca); background: linear-gradient(90deg, rgba(10,10,28,.92), rgba(10,10,28,.78)); text-shadow: 0 1px 0 #000; }
.final, .big { z-index: 5; }
@media (prefers-reduced-motion: reduce) { .pic, .screen.shake, .flash.on, .board .sc.bump, .board .sc.hold { animation: none; } .flash { display: none; } }

/* 行き先(3)「見られない」: 落とした用事の場所の絵（scenes.jpg）に付箋で物の名前 */
.scene-mode .place { position: absolute; left: 14px; right: 14px; top: 13%; aspect-ratio: 780 / 330; z-index: 1; border-radius: 14px; overflow: hidden; background: #2a2150 url(/assets/scenes.jpg) 0 0 / 100% auto no-repeat; box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.scene-mode .place[data-scene="1"] { background-position: 0 50%; } .scene-mode .place[data-scene="2"] { background-position: 0 100%; }
.scene-mode .place::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,8,24,0) 40%, rgba(10,8,24,.7)); }
.scene-mode .place .where { position: absolute; left: 12px; bottom: 8px; z-index: 1; font-size: 13px; font-weight: 800; letter-spacing: .08em; }
.scene-mode .place .lamp { position: absolute; right: 18px; top: 10px; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle, #ffe9a6, rgba(255,200,90,0) 70%); z-index: 1; }
.scene-mode .sticky { position: absolute; right: 14px; bottom: 14px; z-index: 2; max-width: 55%; padding: 10px 16px; background: #ffe36b; color: #3a2a00; font-size: 24px; font-weight: 900; line-height: 1.2; transform: rotate(4deg) scale(0); box-shadow: 0 6px 14px rgba(0,0,0,.5); animation: stick .5s .2s cubic-bezier(.2,1.6,.4,1) forwards; }
@keyframes stick { to { transform: rotate(4deg) scale(1); } }
.scene-mode .sline { top: auto; bottom: auto; position: absolute; left: 0; right: 0; top: calc(13% + 190px); font-size: 20px; font-weight: 800; text-align: center; padding: 0 16px; opacity: 0; transition: opacity .6s; z-index: 3; }
.scene-mode .sline.on { opacity: 1; }
.scene-mode .ruined { position: absolute; left: 24px; right: 24px; top: calc(13% + 232px); z-index: 3; text-align: center; font-size: 14px; font-weight: 700; color: #ffb4aa; }
.scene-mode .tvwrap { left: 50%; bottom: 20%; width: 150px; height: 100px; margin-left: -75px; border-width: 5px; transition: opacity .6s; }
.scene-mode .nosig { display: flex; position: absolute; inset: 0; justify-content: center; align-items: center; font-size: 11px; font-weight: 800; letter-spacing: .12em; opacity: 0; transition: opacity .6s; }
.scene-mode.dark .nosig { opacity: .9; }
@media (prefers-reduced-motion: reduce) { .scene-mode .sticky { animation: none; transform: rotate(4deg); } }
.p-pitch { background-image: radial-gradient(circle at 10% 6%, #fff6cf 0 2%, rgba(255,246,207,0) 14%), radial-gradient(circle at 90% 6%, #fff6cf 0 2%, rgba(255,246,207,0) 14%), linear-gradient(180deg, #17142e, #2b2150 36%, #1f6a3a 37%, #2f9552 100%); background-size: 100% 100%; background-repeat: no-repeat; }
.p-goal { background-image: radial-gradient(circle at 50% 46%, rgba(255,235,170,.9), rgba(255,170,60,0) 55%), linear-gradient(180deg, #3a1c4a, #7a3a4a 40%, #2f9552 41%, #1d6a3a); background-size: 100% 100%; background-repeat: no-repeat; }
.p-crowd { background-image: radial-gradient(circle at 30% 20%, #ffd23d 0 5px, transparent 6px), radial-gradient(circle at 70% 35%, #ff6b8a 0 5px, transparent 6px), linear-gradient(180deg, #120f2a, #3a2a58 70%, #6a3d6b); background-size: 100% 100%; background-repeat: no-repeat; }
.p-pitch::before, .p-goal::before, .p-crowd::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 37%; opacity: .55; background: radial-gradient(circle, #e0aa70 0 1px, transparent 1.6px) 0 0 / 9px 7px; }
.p-crowd::before { height: 100%; opacity: .4; }
.has-pics .pic::before { display: none; }
.board .tA, .board .tB { padding: 5px 10px; letter-spacing: .04em; }
.scene-mode .tvwrap { width: 200px; height: 130px; margin-left: -100px; bottom: 21%; }
.scene-mode.dark .tvwrap { opacity: .55; } .scene-mode .nosig { font-size: 13px; color: #fff; text-shadow: 0 1px 4px #000; }

/* 周回2: 結果。知った事の重さの種類と目盛りを分ける、上達の記録は下に寄せて「もう1回」の上に置く */
.result .rscroll { gap: 8px; }
.result .modenote { margin: -2px 0 0; padding-right: 96px; font-size: 11px; line-height: 1.4; opacity: .7; }
.result ul.known li { flex-direction: column; align-items: stretch; gap: 3px; }
.result .khead { display: flex; align-items: center; gap: 8px; }
.result .khead .ktext { flex: 1; min-width: 0; font-size: 18px; }
.result .kw { flex: none; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 900; background: #ff4d3d; color: #fff; letter-spacing: .04em; }
.result .kw:empty { display: none; }
.result .kw.w-heavy, .result .kw[class*="heavy"] { background: #d9772b; } .result .kw.w-light { background: #8a6a3a; }
.result .kfrom { text-align: left; }
.result .progress { margin-top: auto; padding-top: 10px; }
.result .progress h2 { margin-top: 4px; }
.result .pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.result .ptile { position: relative; padding: 8px 12px; border-radius: 12px; background: rgba(0,0,0,.3); display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.result .ptile .pl { font-size: 11px; opacity: .75; } .result .ptile .pv { font-size: 22px; font-variant-numeric: tabular-nums; } .result .ptile .ps { font-size: 11px; opacity: .65; }
.result .ptile.new { background: linear-gradient(180deg, rgba(255,210,61,.25), rgba(0,0,0,.3)); box-shadow: 0 0 0 1px #ffd23d; }
.result .pnew { position: absolute; right: 8px; top: 8px; padding: 1px 8px; border-radius: 999px; background: #ffd23d; color: #2a1a00; font-size: 11px; font-style: normal; font-weight: 900; animation: scbump2 .6s ease-out; }
@media (prefers-reduced-motion: reduce) { .result .pnew { animation: none; } }
/* 360×640 でも「もう1回」の近くに上達の記録が見えるよう、縦を詰める */
.result .rscroll { padding-top: 14px; }
.result .modenote { padding-right: 90px; }
.result .num { padding: 6px 12px; } .result .num b { font-size: 26px; }
.result .progress { padding-top: 4px; } .result .progress h2 { margin: 4px 0 4px; }
.result .pgrid { gap: 6px; }
.result .ptile { display: grid; grid-template-columns: 1fr auto; align-items: baseline; padding: 6px 10px; gap: 0 6px; }
.result .ptile .pl { grid-column: 1 / -1; } .result .ptile .pv { font-size: 18px; } .result .ptile .ps { text-align: right; }
.result .pnew { position: static; grid-column: 1 / -1; justify-self: start; margin-top: 2px; }
.result .ptile.new .pl { padding-right: 0; }
.result .pnew { position: absolute; right: 8px; top: 6px; margin: 0; grid-column: auto; }
.result .ptile { padding: 5px 10px; } .result .ptile .pl { font-size: 10px; }
.result .rscroll { gap: 6px; } .result .opened { margin-top: -2px; } .result h2 { margin-top: 8px; }

/* 周回3: 結果の1画面目。称号、数、守った結末、上達の記録を「もう1回」の上に。知った事 0件は1行 */
.result .rscroll { gap: 5px; }
.result .newrec { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.result .newrec .nr { padding: 2px 10px; border-radius: 999px; background: #ffd23d; color: #2a1a00; font-size: 12px; font-weight: 900; animation: scbump2 .6s ease-out; }
.result .knownrow { margin: 4px 0 0; padding: 7px 12px; border-radius: 12px; background: rgba(0,0,0,.3); display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; opacity: .9; }
.result .knownrow b { font-size: 16px; }
.result .keep { padding: 6px 12px; gap: 0 10px; }
.result .keep .kl { font-size: 11px; } .result .keep b { font-size: 18px; } .result .keep .k-score { font-size: 26px; }
.result .progress { margin-top: 2px; padding-top: 0; }
.result .pnote { margin: 4px 0 0; font-size: 10px; line-height: 1.35; opacity: .6; }
.result .mixrow h2 { margin-top: 8px; }
.result ul.mixlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.result ul.mixlist li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: rgba(0,0,0,.3); font-size: 14px; font-weight: 700; }
.result ul.mixlist .mk { flex: none; width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 50%; font-style: normal; font-size: 13px; font-weight: 900; }
.result ul.mixlist .m-yes .mk { background: #3ed6c0; color: #06241f; } .result ul.mixlist .m-no .mk { background: #ff4d3d; color: #fff; } .result ul.mixlist .m-skip { opacity: .7; } .result ul.mixlist .m-skip .mk { background: rgba(255,255,255,.25); }
.result .modenote { padding-right: 0; margin-top: 6px; }
.result .pnew { display: none; }

/* 周回3: 再生。クリアした回の「録画再生中」、得点でない出来事の字幕とカメラ、最後の笛の板の光、守り切った結末、部屋の光、得点の絵の左右 */
.replay .rec { position: absolute; right: 8px; top: 10px; z-index: 5; display: flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 4px; background: rgba(8,8,22,.78); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.replay .rec[hidden] { display: none; }
.replay .rec i { width: 8px; height: 8px; border-radius: 50%; background: #ff4d3d; animation: recblink 1.2s steps(1) infinite; }
.replay .rec em { font-style: normal; font-variant-numeric: tabular-nums; opacity: .85; }
@keyframes recblink { 50% { opacity: .15; } }
.replay.cleared .recap { font-size: 14px; font-weight: 800; opacity: .95; color: #ffd98a; letter-spacing: .08em; }
.replay .cap[data-ev="chance"] { border-left-color: #ffd23d; }
.replay .screen .pic { transition: opacity .25s, transform-origin .7s ease-in-out; }
/* カメラの寄り: 倍率は 1 以上だけ（1 → 1.12 → 1）。絵は枠より 8% 大きく置き、寄りの原点は枠の内側（8〜92%）に限る。寄りは得点の絵（左右反転あり）には掛けない */
.replay .screen .pic { inset: -8%; }
.replay .screen[data-cam="home"] .pic:not(.p-goal) { transform-origin: 8% 62%; } .replay .screen[data-cam="away"] .pic:not(.p-goal) { transform-origin: 92% 62%; }
.replay .screen[data-cam] .pic:not(.p-goal) { animation-name: camdrift, camlean; animation-duration: 18s, 1.6s; animation-fill-mode: both, none; }
@keyframes camlean { from { scale: 1; } 50% { scale: 1.12; } to { scale: 1; } }
.p-goal { scale: var(--gs, 1) var(--gz, 1); translate: var(--gx, 0) var(--gy, 0); }
.board.lit { animation: boardlit 1.6s ease-in-out infinite; }
@keyframes boardlit { 50% { box-shadow: 0 0 22px 4px rgba(255,217,138,.85); } }
.replay .floorlight { position: absolute; left: 4%; right: 4%; top: 100%; height: 150px; margin-top: 2px; z-index: -1; pointer-events: none; background: radial-gradient(ellipse 60% 100% at 50% 0, rgba(120,225,160,.34), rgba(120,225,160,0) 72%); filter: blur(6px); animation: hintpulse 2.4s infinite; }
.replay .kept { position: absolute; left: 0; right: 0; top: 100%; margin: 26px 0 0; z-index: 2; text-align: center; font-size: 19px; font-weight: 900; line-height: 1.4; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.8); opacity: 0; transform: translateY(8px); transition: opacity .5s, transform .5s; }
.replay .kept.on { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .replay .rec i, .board.lit, .replay .floorlight { animation: none; } }
.replay .kept { text-wrap: balance; font-size: 18px; padding: 0 10px; }
.replay .rec { top: auto; bottom: 46px; right: 8px; }
.result .pnote, .result .modenote { text-wrap: balance; }
