/* =========================================================
 * 霓虹夜市 · 深夜小食摊  —— 场景版视觉层 v2
 * 布局：篷布招牌 + HUD + 顾客街 + 铁板料理台 + 食材架
 * =======================================================*/

/* ---------------- 基础 ---------------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: #ffe9d6;
  color: #fff;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

#app {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff3e2;
  box-shadow: 0 0 70px rgba(255, 150, 180, .25);
  isolation: isolate;
}

/* =========================================================
 * 一、场景层（纯装饰，不接事件）
 * =======================================================*/
.scene { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.scene i { position: absolute; display: block; }
/* 整幅手绘街景 */
.scene-art { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.scene-art svg { display: block; width: 100%; height: 100%; }
.scene-photo {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: 50% 40%;
  will-change: transform;
  backface-visibility: hidden;
  animation: sceneBreath 22s ease-in-out infinite alternate;
  image-rendering: auto;
}
@keyframes sceneBreath {
  from { transform: scale(1); }
  to   { transform: scale(1.018); }
}
/* 飘浮光尘 */
.scene-motes {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
  background-image:
    radial-gradient(2.2px 2.2px at 14% 62%, rgba(255, 220, 160, .8), transparent 70%),
    radial-gradient(1.8px 1.8px at 36% 74%, rgba(255, 180, 120, .7), transparent 70%),
    radial-gradient(2.6px 2.6px at 58% 58%, rgba(255, 235, 190, .7), transparent 70%),
    radial-gradient(1.6px 1.6px at 78% 70%, rgba(255, 150, 200, .65), transparent 70%),
    radial-gradient(2.0px 2.0px at 88% 52%, rgba(160, 235, 255, .6), transparent 70%),
    radial-gradient(1.6px 1.6px at 24% 48%, rgba(255, 210, 170, .6), transparent 70%);
  background-size: 100% 100%;
  animation: moteFloat 9s linear infinite;
  opacity: .85;
}
@keyframes moteFloat {
  0%   { transform: translateY(14px); opacity: .25; }
  35%  { opacity: .8; }
  100% { transform: translateY(-46px); opacity: 0; }
}

/* 夜空 */
.s-sky {
  top: 0; right: 0; bottom: 0; left: 0;
  background:
    radial-gradient(118% 48% at 50% -4%, #632b81 0%, #3a1c56 26%, #22123a 52%, #0e0920 78%, #06040e 100%);
}

/* 星星 */
.s-stars {
  top: 0; right: 0; bottom: 42%; left: 0;
  opacity: .75;
  background-image:
    radial-gradient(1.3px 1.3px at 12% 18%, rgba(255,255,255,.9), transparent),
    radial-gradient(1.1px 1.1px at 27% 9%,  rgba(255,255,255,.7), transparent),
    radial-gradient(1.4px 1.4px at 41% 24%, rgba(200,230,255,.85), transparent),
    radial-gradient(1.1px 1.1px at 58% 12%, rgba(255,255,255,.65), transparent),
    radial-gradient(1.5px 1.5px at 72% 21%, rgba(255,230,200,.85), transparent),
    radial-gradient(1.1px 1.1px at 86% 8%,  rgba(255,255,255,.75), transparent),
    radial-gradient(1.2px 1.2px at 94% 27%, rgba(255,255,255,.6), transparent),
    radial-gradient(1.1px 1.1px at 6% 33%,  rgba(255,255,255,.55), transparent);
  animation: twinkle 5.5s ease-in-out infinite alternate;
}

/* 远景楼宇剪影 */
.s-skyline {
  left: -8%; right: -8%; bottom: 54%;
  height: 40%;
  background: linear-gradient(180deg, #0a0616 0%, #06040f 62%, #030208 100%);
  filter: drop-shadow(0 -1px 4px rgba(255, 61, 129, .45));
  clip-path: polygon(
    0% 62%, 6% 62%, 6% 41%, 13% 41%, 13% 56%, 20% 56%, 20% 29%,
    27% 29%, 27% 49%, 34% 49%, 34% 19%, 41% 19%, 41% 45%, 48% 45%,
    48% 35%, 55% 35%, 55% 13%, 62% 13%, 62% 41%, 69% 41%, 69% 27%,
    76% 27%, 76% 51%, 83% 51%, 83% 37%, 90% 37%, 90% 59%, 97% 59%,
    97% 45%, 100% 45%, 100% 100%, 0% 100%
  );
  opacity: .9;
}

/* 楼宇窗户灯点 */
.s-windows {
  left: 0; right: 0; bottom: 54%;
  height: 40%;
  opacity: .9;
  background-image:
    radial-gradient(circle, rgba(255,206,130,.95) 1.15px, transparent 1.75px),
    radial-gradient(circle, rgba(120,230,255,.75) 1px, transparent 1.6px);
  background-size: 12px 16px, 29px 23px;
  background-position: 0 0, 7px 9px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 32%, #000 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 32%, #000 100%);
}

/* 地面霓虹反光 */
.s-streetglow {
  left: 0; right: 0; bottom: 0;
  height: 46%;
  background:
    radial-gradient(80% 60% at 50% 100%, rgba(255, 183, 197, .28), transparent 70%),
    radial-gradient(50% 40% at 20% 100%, rgba(255, 214, 150, .22), transparent 70%),
    linear-gradient(0deg, rgba(255, 241, 220, .55) 0%, rgba(255, 241, 220, .18) 55%, transparent 100%);
}

/* 雾气 */
.s-fog {
  left: -20%; right: -20%; bottom: 30%;
  height: 26%;
  background: radial-gradient(60% 100% at 50% 50%, rgba(180,150,255,.16), transparent 70%);
  filter: blur(12px);
  animation: fogDrift 9s ease-in-out infinite alternate;
}

/* =========================================================
 * 二、摊位篷布 + 霓虹招牌
 * =======================================================*/
.awning {
  position: relative;
  z-index: 4;
  flex: 0 0 auto;
  height: 34px;
  background: repeating-linear-gradient(115deg, #ff9ebb 0 18px, #fff6e8 18px 36px);
  box-shadow:
    0 8px 20px rgba(255, 155, 185, .35),
    inset 0 -10px 14px rgba(190, 90, 110, .18),
    inset 0 2px 0 rgba(255, 255, 255, .5);
}

/* 篷布下沿灯泡串 */
.awning::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 9px;
  background-image: radial-gradient(circle at 50% 45%, #ffe9b0 0 2.6px, rgba(255, 181, 69, 0) 3.8px);
  background-size: 22px 9px;
  background-repeat: repeat-x;
  filter: drop-shadow(0 0 6px rgba(255, 181, 69, .95));
  pointer-events: none;
}

/* 招牌灯牌 */
.neon-sign {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 12px 5px;
  white-space: nowrap;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffaf0, #ffe9d6);
  border: 1.5px solid #ff9ebb;
  box-shadow:
    0 2px 0 rgba(255, 155, 187, .55),
    0 6px 14px rgba(255, 155, 187, .35),
    inset 0 1px 0 rgba(255, 255, 255, .9);
}
.neon-sign::after {
  content: "";
  position: absolute;
  left: 9px; right: 9px; top: 2px;
  height: 3px;
  background:
    radial-gradient(circle 1.6px at 50% 50%, #fff0f3, #ff9ebb 58%, transparent 72%) 0 0 / 13px 3px repeat-x;
  opacity: .7;
  pointer-events: none;
}
.neon-sign span {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .2em;
  color: #e0447c;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}
.neon-sign em {
  font-style: normal;
  font-size: 9px;
  letter-spacing: .14em;
  color: #b0713a;
  text-shadow: none;
}

/* =========================================================
 * 三、HUD
 * =======================================================*/
.hud {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  padding: 9px 10px 8px;
  background: linear-gradient(180deg, rgba(255, 243, 226, .96), rgba(255, 233, 205, .82));
  border-bottom: 1px solid rgba(255, 155, 187, .35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.hud-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.hud-cell {
  position: relative;
  padding: 6px 2px 5px;
  border-radius: 11px;
  text-align: center;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, .9), transparent 66%),
    linear-gradient(180deg, #fffaf0 0%, #ffe9c4 100%);
  border: 1px solid rgba(255, 155, 187, .35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    inset 0 -3px 7px rgba(255, 180, 140, .25),
    0 3px 9px rgba(190, 120, 90, .25);
}
.hud-cell::after {
  content: "";
  position: absolute;
  left: 12%; right: 12%; bottom: 1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .18), transparent);
  pointer-events: none;
}
.hud-cell .k {
  display: block;
  font-size: 9px;
  letter-spacing: .16em;
  color: rgba(150, 100, 60, .75);
  margin-bottom: 1px;
}
.hud-cell b {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: #5a3a28;
}
.hud-cell b.amber { color: #e8890c; text-shadow: none; }
.hud-cell b.cyan  { color: #0d7ea6; text-shadow: none; }
.hud-cell b.pink  { color: #e0447c; text-shadow: none; font-size: 14px; letter-spacing: 1px; }

.timebar {
  margin-top: 7px;
  height: 5px;
  border-radius: 99px;
  background: rgba(190, 120, 90, .25);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(190, 120, 90, .25);
}
.timebar i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #37e6d0, #ffb545 62%, #ff3d81);
  box-shadow: 0 0 10px rgba(255, 181, 69, .75);
  transition: width .2s linear;
}

/* =========================================================
 * 四、顾客街
 * =======================================================*/
.street {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  height: 220px;
  height: clamp(196px, 27vh, 254px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  padding: 8px 8px 12px;
  background:
    radial-gradient(34px 34px at 12px 40%, rgba(255, 200, 130, .26), transparent 72%),
    radial-gradient(34px 34px at calc(100% - 12px) 40%, rgba(255, 200, 130, .26), transparent 72%),
    radial-gradient(70% 40% at 50% 100%, rgba(255, 61, 129, .14), transparent 72%);
}
/* 头顶灯泡串 */
.street::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: 11px;
  pointer-events: none;
  background-image: radial-gradient(circle at 50% 40%, #ffe0a8 0 2.2px, rgba(255, 140, 60, 0) 3.4px);
  background-size: 26px 11px;
  background-repeat: repeat-x;
  filter: drop-shadow(0 0 6px rgba(255, 140, 60, .9));
  opacity: .9;
}
/* 街沿 */
.street::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 24px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(255, 61, 129, .1) 62%, rgba(255, 181, 69, .12));
  border-top: 1px solid rgba(255, 255, 255, .05);
}
.street-empty {
  position: absolute;
  left: 0; right: 0; bottom: 44%;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: .14em;
  color: rgba(150, 100, 60, .55);
}

/* 素材加载中按钮态 */
.btn:disabled,
.btn[disabled] {
  opacity: .6;
  cursor: progress;
  filter: grayscale(.35);
}

/* ---- 顾客立绘 ---- */
.c-card {
  position: relative;
  flex: 1 1 0;
  max-width: 122px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  transition: transform .16s ease;
  animation: cIn .32s cubic-bezier(.2, 1.25, .4, 1) both;
}
.c-card.selected { transform: translateY(-5px); }

/* 脚下影子（贴在人物下沿） */
.c-figure::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -5px;
  transform: translateX(-50%);
  width: 80px; height: 13px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .72), transparent 76%);
  pointer-events: none;
  z-index: -1;
}
.c-card.selected .c-figure::after {
  background: radial-gradient(closest-side, rgba(255, 93, 143, .55), transparent 76%);
}

/* ---- 订单气泡 ---- */
.c-bubble {
  position: relative;
  width: 100%;
  margin-bottom: 9px;
  padding: 8px 6px 9px;
  border-radius: 12px;
  border: 2px solid #ff9ebb;
  text-align: center;
  font-size: 11px;
  line-height: 1.25;
  color: #241608;
  background:
    repeating-linear-gradient(180deg, rgba(180, 140, 90, .07) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #fffdf5, #ffe9c4);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, .45),
    inset 0 1px 0 rgba(255, 255, 255, .9),
    inset 0 -2px 0 rgba(160, 110, 50, .1);
  transform: rotate(-1.2deg);
  transition: box-shadow .18s, transform .18s;
}
.c-card:nth-child(2n) .c-bubble { transform: rotate(1.2deg); }
.c-bubble::after {
  content: "";
  position: absolute;
  left: 7px; right: 7px; bottom: 3px;
  border-top: 1px dashed rgba(150, 105, 50, .34);
  pointer-events: none;
}
.c-bubble .tail {
  position: absolute;
  left: 50%; bottom: -6px;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid #ffeac8;
}
.c-bubble .ico { display: block; width: 36px; height: 36px; margin: 0 auto 3px; }
.c-bubble .nm {
  display: block;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .02em;
}
.c-bubble .c-price {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 800;
  color: #0f8f6f;
}
/* 顾客台词：说话时临时替换菜名，图标和价格还在 */
.c-bubble .c-talk { display: none; }
.c-card.talking .c-bubble .nm { display: none; }
.c-card.talking .c-bubble .c-talk {
  display: block;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .02em;
  color: #c2185b;
}
.c-card.grumpy.talking .c-bubble .c-talk { color: #d32f2f; }
.c-card.talking .c-bubble { border-color: #ff5f96; }
.tag.grumpy { background: #ffd9d9; color: #b71c1c; }
.c-card.selected .c-bubble {
  box-shadow: 0 0 0 2px rgba(255, 93, 143, .9), 0 8px 18px rgba(255, 93, 143, .4);
}
.c-card.urgent .c-bubble { background: linear-gradient(180deg, #fff0f1, #ffccd3); }
.c-card.urgent .c-bubble .tail { border-top-color: #ffccd3; }

/* ---- 人物 ---- */
.c-figure {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}
.c-face {
  width: 88px;
  height: 88px;
  filter: drop-shadow(0 7px 12px rgba(0, 0, 0, .6));
  transition: transform .16s ease;
}
.c-face .cust-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: 50% 100%;
  will-change: transform;
  backface-visibility: hidden;
  background: transparent;
  animation: custIdle 2.8s ease-in-out infinite;
}
.c-card:nth-child(2n) .cust-img { animation-delay: -0.9s; }
.c-card:nth-child(3n) .cust-img { animation-delay: -1.7s; }
@keyframes custIdle {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-2.5px) scale(1.012); }
}
.c-card.selected .c-face { transform: translateY(-2px) scale(1.06); }
.c-card.urgent .c-face { animation: urgentShake .46s ease-in-out infinite; }

/* 人物已改为整身 SVG 立绘，衣服/肤色由 art.js 组合 */

/* ---- 耐心条 ---- */
.c-patience {
  position: relative;
  width: 88%;
  height: 9px;
  margin: 8px 0 2px;
  border-radius: 99px;
  background: linear-gradient(180deg, #0a0810, #201a2b);
  border: 1px solid rgba(255, 255, 255, .14);
  overflow: hidden;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, .92),
    inset 0 -1px 0 rgba(255, 255, 255, .07),
    0 1px 2px rgba(0, 0, 0, .55);
}
.c-patience > i {
  position: relative;
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #3ee07f, #ffd166 62%, #ff4d6d);
  background: linear-gradient(180deg,
    hsl(calc(var(--hp, 100) * 1.2) 92% 72%) 0%,
    hsl(calc(var(--hp, 100) * 1.2) 86% 52%) 54%,
    hsl(calc(var(--hp, 100) * 1.2) 80% 38%) 100%);
  box-shadow:
    0 0 8px hsl(calc(var(--hp, 100) * 1.2) 90% 55% / .75),
    inset 0 1px 0 rgba(255, 255, 255, .55);
  transition: width .12s linear, background .3s linear;
}
.c-patience > i::after {
  content: "";
  position: absolute;
  left: 4px; right: 4px; top: 1px;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .5), transparent);
  pointer-events: none;
}
.c-patience > i.low { animation: lowBlink .55s ease-in-out infinite; }

/* ---- 标签 ---- */
.c-tags { position: absolute; top: -7px; right: -2px; z-index: 2; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.tag {
  display: block;
  padding: 1px 5px;
  border-radius: 6px;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .06em;
  color: #1a0812;
}
.tag.vip { background: linear-gradient(180deg, #ffd166, #ffb545); box-shadow: 0 0 10px rgba(255, 181, 69, .7); }
.tag.express { background: linear-gradient(180deg, #7ef7e4, #37e6d0); box-shadow: 0 0 10px rgba(55, 230, 208, .7); }

.c-card.leave { animation: leaveAnim .4s ease forwards; pointer-events: none; }

/* =========================================================
 * 五、铁板料理台
 * =======================================================*/
.counter {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  margin: 0 8px;
  padding: 8px 9px 10px;
  border-radius: 16px 16px 8px 8px;
  background: linear-gradient(180deg, #fff6e8, #ffe9c4 60%, #ffd9a8);
  border: 1px solid rgba(255, 155, 187, .4);
  border-top: 2px solid rgba(255, 181, 69, .55);
  box-shadow:
    0 -10px 26px rgba(190, 120, 90, .25),
    inset 0 1px 0 rgba(255, 255, 255, .9);
}
.counter-top { display: flex; flex-direction: column; gap: 2px; margin-bottom: 7px; padding: 0 2px; }
.counter-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .02em;
  color: #5a3a28;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.counter-title .ct-ico { display: inline-block; width: 30px; height: 30px; vertical-align: -7px; margin-right: 5px; }
.counter-sub {
  font-size: 11px;
  color: rgba(150, 100, 60, .85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 铁板 / 摆盘区 */
.steps {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 66px;
  padding: 8px 8px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .5), transparent 40%),
    repeating-linear-gradient(90deg, rgba(190, 120, 90, .08) 0 1px, transparent 1px 4px),
    linear-gradient(102deg, #fff3da 0%, #ffe9c4 50%, #ffd9a8 100%);
  border: 1px solid rgba(255, 155, 187, .4);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .8),
    inset 0 -2px 0 rgba(190, 120, 90, .18),
    inset 0 -14px 24px rgba(255, 180, 140, .18),
    0 4px 0 rgba(190, 120, 90, .25),
    0 0 30px rgba(255, 180, 140, .2);
}
.steps-empty {
  padding: 14px 0;
  font-size: 11px;
  letter-spacing: .14em;
  color: rgba(150, 100, 60, .6);
}

.slot {
  position: relative;
  flex: 0 0 auto;
  width: 52px; height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 155, 187, .5);
  background:
    radial-gradient(circle at 50% 28%, #ffffff, #ffe9c4 70%);
  box-shadow:
    0 0 0 1.5px rgba(255, 255, 255, .6),
    0 3px 6px rgba(190, 120, 90, .35),
    inset 0 2px 3px rgba(255, 255, 255, .9),
    inset 0 -5px 9px rgba(255, 180, 140, .25);
  transition: all .16s ease;
  cursor: pointer;
}
.slot::after {
  content: "";
  position: absolute;
  top: 2px; right: 2px; bottom: 2px; left: 2px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 8%, rgba(255, 255, 255, .2), transparent 44%);
  pointer-events: none;
}
.slot .si {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  opacity: .8;
  transition: all .16s ease;
}
.slot.done {
  border: 1.5px solid rgba(61, 220, 132, .7);
  background:
    radial-gradient(circle at 50% 26%, rgba(61, 220, 132, .3), transparent 66%),
    radial-gradient(circle at 50% 50%, #eafff2 0%, #c8f5d6 70%, #a8ecc0 100%);
  box-shadow: 0 0 14px rgba(61, 220, 132, .35), inset 0 0 10px rgba(61, 220, 132, .2);
  animation: slotIn .22s ease;
}
.slot.done .si { opacity: 1; filter: none; }
.slot.next {
  border: 2px solid #ffb545;
  background:
    radial-gradient(circle at 50% 26%, rgba(255, 181, 69, .4), transparent 62%),
    radial-gradient(circle at 50% 50%, #fff6e0 0%, #ffe9b8 70%, #ffd98a 100%);
  box-shadow: 0 0 18px rgba(255, 181, 69, .5), inset 0 0 12px rgba(255, 181, 69, .25);
  animation: slotPulse 1.15s ease-in-out infinite;
}
.slot.next .si { opacity: 1; filter: none; }
.slot.hit { animation: foodHit .32s ease; }
.slot.miss { animation: foodMiss .32s ease; }

/* 出餐飞行物 */
.fly-dish {
  position: absolute;
  z-index: 9;
  width: 30px;
  height: 30px;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .6));
  transition: transform .42s cubic-bezier(.3, -.3, .5, 1), opacity .42s ease;
}

/* =========================================================
 * 六、食材架
 * =======================================================*/
.pantry {
  position: relative;
  z-index: 3;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 9px 8px 12px;
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, .55), transparent 62%),
    linear-gradient(180deg, #fff3e2, #ffe9c4);
}
.food {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 5px 2px 6px;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .55), transparent 44%),
    linear-gradient(180deg, #fffaf0 0%, #ffe9c4 100%);
  border: 1px solid rgba(255, 155, 187, .4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    inset 0 -4px 8px rgba(255, 180, 140, .22),
    0 3px 0 #ecc9a2,
    0 7px 13px rgba(190, 120, 90, .28);
  transition: transform .08s ease, box-shadow .08s ease, filter .14s;
}
.food::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 11px);
  max-width: 50px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 32%, #ffe8cc, #ffd3a3 74%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 180, 140, .35),
    inset 0 3px 6px rgba(190, 120, 90, .18);
  pointer-events: none;
}
.food .fi { position: relative; z-index: 1; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; filter: drop-shadow(0 2px 2px rgba(190, 120, 90, .3)); }
.food .fn { position: relative; z-index: 1; font-size: 9.5px; font-weight: 700; color: #8a5a3b; letter-spacing: .04em; text-shadow: none; }
.food:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 rgba(0, 0, 0, .2), inset 0 2px 7px rgba(190, 120, 90, .3);
}
.food.hit { animation: foodHit .32s ease; }
.food.miss { animation: foodMiss .32s ease; }
/* 13 个食材，最后一格居中占两列 */
.food:last-child { grid-column: 2 / span 2; }

/* 跳闸事件 */
.pantry.blackout .food { filter: brightness(.5) saturate(.5); }
.pantry.blackout .food .fn { opacity: 0; }

/* =========================================================
 * 七、事件横幅
 * =======================================================*/
.banner {
  position: absolute;
  left: 50%;
  top: 30%;
  z-index: 30;
  transform: translate(-50%, -50%) scale(.9);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  padding: 11px 20px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 250, 240, .98), rgba(255, 233, 205, .98));
  border: 1.5px solid rgba(255, 120, 170, .6);
  box-shadow: 0 0 30px rgba(255, 120, 170, .3), 0 14px 34px rgba(190, 120, 90, .35);
  transition: opacity .2s ease, transform .2s ease;
}
.banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.banner b {
  display: block;
  font-size: 15px;
  letter-spacing: .16em;
  color: #e0447c;
  text-shadow: none;
}
.banner span { display: block; margin-top: 4px; font-size: 11px; color: rgba(150, 100, 60, .8); }

/* =========================================================
 * 八、漂浮分数
 * =======================================================*/
.float-score {
  position: absolute;
  z-index: 25;
  pointer-events: none;
  font-size: 15px;
  font-weight: 900;
  color: #ffd166;
  text-shadow: 0 0 12px rgba(255, 209, 102, .9), 0 2px 6px #000;
  animation: floatUp .9s ease-out forwards;
}

/* =========================================================
 * 九、开始页 / 结算页
 * =======================================================*/
.overlay {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(150, 100, 60, .32);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.overlay.show { display: flex; animation: fadeIn .28s ease both; }
.ov-card {
  width: 100%;
  max-width: 362px;
  max-height: 100%;
  overflow-y: auto;
  padding: 20px 18px 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fffaf0, #ffe9c4);
  border: 1px solid rgba(255, 155, 187, .5);
  box-shadow: 0 0 42px rgba(255, 155, 187, .3), 0 22px 50px rgba(190, 120, 90, .35);
  color: #5a3a28;
}

.brand { text-align: center; margin-bottom: 14px; }
.brand-sub {
  display: block;
  font-size: 8.5px;
  letter-spacing: .34em;
  color: rgba(224, 68, 124, .85);
  text-shadow: none;
  margin-bottom: 6px;
}
.brand h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 900;
  letter-spacing: .04em;
  color: #5a3a28;
  text-shadow: none;
}
.brand h1 em {
  display: block;
  margin-top: 5px;
  font-style: normal;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .3em;
  color: #e0447c;
  text-shadow: none;
}

.rules { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rules li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11.5px;
  line-height: 1.5;
  color: rgba(120, 70, 40, .85);
}
.rules li i {
  flex: 0 0 auto;
  width: 17px; height: 17px;
  margin-top: 1px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  color: #1a0812;
  background: linear-gradient(180deg, #ffd166, #ffb545);
}

.wallet {
  margin-bottom: 13px;
  padding: 8px;
  border-radius: 11px;
  text-align: center;
  font-size: 11px;
  letter-spacing: .12em;
  color: rgba(150, 100, 60, .8);
  background: rgba(255, 255, 255, .65);
  border: 1px dashed rgba(255, 181, 69, .5);
}
.wallet b { font-size: 15px; color: #e8890c; text-shadow: none; }

.btn {
  display: block;
  width: 100%;
  padding: 13px;
  border: 0;
  border-radius: 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .3em;
  cursor: pointer;
  transition: transform .1s ease, filter .15s;
}
.btn.primary {
  color: #1a0812;
  background: linear-gradient(180deg, #ff7aae, #ff3d81);
  box-shadow: 0 6px 0 #a81f4f, 0 10px 26px rgba(255, 61, 129, .45);
}
.btn.primary:active { transform: translateY(4px); box-shadow: 0 2px 0 #a81f4f; }
.btn.continue-btn {
  margin-top: 10px;
  color: #5a3a08;
  background: linear-gradient(180deg, #ffd166, #ffab2e);
  box-shadow: 0 6px 0 #b97a12, 0 10px 26px rgba(255, 171, 46, .4);
}
.btn.continue-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #b97a12; }
.btn.continue-btn:disabled { opacity: .55; box-shadow: 0 6px 0 #b97a12; }
.btn.ghost {
  margin-top: 9px;
  padding: 10px;
  font-size: 12px;
  letter-spacing: .2em;
  color: #8a5a3b;
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(255, 155, 187, .5);
}

/* 结算页 */
.ov-card h2 {
  margin: 0 0 6px;
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .08em;
  color: #5a3a28;
  text-shadow: none;
}
.stars {
  text-align: center;
  font-size: 22px;
  letter-spacing: .18em;
  color: #e8890c;
  text-shadow: none;
  margin-bottom: 6px;
}
.res-tip {
  margin: 0 0 12px;
  min-height: 16px;
  text-align: center;
  font-size: 11px;
  color: rgba(150, 100, 60, .8);
}
.res-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-bottom: 15px; }
.res-cell {
  padding: 8px 6px;
  border-radius: 11px;
  text-align: center;
  background: rgba(255, 255, 255, .65);
  border: 1px solid rgba(255, 155, 187, .3);
}
.res-cell .k { display: block; font-size: 9px; letter-spacing: .14em; color: rgba(150, 100, 60, .7); }
.res-cell .v { display: block; margin-top: 2px; font-size: 15px; font-weight: 800; color: #5a3a28; }

.shop-title {
  margin: 0 0 9px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .12em;
  color: #e0447c;
}
.shop-title small { font-size: 9.5px; font-weight: 400; color: rgba(150, 100, 60, .6); letter-spacing: 0; }
.shop { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
/* 技能/摊位商店行：每条技能一个主题色（左侧色条 + 图标底座 + 等级徽章同色） */
.up {
  --ac: #e0447c;
  --acbg: #fff0f5;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdf8, #fff8ee);
  border: 1px solid rgba(255, 170, 120, .35);
  border-left: 4px solid var(--ac);
  box-shadow: 0 2px 8px rgba(180, 120, 60, .12);
}
.up-speed { --ac: #ff8a3d; --acbg: #fff0e4; }
.up-patience { --ac: #ff5fa2; --acbg: #ffeef5; }
.up-sign { --ac: #8f79ff; --acbg: #f0edff; }
.up-helper { --ac: #2fbf71; --acbg: #eafff2; }
.up-extratime { --ac: #0d7ea6; --acbg: #e0f2f7; }
.up-combo { --ac: #e8a100; --acbg: #fff6da; }
.up-spoon { --ac: #e05d44; --acbg: #ffede8; }
/* 图标底座：主题色浅底圆角片 */
.up .ui {
  box-sizing: border-box;
  width: 44px; height: 44px;
  margin: 0 auto;
  padding: 5px;
  display: flex; align-items: center; justify-content: center;
  background: var(--acbg);
  border: 1px solid rgba(255, 180, 90, .4);
  border-radius: 12px;
}
.up .ui img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }
.up .un { font-size: 13px; font-weight: 800; color: #4a2c18; }
.up .ud { font-size: 10px; color: rgba(120, 70, 40, .75); line-height: 1.4; margin-top: 2px; }
/* 等级小徽章：主题色 */
.up .ul {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  color: var(--ac);
  background: var(--acbg);
}
/* 技能行里徽章跟在名字后面同一行 */
.up .un .ul { margin-top: 0; margin-left: 6px; vertical-align: 1px; }
.up button {
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  color: #1a0812;
  cursor: pointer;
  background: linear-gradient(180deg, #ffd166, #ffb545);
  box-shadow: 0 3px 0 #a8761f;
}
.up button:disabled {
  color: rgba(150, 100, 60, .5);
  background: rgba(190, 120, 90, .15);
  box-shadow: none;
  cursor: not-allowed;
}

/* =========================================================
 * 十、动效
 * =======================================================*/
@keyframes twinkle { from { opacity: .45; } to { opacity: .9; } }
@keyframes fogDrift { from { transform: translateX(-4%); } to { transform: translateX(4%); } }
@keyframes neonFlicker {
  0%, 92%, 96%, 100% { opacity: 1; }
  93% { opacity: .55; }
  94% { opacity: 1; }
  95% { opacity: .7; }
}
@keyframes cIn {
  from { opacity: 0; transform: translateY(14px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes leaveAnim {
  to { opacity: 0; transform: translateY(-18px) scale(.86); }
}
@keyframes urgentShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2.5px) rotate(-3deg); }
  75% { transform: translateX(2.5px) rotate(3deg); }
}
@keyframes lowBlink { 50% { opacity: .35; } }
@keyframes slotPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 181, 69, .28), inset 0 0 8px rgba(255, 181, 69, .12); }
  50% { box-shadow: 0 0 20px rgba(255, 181, 69, .6), inset 0 0 12px rgba(255, 181, 69, .22); }
}
@keyframes slotIn { from { transform: scale(.72); } to { transform: scale(1); } }
@keyframes foodHit {
  0% { transform: scale(1); }
  40% { transform: scale(.9) translateY(3px); box-shadow: 0 0 18px rgba(55, 230, 208, .7); }
  100% { transform: scale(1); }
}
@keyframes foodMiss {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  80% { transform: translateX(-2px); }
}
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(0) scale(.7); }
  22% { opacity: 1; transform: translateY(-6px) scale(1.05); }
  100% { opacity: 0; transform: translateY(-46px) scale(1.12); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulsePop {
  0% { transform: scale(1); }
  45% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* HUD / 通用脉冲 */
.pulse { animation: pulsePop .38s ease; }

/* 低矮屏幕适配 */
@media (max-height: 720px) {
  .awning { height: 28px; }
  .neon-sign span { font-size: 11px; }
  .street { height: 190px; height: clamp(172px, 24vh, 210px); }
  .c-face { width: 78px; height: 78px; }
  .c-bubble .ico { width: 30px; height: 30px; }
  .c-bubble .nm, .c-bubble .c-price { font-size: 12px; }
  .slot { width: 44px; height: 44px; }
  .slot .si { width: 36px; height: 36px; }
  .food .fi { width: 38px; height: 38px; }
  .food .fn { font-size: 9px; }
}

/* =========================================================
 * 场景动效：灯笼摆动 / 热气上浮
 * =======================================================*/
.lntr {
  transform-box: fill-box;
  transform-origin: 50% -4px;
  animation: lntrSwing 4.6s ease-in-out infinite alternate;
}
@keyframes lntrSwing {
  from { transform: rotate(-4deg); }
  to   { transform: rotate(4deg); }
}
.mote {
  transform-box: fill-box;
  animation: moteUp 8s linear infinite;
}
@keyframes moteUp {
  0%   { opacity: 0; transform: translateY(0); }
  15%  { opacity: .55; }
  75%  { opacity: .3; }
  100% { opacity: 0; transform: translateY(-90px); }
}


/* =========================================================
 * v3 升级层：分类 / 品质 / 顾客类型 / 成长 / 图鉴 / 分享
 * 说明：以下规则后置覆盖，旧视觉基调保持不变
 * =======================================================*/

/* ---------------- HUD 补充 ---------------- */
.hud-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
}
.stage-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: .06em;
  color: #b4761a;
  background: linear-gradient(180deg, rgba(255, 207, 61, .35), rgba(255, 181, 69, .2));
  border: 1px solid rgba(255, 181, 69, .5);
  box-shadow: 0 0 10px rgba(255, 180, 69, .25), inset 0 1px 0 rgba(255, 255, 255, .7);
  white-space: nowrap;
}
.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  min-height: 26px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 10.5px;
  color: #0d7ea6;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(76, 216, 255, .3), rgba(76, 216, 255, .12));
  border: 1px solid rgba(76, 216, 255, .55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 0 10px rgba(76, 216, 255, .2);
}
.mini-btn:active { transform: translateY(1px); filter: brightness(1.15); }
.mini-btn b { color: #b4761a; font-size: 10px; }

.hud-cell b.amber { color: #e8890c; text-shadow: none; }
.hud-cell b.cyan { color: #0d7ea6; text-shadow: none; }
.hud-cell b.pink { color: #e0447c; text-shadow: none; }
.hud-cell b.pulse, .hud-cell b.combo-fx { animation: pulsePop .34s ease; }

/* ---------------- 顾客卡补充（类型 / 表情 / 名字） ---------------- */
.c-card { --pc: #9aa8c7; }
.c-name {
  margin-top: 2px;
  font-size: 9.5px;
  letter-spacing: .04em;
  color: var(--pc);
  text-align: center;
  text-shadow: 0 1px 2px rgba(255, 255, 255, .9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 96px;
}
.c-tags {
  display: flex;
  gap: 3px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2px;
  min-height: 0;
}
.c-tags .tag {
  position: static;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 8.5px;
  line-height: 1.35;
  letter-spacing: .02em;
  color: #fff;
  background: rgba(0, 0, 0, .5);
  border: 1px solid rgba(255, 255, 255, .18);
  white-space: nowrap;
}
.c-tags .tag[class*="pt-"] { border-color: currentColor; color: var(--pc); background: rgba(0, 0, 0, .55); }
.c-tags .tag.vip { color: #7a4d00; background: linear-gradient(180deg, #ffd166, #ffb545); border-color: rgba(255, 207, 61, .9); text-shadow: none; box-shadow: 0 0 10px rgba(255, 181, 69, .7); }
.c-card.vip .c-figure { filter: drop-shadow(0 0 8px rgba(255, 207, 61, .85)); }
.c-card.vip .c-name { color: #e8890c; font-weight: 800; }
.c-tags .tag.express { color: #ff5fa2; border-color: rgba(255, 95, 162, .7); animation: neonFlicker 1.1s infinite; }
.c-card[data-patron="mystery"] { filter: none; }
.c-card[data-patron="mystery"] .c-figure { box-shadow: 0 0 16px rgba(255, 207, 61, .5), inset 0 0 22px rgba(255, 207, 61, .22); }
.c-card.urgent .c-bubble { border-color: rgba(255, 61, 129, .9); box-shadow: 0 0 14px rgba(255, 61, 129, .45); }
.c-face.anxious .cust-img { animation: urgentShake .42s infinite; filter: saturate(1.15) brightness(1.04); }
.c-bubble .ico { display: inline-flex; width: 36px; height: 36px; }
.c-bubble .ico svg { width: 100%; height: 100%; display: block; }

/* ---------------- 料理台补充 ---------------- */
.counter-top { display: flex; flex-direction: column; gap: 2px; }
.counter-title { display: inline-flex; align-items: center; gap: 5px; }
.counter-title .ct-ico { display: inline-flex; width: 30px; height: 30px; }
.counter-title .ct-ico svg { width: 100%; height: 100%; }
.counter-prog {
  position: relative;
  height: 4px;
  border-radius: 999px;
  margin: 5px 0 6px;
  overflow: hidden;
  background: rgba(190, 120, 90, .25);
  box-shadow: inset 0 1px 2px rgba(190, 120, 90, .25);
}
.counter-prog > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #4cd8ff, #ff5fa2);
  box-shadow: 0 0 8px rgba(255, 95, 162, .6);
  transition: width .18s ease;
}
.slot .sn {
  display: none;
}
.slot.next .sn { color: #c47f1a; }
.slot .si { display: flex; align-items: center; justify-content: center; }
.slot .si svg { width: 100%; height: 100%; display: block; }
.fi-emoji { font-size: 33px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.slot .si .fi-emoji { font-size: 28px; }
.food .fi img, .slot .si img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.steps-hint { margin-top: 3px; font-size: 9px; letter-spacing: .06em; color: rgba(150, 100, 60, .7); text-align: center; }

/* 浅色面板默认文字色（body 默认是白色，必须显式覆盖） */
.counter, .hud, .pantry-wrap { color: #5a3a28; }

/* ---------------- 食材盘（分类 + 滚动） ---------------- */
.pantry-wrap {
  position: relative;
  z-index: 3;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  /* v1.0.1b：安全区 padding 不能放这里——它吃弹性空间压矮滚动区，
     真机 env(safe-area-inset-bottom)≈46px 时第 3 行被截断、下方留空白带；
     安全区改放 .pantry 内部（滚动内容里），见文件末尾 v1.0.1b 修正层 */
  padding-bottom: 0;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, .55), transparent 62%),
    linear-gradient(180deg, #fff3e2, #ffe9c4);
}
.cats {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  padding: 6px 8px 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  min-height: 28px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: .04em;
  color: #8a5a3b;
  cursor: pointer;
  background: linear-gradient(180deg, #fffaf0, #ffe9c4);
  border: 1px solid rgba(255, 155, 187, .35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 2px 5px rgba(190, 120, 90, .18);
  transition: transform .1s, color .15s, box-shadow .15s;
}
.cat i { font-style: normal; }
.cat em {
  font-style: normal;
  font-size: 9px;
  opacity: .75;
  padding-left: 3px;
  border-left: 1px solid rgba(190, 120, 90, .3);
}
.cat.on {
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 95, 162, .95), rgba(190, 46, 120, .95));
  border-color: rgba(255, 180, 220, .8);
  box-shadow: 0 0 12px rgba(255, 61, 129, .5), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.cat:active { transform: scale(.96); }
.pantry-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.pantry-scroll::-webkit-scrollbar { width: 3px; }
.pantry-scroll::-webkit-scrollbar-thumb { background: rgba(255, 181, 69, .35); border-radius: 3px; }
.pantry {
  flex: none;
  overflow: visible;
  padding: 4px 8px 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.pantry .food:last-child { grid-column: auto; }  /* 取消旧版 13 格的居中规则 */
.pantry-empty {
  grid-column: 1 / -1;
  padding: 22px 10px;
  text-align: center;
  font-size: 11px;
  color: rgba(150, 100, 60, .6);
  letter-spacing: .08em;
}
.food { min-height: 62px; }
.food .fi { width: 44px; height: 44px; }
.food .fi svg, .food .fi img { width: 100%; height: 100%; display: block; }
.food.locked { filter: grayscale(1) brightness(.52); }
.food.locked .fi { opacity: .5; }
.sc-tip { font-size: 11.5px; color: rgba(120, 70, 40, .8); line-height: 1.5; margin: 0 0 10px; }
#scCode {
  width: 100%;
  min-height: 110px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 170, 120, .5);
  background: #fffaf0;
  font-family: monospace;
  font-size: 11px;
  line-height: 1.5;
  color: #4a2c18;
  resize: vertical;
  box-sizing: border-box;
  word-break: break-all;
}
.sc-actions { display: flex; gap: 8px; margin-top: 12px; }
.sc-actions .btn { flex: 1 1 0; }
.sc-warn { min-height: 16px; font-size: 11.5px; margin: 8px 0 0; text-align: center; }
.food .fi { position: relative; }
/* 已用完的食材：图标上叠一个红圈加斜杠（禁止符号），让玩家一眼看出
   这份已经加了、还差哪些没加；计数制，双层芝士堡的鸡肉要加满 2 份才标。
   食材盘（.food.done）与料理台步骤格（.slot.done）上都有 */
.food .fx, .slot .fx {
  display: none;
  position: absolute;
  top: 50%; left: 50%;
  width: 46px; height: 46px;
  margin: -23px 0 0 -23px;
  border: 3.5px solid rgba(230, 40, 60, .92);
  border-radius: 50%;
  pointer-events: none;
  z-index: 3;
}
.food .fx::after, .slot .fx::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 56px; height: 3.5px;
  margin: -1.75px 0 0 -28px;
  background: rgba(230, 40, 60, .92);
  transform: rotate(-45deg);
  border-radius: 2px;
}
.food.done .fx, .slot.done .fx { display: block; }
.food.done .fi img, .food.done .fi svg { opacity: .45; }
.food.need, .food.must {
  z-index: 2;
  box-shadow:
    0 0 0 1.5px rgba(255, 207, 61, .85),
    0 0 16px rgba(255, 207, 61, .5),
    inset 0 1px 0 rgba(255, 255, 255, .9),
    0 3px 0 #ecc9a2;
}
.food.need::after, .food.must::after {
  content: "";
  position: absolute;
  top: -2px; right: -2px; bottom: -2px; left: -2px;
  border-radius: 13px;
  border: 1.5px solid rgba(255, 207, 61, .85);
  animation: mustGlow 1.1s ease-in-out infinite;
  pointer-events: none;
}
.food.need .fn, .food.must .fn { color: #d6336c; }
.food.ok-glow { animation: foodHit .32s ease, okGlow .42s ease; }
@keyframes mustGlow { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes okGlow { 0% { box-shadow: 0 0 0 0 rgba(94, 242, 164, .8); } 100% { box-shadow: 0 0 0 14px rgba(94, 242, 164, 0); } }

/* ---------------- 食材品质边框 ---------------- */
.q-common { --qc: #c8cbd6; --qg: rgba(200, 203, 214, .3); }
.q-fine { --qc: #3ddc84; --qg: rgba(61, 220, 132, .42); }
.q-rare { --qc: #8f79ff; --qg: rgba(143, 121, 255, .5); }
.q-legend { --qc: #ffcf3d; --qg: rgba(255, 207, 61, .58); }
.food[class*="q-"] {
  border-color: var(--qc);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    inset 0 -4px 8px rgba(255, 180, 140, .22),
    0 3px 0 #ecc9a2,
    0 0 10px var(--qg);
}
.food.q-legend {
  background:
    linear-gradient(180deg, rgba(255, 207, 61, .3), transparent 46%),
    linear-gradient(180deg, #fffaf0 0%, #ffe9c4 100%);
  animation: legendPulse 2.4s ease-in-out infinite;
}
@keyframes legendPulse {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -4px 8px rgba(255, 180, 140, .22), 0 3px 0 #ecc9a2, 0 0 8px rgba(255, 207, 61, .4); }
  50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -4px 8px rgba(255, 180, 140, .22), 0 3px 0 #ecc9a2, 0 0 18px rgba(255, 207, 61, .86); }
}
.slot.q-fine { border-color: rgba(61, 220, 132, .6); }
.slot.q-rare { border-color: rgba(143, 121, 255, .65); }
.slot.q-legend { border-color: rgba(255, 207, 61, .8); box-shadow: 0 0 12px rgba(255, 207, 61, .34); }

/* ---------------- 开始页 / 结算页补充 ---------------- */
.start-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 10px;
  font-size: 11px;
  color: #b4761a;
}
.start-stage em {
  font-style: normal;
  color: #0d7ea6;
  padding-left: 8px;
  border-left: 1px solid rgba(190, 120, 90, .35);
}
.start-acts { display: flex; gap: 8px; margin-top: 8px; }
.start-acts .btn { flex: 1 1 0; }

.stars { letter-spacing: 4px; }
.res-tip { min-height: 17px; }
.res-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 4px 0 8px;
}
.res-cell {
  margin: 0;
  padding: 7px 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.res-cell span { font-size: 9.5px; color: rgba(150, 100, 60, .7); letter-spacing: .06em; }
.res-cell b { font-size: 15px; color: #5a3a28; }
.res-cell b.amber { color: #e8890c; }
.res-cell b.pink { color: #e0447c; }

.res-stage, .res-new {
  margin: 6px 0;
  padding: 9px 10px;
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(255, 233, 205, .8));
  border: 1px solid rgba(255, 181, 69, .4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}
.res-stage:empty, .res-new:empty { display: none; }
.rs-head { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: rgba(150, 100, 60, .8); }
.rs-head b { color: #e8890c; font-size: 12px; }
.rs-desc { margin: 4px 0 8px; font-size: 10.5px; line-height: 1.5; color: rgba(120, 70, 40, .75); }
.rs-next { font-size: 10px; color: rgba(150, 100, 60, .7); margin-bottom: 5px; letter-spacing: .04em; }
.rs-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 10px; color: rgba(150, 100, 60, .8); }
.rs-bar span { flex: 0 0 50px; }
.rs-bar i { flex: 1 1 auto; height: 6px; border-radius: 999px; background: rgba(190, 120, 90, .25); overflow: hidden; }
.rs-bar i b { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4cd8ff, #ff5fa2); transition: width .3s; }
.rs-bar em { flex: 0 0 auto; font-style: normal; font-size: 9.5px; color: rgba(150, 100, 60, .7); min-width: 54px; text-align: right; }
.rs-max { font-size: 11px; color: #e8890c; text-align: center; padding: 4px; }
.stage-up {
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  border-radius: 11px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  color: rgba(150, 100, 60, .7);
  background: linear-gradient(180deg, rgba(255, 255, 255, .6), rgba(255, 233, 205, .6));
  border: 1px solid rgba(255, 155, 187, .35);
  cursor: not-allowed;
}
.stage-up.ready {
  color: #1b1020;
  background: linear-gradient(180deg, #ffe07a, #ffb545);
  border-color: rgba(255, 240, 190, .9);
  box-shadow: 0 0 16px rgba(255, 181, 69, .55), inset 0 1px 0 rgba(255, 255, 255, .7);
  cursor: pointer;
}
.stage-up.ready:active { transform: translateY(1px); }
.rn-title { font-size: 10px; letter-spacing: .1em; color: rgba(150, 100, 60, .7); margin-bottom: 5px; }
.rn-list { display: flex; flex-wrap: wrap; gap: 5px; }
.nf {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  color: #b4761a;
  background: rgba(255, 181, 69, .18);
  border: 1px solid rgba(255, 181, 69, .5);
}
.res-actions { display: flex; gap: 8px; margin: 8px 0 4px; }
.res-actions .btn { flex: 1 1 0; }
.share-btn {
  color: #1b1020;
  background: linear-gradient(180deg, #ff9ec4, #ff5fa2);
  border: 1px solid rgba(255, 200, 226, .9);
  box-shadow: 0 0 16px rgba(255, 95, 162, .45), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.stall-shop .up button { min-width: 66px; }
.up.maxed { opacity: .55; }
.up button { min-height: 30px; }


/* =========================================================
 * 图鉴 / 成长 面板
 * =======================================================*/
.codex-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: rgba(150, 100, 60, .4);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}
.codex-overlay.show { display: flex; animation: fadeIn .2s ease; }
.codex-panel {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255, 155, 187, .25), transparent 60%),
    linear-gradient(180deg, #fffaf0 0%, #ffe9c4 100%);
  border: 1px solid rgba(255, 181, 69, .5);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .5), 0 22px 60px rgba(190, 120, 90, .4), 0 0 40px rgba(255, 155, 187, .25);
  color: #5a3a28;
}
.codex-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 155, 187, .3);
  background: linear-gradient(180deg, rgba(255, 255, 255, .7), transparent);
}
.codex-tabs { display: flex; gap: 6px; }
.ct {
  padding: 6px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  color: #8a5a3b;
  cursor: pointer;
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(255, 155, 187, .35);
}
.ct.on {
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 95, 162, .95), rgba(190, 46, 120, .95));
  border-color: rgba(255, 180, 220, .8);
  box-shadow: 0 0 12px rgba(255, 61, 129, .45);
}
.codex-x {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 13px;
  color: #8a5a3b;
  cursor: pointer;
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(255, 155, 187, .35);
}
.codex-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 10px 12px 16px;
  padding: 10px 12px calc(16px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
}
.codex-body::-webkit-scrollbar { width: 4px; }
.codex-body::-webkit-scrollbar-thumb { background: rgba(255, 181, 69, .32); border-radius: 4px; }

.cx-p-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cx-p-top b { font-size: 15px; color: #e8890c; }
.cx-p-top span { font-size: 10.5px; color: rgba(150, 100, 60, .7); }
.cx-p-sub { margin: 3px 0 7px; font-size: 10.5px; color: rgba(150, 100, 60, .7); }
.cx-progress { height: 7px; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .5); }
.cx-progress > i, .cx-progress .cx-bar { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4cd8ff, #ff5fa2); transition: width .3s; }
.cx-cats { display: flex; gap: 5px; overflow-x: auto; margin: 10px 0 8px; padding-bottom: 2px; scrollbar-width: none; }
.cx-cats::-webkit-scrollbar { display: none; }
.cx-cat {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 10.5px;
  color: #8a5a3b;
  cursor: pointer;
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(255, 155, 187, .35);
}
.cx-cat.on { color: #0d7ea6; background: linear-gradient(180deg, rgba(76, 216, 255, .35), rgba(76, 216, 255, .14)); border-color: rgba(76, 216, 255, .6); }
.cx-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.cx-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 3px 6px;
  border-radius: 11px;
  background: linear-gradient(180deg, #fffaf0, #ffe9c4);
  border: 1px solid var(--qc, rgba(255, 155, 187, .35));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 8px var(--qg, transparent);
  overflow: hidden;
  cursor: pointer;
}
.cx-card.sel { outline: 2px solid #ff5fa2; outline-offset: -2px; }
.cx-ico { width: 40px; height: 40px; }
.cx-ico img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.cx-detail { margin: 10px 0 4px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .65); border: 1px solid rgba(255, 155, 187, .35); }
.xd-top { display: flex; align-items: center; gap: 10px; }
.xd-ico { width: 48px; height: 48px; flex: 0 0 auto; }
.xd-ico img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.xd-top b { display: block; font-size: 14px; color: #5a3a28; }
.xd-top span { display: block; margin-top: 2px; font-size: 10.5px; color: rgba(150, 100, 60, .7); }
.xd-cond { margin-top: 7px; font-size: 10.5px; color: #e8890c; }
.xd-dish { margin-top: 4px; font-size: 11px; color: rgba(120, 70, 40, .85); }
.cx-card.locked { filter: grayscale(1) brightness(.78); border-color: rgba(190, 120, 90, .25); box-shadow: none; }
.cx-card .cx-ico { width: 34px; height: 34px; }
.cx-card .cx-ico svg, .cx-card .cx-ico img { width: 100%; height: 100%; display: block; }
.cx-card .cx-nm {
  font-size: 9.5px;
  color: #5a3a28;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cx-card .cx-q { font-size: 8px; letter-spacing: .02em; color: var(--qc, #c8cbd6); }
.cx-card .cx-cat, .cx-card .cx-cond {
  font-size: 8px;
  line-height: 1.35;
  color: rgba(150, 100, 60, .75);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cx-card .cx-lock {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  font-size: 8px;
  line-height: 13px;
  text-align: center;
  color: #0b0817;
  background: rgba(255, 255, 255, .7);
}
.cx-card.is-new::after {
  content: "NEW";
  position: absolute;
  left: 3px;
  top: 3px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 7px;
  letter-spacing: .04em;
  color: #1b1020;
  background: linear-gradient(180deg, #ffe07a, #ffb545);
}
.cx-sec { margin-top: 12px; }
.cx-sec > h4 {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  color: rgba(150, 100, 60, .75);
}
.cx-rewards { display: flex; flex-direction: column; gap: 6px; }
.cx-rw {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .65);
  border: 1px solid rgba(255, 155, 187, .3);
}
.cx-rw.done { border-color: rgba(94, 242, 164, .6); background: rgba(94, 242, 164, .14); }
.cx-rw.ready { border-color: rgba(255, 207, 61, .7); box-shadow: 0 0 12px rgba(255, 207, 61, .3); }
.cx-rw .rw-p { flex: 1 1 auto; min-width: 0; }
.cx-rw .rw-t { font-size: 11px; color: #5a3a28; }
.cx-rw .rw-p small { display: block; margin-top: 2px; font-size: 9.5px; color: rgba(150, 100, 60, .6); }
.cx-rw .rw-b {
  flex: 0 0 auto;
  padding: 5px 11px;
  min-height: 28px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 10.5px;
  color: #1b1020;
  cursor: pointer;
  background: linear-gradient(180deg, #ffe07a, #ffb545);
  border: 1px solid rgba(255, 240, 190, .8);
}
.cx-rw .rw-b:disabled { color: rgba(150, 100, 60, .5); background: rgba(190, 120, 90, .15); border-color: rgba(190, 120, 90, .25); cursor: default; }

/* ---------------- 成长页 ---------------- */
.gr-hero {
  padding: 11px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 181, 69, .16), rgba(255, 61, 129, .1));
  border: 1px solid rgba(255, 181, 69, .3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}
.gr-lv { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.gr-lv b { font-size: 16px; color: #e8890c; }
.gr-lv span { font-size: 10.5px; color: rgba(150, 100, 60, .7); }
.gr-lv em { font-style: normal; font-size: 12px; color: #5a3a28; }
.gr-bar { height: 7px; margin: 8px 0 4px; border-radius: 999px; background: rgba(190, 120, 90, .25); overflow: hidden; }
.gr-bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4cd8ff, #ff5fa2); }
.gr-next { font-size: 10px; color: rgba(150, 100, 60, .75); }
.gr-next h4 { margin: 0 0 4px; font-size: 11px; font-weight: 600; color: #5a3a28; }
.gr-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 10.5px; color: rgba(150, 100, 60, .8); }
.gr-row .gr-bar { flex: 1 1 auto; margin: 0; }
.gr-row span.ok { color: #2ea35c; font-weight: 700; }
.gr-row span.no { color: rgba(150, 100, 60, .75); }
.gr-row b { min-width: 56px; text-align: right; }
.gr-row b.ok { color: #2ea35c; }
.gr-bar > i.ok { background: linear-gradient(90deg, #3ddc84, #7df0a8); }
.gr-miss { margin-top: 7px; font-size: 10.5px; color: #e8890c; }
.gr-row .gi-bars { flex: 1 1 auto; height: 6px; border-radius: 999px; background: rgba(190, 120, 90, .25); overflow: hidden; }
.gr-row .gi-bars i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ffcf3d, #ff8a5c); }
.gr-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 8px; }
.gr-stats > div { padding: 7px 9px; border-radius: 10px; background: rgba(255, 255, 255, .65); border: 1px solid rgba(255, 155, 187, .3); text-align: center; }
.gr-stats span { display: block; font-size: 9.5px; color: rgba(150, 100, 60, .7); }
.gr-stats b { display: block; margin-top: 2px; font-size: 14px; color: #5a3a28; }
.gr-log { margin-top: 8px; font-size: 10px; line-height: 1.6; color: rgba(150, 100, 60, .75); }
.gr-item {
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .65);
  border: 1px solid rgba(255, 155, 187, .3);
  font-size: 11px;
  color: #5a3a28;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.gr-item b { color: #e8890c; }
.gr-tag { font-size: 9px; color: #8a5a3b; }
.gr-bank { margin-top: 8px; padding: 8px 10px; border-radius: 10px; font-size: 11px; color: #b4761a; background: rgba(255, 181, 69, .14); border: 1px dashed rgba(255, 181, 69, .5); text-align: center; }
.gr-bank b { font-size: 14px; color: #e8890c; }
.gr-stall { display: flex; flex-direction: column; gap: 6px; }
.gr-up {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border-radius: 11px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  color: #1b1020;
  cursor: pointer;
  background: linear-gradient(180deg, #ffe07a, #ffb545);
  border: 1px solid rgba(255, 240, 190, .9);
  box-shadow: 0 3px 0 #a8761f;
}
.gr-up:disabled {
  color: rgba(150, 100, 60, .55);
  background: rgba(190, 120, 90, .15);
  border-color: rgba(190, 120, 90, .25);
  box-shadow: none;
  cursor: not-allowed;
}
.gr-up .gi-d { flex: 1 1 auto; min-width: 0; }
.gr-up .gi-d b { display: block; font-size: 11px; color: #5a3a28; }
.gr-up .gi-d small { font-size: 9.5px; color: rgba(150, 100, 60, .6); }
.gr-up button {
  flex: 0 0 auto;
  padding: 5px 10px;
  min-height: 28px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 10.5px;
  color: #1b1020;
  cursor: pointer;
  background: linear-gradient(180deg, #ffe07a, #ffb545);
  border: 1px solid rgba(255, 240, 190, .8);
}
.gr-up button:disabled { color: rgba(255, 255, 255, .38); background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .1); cursor: default; }
.gr-max { color: #ffcf3d; font-size: 10.5px; }

/* =========================================================
 * 成绩卡分享弹窗
 * =======================================================*/
.share-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(150, 100, 60, .4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.share-overlay.show { display: flex; animation: fadeIn .2s ease; }
.share-panel {
  width: 100%;
  max-width: 380px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, #fff8ee, #ffe9c4);
  border: 1px solid rgba(255, 155, 187, .5);
  box-shadow: 0 22px 60px rgba(190, 120, 90, .35);
}
.share-hd {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 12.5px;
  color: #5a3a28;
  border-bottom: 1px solid rgba(255, 155, 187, .25);
}
.share-x {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 12px;
  color: #8a5a3b;
  cursor: pointer;
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(255, 155, 187, .4);
}
.share-prev {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.share-prev img, .share-prev canvas {
  display: block;
  max-width: 100%;
  max-height: 62vh;
  width: auto;
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(190, 120, 90, .35);
}
.share-tip { padding: 0 14px 6px; font-size: 10px; color: rgba(120, 80, 50, .6); text-align: center; }
.share-acts { flex: 0 0 auto; display: flex; gap: 8px; padding: 8px 14px 14px; padding: 8px 14px calc(14px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))); }
.share-acts button {
  flex: 1 1 0;
  min-height: 40px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.sb-main {
  color: #1b1020;
  background: linear-gradient(180deg, #ff9ec4, #ff5fa2);
  border: 1px solid rgba(255, 210, 232, .85);
  box-shadow: 0 0 16px rgba(224, 68, 124, .3), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.sb-ghost { color: #5a3a28; background: #fff6e8; border: 1px solid rgba(255, 155, 187, .5); }

/* =========================================================
 * 动画与反馈
 * =======================================================*/
.fly-coin {
  position: absolute;
  z-index: 40;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 34% 30%, #fff3c4, #ffcf3d 52%, #d99a12 100%);
  box-shadow: 0 0 10px rgba(255, 207, 61, .8);
  transition: transform .6s cubic-bezier(.34, .02, .7, 1), opacity .6s ease;
}
.float-score {
  position: absolute;
  z-index: 42;
  font-size: 13px;
  font-weight: 700;
  color: #ffcf3d;
  text-shadow: 0 2px 5px rgba(0, 0, 0, .75), 0 0 12px rgba(255, 207, 61, .55);
  pointer-events: none;
  animation: floatUp .9s ease forwards;
}
.float-score.perfect { color: #5ef2a4; font-size: 14px; }
.fly-dish {
  position: absolute;
  z-index: 41;
  width: 26px;
  height: 26px;
  pointer-events: none;
  transition: transform .46s cubic-bezier(.36, .02, .66, 1), opacity .46s ease;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .6));
}
.fly-dish svg { width: 100%; height: 100%; display: block; }
#app.shake { animation: appShake .26s ease; }
@keyframes appShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  45% { transform: translateX(4px); }
  70% { transform: translateX(-2px); }
}
#app.stage-fx::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 55;
  pointer-events: none;
  background: radial-gradient(circle at 50% 42%, rgba(255, 207, 61, .5), transparent 58%);
  animation: stageFlash 1.5s ease forwards;
}
@keyframes stageFlash {
  0% { opacity: 0; transform: scale(.7); }
  22% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.5); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.c-card.served-ok .c-figure { animation: servedPop .34s ease; }
@keyframes servedPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.1) translateY(-4px); }
  100% { transform: scale(1); }
}

/* =========================================================
 * 夜市等级主题（#app 上的 stage-N 类）
 * =======================================================*/
#app.stage-1 { --theme: #ff5fa2; }
#app.stage-2 { --theme: #4cd8ff; }
#app.stage-3 { --theme: #8f79ff; }
#app.stage-4 { --theme: #ffcf3d; }
#app.stage-2 .neon-sign { box-shadow: 0 2px 0 rgba(255, 155, 187, .55), 0 6px 18px rgba(255, 155, 187, .5), inset 0 1px 0 rgba(255, 255, 255, .9); }
#app.stage-3 .neon-sign { box-shadow: 0 2px 0 rgba(255, 155, 187, .55), 0 6px 20px rgba(255, 155, 187, .55), inset 0 1px 0 rgba(255, 255, 255, .9); }
#app.stage-4 .neon-sign {
  box-shadow: 0 2px 0 rgba(255, 155, 187, .55), 0 6px 22px rgba(255, 190, 90, .55), inset 0 1px 0 rgba(255, 255, 255, .9);
}
#app.stage-3 .street { background-color: rgba(143, 121, 255, .05); }
#app.stage-4 .street { background-color: rgba(255, 207, 61, .06); }
#app.stage-2 .awning::after { opacity: .9; }
#app.stage-3 .awning::after { opacity: 1; }
#app.stage-4 .awning::after { opacity: 1; filter: saturate(1.4) brightness(1.2); }
/* 摊位升级：招牌与灯串逐级增强 */
#app.up-lantern-1 .awning::after { opacity: .8; }
#app.up-lantern-2 .awning::after { opacity: 1; filter: drop-shadow(0 0 8px rgba(255, 140, 60, .9)); }
#app.up-lantern-3 .awning::after { opacity: 1; filter: drop-shadow(0 0 14px rgba(255, 176, 96, 1)) saturate(1.3); }
#app.up-deco-1 .neon-sign { letter-spacing: .1em; }
#app.up-deco-2 .neon-sign span { text-shadow: 0 0 18px rgba(255, 95, 162, .95), 0 0 34px rgba(255, 95, 162, .6); }
#app.up-deco-3 .neon-sign span { text-shadow: 0 0 22px #fff, 0 0 40px rgba(255, 95, 162, .9), 0 0 66px rgba(255, 61, 129, .7); }
#app.up-kitchen-1 .counter { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 -6px 20px rgba(255, 140, 60, .12); }
#app.up-kitchen-2 .counter { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 -8px 26px rgba(255, 140, 60, .2); }
#app.up-kitchen-3 .counter {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 -10px 32px rgba(255, 95, 162, .26);
  border-color: rgba(255, 207, 61, .3);
}
#app.up-menu-1 .c-bubble { border-color: rgba(255, 207, 61, .34); }
#app.up-menu-2 .c-bubble { border-color: rgba(255, 207, 61, .5); box-shadow: 0 4px 14px rgba(0, 0, 0, .5), 0 0 12px rgba(255, 207, 61, .2); }
#app.up-menu-3 .c-bubble { border-color: rgba(255, 207, 61, .7); box-shadow: 0 4px 14px rgba(0, 0, 0, .5), 0 0 18px rgba(255, 207, 61, .34); }
#app.up-bg-1 .scene-art { filter: saturate(1.08) brightness(1.04); }
#app.up-bg-2 .scene-art { filter: saturate(1.16) brightness(1.07) contrast(1.03); }
#app.up-bg-3 .scene-art { filter: saturate(1.26) brightness(1.1) contrast(1.06); }
#app.deco-limited .scene { box-shadow: inset 0 0 90px rgba(255, 207, 61, .22); }

/* =========================================================
 * 移动端适配 / 安全区
 * =======================================================*/
@supports (padding: max(0px)) {
  .hud { padding-top: max(9px, env(safe-area-inset-top, 9px)); }
  .pantry-wrap { padding-bottom: 0; } /* v1.0.1b：同上，安全区改放 .pantry 内部 */
  .ov-card { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-height: 780px) {
  .street { height: 188px; height: clamp(168px, 23vh, 210px); }
  .food { min-height: 56px; }
  .food .fi { width: 30px; height: 30px; }
  .counter { padding-top: 6px; padding-bottom: 6px; }
}
@media (max-height: 700px) {
  .street { height: 158px; height: clamp(140px, 20vh, 176px); }
  .hud-cell { padding: 4px 2px; }
  .hud-strip { margin-top: 5px; }
  .food { min-height: 52px; }
  .food .fi { width: 27px; height: 27px; }
  .food .fn { font-size: 9px; }
  .slot { min-height: 46px; }
  .cx-card .cx-ico { width: 28px; height: 28px; }
  .codex-panel { max-height: 94vh; }
}
@media (max-height: 620px) {
  .street { height: 132px; }
  .hud-strip { display: none; }
  .counter-sub { font-size: 9.5px; }
}
@media (max-width: 360px) {
  /* v1.0.1：删掉食材盘 3 列规则——15 种食材会撑成 5 行放不下；4 列（矮屏 5 列）即可 */
  .cx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .res-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (orientation: landscape) and (max-height: 520px) {
  .street { height: 120px; }
}
/* 图鉴打开时锁背景滚动 */
body.no-scroll { overflow: hidden; }


/* =========================================================
 * v3 修正层：按真实 DOM 对齐（codex.js 结构）
 * =======================================================*/
/* 收藏进度块（.cx-progress 是容器，不是进度条本体） */
.codex-body > .cx-progress {
  height: auto;
  overflow: visible;
  padding: 10px 12px;
  border-radius: 14px;
  margin-bottom: 2px;
  background: linear-gradient(180deg, rgba(255, 95, 162, .16), rgba(76, 216, 255, .1));
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.cx-progress .cx-p-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cx-progress .cx-p-top b { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: rgba(150, 100, 60, .75); }
.cx-progress .cx-p-top > span { font-size: 11px; color: rgba(150, 100, 60, .7); }
.cx-progress .cx-p-top em { font-style: normal; font-size: 16px; font-weight: 700; color: #e8890c; text-shadow: none; }
.cx-progress .cx-bar {
  display: block;
  height: 8px;
  margin: 8px 0 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(190, 120, 90, .25);
  box-shadow: inset 0 1px 3px rgba(190, 120, 90, .25);
}
.cx-progress .cx-bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4cd8ff, #ff5fa2 70%, #ffcf3d);
  box-shadow: 0 0 12px rgba(255, 95, 162, .55);
  transition: width .35s ease;
}
.cx-progress .cx-p-sub { font-size: 10.5px; color: rgba(150, 100, 60, .7); }

/* 品质：类挂在卡片上 */
.cx-card.q-common { --qc: rgba(150, 150, 160, .8); --qg: transparent; }
.cx-card.q-fine { --qc: rgba(94, 242, 164, .7); --qg: rgba(94, 242, 164, .18); }
.cx-card.q-rare { --qc: rgba(143, 121, 255, .8); --qg: rgba(143, 121, 255, .26); }
.cx-card.q-legend { --qc: rgba(255, 207, 61, .95); --qg: rgba(255, 207, 61, .34); }
.cx-card.q-legend:not(.locked) { animation: legendBreathe 2.6s ease-in-out infinite; }
@keyframes legendBreathe {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 8px var(--qg); }
  50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 0 18px var(--qg); }
}
.cx-card .cx-q { color: var(--qc, rgba(255, 255, 255, .5)); }
.cx-card .pxi { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; display: block; }
.cx-card.locked .pxi { opacity: .38; filter: grayscale(1); }

/* 成长页：门店主按钮（元素本体就是 .gr-up） */
button.gr-up {
  display: block;
  width: 100%;
  margin-top: 9px;
  padding: 10px 12px;
  min-height: 42px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: #1b1020;
  cursor: pointer;
  background: linear-gradient(180deg, #ffe07a, #ffb545);
  border: 1px solid rgba(255, 240, 190, .85);
  box-shadow: 0 4px 0 rgba(140, 88, 8, .45), 0 0 18px rgba(255, 181, 69, .35);
  transition: transform .12s ease, box-shadow .12s ease;
}
button.gr-up:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(140, 88, 8, .45); }
button.gr-up:disabled {
  color: rgba(150, 100, 60, .55);
  background: rgba(190, 120, 90, .15);
  border-color: rgba(190, 120, 90, .25);
  box-shadow: none;
  cursor: default;
}
button.gr-up.ready {
  background: linear-gradient(180deg, #a6ffcb, #35d98a);
  border-color: rgba(210, 255, 230, .9);
  box-shadow: 0 4px 0 rgba(14, 96, 58, .5), 0 0 22px rgba(94, 242, 164, .5);
  animation: readyPulse 1.5s ease-in-out infinite;
}
@keyframes readyPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.5px); }
}

/* 摊位升级行（.gr-item） */
.gr-stall { display: flex; flex-direction: column; gap: 6px; }
.gr-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "head btn" "detail btn" "bars btn";
  align-items: center;
  gap: 2px 8px;
  padding: 8px 10px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .08);
}
.gr-item .gi-h { grid-area: head; display: flex; align-items: baseline; gap: 6px; }
.gr-item .gi-h b { font-size: 11.5px; color: #5a3a28; }
.gr-item .gi-h span { font-size: 9.5px; color: #e8890c; }
.gr-item .gi-d { grid-area: detail; font-size: 9.5px; color: rgba(150, 100, 60, .6); }
.gr-item .gi-bars { grid-area: bars; display: flex; gap: 3px; margin-top: 3px; }
.gr-item .gi-bars i {
  width: 16px;
  height: 4px;
  border-radius: 3px;
  background: rgba(190, 120, 90, .25);
}
.gr-item .gi-bars i.on, .gr-item .gi-bars i.done {
  background: linear-gradient(90deg, #ffcf3d, #ff8a5c);
  box-shadow: 0 0 8px rgba(255, 176, 96, .6);
}
.gr-item .gi-b {
  grid-area: btn;
  min-width: 66px;
  min-height: 32px;
  padding: 5px 9px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 10.5px;
  color: #1b1020;
  cursor: pointer;
  background: linear-gradient(180deg, #ffe07a, #ffb545);
  border: 1px solid rgba(255, 240, 190, .8);
}
.gr-item .gi-b:disabled { color: rgba(150, 100, 60, .5); background: rgba(190, 120, 90, .15); border-color: rgba(190, 120, 90, .25); cursor: default; }

/* 成长条件行 */
.gr-hero .gr-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 10.5px; color: rgba(150, 100, 60, .8); }
.gr-hero .gr-row > span { flex: 0 0 62px; }
.gr-hero .gr-row .gr-bar { flex: 1 1 auto; display: flex; align-items: center; gap: 6px; height: auto; margin: 0; background: none; overflow: visible; }
.gr-hero .gr-row .gr-bar > i {
  flex: 1 1 auto;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffcf3d, #ff8a5c);
  box-shadow: 0 0 8px rgba(255, 176, 96, .5);
  min-width: 0;
}
.gr-hero .gr-row .gr-bar > b { flex: 0 0 auto; font-size: 9.5px; font-weight: 500; color: rgba(150, 100, 60, .75); }
.gr-hero h4 { margin: 10px 0 2px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; color: #5a3a28; }
.gr-hero .gr-lv em { font-style: normal; font-size: 10.5px; color: #5a3a28; }
.gr-hero .gr-tag { font-size: 10px; color: #8a5a3b; }

/* ===== v3.1 可读性与触区微调 ===== */
.c-card .c-bubble { background: linear-gradient(180deg, #fffdf5, #ffe9c4); border: 2px solid #ff9ebb; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.c-card .c-bubble::after { display: none; }
.card .c-bubble * { position: relative; z-index: 1; }
#street { z-index: 4; }
#counter { z-index: 5; background: linear-gradient(180deg, rgba(12, 8, 20, .72), rgba(12, 8, 20, .55)); backdrop-filter: blur(2px); }
.food { min-height: 72px; padding: 7px 4px 5px; }
.food img, .food svg { width: 32px; height: 32px; }
.food .fn, .food span { font-size: 10.5px; line-height: 1.15; }
.pantry { gap: 8px; padding: 2px 10px 10px; }
.cats { padding: 0 10px; }
.cat { min-height: 30px; padding: 0 11px; font-size: 11.5px; }
@media (max-width: 380px) {
  .food { min-height: 66px; }
  .food img, .food svg { width: 29px; height: 29px; }
}

/* ===== v3.2 可读性与交互强化 ===== */
.steps-empty { color: rgba(150, 100, 60, .75); font-size: 12.5px; letter-spacing: .04em; }
#counterTitle { text-shadow: 0 1px 2px rgba(255, 255, 255, .8); }
#counterSub { opacity: .95; }
.hud-strip { background: rgba(255, 243, 226, .85); border-bottom: 1px solid rgba(255, 155, 187, .25); backdrop-filter: blur(6px); }
#startScreen .wallet { border-style: solid; border-color: rgba(255, 207, 61, .5); background: rgba(255, 255, 255, .7); }
#startScreen .home-acts, #startScreen .start-acts { gap: 10px; }
#startScreen .btn.ghost {
  min-width: 104px;
  min-height: 46px;
  padding: 0 16px;
  font-size: 13.5px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .18);
}
@media (max-height: 700px) {
  #startScreen .btn.ghost { min-height: 40px; font-size: 12.5px; min-width: 92px; }
}

/* =====================================================
 * v1.0.1 一屏适配（2026-11-22）：游戏画面一屏放得下
 * 根因：① 食材格 72px × 4 行 + 228px 顾客街 + 172px 料理台，
 *   食材盘只剩 2~3 行可见，第 4 行要滑托盘才点得到；
 * ② 矮屏顾客街 clamp 高度（140px）远小于顾客卡内容
 *   （约 197px），气泡向上溢出 66px 盖住 HUD。
 * 修法：收紧各区高度、顾客街按内容定高、食材格缩小、
 * 矮屏食材盘改 5 列（15 种食材 3 行放得下）。
 * 只改布局尺寸，不动玩法/数值/文案/音乐/存档。
 * ===================================================== */

/* ---- HUD 收紧 ---- */
.hud { padding-bottom: 6px; }
.timebar { margin-top: 5px; }
.hud-strip { margin-top: 5px; }

/* ---- 顾客街：按内容定高，气泡不再盖 HUD ---- */
.street { height: 219px; height: clamp(205px, 26vh, 222px); }
.c-face { width: 80px; height: 80px; }
.c-bubble { padding: 7px 6px 8px; margin-bottom: 8px; }
.c-bubble .ico { width: 32px; height: 32px; }
.c-patience { margin: 6px 0 2px; }

/* ---- 料理台收紧 ---- */
.counter { padding: 6px 9px 8px; }
.counter-top { margin-bottom: 5px; }
.counter-prog { margin: 4px 0 5px; }
.steps { min-height: 60px; padding: 6px 8px; }
.slot { width: 48px; height: 48px; }
.slot .si { width: 38px; height: 38px; }
.steps-hint { margin-top: 2px; }

/* ---- 食材格缩小（72px → 58px） ---- */
.food { min-height: 58px; padding: 4px 2px 4px; }
.food .fi { width: 34px; height: 34px; }
.food img, .food svg { width: 30px; height: 30px; }
.fi-emoji { font-size: 26px; }
.food .fn { font-size: 10px; }
.pantry { gap: 6px; padding: 4px 8px 10px; }

/* ---- 矮屏（≤780px）：食材盘改 5 列，3 行放得下 ---- */
@media (max-height: 780px) {
  .street { height: 200px; height: clamp(196px, 27vh, 204px); }
  .c-face { width: 68px; height: 68px; }
  .c-bubble .ico { width: 30px; height: 30px; }
  .pantry { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .food { min-height: 56px; }
  .food .fi { width: 32px; height: 32px; }
  .fi-emoji { font-size: 24px; }
  .slot { width: 46px; height: 46px; }
  .slot .si { width: 36px; height: 36px; }
  .steps { min-height: 56px; }
}

/* ---- 更矮（≤700px）：再收一档 ---- */
@media (max-height: 700px) {
  .street { height: 183px; padding: 6px 8px 8px; }
  .c-face { width: 58px; height: 58px; }
  .c-bubble { padding: 6px 6px 7px; margin-bottom: 6px; }
  .c-bubble .ico { width: 26px; height: 26px; }
  .hud-cell { padding: 4px 2px 3px; }
  .hud-strip { margin-top: 4px; }
  .counter { padding: 5px 9px 7px; }
  .counter-title .ct-ico { width: 26px; height: 26px; }
  .steps { min-height: 48px; padding: 4px 8px; }
  .slot { width: 40px; height: 40px; min-height: 0; }
  .slot .si { width: 32px; height: 32px; }
  .food { min-height: 48px; }
  .food .fi { width: 30px; height: 30px; }
  .food img, .food svg { width: 28px; height: 28px; }
  .fi-emoji { font-size: 22px; }
  .food::before { max-width: 40px; }
  .pantry { padding-bottom: 8px; }
}

/* =====================================================
 * v1.0.1b 安全区修正（2026-11-22）：真机第 3 行被截 + 底部空白带
 * 根因（实测复现，见 /tmp/nm-shot/mech.js）：安卓全面屏容器里
 * env(safe-area-inset-bottom) 约 46px（导航栏高），.pantry-wrap 用它做
 * padding-bottom 会吃掉 46px 弹性空间——.pantry-scroll 被压矮、第 3 行
 * 拦腰截断，而 padding 本身在滚动区下方渲染成一条奶油色空白带。
 * 无头 Chrome 的 env() 恒为 0，所以 v1.0.1 的四档实测全是 0 溢出、
 * 没暴露问题（复现时注入 46px 后与用户截图逐项对上：滚动区底边 684、
 * 空白带 46px、第 3 行只剩 34/56px）。
 * 修法：安全区 padding 从 .pantry-wrap（弹性容器，会压矮滚动区）移到
 * .pantry（滚动内容内部）：最后一行永远完整可见；滑到底时 padding
 * 把内容顶出导航栏区。16px 最小值兜底，env()=0 的设备也有呼吸空间。
 * Chrome 61 不认 env()，整条 calc 声明会被丢弃、回退到上一行 16px。
 * ===================================================== */
.pantry { padding-bottom: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }

/* =====================================================
 * v1.0.1c 开始页一屏适配（2026-11-22）
 * 根因（实测，见 /tmp/nm-shot/repro-start.js）：开始页 .ov-card
 * 内容高 1043~1076px，卡片可视高仅 629~806px，整卡溢出
 * 249~414px（真机 inset 46px 时再 +46px），卡片内部滚动 =
 * 用户感觉「整页滑来滑去」。文档本身不滚动（body/#app 均
 * overflow:hidden），滑的是这张卡。
 * 各区块（390×844）：品牌 94 + 玩法 127 + 金库 51 + 阶段 32
 * + 开摊 47 + 继续 57（有存档时才显示）+ 操作行 63×2
 * + 商店标题 28 + 商店 518（7 行）+ 卡片 padding 38。
 * 修法：① 卡片定高为 overlay 内容区高、变 flex 纵列，卡片本身
 * 不再滚动；② 收紧各区块（约省 80px）；③ 商店列表 flex:1 +
 * 内部滚动（唯一可滚区）；④ 安全区从卡片 padding 移到 overlay
 * 底部 padding：卡片底边不伸进导航栏区，列表空间与放卡片内
 * 相同（卡片矮 46px、padding 少 46px，两相抵消）。
 * 只改开始页（#startScreen 限定），结算/过关页卡片不动。
 * 配套：game.js renderShop() 重渲染前保存、各商店 scrollTop、
 * 渲染后恢复，避免购买后开始页列表跳回顶部。
 * ===================================================== */

/* ---- 卡片：定高 flex 纵列，本身不滚动 ---- */
#startScreen .ov-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 18px; /* 覆盖 @supports 的 env() 规则：安全区改放 overlay 上 */
}
#startScreen .ov-card > * { flex: 0 0 auto; }

/* ---- 商店列表：唯一内部滚动区 ---- */
#startScreen .ov-card > .shop {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin-bottom: 0;
  -webkit-overflow-scrolling: touch;
}

/* ---- 安全区：overlay 底部 padding 吃掉，卡片底边不进导航栏 ---- */
#startScreen {
  padding-bottom: 18px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}

/* ---- 收紧各区块 ---- */
#startScreen .brand { margin-bottom: 8px; }
#startScreen .brand-sub { margin-bottom: 4px; }
#startScreen .brand h1 { font-size: 24px; }
#startScreen .brand h1 em { margin-top: 3px; font-size: 12px; }
#startScreen .rules { gap: 6px; margin-bottom: 10px; }
#startScreen .rules li { font-size: 11px; line-height: 1.45; }
#startScreen .wallet { margin-bottom: 9px; padding: 7px; }
#startScreen .start-stage { margin: 4px 0 8px; }
#startScreen .btn.primary { padding-top: 11px; padding-bottom: 11px; }
#startScreen .btn.continue-btn { margin-top: 8px; padding-top: 11px; padding-bottom: 11px; }
#startScreen .start-acts { margin-top: 6px; gap: 8px; }
#startScreen .start-acts .btn.ghost { margin-top: 0; min-height: 40px; font-size: 12.5px; }
#startScreen .shop-title { margin-bottom: 7px; }

/* ---- 矮屏（≤720px）：再收一档，多留商店空间 ---- */
@media (max-height: 720px) {
  #startScreen { padding-top: 12px; padding-bottom: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  #startScreen .ov-card { padding-top: 16px; padding-bottom: 14px; }
  #startScreen .brand h1 { font-size: 22px; }
  #startScreen .rules { gap: 5px; margin-bottom: 8px; }
  #startScreen .rules li { font-size: 10.5px; line-height: 1.4; }
  #startScreen .wallet { margin-bottom: 8px; padding: 6px; }
  #startScreen .start-acts .btn.ghost { min-height: 38px; }
}

/* =====================================================
 * Chrome 61 基线回退（小工具容器最低内核，2026-11-20）
 * Flex gap：detect.js 实测生效时 <html> 带 .supports-flex-gap，
 * 用原生 gap；否则（Chrome 61）走 margin 基线。
 * Grid gap：grid-gap 全内核可用，直接补。
 * ===================================================== */
html:not(.supports-flex-gap) .neon-sign > * + * { margin-left: 6px; }
html:not(.supports-flex-gap) .street > * + * { margin-left: 6px; }
html:not(.supports-flex-gap) .c-tags > * + * { margin-top: 3px; }
html:not(.supports-flex-gap) .counter-top > * + * { margin-top: 2px; }
html:not(.supports-flex-gap) .counter-title > * + * { margin-left: 5px; }
html:not(.supports-flex-gap) .steps > * + * { margin-left: 6px; }
html:not(.supports-flex-gap) .food > * + * { margin-top: 2px; }
html:not(.supports-flex-gap) .rules > * + * { margin-top: 8px; }
html:not(.supports-flex-gap) .rules li > * + * { margin-left: 8px; }
html:not(.supports-flex-gap) .res-cell > * + * { margin-top: 2px; }
html:not(.supports-flex-gap) .shop > * + * { margin-top: 7px; }
html:not(.supports-flex-gap) .hud-strip > * + * { margin-left: 8px; }
html:not(.supports-flex-gap) .stage-chip > * + * { margin-left: 4px; }
html:not(.supports-flex-gap) .mini-btn > * + * { margin-left: 5px; }
html:not(.supports-flex-gap) .cats > * + * { margin-left: 6px; }
html:not(.supports-flex-gap) .cat > * + * { margin-left: 4px; }
html:not(.supports-flex-gap) .start-stage > * + * { margin-left: 8px; }
html:not(.supports-flex-gap) .start-acts > * + * { margin-left: 8px; }
html:not(.supports-flex-gap) .rs-bar > * + * { margin-left: 6px; }
html:not(.supports-flex-gap) .rn-list > * + * { margin-left: 5px; }
html:not(.supports-flex-gap) .res-actions > * + * { margin-left: 8px; }
html:not(.supports-flex-gap) .codex-head > * + * { margin-left: 8px; }
html:not(.supports-flex-gap) .codex-tabs > * + * { margin-left: 6px; }
html:not(.supports-flex-gap) .cx-p-top > * + * { margin-left: 8px; }
html:not(.supports-flex-gap) .cx-cats > * + * { margin-left: 5px; }
html:not(.supports-flex-gap) .cx-card > * + * { margin-top: 2px; }
html:not(.supports-flex-gap) .xd-top > * + * { margin-left: 10px; }
html:not(.supports-flex-gap) .cx-rewards > * + * { margin-top: 6px; }
html:not(.supports-flex-gap) .cx-rw > * + * { margin-left: 8px; }
html:not(.supports-flex-gap) .gr-lv > * + * { margin-left: 8px; }
html:not(.supports-flex-gap) .gr-row > * + * { margin-left: 8px; }
html:not(.supports-flex-gap) .gr-stall > * + * { margin-top: 6px; }
html:not(.supports-flex-gap) .share-acts > * + * { margin-left: 8px; }
html:not(.supports-flex-gap) .cx-progress .cx-p-top > * + * { margin-left: 8px; }
html:not(.supports-flex-gap) .gr-item .gi-h > * + * { margin-left: 6px; }
html:not(.supports-flex-gap) .gr-item .gi-bars > * + * { margin-left: 3px; }
html:not(.supports-flex-gap) .gr-hero .gr-row > * + * { margin-left: 8px; }
html:not(.supports-flex-gap) .gr-hero .gr-row .gr-bar > * + * { margin-left: 6px; }
html:not(.supports-flex-gap) #startScreen .home-acts > * + *, html:not(.supports-flex-gap) #startScreen .start-acts > * + * { margin-left: 10px; }

.hud-grid { grid-gap: 6px; }
.pantry { grid-gap: 6px; }  /* v1.0.1：与 gap: 6px 同步 */
.res-grid { grid-gap: 6px; }
.up { grid-gap: 10px; }
.cx-grid { grid-gap: 6px; }
.gr-stats { grid-gap: 6px; }
.gr-item { grid-gap: 2px 8px; }

/* aspect-ratio 回退：不支持时用定高兜底（.food 圆底） */
@supports not (aspect-ratio: 1 / 1) {
  .food::before { height: calc(100% - 11px); max-height: 50px; }
}

/* =====================================================
 * 新手引导（仅首局，Chrome 61 安全写法）
 * ===================================================== */
.tut-mask {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 90;
  display: none;
  background: rgba(90, 50, 20, .42);
  pointer-events: none;
}
.tut-ring {
  position: absolute;
  display: none;
  border: 3px solid #ff5fa2;
  border-radius: 16px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .55), 0 0 22px rgba(255, 95, 162, .65);
  pointer-events: none;
  transition: top .3s ease, left .3s ease, width .3s ease, height .3s ease;
  animation: tutPulse 1.1s ease-in-out infinite;
}
@keyframes tutPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255, 255, 255, .55), 0 0 18px rgba(255, 95, 162, .5); }
  50% { box-shadow: 0 0 0 7px rgba(255, 255, 255, .35), 0 0 30px rgba(255, 95, 162, .8); }
}
.tut-card {
  position: absolute;
  left: 18px;
  right: 18px;
  padding: 14px 16px 12px;
  background: linear-gradient(180deg, #fff8ee, #ffe9c4);
  border: 1px solid rgba(255, 155, 187, .6);
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(150, 80, 40, .35);
  pointer-events: auto;
  text-align: center;
}
.tut-card.pos-top { top: 96px; }
.tut-card.pos-mid { top: 60%; transform: translateY(-50%); }
.tut-title { font-size: 15px; font-weight: 700; color: #e0447c; margin-bottom: 6px; }
.tut-body { font-size: 12.5px; line-height: 1.55; color: #5a3a28; }
.tut-skip {
  margin-top: 10px;
  padding: 7px 18px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  color: #fff;
  background: linear-gradient(180deg, #ff9ec4, #ff5fa2);
  border: 1px solid rgba(255, 210, 232, .85);
  cursor: pointer;
}
