/* =========================================================
 *  タコス厨房 算数ラッシュ — styles
 *  パレットは厨房タコスラッシュ（WordTacos）を継承
 * ========================================================= */
:root {
  --bg: #FFF8EE;
  --paper: #FFFDF7;
  --ink: #2A1F14;
  --sub: #6B5A47;
  --accent: #C73E1D;
  --accent-soft: #F4A26A;
  --green: #4A7C59;
  --green-soft: #EAF4EC;
  --yellow: #E8B647;
  --red: #D2342B;
  --red-soft: #FCE4E0;
  --border: #E6D5BC;
  --wood: #B8845A;
  --wood-dark: #8B5E3C;
  --shadow: 0 4px 16px rgba(74, 50, 30, 0.08);

  --dur-fast: 120ms;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: "Hiragino Sans", "Hiragino Maru Gothic ProN", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.app {
  max-width: 440px; margin: 0 auto;
  height: 100svh;
  height: 100dvh;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column;
  position: relative;
}

/* ==== HUD ==== */
.hud {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--sub);
  padding: 2px 0 8px;
}
.hud .streak { font-weight: 700; color: var(--accent); white-space: nowrap; }
.hud .streak b { font-size: 1.05rem; }
.hud .speed {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 700; color: var(--wood-dark);
  background: #F3E6D2; border-radius: 999px; padding: 2px 9px;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.hud .speed small { font-size: 0.72em; opacity: 0.75; }
/* 加速するほど熱くなる */
.hud .speed.hot { background: #FBD9C4; color: var(--accent); }
.hud .speed.blazing { background: var(--accent); color: #fff; animation: speedPulse 0.7s ease-in-out infinite alternate; }
@keyframes speedPulse { from { transform: scale(1); } to { transform: scale(1.07); } }

.hud .score { font-weight: 800; color: var(--ink); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.hud .score small { font-size: 0.62em; font-weight: 600; color: var(--sub); margin-left: 1px; }
.hud .sound-toggle {
  background: none; border: none; font-size: 1rem; cursor: pointer;
  opacity: 0.75; padding: 2px;
}
.hud .sound-toggle.off { opacity: 0.3; }

/* ==== 1分メーター (セッション全体の砂時計) ==== */
.session-meter {
  position: relative;
  height: 18px; border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 10px;
  box-shadow: inset 0 1px 3px rgba(74, 50, 30, 0.18);
}
.session-fill {
  position: absolute; inset: 0;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--green) 0%, var(--yellow) 65%, var(--accent-soft) 100%);
  will-change: transform;
}
.session-meter.low .session-fill {
  background: linear-gradient(90deg, var(--red) 0%, #F4633F 100%);
}
.session-meter.low { animation: lowPulse 0.55s ease-in-out infinite alternate; }
@keyframes lowPulse { from { box-shadow: inset 0 1px 3px rgba(74,50,30,0.18); } to { box-shadow: inset 0 1px 3px rgba(74,50,30,0.18), 0 0 0 3px rgba(210,52,43,0.25); } }
.session-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800; color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(74, 50, 30, 0.45);
  letter-spacing: 0.04em;
}

/* ==== 客 ==== */
.customer-row { display: flex; justify-content: flex-end; height: 54px; padding-right: 10px; }
.customer { width: 54px; height: 54px; display: flex; align-items: flex-end; }
.customer img {
  width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(74, 50, 30, 0.18));
  user-select: none; -webkit-user-drag: none;
}
.customer.happy { animation: happyBounce 0.7s ease; }
@keyframes happyBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  30%      { transform: translateY(-12px) scale(1.1); }
  60%      { transform: translateY(0) scale(1.05); }
}
.customer.angry { animation: angryShake 0.45s ease; }
@keyframes angryShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); filter: hue-rotate(-20deg); }
  40%, 80% { transform: translateX(5px); filter: hue-rotate(-20deg); }
}

/* ==== 注文票 (式) — 画面の主役。余った縦幅はここに与え、式を最大化する ==== */
.order {
  background: var(--paper); border: 2px solid var(--border); border-radius: 14px;
  padding: 10px 18px 14px; box-shadow: var(--shadow); position: relative;
  margin-bottom: 12px;
  text-align: center;
  flex: 1 1 0; min-height: 150px;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
}
.order::after {
  content: ""; position: absolute;
  left: 32px; bottom: -10px; width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid var(--border);
}
.order .direction {
  font-size: 0.7rem; color: var(--sub);
  letter-spacing: 0.1em; margin-bottom: 2px;
}
.order .eq {
  font-size: clamp(3rem, 17vw, 5rem);
  font-weight: 800; line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
/* 分数・筆算。要素が縦に積むので字を詰めないと注文票からはみ出す */
.order .eq.sm { font-size: clamp(1.8rem, 9vw, 2.7rem); }

/* 答えるべき穴。ここだけ色で立たせる */
.bl {
  font-style: normal; color: var(--accent);
  animation: blankPulse 1.1s ease-in-out infinite alternate;
}
@keyframes blankPulse { from { opacity: 1; } to { opacity: 0.45; } }

/* ==== 分数 ==== */
.fr {
  display: inline-flex; flex-direction: column; align-items: center;
  vertical-align: middle; line-height: 1.05; margin: 0 0.1em;
}
.fr-n { padding: 0 0.2em 0.05em; }
.fr-d { padding: 0.05em 0.2em 0; border-top: 0.08em solid currentColor; }

/* ==== 筆算 ==== */
.hs {
  display: inline-flex; flex-direction: column; align-items: flex-end;
  line-height: 1.16; font-variant-numeric: tabular-nums;
}
.hs-row { display: flex; align-items: center; }
.hs-row > i { font-style: normal; width: 0.9em; text-align: center; }
.dg { display: inline-block; width: 0.72em; text-align: center; }
.hs-rule {
  width: 100%; height: 0.07em; background: currentColor;
  margin: 0.09em 0; border-radius: 2px;
}

/* ==== コンベア + トルティーヤ (1問の砂時計) ==== */
.conveyor-wrap { position: relative; height: 78px; margin-bottom: 10px; }
.conveyor {
  position: absolute; left: 0; right: 0; top: 24px; height: 32px;
  background: repeating-linear-gradient(90deg, var(--wood) 0 16px, var(--wood-dark) 16px 18px);
  border-radius: 6px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.15);
  animation: conveyorRoll 1.2s linear infinite;
}
@keyframes conveyorRoll {
  from { background-position: 0 0; }
  to   { background-position: 18px 0; }
}
/* コンベアの終端 = 時間切れの落とし穴 */
.conveyor-wrap::after {
  content: ""; position: absolute; right: 0; top: 18px;
  width: 4px; height: 44px; border-radius: 2px;
  background: linear-gradient(180deg, transparent, rgba(210, 52, 43, 0.5));
}
/* track がコンベア上を移動する。tortilla は完成/焦げ落ちを演じる。
   役割を2要素に分けてあるので、両者の transform が衝突しない */
.tortilla-track {
  position: absolute; top: 2px; left: 0;
  width: 68px; height: 68px;
  pointer-events: none;
  will-change: transform;
}
.tortilla {
  width: 100%; height: 100%; font-size: 3.6rem;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(74, 50, 30, 0.3));
}

/* ==== 数字パッド 0〜9 (この10ボタンが不変の骨格) ==== */
.keypad {
  display: grid; gap: 8px;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(2, clamp(58px, 11vh, 96px));
  flex: 0 0 auto;
  margin-bottom: 10px;
}
.key {
  background: white; border: 2px solid var(--border); border-radius: 12px;
  font-size: 1.7rem; font-weight: 800; cursor: pointer;
  color: var(--ink); font-family: inherit;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(74, 50, 30, 0.08);
  transition: transform 80ms, border-color var(--dur-fast), background var(--dur-fast);
}
.key:active { transform: scale(0.94); }
.key:disabled { cursor: default; }
.key.correct {
  background: var(--green-soft); border-color: var(--green); color: var(--green);
  animation: correctPulse 0.25s ease;
}
.key.wrong {
  background: var(--red-soft); border-color: var(--red); color: var(--red);
  animation: wrongShake 0.22s ease;
}
@keyframes correctPulse { from { transform: scale(0.9); } to { transform: scale(1); } }
@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ==== マスコット ==== */
.mascot-row { display: flex; align-items: center; gap: 10px; padding: 2px; }
.mascot { width: 54px; height: 68px; flex-shrink: 0; position: relative; }
.mascot img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; opacity: 0; transition: opacity 0.2s;
}
.mascot img.active { opacity: 1; }
.mascot.bounce img.active { animation: mascotBounce 1.4s ease-in-out infinite; }
@keyframes mascotBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
.bubble {
  background: var(--paper); border: 2px solid var(--border); border-radius: 12px;
  padding: 6px 12px; font-size: 0.78rem; color: var(--sub); position: relative;
}
.bubble::before {
  content: ""; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 0; height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 8px solid var(--border);
}

/* ==== オーバーレイ ==== */
.overlay {
  position: fixed; inset: 0; background: rgba(255, 248, 238, 0.97);
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  z-index: 100;
}
.overlay[hidden] { display: none; }
.overlay h1 {
  font-size: 1.7rem; font-weight: 800; color: var(--accent);
  margin-bottom: 2px; text-align: center;
}
.overlay .lead { color: var(--sub); font-size: 0.82rem; text-align: center; margin-bottom: 14px; }

/* ==== ステージ選択 ==== */
#view-stages, #view-lessons { width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: center; }
#view-lessons[hidden], #view-stages[hidden] { display: none; }

.stage-grid { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.stage-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper); border: 2px solid var(--border); border-radius: 14px;
  padding: 12px 14px; cursor: pointer; font-family: inherit; color: var(--ink);
  box-shadow: 0 2px 6px rgba(74, 50, 30, 0.06); text-align: left;
  transition: transform 90ms, border-color var(--dur-fast);
}
.stage-card:hover { border-color: var(--accent-soft); }
.stage-card:active { transform: scale(0.98); }
.stage-card.done { border-color: var(--green); background: var(--green-soft); }
.stage-card .s-emoji { font-size: 1.7rem; flex-shrink: 0; }
.stage-card .s-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.stage-card .s-name { font-weight: 800; font-size: 1rem; }
.stage-card .s-lead { font-size: 0.68rem; color: var(--sub); }
.stage-card .s-bar {
  height: 5px; background: var(--border); border-radius: 999px; overflow: hidden; margin-top: 2px;
}
.stage-card .s-bar > i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  transition: width 0.5s var(--ease-out-expo);
}
.stage-card.done .s-bar > i { background: var(--green); }
.stage-card .s-count {
  font-weight: 800; font-size: 1.25rem; color: var(--accent);
  font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.stage-card .s-count small { font-size: 0.55em; color: var(--sub); font-weight: 600; }
.stage-card.done .s-count { color: var(--green); }

/* ==== レッスン一覧 ==== */
.btn-back {
  align-self: flex-start; background: none; border: none; cursor: pointer;
  color: var(--accent); font-weight: 700; font-size: 0.85rem; font-family: inherit;
  padding: 4px 0 8px;
}
#view-lessons h2 { font-size: 1.35rem; font-weight: 800; color: var(--accent); }
.lesson-note {
  font-size: 0.72rem; color: var(--sub); background: var(--paper);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; margin-bottom: 10px; text-align: center; width: 100%;
}
.lesson-list { display: flex; flex-direction: column; gap: 7px; width: 100%; }
.lesson {
  display: flex; align-items: stretch; gap: 6px;
}
.lesson .l-main {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  background: var(--paper); border: 2px solid var(--border); border-radius: 12px;
  padding: 11px 12px; cursor: pointer; font-family: inherit; color: var(--ink);
  text-align: left; box-shadow: 0 2px 6px rgba(74, 50, 30, 0.06);
  transition: transform 90ms, border-color var(--dur-fast);
}
.lesson .l-main:hover:not(:disabled) { border-color: var(--accent-soft); }
.lesson .l-main:active:not(:disabled) { transform: scale(0.98); }
.lesson .l-no { font-size: 1.15rem; color: var(--wood-dark); flex-shrink: 0; }
.lesson .l-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lesson .l-name { font-weight: 800; font-size: 0.95rem; }
.lesson .l-stage { font-size: 0.68rem; font-weight: 700; }
.lesson .l-stage.none { color: var(--sub); font-weight: 600; }
.lesson .l-stage.try { color: var(--wood-dark); }
.lesson .l-stage.master { color: var(--green); }
.lesson .l-stage.expert { color: var(--accent); }
.lesson .l-lock { font-size: 0.66rem; color: var(--wood-dark); }

.lesson.locked .l-main {
  opacity: 0.55; border-style: dashed; background: transparent;
  box-shadow: none; cursor: default;
}
.lesson.locked .l-name { color: var(--sub); }
.lesson.capstone .l-main { border-color: var(--green); background: var(--green-soft); }
.lesson.capstone.locked .l-main { background: transparent; }

.lesson .l-info {
  flex-shrink: 0; width: 40px;
  background: var(--paper); border: 2px solid var(--border); border-radius: 12px;
  color: var(--sub); font-size: 1rem; cursor: pointer; font-family: inherit;
}
.lesson .l-info:active { transform: scale(0.94); }

/* ==== レッスンの説明モーダル ==== */
.modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(42, 31, 20, 0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-box {
  background: var(--paper); border: 2px solid var(--border); border-radius: 18px;
  padding: 22px 20px 18px; width: 100%; max-width: 340px;
  box-shadow: 0 16px 48px rgba(74, 50, 30, 0.3);
  position: relative; text-align: center;
  animation: modalIn 0.28s var(--ease-out-expo);
}
@keyframes modalIn {
  from { transform: translateY(16px) scale(0.96); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.modal-box h3 { font-size: 1.2rem; font-weight: 800; color: var(--accent); margin-bottom: 10px; }
.modal-box p { font-size: 0.92rem; color: var(--ink); line-height: 1.7; margin-bottom: 12px; }
.modal-box p b { color: var(--accent); }
.modal-example {
  background: #FFF4E4; border: 1px dashed var(--accent-soft); border-radius: 10px;
  padding: 12px 10px; margin-bottom: 16px;
  font-size: 1.05rem; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.modal-example[hidden] { display: none; }
.modal-example b { color: var(--accent); font-size: 1.2em; }
.modal-box .btn { width: 100%; margin: 0; }
.modal-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; cursor: pointer;
  font-size: 1.4rem; color: var(--sub); line-height: 1; padding: 4px 8px;
}

/* ==== 結果画面の記録 ==== */
.history .bars { display: flex; gap: 6px; height: auto; }
.history .stat {
  flex: 1; background: var(--paper); border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 4px; text-align: center; display: flex; flex-direction: column; gap: 1px;
}
.history .stat span { font-size: 0.6rem; color: var(--sub); }
.history .stat b { font-size: 0.85rem; font-variant-numeric: tabular-nums; }

/* ==== 旧メニュー (未使用だが残す) ==== */
.menu-grid {
  display: grid; gap: 8px; width: 100%; max-width: 380px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 12px;
}
.menu-card {
  background: var(--paper); border: 2px solid var(--border); border-radius: 12px;
  padding: 12px 10px; cursor: pointer; text-align: left;
  font-family: inherit; color: var(--ink);
  box-shadow: 0 2px 6px rgba(74, 50, 30, 0.06);
  transition: transform 90ms, border-color var(--dur-fast), box-shadow var(--dur-fast);
  display: flex; flex-direction: column; gap: 2px;
}
.menu-card:hover { border-color: var(--accent-soft); }
.menu-card:active { transform: scale(0.97); }
.menu-card.wide { grid-column: 1 / -1; }
.menu-card.hero {
  background: linear-gradient(135deg, #FFF1E5 0%, #FFE2D0 100%);
  border-color: var(--accent);
}
.menu-card.hero .m-title { color: var(--accent); }

/* 工程番号。下の工程から順にやる、が読み取れるように */
.m-step { color: var(--wood-dark); font-size: 0.95em; margin-right: 1px; }

/* 仕上げ = 複数の工程がまとめて来る。下が自動化されてから触るもの */
.menu-card.capstone {
  border-color: var(--green); border-style: dashed;
  background: var(--green-soft);
}
.menu-card.capstone .m-step,
.menu-card.capstone .m-tag { color: var(--green); }
.menu-card .m-title { font-weight: 800; font-size: 1rem; }
.menu-card .m-tag { font-size: 0.68rem; color: var(--sub); }
.menu-card .m-best { font-size: 0.68rem; color: var(--green); font-weight: 700; }
/* 学校モードのみ。まだ開いていない工程 */
.menu-card.locked {
  cursor: default; opacity: 0.5; border-style: dashed; background: transparent;
  box-shadow: none;
}
.menu-card.locked:active { transform: none; }
.menu-card.locked .m-title { color: var(--sub); }
.menu-card.locked .m-tag { color: var(--wood-dark); }

/* 習得の段階 */
.m-stage { font-size: 0.68rem; font-weight: 700; }
.m-stage.try { color: var(--sub); font-weight: 600; }
.m-stage.master { color: var(--green); }
.m-stage.expert { color: var(--accent); }

/* 学校モードの帯 */
.school-bar {
  width: 100%; max-width: 380px;
  background: var(--green-soft); border: 1px solid var(--green);
  border-radius: 10px; padding: 8px 12px; margin-bottom: 10px;
  font-size: 0.78rem; color: var(--green); text-align: center;
}
.school-bar[hidden] { display: none; }
.school-bar b { word-break: break-all; }
.school-bar small { color: var(--sub); font-size: 0.68rem; }

/* 習得した瞬間 */
#end-mastered[hidden] { display: none; }
.mastered {
  display: inline-block; margin-top: 6px;
  font-size: 0.78rem; font-weight: 800; color: #fff; background: var(--green);
  border-radius: 999px; padding: 3px 12px;
  animation: badgePop 0.7s var(--ease-out-expo);
}
.section-label {
  width: 100%; max-width: 380px;
  font-size: 0.72rem; color: var(--sub); font-weight: 700;
  letter-spacing: 0.08em; margin: 6px 0 6px;
}

/* ==== ボタン ==== */
.btn {
  display: block; width: 240px; background: var(--accent); color: white; border: none;
  padding: 13px 24px; border-radius: 12px; font-size: 1rem; font-weight: 700;
  cursor: pointer; box-shadow: var(--shadow); margin: 5px;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn.secondary { background: var(--paper); color: var(--accent); border: 2px solid var(--accent); box-shadow: none; }

/* ==== 結果画面 ==== */
.end-scene { position: relative; width: 150px; height: 150px; margin-bottom: 2px; }
#end-mascot { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 12px rgba(74, 50, 30, 0.18)); }
.end-score {
  background: var(--paper); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 22px; margin-bottom: 10px; text-align: center; min-width: 250px;
}
.end-score .big { font-size: 3rem; font-weight: 800; color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; }
.end-score .label { font-size: 0.72rem; color: var(--sub); }
.end-score .title { font-size: 1.05rem; font-weight: 800; color: var(--yellow); margin-top: 4px; }
.end-score .detail { font-size: 0.78rem; color: var(--sub); margin-top: 4px; font-variant-numeric: tabular-nums; }
.end-score .newbest {
  display: inline-block; margin-top: 6px;
  font-size: 0.72rem; font-weight: 800; color: #fff; background: var(--green);
  border-radius: 999px; padding: 2px 10px;
  animation: badgePop 0.7s var(--ease-out-expo);
}
.history {
  width: 100%; max-width: 250px; margin-bottom: 12px;
}
.history .h-label { font-size: 0.68rem; color: var(--sub); margin-bottom: 4px; text-align: center; }
.history .bars { display: flex; align-items: flex-end; gap: 4px; height: 44px; }
.history .bar {
  flex: 1; background: var(--accent-soft); border-radius: 3px 3px 0 0; min-height: 3px;
  transition: height 0.4s var(--ease-out-expo);
}
.history .bar.latest { background: var(--accent); }

/* ==== バッジ (加速通知など) ==== */
/* コンベアの上あたりに出す。式（画面の主役）を隠さない高さ */
.badge {
  position: fixed; top: 52%; left: 50%; transform: translate(-50%, -50%) scale(0);
  background: var(--green); color: white; padding: 12px 22px; border-radius: 16px;
  font-size: 1.25rem; font-weight: 800;
  box-shadow: 0 8px 32px rgba(74, 124, 89, 0.5);
  pointer-events: none; z-index: 90; white-space: nowrap;
}
.badge.hot { background: var(--accent); box-shadow: 0 8px 32px rgba(199, 62, 29, 0.5); }
.badge.show { animation: badgePop 1.1s ease forwards; }
@keyframes badgePop {
  0%   { transform: translate(-50%, -50%) scale(0); }
  30%  { transform: translate(-50%, -50%) scale(1.15); }
  60%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0.9); opacity: 0; }
}

/* ==== 端末高さが狭い場合の圧縮 ==== */
@media (max-height: 700px) {
  .customer-row { height: 44px; }
  .customer { width: 44px; height: 44px; }
  .order { padding: 8px 14px 11px; margin-bottom: 9px; }
  .order .eq { font-size: clamp(2rem, 10vw, 2.8rem); }
  .conveyor-wrap { height: 64px; margin-bottom: 8px; }
  .conveyor { height: 26px; top: 20px; }
  .tortilla-track { width: 56px; height: 56px; }
  .tortilla { font-size: 3rem; }
  .keypad { grid-template-rows: repeat(2, 48px); gap: 6px; }
  .key { font-size: 1.4rem; }
  .mascot { width: 44px; height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .conveyor, .mascot.bounce img.active, .session-meter.low, .hud .speed.blazing { animation: none; }
}
