/* ぽかぽかラーメン —— ピクセル暖色 UI */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --amber:  #e8a33d;
  --cream:  #f7ead7;
  --red:    #c0392b;
  --brown:  #4a3428;
  --brown2: #6b4f3a;
  --wood:   #8a5a2b;
  --wood-dk:#3d2a1c;
  --paper:  #fff8ec;
  --pink:   #e85a7a;
  --gold:   #f0c14b;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

html, body { height: 100%; }
body {
  background: #1a120e;
  color: var(--brown);
  font-family: "Hiragino Sans", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  display: flex; justify-content: center;
  overflow: hidden;
}

#app {
  width: 100%; max-width: 430px; height: 100dvh;
  display: flex; flex-direction: column;
  background: #2b1f18;
  box-shadow: 0 0 48px rgba(0,0,0,.55);
  position: relative; overflow: hidden;
}

/* ========== 上部 HUD ========== */
#topbar {
  flex-shrink: 0;
  background: linear-gradient(#2a1c12, #1a110c);
  border-bottom: 3px solid #0d0806;
  padding: 8px 8px 6px;
  z-index: 5;
}

.hud-wood {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  background: linear-gradient(180deg, #b07a42 0%, #8b5a2f 45%, #6b4423 100%);
  border: 3px solid #2b1a0e;
  border-radius: 12px;
  box-shadow:
    inset 0 2px 0 rgba(255,220,160,.35),
    inset 0 -2px 0 rgba(0,0,0,.25),
    0 3px 0 #1a0f08;
  padding: 6px 8px;
}

.meter {
  display: flex; align-items: center; gap: 4px;
  min-width: 0;
}
.meter-icon {
  font-size: 16px; line-height: 1; flex-shrink: 0;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.4));
}
.meter-rep .meter-icon { color: #ff6b8a; font-size: 15px; }
.meter-track {
  display: flex; gap: 2px; flex: 1; min-width: 0;
  height: 12px; align-items: center;
}
.meter-track i {
  display: block; flex: 1; height: 10px;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
  background: #2a1c12;
}
.meter-track i.on.gold  { background: linear-gradient(180deg, #ffe08a, #e0a830); }
.meter-track i.on.day   { background: linear-gradient(180deg, #c8d0d8, #7a8898); }
.meter-track i.on.rep   { background: linear-gradient(180deg, #ff9bb0, #e85a7a); }
.meter b {
  font-size: 11px; color: #fff8e8;
  text-shadow: 0 1px 0 #1a0f08;
  font-variant-numeric: tabular-nums;
  min-width: 28px; text-align: right; flex-shrink: 0;
}

.tb-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--cream);
}
.tb-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
#tb-name {
  font-weight: 700;
  color: #ffd98a;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}
.tb-chips {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  max-width: 58%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tb-chips::-webkit-scrollbar { display: none; }
.chip {
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,220,160,.2);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  color: #f0e0c8;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.3;
}
.chip-wood { color: #ffd98a; }
.chip-energy { color: #9fd6ff; }
.chip-buff {
  color: #ffd98a;
  background: rgba(232,163,61,.2);
  max-width: 7.5em;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: nowrap;
}
.tb-actions .mini {
  flex: 0 0 auto;
  white-space: nowrap;
  line-height: 1.2;
  min-height: 28px;
  padding: 4px 9px;
}
.tb-actions .mini-open {
  min-width: 3.2em;
  text-align: center;
}

/* ========== ボタン ========== */
button {
  font-family: inherit; cursor: pointer;
  border: 3px solid var(--brown);
  background: linear-gradient(180deg, #fff8ec, #f0dfc4);
  color: var(--brown);
  border-radius: 8px;
  box-shadow: 0 3px 0 var(--brown), inset 0 1px 0 #fff;
  padding: 6px 10px; font-size: 14px;
}
button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--brown); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
button.mini {
  padding: 3px 8px; font-size: 12px; border-width: 2px;
  box-shadow: 0 2px 0 var(--brown); border-radius: 6px;
  background: linear-gradient(180deg, #fff4e0, #e8d4b0);
  color: #3d2a1c;
}
/* 受取可の赤点 */
#topbar .mini { position: relative; }
.dot {
  position: absolute; top: -3px; right: -3px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #e33; box-shadow: 0 0 0 2px rgba(0,0,0,.3);
  pointer-events: none;
}
button.mini.primary, button.primary {
  background: linear-gradient(180deg, #e85a4a, #c0392b);
  color: #fff; border-color: #7a2218;
  box-shadow: 0 3px 0 #7a2218, inset 0 1px 0 rgba(255,200,180,.4);
}
button.mini-open {
  background: linear-gradient(180deg, #6ecf7a, #3a9e4a);
  color: #fff; border-color: #2a6b34;
  box-shadow: 0 2px 0 #2a6b34;
}
button.mini-open.closed {
  background: linear-gradient(180deg, #7a6a8a, #4a3a5a);
  border-color: #2a1a3a;
  box-shadow: 0 2px 0 #2a1a3a;
}

/* ========== 店舗シーン ========== */
#shop-wrap {
  flex: 1; min-height: 0;
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: #1a120e;
}
#shop-scene {
  flex: none; margin: 0 auto;
  position: relative;
  overflow: hidden;
}
#shop-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  /* fill：canvas 論理座標と同一ストレッチ */
  object-fit: fill;
  object-position: center center;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
  user-select: none;
  transform-origin: 0 0;
}
#shop {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  image-rendering: pixelated;
  z-index: 2;
  transform-origin: 0 0;
}
#hud-overlay {
  position: absolute; inset: 0; z-index: 3;
  pointer-events: none;
}
#hud-overlay button { pointer-events: auto; }
#btn-skip {
  position: absolute; bottom: 10px; left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

#cook-card {
  position: absolute; top: 8%; left: 50%; transform: translateX(-50%);
  background: rgba(30, 18, 10, .9);
  border: 3px solid var(--amber);
  border-radius: 12px;
  padding: 8px 10px 10px;
  min-width: 240px; max-width: 88%;
  color: #ffe9c4;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
  display: flex; flex-direction: column; gap: 6px; align-items: stretch;
}
#cook-card .cook-label {
  font-size: 10px; opacity: .8; letter-spacing: .08em;
  text-align: center; font-weight: 700;
}
.cook-body {
  display: flex; align-items: center; gap: 10px;
}
.cook-thumb-wrap {
  flex-shrink: 0;
  position: relative;
  width: 72px; height: 72px;
  border-radius: 10px;
  border: 2px solid #c07828;
  background:
    radial-gradient(circle at 50% 42%, #5a3a22 0%, #2a180e 100%);
  box-shadow: inset 0 0 0 1px #6b4423, 0 2px 0 #1a1008;
  overflow: visible;
  display: flex; align-items: center; justify-content: center;
  image-rendering: pixelated;
}
#cook-thumb {
  width: 68px; height: 68px;
  border-radius: 8px;
  overflow: hidden;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
/* 大盛りバッジ：調理サムネ付近・全文赤・小さめ */
.cook-large-badge {
  position: absolute;
  top: -8px; right: -10px;
  z-index: 2;
  color: #ff2a2a;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  text-shadow:
    0 0 3px rgba(255, 40, 40, .7),
    0 1px 0 #1a0808,
    1px 0 0 #1a0808,
    -1px 0 0 #1a0808,
    0 -1px 0 #1a0808;
  pointer-events: none;
  transform: rotate(6deg);
  animation: cook-large-pulse 1.1s ease-in-out infinite;
}
@keyframes cook-large-pulse {
  0%, 100% { transform: rotate(6deg) scale(1); }
  50% { transform: rotate(6deg) scale(1.05); }
}
/* 替え玉バッジ：麺だけおかわり */
.cook-kaedama-badge {
  top: auto; bottom: -6px; right: -8px;
  color: #5ec8ff;
  text-shadow:
    0 0 3px rgba(80, 180, 255, .65),
    0 1px 0 #081018,
    1px 0 0 #081018,
    -1px 0 0 #081018,
    0 -1px 0 #081018;
  transform: rotate(-8deg);
  animation: cook-kaedama-pulse 1.2s ease-in-out infinite;
}
@keyframes cook-kaedama-pulse {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  50% { transform: rotate(-8deg) scale(1.06); }
}
.cook-meta {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 4px;
}
#cook-card .cook-name {
  font-size: 13px; font-weight: 700; color: #ffd98a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cook-bar {
  height: 12px; background: #1a1008; border: 2px solid #5a3e28;
  border-radius: 5px; overflow: hidden; margin: 0;
}
.cook-bar i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, #e8a33d, #ffd98a);
  transition: width .25s linear;
}
#btn-hurry { align-self: flex-start; margin-top: 2px; }

#queue-badge {
  position: absolute; left: 8px; top: 12%;
  background: rgba(30,18,10,.85);
  color: #ffe9c4; font-size: 12px;
  border: 2px solid #6b4f3a; border-radius: 8px;
  padding: 4px 8px;
}
#queue-badge b { color: #ffd98a; }

#feed {
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(20,12,8,.92), rgba(15,10,6,.96));
  color: #ffe9c4;
  font-size: 12px; line-height: 1.4;
  padding: 6px 12px;
  border-top: 2px solid #3d2a1c;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-height: 28px;
}

/* 日進捗バー：#shop-scene 底辺（#feed の上）に置く。旧 bottom:28px は feed 文と重なっていた */
#day-progress {
  position: absolute; left: 0; right: auto; bottom: 0; height: 4px; z-index: 4;
  background: linear-gradient(90deg, #e8a33d, #ffd98a);
  pointer-events: none; width: 0%;
  box-shadow: 0 0 6px rgba(232,163,61,.5);
  max-width: 100%;
}

/* ========== 下部ナビ ========== */
#navbar {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 6px calc(8px + var(--safe-b));
  background:
    linear-gradient(180deg, #5a3d28 0%, #3d2a1c 30%, #2a1c12 100%);
  border-top: 3px solid #1a1008;
  box-shadow: inset 0 2px 0 rgba(255,200,120,.12);
}
#navbar button {
  border: none; border-radius: 10px; box-shadow: none;
  background: transparent;
  color: var(--cream);
  display: flex; flex-direction: column; align-items: center;
  padding: 2px 0 2px; gap: 2px;
  min-width: 0;
  transition: transform .1s, background .15s;
}
#navbar button img {
  width: 52px; height: 52px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.35));
  transition: transform .12s;
}
#navbar button.nav-sub img {
  width: 44px; height: 44px;
  opacity: .92;
}
#navbar button span {
  font-size: 10px; font-weight: 600;
  letter-spacing: .02em;
  text-shadow: 0 1px 0 #1a0f08;
  opacity: .9;
}
#navbar button:active { transform: translateY(1px); }
#navbar button:active img { transform: scale(.94); }
#navbar button.active {
  background: rgba(232,163,61,.22);
  box-shadow: inset 0 0 0 2px rgba(232,163,61,.45);
}
#navbar button.active img {
  filter: drop-shadow(0 0 6px rgba(255,200,100,.55)) drop-shadow(0 2px 0 rgba(0,0,0,.35));
}

/* ========== パネル ========== */
#panel-mask {
  position: absolute; inset: 0;
  background: rgba(12,8,4,.58);
  display: flex; align-items: flex-end;
  z-index: 20;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
#panel {
  background: var(--cream);
  width: 100%; max-height: 78%;
  border-top: 4px solid var(--brown);
  border-radius: 18px 18px 0 0;
  display: flex; flex-direction: column;
  box-shadow: 0 -8px 28px rgba(0,0,0,.35);
  animation: slideUp .2s ease;
}
@keyframes slideUp {
  from { transform: translateY(24px); opacity: .6; }
  to   { transform: translateY(0); opacity: 1; }
}
#panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-bottom: 3px dashed var(--brown2);
  font-weight: 700; font-size: 16px; color: var(--brown);
  background: linear-gradient(180deg, #fff4e4, var(--cream));
  border-radius: 18px 18px 0 0;
}
#panel-close {
  border: none; box-shadow: none; background: #e8d8c0;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 14px; color: var(--brown); padding: 0;
}
#panel-body { overflow-y: auto; padding: 10px 14px 24px; -webkit-overflow-scrolling: touch; }

.hidden { display: none !important; }

/* ========== パネル内容 ========== */
.section { margin-bottom: 14px; }
.section h3 {
  font-size: 13px; color: #8a5a2b;
  border-left: 4px solid var(--amber);
  padding-left: 8px; margin-bottom: 8px; font-weight: 700;
}
.row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px dashed #d8c3a5; font-size: 13px;
}
.row .grow { flex: 1; min-width: 0; }
.row .sub { color: #8a7360; font-size: 11px; }
.tag {
  background: var(--amber); color: #fff; font-size: 10px;
  border-radius: 4px; padding: 1px 6px; font-weight: 600;
}
.tag.gray { background: #a08b76; }
.tag.red  { background: var(--red); }

select, input[type="text"] {
  font-family: inherit; font-size: 13px; padding: 6px 8px;
  border: 2px solid var(--brown); border-radius: 6px; background: #fff;
  max-width: 100%;
}
label.chk {
  display: inline-flex; align-items: center; gap: 3px;
  margin: 3px 8px 3px 0; font-size: 13px;
}

.favorbar {
  width: 90px; height: 10px; background: #e5d5bd;
  border: 2px solid var(--brown); border-radius: 5px; overflow: hidden;
}
.favorbar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, #ff7d9c, #e8385d);
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cell {
  border: 2px solid var(--brown2); border-radius: 10px;
  background: var(--paper);
  padding: 8px 6px; font-size: 12px; text-align: center;
  box-shadow: 0 2px 0 rgba(74,52,40,.15);
}
.cell .big { font-size: 22px; }

/* ========== オフライン精算 ========== */
#settle-mask {
  position: absolute; inset: 0;
  background: rgba(10,6,16,.88);
  display: flex; align-items: center; justify-content: center;
  z-index: 30;
}
#settle {
  width: 86%; background: var(--paper);
  border: 4px solid var(--amber);
  border-radius: 14px; padding: 20px; text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.settle-title { font-size: 18px; font-weight: 700; color: var(--brown); }
.settle-story {
  margin: 14px 0; padding: 12px;
  background: #f3e3c8; border-radius: 10px;
  font-size: 14px; line-height: 1.7; color: #5a4232;
  text-align: left;
}
.settle-gain {
  font-size: 15px; margin-bottom: 14px;
  color: var(--red); font-weight: 700;
}

/* ========== 研究成功特写 ========== */
#ramen-closeup-mask {
  position: absolute; inset: 0;
  background: rgba(10, 6, 16, 0.9);
  display: flex; align-items: center; justify-content: center;
  z-index: 35;
  animation: rcFadeIn 0.22s ease;
}
@keyframes rcFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
#ramen-closeup {
  position: relative;
  width: min(92%, 340px);
  background: linear-gradient(180deg, #fff8ec 0%, #f3e3c8 100%);
  border: 4px solid var(--amber);
  border-radius: 16px;
  padding: 18px 16px 16px;
  text-align: center;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.55),
    inset 0 2px 0 rgba(255, 255, 255, 0.45);
  animation: rcPop 0.35s cubic-bezier(0.2, 1.2, 0.4, 1);
}
@keyframes rcPop {
  from { opacity: 0; transform: scale(0.82) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.rc-sparkle {
  position: absolute; top: 8px; right: 12px;
  font-size: 22px;
  animation: rcTwinkle 1.2s ease-in-out infinite;
}
@keyframes rcTwinkle {
  0%, 100% { opacity: 0.55; transform: scale(0.9) rotate(-8deg); }
  50%      { opacity: 1;    transform: scale(1.15) rotate(8deg); }
}
.rc-tag {
  display: inline-block;
  font-size: 13px; font-weight: 700;
  color: #6b3a14;
  background: linear-gradient(180deg, #ffe08a, #e8a33d);
  border: 2px solid #8a5a2b;
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 10px;
  box-shadow: 0 2px 0 #6b4423;
}
.rc-frame {
  position: relative;
  margin: 0 auto 10px;
  width: 260px; height: 260px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 42%, #5a3a22 0%, #3d2414 70%, #2a180e 100%);
  border: 4px solid #c07828;
  box-shadow:
    inset 0 0 0 2px #6b4423,
    0 6px 0 #3d2414,
    0 0 24px rgba(255, 200, 80, 0.25);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  image-rendering: pixelated;
}
/* 枠外キラキラ */
.rc-frame::before,
.rc-frame::after {
  content: '✦';
  position: absolute;
  z-index: 2;
  pointer-events: none;
  color: #ffe566;
  text-shadow: 0 0 6px #fff8c0, 0 0 12px rgba(255, 220, 100, 0.8);
  animation: rcStarFloat 1.6s ease-in-out infinite;
}
.rc-frame::before {
  top: 10%; left: 8%;
  font-size: 14px;
  animation-delay: 0s;
}
.rc-frame::after {
  top: 18%; right: 10%;
  font-size: 11px;
  color: #fff;
  animation-delay: 0.55s;
  animation-duration: 1.9s;
}
@keyframes rcStarFloat {
  0%, 100% { opacity: 0.15; transform: scale(0.6) rotate(-12deg); }
  40%      { opacity: 1;    transform: scale(1.25) rotate(8deg); }
  70%      { opacity: 0.45; transform: scale(0.9) rotate(-4deg); }
}
#rc-canvas {
  width: 248px; height: 248px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  /* どんぶり面のハイライト */
  filter: drop-shadow(0 0 6px rgba(255, 220, 120, 0.35));
}
.rc-name {
  font-size: 17px; font-weight: 800;
  color: var(--brown);
  margin-bottom: 4px;
  line-height: 1.3;
}
.rc-meta {
  font-size: 12px; color: #8a5a2b;
  margin-bottom: 6px;
  line-height: 1.45;
}
.rc-parts {
  display: flex; flex-wrap: wrap; gap: 4px;
  justify-content: center;
  margin-bottom: 8px;
}
.rc-parts span {
  font-size: 11px;
  background: #efe0c8;
  border: 1px solid #d4b896;
  color: #5a4232;
  border-radius: 999px;
  padding: 2px 8px;
}
.rc-score {
  font-size: 14px; font-weight: 700;
  color: var(--red);
  margin-bottom: 12px;
}
#rc-ok {
  width: 100%;
  font-size: 15px;
  padding: 10px 12px;
}

/* ========== 客詳細 ========== */
#cust-detail-mask {
  position: absolute; inset: 0;
  background: rgba(10, 6, 16, 0.88);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 34;
  animation: rcFadeIn 0.18s ease;
  padding: 0 0 env(safe-area-inset-bottom, 0);
}
#cust-detail {
  width: 100%;
  max-width: 430px;
  max-height: 86dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, #fff8ec 0%, #f0dfc4 100%);
  border-radius: 18px 18px 0 0;
  border: 4px solid var(--amber);
  border-bottom: none;
  padding: 14px 16px 18px;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
  animation: cdSlideUp 0.28s cubic-bezier(0.2, 1.1, 0.4, 1);
}
@keyframes cdSlideUp {
  from { transform: translateY(40%); opacity: 0.4; }
  to   { transform: translateY(0); opacity: 1; }
}
.cd-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 8px;
}
/* 客の見た目ポートレート（スプライト拡大表示） */
.cd-portrait-wrap {
  position: relative;
  flex-shrink: 0;
  width: 104px; height: 104px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 38%, #6a4428 0%, #3d2414 68%, #24160c 100%);
  border: 3px solid #c07828;
  box-shadow:
    inset 0 0 0 2px #6b4423,
    0 3px 0 #3d2414;
  overflow: hidden;
  image-rendering: pixelated;
}
#cd-portrait {
  display: block;
  width: 100%; height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.cd-emoji-badge {
  position: absolute;
  right: 2px; bottom: 1px;
  font-size: 14px; line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.55));
  pointer-events: none;
}
.cd-emoji {
  font-size: 36px; line-height: 1;
  width: 48px; text-align: center;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.15));
}
.cd-title {
  flex: 1; min-width: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
}
.cd-name {
  font-size: 18px; font-weight: 800; color: var(--brown);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
/* 詳細ヘッダの大盛りバッジ：全文・赤・コンパクト */
.cd-name-large {
  display: inline-flex; align-items: center; justify-content: center;
  height: 18px; padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff5a48, #c01414);
  color: #fff; font-weight: 800; font-size: 10px;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255,244,232,.9);
  box-shadow: 0 1px 0 #7a1010;
  flex-shrink: 0;
  line-height: 1;
  white-space: nowrap;
}
.cd-sub {
  flex-basis: 100%;
  font-size: 12px; color: #8a5a2b; margin-top: 0;
}
.cd-x {
  border: none; background: #e8d8c0; color: var(--brown);
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 14px; padding: 0; cursor: pointer;
  box-shadow: 0 2px 0 #c4a882;
}
.cd-tags {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-bottom: 8px;
}
.cd-tags span {
  font-size: 11px; font-weight: 700;
  background: #efe0c8;
  border: 1px solid #d4b896;
  color: #5a4232;
  border-radius: 999px;
  padding: 3px 9px;
}
.cd-tags span.cd-tag-hot {
  background: linear-gradient(180deg, #ffe08a, #e8a33d);
  border-color: #8a5a2b;
  color: #6b3a14;
}
.cd-tags span.cd-tag-reg {
  background: #ffe8f0;
  border-color: #e85a7a;
  color: #a02848;
}
.cd-stats {
  background: #f7ead7;
  border: 1px solid #e0c9a0;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #5a4232;
  line-height: 1.55;
}
.cd-stats b { color: var(--brown); }
.cd-stat-bar {
  margin-top: 6px;
  height: 8px;
  background: #2a1c12;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.25);
}
.cd-stat-bar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, #7bc47f, #c5e87a);
}
.cd-stat-bar i.low {
  background: linear-gradient(90deg, #e84c3d, #f0a060);
}
.cd-order-block { text-align: center; margin-bottom: 12px; }
.cd-order-label {
  font-size: 13px; font-weight: 700; color: #8a5a2b;
  border-left: 4px solid var(--amber);
  padding-left: 8px; margin-bottom: 8px;
  text-align: left;
}
.cd-frame {
  position: relative;
  margin: 0 auto 8px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 42%, #5a3a22 0%, #3d2414 70%, #2a180e 100%);
  border: 3px solid #c07828;
  box-shadow:
    inset 0 0 0 2px #6b4423,
    0 4px 0 #3d2414;
  display: flex; align-items: center; justify-content: center;
  overflow: visible; /* 大盛りバッジが枠外に見切れないよう */
  image-rendering: pixelated;
  transition: width 0.2s, height 0.2s;
}
.cd-frame #cd-canvas {
  border-radius: 11px;
  overflow: hidden;
}
.cd-order-name.cd-order-large {
  color: #c02828;
}
.cd-order-meta .cd-large-price {
  color: #c02828;
  font-weight: 800;
}
/* 注文済み：大特写 */
.cd-frame--lg {
  width: 240px; height: 240px;
}
.cd-frame--lg #cd-canvas {
  width: 228px; height: 228px;
}
/* 未注文：小さいどんぶり */
.cd-frame--sm {
  width: 140px; height: 140px;
  opacity: 0.92;
}
.cd-frame--sm #cd-canvas {
  width: 128px; height: 128px;
}
#cd-canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.cd-order-empty {
  position: absolute;
  bottom: 10px; left: 0; right: 0;
  text-align: center;
  font-size: 11px; font-weight: 700;
  color: #ffe9c4;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
  pointer-events: none;
}
.cd-order-name {
  font-size: 15px; font-weight: 800; color: var(--brown);
  margin-bottom: 2px;
}
.cd-order-meta {
  font-size: 11px; color: #8a5a2b; line-height: 1.4;
  margin-bottom: 4px;
}
#cd-ok {
  width: 100%;
  font-size: 15px;
  padding: 10px 12px;
}

/* ========== toast ========== */
#toast {
  position: absolute; top: 72px; left: 50%; transform: translateX(-50%);
  background: rgba(30,18,10,.94); color: #ffe9c4;
  padding: 10px 18px; border-radius: 10px; font-size: 13px;
  z-index: 40; max-width: 86%; text-align: center;
  border: 2px solid rgba(232,163,61,.5);
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
  animation: toastIn .18s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 閉店：閉門背景 + 角標 */
#shop-scene.closed #shop-bg {
  filter: brightness(.88) saturate(.9);
}
#shop-scene.closed::after {
  content: '🌙 閉店中';
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  z-index: 4; pointer-events: none;
  color: #ffd98a; font-size: 18px; font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,.8), 0 0 20px rgba(0,0,0,.5);
  background: rgba(15,10,20,.55);
  padding: 8px 18px; border-radius: 10px;
  border: 2px solid rgba(255,200,120,.3);
}
