/* 经营奶茶店11 —— 横屏卡通奶茶店经营游戏 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  overflow: hidden;
  background: #2A1A12;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  color: #3A2418;
  user-select: none;
  -webkit-user-select: none;
}
body { position: fixed; inset: 0; }

/* 舞台：横屏铺满，从左上角开始画 */
.stage {
  position: absolute; inset: 0;
  overflow: hidden;
  background: #2A1A12;
}
.scene {
  position: absolute; top: 0; left: 0;
  width: 812px; height: 375px;
  transform-origin: top left;
  overflow: hidden;
}

/* 背景成品图 */
.scene-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  z-index: 0;
}
.scene-bg.hidden { display: none; }
.scene::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(58, 26, 10, .30) 0%, rgba(58, 26, 10, 0) 24%, rgba(58, 26, 10, 0) 58%, rgba(58, 26, 10, .40) 100%);
  pointer-events: none;
  z-index: 1;
}

/* ---------- 顶部状态条 ---------- */
.hud {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  z-index: 6;
}
.hud-chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 11px;
  border-radius: 15px;
  background: rgba(255, 250, 244, .94);
  border: 1px solid rgba(255, 138, 61, .5);
  box-shadow: 0 3px 10px rgba(90, 45, 15, .20);
  font-size: 13px; font-weight: 700; color: #7A3A12;
  white-space: nowrap;
}
.hud-chip .mp-icon { width: 15px; height: 15px; color: #FF8A3D; }
.hud-spacer { flex: 1; }
.hud-btn {
  width: 32px; height: 32px; border-radius: 16px;
  border: 1px solid rgba(255, 138, 61, .5);
  background: rgba(255, 250, 244, .94);
  color: #FF8A3D;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(90, 45, 15, .20);
  cursor: pointer;
  padding: 0;
}
.hud-btn .mp-icon { width: 17px; height: 17px; }
.hud-btn:active { transform: scale(.94); }
.hud-btn.muted { color: #B9A79A; }

/* ---------- 顾客队列 ---------- */
.queue {
  position: absolute; top: 46px; left: 0; right: 0;
  display: flex; align-items: flex-start; justify-content: center;
  gap: 10px; padding: 0 14px;
  z-index: 5;
  pointer-events: none;
}
.guest {
  width: 62px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: transform .18s ease, opacity .18s ease;
}
.guest .avatar {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  background: #FFF3E6;
  border: 2px solid #FFD3AE;
  box-shadow: 0 4px 10px rgba(90, 45, 15, .22);
}
.guest.active .avatar {
  border-color: #FF8A3D;
  box-shadow: 0 0 0 3px rgba(255, 138, 61, .30), 0 4px 12px rgba(90, 45, 15, .26);
}
.guest .mood {
  font-size: 10px; font-weight: 700; color: #FFF6EC;
  background: rgba(58, 26, 10, .58);
  padding: 1px 7px; border-radius: 8px;
  white-space: nowrap;
}

/* ---------- 订单气泡 ---------- */
.order-bubble {
  position: absolute; top: 100px; left: 50%;
  transform: translateX(-50%);
  width: 300px;
  padding: 9px 12px 10px;
  border-radius: 16px;
  background: rgba(255, 252, 247, .97);
  border: 1.5px solid #FFC79B;
  box-shadow: 0 8px 22px rgba(90, 45, 15, .24);
  z-index: 5;
  opacity: 0; pointer-events: none;
  transition: opacity .16s ease;
}
.order-bubble.show { opacity: 1; }
.ob-title {
  font-size: 11px; font-weight: 800; letter-spacing: .06em;
  color: #C4691F;
}
.ob-items {
  display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px;
}
.ob-item {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 10px;
  background: #FFF0E2; border: 1px solid #FFD9BC;
  font-size: 12px; font-weight: 700; color: #8A4415;
}
.ob-item .mp-icon { width: 13px; height: 13px; color: #FF8A3D; }
.ob-item.done { background: #E8F7E9; border-color: #B6E3B9; color: #2E7A38; }
.ob-item.done .mp-icon { color: #3FA34D; }
.ob-timer {
  margin-top: 7px; height: 5px; border-radius: 3px;
  background: #F0E2D6; overflow: hidden;
}
.ob-timer span {
  display: block; height: 100%; width: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #FFB067, #FF8A3D);
  transition: width .1s linear, background .2s;
}
.ob-timer span.low { background: linear-gradient(90deg, #FF8A6B, #E8452C); }

/* ---------- 制作台 ---------- */
.bench {
  position: absolute; left: 50%; bottom: 88px;
  transform: translateX(-50%);
  width: 268px;
  padding: 9px 12px 11px;
  border-radius: 18px;
  background: rgba(255, 250, 244, .96);
  border: 1.5px solid #FFD3AE;
  box-shadow: 0 10px 26px rgba(90, 45, 15, .26);
  z-index: 5;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
}
.bench-head {
  width: 100%; display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.bench-title { font-size: 12px; font-weight: 800; color: #7A3A12; }
.bench-hint { font-size: 10px; color: #A98A73; }

.cup {
  position: relative;
  width: 70px; height: 86px;
  border-radius: 8px 8px 22px 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.55));
  border: 2px solid #E9D6C4;
  box-shadow: inset 0 -6px 12px rgba(200, 160, 120, .18);
  overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
}
.cup-layers {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column-reverse;
  width: 100%;
}
.cup-layer {
  width: 100%;
  animation: layerIn .2s ease;
}
@keyframes layerIn { from { transform: translateY(8px); opacity: .2; } to { transform: none; opacity: 1; } }
.cup-label {
  position: relative; z-index: 2;
  font-size: 9px; font-weight: 800; color: #8A6A52;
  padding: 0 4px 8px; text-align: center; line-height: 1.2;
  text-shadow: 0 1px 0 rgba(255,255,255,.85);
}

.bench-actions { display: flex; gap: 8px; width: 100%; }
.act {
  flex: 1; height: 36px; border-radius: 12px;
  border: 1.5px solid #E9D6C4;
  background: #FFF6EC; color: #8A4415;
  font-size: 13px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  cursor: pointer;
  transition: transform .1s ease, background .15s;
  padding: 0;
}
.act .mp-icon { width: 15px; height: 15px; }
.act:active { transform: scale(.96); background: #FFEBD9; }
.act-primary {
  background: linear-gradient(180deg, #FFA45C, #FF8A3D);
  border-color: #F07A2C; color: #FFF8F1;
  box-shadow: 0 4px 12px rgba(255, 138, 61, .40);
}
.act-primary:active { background: linear-gradient(180deg, #FF9440, #F07A2C); }

/* ---------- 原料区 ---------- */
.shelf {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 14px;
  z-index: 6;
  background: linear-gradient(180deg, rgba(58, 26, 10, 0) 0%, rgba(58, 26, 10, .46) 100%);
}
.ing {
  flex: 0 0 74px;
  height: 60px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, .6);
  background: rgba(255, 250, 244, .95);
  box-shadow: 0 5px 14px rgba(40, 18, 6, .30);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .15s, border-color .15s;
  padding: 4px;
}
.ing .mp-icon { width: 20px; height: 20px; color: #FF8A3D; }
.ing .nm { font-size: 10px; font-weight: 800; color: #7A3A12; white-space: nowrap; }
.ing:active { transform: scale(.94); box-shadow: 0 2px 6px rgba(40, 18, 6, .32); }
.ing.hit { border-color: #3FA34D; box-shadow: 0 0 0 3px rgba(63, 163, 77, .32); }
.ing.miss { border-color: #E8452C; box-shadow: 0 0 0 3px rgba(232, 69, 44, .32); }

/* ---------- 飘字 ---------- */
.floaters {
  position: absolute; inset: 0; pointer-events: none; z-index: 8;
}
.floater {
  position: absolute;
  font-size: 15px; font-weight: 900;
  color: #FFF8F1;
  text-shadow: 0 2px 6px rgba(60, 25, 8, .6);
  animation: floatUp .9s ease-out forwards;
  white-space: nowrap;
}
.floater.good { color: #B9F5C0; }
.floater.bad { color: #FFC0B4; }
@keyframes floatUp {
  0% { transform: translate(-50%, 0) scale(.8); opacity: 0; }
  22% { transform: translate(-50%, -10px) scale(1.08); opacity: 1; }
  100% { transform: translate(-50%, -52px) scale(1); opacity: 0; }
}

/* ---------- 遮罩面板 ---------- */
.overlay {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(42, 20, 8, .60);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition: opacity .2s ease;
}
.overlay.hide { opacity: 0; pointer-events: none; }
.panel {
  width: 400px;
  max-height: 340px;
  overflow-y: auto;
  padding: 16px 20px 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, #FFFCF7, #FFF3E6);
  border: 2px solid #FFC79B;
  box-shadow: 0 18px 44px rgba(30, 12, 4, .48);
  text-align: center;
}
.panel-badge {
  display: inline-block;
  padding: 3px 12px; border-radius: 10px;
  background: #FFEBD9; color: #C4691F;
  font-size: 11px; font-weight: 800; letter-spacing: .08em;
}
.panel-title {
  margin: 9px 0 0; font-size: 20px; font-weight: 900; color: #5A2A0C;
}
.panel-desc {
  margin: 6px 0 0; font-size: 12.5px; line-height: 1.6; color: #8A6A52;
}
.panel-stats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin-top: 12px;
}
.pstat {
  flex: 1 1 80px;
  padding: 7px 6px; border-radius: 12px;
  background: #FFF6EC; border: 1px solid #FFD9BC;
}
.pstat .v { font-size: 16px; font-weight: 900; color: #FF8A3D; }
.pstat .k { font-size: 10px; color: #A98A73; margin-top: 1px; }
.panel-btn {
  margin-top: 14px; width: 100%; height: 44px;
  border: none; border-radius: 14px;
  background: linear-gradient(180deg, #FFA45C, #FF8A3D);
  color: #FFF8F1; font-size: 15px; font-weight: 900;
  box-shadow: 0 6px 16px rgba(255, 138, 61, .44);
  cursor: pointer;
  transition: transform .1s ease;
}
.panel-btn:active { transform: scale(.97); }
