/* ===== 沙威玛小店 · 样式（横屏） ===== */

:root {
  --bg-1: #2a1a10;
  --bg-2: #120b07;
  --card: #3a2416;
  --card-line: rgba(255, 190, 110, 0.25);
  --cream: #fff1d6;
  --muted: #c9a883;
  --accent: #ffb347;
  --accent-2: #ff7a3d;
  --good: #8fe388;
  --bad: #ff6b6b;
}

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

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;                 /* 禁止页面滚动 */
  overscroll-behavior: none;
  color: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: radial-gradient(ellipse at 50% 0%, #5a3418 0%, var(--bg-1) 40%, var(--bg-2) 100%);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* 竖屏提示 */
.rotate-tip {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  font-size: 18px;
  color: var(--accent);
}

@media (orientation: portrait) {
  .rotate-tip {
    display: flex;
  }
}

.app {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 14px 12px;
}

/* ===== 顶部信息栏 ===== */
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--card-line);
  font-size: 14px;
}

.hud-item b {
  font-size: 18px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.money b {
  color: var(--good);
}

.hearts {
  font-size: 18px;
  letter-spacing: 2px;
}

/* ===== 排队区 ===== */
.queue-row {
  display: flex;
  gap: 8px;
  min-height: 74px;
}

.customer {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 12px;
  background: var(--card);
  border: 2px solid transparent;
  color: var(--cream);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.customer.selected {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(255, 179, 71, 0.45);
}

.customer .who {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 3px;
}

.customer .order {
  display: block;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 耐心条：宽度随剩余耐心变化，越少越红 */
.patience {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  background: var(--good);
  transition: width 0.2s linear, background 0.3s;
}

.customer.angry .patience {
  background: var(--bad);
}

/* ===== 主操作区 ===== */
.main {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 12px;
}

.counter {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--card-line);
}

.target {
  margin: 0;
  min-height: 20px;
  font-size: 14px;
  color: var(--cream);
}

.target b {
  color: var(--accent);
}

/* 饼：椭圆形卷饼，内部按加入顺序堆叠食材 */
.board {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pita {
  width: min(86%, 360px);
  aspect-ratio: 2.2 / 1;
  max-height: 100%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 40% 35%, #ffe2a6, #e8b26a 70%, #c98c46);
  box-shadow: inset 0 -6px 12px rgba(0, 0, 0, 0.2), 0 8px 18px rgba(0, 0, 0, 0.4);
  padding: 10% 16%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fills {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column-reverse;   /* 第一种食材在最底层 */
  justify-content: center;
  align-items: stretch;
  gap: 2px;
  border-radius: 40%;
  overflow: hidden;
}

.layer {
  flex: 1;
  border-radius: 40%;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2a1408;
  animation: drop 0.25s ease-out;
}

.layer.meat { background: linear-gradient(#b5512e, #8c3218); color: #fff3e6; }
.layer.veg { background: linear-gradient(#9ad86a, #5ba53b); }
.layer.sauce { background: linear-gradient(#ffe38a, #f2b84a); }
.layer.tomato { background: linear-gradient(#ff8a7a, #d8483a); color: #fff3e6; }

@keyframes drop {
  from { transform: translateY(-14px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.actions {
  display: flex;
  gap: 10px;
}

/* ===== 食材区 ===== */
.pantry {
  width: 92px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ingredient {
  flex: 1;
  border: none;
  border-radius: 14px;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  color: #2a1408;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.08s;
}

.ingredient:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

/* ===== 按钮 ===== */
.btn {
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  color: #2a1408;
  background: linear-gradient(180deg, #ffd27a, var(--accent-2));
  box-shadow: 0 4px 0 #a64a1f;
}

.btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #a64a1f;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn.ghost {
  background: rgba(255, 241, 214, 0.12);
  color: var(--cream);
  box-shadow: none;
  border: 1px solid var(--card-line);
}

.btn.small {
  padding: 8px 16px;
  font-size: 14px;
}

.btn.ghost:active {
  transform: none;
}

/* ===== 提示 ===== */
.toast {
  position: fixed;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  z-index: 20;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.75);
  color: var(--cream);
  font-size: 15px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.toast.show {
  opacity: 1;
}

.toast.bad {
  color: var(--bad);
}

/* 飘出的收入数字 */
.float-money {
  position: fixed;
  z-index: 15;
  font-weight: 800;
  font-size: 20px;
  color: var(--good);
  pointer-events: none;
  animation: floatUp 0.9s ease-out forwards;
}

@keyframes floatUp {
  from { opacity: 1; transform: translate(-50%, 0); }
  to { opacity: 0; transform: translate(-50%, -40px); }
}

/* ===== 遮罩与面板 ===== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 6, 3, 0.72);
  backdrop-filter: blur(3px);
}

.panel {
  width: min(92vw, 420px);
  max-height: 92vh;
  overflow-y: auto;
  padding: 20px;
  border-radius: 18px;
  text-align: center;
  background: linear-gradient(180deg, #4a2c18, #2a1a10);
  border: 1px solid var(--card-line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 22px;
  color: var(--accent);
}

.panel p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.7;
  color: #e8d3b8;
}

.panel .btn {
  margin-top: 8px;
}

/* 升级卡片 */
.upgrades {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}

.upgrade {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--card-line);
  color: var(--cream);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}

.upgrade small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.upgrade:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ===== 小屏横屏收紧 ===== */
@media (max-height: 480px) {
  .queue-row {
    min-height: 60px;
  }
  .customer {
    font-size: 11px;
  }
  .ingredient {
    font-size: 14px;
  }
}
