/* 煎饼传奇 — 暖色像素风（浅色主题）
   UI 无美术资源，靠色块/硬阴影/描边营造"像素小摊"感 */

:root {
  --bg: #fff6e6;          /* 米黄底 */
  --panel: #fffdf5;       /* 面板 */
  --ink: #3a2a18;         /* 主文字（深褐） */
  --muted: #8a7458;
  --brown: #a05a2c;       /* 炉灶/饼皮 */
  --brown-dk: #7a3f1a;
  --red: #e5484d;         /* 辣 / 警示 */
  --gold: #f5a623;        /* 金币 */
  --green: #2f9e5f;
  --line: #3a2a18;
  --shadow: 0 5px 0 rgba(58, 42, 24, .85);
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% -10%, #ffe9b8 0, transparent 55%),
    radial-gradient(circle at 90% 110%, #ffe0c2 0, transparent 50%),
    var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--red); font-size: 13px; min-height: 18px; margin: 6px 0 0; }

#app { max-width: 1080px; margin: 0 auto; padding: 14px 16px 40px; }

/* ===== 顶栏 ===== */
#topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 10px 16px;
  background: linear-gradient(180deg, #ffe9b8, #ffdc93);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand .logo { font-size: 30px; line-height: 1; }
.brand h1 { margin: 0; font-size: 24px; letter-spacing: 2px; }
.brand .tagline { color: var(--muted); font-size: 12px; }
.chip {
  display: inline-block; padding: 5px 12px;
  background: #fff; border: 2px solid var(--line); border-radius: 999px;
  font-size: 14px; font-weight: 600;
}
.chip.gold { background: #fff3d6; color: #7a4d00; }

/* ===== 布局 ===== */
.layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  #rank-panel { order: -1; }
}

/* ===== 舞台 ===== */
#stage .screen {
  background: var(--panel);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

/* HUD */
#hud {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 12px;
}
.hud-cell {
  padding: 6px 12px; border-radius: 999px;
  background: #f7ecd7; border: 2px solid var(--line);
  font-size: 14px; font-weight: 600;
}
.hud-cell.day { background: #ffd75e; }
.hud-cell.coin { background: #fff0c2; }
.hud-cell.combo { background: #ffd0d0; color: #c22; }
.hud-cell.tip { background: #d8f3e0; color: var(--green); }

/* 工作台 */
#benches { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.bench {
  background: linear-gradient(180deg, #fdf1d8, #f6e2bd);
  border: 3px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px;
}
.bench-title {
  font-weight: 800; font-size: 14px; margin-bottom: 8px;
  color: var(--brown-dk);
  border-bottom: 2px dashed var(--brown);
  padding-bottom: 5px;
  display: flex; justify-content: space-between;
}
.bench .btns { display: flex; flex-wrap: wrap; gap: 8px; }
.bench > button { margin: 0 6px 8px 0; }

/* 按钮 */
.btn {
  font: inherit; font-weight: 700;
  padding: 9px 14px;
  border: 3px solid var(--line); border-radius: 10px;
  background: #ffe9b8; color: var(--ink);
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(58, 42, 24, .8);
  transition: transform .04s, box-shadow .04s;
  user-select: none;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 rgba(58,42,24,.8); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn.primary { background: #ff9f45; }
.btn.hot { background: #ff6b6b; }
.btn.ghost { background: #eee0c4; box-shadow: 2px 2px 0 rgba(58,42,24,.5); }
.btn.small { padding: 6px 10px; font-size: 13px; box-shadow: 2px 2px 0 rgba(58,42,24,.7); }
.btn.big { font-size: 17px; padding: 12px 26px; display: block; width: 100%; margin-top: 14px; }
.btn.top.on { background: var(--green); color: #fff; }
.btn.wide { width: 100%; margin-top: 10px; }

/* 当前订单横幅 */
.order-banner {
  margin: 12px 0;
  padding: 10px 14px;
  background: #fff3d6; border: 3px dashed var(--brown);
  border-radius: 10px; font-weight: 700; font-size: 15px;
}

/* 顾客队列 */
#queue-box { display: flex; flex-wrap: wrap; gap: 10px; }
.customer {
  flex: 1 1 200px; max-width: 240px;
  background: #fff; border: 3px solid var(--line); border-radius: 10px;
  padding: 8px 10px;
}
.customer.head { border-color: var(--red); background: #fff5f2; }
.c-top { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 14px; }
.c-omit { background: var(--red); color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 999px; }
.order-line { font-size: 12px; color: var(--muted); margin: 4px 0; }
.patience {
  height: 8px; background: #eadfc9; border-radius: 999px; overflow: hidden;
  margin-top: 6px;
}
.pat-bar { height: 100%; background: linear-gradient(90deg, #ff6b6b, #ffd75e); border-radius: 999px; }

.howto { margin-top: 14px; font-size: 12px; }

/* ===== 升级店 ===== */
.shop-head {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
}
.shop-head h2 { margin: 0; font-size: 20px; }
#shop-list { display: flex; flex-direction: column; gap: 10px; }
.shop-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: #fdf1d8; border: 3px solid var(--line); border-radius: 10px;
  padding: 10px 14px;
}
.si-main { display: flex; flex-direction: column; gap: 2px; }
.si-name { font-weight: 800; }
.si-desc { font-size: 12px; color: var(--muted); }

/* ===== 排行榜 ===== */
#rank-panel {
  background: var(--panel); border: 3px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 14px;
}
#rank-panel h2 { margin: 0 0 10px; font-size: 18px; text-align: center; }
#rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
#rank-list li {
  display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px;
  background: #f8eeda; border: 2px solid transparent; border-radius: 8px;
  padding: 6px 10px; font-size: 14px;
}
#rank-list li.me { border-color: var(--gold); background: #fff3d6; }
#rank-list .rank {
  width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  background: #d9c9a8; border-radius: 6px; font-weight: 800; font-size: 12px;
}
#rank-list .r-top1 { background: #ffd75e; color: #7a4d00; }
#rank-list .r-top2 { background: #c9d1d9; color: #37414b; }
#rank-list .r-top3 { background: #e6a97c; color: #5c2c0c; }
#rank-list .pts { font-weight: 800; color: var(--brown-dk); }
.rank-note { font-size: 11px; color: var(--muted); text-align: center; margin: 10px 0 2px; }

/* ===== 弹窗 ===== */
.mask {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(58, 42, 24, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.mask .card {
  width: 100%; max-width: 400px;
  background: var(--panel); border: 3px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
  text-align: center;
}
.mask .card h2 { margin: 0 0 6px; }
.mask input {
  width: 100%; font: inherit; padding: 10px 12px; margin-top: 8px;
  border: 3px solid var(--line); border-radius: 10px; background: #fff;
  outline: none;
}
.mask input:focus { border-color: var(--gold); }

/* 结算 */
.settle-title { font-weight: 800; font-size: 18px; }
.grade { font-size: 74px; font-weight: 900; line-height: 1.1; margin: 6px 0; }
.grade.gS { color: #ff9f45; text-shadow: 3px 3px 0 #ffe0b8; }
.grade.gA { color: #2f9e5f; }
.grade.gB { color: #4f7bd9; }
.grade.gC { color: #b8860b; }
.grade.gD { color: #9a9a9a; }
.settle-line { margin: 4px 0; font-size: 15px; }
.mask .row { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

/* ===== 飘字 ===== */
.flash {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 99; max-width: 90vw;
  padding: 10px 20px;
  border: 3px solid var(--line); border-radius: 999px;
  background: #fff; box-shadow: var(--shadow);
  font-weight: 800; font-size: 15px;
  animation: pop .18s ease-out;
}
.flash.good { background: #d8f3e0; }
.flash.warn { background: #fff3d6; }
.flash.bad { background: #ffd0d0; }
.flash.muted { background: #eee; }
@keyframes pop { from { transform: translateX(-50%) scale(.8); opacity: 0; } }
