/* ステーキシミュレーター：上6割が3D、下が段階ごとの操作パネル。スマホ縦・片手が主 */
:root {
  --bg: #151110;
  --surface: #1f1a18;
  --surface-2: #2a2321;
  --surface-3: #352c29;
  --line: rgba(255, 240, 225, 0.09);
  --line-strong: rgba(255, 240, 225, 0.18);
  --ink: #f6efe9;
  --ink-soft: rgba(246, 239, 233, 0.72);
  --ink-faint: rgba(246, 239, 233, 0.45);
  --accent: #ff7a45;            /* 炭火の橙 */
  --accent-2: #e8512f;
  --accent-ink: #1b0f0a;
  --gold: #e9c27a;
  --flame: #5aa9ff;
  --paper: #f5efe4;             /* 講評カードの紙 */
  --paper-ink: #231a16;
  --paper-soft: #6c5c52;
  --paper-line: rgba(35, 26, 22, 0.14);
  --serif: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --latin: "Playfair Display", Georgia, serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --gutter: 16px;
  --radius: 16px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
body { position: fixed; inset: 0; }

button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; -webkit-touch-callout: none; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- 全体の割り付け ---- */
#app {
  position: fixed; inset: 0;
  display: grid;
  grid-template-rows: 60% 1fr;
  grid-template-columns: 100%;
}

#stage {
  position: relative;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 40%, #3a2f2a 0%, #1a1513 70%);
}
#scene {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  touch-action: none;
}

/* ---- 上部：段階の進み具合とミュート ---- */
#topbar {
  position: absolute; left: 0; right: 0; top: 0;
  z-index: 3;
  display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-t) + 10px) calc(var(--safe-r) + var(--gutter)) 10px calc(var(--safe-l) + var(--gutter));
  background: linear-gradient(to bottom, rgba(12, 9, 8, 0.6), rgba(12, 9, 8, 0));
  pointer-events: none;
  transition: opacity 0.3s;
}
body[data-phase="title"] #topbar { opacity: 0; }
#steps {
  flex: 1;
  display: flex; gap: 4px;
  margin: 0; padding: 0; list-style: none;
}
#steps li {
  flex: 1;
  min-width: 0;
  font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  text-align: center;
  white-space: nowrap;
}
#steps li::before {
  content: "";
  display: block;
  height: 4px; border-radius: 2px;
  margin-bottom: 5px;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.35s;
}
#steps li.done { color: var(--ink-soft); }
#steps li.done::before { background: rgba(255, 122, 69, 0.55); }
#steps li.now { color: var(--ink); font-weight: 700; }
#steps li.now::before { background: var(--accent); box-shadow: 0 0 10px rgba(255, 122, 69, 0.6); }

.icon-btn {
  pointer-events: auto;
  width: 38px; height: 38px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(20, 15, 13, 0.55);
  border: 1px solid var(--line-strong);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.icon-btn svg { width: 20px; height: 20px; }
#btn-mute .ic-off { display: none; }
#btn-mute[aria-pressed="true"] .ic-on { display: none; }
#btn-mute[aria-pressed="true"] .ic-off { display: block; }

/* 3D の上の案内 */
#stage-hint {
  position: absolute; left: 50%; bottom: 34px;
  transform: translateX(-50%);
  z-index: 2;
  max-width: calc(100% - 32px);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  background: rgba(20, 15, 13, 0.62);
  border: 1px solid var(--line-strong);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s var(--ease);
}
#stage-hint.show { opacity: 1; }
#stage-hint.pulse { animation: hintPulse 0.35s var(--ease); }
@keyframes hintPulse { 50% { transform: translateX(-50%) scale(1.06); } }

/* 経過時間（焼く） */
#timer {
  position: absolute; right: calc(var(--safe-r) + var(--gutter)); top: calc(var(--safe-t) + 52px);
  z-index: 2;
  display: flex; align-items: center; gap: 7px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  background: rgba(20, 15, 13, 0.6);
  border: 1px solid var(--line-strong);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-variant-numeric: tabular-nums;
  font-weight: 700; font-size: 17px; letter-spacing: 0.02em;
}
#timer[hidden] { display: none; }
.timer-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: blink 1.2s infinite; }
#timer.paused .timer-dot { animation: none; background: var(--ink-faint); box-shadow: none; }
@keyframes blink { 50% { opacity: 0.25; } }

/* 早送りの時計（寝かせる・休ませる） */
#clock {
  position: absolute; inset: 0;
  z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: rgba(14, 10, 9, 0.45);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.2s;
}
#clock[hidden] { display: none; }
.clock-face {
  position: relative;
  width: 84px; height: 84px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
}
.clock-face::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: #fff; }
.clock-hand {
  position: absolute; left: 50%; bottom: 50%;
  width: 3px; height: 32px; margin-left: -1.5px;
  border-radius: 2px;
  background: var(--accent);
  transform-origin: 50% 100%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.clock-text { text-align: center; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
.clock-text b { display: block; font-size: 15px; }
.clock-text span { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
@keyframes fadeIn { from { opacity: 0; } }

/* ---- 下：操作パネル ---- */
#panel {
  position: relative;
  z-index: 5;
  margin-top: -18px;
  display: flex; flex-direction: column;
  min-height: 0;
  padding: 14px calc(var(--safe-r) + var(--gutter)) calc(var(--safe-b) + 12px) calc(var(--safe-l) + var(--gutter));
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.panel-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter);
  scrollbar-width: none;
}
.panel-scroll::-webkit-scrollbar { display: none; }
.panel-foot { flex: none; padding-top: 10px; }

.panel-anim { animation: panelIn 0.35s var(--ease); }
@keyframes panelIn { from { opacity: 0; transform: translateY(14px); } }

.p-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 2px 0 10px; }
.p-title { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: 0.02em; }
.p-sub { margin: 0; font-size: 12px; color: var(--ink-faint); }

.field { margin-bottom: 12px; }
.field-label { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 5px; font-size: 12px; font-weight: 500; color: var(--ink-soft); }
.field.inline { display: flex; align-items: center; gap: 10px; }
.field.inline .field-label { flex: none; flex-direction: column; align-items: flex-start; gap: 0; margin: 0; width: 64px; font-size: 13px; color: var(--ink); }
.field.inline .field-label em { font-size: 11px; }
.field.inline .seg { flex: 1; }
.field-label em { font-style: normal; color: var(--ink-faint); font-weight: 400; }

/* セグメント */
.seg {
  display: flex;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface-2);
  gap: 3px;
}
.seg button {
  flex: 1;
  min-height: 38px;
  padding: 6px 4px;
  border-radius: 9px;
  font-size: 14px; font-weight: 500;
  color: var(--ink-soft);
  transition: background 0.2s, color 0.2s;
  line-height: 1.2;
}
.seg button small { display: block; font-size: 10.5px; color: var(--ink-faint); font-weight: 400; margin-top: 2px; }
.seg button.on { background: var(--surface-3); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); font-weight: 700; }
.seg button.on small { color: var(--ink-soft); }
.seg.small button { min-height: 32px; font-size: 13px; }

/* 道具（叩く・筋切り・揉む） */
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.tool {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 4px 8px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1.5px solid transparent;
  font-size: 13px; font-weight: 700;
  transition: border-color 0.2s, background 0.2s;
}
.tool svg { width: 24px; height: 24px; opacity: 0.85; }
.tool small { font-size: 10.5px; font-weight: 400; color: var(--ink-faint); }
.tool.on { border-color: var(--accent); background: rgba(255, 122, 69, 0.1); }
.tool.on svg { color: var(--accent); opacity: 1; }
.tool .count { position: absolute; top: 6px; right: 9px; font-size: 10.5px; color: var(--accent); font-weight: 700; }

/* 行のボタン（調味料を開く、など） */
.row-btn {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  text-align: left;
  margin-bottom: 10px;
}
.row-btn .rb-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 122, 69, 0.14); color: var(--accent); flex: none; }
.row-btn .rb-ic svg { width: 20px; height: 20px; }
.row-btn .rb-main { flex: 1; min-width: 0; }
.row-btn .rb-main b { display: block; font-size: 14px; }
.row-btn .rb-main span { display: block; font-size: 12px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-btn .rb-arrow { color: var(--ink-faint); font-size: 18px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--surface-2);
  color: var(--ink-soft);
}
.chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 14px;
  font-size: 16px; font-weight: 700;
  letter-spacing: 0.03em;
  transition: transform 0.12s, filter 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; transform: none; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: linear-gradient(180deg, #ff8a52, var(--accent-2)); color: #fff; box-shadow: 0 6px 18px rgba(232, 81, 47, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-secondary { background: var(--surface-3); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line-strong); min-height: 44px; font-size: 14px; font-weight: 500; }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: 17px; padding: 0 36px; }
.btn-next .arrow { font-size: 18px; margin-left: 2px; }

/* ---- 焼く：つまみと操作 ---- */
.cook-grid { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.dial-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dial {
  position: relative;
  width: 148px; height: 148px;
  touch-action: none;
  cursor: grab;
}
.dial svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dial-knob {
  position: absolute; inset: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4a403b, #231d1a 70%);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -3px 8px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.dial-knob::before {
  /* つまみの握り（横長の出っ張り） */
  content: "";
  position: absolute; left: 50%; top: 8px; bottom: 8px;
  width: 22px; margin-left: -11px;
  border-radius: 11px;
  background: linear-gradient(90deg, #2b2421, #5a4e48 50%, #2b2421);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.dial-knob::after {
  /* 指し示す線 */
  content: "";
  position: absolute; left: 50%; top: 11px;
  width: 4px; height: 20px; margin-left: -2px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.dial.dragging .dial-knob { cursor: grabbing; }
.dial-label { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.dial-label .flame { width: 14px; height: 14px; color: var(--flame); transition: transform 0.2s; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.act {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 64px;
  padding: 6px 4px;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 13px; font-weight: 700;
  overflow: hidden;
  transition: background 0.15s, transform 0.12s, opacity 0.2s;
}
.act svg { width: 24px; height: 24px; }
/* 長押しの途中でスクロールが始まって外れないように */
#act-press, #act-baste { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.act small { font-size: 10px; font-weight: 400; color: var(--ink-faint); }
.act:active, .act.holding { transform: scale(0.96); background: var(--surface-3); }
.act.holding { box-shadow: inset 0 0 0 2px var(--accent); }
.act.holding svg { color: var(--accent); }
.act:disabled { opacity: 0.35; }
.act .badge { position: absolute; top: 6px; right: 8px; font-size: 10px; font-weight: 700; color: var(--accent); }

.cook-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cook-top .seg { flex: none; }
.cook-top .seg button { min-width: 46px; min-height: 32px; font-size: 13px; font-variant-numeric: tabular-nums; }
.cook-state { font-size: 13px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; min-width: 0; }
.cook-state b { color: var(--ink); white-space: nowrap; }

/* ---- 切る ---- */
.cut-body { display: flex; flex-direction: column; }
.cut-body .knife-track { height: 84px; border-radius: 42px; margin: 14px 0 14px; }
.cut-body .knife-track .kt-knife { top: 10px; height: 62px; border-radius: 31px; }
.knife-track {
  position: relative;
  height: 72px;
  border-radius: 36px;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  touch-action: none;
  overflow: hidden;
  margin: 8px 0 12px;
}
.knife-track .kt-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, rgba(255, 122, 69, 0.05), rgba(255, 122, 69, 0.25)); }
.knife-track .kt-text { position: absolute; inset: 0 12px 0 172px; display: grid; place-items: center; text-align: center; white-space: nowrap; transition: opacity 0.15s; font-size: 13px; color: var(--ink-faint); letter-spacing: 0.04em; pointer-events: none; }
.knife-track .kt-knife {
  position: absolute; top: 8px; left: 8px;
  width: 92px; height: 56px;
  border-radius: 28px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #f4f1ee, #b9b3ae);
  color: #2a2421;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.knife-track .kt-knife svg { width: 56px; height: 28px; }
.knife-track.hint .kt-knife { animation: knifeHint 1.8s var(--ease) infinite; }
@keyframes knifeHint { 0%, 15% { transform: translateX(0); } 55% { transform: translateX(56px); } 70%, 100% { transform: translateX(0); } }
.knife-track.dragging .kt-text { opacity: 0; }
.knife-track.done { border-style: solid; border-color: var(--accent); }

/* ---- 引き出し（調味料） ---- */
.sheet { position: fixed; inset: 0; z-index: 30; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); animation: fadeIn 0.25s; }
.sheet-body {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 82%;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
  padding-bottom: var(--safe-b);
  animation: sheetUp 0.35s var(--ease);
}
.sheet.closing .sheet-body { animation: sheetDown 0.22s ease-in forwards; }
.sheet.closing .sheet-backdrop { animation: fadeOut 0.22s forwards; }
@keyframes sheetUp { from { transform: translateY(100%); } }
@keyframes sheetDown { to { transform: translateY(100%); } }
@keyframes fadeOut { to { opacity: 0; } }
.sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 8px auto 0; }
.sheet-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 8px calc(var(--safe-r) + var(--gutter)) 6px calc(var(--safe-l) + var(--gutter)); }
.sheet-head h2 { margin: 0; font-size: 18px; }
.sheet-close { font-size: 15px; font-weight: 700; color: var(--accent); padding: 8px 4px; }
.sheet-tabs {
  flex: none;
  display: flex; gap: 6px;
  overflow-x: auto;
  padding: 4px calc(var(--safe-r) + var(--gutter)) 10px calc(var(--safe-l) + var(--gutter));
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}
.sheet-tabs::-webkit-scrollbar { display: none; }
.sheet-tabs button {
  flex: none;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  background: var(--surface-2);
  color: var(--ink-soft);
}
.sheet-tabs button.on { background: var(--ink); color: var(--bg); font-weight: 700; }
.sheet-list {
  flex: 1; min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 6px calc(var(--safe-r) + var(--gutter)) 16px calc(var(--safe-l) + var(--gutter));
}
.sea {
  display: grid;
  grid-template-columns: 34px 1fr;
  column-gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.sea:last-child { border-bottom: 0; }
.sea-swatch { width: 34px; height: 34px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); grid-row: span 3; }
.sea-name { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.sea-name .used { font-size: 11px; font-weight: 700; color: var(--accent); background: rgba(255, 122, 69, 0.12); padding: 1px 7px; border-radius: 999px; }
.sea-note { font-size: 12px; color: var(--ink-faint); line-height: 1.55; margin: 3px 0 8px; }
.sea-ctrl { display: flex; gap: 8px; align-items: center; }
.sea-ctrl .seg { flex: 1; }
.sea-ctrl .seg button { min-height: 34px; font-size: 12.5px; }
.sea-add {
  flex: none;
  min-width: 72px; min-height: 40px;
  padding: 0 12px;
  border-radius: 11px;
  background: var(--accent-2);
  color: #fff;
  font-size: 14px; font-weight: 700;
  transition: transform 0.12s;
}
.sea-add:active { transform: scale(0.95); }

/* ---- 重ねる画面（タイトル・講評） ---- */
.overlay { position: fixed; inset: 0; z-index: 20; }
.overlay[hidden] { display: none; }

/* ---- タイトル：後ろで断面デモ、手前に紙のカード（講評カードと同じ紙・赤インク） ---- */
#title {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--safe-t) + 12px) calc(var(--safe-r) + var(--gutter)) calc(var(--safe-b) + 16px) calc(var(--safe-l) + var(--gutter));
  background: linear-gradient(to bottom, rgba(12, 9, 8, 0.45) 0, rgba(12, 9, 8, 0) 16%, rgba(12, 9, 8, 0) 46%, rgba(12, 9, 8, 0.92) 100%);
}
#title.leaving { animation: titleOut 0.32s var(--ease) forwards; pointer-events: none; }
/* 隠した後は消す（#title の display:flex が .overlay[hidden] より強く、透明なままベルや音のボタンに Tab で届いていた） */
#title[hidden] { display: none; }
@keyframes titleOut { to { opacity: 0; transform: translateY(12px); } }
.title-top { display: flex; justify-content: space-between; align-items: center; }
.title-brand { font-family: var(--latin); font-style: italic; font-size: 15px; color: var(--gold); letter-spacing: 0.06em; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); }
.title-icon {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 240, 225, 0.22);
  background: rgba(20, 15, 13, 0.55); color: var(--ink); display: grid; place-items: center; cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.title-icon svg { width: 20px; height: 20px; }
/* お知らせのベル（/news.js）。音のボタンのすぐ左に寄せる */
.title-news { position: relative; margin-left: auto; margin-right: 10px; }
.title-icon .snd-off, .title-icon[aria-pressed="true"] .snd-on { display: none; }
.title-icon[aria-pressed="true"] .snd-off { display: inline; }

/* 紙（ほんのり繊維の見える生成り） */
.title-card, .demo-slip, .book-paper {
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(120, 90, 60, 0.07) 1px, transparent 1.2px),
    radial-gradient(rgba(120, 90, 60, 0.05) 1px, transparent 1.2px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(0, 0, 0, 0.03));
  background-size: 7px 7px, 11px 11px, 100% 100%;
  background-position: 0 0, 3px 5px, 0 0;
  color: var(--paper-ink);
}
.title-card {
  position: relative;
  width: 100%; max-width: 440px; margin: 0 auto;
  padding: 26px 22px 18px;
  border-radius: 3px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 2px 0 rgba(0, 0, 0, 0.2);
  animation: cardRise 0.7s var(--ease) both;
}
@keyframes cardRise { from { opacity: 0; transform: translateY(28px); } }
/* 伝票のミシン目 */
.title-card::before {
  content: ""; position: absolute; left: 10px; right: 10px; top: 9px; height: 2px;
  background: radial-gradient(circle, rgba(35, 26, 22, 0.28) 1px, transparent 1.4px) 0 0 / 8px 2px repeat-x;
}
/* 店の判子 */
.title-card::after {
  content: "焼"; position: absolute; right: 18px; top: 22px;
  width: 52px; height: 52px; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 900; font-size: 30px; color: #b4442a;
  border: 3px solid #b4442a; border-radius: 10px; transform: rotate(8deg); opacity: 0.85;
  box-shadow: inset 0 0 0 2px rgba(180, 68, 42, 0.15);
}
.tc-kicker { margin: 0 0 8px; font-family: var(--latin); font-size: 11px; letter-spacing: 0.34em; color: var(--paper-soft); }
.tc-logo { margin: 0; font-family: var(--serif); font-weight: 900; font-size: clamp(34px, 10.5vw, 46px); line-height: 1.12; letter-spacing: 0.02em; }
.tc-lead { margin: 12px 0 18px; font-family: var(--serif); font-size: 14px; line-height: 1.75; color: var(--paper-soft); }
.btn-ink {
  width: 100%; min-height: 62px; border: 0; border-radius: 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: #fff8f0; font-family: var(--serif);
  background: linear-gradient(180deg, #c8553a, #a63a22);
  box-shadow: 0 5px 0 #6e2414, 0 10px 22px rgba(110, 36, 20, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn-ink span { font-size: 22px; font-weight: 900; letter-spacing: 0.12em; }
.btn-ink small { font-family: var(--sans); font-size: 11px; opacity: 0.8; letter-spacing: 0.08em; }
.btn-ink:active { transform: translateY(4px); box-shadow: 0 1px 0 #6e2414, 0 4px 10px rgba(110, 36, 20, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.tc-records { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.tc-rec {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: 9px 11px; border-radius: 4px; border: 1px dashed rgba(35, 26, 22, 0.28);
  background: rgba(255, 255, 255, 0.35); color: var(--paper-ink); font: inherit; min-height: 54px;
}
button.tc-rec { cursor: pointer; transition: transform 0.08s, background 0.15s; position: relative; }
button.tc-rec::after { content: "›"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--paper-soft); }
button.tc-rec:active { transform: scale(0.97); background: rgba(180, 68, 42, 0.08); }
.tc-rec-k { font-size: 10.5px; letter-spacing: 0.18em; color: var(--paper-soft); }
.tc-rec-v { font-family: var(--serif); font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tc-rec-v b { color: #b4442a; font-weight: 900; }
.tc-best .tc-rec-v { font-size: 14px; }
.tc-next { margin: 10px 0 0; min-height: 1em; text-align: center; font-size: 12px; color: var(--paper-soft); letter-spacing: 0.06em; }
.tc-next b { font-family: var(--serif); color: #b4442a; font-size: 14px; }

/* デモの格付け伝票 */
.demo-slip {
  position: absolute; right: calc(var(--safe-r) + var(--gutter)); top: calc(var(--safe-t) + 66px);
  width: 214px; padding: 12px 14px 14px; border-radius: 2px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
  z-index: 2; /* カードの上端にかぶせるときも手前に */
  opacity: 0; transform: translateY(-14px) rotate(-3deg); pointer-events: none;
  transition: opacity 0.25s, transform 0.35s var(--ease);
}
.demo-slip.show { opacity: 1; transform: translateY(0) rotate(-3deg); }
.ds-head { display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; font-size: 10px; color: var(--paper-soft); border-bottom: 1px solid var(--paper-line); padding-bottom: 6px; }
.ds-head span:first-child { font-family: var(--latin); letter-spacing: 0.2em; }
.ds-name { margin-top: 8px; font-family: var(--serif); font-weight: 900; font-size: 27px; line-height: 1.2; padding-right: 54px; }
.ds-stamp {
  position: absolute; right: 10px; bottom: 10px; width: 54px; height: 54px; border-radius: 50%;
  border: 3px solid #b4442a; color: #b4442a; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 900; font-size: 15px; letter-spacing: 0.05em;
  transform: rotate(-14deg) scale(1); opacity: 0;
}
.demo-slip.show .ds-stamp { animation: stampIn 0.32s 0.28s cubic-bezier(0.3, 1.6, 0.5, 1) forwards; }
@keyframes stampIn { from { opacity: 0; transform: rotate(-24deg) scale(2.2); } to { opacity: 0.9; transform: rotate(-14deg) scale(1); } }
.demo-slip[data-band="bad"] .ds-name { color: #3b2a22; }
.demo-slip[data-band="great"] .ds-stamp { background: rgba(180, 68, 42, 0.06); }

/* 格付け帳 */
#book { background: rgba(10, 7, 6, 0.82); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fadeIn 0.2s; z-index: 30; }
.book-scroll { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: calc(var(--safe-t) + 16px) calc(var(--safe-r) + 12px) calc(var(--safe-b) + 24px) calc(var(--safe-l) + 12px); }
.book-paper { max-width: 760px; margin: 0 auto; padding: 22px 16px 18px; border-radius: 3px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); animation: cardRise 0.35s var(--ease); }
.book-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 0 4px 14px; border-bottom: 2px solid var(--paper-ink); margin-bottom: 14px; }
.book-kicker { margin: 0; font-family: var(--latin); font-size: 11px; letter-spacing: 0.3em; color: var(--paper-soft); }
.book-title { margin: 2px 0 4px; font-family: var(--serif); font-weight: 900; font-size: 32px; }
.book-sub { margin: 0; font-size: 12px; color: var(--paper-soft); }
.book-sub b { font-family: var(--latin); font-size: 18px; color: #b4442a; }
.book-close { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--paper-line); background: rgba(255, 255, 255, 0.5); font-size: 24px; line-height: 1; color: var(--paper-ink); cursor: pointer; flex: none; }
.book-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bk { border: 1px solid var(--paper-line); border-radius: 4px; overflow: hidden; background: rgba(255, 255, 255, 0.4); }
.bk-ph { position: relative; aspect-ratio: 3 / 2; background: #2a201c; display: grid; place-items: center; overflow: hidden; }
.bk-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bk-q { font-family: var(--serif); font-weight: 900; font-size: 34px; color: rgba(255, 240, 225, 0.16); }
.bk-no { position: absolute; left: 7px; top: 5px; font-family: var(--latin); font-size: 11px; letter-spacing: 0.06em; color: rgba(255, 255, 255, 0.85); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); }
.bk-best { position: absolute; right: 6px; top: 6px; font-size: 10px; font-weight: 700; color: #fff; background: #b4442a; padding: 2px 6px; border-radius: 3px; }
.bk-tx { padding: 7px 9px 9px; display: flex; flex-direction: column; gap: 1px; }
.bk-tx b { font-family: var(--serif); font-size: 15px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-tx span { font-size: 11px; color: var(--paper-soft); }
.bk:not(.got) .bk-tx b { color: rgba(35, 26, 22, 0.35); letter-spacing: 0.2em; }
.bk.best { border-color: #b4442a; box-shadow: 0 0 0 1px #b4442a; }
.bk.next { border-style: dashed; border-color: #b4442a; }
.bk.next .bk-tx b { color: rgba(35, 26, 22, 0.55); letter-spacing: 0; }
.bk.next .bk-best { background: transparent; color: #f2b8a6; border: 1px solid #c8553a; }

/* 講評 */
#result { background: #0f0b0a; animation: fadeIn 0.5s; }
.result-scroll {
  position: absolute; inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: calc(var(--safe-t) + 14px) calc(var(--safe-r) + var(--gutter)) calc(var(--safe-b) + 28px) calc(var(--safe-l) + var(--gutter));
}
#result-card, .result-actions { max-width: 480px; margin: 0 auto; }
.result-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.result-actions .btn-row { display: grid; grid-template-columns: 1fr; gap: 8px; }
.result-actions .btn-row .btn { padding: 0 8px; font-size: 13px; }
.hub-link { display: block; text-align: center; margin-top: 10px; padding: 10px; font-size: 13px; color: var(--ink-faint); text-decoration: none; }
.hub-link:active { color: var(--ink); }

/* 講評カード（グルメ雑誌の1ページ） */
.review {
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: cardIn 0.6s var(--ease);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(0.98); } }
.rv-photo { position: relative; aspect-ratio: 3 / 2; background: #2a201c; overflow: hidden; }
.rv-photo img, .rv-photo canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv-photo .rv-mast {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  font-family: var(--latin); font-size: 12px; letter-spacing: 0.18em; color: #fff;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent);
  text-transform: uppercase;
}
.rv-photo .rv-mast i { font-style: italic; letter-spacing: 0.04em; text-transform: none; }
.rv-body { padding: 18px 20px 22px; }
.rv-doneness { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--paper-line); padding-bottom: 10px; }
.rv-doneness b { font-family: var(--serif); font-size: 22px; font-weight: 700; }
.rv-doneness span { font-size: 13px; color: var(--paper-soft); white-space: nowrap; }
.rv-doneness span em { font-style: normal; font-family: var(--latin); font-size: 22px; color: var(--paper-ink); margin-left: 4px; }
.rv-tier { text-align: center; padding: 18px 0 12px; }
.rv-tier-kicker { font-size: 11px; letter-spacing: 0.3em; color: var(--paper-soft); }
.rv-tier-name { margin: 4px 0 6px; font-family: var(--serif); font-weight: 900; font-size: 42px; line-height: 1.2; letter-spacing: 0.02em; white-space: nowrap; }
.rv-tier-rank { font-size: 13px; color: var(--paper-soft); }
.rv-tier-rank b { font-family: var(--latin); font-size: 20px; color: #b4442a; margin: 0 2px; }
.rv-meter { display: flex; gap: 2px; margin: 10px 0 0; }
.rv-meter i { flex: 1; height: 6px; border-radius: 1px; background: rgba(35, 26, 22, 0.1); }
.rv-meter i.on { background: linear-gradient(180deg, #d4673f, #a8361d); }
.rv-meter i.me { background: #231a16; transform: scaleY(1.8); }
.rv-headline {
  margin: 14px 0 12px;
  font-family: var(--serif);
  font-size: 21px; font-weight: 700;
  text-align: center;
  line-height: 1.4;
}
.rv-headline::before, .rv-headline::after { color: #b4442a; }
.rv-headline::before { content: "「"; }
.rv-headline::after { content: "」"; }
.rv-stars { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; padding: 12px 0; border-top: 1px solid var(--paper-line); border-bottom: 1px solid var(--paper-line); }
.rv-star { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.rv-star span:last-child { color: #b4442a; letter-spacing: 1px; font-size: 13px; }
.rv-star span:last-child .off { color: rgba(35, 26, 22, 0.18); }
.rv-comment { margin: 14px 0 10px; font-family: var(--serif); font-size: 15px; line-height: 1.9; }
.rv-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--paper-soft); }
.rv-sign { margin-top: 14px; display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--paper-soft); }
.rv-sign b { font-family: var(--latin); font-style: italic; font-size: 14px; color: var(--paper-ink); }

/* 通知 */
#toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 58px);
  z-index: 50;
  transform: translate(-50%, -12px);
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(246, 239, 233, 0.95);
  color: #1b1412;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--ease);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 背の低い画面（iPhone SE など）：パネルを詰める */
@media (max-height: 760px) {
  .tool .tool-sub { display: none; }
}
@media (max-height: 700px) {
  #app { grid-template-rows: 54% 1fr; }
  .dial { width: 128px; height: 128px; }
  .dial-knob { inset: 22px; }
  .act { min-height: 56px; }
  .tool { padding: 8px 4px 7px; }
}

/* パソコン・横長：3D を左、操作を右に */
@media (min-width: 860px) and (min-aspect-ratio: 1/1) {
  #app { grid-template-rows: 100%; grid-template-columns: 1fr 420px; }
  #panel {
    margin-top: 0;
    border-radius: 0;
    padding: calc(var(--safe-t) + 22px) 24px 24px;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
  }
  .panel-scroll { margin: 0 -24px; padding: 0 24px; }
  #stage-hint { bottom: 24px; }
  .sheet-body { left: auto; right: 0; top: 0; max-height: none; width: 440px; border-radius: 0; animation-name: sheetLeft; }
  .sheet.closing .sheet-body { animation-name: sheetRight; }
  @keyframes sheetLeft { from { transform: translateX(100%); } }
  @keyframes sheetRight { to { transform: translateX(100%); } }
  .sheet-grip { display: none; }
  .book-list { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* 早送りの時計の間はパネルの操作を止める（段階の食い違いを防ぐ） */
body.clock-busy #panel button { pointer-events: none; opacity: 0.45; }
/* 返す動きの間 */
.act.locked { opacity: 0.55; pointer-events: none; }
/* 寝かせる：場所の説明 */
.wait-note { margin: -4px 0 4px; font-size: 11px; line-height: 1.5; color: var(--ink-faint); }
#wait-seg button small { margin-top: 0; }

/* 幅の狭い画面（初代 iPhone SE など 320px）：焼くパネルを詰める */
@media (max-width: 359px) {
  .cook-grid { gap: 10px; }
  .dial { width: 112px; height: 112px; }
  .dial-knob { inset: 18px; }
  .act { min-height: 52px; font-size: 12px; }
  .act small { display: none; }
  .act svg { width: 20px; height: 20px; }
  .cook-top .seg button { min-width: 40px; }
  .knife-track .kt-text { inset: 0 8px 0 160px; }
}

/* 背の低い画面：下ごしらえの見出しは上の進み具合と重複するので省き、寝かせるの説明まで見えるようにする */
@media (max-height: 700px) {
  .prep-head { display: none; }
  .panel-scroll > .tools:first-child { margin-top: 2px; }
}

/* 途中でやり直す */
body[data-phase="title"] #btn-restart, body[data-phase="result"] #btn-restart { display: none; }
#btn-restart:disabled { opacity: 0.35; }
.menu-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 var(--gutter) calc(var(--safe-b, 0px) + 18px);
  background: rgba(8, 6, 5, 0.55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.menu-overlay[hidden] { display: none; }
.menu-card {
  width: 100%; max-width: 420px;
  display: grid; gap: 10px;
  padding: 18px 16px 14px;
  border-radius: 20px;
  background: var(--panel, #1d1715);
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.menu-title { margin: 0 0 4px; text-align: center; font-weight: 700; font-size: 15px; color: var(--ink); }
body.clock-busy #btn-restart { opacity: 0.35; pointer-events: none; }

/* 100点満点の採点 */
.rv-score { display: flex; align-items: baseline; justify-content: center; gap: 4px; margin: 2px 0 4px; }
.rv-score b { font-family: var(--latin); font-weight: 700; font-size: 76px; line-height: 1; color: #b4442a; letter-spacing: -0.02em; }
.rv-score span { font-family: var(--serif); font-weight: 900; font-size: 26px; color: var(--paper-ink, #231a16); }
.rv-score small { font-size: 15px; color: var(--paper-soft); margin-left: 4px; }
.rv-bar { height: 8px; border-radius: 4px; background: rgba(35, 26, 22, 0.1); overflow: hidden; margin: 6px 0 10px; }
.rv-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #d4673f, #a8361d); }
.rv-tier-label { font-family: var(--serif); font-weight: 900; font-size: 17px; color: var(--paper-ink, #231a16); margin: 0 2px; }

/* 講評：次の一手 */
.rv-next { margin: 14px 0 4px; padding: 10px 12px; border-radius: 10px; background: rgba(214, 90, 40, 0.08); border: 1px solid rgba(214, 90, 40, 0.25); font-size: 13px; line-height: 1.6; text-align: left; }
.rv-next b { display: block; font-size: 11px; letter-spacing: .1em; color: #c4502a; margin-bottom: 2px; }
/* 講評のあと：下ごしらえから焼く */
.btn-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* 下線つきの小さいリンク */
.title-sub-link { display: block; margin: 12px auto 0; background: none; border: 0; color: inherit; opacity: .7; font-size: 13px; text-decoration: underline; cursor: pointer; }
/* 焼いている間の様子 */
.cook-state small { display: block; white-space: nowrap; font-size: 11px; opacity: .75; font-weight: 400; margin-top: 1px; }

.again-label { margin: 6px 0 -2px; font-size: 12px; opacity: .6; text-align: center; }
.btn-row.two .btn { flex-direction: column; gap: 2px; line-height: 1.2; }
.btn-row.two .btn small { font-size: 11px; font-weight: 500; opacity: .7; }
.menu-card .btn[hidden] { display: none; }

/* 講評の下：格付け帳・タイトルへ */
.result-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 2px; }
.res-link { min-height: 44px; border-radius: 10px; border: 1px dashed var(--line-strong); background: transparent; color: var(--ink-soft); font: inherit; font-size: 13px; cursor: pointer; }
.res-link b { color: var(--gold); font-family: var(--latin); font-size: 15px; margin-left: 4px; }
.res-link:active { transform: scale(0.97); }
.menu-link { margin-top: 4px; min-height: 40px; background: none; border: 0; color: var(--ink-faint); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }

/* タイトルの間はどの画面でも 3D を全面に（操作パネルは隠す） */
body[data-phase="title"] #app { grid-template-rows: 100%; grid-template-columns: 100%; }
body[data-phase="title"] #panel { display: none; }

/* 横長（PC・スマホ横）：カードは左、肉は右（main.js の titleFraming で絵を右へ寄せる） */
@media (min-aspect-ratio: 1/1) {
  #title { background: linear-gradient(90deg, rgba(12, 9, 8, 0.7) 0, rgba(12, 9, 8, 0.15) 42%, rgba(12, 9, 8, 0) 60%), linear-gradient(to bottom, rgba(12, 9, 8, 0.4), transparent 18%); }
  .title-card { position: absolute; left: calc(var(--safe-l) + 5vw); top: 50%; transform: translateY(-50%); width: 400px; max-width: none; margin: 0; padding: 30px 28px 22px; animation-name: cardRiseSide; }
  @keyframes cardRiseSide { from { opacity: 0; transform: translate(-20px, -50%); } }
  .tc-logo { font-size: 48px; }
  .demo-slip { top: auto; bottom: 9vh; right: 6vw; width: 260px; padding: 14px 18px 18px; }
  .ds-name { font-size: 32px; }
}
/* 高さの低い横長（スマホ横）：カードを詰めて画面に収める */
@media (min-aspect-ratio: 1/1) and (max-height: 560px) {
  .title-card { width: 300px; left: calc(var(--safe-l) + 16px); padding: 18px 18px 12px; }
  .title-card::after { width: 38px; height: 38px; font-size: 22px; right: 14px; top: 16px; border-width: 2px; border-radius: 7px; }
  .tc-kicker { font-size: 9.5px; margin-bottom: 4px; }
  .tc-logo { font-size: 28px; }
  .tc-lead { display: none; }
  .btn-ink { min-height: 50px; margin-top: 12px; }
  .btn-ink span { font-size: 18px; }
  .tc-records { margin-top: 10px; }
  .tc-rec { min-height: 44px; padding: 6px 9px; }
  .tc-next { margin-top: 6px; }
  .ds-head { font-size: 9px; gap: 6px; }
  .demo-slip { width: 228px; bottom: 5vh; right: calc(var(--safe-r) + 16px); padding: 10px 12px 12px; }
  .ds-name { font-size: 22px; padding-right: 46px; }
  .ds-stamp { width: 44px; height: 44px; font-size: 12px; }
}

/* 講評：格付けをハンコで押す（カードが出てから約0.6秒後。押す瞬間に main で「ドン」と振動） */
.rv-tier { position: relative; }
.rv-stamp { display: inline-block; animation: tierStamp 0.3s 0.6s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
/* 押し始めの大きさ --s0 は main.js が名前の幅から決める（長い名前でも押す途中でカードからはみ出さない） */
@keyframes tierStamp { from { opacity: 0; transform: translateY(var(--dy, 0px)) scale(var(--s0, 2.4)) rotate(calc(-6deg * (var(--s0, 2.4) - 1) / 1.4)); } to { opacity: 1; transform: scale(1) rotate(0); } }
.rv-seal {
  position: absolute; right: 2px; top: 6px; width: 58px; height: 58px; border-radius: 50%;
  border: 3px solid #b4442a; color: #b4442a; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 900; font-size: 15px; letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 2px rgba(180, 68, 42, 0.12);
  animation: sealStamp 0.3s 0.6s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}
@keyframes sealStamp { from { opacity: 0; transform: rotate(-30deg) scale(2.2); } to { opacity: 0.85; transform: rotate(-14deg) scale(1); } }
#result-card.thud { animation: cardThud 0.18s ease-out; }
@keyframes cardThud { 30% { transform: translateY(3px) scale(0.997); } }

/* 周辺減光：3D の四隅をごく薄く暗くして、真ん中の肉に目を集める（CSS なので重くならない） */
#stage::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(115% 90% at 50% 45%, transparent 50%, rgba(10, 7, 6, 0.5) 100%); }

/* 講評の中央：格付けが主役、点数は1行（2026-11-08） */
.rv-body { position: relative; }
.rv-seal { position: absolute; top: -46px; right: 16px; z-index: 2; background: var(--paper); }
.rv-tier { padding: 16px 0 12px; }
.rv-tier-kicker span { font-family: var(--latin); letter-spacing: 0.04em; }
.rv-tier-name { margin: 22px 0 4px; font-size: min(46px, calc((min(100vw, 480px) - 76px) / var(--n, 6))); color: var(--paper-ink); }
.rv-meter { margin: 8px 0 0; }
.rv-score-line { margin-top: 12px; font-size: 13px; color: var(--paper-soft); }
.rv-score-line b { font-family: var(--serif); font-size: 26px; font-weight: 900; color: #b4442a; margin: 0 2px; font-variant-numeric: lining-nums; }
.rv-score-line small { font-size: 12px; }

/* =====================================================================
   操作パネル：暗い調理台（木）に紙の札と伝票（2026-11-08。タイトル・講評と同じ紙と赤インクにそろえる）
   ここから下は見た目の上書きだけ。HTML と動きは変えない
   ===================================================================== */
:root {
  --red-ink: #b4442a;
  --paper-grain:
    radial-gradient(rgba(120, 90, 60, 0.07) 1px, transparent 1.2px) 0 0 / 7px 7px,
    radial-gradient(rgba(120, 90, 60, 0.05) 1px, transparent 1.2px) 3px 5px / 11px 11px;
  --paper-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 6px 14px rgba(0, 0, 0, 0.28);
}
/* 調理台の木目 */
#panel {
  background-color: #241812;
  background-image:
    linear-gradient(180deg, rgba(255, 230, 200, 0.06), transparent 40px),
    repeating-linear-gradient(91deg, rgba(255, 220, 180, 0.028) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(89deg, rgba(0, 0, 0, 0.2) 0 1px, transparent 1px 23px),
    linear-gradient(180deg, #2d2019, #1d1410);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 230, 200, 0.08);
}
.p-title { font-family: var(--serif); font-weight: 900; font-size: 19px; color: var(--paper); letter-spacing: 0.06em; }
.p-sub, .field-label em { color: rgba(245, 239, 228, 0.55); }
.field-label, .field.inline .field-label { color: rgba(245, 239, 228, 0.8); }
.cook-state { color: rgba(245, 239, 228, 0.7); }
.cook-state b { color: var(--paper); }
.dial-label { color: var(--paper); }

/* 紙の札：道具・操作・行ボタン・切り替えの帯・包丁の帯 */
.tool, .act, .row-btn, .seg, .knife-track {
  background: var(--paper-grain), var(--paper);
  color: var(--paper-ink);
  box-shadow: var(--paper-shadow);
  border-radius: 6px;
}
.tool { border: 0; }
.tool svg, .act svg { color: var(--paper-ink); opacity: 1; }
.tool small, .act small, .row-btn .rb-main span, .row-btn .rb-arrow { color: var(--paper-soft); }
.tool.on { background: var(--paper-grain), #f1e4d6; box-shadow: var(--paper-shadow), inset 0 0 0 2px var(--red-ink); }
.tool.on svg { color: var(--red-ink); }
.tool .count, .act .badge { color: var(--red-ink); }
.tool:active { transform: translateY(1px); }
.act:active, .act.holding { background: var(--paper-grain), #ebe0cf; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35), 0 3px 8px rgba(0, 0, 0, 0.25); }
.act.holding { box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35), inset 0 0 0 2px var(--red-ink); }
.act.holding svg { color: var(--red-ink); }
.act:disabled { opacity: 0.45; }
.row-btn .rb-ic { background: rgba(180, 68, 42, 0.12); color: var(--red-ink); border-radius: 50%; }
.row-btn .rb-main b { color: var(--paper-ink); }
/* 切り替えの帯：選んだ所は墨で塗る */
.seg { padding: 3px; }
.seg button { color: var(--paper-soft); border-radius: 4px; }
.seg button small { color: rgba(108, 92, 82, 0.8); }
.seg button.on { background: var(--paper-ink); color: var(--paper); box-shadow: none; }
.seg button.on small { color: rgba(245, 239, 228, 0.7); }
/* 包丁の帯 */
.knife-track { border: 1px dashed rgba(35, 26, 22, 0.25); border-radius: 36px; }
.cut-body .knife-track { border-radius: 42px; }
.knife-track .kt-text { color: var(--paper-soft); }
.knife-track .kt-fill { background: linear-gradient(90deg, rgba(180, 68, 42, 0.04), rgba(180, 68, 42, 0.2)); }

/* 進むボタン：タイトルの「焼きにいく」と同じ赤インクの押し込み */
.btn-primary {
  background: linear-gradient(180deg, #c8553a, #a63a22);
  color: #fff8f0;
  font-family: var(--serif); font-weight: 900; letter-spacing: 0.1em;
  box-shadow: 0 5px 0 #6e2414, 0 10px 22px rgba(110, 36, 20, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn-primary:active { transform: translateY(4px); box-shadow: 0 1px 0 #6e2414, 0 4px 10px rgba(110, 36, 20, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.btn-primary:disabled { transform: none; box-shadow: 0 5px 0 #6e2414; }

/* 上の工程：伝票の帯 */
#steps {
  background: var(--paper-grain), var(--paper);
  border-radius: 3px; padding: 6px 8px 5px; gap: 2px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}
#steps li { color: var(--paper-soft); font-family: var(--serif); font-weight: 500; } /* まだの工程も読める濃さ（約5:1）。今の工程は墨の太字＋赤い線で区別 */
#steps li::before { height: 3px; margin-bottom: 4px; background: rgba(35, 26, 22, 0.12); }
#steps li.done { color: var(--paper-soft); }
#steps li.done::before { background: rgba(180, 68, 42, 0.55); }
#steps li.now { color: var(--paper-ink); font-weight: 900; }
#steps li.now::before { background: var(--red-ink); box-shadow: none; }

/* 引き出し（調味料・フライパンに足す）：レシピ帳の紙 */
.sheet-body { background: var(--paper-grain), var(--paper); color: var(--paper-ink); }
.sheet-grip { background: rgba(35, 26, 22, 0.2); }
.sheet-head h2 { font-family: var(--serif); font-weight: 900; color: var(--paper-ink); }
.sheet-close { color: var(--red-ink); }
.sheet-tabs { border-bottom-color: var(--paper-line); }
.sheet-tabs button { background: rgba(35, 26, 22, 0.06); color: var(--paper-soft); }
.sheet-tabs button.on { background: var(--paper-ink); color: var(--paper); }
.sea { border-bottom-color: var(--paper-line); }
.sea-swatch { box-shadow: inset 0 0 0 1px rgba(35, 26, 22, 0.18); }
.sea-name { font-family: var(--serif); font-weight: 900; }
.sea-name .used { color: var(--red-ink); background: rgba(180, 68, 42, 0.1); }
.sea-note { color: var(--paper-soft); }
.sheet .seg { background: rgba(35, 26, 22, 0.06); box-shadow: none; }
.sea-add { background: linear-gradient(180deg, #c8553a, #a63a22); color: #fff8f0; border-radius: 6px; box-shadow: 0 3px 0 #6e2414; font-family: var(--serif); font-weight: 900; }
.sea-add:active { transform: translateY(2px); box-shadow: 0 1px 0 #6e2414; }
.rv-star span:first-child { white-space: nowrap; }

/* やり直しのメニュー・講評の下のボタンも紙に */
.menu-card { background: var(--paper-grain), var(--paper); border: 0; border-radius: 6px; color: var(--paper-ink); }
.menu-title { color: var(--paper-ink); font-family: var(--serif); font-weight: 900; font-size: 17px; }
.menu-card .btn-ghost { color: var(--paper-ink); border-color: rgba(35, 26, 22, 0.25); }
.menu-card .menu-link { color: var(--paper-soft); }
.result-actions .btn-secondary { background: var(--paper-grain), var(--paper); color: var(--paper-ink); box-shadow: var(--paper-shadow); border-radius: 6px; }
.result-actions .btn-secondary small { color: var(--paper-soft); }
.res-link { border-color: rgba(245, 239, 228, 0.25); color: rgba(245, 239, 228, 0.8); }

/* 狭い画面（〜360px）：明朝＋字間で折れる所を詰める */
@media (max-width: 360px) {
  .btn-primary { letter-spacing: 0.02em; }
  .sea-ctrl .seg button { white-space: nowrap; font-size: 11.5px; padding: 6px 2px; }
  #steps { padding: 5px 5px 4px; gap: 3px; }
  #steps li { font-family: var(--sans); font-size: 9.5px; letter-spacing: 0; }
}
/* 工程の幅は文字の長さに合わせて配る（同じ幅だと「下ごしらえ」が収まらない） */
#steps li { flex: 1 0 auto; }
/* 焼く工程の上の行：入りきらないときだけ早送りの切り替えを2行目に回す（幅・数値の長さによらず重ならない） */
.cook-top { flex-wrap: wrap; row-gap: 6px; }
.cook-top .seg { margin-left: auto; }

/* 伝票（PC の横長・高さ760px以上だけ）：パネルの下の空きに置く紙。今回やったことが書き足されていく */
.ticket { display: none; }
@media (min-width: 860px) and (min-aspect-ratio: 1/1) and (min-height: 760px) {
  body[data-phase="prep"] .ticket, body[data-phase="cook"] .ticket, body[data-phase="rest"] .ticket, body[data-phase="cut"] .ticket { display: block; }
  .ticket {
    position: fixed; z-index: 6; right: calc(var(--safe-r) + 30px); width: 360px;
    bottom: calc(var(--safe-b) + 108px); max-height: calc(100vh - 480px); overflow: hidden; /* max-height は main.js が工程ごとに合わせる */
    padding: 20px 22px 16px; border-radius: 2px;
    background: var(--paper-grain), var(--paper); color: var(--paper-ink);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3), 0 14px 30px rgba(0, 0, 0, 0.35);
    transform: rotate(-0.8deg); font-family: var(--serif);
  }
  .ticket::before { content: ""; position: absolute; left: 10px; right: 10px; top: 8px; height: 2px; background: radial-gradient(circle, rgba(35, 26, 22, 0.28) 1px, transparent 1.4px) 0 0 / 8px 2px repeat-x; }
  .tk-head { display: flex; justify-content: space-between; font-family: var(--latin); font-size: 11px; letter-spacing: 0.3em; color: var(--paper-soft); padding-bottom: 6px; border-bottom: 1px solid var(--paper-line); }
  .tk-title { margin-top: 8px; font-size: 20px; font-weight: 900; }
  .tk-sub { font-size: 12px; color: var(--paper-soft); }
  .tk-sec { margin-top: 10px; }
  .tk-sec h3 { margin: 0 0 3px; font-size: 12px; letter-spacing: 0.2em; color: var(--red-ink); font-weight: 900; }
  .tk-sec ul { list-style: none; margin: 0; padding: 0; }
  .tk-sec li { display: flex; align-items: baseline; gap: 6px; font-size: 14px; line-height: 1.7; }
  .tk-sec li i { flex: 1; border-bottom: 1px dotted rgba(35, 26, 22, 0.3); transform: translateY(-4px); }
  .tk-sec li b { font-weight: 700; font-variant-numeric: tabular-nums; }
  .tk-sec li.tk-empty { color: var(--paper-soft); font-size: 13px; }
  .tk-foot { margin-top: 12px; padding-top: 8px; border-top: 1px dashed rgba(35, 26, 22, 0.3); text-align: center; font-size: 12px; letter-spacing: 0.15em; color: var(--paper-soft); }
}

/* ---- このゲームについて（2026-11-12。検索エンジン向けの説明。タイトルでは小さなリンクだけ） ---- */
.about-open {
  display: block; margin: 8px auto 0; padding: 4px 8px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 11.5px; letter-spacing: 0.08em; color: var(--paper-soft);
  text-decoration: underline; text-underline-offset: 3px;
}
.about { z-index: 40; overflow-y: auto; background: var(--paper); color: var(--paper-ink); }
.about-in { max-width: 560px; margin: 0 auto; padding: calc(var(--safe-t) + 64px) calc(var(--safe-r) + var(--gutter)) calc(var(--safe-b) + 40px) calc(var(--safe-l) + var(--gutter)); font-size: 14px; line-height: 1.85; }
.about h2 { margin: 0 0 12px; font-family: var(--serif); font-size: 22px; font-weight: 900; }
.about h3 { margin: 22px 0 6px; font-family: var(--serif); font-size: 16px; font-weight: 700; color: #b4442a; }
.about p { margin: 0 0 10px; }
.about dt { font-weight: 700; margin-top: 8px; }
.about dd { margin: 0 0 4px; color: var(--paper-soft); }
.about a { color: #b4442a; }
.about-more { margin-top: 20px; }
.about-close {
  position: fixed; top: calc(var(--safe-t) + 12px); right: calc(var(--safe-r) + 14px); width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid rgba(35, 26, 22, 0.25); background: rgba(255, 255, 255, 0.6);
  color: var(--paper-ink); font-size: 22px; line-height: 1; cursor: pointer;
}
