/*
  店ごとのテーマ色はここだけ差し替えれば全体に反映される。
  --forest 系 = 店のメインカラー（ボタン・注文トレイ・枝色の合図）
  --cream 系  = 背景・ボタン文字（メインカラーの上に載せる明るい色）
*/
:root {
  --cream: #f5f1e7;        /* 画面全体の背景。明るい紙色 */
  --cream-2: #efe9db;      /* 背景グラデの外側。--cream より少し濃く */
  --forest: #3d5136;       /* メインカラー。3ボタン・注文トレイ・吹き出し・選択枠 */
  --forest-deep: #2c3f27;  /* メインカラーの影側（ボタンのグラデ下端） */
  --ink: #20251f;          /* 本文の文字色。管理小窓のボタン地色にも使う */
  --sage: #718067;         /* 補足文字（説明・カテゴリ・注意書き）の薄い色 */
  --leaf: #24452f;         /* 予備の濃い緑（アクセント用） */
  --night: #07140c;        /* 管理小窓（監視カメラ風）の地色 */
  --focus: #d9a441;        /* キーボード/リモコン操作時のフォーカス枠。明暗どちらでも見える色 */
  --glow: #6f9a5f;         /* 「呼び出し中」に画面外周で点滅する枝色 */
  --admin-w: min(240px, 34vw); /* 右下の管理小窓の幅。3ボタンはこの分だけ避けて配置される */

  /* 待機サイネージ（誰もいないときの看板）の寸法。横向きは左 40% に縦積み */
  --signage-w: clamp(280px, 40vw, 520px);      /* 横向きでの看板の幅 */
  --signage-bottom: 140px;                     /* 3ボタン＋プライバシー文の高さ分。看板はこの上で止まる */
  --signage-photo: clamp(40px, 6.4vh, 56px);   /* 品目カードの写真の一辺。低い画面では自動で縮む */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---------- ボタン共通（タッチ品質） ---------- */

button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

button:focus-visible,
.menu-card:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.action,
.menu-sheet__close,
.menu-sheet__submit,
.order-tray__btn,
.admin__btns button,
.overlay__btn {
  min-height: 48px;
  min-width: 48px;
}

html,
body {
  height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
}

[hidden] {
  display: none !important;
}

audio {
  display: none;
}

/* ---------- 開始画面 ---------- */

.overlay {
  min-height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 20px;
  padding: 32px 28px;
  text-align: center;
  background:
    radial-gradient(120% 90% at 50% 0%, var(--cream) 0%, var(--cream-2) 100%);
}

.overlay__mark {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--cream);
  font-weight: 900;
  font-size: 28px;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(44, 63, 39, 0.18);
}

.overlay h1 {
  font-size: 30px;
  letter-spacing: 0.22em;
  color: var(--forest);
  font-weight: 900;
}

.overlay__lead {
  max-width: 28em;
  line-height: 1.8;
  color: var(--sage);
  font-size: 15px;
}

.overlay__btn {
  appearance: none;
  border: 0;
  margin-top: 10px;
  padding: 15px 42px;
  border-radius: 999px;
  background: var(--forest);
  color: var(--cream);
  font: inherit;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 10px 28px rgba(44, 63, 39, 0.28);
}

.overlay__btn:active {
  transform: translateY(1px);
}

.overlay__error {
  color: #8a3a32;
  font-size: 14px;
  max-width: 28em;
}

/* ---------- 窓口ステージ ---------- */

.stage {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 14px;
  background:
    radial-gradient(140% 100% at 50% 0%, #f8f4ea 0%, var(--cream) 46%, var(--cream-2) 100%);
}

.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(255, 253, 247, 0.6), transparent 30%),
    radial-gradient(90% 60% at 50% 100%, rgba(61, 81, 54, 0.06), transparent 70%);
}

/* 呼び出し中の合図: 画面外周に枝色のグローが 1 秒周期で点滅する（body.is-calling で ON） */
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 0 0 var(--glow);
}

body.is-calling .stage::after {
  animation: calling-glow 1s ease-in-out infinite;
}

@keyframes calling-glow {
  0%,
  100% {
    opacity: 0.35;
    box-shadow:
      inset 0 0 0 3px var(--glow),
      inset 0 0 24px 4px var(--glow);
  }
  50% {
    opacity: 1;
    box-shadow:
      inset 0 0 0 4px var(--glow),
      inset 0 0 56px 14px var(--glow);
  }
}

.character {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  z-index: 1;
}

.character canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- 3ボタン ---------- */

.actions {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  /* 右下の管理小窓（--admin-w）と重ならない幅に収める。広い画面では従来どおり 700px */
  width: min(92vw, clamp(300px, calc(100vw - 2 * var(--admin-w) - 72px), 700px));
  margin-top: 4px;
  padding: 0 4px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.action {
  appearance: none;
  border: 0;
  border-radius: 22px;
  padding: 18px 10px 16px;
  background: linear-gradient(180deg, var(--forest) 0%, var(--forest-deep) 100%);
  color: var(--cream);
  font: inherit;
  text-align: center;
  box-shadow:
    0 10px 26px rgba(44, 63, 39, 0.24),
    inset 0 1px 0 rgba(245, 241, 231, 0.18);
}

.action__label {
  display: block;
  font-weight: 900;
  font-size: clamp(17px, 2.6vw, 22px);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.action__sub {
  display: block;
  margin-top: 5px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  opacity: 0.68;
}

.action:active {
  transform: translateY(1px);
}

.privacy {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--sage);
  opacity: 0.62;
}

/* ---------- 吹き出し ---------- */

.bubble {
  position: absolute;
  top: 8%;
  right: 20%;
  max-width: 36vw;
  padding: 14px 20px;
  border-radius: 24px 24px 24px 8px;
  background: var(--forest);
  color: var(--cream);
  font-size: clamp(16px, 2.6vw, 22px);
  font-weight: 700;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 6;
  pointer-events: none;
  box-shadow: 0 12px 30px rgba(44, 63, 39, 0.28);
}

.bubble.is-on {
  opacity: 1;
  transform: translateY(0);
}

/* 注文トレイが出ているあいだは、吹き出しをトレイの左に寄せて重ねない */
.stage:has(.order-tray:not([hidden])) .bubble {
  right: calc(min(280px, 46vw) + 28px);
}

/* ---------- メニュー（透過・下から） ---------- */

.menu-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  width: auto;
  z-index: 12;
  display: flex;
  flex-direction: column;
  background: linear-gradient(to top, rgba(24, 30, 22, 0.5), rgba(24, 30, 22, 0.14) 52%, transparent);
  padding: 16px 0 14px;
  animation: sheet-in 0.24s ease-out;
  pointer-events: auto;
}

@keyframes sheet-in {
  from {
    transform: translateY(26px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.menu-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 12px;
}

.menu-sheet__title {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.32em;
  color: var(--cream);
  font-weight: 600;
  font-size: 13px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

.menu-sheet__close {
  appearance: none;
  border: 0;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.menu-sheet__rail {
  display: flex;
  gap: 16px;
  align-items: stretch;
  overflow-x: auto;
  padding: 2px 24px 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.menu-sheet__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 24px 0;
}

.menu-sheet__summary {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--cream);
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-sheet__submit {
  appearance: none;
  border: 0;
  flex: 0 0 auto;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  font-size: 15px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.menu-sheet__submit:disabled {
  opacity: 0.45;
}

.menu-sheet__submit:not(:disabled):active {
  transform: translateY(1px);
}

.order-tray {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 14;
  display: grid;
  gap: 8px;
  width: min(280px, 46vw);
  padding: 14px 16px 14px;
  border-radius: 18px;
  background: var(--forest);
  color: var(--cream);
  box-shadow: 0 14px 34px rgba(24, 30, 22, 0.3);
  animation: tray-in 0.22s ease-out;
}

@keyframes tray-in {
  from {
    transform: translateX(32px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.order-tray__label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.24em;
  color: #c9d6b6;
}

.order-tray__list {
  list-style: none;
  display: grid;
  gap: 6px;
  max-height: 34vh;
  overflow-y: auto;
  padding-right: 2px;
}

.order-tray__list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  padding-left: 14px;
  position: relative;
}

.order-tray__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c9d6b6;
}

.order-tray__name {
  flex: 1 1 auto;
  min-width: 0;
}

.order-tray__price {
  flex: 0 0 auto;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 600;
  font-size: 13px;
  color: #e6e0cf;
}

.order-tray__total {
  display: flex;
  justify-content: flex-end;
  padding-top: 6px;
  border-top: 1px solid rgba(245, 241, 231, 0.22);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 15px;
  font-weight: 600;
}

.order-tray__btn {
  appearance: none;
  border: 0;
  margin-top: 2px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  font-size: 13px;
}

.order-tray__btn:active {
  transform: translateY(1px);
}

.menu-card {
  flex: 0 0 auto;
  width: min(248px, 64vw);
  scroll-snap-align: center;
  border-radius: 24px;
  padding: 12px 14px 15px;
  background: #fffdf7;
  border: 1.5px solid var(--forest);
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: 0 14px 34px rgba(24, 30, 22, 0.22);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.menu-card:active {
  transform: translateY(1px);
}

.menu-card.is-selected {
  transform: translateY(-4px);
  border-color: var(--forest);
  box-shadow:
    0 18px 40px rgba(24, 30, 22, 0.3),
    0 0 0 4px var(--forest);
}

.menu-card.is-selected::after {
  content: "✓ 選んだ";
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--forest);
  color: var(--cream);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 12px rgba(24, 30, 22, 0.35);
}

.menu-card--accent {
  background: linear-gradient(180deg, var(--forest) 0%, var(--forest-deep) 100%);
  color: var(--cream);
  border-color: var(--forest-deep);
}

/* 濃い色のカードは、白いリングを一枚はさんで枝色の枠が見えるようにする */
.menu-card--accent.is-selected {
  box-shadow:
    0 18px 40px rgba(24, 30, 22, 0.3),
    0 0 0 3px var(--cream),
    0 0 0 6px var(--forest);
}

.menu-card--accent.is-selected::after {
  background: var(--cream);
  color: var(--forest);
}

.menu-card__photo {
  position: relative;
  height: 96px;
  border-radius: 18px;
  background: var(--tone, #8a9a7a);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* 写真がある場合: 写真枠いっぱいに角丸で収める（アイコン表示と同じ 96px 枠） */
.menu-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.menu-card__photo:has(.menu-card__img) .menu-card__icon {
  display: none;
}

.menu-card__icon {
  font-weight: 900;
  font-size: 20px;
  color: var(--cream);
  letter-spacing: 0.22em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.menu-card__kind {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--sage);
}

.menu-card--accent .menu-card__kind {
  color: #c9d6b6;
}

.menu-card h3 {
  font-size: 17px;
  font-weight: 900;
  line-height: 1.35;
}

.menu-card__note {
  font-size: 12px;
  line-height: 1.55;
  color: var(--sage);
}

.menu-card--accent .menu-card__note {
  color: #e6e0cf;
}

.menu-card__price {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---------- 管理画面（夜間カメラ） ---------- */

.admin {
  position: fixed;
  right: 14px;
  bottom: 12px;
  width: var(--admin-w);
  max-height: calc(100vh - 24px);
  z-index: 8;
  display: grid;
  gap: 8px;
  transition: opacity 0.2s ease;
}

/* メニューシートが開いているあいだは半透明シートの下で混ざって見えるので、いったん消す */
body:has(.menu-sheet:not([hidden])) .admin {
  opacity: 0;
  pointer-events: none;
}

/* メニュー表示中は下の3ボタンがシートの足元と重なるので引っ込める */
.stage:has(.menu-sheet:not([hidden])) .actions {
  opacity: 0;
  transform: translateY(24px);
  pointer-events: none;
}

.admin__screen {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 14px;
  border: 1.5px solid #16351c;
  background: var(--night);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.32),
    inset 0 0 0 1px #3d7a48;
}

.admin__video,
.admin__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.admin__video {
  filter: grayscale(1) contrast(1.35) brightness(0.82) sepia(1) hue-rotate(70deg) saturate(2.4);
}

.admin__scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.18) 0 1px,
    transparent 1px 4px
  );
  mix-blend-mode: multiply;
}

.admin__hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  background: rgba(4, 16, 8, 0.8);
  color: #9dffa8;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.05em;
}

.admin__rec {
  color: #7cff8d;
}

.admin__btns {
  display: flex;
  gap: 6px;
}

.admin__btns button {
  appearance: none;
  border: 0;
  flex: 1;
  padding: 8px 8px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--cream);
  font: inherit;
  font-size: 12px;
}

.admin__btns button:active {
  transform: translateY(1px);
}

.admin__btns button[aria-pressed="true"] {
  background: #4a2a26;
}

/* ---------- 管理小窓: 注文ログ ---------- */

.admin__log {
  min-width: 0;
  padding: 6px 8px 7px;
  border-radius: 12px;
  border: 1.5px solid #16351c;
  background: rgba(4, 16, 8, 0.92);
  color: #9dffa8;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.03em;
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px #3d7a48;
}

.admin__log-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: #7cff8d;
}

.admin__log-clear {
  appearance: none;
  border: 1px solid rgba(157, 255, 168, 0.4);
  min-height: 32px;
  min-width: 48px;
  padding: 4px 10px;
  border-radius: 8px;
  background: transparent;
  color: #9dffa8;
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.admin__log-clear:active {
  background: rgba(157, 255, 168, 0.14);
}

.admin__log-list {
  list-style: none;
  display: grid;
  gap: 3px;
  margin-top: 5px;
  max-height: 120px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: #3d7a48 transparent;
}

.admin__log-list:empty::after {
  content: "— まだありません —";
  display: block;
  opacity: 0.45;
  font-size: 10px;
}

.admin__log-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 0;
  line-height: 1.4;
  border-bottom: 1px dashed rgba(157, 255, 168, 0.16);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.admin__log-item:last-child {
  border-bottom: 0;
}

/* 声（AI 会話）から入った注文は、先頭に小さな AI ラベルを付けて区別する */
.admin__log-item[data-source="voice"]::before {
  content: "AI";
  flex: 0 0 auto;
  padding: 0 4px;
  border-radius: 4px;
  border: 1px solid currentColor;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.5;
  color: #c9d6b6;
  transform: translateY(-1px);
}

/* ---------- 待機サイネージ（誰もいないときの看板） ---------- */

/*
  js/app.js が誰もいない状態を検知すると <body class="is-idle"> が付き、看板がふわっと出る。
  キャラ（.character, z-index 1）より下・背景（.stage::before）より上に敷くので、
  キャラの体が看板に重なる部分は自然にキャラが手前に見える。
  横向き: 画面左 40% に「見出し → 補助 → 品目 8 行」を縦に積む。
  縦向き: 見出しだけをキャラの頭上に、品目は 2 列にして 3 ボタンのすぐ上に敷く。
*/
.signage {
  position: absolute;
  top: 18px;
  left: 20px;
  bottom: var(--signage-bottom);
  width: var(--signage-w);
  z-index: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-10px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease,
    visibility 0s linear 0.6s;
}

body:not(.is-idle) .signage {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.is-idle .signage {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease,
    visibility 0s;
}

.signage__headline {
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", sans-serif;
  font-weight: 900;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.25;
  letter-spacing: 0.06em;
  color: var(--forest);
  text-shadow: 0 2px 0 rgba(255, 253, 247, 0.9);
}

.signage__sub {
  margin-top: 2px;
  font-size: clamp(12px, 1.3vw, 15px);
  letter-spacing: 0.18em;
  color: var(--sage);
}

.signage__list {
  list-style: none;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  margin-top: 10px;
  /* 上はおすすめバッジ、右は強調時の拡大がはみ出す分の余白 */
  padding: 10px 18px 4px 4px;
  overflow: hidden;
}

.signage__item {
  position: relative;
  display: grid;
  grid-template-columns: var(--signage-photo) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 4px 14px 4px 4px;
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.74);
  color: var(--ink);
  opacity: 0.58;
  transform: scale(0.98);
  transform-origin: left center;
  box-shadow: inset 0 0 0 1px rgba(61, 81, 54, 0.12);
  transition:
    transform 0.5s ease,
    opacity 0.5s ease,
    background-color 0.5s ease,
    color 0.5s ease,
    box-shadow 0.5s ease;
}

/* いま光っている 1 品: 少し大きく、枝色の地にクリーム文字 */
.signage__item.is-active {
  opacity: 1;
  transform: scale(1.03);
  background: var(--forest);
  color: var(--cream);
  box-shadow:
    0 10px 26px rgba(44, 63, 39, 0.28),
    inset 0 1px 0 rgba(245, 241, 231, 0.18);
}

.signage__item--accent::before {
  content: "おすすめ";
  position: absolute;
  top: -8px;
  right: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--focus);
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.4;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

.signage__photo {
  position: relative;
  width: var(--signage-photo);
  aspect-ratio: 1;
  border-radius: 12px;
  background: var(--tone, #8a9a7a);
  color: var(--cream);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.12em;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.signage__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.signage__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: clamp(14px, 1.5vw, 18px);
  line-height: 1.3;
}

.signage__item.is-active .signage__name {
  font-weight: 900;
}

.signage__price {
  flex: 0 0 auto;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 600;
  font-size: clamp(14px, 1.5vw, 18px);
  letter-spacing: 0.02em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- 画面向き・小画面 ---------- */

/* 縦向き: 管理小窓は左上に退避させ、3ボタンは画面幅いっぱいを使う */
@media (orientation: portrait) {
  /* 看板は画面全体に広げ、見出しは頭上（左上の管理小窓を避けて中央寄せ）、品目は足元に 2 列 */
  .signage {
    top: 16px;
    left: 16px;
    right: 16px;
    width: auto;
    transform: translateY(8px);
  }

  body.is-idle .signage {
    transform: translateY(0);
  }

  .signage__headline,
  .signage__sub {
    margin-left: calc(min(200px, 30vw) + 12px);
    text-align: center;
  }

  .signage__headline {
    font-size: clamp(26px, 5vw, 40px);
  }

  .signage__list {
    flex: 0 0 auto;
    margin-top: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    padding: 10px 6px 4px;
  }

  .signage__item {
    --signage-photo: clamp(40px, 5.5vw, 52px);
    transform-origin: center;
  }

  .signage__name,
  .signage__price {
    font-size: clamp(13px, 2.2vw, 17px);
  }

  .actions {
    width: min(700px, 92vw);
    gap: 10px;
  }

  .action__label {
    font-size: clamp(16px, 4.2vw, 22px);
  }

  .admin {
    top: 14px;
    left: 14px;
    right: auto;
    bottom: auto;
    width: min(200px, 30vw);
  }

  .bubble {
    top: 6%;
    max-width: 46vw;
  }

  .stage:has(.order-tray:not([hidden])) .bubble {
    max-width: calc(100vw - min(280px, 46vw) - 28px - min(200px, 30vw) - 28px);
  }
}

/* 低い画面（高さ 600px 以下）: 管理小窓を小さく、ボタン・ログの縦寸を詰める */
@media (max-height: 600px) {
  :root {
    --admin-w: min(200px, 28vw);
    --signage-bottom: 118px; /* 3ボタンが低くなった分、看板を下に伸ばす */
  }

  .stage {
    padding-bottom: 10px;
  }

  .action {
    padding: 12px 10px 10px;
  }

  .action__sub {
    margin-top: 3px;
  }

  .privacy {
    margin-top: 6px;
  }

  .admin {
    gap: 6px;
  }

  .admin__log-list {
    max-height: 72px;
  }

  .order-tray__list {
    max-height: 28vh;
  }

  /* 看板: 補助文を省き、行間を詰めて 8 品を収める */
  .signage {
    top: 12px;
  }

  .signage__sub {
    display: none;
  }

  .signage__headline {
    font-size: clamp(24px, 3vw, 36px);
  }

  .signage__list {
    gap: 3px;
    margin-top: 6px;
  }

  .signage__item {
    padding: 3px 12px 3px 3px;
  }
}

/* 動きを減らす設定: スライド・点滅を止める。呼び出し中は点滅なしの常時表示にする */
@media (prefers-reduced-motion: reduce) {
  .menu-sheet,
  .order-tray {
    animation: none;
  }

  .bubble,
  .menu-card,
  .signage,
  body.is-idle .signage,
  .signage__item {
    transition: none;
  }

  /* 看板のフェードとハイライトの滑らかな移動を切る（表示・非表示は即時） */
  .signage,
  body.is-idle .signage {
    transform: none;
  }

  body.is-calling .stage::after {
    animation: none;
    opacity: 1;
    box-shadow:
      inset 0 0 0 4px var(--glow),
      inset 0 0 40px 10px var(--glow);
  }
}
