/* =========================================================
 * 重生之我要当煎饼王 · 视觉层 v2（煎饼摊主题）
 * 街边小吃摊感觉：深木招牌 + 琥珀金 + 奶油纸 + 辣椒红点缀，
 * 与夜市摊主的通用粉色模板区分开。HUD 是木质招牌、订单卡是
 * 深木案板、道具栏与商店统一走暖色体系。
 * Chrome 61 基线：无 flex gap（用 margin）、无 inset/clamp、
 * Grid 间距用 grid-gap，100vh 在前、100dvh 在后。
 * =======================================================*/

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

#app {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff3e2;
  /* 细微的暖色斑点纹理（纯 CSS，像摊位桌布/牛皮纸），很淡、不抢内容 */
  background-image: radial-gradient(rgba(200, 140, 60, .10) 1px, transparent 1.6px);
  background-size: 18px 18px;
  box-shadow: 0 0 70px rgba(200, 120, 40, .18);
}

.screen {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 14px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
/* .screen 是纵向 flex + 可滚动：子项禁止压缩，否则内容总高超过视口时
   flex 会把带 overflow:hidden 的卡片压扁——英雄卡被压到约 170px、
   大标题/口号/金币行全被裁掉（2026-11-22 无头实测发现）。宁可滚动，不要压扁。 */
.screen > * { flex-shrink: 0; }

/* 游戏画面要一屏放得下（HUD+道具栏+顾客+订单卡+棋盘+回首页，不滚动，
   2026-11-22 用户反馈手机上要往下滑一点）：上下内边距收紧，棋盘尺寸
   由 game.js 的 fitBoard() 按剩余高度算（见棋盘一节注释），其余区块
   固定高度不被压扁。开始页/结算页沿用 .screen 默认 padding，不动。 */
#gameScreen { padding: 10px 14px 10px; }

/* ---------------- 通用组件 ---------------- */
.brand-sub {
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 6px;
  color: rgba(255, 255, 255, .9);
  margin-top: 2px;
  text-shadow: 0 1px 2px rgba(160, 61, 45, .25);
}
/* 大标题 30px：新名 9 个字（重生之我要当煎饼王），34px 在 375px 宽下会
   溢出换行；30px 时 9 字约 286px，360/375/390 宽都一行放得下 */
.big-title {
  text-align: center;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 2px;
  color: #fff;
  margin: 6px 0 3px;
  text-shadow: 0 2px 0 rgba(160, 61, 45, .3), 0 6px 16px rgba(160, 61, 45, .3);
}
.slogan { text-align: center; font-size: 13px; font-weight: bold; color: #7a3b1e; margin: 0; }

.card {
  background: #fffaf2;
  border: 2px solid #f0d3ac;
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 4px 14px rgba(200, 130, 50, .12);
}

/* 主按钮：立体质感——纵向渐变 + 顶部高光 + 底部硬边 + 彩色投影，
   图标在左、文字居中；按下去整颗下沉、硬边收短，像真的按进去了。
   .is-restart 时播放图标换成重开箭头（文案由 renderStart 同步改）。 */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 15px 0;
  margin-top: 10px;
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 1px;
  color: #fff;
  background: linear-gradient(180deg, #ff8a3d 0%, #f56a1b 100%);
  border-radius: 16px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), inset 0 -2px 0 rgba(224, 79, 125, .35),
    0 5px 0 #d14e0e, 0 10px 18px rgba(245, 106, 27, .35);
  text-shadow: 0 1px 2px rgba(160, 70, 10, .4);
}
.btn .btn-ico { width: 22px; height: 22px; margin-right: 8px; flex-shrink: 0; filter: drop-shadow(0 1px 1px rgba(160, 70, 10, .4)); }
.btn span { white-space: nowrap; }
.btn .ico-restart { display: none; }
.btn.is-restart .ico-play { display: none; }
.btn.is-restart .ico-restart { display: block; }
.btn:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), 0 2px 0 #d14e0e, 0 4px 8px rgba(245, 106, 27, .3); }
.btn:disabled { background: linear-gradient(180deg, #efddd0, #e8d5c2); box-shadow: 0 5px 0 #d3bda6; text-shadow: none; }
.btn.gold {
  background: linear-gradient(180deg, #ffc44d 0%, #f59e1b 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), inset 0 -2px 0 rgba(209, 138, 18, .35),
    0 5px 0 #d18a12, 0 10px 18px rgba(245, 166, 35, .35);
  text-shadow: 0 1px 2px rgba(160, 100, 0, .4);
}
.btn.gold .btn-ico { filter: drop-shadow(0 1px 1px rgba(160, 100, 0, .4)); }
.btn.gold:active { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4), 0 2px 0 #d18a12, 0 4px 8px rgba(245, 166, 35, .3); }
.btn.ghost {
  color: #c96a1e;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf3 100%);
  border: 2px solid #f0c9a0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 3px 0 #e0b98a, 0 6px 12px rgba(220, 140, 60, .18);
  text-shadow: none;
}
.btn.ghost .btn-ico { filter: none; }
.btn.ghost:active { transform: translateY(2px); background: #fff3e2; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 0 #e0b98a; }

.coins-line {
  display: table;
  margin: 12px auto 0;
  padding: 6px 18px 6px 12px;
  font-size: 14px;
  font-weight: bold;
  color: #8a6d1a;
  background: rgba(255, 255, 255, .94);
  border: 1.5px solid rgba(245, 197, 66, .55);
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(160, 61, 45, .18);
}
.coins-line .coin-ico { width: 20px; height: 20px; vertical-align: -4px; margin-right: 5px; }
.coins-line b { color: #d18a12; font-size: 17px; }

.save-note {
  font-size: 12px;
  line-height: 1.65;
  color: #a06a4a;
  background: #fff7ee;
  border: 1px dashed #f0c9a0;
  border-radius: 12px;
  padding: 9px 12px;
  margin: 12px 0 0;
}
.save-note b { color: #c96a1e; }

/* ---------------- 开始页 ---------------- */
/* 英雄区：暖色晨光渐变卡片，煎饼插画 + 蒸汽 + 装饰圆点；
   加白边描边 + 内高光，卡片不再贴着背景、浮起来了 */
.hero-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #ffdf9e 0%, #ffc98a 55%, #ffab7a 100%);
  border: 2px solid rgba(255, 255, 255, .65);
  border-radius: 24px;
  padding: 14px 14px 18px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), 0 10px 24px rgba(245, 150, 66, .32);
}
.hero-card::before {
  content: "";
  position: absolute;
  top: -46px; right: -30px;
  width: 130px; height: 130px;
  background: rgba(255, 255, 255, .22);
  border-radius: 50%;
}
.hero-card::after {
  content: "";
  position: absolute;
  bottom: -60px; left: -24px;
  width: 110px; height: 110px;
  background: rgba(255, 255, 255, .18);
  border-radius: 50%;
}
.hero { text-align: center; margin: 2px 0 0; position: relative; z-index: 1; }
.hero svg {
  width: 150px;
  height: 150px;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 8px 12px rgba(160, 61, 45, .25));
}
.hero-card .big-title, .hero-card .slogan, .hero-card .coins-line { position: relative; z-index: 1; }
/* 玩法说明 5 条（编号圆徽章 + 文字）：原先在开始页底部是一张卡片，
   用户反馈要往下滑才能看到（2026-11-22），已搬进「怎么玩」居中弹窗
   （.modal-card 里的 .howto），开始页不再留位置。 */
.howto { font-size: 13px; line-height: 1.7; color: #8a6a52; }
.howto b { color: #c96a1e; }
.howto p { margin: 8px 0; }
.howto p:last-child { margin-bottom: 2px; }
.howto p i {
  display: inline-block;
  width: 19px; height: 19px;
  margin-right: 8px;
  font-style: normal;
  font-size: 11px;
  font-weight: bold;
  line-height: 19px;
  text-align: center;
  color: #fff;
  background: linear-gradient(180deg, #ffb347, #f56a1b);
  border-radius: 50%;
  vertical-align: 2px;
  box-shadow: 0 2px 4px rgba(245, 106, 27, .4);
  text-shadow: 0 1px 1px rgba(160, 70, 10, .4);
}
.start-acts { margin-top: 6px; }
.start-acts .btn:first-child { margin-top: 8px; }

/* 工具行：导出/导入/音乐/音效收成一排小方块（图标 + 短文字），
   不再一人占一整行；音乐/音效静音时变灰、图标换静音态（同 HUD 做法）。 */
.tool-row { display: flex; margin-top: 12px; }
.tool-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 10px 2px 8px;
  margin-right: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fff8f3 100%);
  border: 2px solid #f0d3ac;
  border-radius: 16px;
  font-size: 12px;
  font-weight: bold;
  color: #c96a1e;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 3px 8px rgba(220, 140, 60, .16);
}
.tool-btn:last-child { margin-right: 0; }
.tool-btn svg { width: 24px; height: 24px; display: block; flex-shrink: 0; }
.tool-btn span { margin-top: 5px; white-space: nowrap; }
.tool-btn:active { transform: translateY(1px); background: #fff3e2; box-shadow: 0 1px 4px rgba(220, 140, 60, .14); }
.tool-btn:disabled { color: #c9ae97; border-color: #f2ddc8; box-shadow: none; }
.tool-btn .slash { display: none; }
.tool-btn.off { color: #c9ae97; border-color: #f2ddc8; }
.tool-btn.off .slash { display: block; }
.tool-btn.off .waves { display: none; }

/* ---------------- 商店浮层 ---------------- */
.overlay {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 30;
  background: rgba(91, 58, 41, .45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
/* 居中弹窗（怎么玩）用同一层遮罩，只是卡片放中间 */
.overlay.center { align-items: center; }

/* 关闭 X：怎么玩弹窗与满屏商店共用同一颗——36px 白底圆钮 + 橙色 X，
   够大好点；弹窗里是绝对定位在卡片右上角，商店里在标题栏右侧。 */
.modal-x {
  width: 36px; height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px solid #f0d3ac;
  border-radius: 50%;
  color: #c96a1e;
  box-shadow: 0 2px 6px rgba(220, 140, 60, .2);
}
.modal-x svg { width: 18px; height: 18px; display: block; }
.modal-x:active { background: #fff3e2; }

/* 居中弹窗卡片（怎么玩）：内容区 flex: 1 内部可滚，标题与「知道了」
   按钮固定在上下两端；点遮罩不关闭，只认 X 与「知道了」。 */
.modal-card {
  position: relative;
  width: 92%;
  max-width: 420px;
  max-height: 84%;
  display: flex;
  flex-direction: column;
  background: #fffaf2;
  border: 2px solid #f0d3ac;
  border-radius: 20px;
  padding: 16px 16px 14px;
  box-shadow: 0 16px 40px rgba(91, 58, 41, .35);
}
.modal-card h2 { flex-shrink: 0; font-size: 18px; margin: 0 0 8px; padding-right: 40px; color: #c96a1e; }
.modal-card .modal-x { position: absolute; top: 10px; right: 10px; }
.modal-card .howto {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-card .btn { flex-shrink: 0; margin-top: 12px; }
.sheet {
  width: 100%;
  max-height: 82%;
  overflow-y: auto;
  background: #fffaf2;
  border-radius: 20px 20px 0 0;
  padding: 12px 14px 22px;
  -webkit-overflow-scrolling: touch;
}
/* 底部浮层顶部的小把手，一看就知道可以上下滑 */
.sheet::before {
  content: "";
  display: block;
  width: 40px; height: 5px;
  margin: 0 auto 12px;
  background: #f0d3ac;
  border-radius: 3px;
}
/* 满屏商店（2026-11-22 用户要求）：占满整个视口，标题栏固定在顶、
   列表区内部滚动；底部「关掉」按钮已删，右上角 X 关闭。
   存档码浮层仍用原来的底部 sheet，不受影响。 */
.sheet.full {
  max-height: none;
  height: 100%;
  border-radius: 0;
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sheet.full::before { display: none; }
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.sheet-head h2 { margin: 0; }
.sheet.full .sub { flex-shrink: 0; margin-top: 6px; }
.sheet.full #shopList {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sheet h2 { font-size: 18px; margin: 0 0 6px; color: #c96a1e; }
.sheet .sub { font-size: 13px; color: #a06a4a; margin: 0 0 10px; }
/* 商店顶部的金币药丸：和开始页 coins-line 同款，余额一眼可见 */
.shop-coins {
  display: inline-block;
  margin-right: 8px;
  padding: 3px 12px 3px 6px;
  font-size: 13px;
  font-weight: bold;
  color: #8a6d1a;
  background: #fff;
  border: 1.5px solid rgba(245, 197, 66, .6);
  border-radius: 14px;
  vertical-align: -3px;
}
.shop-coins .coin-ico { width: 16px; height: 16px; vertical-align: -3px; margin-right: 3px; }
.shop-coins b { color: #d18a12; font-size: 15px; }

/* ---------------- 存档码浮层 ---------------- */
#scCode {
  width: 100%;
  min-height: 96px;
  padding: 10px;
  border-radius: 12px;
  border: 2px solid #f0d3ac;
  background: #fff;
  font-family: monospace;
  font-size: 11px;
  line-height: 1.5;
  color: #5b3a29;
  resize: vertical;
  word-break: break-all;
}
.sc-warn { min-height: 16px; font-size: 12px; line-height: 1.5; margin: 8px 0 0; text-align: center; color: #d43d2a; }
/* 分区标题：左粉条 + 标题 + 说明，一眼分清升级区和道具区 */
.shop-sec {
  display: flex;
  align-items: baseline;
  margin: 16px 0 10px;
  padding-left: 10px;
  border-left: 4px solid #f56a1b;
}
.shop-sec:first-child { margin-top: 4px; }
.shop-sec b { font-size: 15px; color: #c96a1e; }
.shop-sec span { font-size: 11px; font-weight: normal; color: #c08a6a; margin-left: 8px; }
/* 商店行：白底圆角卡，图标大一号、底块按商品配色，价格按钮金色立体 */
.shop-row {
  display: flex;
  align-items: center;
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
  border: 2px solid #f0d3ac;
  border-radius: 16px;
  box-shadow: 0 3px 8px rgba(200, 130, 50, .12);
}
.shop-icon {
  flex-shrink: 0;
  width: 54px; height: 54px;
  margin-right: 12px;
  background: #fff3e2;
  border: 2px solid #ffe4c7;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, .8);
}
.shop-icon img.shop-img { width: 46px; height: 46px; display: block; object-fit: cover; border-radius: 10px; }
/* 竖铲与横铲共用一张图，用旋转区分方向 */
.shop-icon img.shop-img.v { transform: rotate(90deg); }
/* 图标底块按商品配色：粉（提示）/绿（洗牌）/金（铲子、+5步、金铲子）/
   暖橙（大铁板）/浅黄（好运蛋） */
.shop-row.t-hint .shop-icon { background: #fff3d6; border-color: #f0c9a0; }
.shop-row.t-shuffle .shop-icon { background: #eefaf0; border-color: #c4e9cc; }
.shop-row.t-shovelH .shop-icon, .shop-row.t-shovelV .shop-icon,
.shop-row.t-moves .shop-icon, .shop-row.t-spatula .shop-icon { background: #fff6df; border-color: #ffe1a1; }
.shop-row.t-griddle .shop-icon { background: #fff0e4; border-color: #ffd9b3; }
.shop-row.t-luckegg .shop-icon { background: #fff8e6; border-color: #ffdf9e; }
.shop-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.shop-info b { font-size: 16px; line-height: 1.25; }
.shop-info .shop-desc { font-size: 12px; color: #a06a4a; margin-top: 3px; line-height: 1.4; }
/* 等级进度：圆润的胶囊段（已升金色渐变+阴影、未升浅米色描边），
   末尾跟 "Lv.1/5" 文字——一眼看清升到几级、还差几级 */
.shop-info .pips { display: flex; align-items: center; margin-top: 7px; }
.shop-info .pips i {
  width: 20px; height: 9px;
  border-radius: 5px;
  background: #f6e3d3;
  border: 1px solid #eed3bd;
  margin-right: 5px;
}
.shop-info .pips i.on {
  background: linear-gradient(180deg, #ffc44d, #f59e1b);
  border-color: #e0a02c;
  box-shadow: 0 1px 3px rgba(245, 166, 35, .5);
}
.shop-info .pips .lv-text {
  font-style: normal;
  font-size: 11px;
  font-weight: bold;
  color: #b87a00;
  margin-left: 2px;
}
/* 已拥有数量做成徽章（金色底），0 个时是浅色空态 */
.shop-info .owned-badge {
  align-self: flex-start;
  margin-top: 6px;
  font-size: 11px;
  font-weight: bold;
  color: #8a6d1a;
  background: #fff3cf;
  border: 1.5px solid #f5d67a;
  border-radius: 10px;
  padding: 2px 8px;
}
.shop-info .owned-badge.zero { color: #c08a6a; background: #fdf3e9; border-color: #f2ddc8; }
/* 价格按钮：金币图标 + 数字，金色渐变立体；买不起时是浅金色
   （仍看得出是按钮，不是死灰方块）；已满级是柔和的米粉色 */
.shop-buy {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 10px 13px;
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(180deg, #ffc44d 0%, #f59e1b 100%);
  border-radius: 12px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), inset 0 -2px 0 rgba(209, 138, 18, .3),
    0 3px 0 #d18a12, 0 5px 10px rgba(245, 166, 35, .3);
  text-shadow: 0 1px 1px rgba(160, 100, 0, .35);
  margin-left: 10px;
  white-space: nowrap;
}
.shop-buy:active { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4), 0 1px 0 #d18a12; }
.shop-buy .coin-ico { width: 16px; height: 16px; margin-right: 4px; flex-shrink: 0; }
.shop-buy:disabled {
  background: linear-gradient(180deg, #ffe1a1 0%, #ffd06e 100%);
  color: #a8761a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 2px 0 #e0b45a;
  text-shadow: none;
}
.shop-buy.maxed {
  background: #f6e3d3;
  color: #c08a6a;
  box-shadow: none;
  text-shadow: none;
}

/* ---------------- 游戏 HUD（摊位招牌） ----------------
 * 深木色招牌板 + 奶油字 + 金色描边，像挂在摊位上的菜单牌；
 * 每格带一个小图标（旗帜=关卡、小票=订单、时钟=时间、脚印=步数、
 * 金币=金币），图标与标签同行、数值在下。 */
.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, #7a4a2b 0%, #5d361f 100%);
  border: 2px solid #4a2a15;
  border-radius: 14px;
  padding: 9px 10px;
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, .35), inset 0 0 0 1.5px rgba(255, 196, 77, .35),
    0 4px 12px rgba(93, 54, 31, .35);
}
.hud .cell { flex: 1; text-align: center; min-width: 0; padding: 0 2px; }
.hud .cell + .cell { border-left: 1px solid rgba(255, 220, 160, .18); }
.hud .k { display: block; font-size: 11px; color: #e8c9a0; white-space: nowrap; }
.hud .k .hud-ico { width: 12px; height: 12px; vertical-align: -1px; margin-right: 2px; color: #ffc44d; }
.hud b { font-size: 15px; color: #fff6e8; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); white-space: nowrap; }
.hud b.low { color: #ff8a7a; }
.hud b.gold { color: #ffc44d; }
/* 剩余时间 ≤15 秒：亮辣椒红；JS 每秒切一次 .blink（奇数秒有浅红底），
   1Hz 一闪一闪做警示，不用 CSS infinite 动画（项目禁无限动画）。 */
.hud b.low.blink { background: rgba(255, 90, 70, .30); border-radius: 6px; padding: 0 4px; }
/* HUD 里的音乐/音效开关小圆钮：招牌上的小木钮，奶油图标；
   静音时变暗、无声波、加斜杠；两个按钮同尺寸同样式。 */
.hud-music {
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 196, 77, .55);
  background: rgba(255, 255, 255, .10);
  color: #ffe9c9;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hud-music svg { width: 20px; height: 20px; display: block; }
.hud-music .slash { display: none; }
.hud-music.off { color: rgba(255, 233, 201, .45); border-color: rgba(255, 196, 77, .25); }
.hud-music.off .slash { display: block; }
.hud-music.off .waves { display: none; }

/* ---------------- 局内道具栏（5 个一排，图标在上、文字在下） ----------------
 * 照片图标放大到 30px 才认得清（旧版 18px 小到看不清是什么）；
 * 图标在上、两字标签在下，5 个一排不挤、标签不竖排。 */
.item-bar { display: flex; margin-top: 8px; }
.item-btn {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px 1px 4px;
  margin-right: 5px;
  background: #fff;
  border: 2px solid #f0d3ac;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  color: #c96a1e;
  box-shadow: 0 2px 5px rgba(220, 140, 60, .1);
  white-space: nowrap;
}
.item-btn:last-child { margin-right: 0; }
.item-btn img.item-img { width: 30px; height: 30px; margin: 0 0 3px; flex-shrink: 0; object-fit: cover; border-radius: 7px; }
/* 竖铲与横铲共用一张图，用旋转区分方向 */
.item-btn img.item-img.v { transform: rotate(90deg); }
.item-btn .item-label { font-size: 11px; line-height: 1.2; }
/* 数量角标浮在按钮右上角，不占横向空间，标签再也不会被挤成竖排 */
.item-btn .cnt {
  position: absolute;
  top: -7px;
  right: -4px;
  margin: 0;
  background: #f5a623;
  color: #fff;
  font-size: 10px;
  border-radius: 10px;
  padding: 1px 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  border: 1.5px solid #fff;
}
.item-btn:disabled { color: #c9ae97; border-color: #f2ddc8; box-shadow: none; }
.item-btn:disabled img.item-img { opacity: .45; filter: grayscale(.5); }
.item-btn:disabled .cnt { background: #e0cbb8; }
/* 铲子点选模式：按钮高亮，棋盘描虚线边（横铲粉色、竖铲绿色，方向一眼分清） */
.item-btn.active { border-color: #f56a1b; background: #fff3d6; box-shadow: 0 0 0 2px rgba(245, 166, 35, .35); }
.board.pick-mode { outline: 2px dashed #f56a1b; outline-offset: 2px; border-radius: 12px; }
.board.pick-mode.pick-col { outline-color: #2f9e44; }
/* 点选模式行列高亮：悬停格所在行/列的格子描粉边（横铲）或绿边（竖铲） */
.tile.pick-hl { box-shadow: inset 0 0 0 3px rgba(245, 158, 27, .85), 0 0 8px rgba(245, 158, 27, .5); z-index: 1; }
.board.pick-col .tile.pick-hl { box-shadow: inset 0 0 0 3px rgba(47, 158, 68, .85), 0 0 8px rgba(47, 158, 68, .5); }

/* ---------------- 订单卡（深木案板） ----------------
 * 2026-11-22 用户第三次说看不清、亲口要求直接换背景色：之前三轮
 * （提透明度→白底小块）都没抓到根——整套配色太浅，奶油底贴浅黄
 * 图标，再描边也救不了。这次直接换深色：深胡桃木棕渐变 + 很淡的
 * 木纹感斜纹（纯 CSS repeating-linear-gradient，无图片背景），像一
 * 块真正的木案板；浅黄图标往深色上一放就清楚了。标题/步骤文字全
 * 部奶油白，步骤图标保留白底小块（白块在深木底上更醒目），当前步
 * 骤亮琥珀金边框、已完成亮绿 ✓。与 HUD 深木招牌板上下呼应。 */
.card.order-card {
  margin-top: 8px;
  background:
    repeating-linear-gradient(93deg, rgba(255, 220, 160, .05) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, #6b4226 0%, #4a2c17 100%);
  border: 2px solid #3a2110;
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, .25), 0 4px 14px rgba(74, 44, 23, .4);
}
.order-name { font-size: 16px; font-weight: bold; color: #fff6e8; margin-bottom: 6px; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.order-name .order-tag {
  display: inline-block;
  margin-right: 7px;
  padding: 2px 7px;
  font-style: normal;
  font-size: 11px;
  font-weight: bold;
  color: #fff;
  background: #e05244;
  border-radius: 6px;
  vertical-align: 2px;
  box-shadow: 0 1px 3px rgba(224, 82, 68, .4);
}
.order-name small { font-size: 12px; font-weight: normal; color: #e8c9a0; margin-left: 6px; }
.steps { display: flex; flex-direction: column; }
.step {
  display: flex;
  align-items: center;
  border-radius: 10px;
  padding: 5px 9px 5px 6px;
  margin-right: 0;
  margin-bottom: 4px;
  font-size: 13px;
  color: #fff6e8;
  background: rgba(255, 246, 232, .07);
  border: 2px solid rgba(255, 220, 160, .22);
}
.step .step-glyph { width: 26px; height: 26px; margin-right: 4px; }
.step .step-glyph svg { width: 100%; height: 100%; display: block; }
.step .step-name { font-size: 14px; font-weight: bold; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.step b { margin-left: 6px; font-size: 14px; }
.step.current { border-color: #ffc44d; background: rgba(255, 196, 77, .18); box-shadow: 0 0 0 2px rgba(255, 196, 77, .35); }
/* 已完成步骤：深木底上用亮绿表示——亮绿左竖条 + 绿框 + 亮绿 ✓ +
 * 浅绿文字；旧版深绿字（#1e6b2e）在深色底上看不清，已换掉。 */
.step.done { background: rgba(255, 246, 232, .07); border-color: rgba(126, 212, 145, .55); border-left: 4px solid #4ade80; padding-left: 4px; }
.step.done .step-name { color: #b9f5c4; }
.step.done .ok { color: #7ed491; }

/* ---------------- 棋盘 ---------------- */
/* 棋盘：外框定宽居中，内层 padding-top: 100% 相对外框内容宽，
   保证棋盘是正方形、格子是 1:1。注意：padding 百分比相对包含块宽度，
   所以 max-width 与 padding-top 绝不能写在同一个元素上（旧版 bug：高被撑到
   452px、宽卡在 340px，格子纵向拉伸约 0.75:1）。
   一屏适配（2026-11-22）：棋盘宽度由 game.js 的 fitBoard() 按剩余高度
   实时算（内联 style.width，矮屏自动缩小、高屏用到满宽）；CSS 这里不
   再写 max-width: 340px——max-width 会压住内联宽度，高屏棋盘就长不大
   了；JS 失效时 width: 100% 兜底，仍是正方形棋盘（只是可能要滚动）。 */
.board-frame {
  width: 100%;
  margin: 8px auto 0;
  flex-shrink: 0;
  background: #ffe4c7;
  border: 2px solid #ffcf9e;
  border-radius: 16px;
  box-shadow: inset 0 2px 10px rgba(200, 120, 40, .12);
  padding: 6px;
}
.board-wrap {
  position: relative;
  width: 100%;
  padding-top: 100%;
}
.board {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(7, 1fr);
  grid-gap: 4px;
  touch-action: none;
}
.tile {
  position: relative;
  background: #fff6e8;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .06);
  transition: transform .12s ease;
  overflow: hidden; /* 图片满幅铺满格子，圆角裁切 */
}
/* 食材图满幅方图（底色已烘焙进图里）；图未到时格子底色兜底 */
.tile img.tile-img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.tile svg { width: 72%; height: 72%; display: block; pointer-events: none; } /* 豪华星星 */
.tile:active { transform: scale(.94); }
.tile.selected {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px #f56a1b, 0 4px 10px rgba(245, 106, 27, .4);
  z-index: 2;
}
.tile.need::after {
  content: "";
  position: absolute;
  top: 3px; right: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #e05244;
  box-shadow: 0 0 0 3px #fff, 0 1px 4px rgba(224, 82, 68, .5);
}
.tile.special-egg { box-shadow: 0 0 0 2px #f5c542, 0 2px 0 rgba(0, 0, 0, .06); }
.tile.special-deluxe {
  background: #ffe9a8 !important;
  box-shadow: 0 0 0 2px #f5a623, 0 0 14px rgba(245, 166, 35, .55);
}
/* 特殊格闪光：JS 每 3 秒给格子加 .sparkle，动画播完摘掉（不用 infinite）。
   .shine 是格子里的斜向亮光带，平时透明；双蛋亮一点、豪华弱一点。 */
.tile .shine {
  position: absolute;
  top: 0; left: -60%;
  width: 45%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .8), transparent);
  transform: skewX(-20deg);
  opacity: 0;
  pointer-events: none;
}
.tile.sparkle .shine { animation: shineSweep .9s ease-out 1; }
.tile.special-deluxe .shine {
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .45), transparent);
}
@keyframes shineSweep {
  0% { left: -60%; opacity: 0; }
  15% { opacity: 1; }
  100% { left: 130%; opacity: 0; }
}
.tile.pop { animation: tilePop .17s ease forwards; }
@keyframes tilePop {
  0% { transform: scale(1) rotate(0deg); opacity: 1; }
  40% { transform: scale(1.25) rotate(8deg); opacity: .85; }
  100% { transform: scale(0) rotate(20deg); opacity: 0; }
}
/* 新格子落入：重力补充 / 开局进场时从上方滑入（v0.3） */
.tile.tile-new { animation: tileFallIn .22s ease-out; }
@keyframes tileFallIn {
  0% { transform: translateY(-26px) scale(.85); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
/* 连锁浮字层：棋盘中央上飘（v0.3） */
.float-layer {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.float-text {
  font-size: 26px;
  font-weight: bold;
  color: #c96a1e;
  text-shadow: 0 2px 0 #fff, 0 4px 14px rgba(224, 82, 68, .5);
  animation: floatUp .9s ease-out forwards;
}
@keyframes floatUp {
  0% { transform: translateY(10px) scale(.7); opacity: 0; }
  20% { transform: translateY(0) scale(1.15); opacity: 1; }
  100% { transform: translateY(-46px) scale(.9); opacity: 0; }
}

.game-foot { margin-top: 8px; text-align: center; }
.mini-btn {
  padding: 8px 18px;
  font-size: 13px;
  color: #a06a4a;
  background: #fff;
  border: 1.5px solid #f0d3ac;
  border-radius: 20px;
}

/* ---------------- 洗牌过渡遮罩 ----------------
   无路自动洗牌 / 洗牌道具共用：先盖住棋盘约 600ms 再换新盘，
   避免瞬间替换让玩家以为棋盘被重置（2026-11-22 用户反馈） */
.shuffle-veil {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 5;
  background: rgba(255, 246, 232, .93);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease;
}
.shuffle-veil.show { opacity: 1; }
.shuffle-veil-text { font-size: 17px; font-weight: bold; color: #c96a1e; }

/* ---------------- 提示条 ---------------- */
.toast {
  position: absolute;
  left: 50%;
  top: 34%;
  transform: translateX(-50%);
  z-index: 20;
  max-width: 86%;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  background: rgba(91, 58, 41, .92);
  border-radius: 20px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease;
}
.toast.show { opacity: 1; }

/* ---------------- 结算 ---------------- */
.result-title { text-align: center; font-size: 26px; color: #c96a1e; margin: 18px 0 4px; }
.result-sub { text-align: center; font-size: 14px; color: #a06a4a; margin: 0 0 16px; }
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 2px;
  border-top: 1px dashed #f0d3ac;
  font-size: 15px;
}
.stat-row:first-child { border-top: none; }
.stat-row b { color: #d18a12; }

/* ---------------- 顾客 ---------------- */
.customer-row { display: flex; align-items: flex-start; margin-top: 8px; }
.cust-avatar {
  width: 72px; height: 72px;
  flex-shrink: 0;
  background: #ffeddf;
  border: 2px solid #f0d3ac;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(200, 120, 40, .18);
}
.cust-avatar svg { width: 100%; height: 100%; display: block; }
.cust-avatar img.cust-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cust-avatar.happy { animation: custJump .6s ease; }
@keyframes custJump {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-8px); }
  60% { transform: translateY(0); }
  80% { transform: translateY(-4px); }
}
.cust-bubble {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 72px;
  margin-left: 14px;
  background: #fff;
  border: 2px solid #f0d3ac;
  border-radius: 16px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(200, 130, 50, .12);
}
.cust-bubble::before {
  content: "";
  position: absolute;
  left: -9px; top: 32px;
  width: 14px; height: 14px;
  background: #fff;
  border-left: 2px solid #f0d3ac;
  border-bottom: 2px solid #f0d3ac;
  transform: rotate(45deg);
}
.cust-name {
  align-self: flex-start;
  font-size: 11px;
  font-weight: bold;
  color: #c96a1e;
  background: #ffe9c9;
  border-radius: 10px;
  padding: 2px 8px;
}
.cust-say { font-size: 15px; font-weight: bold; color: #5b3a29; margin-top: 4px; line-height: 1.4; }

/* ---------------- 订单卡：组装图 + 步骤 ---------------- */
.order-body { display: flex; align-items: center; border-top: 1.5px dashed rgba(255, 220, 160, .35); padding-top: 7px; }
/* 组装图：写实照片（img/order/，随步骤换图），圆角相框 + 暖金描边 */
.assembly { width: 80px; height: 80px; flex-shrink: 0; margin-right: 12px; border: 2px solid #d9a55f; border-radius: 14px; overflow: hidden; background: #fff6e8; box-shadow: 0 3px 8px rgba(0, 0, 0, .3); }
.assembly img.assembly-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.steps { flex: 1; min-width: 0; }
/* 步骤槽：白底小块衬底（白色圆角方块 + 细边框 + 轻微阴影，图标内嵌 2px 白边）。
 * 面糊、煎蛋这类浅黄图标直接贴在奶油行底上对比度天然不够——上轮只删半透明
 * 还是看不清（2026-11-22 用户截图反馈），必须用白底把它和行底隔开；已完成与
 * 未完成靠绿圈区分，不靠淡化。全局 border-box，28px 含 1px 边框 + 2px 内边距，
 * 图标实际 22px。订单卡换深木底后（2026-11-22），白块在深色上更醒目。 */
.step .slot {
  display: inline-block;
  width: 28px; height: 28px;
  margin-right: 3px;
  vertical-align: middle;
  background: #fff;
  border: 1px solid #e8c9a0;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  padding: 2px;
}
.step .slot.on img.slot-img, .step .slot.on svg { box-shadow: inset 0 0 0 2px #5da85f; }
.step .slot svg { width: 100%; height: 100%; display: block; }
.step .slot img.slot-img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; display: block; }

/* ---------------- 新手引导（教练卡片） ---------------- */
.coach-wrap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 25;
  padding: 0 14px 16px;
  pointer-events: none;
}
.coach {
  pointer-events: auto;
  background: #fffaf2;
  border: 2px solid #f56a1b;
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(200, 120, 40, .3);
}
.coach-text { font-size: 15px; line-height: 1.6; font-weight: bold; color: #5b3a29; }
.coach-foot { display: flex; align-items: center; margin-top: 10px; }
.coach-step { font-size: 12px; color: #c08a6a; margin-right: auto; }
.coach-next {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  background: #f56a1b;
  border-radius: 20px;
  margin-left: 8px;
  box-shadow: 0 3px 0 #d14e0e;
}
.coach-next:active { transform: translateY(2px); box-shadow: 0 1px 0 #d14e0e; }
/* 引导高亮：只脉冲 3 次后停下（旧版 infinite 无限跳是用户反馈的“格子一直跳”根因）；
   粉色边框保留在 class 上，动画停后格子仍有粉边但不再动。玩家一动手交换，
   game.js 的 trySwap 会立即清除 tut-hint class。 */
.tile.tut-hint {
  animation: tutPulse .8s ease-in-out 3;
  box-shadow: 0 0 0 3px #f56a1b, 0 4px 10px rgba(245, 106, 27, .4);
  z-index: 2;
}
@keyframes tutPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* ---------------- 矮屏紧凑模式（视口高 ≤760px，游戏画面专用） ----------------
 * 667/740 这类矮屏光靠棋盘缩小不够——棋盘缩到 170px 以下格子就没法点了，
 * 所以矮屏下固定区块也再收一档（头像 72→56、步骤槽 28→24、HUD/道具栏/
 * 间距各收一点），把空间让给棋盘；只用 #gameScreen 前缀，不碰开始页。 */
@media (max-height: 760px) {
  #gameScreen { padding: 8px 14px 8px; }
  #gameScreen .hud { padding: 6px 10px; }
  #gameScreen .item-bar { margin-top: 6px; }
  #gameScreen .item-btn img.item-img { width: 24px; height: 24px; }
  #gameScreen .customer-row { margin-top: 6px; }
  #gameScreen .cust-avatar { width: 56px; height: 56px; }
  #gameScreen .cust-bubble { min-height: 56px; padding: 8px 12px; }
  #gameScreen .cust-bubble::before { top: 24px; }
  #gameScreen .card.order-card { margin-top: 6px; }
  #gameScreen .step { padding: 4px 9px 4px 6px; margin-bottom: 3px; }
  #gameScreen .step .slot { width: 24px; height: 24px; }
  #gameScreen .assembly { width: 64px; height: 64px; }
  #gameScreen .board-frame { margin-top: 6px; }
  #gameScreen .game-foot { margin-top: 6px; }
}

/* ---------------- 极矮屏紧凑模式（视口高 ≤700px，B站 Toy 容器专用） ----------------
 * Toy 容器在手机上的视口只有约 667px 高（顶部作者栏+底部互动栏占了高度），
 * 760px 档的收紧不够：第 1 关棋盘只剩 190px、格子 31px 没法看（2026-11-23
 * 用户截图反馈）。这一档再收一档：HUD/道具栏/顾客/订单卡/间距全部收紧，
 * 目标 360×667 下棋盘 ≥280px 且第 1 关一屏放得下、不滚动（用户亲口定：
 * 高度不够就把上面收紧，绝对不要下滑）。只用 #gameScreen 前缀，不碰开始页/
 * 商店/结算页；740px 的小红书容器不受这一档影响。 */
@media (max-height: 700px) {
  #gameScreen { padding: 6px 14px 6px; }
  #gameScreen .hud { padding: 4px 10px; }
  #gameScreen .hud .k { font-size: 10px; }
  #gameScreen .hud b { font-size: 14px; }
  #gameScreen .hud-music { width: 26px; height: 26px; }
  #gameScreen .hud-music svg { width: 17px; height: 17px; }
  #gameScreen .item-bar { margin-top: 4px; }
  #gameScreen .item-btn { padding: 3px 1px 2px; }
  #gameScreen .item-btn img.item-img { width: 20px; height: 20px; }
  #gameScreen .item-btn .item-label { font-size: 10px; }
  #gameScreen .customer-row { margin-top: 4px; }
  #gameScreen .cust-avatar { width: 44px; height: 44px; }
  #gameScreen .cust-bubble { min-height: 44px; margin-left: 10px; padding: 6px 10px; }
  #gameScreen .cust-bubble::before { top: 15px; }
  #gameScreen .cust-say { font-size: 13px; }
  #gameScreen .card.order-card { margin-top: 4px; padding: 8px 12px; }
  #gameScreen .order-name { font-size: 14px; margin-bottom: 3px; }
  #gameScreen .order-body { padding-top: 4px; }
  #gameScreen .step { padding: 2px 8px 2px 5px; margin-bottom: 2px; }
  #gameScreen .step .slot { width: 20px; height: 20px; }
  #gameScreen .step .step-name { font-size: 12px; }
  #gameScreen .step b { font-size: 12px; }
  #gameScreen .assembly { width: 48px; height: 48px; }
  #gameScreen .board-frame { margin-top: 4px; }
  #gameScreen .game-foot { margin-top: 4px; }
  #gameScreen .mini-btn { padding: 5px 16px; font-size: 12px; }
}

/* ---------------- 小屏 ---------------- */
@media (max-width: 360px) {
  .big-title { font-size: 30px; }
  .hero svg { width: 126px; height: 126px; }
  .btn { font-size: 16px; }
  .hud b { font-size: 14px; }
  .step { font-size: 12px; }
}
@media (max-height: 640px) {
  .screen { padding-top: 10px; }
  .hero svg { width: 110px; height: 110px; }
  .hero-card { padding-top: 10px; padding-bottom: 12px; }
  .big-title { font-size: 28px; }
}
