/* ===== 全局重置与基础变量 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

:root {
  --pixel-size: 4px;
  --bg-dark: #1c1410;
  --bg-medium: #2a1f17;
  --bg-light: #3d2b1f;
  --primary: #e94560;
  --secondary: #8b5e3c;
  --accent: #f5c518;
  --gold: #ffd700;
  --gold-dark: #b8960f;
  --success: #4caf50;
  --danger: #e74c3c;
  --warning: #f39c12;
  --text: #f5efe6;
  --text-dim: #a89585;
  --wood: #8B4513;
  --wood-light: #A0522D;
  --wood-dark: #654321;
  --shelf-bg: #2c1810;
  --card-bg: rgba(255, 235, 205, 0.08);
  --card-border: rgba(255, 220, 180, 0.18);
  --font-pixel: 'Courier New', monospace;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-pixel);
  background: var(--bg-dark);
  color: var(--text);
  image-rendering: pixelated;
}

/* ===== 游戏容器 ===== */
#game-container {
  width: 100%;
  height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

/* ===== 屏幕管理 ===== */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.3s;
}

.screen.active {
  display: flex;
}

/* ===== 像素风格按钮 ===== */
.pixel-btn {
  font-family: var(--font-pixel);
  font-size: 18px;
  font-weight: bold;
  padding: 12px 32px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: #fff;
  background: var(--primary);
  position: relative;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: transform 0.1s, filter 0.1s;
  box-shadow:
    inset -4px -4px 0 rgba(0,0,0,0.3),
    inset 4px 4px 0 rgba(255,255,255,0.15),
    0 4px 0 #a0303f;
  image-rendering: pixelated;
}

.pixel-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow:
    inset -4px -4px 0 rgba(0,0,0,0.3),
    inset 4px 4px 0 rgba(255,255,255,0.15),
    0 6px 0 #a0303f;
}

.pixel-btn:active {
  transform: translateY(2px);
  box-shadow:
    inset -4px -4px 0 rgba(0,0,0,0.3),
    inset 4px 4px 0 rgba(255,255,255,0.15),
    0 2px 0 #a0303f;
}

.pixel-btn.secondary {
  background: var(--secondary);
  box-shadow:
    inset -4px -4px 0 rgba(0,0,0,0.3),
    inset 4px 4px 0 rgba(255,255,255,0.15),
    0 4px 0 #3a2460;
}

.pixel-btn.small {
  font-size: 12px;
  padding: 6px 16px;
}

.pixel-btn.danger {
  background: var(--danger);
  box-shadow:
    inset -4px -4px 0 rgba(0,0,0,0.3),
    inset 4px 4px 0 rgba(255,255,255,0.15),
    0 4px 0 #a0302a;
}

.pixel-btn.cook-btn {
  background: var(--success);
  font-size: 20px;
  padding: 14px 40px;
  box-shadow:
    inset -4px -4px 0 rgba(0,0,0,0.3),
    inset 4px 4px 0 rgba(255,255,255,0.15),
    0 4px 0 #1e8c4d;
}

.pixel-btn.cook-btn:disabled {
  background: #555;
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow:
    inset -4px -4px 0 rgba(0,0,0,0.3),
    inset 4px 4px 0 rgba(255,255,255,0.1),
    0 4px 0 #333;
}

/* ===== 开始界面 ===== */
#start-screen {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-medium) 50%, var(--bg-light) 100%);
  gap: 20px;
}

.title-area {
  text-align: center;
  position: relative;
}

.restaurant-sign {
  background: var(--wood);
  border: 4px solid var(--wood-dark);
  padding: 30px 60px;
  position: relative;
  box-shadow:
    inset -6px -6px 0 rgba(0,0,0,0.2),
    inset 6px 6px 0 rgba(255,255,255,0.1),
    0 8px 0 var(--wood-dark);
}

.restaurant-sign h1 {
  font-size: 48px;
  color: var(--accent);
  text-shadow: 4px 4px 0 rgba(0,0,0,0.5);
  letter-spacing: 8px;
}

.restaurant-sign .subtitle {
  font-size: 16px;
  color: var(--text-dim);
  margin-top: 8px;
  letter-spacing: 4px;
}

.sign-top {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 16px;
  background: var(--wood-dark);
  border-top: 4px solid #4a3010;
}

.sign-top::before, .sign-top::after {
  content: '';
  position: absolute;
  top: -20px;
  width: 8px;
  height: 24px;
  background: #666;
  border: 2px solid #444;
}

.sign-top::before { left: 8px; }
.sign-top::after { right: 8px; }

/* 蒸汽动画 */
.steam {
  position: absolute;
  width: 8px;
  height: 8px;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  animation: steamRise 2s ease-out infinite;
}

.steam-1 { bottom: 20px; left: 30%; animation-delay: 0s; }
.steam-2 { bottom: 20px; left: 50%; animation-delay: 0.7s; }
.steam-3 { bottom: 20px; left: 70%; animation-delay: 1.4s; }

@keyframes steamRise {
  0% { opacity: 0.6; transform: translateY(0) scale(1); }
  50% { opacity: 0.3; transform: translateY(-30px) scale(1.5); }
  100% { opacity: 0; transform: translateY(-60px) scale(2); }
}

.start-decorations {
  position: absolute;
  bottom: 40px;
  width: 200px;
  height: 80px;
}

/* ===== 游戏说明界面 ===== */
#help-screen {
  background: linear-gradient(135deg, var(--bg-dark), var(--bg-medium));
  gap: 20px;
}

#help-screen h2 {
  font-size: 32px;
  color: var(--accent);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}

.help-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 500px;
  width: 100%;
}

.help-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  padding: 14px 20px;
  box-shadow: inset -3px -3px 0 rgba(0,0,0,0.2);
}

.help-icon {
  font-size: 28px;
  min-width: 40px;
  text-align: center;
}

.help-item p {
  font-size: 14px;
  line-height: 1.5;
}

/* ===== 每日开始界面 ===== */
#day-start-screen {
  background: linear-gradient(135deg, var(--bg-dark), var(--bg-light));
  gap: 24px;
}

.day-banner {
  text-align: center;
  background: var(--card-bg);
  border: 3px solid var(--accent);
  padding: 30px 40px;
  box-shadow: 0 0 30px rgba(233, 69, 96, 0.2);
}

.day-banner h2 {
  font-size: 36px;
  color: var(--accent);
  margin-bottom: 16px;
}

.day-info {
  display: flex;
  gap: 30px;
  justify-content: center;
  margin-bottom: 16px;
}

.day-info p {
  font-size: 16px;
}

.gold-text {
  color: var(--gold) !important;
  text-shadow: 1px 1px 0 var(--gold-dark);
}

.menu-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.menu-preview-item {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--card-border);
  padding: 6px 12px;
  font-size: 12px;
}

/* ===== 主游戏界面 ===== */
#game-screen {
  flex-direction: column;
  justify-content: flex-start;
  padding: 0;
  gap: 0;
  background: linear-gradient(180deg, var(--bg-medium) 0%, var(--bg-dark) 100%);
}

/* 顶部信息栏 */
#top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 16px;
  background: var(--bg-light);
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.info-item {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 14px;
}

.info-item .label {
  color: var(--text-dim);
  font-size: 12px;
}

.info-item .value {
  font-size: 18px;
  font-weight: bold;
  color: var(--text);
}

/* 客人区域 */
#customer-area {
  width: 100%;
  padding: 8px 16px;
  background: rgba(0,0,0,0.2);
  border-bottom: 2px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

#customer-area h3 {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.customer-slots {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  min-height: 120px;
}

/* 统一卡片圆角与阴影 */
.help-item,
.order-display,
.shop-item,
.stat-row,
.day-banner,
.menu-preview-item,
.day-event-card,
.stove-slot,
.ingredient-btn,
.prep-item,
.order-ingredient,
.toast {
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.patience-bar {
  border-radius: 3px;
  overflow: hidden;
}

.patience-fill {
  border-radius: 3px;
}

.stove-progress {
  border-radius: 3px;
}

.stove-progress-fill {
  border-radius: 3px;
}

/* 客人卡片 */
.customer-card {
  min-width: 140px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.customer-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.customer-card.selected {
  border-color: var(--success);
  box-shadow: 0 0 12px rgba(46, 204, 113, 0.3);
}

.customer-card.angry {
  border-color: var(--danger);
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.customer-avatar {
  width: 36px;
  height: 36px;
  margin: 0 auto 6px;
  position: relative;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  font-weight: bold;
}

.customer-name {
  font-size: 11px;
  text-align: center;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-order {
  font-size: 12px;
  text-align: center;
  color: var(--accent);
  font-weight: bold;
  margin-bottom: 6px;
}

.patience-bar {
  width: 100%;
  height: 6px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
}

.patience-fill {
  height: 100%;
  background: var(--success);
  transition: width 0.3s linear, background-color 0.3s;
}

.patience-fill.warning {
  background: var(--warning);
}

.patience-fill.danger {
  background: var(--danger);
  animation: pulseDanger 0.5s ease-in-out infinite;
}

@keyframes pulseDanger {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.customer-tip {
  font-size: 10px;
  text-align: center;
  color: var(--gold);
  margin-top: 4px;
}

/* 订单区域 */
#order-area {
  width: 100%;
  padding: 8px 16px;
  border-bottom: 2px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

#order-area h3 {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.order-display {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  padding: 12px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.order-display .empty-hint {
  color: var(--text-dim);
  font-style: italic;
}

.order-detail {
  width: 100%;
}

.order-dish-name {
  font-size: 18px;
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 8px;
}

.order-ingredients {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.order-ingredient {
  padding: 4px 10px;
  font-size: 12px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
  transition: border-color 0.2s, background 0.2s;
}

.order-ingredient.collected {
  border-color: var(--success);
  background: rgba(46, 204, 113, 0.15);
  color: var(--success);
}

.order-ingredient.collected::before {
  content: '✓ ';
}

.order-price {
  font-size: 14px;
  color: var(--gold);
  margin-top: 6px;
  text-align: right;
}

/* 准备区 */
#prep-area {
  width: 100%;
  padding: 8px 16px;
  border-bottom: 2px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

#prep-area h3 {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.prep-slots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 40px;
  margin-bottom: 8px;
}

.prep-item {
  background: rgba(46, 204, 113, 0.15);
  border: 2px solid var(--success);
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.1s;
  animation: popIn 0.2s ease-out;
}

.prep-item:hover {
  transform: scale(1.05);
}

.prep-item.wrong {
  border-color: var(--danger);
  background: rgba(231, 76, 60, 0.15);
  animation: shake 0.3s;
}

@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  80% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

#prep-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* 食材架 */
#ingredient-shelf {
  width: 100%;
  padding: 8px 16px;
  flex: 1;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--shelf-bg) 0%, rgba(44, 24, 16, 0.5) 100%);
  border-top: 4px solid var(--wood);
}

#ingredient-shelf h3 {
  font-size: 13px;
  color: var(--wood-light);
  margin-bottom: 8px;
}

.ingredient-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}

.ingredient-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 6px;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.12);
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s, background 0.15s;
  font-family: var(--font-pixel);
  color: var(--text);
  font-size: 12px;
}

.ingredient-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: rgba(255,255,255,0.1);
}

.ingredient-btn:active {
  transform: translateY(1px);
}

.ingredient-btn .emoji {
  font-size: 24px;
}

.ingredient-btn.needed {
  border-color: var(--success);
  background: rgba(46, 204, 113, 0.1);
}

.ingredient-btn.not-needed {
  opacity: 0.4;
}

.ingredient-btn.collected {
  border-color: var(--text-dim);
  opacity: 0.3;
  cursor: default;
}

/* 灶台栏 */
#stove-bar {
  width: 100%;
  padding: 4px 16px;
  border-bottom: 2px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
  min-height: 44px;
}

.stove-slots {
  display: flex;
  gap: 8px;
}

.stove-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 2px solid var(--card-border);
  background: var(--card-bg);
  flex: 1;
  min-height: 36px;
  position: relative;
}

.stove-slot.empty {
  opacity: 0.4;
  justify-content: center;
}

.stove-icon {
  font-size: 16px;
}

.stove-label {
  font-size: 11px;
  color: var(--text-dim);
}

.stove-slot.cooking {
  border-color: var(--warning);
  background: rgba(243, 156, 18, 0.08);
}

.stove-dish {
  font-size: 12px;
  font-weight: bold;
  color: var(--accent);
  white-space: nowrap;
}

.stove-for {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

.stove-progress {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  overflow: hidden;
  min-width: 40px;
}

.stove-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--warning), var(--success));
  transition: width 0.1s linear;
}

.stove-slot.done {
  border-color: var(--success);
  background: rgba(46, 204, 113, 0.1);
  animation: stovePulse 1s ease-in-out infinite;
}

@keyframes stovePulse {
  0%, 100% { box-shadow: 0 0 4px rgba(46, 204, 113, 0.2); }
  50% { box-shadow: 0 0 12px rgba(46, 204, 113, 0.5); }
}

.serve-btn {
  font-family: var(--font-pixel);
  font-size: 12px;
  font-weight: bold;
  padding: 4px 12px;
  border: none;
  cursor: pointer;
  color: #fff;
  background: var(--success);
  box-shadow: inset -2px -2px 0 rgba(0,0,0,0.2), inset 2px 2px 0 rgba(255,255,255,0.15), 0 2px 0 #1e8c4d;
  animation: popIn 0.3s ease-out;
  white-space: nowrap;
  flex-shrink: 0;
}

.serve-btn:active {
  transform: translateY(1px);
  box-shadow: inset -2px -2px 0 rgba(0,0,0,0.2), inset 2px 2px 0 rgba(255,255,255,0.15), 0 1px 0 #1e8c4d;
}

/* 客人卡片灶台指示 */
.customer-card.on-stove {
  border-color: var(--warning);
}

.customer-card.on-stove::after {
  content: '🍳';
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 12px;
}

.customer-card.dish-ready {
  border-color: var(--success);
}

.customer-card.dish-ready::after {
  content: '✅';
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 12px;
}

/* 明星客人特殊样式 */
.customer-card.star-customer {
  background: linear-gradient(135deg, rgba(255, 105, 180, 0.15), rgba(255, 215, 0, 0.1));
  border-color: #ff69b4;
  box-shadow: 0 0 8px rgba(255, 105, 180, 0.25);
}

.customer-card.star-customer::before {
  content: '⭐';
  position: absolute;
  top: 2px;
  left: 2px;
  font-size: 12px;
}

.customer-card.star-customer.on-stove {
  border-color: var(--warning);
}

.customer-card.star-customer.dish-ready {
  border-color: var(--success);
}

/* ===== 暂停覆盖 ===== */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.overlay-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.overlay-content h2 {
  font-size: 32px;
  color: var(--accent);
}

/* ===== 每日结算 ===== */
#day-end-screen {
  background: linear-gradient(135deg, var(--bg-dark), var(--bg-medium));
}

.day-end-content {
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.day-end-content h2 {
  font-size: 32px;
  color: var(--accent);
  margin-bottom: 20px;
}

.day-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  font-size: 15px;
}

.stat-row.result-row {
  border-color: var(--accent);
  margin-top: 8px;
}

.result-text {
  font-weight: bold;
}

.result-text.success { color: var(--success); }
.result-text.fail { color: var(--danger); }

.star-rating {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 36px;
}

.star {
  display: inline-block;
  transition: transform 0.3s, opacity 0.3s;
}

.star.earned {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  animation: starPop 0.5s ease-out;
}

.star.empty {
  color: #444;
  opacity: 0.4;
}

@keyframes starPop {
  0% { transform: scale(0); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ===== 升级商店 ===== */
#shop-screen {
  background: linear-gradient(135deg, var(--bg-dark), var(--bg-light));
  gap: 16px;
}

#shop-screen h2 {
  font-size: 28px;
  color: var(--accent);
}

.shop-money {
  font-size: 18px;
  color: var(--gold);
  margin-bottom: 8px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  max-width: 700px;
  width: 100%;
  max-height: 400px;
  overflow-y: auto;
  padding: 4px;
}

.shop-item {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  padding: 16px;
  text-align: center;
  transition: border-color 0.15s, transform 0.1s;
  cursor: pointer;
}

.shop-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.shop-item.purchased {
  border-color: var(--success);
  opacity: 0.6;
  cursor: default;
}

.shop-item-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.shop-item-name {
  font-size: 14px;
  font-weight: bold;
  color: var(--text);
  margin-bottom: 4px;
}

.shop-item-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.shop-item-price {
  font-size: 16px;
  color: var(--gold);
  font-weight: bold;
}

.shop-item-price.affordable {
  color: var(--success);
}

/* ===== 游戏结束 ===== */
#gameover-screen {
  background: linear-gradient(135deg, #1a0a0a, #2a0a0a);
}

.gameover-content {
  text-align: center;
}

.gameover-content h2 {
  font-size: 40px;
  color: var(--danger);
  margin-bottom: 20px;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}

.gameover-content p {
  font-size: 18px;
  margin-bottom: 12px;
}

/* ===== Toast 消息 ===== */
#toast-container {
  position: absolute;
  top: 60px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 300;
  pointer-events: none;
}

.toast {
  padding: 10px 20px;
  font-family: var(--font-pixel);
  font-size: 14px;
  font-weight: bold;
  animation: toastIn 0.3s ease-out, toastOut 0.3s ease-in 2s forwards;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.toast.success {
  background: var(--success);
  color: #fff;
  border-left: 4px solid #1a9a54;
}

.toast.error {
  background: var(--danger);
  color: #fff;
  border-left: 4px solid #a52a2a;
}

.toast.info {
  background: var(--bg-light);
  color: var(--text);
  border-left: 4px solid var(--accent);
}

.toast.money {
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  color: #1a1a1a;
  border-left: 4px solid #8a6a00;
  font-size: 18px;
}

@keyframes toastIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100px); }
}

/* ===== 金币飘动效果 ===== */
.coin-float {
  position: absolute;
  color: var(--gold);
  font-weight: bold;
  font-size: 20px;
  pointer-events: none;
  animation: coinFloat 1.5s ease-out forwards;
  z-index: 250;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}

@keyframes coinFloat {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  30% { opacity: 1; transform: translateY(-25px) scale(1.15); }
  100% { opacity: 0; transform: translateY(-80px) scale(0.8); }
}

/* ===== 连击显示 ===== */
#combo-display {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  background: rgba(255, 165, 0, 0.15);
  border: 1px solid rgba(255, 165, 0, 0.4);
  border-radius: 4px;
  animation: comboAppear 0.3s ease-out;
}

#combo-display.active {
  display: flex;
}

.combo-count {
  font-size: 14px;
  font-weight: bold;
  color: var(--warning);
}

.combo-mult {
  font-size: 12px;
  color: var(--gold);
  font-weight: bold;
}

.combo-bar {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.combo-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--danger), var(--warning));
  transition: width 0.1s linear;
}

@keyframes comboAppear {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ===== QTE 按钮 ===== */
.stove-qte-btn {
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: bold;
  padding: 3px 10px;
  border: 2px solid var(--warning);
  cursor: pointer;
  color: #fff;
  background: rgba(243, 156, 18, 0.3);
  animation: qteFlash 0.4s ease-in-out infinite;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
}

.stove-qte-btn:active {
  transform: scale(0.95);
}

@keyframes qteFlash {
  0%, 100% { background: rgba(243, 156, 18, 0.3); box-shadow: 0 0 4px rgba(243, 156, 18, 0.3); }
  50% { background: rgba(243, 156, 18, 0.6); box-shadow: 0 0 12px rgba(243, 156, 18, 0.6); }
}

.qte-timer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(0, 0, 0, 0.3);
}

.qte-timer-fill {
  height: 100%;
  background: var(--danger);
  transition: width 0.1s linear;
}

.qte-badge {
  font-size: 10px;
  font-weight: bold;
  color: var(--gold);
  background: rgba(255, 215, 0, 0.2);
  border: 1px solid var(--gold);
  padding: 1px 4px;
  white-space: nowrap;
}

/* ===== 每日事件 ===== */
#day-event-area {
  margin-top: 12px;
}

.day-event-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(233, 69, 96, 0.1);
  border: 2px solid var(--primary);
  padding: 12px 16px;
  animation: eventAppear 0.5s ease-out;
}

.day-event-icon {
  font-size: 28px;
}

.day-event-info {
  text-align: left;
}

.day-event-name {
  font-size: 16px;
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 2px;
}

.day-event-desc {
  font-size: 12px;
  color: var(--text-dim);
}

@keyframes eventAppear {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ===== 客人特殊标签 ===== */
.special-tag {
  font-size: 10px;
  text-align: center;
  color: var(--gold);
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  padding: 1px 4px;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== 成就 Toast ===== */
.toast.achievement {
  background: linear-gradient(135deg, #2c1654, #533483);
  color: var(--gold);
  border-left: 4px solid var(--gold);
  font-size: 14px;
  animation: toastIn 0.3s ease-out, achievePulse 0.5s ease-out 0.3s, toastOut 0.3s ease-in 3.5s forwards;
}

@keyframes achievePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* ===== 隐藏类 ===== */
.hidden {
  display: none !important;
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.3);
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.3);
}

/* ===== 像素化头像 (CSS 绘制) ===== */
.avatar-pixel {
  image-rendering: pixelated;
}

/* 客人进入动画 */
.customer-card.entering {
  animation: customerEnter 0.4s ease-out;
}

@keyframes customerEnter {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 客人离开动画 */
.customer-card.leaving {
  animation: customerLeave 0.4s ease-in forwards;
}

@keyframes customerLeave {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-100px); opacity: 0; }
}

/* 完成订单特效 */
.order-complete-flash {
  animation: flashGreen 0.5s ease-out;
}

@keyframes flashGreen {
  0% { box-shadow: 0 0 0 rgba(46, 204, 113, 0); }
  50% { box-shadow: 0 0 30px rgba(46, 204, 113, 0.6); }
  100% { box-shadow: 0 0 0 rgba(46, 204, 113, 0); }
}

/* ===== 上菜粒子特效 ===== */
.serve-particle {
  position: absolute;
  width: 12px;
  height: 12px;
  pointer-events: none;
  z-index: 260;
  animation: particleBurst 0.7s ease-out forwards;
}

@keyframes particleBurst {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--px), var(--py)) scale(0.3); }
}

/* ===== 连击火焰效果 ===== */
#combo-display.on-fire {
  background: rgba(255, 80, 0, 0.25);
  border-color: rgba(255, 100, 0, 0.6);
  animation: comboFire 0.4s ease-in-out infinite alternate;
}

@keyframes comboFire {
  0% { box-shadow: 0 0 6px rgba(255, 100, 0, 0.4), 0 -4px 8px rgba(255, 60, 0, 0.2); }
  100% { box-shadow: 0 0 12px rgba(255, 100, 0, 0.7), 0 -8px 16px rgba(255, 60, 0, 0.4); }
}

/* ===== 全屏连击闪光 ===== */
.screen-flash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 240;
  animation: flashFade 0.35s ease-out forwards;
}

@keyframes flashFade {
  0% { opacity: 0.35; }
  100% { opacity: 0; }
}

/* ===== QTE 命中闪光 ===== */
.stove-slot.qte-hit-flash {
  animation: qteHitGlow 0.4s ease-out;
}

@keyframes qteHitGlow {
  0% { box-shadow: 0 0 0 rgba(255, 215, 0, 0); }
  30% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.7), inset 0 0 10px rgba(255, 215, 0, 0.3); }
  100% { box-shadow: 0 0 0 rgba(255, 215, 0, 0); }
}

/* ===== 飘浮文字 ===== */
.float-text {
  position: absolute;
  font-family: var(--font-pixel);
  font-size: 16px;
  font-weight: bold;
  pointer-events: none;
  z-index: 270;
  white-space: nowrap;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
  animation: floatUp 0.9s ease-out forwards;
}

@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0) scale(1.2); }
  60% { opacity: 1; transform: translateY(-30px) scale(1); }
  100% { opacity: 0; transform: translateY(-50px) scale(0.8); }
}

/* ===== 客人离开愤怒标记 ===== */
.leave-mark {
  position: absolute;
  top: -8px;
  right: -4px;
  font-size: 18px;
  z-index: 10;
  animation: angryPop 0.3s ease-out;
}

@keyframes angryPop {
  0% { transform: scale(0); }
  60% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ===== 金币飘动增强 ===== */
.coin-float.big-coin {
  font-size: 28px;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.5), 1px 1px 0 rgba(0,0,0,0.5);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .restaurant-sign h1 {
    font-size: 32px;
    letter-spacing: 4px;
  }
  .restaurant-sign {
    padding: 20px 30px;
  }

  /* === 游戏界面整体布局 === */
  #game-screen {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
  }

  /* 隐藏手机上的区域标题节省空间 */
  #customer-area h3,
  #order-area h3,
  #prep-area h3,
  #ingredient-shelf h3 {
    display: none;
  }

  /* === Toast 移到底部、更紧凑 === */
  #toast-container {
    top: auto;
    bottom: 8px;
    right: 8px;
    left: 8px;
    align-items: flex-end;
  }
  .toast {
    padding: 5px 10px;
    font-size: 11px;
    max-width: 100%;
    animation: toastIn 0.2s ease-out, toastOut 0.2s ease-in 1.2s forwards;
  }
  .toast.money {
    font-size: 13px;
  }

  /* === 顶部信息栏 === */
  #top-bar {
    padding: 3px 8px;
    gap: 4px;
  }
  .info-item { gap: 2px; }
  .info-item .label { font-size: 9px; }
  .info-item .value { font-size: 13px; }
  .pixel-btn.small { font-size: 10px; padding: 4px 10px; }

  /* === 客人区域 === */
  #customer-area {
    padding: 4px 8px;
  }
  .customer-slots {
    min-height: 80px;
    gap: 6px;
  }
  .customer-card {
    min-width: 90px;
    padding: 5px;
  }
  .customer-avatar {
    width: 24px;
    height: 24px;
    font-size: 12px;
    margin-bottom: 2px;
  }
  .customer-name { font-size: 10px; margin-bottom: 1px; }
  .customer-order { font-size: 11px; margin-bottom: 2px; }
  .patience-bar { height: 4px; }
  .customer-tip { font-size: 9px; margin-top: 2px; }
  .customer-card.star-customer::before { font-size: 9px; }
  .special-tag { font-size: 8px; padding: 0px 3px; margin-bottom: 1px; }

  /* === 订单区 - 强制单行不换行 === */
  #order-area {
    padding: 2px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .order-display {
    padding: 3px 8px;
    min-height: 0;
    border: 1px solid var(--card-border);
  }
  .order-display .empty-hint {
    font-size: 11px;
  }
  .order-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
  }
  .order-dish-name {
    font-size: 13px;
    margin-bottom: 0;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .order-ingredients {
    display: flex;
    gap: 3px;
    flex-wrap: nowrap;
    overflow: hidden;
    flex: 1;
    min-width: 0;
  }
  .order-ingredient {
    padding: 1px 4px;
    font-size: 10px;
    white-space: nowrap;
    flex-shrink: 0;
    border-width: 1px;
  }
  .order-price {
    font-size: 11px;
    margin-top: 0;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* === 准备区 + 烹饪按钮合为一行 === */
  #prep-area {
    padding: 2px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .prep-slots {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    min-height: 0;
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
  }
  .prep-item {
    padding: 2px 6px;
    font-size: 10px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  #prep-actions {
    gap: 4px;
    flex-shrink: 0;
  }
  .pixel-btn.cook-btn {
    font-size: 12px;
    padding: 5px 14px;
    box-shadow:
      inset -2px -2px 0 rgba(0,0,0,0.3),
      inset 2px 2px 0 rgba(255,255,255,0.15),
      0 2px 0 #1e8c4d;
  }

  /* === 灶台栏 === */
  #stove-bar {
    padding: 3px 8px;
    min-height: 30px;
  }
  .stove-slots { gap: 4px; }
  .stove-slot {
    padding: 3px 6px;
    gap: 4px;
    min-height: 26px;
  }
  .stove-dish { font-size: 10px; }
  .stove-for { font-size: 9px; }
  .stove-progress { height: 5px; min-width: 30px; }
  .serve-btn { font-size: 14px; padding: 8px 16px; min-height: 38px; }
  .stove-icon { font-size: 13px; }
  .stove-label { font-size: 9px; }
  .stove-slot { min-height: 38px; }
  .stove-qte-btn { font-size: 13px; padding: 6px 14px; min-height: 36px; }
  .qte-badge { font-size: 9px; padding: 0px 3px; }

  /* === 食材架 - 大图标充实内容 === */
  #ingredient-shelf {
    padding: 6px 8px;
    border-top-width: 2px;
    min-height: 0;
    flex: 1;
    overflow-y: auto;
  }
  .ingredient-grid {
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 5px;
  }
  .ingredient-btn {
    padding: 10px 4px;
    font-size: 13px;
    gap: 3px;
  }
  .ingredient-btn .emoji {
    font-size: 28px;
  }

  /* === 连击显示 === */
  #combo-display.active {
    padding: 1px 5px;
    gap: 3px;
  }
  .combo-count { font-size: 10px; }
  .combo-mult { font-size: 9px; }
  .combo-bar { width: 24px; height: 3px; }

  /* === 每日事件 === */
  .day-event-card { padding: 8px 12px; gap: 8px; }
  .day-event-icon { font-size: 22px; }
  .day-event-name { font-size: 14px; }
  .day-event-desc { font-size: 11px; }

  /* === 商店 === */
  .shop-grid {
    grid-template-columns: 1fr;
  }
}
