:root {
  --bg: #16110d;
  --panel: rgba(30, 23, 18, 0.92);
  --panel2: #2a201a;
  --line: #4a3a2e;
  --text: #f1e7d6;
  --dim: #a8967f;
  --paper: #f3ead8;
  --ink: #2a1e16;
  --red: #b8342a;
  --red2: #8e2219;
  --gold: #e0b45a;
  --green: #8fbf7a;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
  --sans: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif;
}
html { font-size: 16px; }
html.fz1 { font-size: 18.4px; }
html.fz2 { font-size: 20.8px; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); overflow: hidden; }
body { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.dim { color: var(--dim); }
img { -webkit-user-drag: none; }

#stage {
  position: relative; height: 100%; height: 100dvh; max-width: 460px; margin: 0 auto; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 0%, #2a1f17 0%, var(--bg) 70%);
}
@media (min-width: 600px) { #stage { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
.screen {
  position: absolute; inset: 0; display: none; flex-direction: column; gap: 0.55rem;
  padding: max(10px, env(safe-area-inset-top)) 14px max(12px, env(safe-area-inset-bottom));
}
.screen.on { display: flex; animation: fadein .35s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ボタン */
.btn {
  font: inherit; font-size: 1rem; color: var(--text); background: var(--panel2); border: 1px solid var(--line);
  border-radius: 10px; padding: 0.7rem 1rem; cursor: pointer; font-weight: 700; line-height: 1.3;
}
.btn small { display: block; font-size: 0.8rem; font-weight: 400; opacity: .85; margin-top: 0.1rem; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(#c63d31, #8e2219); border-color: #e0685c; color: #fff; }
.btn.big { font-size: 1.15rem; padding: 0.85rem 1rem; }
.btn.ghost { background: rgba(0, 0, 0, .25); }
.btn:disabled { opacity: .35; cursor: default; }
.linkbtn { font: inherit; font-size: 0.9rem; background: none; border: 0; color: var(--dim); text-decoration: underline; cursor: pointer; padding: 0.3rem; }

/* タイトル */
#title { padding: 0; }
.t-bg { position: absolute; inset: 0; }
.t-bg img { width: 100%; height: 100%; object-fit: cover; }
.t-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(22, 17, 13, .1) 20%, rgba(22, 17, 13, .55) 55%, rgba(22, 17, 13, .96) 85%); }
.t-in { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; text-align: center; gap: 0.8rem; padding: max(16px, env(safe-area-inset-top)) 18px max(16px, env(safe-area-inset-bottom)); overflow-y: auto; }
.t-name { margin: 0; font-family: var(--serif); font-size: 3rem; letter-spacing: 0.2em; text-shadow: 0 2px 14px rgba(0, 0, 0, .8); }
.t-lead { margin: 0; font-family: var(--serif); font-size: 1.1rem; line-height: 1.9; text-shadow: 0 1px 8px rgba(0, 0, 0, .9); }
.t-btns { display: flex; flex-direction: column; gap: 0.55rem; width: 100%; max-width: 330px; align-items: stretch; }
.t-row { display: flex; gap: 0.5rem; }
.t-row .btn { flex: 1; font-size: 0.95rem; padding: 0.6rem 0.4rem; }
.t-font { display: flex; align-items: center; justify-content: center; gap: 0.35rem; font-size: 0.9rem; color: var(--dim); }
.fz { font: inherit; font-size: 0.9rem; background: rgba(0, 0, 0, .3); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 0.35rem 0.6rem; cursor: pointer; }
.fz.on { border-color: var(--gold); color: var(--gold); }
.t-brand { font-size: 0.8rem; color: var(--dim); letter-spacing: 0.1em; }

/* 場面の絵 */
.scene { position: relative; flex: none; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 3 / 2; max-height: 42vh; background: #000; }
.scene img { width: 100%; height: 100%; object-fit: cover; display: block; }
.date-tag { position: absolute; left: 0.6rem; top: 0.6rem; background: rgba(22, 17, 13, .82); border: 1px solid var(--line); border-radius: 6px; padding: 0.25rem 0.6rem; font-family: var(--serif); font-size: 1rem; }

/* 独り言 */
.mono-box { position: relative; flex: none; display: flex; gap: 0.6rem; align-items: flex-end; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0.6rem 0.75rem 0.6rem 0.4rem; min-height: 6.2rem; }
.mono-box.big { flex: 1 1 auto; align-items: center; min-height: 0; }
.face { width: 5.2rem; height: 6.5rem; object-fit: cover; object-position: top; flex: none; border-radius: 8px; background: radial-gradient(#3a2c22, #1e1712); }
.mono-box.big .face { width: 6.4rem; height: 8rem; }
.mono-text { margin: 0; font-family: var(--serif); font-size: 1.12rem; line-height: 1.75; flex: 1; align-self: center; }
.mono-text.in { animation: textin .35s ease; }
@keyframes textin { from { opacity: 0; transform: translateY(4px); } }
.foot-hint { flex: none; text-align: center; color: var(--dim); font-size: 0.9rem; }
#morning { cursor: pointer; }

/* 上の帯：時刻・財布 */
.bar { flex: none; display: flex; justify-content: space-between; align-items: baseline; gap: 0.4rem; font-size: 0.9rem; white-space: nowrap; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 8px; padding: 0.35rem 0.7rem; }
.bar b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.bar .warn { color: #ff8a70; }

/* 商店街 */
.s-head { flex: none; font-family: var(--serif); font-size: 1.1rem; }
.s-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 0.6rem; padding-bottom: 0.4rem; }
.shop { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; flex: none; }
.shop-img { position: relative; aspect-ratio: 16 / 7; overflow: hidden; }
.shop-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-name { position: absolute; left: 0.5rem; bottom: 0.45rem; background: rgba(22, 17, 13, .85); border-radius: 6px; padding: 0.2rem 0.55rem; font-family: var(--serif); font-size: 1.15rem; }
.shop-name small { font-family: var(--sans); font-size: 0.8rem; color: var(--dim); margin-left: 0.3rem; }
.shop-body { padding: 0.5rem 0.7rem 0.6rem; display: flex; flex-direction: column; gap: 0.45rem; }
.shop-face { font-family: var(--serif); font-size: 1rem; line-height: 1.6; }
.shop-peek { font-family: var(--serif); font-size: 1rem; line-height: 1.65; background: rgba(224, 180, 90, .09); border-left: 3px solid var(--gold); padding: 0.35rem 0.55rem; border-radius: 0 6px 6px 0; }
.shop-btns { display: flex; gap: 0.5rem; }
.shop-btns .btn { flex: 1; padding: 0.6rem 0.4rem; font-size: 0.98rem; }

/* 注文 */
.o-head { flex: none; font-size: 0.85rem; line-height: 1.4; }
.o-head b { font-family: var(--serif); font-size: 1.2rem; }
.o-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: max-content; gap: 0.5rem; align-content: start; padding-bottom: 0.3rem; }
.fuda { position: relative; background: var(--paper); color: var(--ink); border-radius: 8px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; border: 2px solid transparent; }
.fuda img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.fuda .f-txt { padding: 0.3rem 0.45rem 0.4rem; display: flex; justify-content: space-between; align-items: baseline; gap: 0.3rem; }
.fuda .f-name { font-family: var(--serif); font-weight: 700; font-size: 1rem; line-height: 1.3; }
.fuda .f-price { font-size: 0.9rem; white-space: nowrap; }
.fuda.on { border-color: var(--red); box-shadow: 0 0 0 2px rgba(184, 52, 42, .35); }
.fuda .f-cnt { position: absolute; top: 0.35rem; right: 0.35rem; background: var(--red); color: #fff; border-radius: 999px; min-width: 1.7rem; height: 1.7rem; line-height: 1.7rem; text-align: center; font-weight: 700; font-size: 0.95rem; display: none; }
.fuda.on .f-cnt { display: block; }
.fuda.off { opacity: .45; }
.o-foot { flex: none; display: flex; flex-direction: column; gap: 0.4rem; }
.o-sum { display: flex; justify-content: space-between; font-size: 1rem; }
.o-sum b { font-size: 1.15rem; }
.o-hint { font-family: var(--serif); font-size: 1rem; min-height: 1.5rem; }

/* 腹の見込み */
.belly { flex: none; display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.bl-name { flex: none; color: var(--dim); }
.bl-bar { position: relative; flex: 1; height: 0.9rem; background: #2c221b; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.bl-band { position: absolute; top: 0; bottom: 0; background: rgba(143, 191, 122, .35); border-left: 1px dashed var(--green); border-right: 1px dashed var(--green); }
.bl-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--gold); transition: width .3s; opacity: .85; }
.bl-fill.over { background: #e0685c; }

/* 食べる */
.eat-view { position: relative; flex: 1 1 auto; min-height: 8rem; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #0e0a08; }
.eat-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .25s; }
.eat-img.dim { filter: brightness(.45); }
.eat-name { position: absolute; left: 0.55rem; bottom: 0.5rem; background: rgba(22, 17, 13, .82); border-radius: 6px; padding: 0.2rem 0.55rem; font-family: var(--serif); font-size: 1rem; }
.word { position: absolute; right: 0.7rem; top: 0.5rem; font-family: var(--serif); font-weight: 800; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .9), 0 0 2px #000; opacity: 0; pointer-events: none; }
.word.s0 { font-size: 1.4rem; color: #cbbba5; }
.word.s1 { font-size: 1.8rem; }
.word.s2 { font-size: 2.3rem; }
.word.s3 { font-size: 2.9rem; color: #ffe2a0; }
.word.s4 { font-size: 3.6rem; color: #ffd36b; }
.word.pop { animation: pop 1.3s ease forwards; }
@keyframes pop { 0% { opacity: 0; transform: scale(1.6); } 15% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; } }
.word.s4.pop { animation: pop4 1.6s ease forwards; }
@keyframes pop4 { 0% { opacity: 0; transform: scale(2.2) rotate(-6deg); } 15% { opacity: 1; transform: scale(1) rotate(-3deg); } 80% { opacity: 1; } 100% { opacity: 0; } }

.tray { flex: none; display: flex; gap: 0.45rem; overflow-x: auto; padding: 0.1rem 0 0.2rem; scrollbar-width: none; }
.tray::-webkit-scrollbar { display: none; }
.plate { position: relative; flex: 1 0 0; min-width: 5.3rem; max-width: 7rem; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.plate img { width: 100%; height: 4.6rem; object-fit: cover; display: block; }
.plate .p-name { font-size: 0.85rem; line-height: 1.25; padding: 0.2rem 0.3rem 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate .p-left { display: flex; gap: 2px; padding: 0.2rem 0.3rem 0.3rem; flex-wrap: wrap; }
.plate .p-left i { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--gold); display: block; }
.plate .p-left i.e { background: #4a3a2e; }
.plate .p-cond { font: inherit; font-size: 0.8rem; margin: 0 0.3rem 0.3rem; padding: 0.3rem 0.2rem; border-radius: 6px; border: 1px dashed var(--gold); background: rgba(224, 180, 90, .1); color: var(--gold); cursor: pointer; line-height: 1.2; }
.plate .p-cond.used { border-style: solid; opacity: .5; cursor: default; }
.plate.wait { opacity: .5; cursor: default; }
.plate.wait .p-w { position: absolute; left: 0; right: 0; top: 1.4rem; text-align: center; font-size: 0.85rem; font-weight: 700; text-shadow: 0 1px 4px #000; }
.plate.done { opacity: .35; cursor: default; }
.plate.hot::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4.6rem; background: linear-gradient(transparent 60%, rgba(255, 255, 255, .0)); }
.plate.bump { animation: bump .25s ease; }
@keyframes bump { 50% { transform: scale(.94); } }
.t-acts { flex: none; display: flex; gap: 0.45rem; }
.t-acts .btn { flex: 1; padding: 0.6rem 0.3rem; font-size: 0.95rem; }

/* 結果 */
.r-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 0.6rem; text-align: center; padding: 0.4rem 0.2rem; }
.r-day { color: var(--dim); font-size: 0.95rem; }
.r-shop { font-family: var(--serif); font-size: 1.1rem; }
.r-rank { margin: 0; font-family: var(--serif); font-size: 2rem; letter-spacing: 0.08em; color: var(--gold); }
.r-line { font-family: var(--serif); font-size: 1.05rem; line-height: 1.7; }
.r-score b { font-size: 2.6rem; font-variant-numeric: tabular-nums; }
.r-score span { margin-left: 0.2rem; color: var(--dim); }
.r-parts { display: flex; flex-direction: column; gap: 0.4rem; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.7rem; }
.rp { display: grid; grid-template-columns: 6.2rem 1fr 2.4rem; align-items: center; gap: 0.5rem; font-size: 0.95rem; }
.rp-bar { height: 0.7rem; background: #2c221b; border-radius: 4px; overflow: hidden; }
.rp-bar i { display: block; height: 100%; background: var(--gold); }
.rp b { text-align: right; font-variant-numeric: tabular-nums; }
.r-comments { display: flex; flex-direction: column; gap: 0.35rem; text-align: left; }
.rc { font-family: var(--serif); font-size: 1rem; line-height: 1.6; padding-left: 1.4rem; position: relative; }
.rc::before { position: absolute; left: 0; top: 0; }
.rc.g::before { content: "○"; color: var(--green); }
.rc.b::before { content: "△"; color: #e0907c; }
.r-meal { font-size: 0.9rem; color: var(--dim); line-height: 1.6; }
.r-acts { flex: none; display: flex; flex-direction: column; gap: 0.45rem; }
.r-row { display: flex; gap: 0.45rem; }
.r-row .btn { flex: 1; font-size: 0.95rem; padding: 0.6rem 0.3rem; }

/* 手帳 */
.bk-head { flex: none; font-family: var(--serif); font-size: 1.4rem; text-align: center; }
.bk-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 0.5rem; }
.bk { background: var(--paper); color: var(--ink); border-radius: 8px; padding: 0.6rem 0.75rem; font-family: var(--serif); line-height: 1.6; }
.bk .bk-top { display: flex; justify-content: space-between; font-size: 0.95rem; }
.bk .bk-rank { font-weight: 700; font-size: 1.1rem; }
.bk .bk-items { font-size: 0.9rem; }
.bk-empty { color: var(--dim); text-align: center; padding: 2rem 0; font-family: var(--serif); }

/* シート（追加注文・確認） */
.sheet { position: absolute; inset: 0; z-index: 40; background: rgba(0, 0, 0, .55); display: none; align-items: flex-end; }
.sheet.on { display: flex; }
.sheet-in { width: 100%; max-height: 75%; overflow-y: auto; background: var(--panel2); border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; padding: 0.9rem 14px max(14px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 0.5rem; }
.sheet-in h3 { margin: 0; font-family: var(--serif); font-size: 1.15rem; }
.sheet-in p { margin: 0; font-family: var(--serif); line-height: 1.7; }
.add-row { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 8px; padding: 0.55rem 0.7rem; font-size: 1rem; cursor: pointer; }
.add-row.off { opacity: .4; cursor: default; }

/* 案内 */
.hint { position: absolute; left: 14px; right: 14px; top: max(10px, env(safe-area-inset-top)); z-index: 30; display: none; gap: 0.5rem; align-items: flex-start; background: #2e241c; border: 1px solid var(--gold); border-radius: 10px; padding: 0.6rem 0.7rem; font-size: 0.95rem; line-height: 1.55; }
.hint.on { display: flex; }
.hint button { flex: none; background: none; border: 0; color: var(--text); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0 0.2rem; }
#rotate { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; text-align: center; background: var(--bg); padding: 1.5rem; font-size: 1.1rem; line-height: 1.7; }
#rotate small { color: var(--dim); font-size: 0.9rem; }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) { #rotate { display: flex; } }

/* 縦が短い画面では詰める */
@media (max-height: 700px) {
  .face { width: 4.4rem; height: 5.5rem; }
  .mono-box { min-height: 5.4rem; }
  .mono-text { font-size: 1.05rem; line-height: 1.65; }
  .plate img { height: 3.9rem; }
}
html.fz2 .o-list { grid-template-columns: 1fr; }
html.fz1 .bar .lbl, html.fz2 .bar .lbl { display: none; }
html.fz2 .bar b { font-size: 1.05rem; }
img.noimg { visibility: hidden; }

/* ===== リアクションの演出 ===== */
#fx { position: absolute; inset: 0; z-index: 35; pointer-events: none; overflow: hidden; display: none; }
#fx.on { display: block; }
#fx > div { position: absolute; inset: 0; opacity: 0; }
/* 集中線 */
#fxLines {
  background: repeating-conic-gradient(from 0deg at 50% 38%, rgba(255, 255, 255, 0) 0deg 4deg, rgba(255, 250, 230, .75) 4deg 4.7deg, rgba(255, 255, 255, 0) 4.7deg 9deg);
  -webkit-mask: radial-gradient(circle at 50% 38%, transparent 22%, #000 62%); mask: radial-gradient(circle at 50% 38%, transparent 22%, #000 62%);
}
#fx.lv3 #fxLines { animation: lines 1.1s ease-out forwards; }
#fx.lv4 #fxLines { animation: lines 1.8s ease-out forwards; }
@keyframes lines { 0% { opacity: 0; transform: scale(1.4) rotate(0deg); } 12% { opacity: 1; transform: scale(1) rotate(2deg); } 75% { opacity: .9; } 100% { opacity: 0; transform: scale(1) rotate(6deg); } }
/* 後光（最高の一口） */
#fx > #fxBurst { inset: -60%; background: repeating-conic-gradient(from 0deg at 50% 50%, #ffcf4a 0deg 10deg, #ff8a2a 10deg 20deg); }
#fx.lv4 #fxBurst { animation: burst 1.8s ease-out forwards; }
@keyframes burst { 0% { opacity: 0; transform: rotate(0deg) scale(.6); } 10% { opacity: .92; } 70% { opacity: .85; } 100% { opacity: 0; transform: rotate(40deg) scale(1.1); } }
/* 色の幕 */
#fxTint { background: radial-gradient(circle at 50% 40%, rgba(255, 210, 120, .35), rgba(120, 40, 10, .55)); }
#fx.lv3 #fxTint { animation: fade1 1.1s ease forwards; }
#fx.sad #fxTint { background: rgba(40, 40, 50, .55); animation: fade1 1.4s ease forwards; }
#fx.cold #fxTint { background: radial-gradient(circle, transparent 35%, rgba(120, 190, 255, .55)); animation: fade1 1.4s ease forwards; }
#fx.full #fxTint { background: radial-gradient(circle, transparent 30%, rgba(160, 200, 90, .45)); animation: fade1 1.4s ease forwards; }
@keyframes fade1 { 0% { opacity: 0; } 15% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
/* 白い光 */
#fxFlash { background: #fff; }
#fx.lv4 #fxFlash { animation: flash .6s ease-out forwards; }
#fx.lv3 #fxFlash { animation: flash3 .35s ease-out forwards; }
@keyframes flash { 0% { opacity: .95; } 100% { opacity: 0; } }
@keyframes flash3 { 0% { opacity: .5; } 100% { opacity: 0; } }
/* 顔の割り込み（旨い！） */
#fx > #fxCut { inset: auto 0 auto 0; top: 18%; height: 30%; }
#fx.lv3 #fxCut { animation: cut 1.15s cubic-bezier(.2, .9, .3, 1) forwards; }
@keyframes cut { 0% { opacity: 1; transform: translateX(110%) skewY(-7deg); } 16% { transform: translateX(0) skewY(-7deg); } 78% { opacity: 1; transform: translateX(-3%) skewY(-7deg); } 100% { opacity: 0; transform: translateX(-110%) skewY(-7deg); } }
.cut-band { position: absolute; inset: 0; background: linear-gradient(100deg, #8e2219 0%, #c63d31 45%, #e0b45a 100%); border-top: 4px solid #fff3c4; border-bottom: 4px solid #fff3c4; box-shadow: 0 0 30px rgba(0, 0, 0, .6); overflow: hidden; display: flex; align-items: center; }
.cut-band img { height: 135%; margin-left: -4%; align-self: flex-start; transform: skewY(7deg) translateY(-2%); filter: drop-shadow(6px 0 0 rgba(0, 0, 0, .35)); }
.cut-word { flex: 1; text-align: center; font-family: var(--serif); font-weight: 900; font-size: 2.7rem; white-space: nowrap; color: #fff; transform: skewY(7deg); text-shadow: 0 0 2px #000, 4px 4px 0 #5a120c, 0 0 24px rgba(255, 220, 120, .9); letter-spacing: 0.04em; line-height: 1.1; padding-right: 0.4rem; }
/* 画面いっぱい（至福） */
#fxBig { display: flex; align-items: flex-end; justify-content: center; }
#fx.lv4 #fxBig { animation: big 1.8s ease-out forwards; }
@keyframes big { 0% { opacity: 0; transform: scale(1.5); } 12% { opacity: 1; transform: scale(1); } 78% { opacity: 1; transform: scale(1.04); } 100% { opacity: 0; transform: scale(1.1); } }
#fxBig img { position: absolute; bottom: 0; left: 50%; width: 92%; max-width: 420px; transform: translateX(-50%); filter: drop-shadow(0 0 30px rgba(255, 240, 180, .9)); }
.big-word { position: absolute; top: 6%; left: 50%; transform: translateX(-50%); writing-mode: vertical-rl; font-family: var(--serif); font-weight: 900; font-size: 5.6rem; color: #fff; letter-spacing: 0.1em; text-shadow: 0 0 3px #000, 6px 6px 0 #8e2219, 0 0 40px #fff2b0; white-space: nowrap; }
/* 歯車（組み合わせが噛み合った） */
#fxGears svg { position: absolute; fill: #f0d080; filter: drop-shadow(0 0 8px rgba(255, 220, 120, .9)); }
#fx.pair #fxGears { animation: fade1 1.6s ease forwards; }
#fxGears svg.g1 { width: 46%; left: -8%; top: 4%; animation: spin 1.6s linear infinite; }
#fxGears svg.g2 { width: 34%; left: 30%; top: 26%; animation: spin 1.2s linear infinite reverse; }
#fxGears svg.g3 { width: 40%; right: -6%; top: 1%; animation: spin 1.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* 粒 */
#fxParts { opacity: 1 !important; }
.pt { position: absolute; left: 50%; top: 40%; font-size: 1.6rem; color: #ffe08a; text-shadow: 0 0 10px #ffb02e; animation: pt var(--t, 1s) ease-out forwards; }
.pt.drop { color: #9fd0ff; text-shadow: 0 0 6px #3a7bd5; animation: drop 1.3s ease-in forwards; }
@keyframes pt { 0% { transform: translate(-50%, -50%) scale(.4); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.2) rotate(var(--r)); opacity: 0; } }
@keyframes drop { 0% { transform: translate(-50%, -60px); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(-50%, 160px); opacity: 0; } }
/* 小さな段階の文字の飛び出し */
.word.pop2 { animation: pop2 1.2s cubic-bezier(.2, 1.6, .4, 1) forwards; }
@keyframes pop2 { 0% { opacity: 0; transform: scale(2.4) rotate(-12deg); } 18% { opacity: 1; transform: scale(1) rotate(-4deg); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1.1) rotate(-4deg); } }
/* 揺れ */
.shake1 { animation: shake1 .35s linear; }
.shake2 { animation: shake2 .6s linear; }
@keyframes shake1 { 25% { transform: translate(4px, -3px); } 50% { transform: translate(-4px, 3px); } 75% { transform: translate(3px, 2px); } }
@keyframes shake2 { 10% { transform: translate(10px, -6px) rotate(.6deg); } 25% { transform: translate(-10px, 6px) rotate(-.6deg); } 40% { transform: translate(8px, 4px); } 60% { transform: translate(-6px, -4px); } 80% { transform: translate(3px, 2px); } }
.wobble { animation: wobble .9s ease; }
@keyframes wobble { 25% { transform: scale(1.03, .97); } 50% { transform: scale(.97, 1.03); } 75% { transform: scale(1.02, .98); } }
.eat-img.zoom { animation: zoom .9s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes zoom { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
.eat-img.sad { filter: grayscale(.8) brightness(.7); transition: filter .4s; }
.pt.ice { color: #cfe9ff; text-shadow: 0 0 10px #5aa8ff; }

/* ===== コメントを派手に ===== */
.mono-text .ch { display: inline-block; opacity: 0; animation: chin .28s cubic-bezier(.2, 1.8, .4, 1) forwards; }
@keyframes chin { 0% { opacity: 0; transform: translateY(-.5em) scale(1.8); } 100% { opacity: 1; transform: none; } }
.mono-text em.key { font-style: normal; font-weight: 800; color: #ffe08a; font-size: 1.12em; text-shadow: 0 0 10px rgba(255, 190, 70, .65), 2px 2px 0 #5a120c; }
.mono-box.slam { animation: slam .42s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes slam { 0% { transform: scale(1.12) rotate(-1.2deg); } 60% { transform: scale(.98) rotate(.4deg); } 100% { transform: none; } }
.mono-box { transition: border-color .3s, box-shadow .3s, background .3s; }
.mono-box.b0 { border-color: #6b7c99; background: linear-gradient(rgba(30, 34, 48, .95), rgba(22, 20, 26, .95)); }
.mono-box.b0 em.key { color: #b9d4ff; text-shadow: 0 0 8px rgba(90, 150, 255, .6), 2px 2px 0 #1b2440; }
.mono-box.b0.slam { animation: slambad .5s ease; }
@keyframes slambad { 15% { transform: translateX(-7px) rotate(-1deg); } 35% { transform: translateX(6px) rotate(1deg); } 55% { transform: translateX(-4px); } 75% { transform: translateX(3px); } }
.mono-box.b2 { border-color: #a8834a; }
.mono-box.b3 { border: 2px solid #e0b45a; background: linear-gradient(135deg, rgba(90, 30, 18, .96), rgba(40, 26, 16, .96)); box-shadow: 0 0 18px rgba(224, 180, 90, .45); }
.mono-box.b4 { border: 3px solid #ffd36b; background: linear-gradient(135deg, #8e2219, #4a1a10 60%, #6b3d12); box-shadow: 0 0 28px rgba(255, 200, 90, .8), inset 0 0 20px rgba(255, 220, 120, .25); }
.mono-box.b4 .mono-text { font-size: 1.2rem; }
.mono-box.b4 em.key { color: #fff6c8; font-size: 1.25em; text-shadow: 0 0 14px #ffc94a, 3px 3px 0 #5a120c; }
.mono-box.b4.slam { animation: slam4 .6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes slam4 { 0% { transform: scale(1.3) rotate(-3deg); filter: brightness(2); } 50% { transform: scale(.96) rotate(1deg); } 100% { transform: none; filter: none; } }
.face.facepop { animation: facepop .45s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes facepop { 0% { transform: scale(1.35) rotate(-6deg); } 100% { transform: none; } }
.mono-box.big .mono-text { font-size: 1.2rem; }

/* 結果の講評 */
.r-rank.stamp-in { animation: rstamp .7s cubic-bezier(.2, 1.6, .4, 1) .2s backwards; }
@keyframes rstamp { 0% { opacity: 0; transform: scale(3.2) rotate(-14deg); } 60% { opacity: 1; transform: scale(.92) rotate(-3deg); } 100% { transform: rotate(-3deg); } }
.r-rank { display: inline-block; align-self: center; transform: rotate(-3deg); border: 3px solid var(--gold); border-radius: 10px; padding: 0.1rem 0.8rem; text-shadow: 0 0 14px rgba(255, 200, 90, .6), 3px 3px 0 #5a120c; }
#result.great .r-rank { font-size: 2.6rem; color: #fff6c8; background: linear-gradient(135deg, #8e2219, #c63d31); box-shadow: 0 0 30px rgba(255, 200, 90, .8); }
#result.great { background: radial-gradient(120% 70% at 50% 20%, rgba(255, 190, 70, .28), transparent 70%); }
#result.good .r-rank { font-size: 2.3rem; }
.r-score b { display: inline-block; font-size: 3.4rem; color: #fff; text-shadow: 0 0 18px rgba(255, 200, 90, .7); }
.r-score.done b { animation: scorepop .5s cubic-bezier(.2, 1.8, .4, 1); color: #ffe08a; }
@keyframes scorepop { 0% { transform: scale(1.8); } 100% { transform: none; } }
.rp-bar i { transition: width .9s cubic-bezier(.2, .9, .3, 1); }
.rc { opacity: 0; animation: rcin .5s cubic-bezier(.2, 1.6, .4, 1) forwards; font-size: 1.08rem; padding: 0.35rem 0.5rem 0.35rem 1.9rem; border-radius: 8px; }
.rc::before { left: 0.5rem; top: 0.35rem; font-weight: 900; }
.rc.g { background: linear-gradient(90deg, rgba(224, 180, 90, .22), transparent); border-left: 4px solid var(--gold); font-weight: 700; color: #fff3cf; text-shadow: 0 0 8px rgba(255, 200, 90, .35); }
.rc.b { background: linear-gradient(90deg, rgba(110, 140, 200, .2), transparent); border-left: 4px solid #7d93c4; }
@keyframes rcin { 0% { opacity: 0; transform: translateX(40px) scale(1.15); } 100% { opacity: 1; transform: none; } }
.rc.b { animation-name: rcinb; }
@keyframes rcinb { 0% { opacity: 0; transform: translateY(-14px); } 50% { opacity: 1; transform: translateX(-5px); } 75% { transform: translateX(4px); } 100% { opacity: 1; transform: none; } }
.r-line { font-size: 1.15rem; font-weight: 700; color: #fff3cf; }
.mono-text .ch { white-space: nowrap; }
