/* ランチ戦争 — スマホ縦（375px）基準。外部フォント・画像なし */
:root {
  color-scheme: light;
  --bg: #FFF4E4;
  --paper: #FFFDF8;
  --ink: #2A1B12;
  --muted: #8B7563;
  --line: #EBDCC6;
  --tomato: #D7462A;
  --tomato-d: #A9321C;
  --basil: #2E7D4F;
  --basil-l: #DDF1E3;
  --sea: #157A8A;
  --gold: #E9A23B;
  --wood: #F2DFC4;
  --wood-d: #E3C9A6;
  --steel: #D5D9DD;
  --kitchen: #3A2A20;
  --kitchen-2: #4A372B;
  --danger: #C62828;
  --radius: 14px;
  --shadow: 0 2px 0 rgba(42, 27, 18, .08), 0 6px 16px rgba(42, 27, 18, .08);
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; touch-action: manipulation; cursor: pointer; }
button:disabled { cursor: default; }
small { font-size: 12px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.pos { color: var(--basil); }
.neg { color: var(--danger); }

#app {
  max-width: 480px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}
@media (min-width: 520px) {
  body { background: #E9DCC8; }
  #app { box-shadow: 0 0 0 1px var(--line), 0 10px 40px rgba(0,0,0,.15); }
}

.screen { display: none; height: 100%; flex-direction: column; }
.screen.active { display: flex; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 16px 20px; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; flex-direction: column;
  min-height: 44px; padding: 8px 16px;
  border: 2px solid var(--ink); border-radius: 12px;
  background: var(--paper); font-weight: 700;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform .06s, box-shadow .06s;
}
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: .45; box-shadow: none; }
.btn.primary { background: var(--tomato); color: #fff; border-color: var(--tomato-d); box-shadow: 0 3px 0 var(--tomato-d); }
.btn.primary:active:not(:disabled) { box-shadow: 0 1px 0 var(--tomato-d); }
.btn.ghost { background: transparent; border-color: var(--line); box-shadow: none; color: var(--ink); font-weight: 600; }
.btn.big { min-height: 56px; font-size: 18px; }
.btn.big small { font-size: 12px; font-weight: 600; opacity: .9; }
.btn.sm { min-height: 38px; padding: 4px 12px; font-size: 14px; }
.btn.grow { flex: 1; }
.btn.reward { width: 100%; margin-top: 8px; background: #FFF3D6; border-color: var(--gold); box-shadow: 0 3px 0 #C98A2C; font-size: 14px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 0;
  background: rgba(255,255,255,.18); font-size: 20px; line-height: 1;
}
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 8px; font-size: 13px; }

/* ---------- 上下バー ---------- */
.bar {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: var(--tomato); color: #fff; font-size: 14px;
}
.bar .muted { color: rgba(255,255,255,.75); }
.bar-right b { font-size: 16px; }
.dock {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 16px calc(10px + var(--safe-b));
  background: var(--paper); border-top: 1px solid var(--line);
}

/* ---------- タイトル ---------- */
#screen-title {
  background:
    repeating-linear-gradient(0deg, rgba(215,70,42,.10) 0 18px, transparent 18px 36px),
    repeating-linear-gradient(90deg, rgba(215,70,42,.10) 0 18px, transparent 18px 36px),
    var(--bg);
}
.title-wrap {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(16px + var(--safe-t)) 20px calc(16px + var(--safe-b)); text-align: center; overflow-y: auto;
}
.title-hero { position: relative; font-size: 84px; line-height: 1; filter: drop-shadow(0 6px 0 rgba(42,27,18,.12)); }
.hero-plate { display: inline-block; animation: bob 2.4s ease-in-out infinite; }
.steam { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 28px; color: var(--muted); opacity: .6; animation: steam 2.4s ease-in-out infinite; }
.title-kicker { margin: 10px 0 0; font-size: 13px; letter-spacing: .2em; color: var(--tomato-d); font-weight: 700; }
.title-main {
  margin: 2px 0 0; font-size: 52px; line-height: 1.05; font-weight: 900; letter-spacing: .04em;
  color: var(--tomato); text-shadow: 3px 3px 0 var(--ink);
  -webkit-text-stroke: 1.5px var(--ink);
}
.title-sub { margin: 8px 0 0; font-size: 18px; font-weight: 800; }
.title-sub b { color: var(--basil); font-size: 26px; }
.best {
  margin: 14px 0 0; padding: 6px 12px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--line); font-size: 13px;
}
.title-btns { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; margin-top: 18px; }
.title-btns .btn.ghost { background: rgba(255, 253, 248, .9); }
.title-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; max-width: 340px; text-align: left; color: var(--muted); }
.title-foot .icon-btn { background: var(--paper); border: 1px solid var(--line); flex: none; }

/* ---------- カード（準備・締め） ---------- */
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 8px; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card h3 small { color: var(--muted); font-weight: 600; }
.hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.hint b { color: var(--ink); }
.lesson { background: #FFF8E1; border-color: #F1D79A; }
.lesson-head { font-size: 12px; font-weight: 800; color: #8A6A1C; letter-spacing: .05em; }
.lesson-title { font-size: 19px; font-weight: 900; margin: 2px 0 4px; }
.lesson p { margin: 0; font-size: 14px; }
.lessons { margin: 6px 0 0; padding: 0; list-style: none; }
.lessons li { display: flex; gap: 8px; padding: 6px 0; border-top: 1px dashed #EBD59A; font-size: 14px; }
.lessons li:first-child { border-top: 0; }
.lessons li span { flex: none; }

.forecast { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; padding: 10px; }
.fc-item { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.fc-item small { color: var(--muted); }
.fc-item b { font-size: 16px; }
.fc-item.hl { background: var(--basil-l); border-radius: 10px; padding: 4px; }
.fc-item.hl b { font-size: 20px; color: var(--basil); }
.stars { color: var(--gold); letter-spacing: -1px; font-size: 14px; }

.tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.tag.up { background: #FDE3DC; color: var(--tomato-d); }
.tag.down { background: #DCEFF2; color: var(--sea); }

.stepper { display: flex; align-items: center; justify-content: center; gap: 12px; }
.stepper output { min-width: 84px; text-align: center; font-size: 26px; font-weight: 900; }
.stepper output small { font-size: 13px; color: var(--gold); margin-left: 2px; }
.step {
  width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--ink);
  background: var(--paper); font-size: 24px; font-weight: 900; line-height: 1; box-shadow: 0 3px 0 var(--ink);
}
.step:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.step:disabled { opacity: .3; box-shadow: none; }
.stepper.sm { gap: 6px; }
.stepper.sm output { min-width: 44px; font-size: 20px; }
.stepper.sm .step { width: 40px; height: 40px; font-size: 20px; }

.price-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.price-list li { display: flex; flex-direction: column; align-items: center; background: var(--bg); border-radius: 10px; padding: 6px 4px; font-size: 13px; }
.price-list b { font-size: 16px; }
.price-list small { color: var(--muted); font-size: 11px; }

.prep-row { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; padding: 6px 0; border-top: 1px dashed var(--line); }
.prep-row:first-of-type { border-top: 0; }
.prep-name { font-weight: 800; font-size: 16px; }
.prep-hint { grid-column: 1; grid-row: 2; font-size: 12px; color: var(--muted); }
.prep-row .stepper { grid-column: 2; grid-row: 1 / span 2; }
.bonus { margin: 8px 0 0; padding: 6px 10px; background: #FFF3D6; border-radius: 8px; font-size: 13px; font-weight: 700; }

.shop-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px dashed var(--line); }
.shop-row:first-of-type { border-top: 0; }
.shop-info { display: flex; flex-direction: column; min-width: 0; }
.shop-info small { color: var(--muted); }
.shop-btns { display: flex; gap: 6px; flex: none; }

.cost-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cost-sum > div { display: flex; flex-direction: column; }
.cost-sum b { font-size: 18px; }
.cost-sum small { color: var(--muted); }
.cost-sum.warn { border-color: var(--danger); background: #FFF0EE; }
.warn-text { grid-column: 1 / -1; margin: 0; color: var(--danger); font-size: 13px; font-weight: 700; }

/* ---------- 営業画面 ---------- */
#screen-service { background: var(--wood); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.hud {
  display: grid; grid-template-columns: auto 1fr auto auto auto; align-items: center; gap: 8px;
  padding: calc(6px + var(--safe-t)) 10px 6px; background: var(--tomato); color: #fff;
}
.hud-day { font-weight: 900; font-size: 15px; display: flex; flex-direction: column; line-height: 1.1; }
.hud-day small { font-size: 13px; }
.hud-time { text-align: center; }
.hud-time b { font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; }
.hud-time small { margin-left: 2px; }
.hud-sales { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; min-width: 78px; }
.hud-sales small { font-size: 11px; opacity: .85; }
.hud-sales b { font-size: 17px; font-variant-numeric: tabular-nums; }
.timebar { height: 6px; background: var(--tomato-d); }
.timebar i { display: block; height: 100%; background: var(--gold); transform-origin: left center; }
.timebar i.late { background: #fff; }

.dining { flex: 1; min-height: 0; position: relative; padding: 8px 10px; display: flex; flex-direction: column;
  background:
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(160,110,60,.10) 46px 48px),
    var(--wood);
}
.coach {
  flex: none; margin-bottom: 8px;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; line-height: 1.4;
  padding: 8px 12px; border-radius: 10px; box-shadow: var(--shadow);
  animation: pulse 1.6s ease-in-out infinite;
}
.coach[hidden] { display: none; }
.seats { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: 8px; min-height: 0; }
.seat {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--paper); border-radius: 16px; border: 2px solid var(--wood-d);
  box-shadow: 0 3px 0 var(--wood-d); padding: 6px 4px 10px; min-height: 0; cursor: pointer;
}
.seat.empty { background: rgba(255,253,248,.45); border-style: dashed; box-shadow: none; cursor: default; }
.seat.empty .face { opacity: .35; font-size: 30px; }
.seat.empty.fx .face { opacity: 1; font-size: 40px; animation: pop .7s ease-out; }
.seat.tint1 { background: #FFF7F0; }
.seat.tint2 { background: #F6FBF7; }
.seat.tint3 { background: #F4F8FB; }
.face { font-size: 38px; line-height: 1; }
.bubble {
  position: absolute; top: 6px; right: 6px; display: flex; align-items: center; gap: 1px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 1px 6px; font-size: 20px; line-height: 1.3;
}
.seat.empty .bubble, .seat.empty .pbar { display: none; }
.badge { font-size: 14px; }
.pbar { position: absolute; left: 10px; right: 10px; bottom: 7px; height: 6px; border-radius: 3px; background: rgba(42,27,18,.1); overflow: hidden; }
.pbar i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--basil); }
.pbar i.mid { background: var(--gold); }
.pbar i.low { background: var(--danger); }
.seat.st-ready { border-color: var(--basil); box-shadow: 0 0 0 3px rgba(46,125,79,.35), 0 3px 0 var(--basil); animation: glow 1s ease-in-out infinite; }
.seat.st-cooking { border-color: var(--gold); }
.seat.st-soldout { filter: grayscale(.8); opacity: .75; }
.seat.hurry .face { animation: shake .35s linear infinite; }
.float {
  position: absolute; top: 30%; left: 50%; transform: translateX(-50%);
  font-weight: 900; font-size: 18px; color: var(--basil); text-shadow: 0 1px 0 #fff, 0 0 4px #fff;
  pointer-events: none; animation: floatUp .9s ease-out forwards; white-space: nowrap; z-index: 2;
}

.kitchen { background: var(--kitchen); color: #F6EADB; padding: 6px 10px calc(8px + var(--safe-b)); }
.klabel { font-size: 12px; font-weight: 700; color: #E5CDB2; margin: 2px 2px 4px; }
.klabel small { color: #B49A80; font-weight: 500; margin-left: 4px; }
.pass-wrap { background: var(--steel); color: var(--ink); border-radius: 12px; padding: 4px 8px 8px; margin-bottom: 6px; }
.pass-wrap .klabel { color: #4E5A63; }
.pass-wrap .klabel small { color: #75818A; }
.pass { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.plate {
  height: 44px; border-radius: 50%; border: 2px dashed rgba(0,0,0,.15); background: transparent;
  font-size: 24px; line-height: 1; padding: 0;
}
.plate.has { background: #fff; border: 2px solid #AEB6BD; box-shadow: 0 2px 0 #AEB6BD; animation: pop .25s ease-out; }
.plate.has.wanted { border-color: var(--basil); box-shadow: 0 0 0 3px rgba(46,125,79,.35); }
.burners { display: grid; grid-template-columns: repeat(var(--n, 2), 1fr); gap: 6px; margin-bottom: 6px; }
.burner {
  position: relative; display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 8px;
  border-radius: 10px; background: var(--kitchen-2); border: 1px solid #5B4637; overflow: hidden;
}
.burner.idle .b-label { color: #8E7764; }
.burner.on { background: #5A3A26; border-color: #E9A23B; }
.burner.on::before { content: ''; position: absolute; inset: auto 0 0 0; height: 4px; background: linear-gradient(90deg, #FF7A1A, #FFC64D, #FF7A1A); opacity: .8; animation: flame .6s linear infinite alternate; }
.burner.blocked { border-color: var(--danger); }
.b-dish { font-size: 22px; }
.b-label { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-bar { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: rgba(255,255,255,.08); }
.b-bar i { display: block; height: 100%; width: 0; background: #FFC64D; }
.menu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.menu-btn {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 6px; align-items: center;
  min-height: 60px; padding: 6px 8px; border-radius: 12px; text-align: left;
  background: #F6EADB; color: var(--ink); border: 0; box-shadow: 0 3px 0 #B49A80;
}
.menu-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #B49A80; }
.m-emoji { grid-row: 1 / span 2; font-size: 28px; line-height: 1; }
.m-name { font-weight: 800; font-size: 14px; line-height: 1.2; }
.m-price { display: none; }
.m-left { font-size: 12px; color: var(--muted); }
.m-left b { color: var(--ink); font-size: 15px; }
.menu-btn.low .m-left b { color: var(--danger); }
.menu-btn.out { opacity: .45; box-shadow: none; }
.menu-btn.out .m-left::after { content: ' 売切'; color: var(--danger); font-weight: 800; }
.menu-note { font-size: 11px; color: #B49A80; text-align: center; margin-top: 4px; }
@media (min-height: 720px) {
  .m-price { display: block; grid-column: 2; font-size: 12px; color: var(--muted); }
  .menu-btn { grid-template-rows: auto auto auto; }
  .m-emoji { grid-row: 1 / span 3; }
}

/* ---------- 締め ---------- */
.grade-card {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin-bottom: 12px;
  border-radius: var(--radius); color: #fff; box-shadow: var(--shadow);
}
.grade { font-size: 64px; font-weight: 900; line-height: 1; text-shadow: 3px 3px 0 rgba(0,0,0,.2); }
.grade-txt { display: flex; flex-direction: column; }
.grade-txt b { font-size: 20px; }
.g-S { background: linear-gradient(135deg, #E9A23B, #D7462A); }
.g-A { background: var(--basil); }
.g-B { background: var(--sea); }
.g-C { background: #7A6A5C; }
.g-D { background: var(--danger); }
.pl-row { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; padding: 6px 0; border-top: 1px dashed var(--line); }
.pl-row:first-child { border-top: 0; }
.pl-row span { font-weight: 700; }
.pl-row b { font-size: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.pl-row small { grid-column: 1 / -1; color: var(--muted); text-align: right; margin-top: -2px; }
.pl-row small:empty { display: none; }
.pl-row.sub span, .pl-row.sub b { font-size: 13px; font-weight: 600; color: var(--muted); padding-left: 12px; }
.pl-row.sub.bad b { color: var(--danger); }
.pl-row.total { border-top: 2px solid var(--ink); margin-top: 4px; }
.pl-row.total b { font-size: 24px; }
.stack { position: relative; display: flex; height: 18px; border-radius: 9px; overflow: hidden; background: var(--bg); margin-top: 10px; }
.stack i { display: block; height: 100%; }
.s-f { background: var(--tomato); }
.s-l { background: var(--sea); }
.s-p { background: var(--basil); }
.fl-line { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); }
.sales-mark { position: absolute; top: 0; bottom: 0; width: 3px; background: #fff; box-shadow: 0 0 0 1px var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 3px; vertical-align: -1px; }
.fl { margin-top: 8px; padding: 6px 10px; border-radius: 8px; font-size: 14px; }
.fl.ok { background: var(--basil-l); }
.fl.ng { background: #FDE9E4; }
.guests { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; text-align: center; padding: 10px 6px; }
.guests div { display: flex; flex-direction: column; align-items: center; }
.guests span { font-size: 22px; line-height: 1.1; }
.guests b { font-size: 18px; }
.guests small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.mini { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.alert { background: #FFF0EE; border-color: var(--danger); color: var(--danger); font-weight: 800; }

/* ---------- シーズン ---------- */
.rank-card { text-align: center; padding: 18px 12px; margin-bottom: 12px; border-radius: var(--radius); background: var(--paper); border: 2px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.rank-emoji { font-size: 64px; line-height: 1; }
.rank-title { font-size: 30px; font-weight: 900; color: var(--tomato); margin-top: 4px; }
.rank-gain { font-size: 16px; margin-top: 4px; }
.rank-gain b { font-size: 22px; }
.rank-best { margin-top: 6px; font-weight: 800; color: var(--gold); }
.rank-sub { margin-top: 6px; color: var(--muted); font-size: 13px; }
table.days { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.days th, .days td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: right; }
.days th:first-child, .days td:first-child { text-align: left; }
.days th { color: var(--muted); font-weight: 600; font-size: 12px; }
.days td.g { text-align: center; color: #fff; font-weight: 900; border-radius: 6px; }

/* ---------- モーダル・広告・課金 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(42, 27, 18, .55);
}
.overlay[hidden] { display: none; }
.overlay.top { z-index: 60; }
.modal {
  width: 100%; max-width: 400px; max-height: calc(100dvh - 32px); overflow-y: auto;
  background: var(--paper); border-radius: 18px; padding: 18px 16px; box-shadow: 0 20px 50px rgba(0,0,0,.3);
  display: flex; flex-direction: column; gap: 10px; animation: rise .18s ease-out;
}
.modal.center { text-align: center; }
.modal.wide { max-width: 460px; }
.modal h2 { margin: 0; font-size: 20px; }
.modal h2 small { font-size: 12px; color: var(--muted); font-weight: 600; }
.modal p { margin: 0; }
.howto { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.howto small { color: var(--muted); }

.ad-modal { background: #1E1E1E; color: #eee; text-align: center; gap: 12px; }
.ad-label {
  align-self: center; font-size: 12px; font-weight: 800; letter-spacing: .1em;
  border: 1px solid #888; border-radius: 4px; padding: 2px 8px; color: #ddd;
}
.ad-box {
  border: 2px dashed #666; border-radius: 12px; padding: 28px 12px; min-height: 220px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: repeating-linear-gradient(45deg, #262626 0 12px, #2C2C2C 12px 24px);
}
.ad-icon { font-size: 48px; }
.ad-box small { color: #aaa; }
.ad-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ad-foot span { color: #bbb; font-size: 13px; flex-basis: 100%; }
.ad-foot .btn { flex: 1; }
.ad-foot .btn { color: var(--ink); }
.ad-foot .btn.primary { color: #fff; }
.ad-modal .link { color: #aaa; }
.price { color: var(--tomato); }
.iap-list { margin: 0; padding-left: 20px; text-align: left; font-size: 14px; }
.iap-msg { padding: 10px; border-radius: 10px; background: #FFF3D6; font-weight: 800; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.kpis div { background: var(--bg); border-radius: 10px; padding: 6px 8px; display: flex; flex-direction: column; }
.kpis b { font-size: 22px; }
.kpis small { font-size: 11px; color: var(--muted); word-break: break-all; }
dl.dbg { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; font-size: 13px; }
dl.dbg dt { color: var(--muted); }
dl.dbg dd { margin: 0; font-weight: 700; }
.tbl-wrap { overflow-x: auto; }
.dbg-table td, .dbg-table th { white-space: nowrap; }
.dbg-pre { white-space: pre-wrap; word-break: break-all; font-size: 11px; background: var(--bg); padding: 8px; border-radius: 8px; max-height: 180px; overflow: auto; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.debug-fab {
  position: fixed; left: 8px; bottom: calc(96px + var(--safe-b)); z-index: 40;
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; font-size: 20px; box-shadow: var(--shadow);
}

/* ---------- トースト ---------- */
#toasts {
  position: fixed; left: 50%; top: calc(72px + var(--safe-t)); transform: translateX(-50%); z-index: 70;
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; width: min(92vw, 420px);
}
.toast {
  padding: 6px 14px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700;
  box-shadow: var(--shadow); animation: rise .15s ease-out; transition: opacity .35s, transform .35s; max-width: 100%;
}
.toast.good { background: var(--basil); }
.toast.bad { background: var(--danger); }
.toast.out { opacity: 0; transform: translateY(-6px); }
.noscript { padding: 20px; text-align: center; }

/* ---------- 動き ---------- */
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes steam { 0%, 100% { opacity: .2; transform: translate(-50%, 0); } 50% { opacity: .7; transform: translate(-50%, -6px); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .82; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 3px rgba(46,125,79,.35), 0 3px 0 var(--basil); } 50% { box-shadow: 0 0 0 6px rgba(46,125,79,.18), 0 3px 0 var(--basil); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
@keyframes pop { 0% { transform: scale(.6); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 6px); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -34px); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes flame { from { opacity: .55; } to { opacity: .95; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* lab brand */

:root{--bg:#fbfcfa;--paper:#fff;--ink:#18362e;--muted:#53665d;--line:#d8e2d9;--tomato:#185d47;--tomato-d:#104332;--basil:#185d47;--basil-l:#edf3ec;--wood:#edf3ec;--wood-d:#adc2b3;--radius:8px}
body{background:#edf3ec}#screen-title{background:#fbfcfa}.title-main{color:#185d47;text-shadow:none;-webkit-text-stroke:0;font-size:46px;letter-spacing:.03em}.title-kicker{letter-spacing:.06em}.btn{border-radius:6px;box-shadow:none}.btn.primary{box-shadow:none}.title-btns .btn.ghost{background:#fff}#app{height:calc(100dvh - 55px)}@media(max-width:600px){#app{height:calc(100dvh - 83px)}}
