@charset "UTF-8";
/* =============================================================================
   異世界魔物食堂 — スタイル
   ・上部は全ゲーム共通ヘッダー（--sgh-top）ぶん、下部はタブバー＋広告
     （--ad-space）ぶんを空ける
   ・色はランプの灯る石造りの食堂をイメージした暗い紫＋琥珀
   ============================================================================= */

:root {
  --bg:      #1a1026;
  --bg2:     #241634;
  --panel:   #2c1b40;
  --panel2:  #372150;
  --line:    rgba(255, 255, 255, 0.10);
  --line2:   rgba(255, 255, 255, 0.18);
  --text:    #f5edff;
  --dim:     #b3a2c8;
  --gold:    #ffc861;
  --amber:   #ff9f4a;
  --good:    #6fe0a0;
  --bad:     #ff7f8a;
  --rare:    #cf94ff;
  --wood:    #4a2c1d;

  /* 広告（js/ad-banner.js が --ad-h を書き換える） */
  --ad-h: 0px;
  --ad-space: 0px;
}
html.has-ad-banner { --ad-space: calc(var(--ad-h, 0px) + env(safe-area-inset-bottom, 0px)); }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  /* ダブルタップでの拡大を止める。
     iOS Safari は viewport の user-scalable=no を無視するため、
     こちらで明示する必要がある。スクロールとピンチ操作は残る */
  touch-action: manipulation;
}
body {
  background:
    radial-gradient(1200px 600px at 50% -10%, #3a2150 0%, rgba(58, 33, 80, 0) 60%),
    linear-gradient(180deg, #1e1229 0%, #160e20 100%) fixed;
  min-height: 100dvh;
}

#app {
  max-width: 620px;
  margin: 0 auto;
  /* 上端はタイトル帯を隠したぶん、共通ヘッダーとの間を少しだけ空ける */
  padding: 8px 10px calc(70px + var(--ad-space, 0px));
}

img { display: block; }
/* 連打する箇所（調理・客席・タブ等）は要素側にも指定しておく。
   古い WebKit は祖先の touch-action を辿らないことがあるため */
button, a, .seat, .cook-line, .mslot, .lab-slot, .bcell, .toggle {
  touch-action: manipulation;
}
button { font: inherit; color: inherit; }

/* ---------- ヘッダー ----------
   タイトルだけの帯は縦幅を圧迫するので隠す（ボタンは共通ヘッダーのメニューへ集約済み）。
   h1 と、共通ヘッダーが click() で押す元ボタンは DOM に残すため、display:none ではなく
   スクリーンリーダー向けの不可視にする */
#topbar {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
#logo {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: linear-gradient(180deg, #ffe6a8, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}
#topbar-buttons { display: flex; gap: 6px; }
.icon-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 17px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:active { transform: scale(0.94); }

/* ---------- HUD ---------- */
#hud {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 6px;
  align-items: stretch;
  margin-bottom: 8px;
}
.hud-cell {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.hud-cell > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-ico { font-size: 14px; flex: none; }
.hud-star { color: var(--rare); }
.hud-rank {
  grid-column: 1 / -1;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  color: var(--gold);
}
#hud-rank-bar {
  display: block;
  height: 6px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
#hud-rank-fill {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--gold));
  transition: width 0.35s ease;
}

/* ---------- 汎用パーツ ---------- */
.hidden { display: none !important; }

.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 10px;
}
.panel-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
}
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 800; color: var(--gold); }
.panel-sub { font-size: 11px; color: var(--dim); }
.panel-note { margin: 0 0 8px; font-size: 11.5px; line-height: 1.6; color: var(--dim); }
.panel-note.warn { color: var(--gold); }

.btn {
  border: 1px solid var(--line2);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-primary {
  background: linear-gradient(180deg, #ffb057, #f0821f);
  border-color: #ffcf95;
  color: #3a1a00;
}
.btn-sub { background: rgba(255, 255, 255, 0.07); }
.btn-sub.on { background: rgba(111, 224, 160, 0.22); border-color: var(--good); color: var(--good); }
.btn-danger { background: rgba(255, 90, 100, 0.18); border-color: rgba(255, 120, 130, 0.5); color: #ffb3b8; }
.btn-wide { display: block; width: 100%; margin-top: 8px; text-align: center; }
.btn-mini { padding: 7px 10px; font-size: 12px; border-radius: 9px; }
.btn-seg { padding: 6px 12px; font-size: 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); }
.btn-seg.active { background: var(--gold); border-color: var(--gold); color: #2a1500; }
.row-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.row-btns .btn { flex: 1 1 auto; }
/* 一括購入の切り替え（×1 / ×10 / 最大）は、下の一覧とくっつかないよう余白を空ける */
#equip-buy-mode { margin-bottom: 10px; }
.seg-bar { display: flex; gap: 6px; margin-bottom: 8px; overflow-x: auto; padding-bottom: 2px; }
.seg-bar.wrap { flex-wrap: wrap; overflow: visible; }
.seg-bar::-webkit-scrollbar { display: none; }

.ico { flex: none; }
.ico.round { border-radius: 50%; }

/* ---------- 食堂 ---------- */
#scene {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  padding: 10px 8px 12px;
  margin-bottom: 8px;
  background:
    linear-gradient(180deg, rgba(90, 50, 30, 0) 55%, rgba(74, 44, 29, 0.85) 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 58px, rgba(0, 0, 0, 0.05) 58px 60px),
    linear-gradient(180deg, #3b2450, #2a1839);
  min-height: 150px;
}
#scene-sky {
  position: absolute; left: 50%; top: -46px;
  width: 190px; height: 92px; margin-left: -95px;
  background: radial-gradient(closest-side, rgba(255, 200, 97, 0.5), rgba(255, 200, 97, 0));
  pointer-events: none;
}
#scene-empty {
  position: absolute; inset: auto 0 auto 0; top: 50%;
  transform: translateY(-50%);
  text-align: center; font-size: 12px; color: var(--dim);
  pointer-events: none;
}
#seats {
  position: relative;
  display: grid;
  /* 席が少ないうちに端へ寄って見えないよう、実際の席数ぶんだけ中央に並べる */
  grid-template-columns: repeat(auto-fit, minmax(74px, 92px));
  justify-content: center;
  gap: 6px;
}
.seat {
  position: relative;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  padding: 22px 2px 6px;
  min-height: 96px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  cursor: pointer;
  font: inherit;
}
.seat.empty { opacity: 0.42; cursor: default; }
.seat.ready { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 200, 97, 0.2); animation: readyPulse 1.1s ease-in-out infinite; }
@keyframes readyPulse { 50% { box-shadow: 0 0 0 6px rgba(255, 200, 97, 0.06); } }
.seat.eat { border-color: rgba(111, 224, 160, 0.5); }
.seat-chair { font-size: 22px; opacity: 0.7; }
.seat-bubble {
  position: absolute; top: 2px; left: 2px; right: 2px;
  display: flex; align-items: center; gap: 3px;
  background: rgba(255, 255, 255, 0.93);
  color: #2b1b3d;
  border-radius: 8px;
  padding: 2px 4px;
  min-height: 18px;
}
.seat-bubble:empty { display: none; }
.seat-dish {
  font-size: 9px; font-weight: 700; line-height: 1.15;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.seat-body { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%; }
.seat-name { font-size: 9.5px; color: var(--dim); }
.seat-bar { width: 86%; height: 4px; border-radius: 99px; background: rgba(0, 0, 0, 0.5); overflow: hidden; }
.seat-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff8a5c, var(--gold)); }
.seat.eat .seat-bar i { background: linear-gradient(90deg, #3fd08a, var(--good)); }

#kitchen {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  margin-bottom: 8px;
  background: linear-gradient(180deg, #3a2450, #271738);
}
#kitchen-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px; gap: 8px;
}
.kitchen-title { font-size: 13px; font-weight: 800; color: var(--gold); }
#kitchen-info { font-size: 10.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
#cook-lines {
  display: flex; flex-direction: column; gap: 6px;
  /* 調理台が増えても、宣伝ボタンやログが画面外へ押し出されないようにする */
  max-height: min(46vh, 380px);
  overflow-y: auto;
  scrollbar-width: thin;
}
#cook-lines::-webkit-scrollbar { width: 4px; }
#cook-lines::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 99px; }

/* 調理台。メニューに載せた料理ぶんだけ並び、それぞれ独立して調理が進む */
.cook-line {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  font: inherit; color: inherit; text-align: left;
  cursor: pointer;
}
.cook-line:active { transform: translateY(1px); }
.cook-line.active { border-color: rgba(255, 200, 97, 0.45); }
.cook-line.full   { opacity: 0.72; }
.cook-line.lack   { opacity: 0.66; border-color: rgba(255, 127, 138, 0.35); }
.cl-mid { flex: 1 1 auto; min-width: 0; }
.cl-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cl-name {
  font-size: 12.5px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cl-stock {
  flex: none; font-size: 11px; font-weight: 800; color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.cook-line.full .cl-stock { color: var(--good); }
.cl-bar {
  height: 6px; margin: 4px 0 3px;
  border-radius: 99px; background: rgba(0, 0, 0, 0.5); overflow: hidden;
}
.cl-bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--amber), var(--gold));
}
.cook-line.lack .cl-bar i { background: linear-gradient(90deg, #7a5a66, #a97f8a); }
.cl-sub {
  font-size: 10px; color: var(--dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cook-line.lack .cl-sub { color: var(--bad); }
#kitchen-empty { margin: 4px 0 0; }

.strip-empty { font-size: 11.5px; color: var(--dim); padding: 8px 2px; }

/* ---------- 特別依頼（ランク7で解放） ---------- */
#order-box {
  border: 1px solid rgba(255, 200, 97, 0.35);
  border-radius: 16px;
  padding: 10px;
  margin-bottom: 8px;
  background: linear-gradient(180deg, rgba(255, 200, 97, 0.12), rgba(70, 44, 24, 0.35));
}
#order-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px; gap: 8px;
}
#order-info { font-size: 10.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
#order-list { display: flex; flex-direction: column; gap: 6px; }
.order-row {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.26);
  padding: 7px 9px;
}
.order-top { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.order-c { flex: none; font-size: 11px; font-weight: 800; color: var(--gold); }
.order-d {
  font-size: 12px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.order-bar {
  height: 6px; margin: 4px 0 3px;
  border-radius: 99px; background: rgba(0, 0, 0, 0.5); overflow: hidden;
}
.order-bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #b58cff, var(--gold));
}
.order-sub {
  font-size: 10px; color: var(--dim);
  font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

#boost-row { display: flex; gap: 6px; margin-bottom: 8px; }
.btn-boost {
  flex: 1;
  background: linear-gradient(180deg, rgba(207, 148, 255, 0.28), rgba(207, 148, 255, 0.12));
  border-color: rgba(207, 148, 255, 0.5);
  font-size: 12px;
}

#log-strip {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.24);
  padding: 8px 10px;
  min-height: 40px;
}
.log-line {
  font-size: 11.5px; line-height: 1.65; color: var(--dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.log-line.good { color: var(--good); }
.log-line.bad  { color: var(--bad); }
.log-line.rare { color: var(--gold); font-weight: 700; }

/* ---------- 行レイアウト（一覧共通） ---------- */
.row {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  padding: 9px;
  margin-bottom: 6px;
  font: inherit; color: inherit;
}
.row.locked { opacity: 0.45; }
.row-mid { flex: 1 1 auto; min-width: 0; }
.row-title { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 13px; font-weight: 700; }
.row-sub { font-size: 10.5px; color: var(--dim); line-height: 1.5; margin-top: 2px; }
.row-fx { font-size: 10.5px; color: var(--good); margin-top: 3px; }
.row-right { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 11px; color: var(--dim); }
.row-price { font-size: 12.5px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.row-stock { font-size: 10.5px; color: var(--dim); }
.row-badge { font-size: 10px; color: var(--dim); }
.row-badge.on { color: var(--good); }
.row-lock { font-size: 12px; color: var(--dim); }
.row-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.row-tags.center { justify-content: center; }
.tag {
  font-size: 9.5px; padding: 1px 6px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.11); color: var(--text);
}
.tag.bonus { background: rgba(111, 224, 160, 0.2); color: var(--good); }
.lv { font-size: 10px; padding: 1px 6px; border-radius: 99px; background: rgba(255, 200, 97, 0.2); color: var(--gold); }
.attr { font-size: 9.5px; padding: 1px 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.09); color: var(--dim); }
.q { font-size: 9.5px; padding: 1px 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); }
.q1 { color: #b7c2cf; } .q2 { color: #6fd08c; } .q3 { color: #6cb6ff; }
.q4 { color: #c98cf5; } .q5 { color: var(--gold); }

/* ---------- 料理タブ ---------- */
#menu-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}
.mslot {
  border: 1px dashed var(--line2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 7px 4px;
  min-height: 84px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font: inherit; color: inherit;
  cursor: pointer;
}
.mslot.filled { border-style: solid; border-color: var(--gold); background: rgba(255, 200, 97, 0.1); }
.mslot.empty { color: var(--dim); font-size: 18px; cursor: default; }
.mslot-n { font-size: 9.5px; line-height: 1.25; text-align: center; }
.mslot-p { font-size: 10px; font-weight: 800; color: var(--gold); }

.combo {
  display: flex; flex-direction: column; gap: 2px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 7px 9px;
  margin-bottom: 5px;
  background: rgba(255, 255, 255, 0.03);
}
.combo.on { border-color: var(--good); background: rgba(111, 224, 160, 0.12); }
.combo-n { font-size: 12px; font-weight: 700; }
.combo-d { font-size: 10.5px; color: var(--dim); }
.combo.on .combo-d { color: var(--good); }

.dish-row { cursor: pointer; }
.dish-row.on { border-color: var(--gold); background: rgba(255, 200, 97, 0.09); }

/* ---------- 研究タブ ---------- */
#lab-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.lab-slot {
  border: 1px dashed var(--line2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 9px 4px;
  min-height: 92px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font: inherit; color: inherit; cursor: pointer;
}
.lab-slot.filled { border-style: solid; border-color: var(--rare); background: rgba(207, 148, 255, 0.12); }
.lab-plus { font-size: 22px; color: var(--dim); }
.lab-slot-n { font-size: 10px; text-align: center; line-height: 1.25; }
.lab-slot-c { font-size: 9.5px; color: var(--dim); }
#lab-methods { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.method {
  border: 1px solid var(--line2);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 11px;
  font-size: 12px; font-weight: 700;
  cursor: pointer;
}
.method.on { background: var(--rare); border-color: var(--rare); color: #2a0f3d; }
#lab-bar {
  position: relative;
  height: 22px; border-radius: 99px;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
  margin-bottom: 6px;
}
#lab-fill { display: block; height: 100%; background: linear-gradient(90deg, #8d5cff, var(--rare)); }
#lab-bar-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.hint-line {
  font-size: 11.5px; line-height: 1.65; color: var(--gold);
  border-bottom: 1px dashed var(--line);
  padding: 5px 0;
}
.hint-line:last-child { border-bottom: 0; }

/* ---------- 探索タブ ---------- */
.region {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.04);
}
.region.locked { opacity: 0.7; }
.region-img {
  width: 100%; display: block;
  height: 104px; object-fit: cover; object-position: center 55%;
  background: #120b1c;
}
.region-body { padding: 9px; }
.region-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.region-n { font-size: 14px; font-weight: 800; color: var(--gold); }
.region-lv { font-size: 10.5px; color: var(--dim); }
.region-d { font-size: 10.5px; color: var(--dim); line-height: 1.55; margin: 3px 0 6px; }
.region-drops { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.drop {
  display: flex; align-items: center; gap: 3px;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 99px;
  padding: 2px 8px 2px 3px;
}
.region-bar {
  position: relative;
  height: 8px; border-radius: 99px;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden; margin-bottom: 7px;
}
.region-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #4fc3f7, #6fe0a0); }
.ing-row { cursor: default; }

/* ---------- 設備タブ ---------- */
.auto-row.on { border-color: var(--good); background: rgba(111, 224, 160, 0.1); }
.auto-step {
  flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
}
.auto-row.on .auto-step { background: var(--good); color: #06301c; }
/* 解放済みだが止めている自動化。ロック中と見分けがつくよう、薄くしすぎない */
.auto-row.off { border-color: var(--line2); background: rgba(255, 255, 255, 0.02); }
.auto-row.off .row-title { color: var(--dim); }
.auto-row.off .auto-step { background: rgba(255, 255, 255, 0.06); color: var(--dim); }
.auto-row .row-right { flex-direction: row; align-items: center; gap: 8px; }

/* ---------- 図鑑 ---------- */
#book-rewards { display: flex; flex-direction: column; gap: 4px; margin-bottom: 9px; }
.reward {
  font-size: 10.5px; color: var(--dim);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px; padding: 4px 8px;
}
.reward.got { color: var(--good); background: rgba(111, 224, 160, 0.12); }
#book-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
}
.bcell {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 7px 3px 5px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font: inherit; color: inherit;
  cursor: pointer;
  min-height: 92px;
  justify-content: center;
}
.bcell.unknown { opacity: 0.45; cursor: default; }
.bcell.dim { opacity: 0.42; }
.bcell.fail { border-color: rgba(255, 127, 138, 0.35); }
.bcell-q { font-size: 26px; color: var(--dim); line-height: 44px; }
.bcell-n { font-size: 9.5px; line-height: 1.25; text-align: center; }
.bcell-c { font-size: 9px; color: var(--dim); }
.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 6px;
  max-height: 46vh;
  overflow-y: auto;
  margin: 8px 0;
}

/* ---------- 記録タブ ---------- */
.mission.got { opacity: 0.6; }
.m-bar { height: 6px; border-radius: 99px; background: rgba(0, 0, 0, 0.45); overflow: hidden; margin: 5px 0 3px; }
.m-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), var(--gold)); }
.ach.got .row-title { color: var(--gold); }
.star-row .row-title { color: var(--rare); }
/* 「旅立つ」ボタンと、その下の料理人の星の一覧がくっつかないよう余白を空ける */
#btn-prestige { margin-bottom: 10px; }
/* 転生の確認文は「獲得するもの／リセットされるもの／引き継がれるもの」を改行で区切っている */
#prestige-detail { white-space: pre-line; }
.stat {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 11.5px; color: var(--dim);
  padding: 5px 2px;
  border-bottom: 1px dashed var(--line);
}
.stat:last-child { border-bottom: 0; }
.stat b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- タブバー ---------- */
#tabbar {
  position: fixed;
  left: 0; right: 0;
  bottom: var(--ad-space, 0px);
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0;
  background: #180e24;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html.has-ad-banner #tabbar { padding-bottom: 0; }
.tab {
  border: 0; background: none;
  padding: 6px 0 7px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  cursor: pointer;
  color: var(--dim);
  min-width: 0;
}
.tab-ico { font-size: 17px; line-height: 1; }
.tab-txt { font-size: 9px; font-weight: 700; }
.tab.active { color: var(--gold); }
.tab.active .tab-ico { transform: translateY(-1px); }

/* ---------- フッター ---------- */
#footer {
  padding: 10px 0 6px;
  text-align: center;
  font-size: 11px;
  color: var(--dim);
  line-height: 1.7;
}
#footer a { color: var(--dim); }
.ver-label { opacity: 0.7; }

/* ---------- モーダル ---------- */
.modal {
  position: fixed; inset: 0;
  z-index: 2147483000;
  background: rgba(10, 5, 16, 0.78);
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--sgh-top, 12px) + 6px) 12px calc(14px + var(--ad-space, 0px));
  animation: fadeIn 0.16s ease;
  overflow-y: auto;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal-box {
  width: 100%; max-width: 420px;
  max-height: 100%;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--panel2), var(--bg2));
  border: 1px solid var(--line2);
  border-radius: 18px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  animation: pop 0.2s cubic-bezier(0.2, 1.2, 0.5, 1);
}
@keyframes pop { from { transform: scale(0.92); opacity: 0; } }
.modal-title { margin: 6px 0 8px; font-size: 18px; font-weight: 800; color: var(--gold); }
.modal-box .ico { margin: 0 auto; }
.howto { text-align: left; margin: 0 0 10px; padding-left: 1.1em; }
.howto li { font-size: 12px; line-height: 1.75; margin-bottom: 5px; color: var(--dim); }
.howto b { color: var(--text); }
.menu-section { text-align: left; margin-bottom: 12px; }
.menu-caption { font-size: 11px; color: var(--gold); font-weight: 700; margin-bottom: 5px; }
.menu-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; padding: 8px 2px;
  border-bottom: 1px dashed var(--line);
}
.toggle {
  width: 46px; height: 26px; border-radius: 99px;
  border: 1px solid var(--line2);
  background: rgba(255, 255, 255, 0.1);
  position: relative; cursor: pointer; padding: 0;
}
.toggle .knob {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: left 0.16s ease;
}
.toggle.on { background: var(--good); border-color: var(--good); }
.toggle.on .knob { left: 22px; }

.detail-tag { font-size: 11px; color: var(--dim); margin-bottom: 6px; }
.detail-d { font-size: 12px; line-height: 1.7; color: var(--text); margin: 8px 0; }
.detail-table { text-align: left; margin: 10px 0; }
.kv {
  display: flex; gap: 8px; justify-content: space-between;
  font-size: 11.5px; padding: 5px 2px;
  border-bottom: 1px dashed var(--line);
}
.kv .k { color: var(--dim); flex: none; }
.kv .v { text-align: right; }
.disc-label { font-size: 13px; font-weight: 800; color: var(--gold); letter-spacing: 0.08em; }
.disc-img { animation: discPop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1); margin: 6px auto; }
@keyframes discPop { from { transform: scale(0.3) rotate(-16deg); opacity: 0; } }

.idle-icon { font-size: 42px; }
#idle-time { font-size: 12.5px; color: var(--dim); margin-bottom: 10px; }
#idle-rewards { text-align: left; }
.idle-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; padding: 7px 2px;
  border-bottom: 1px dashed var(--line);
}
.idle-k { flex: 1 1 auto; color: var(--dim); }
.idle-v { color: var(--gold); font-variant-numeric: tabular-nums; }
.idle-ings { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 0; }
.idle-ing {
  display: flex; align-items: center; gap: 3px;
  font-size: 10.5px; background: rgba(255, 255, 255, 0.07);
  border-radius: 99px; padding: 2px 8px 2px 3px;
}

#mini-track {
  position: relative;
  height: 34px; border-radius: 10px;
  background: linear-gradient(90deg, #3b2450, #6a3a2a, #3b2450);
  border: 1px solid var(--line2);
  margin: 14px 0 10px;
  overflow: hidden;
}
#mini-zone { position: absolute; top: 0; bottom: 0; background: rgba(111, 224, 160, 0.45); }
#mini-cursor {
  position: absolute; top: -2px; bottom: -2px; width: 4px; margin-left: -2px;
  background: #fff; box-shadow: 0 0 8px #fff;
}
#mini-result { font-size: 12.5px; min-height: 20px; color: var(--gold); font-weight: 700; margin-bottom: 8px; }

/* ---------- トースト・演出 ---------- */
#toast {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(78px + var(--ad-space, 0px));
  z-index: 2147483100;
  background: rgba(20, 12, 30, 0.95);
  border: 1px solid var(--line2);
  border-radius: 99px;
  padding: 9px 18px;
  font-size: 12.5px;
  max-width: 90vw;
  text-align: center;
  animation: toastIn 0.2s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

#fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 30; }
.fx {
  /* 位置は JS が厨房の真上に合わせる。左右は中心そろえ */
  position: absolute; top: 52%; left: 50%;
  white-space: nowrap;
  font-size: 13px; font-weight: 800; color: var(--gold);
  text-shadow: 0 1px 0 #000, 0 2px 6px rgba(0, 0, 0, 0.85);
  animation: fxUp 1.05s ease-out forwards;
}
@keyframes fxUp {
  from { opacity: 0; transform: translate(-50%, 4px); }
  20%  { opacity: 1; }
  to   { opacity: 0; transform: translate(-50%, -42px); }
}

/* ---------- 広い画面 ---------- */
@media (min-width: 560px) {
  #logo { font-size: 21px; }
  .tab-txt { font-size: 10px; }
  #seats { grid-template-columns: repeat(auto-fit, minmax(84px, 100px)); }
  .region-img { height: 128px; }
}

@media (prefers-reduced-motion: reduce) {
  .modal, .modal-box, .disc-img, .seat.ready, #toast, .fx { animation: none; }
  #hud-rank-fill { transition: none; }
}

/* =============================================================================
   フッター固定バナー広告（スマホ表示時のみ / js/ad-banner.js が挿入する）
   --ad-h    : 広告そのものの高さ。広告なしのときは 0px
   --ad-space: レイアウトが空けるべき高さ（広告 + セーフエリア）
   ========================================================================== */
.ad-banner {
  /* height は広告そのものの高さ。セーフエリアぶんの padding は外側に足す */
  box-sizing: content-box;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  /* ランキング・リザルト等の全画面オーバーレイ（2147483000）よりは下に置く */
  z-index: 2147482000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: var(--ad-h, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow: hidden;
  background: rgba(14, 16, 20, 0.86);
  /* border ではなく inset shadow にして、枠線ぶん高さがずれないようにする */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.ad-banner__frame {
  display: block;
  width: 100%;
  height: var(--ad-h, 0px);
  border: 0;
  color-scheme: light;
}

@media print {
  .ad-banner { display: none; }
}
