/* =========================================================
   深夜大排档：爆单 5 分钟 — 9:16 WeChat Mini Game Styles
   Warm Neon Night-Market Charcoal BBQ Aesthetic
   ========================================================= */

:root {
  --bg-outer: #0d080c;
  --shell-bg: #1a0f12;
  --panel-bg: #271519;
  --panel-border: rgba(255, 160, 82, 0.22);
  --neon-red: #ff3b30;
  --neon-orange: #ff7a18;
  --neon-gold: #ffd147;
  --neon-green: #22c55e;
  --neon-cyan: #38bdf8;
  --text-main: #fff5ea;
  --text-sub: #d7b7a5;
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-outer);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  touch-action: manipulation;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ambient-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 25% 18%, rgba(255, 72, 36, 0.22), transparent 45%),
    radial-gradient(circle at 78% 82%, rgba(255, 184, 48, 0.16), transparent 48%),
    linear-gradient(160deg, #12090d 0%, #090507 100%);
  pointer-events: none;
}

/* 9:16 WeChat Portrait Shell */
.wechat-shell {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: min(100dvh, 860px);
  background: linear-gradient(180deg, #241116 0%, #190c10 52%, #13090c 100%);
  border-radius: 26px;
  border: 1px solid rgba(255, 180, 96, 0.25);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.75),
    0 0 40px rgba(255, 92, 38, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
}

@media (max-width: 440px) {
  .wechat-shell {
    max-width: 100%;
    height: 100dvh;
    border-radius: 0;
    border: none;
  }
}

.wechat-shell.shake {
  animation: shellShake 0.34s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes shellShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Simulated WeChat Mini Game Top Bar */
.wx-topbar {
  height: 44px;
  flex-shrink: 0;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(45, 18, 22, 0.96), rgba(29, 13, 17, 0.94));
  border-bottom: 1px solid rgba(255, 168, 88, 0.16);
  z-index: 20;
}

.wx-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 210, 160, 0.22);
  color: #ffe8d2;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.12s ease, background 0.15s ease;
}

.wx-back-btn:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.18);
}

.wx-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #ffdf9a;
  text-shadow: 0 0 12px rgba(255, 118, 38, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wx-capsule {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 220, 180, 0.22);
}

.wx-icon-btn {
  background: transparent;
  border: none;
  color: #fff3e2;
  font-size: 14px;
  width: 28px;
  height: 24px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 999px;
}

.wx-icon-btn:active {
  background: rgba(255, 255, 255, 0.15);
}

.wx-capsule-divider {
  width: 1px;
  height: 14px;
  background: rgba(255, 220, 180, 0.22);
}

/* Main Game Stage */
.game-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 6px 8px 8px;
  gap: 6px;
  overflow: hidden;
}

/* Fever Mode Glow Frame */
.fever-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 14;
  border: 3px solid transparent;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.game-stage.fever .fever-frame {
  opacity: 1;
  border-color: rgba(255, 200, 48, 0.9);
  box-shadow:
    inset 0 0 24px rgba(255, 62, 36, 0.65),
    inset 0 0 48px rgba(255, 196, 42, 0.4);
  animation: feverPulse 0.9s ease-in-out infinite alternate;
}

@keyframes feverPulse {
  from {
    box-shadow:
      inset 0 0 18px rgba(255, 58, 38, 0.55),
      inset 0 0 36px rgba(255, 200, 46, 0.28);
  }
  to {
    box-shadow:
      inset 0 0 30px rgba(255, 90, 32, 0.85),
      inset 0 0 58px rgba(255, 214, 72, 0.58);
  }
}

/* Top HUD Bar */
.hud-bar {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 0.95fr 1.15fr 0.78fr auto;
  gap: 5px;
  align-items: center;
}

.hud-pill {
  background: linear-gradient(180deg, rgba(58, 26, 30, 0.92), rgba(37, 16, 20, 0.95));
  border: 1px solid rgba(255, 164, 88, 0.24);
  border-radius: 10px;
  padding: 4px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
}

.hud-label {
  font-size: 9px;
  color: var(--text-sub);
  letter-spacing: 0.4px;
}

.hud-val {
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff6e9;
}

.hud-revenue .hud-val {
  color: var(--neon-gold);
  text-shadow: 0 0 10px rgba(255, 209, 71, 0.45);
}

.hud-combo .hud-val {
  color: #ff9a3d;
}

.hud-combo.hot {
  border-color: rgba(255, 184, 48, 0.75);
  box-shadow: 0 0 12px rgba(255, 136, 36, 0.35);
}

.hud-combo.hot .hud-val {
  color: #ffe266;
}

.hud-timer.urgent {
  border-color: rgba(255, 68, 56, 0.8);
  background: linear-gradient(180deg, rgba(112, 22, 22, 0.95), rgba(66, 12, 16, 0.95));
  animation: pulseFast 0.75s ease-in-out infinite alternate;
}

@keyframes pulseFast {
  from { transform: scale(1); }
  to { transform: scale(1.03); }
}

.hud-hearts {
  background: rgba(42, 16, 22, 0.9);
  border: 1px solid rgba(255, 98, 108, 0.28);
  border-radius: 10px;
  padding: 6px 6px;
  font-size: 11px;
  letter-spacing: -1px;
  line-height: 1;
  white-space: nowrap;
}

/* Phase Strip */
.phase-strip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 120, 42, 0.13);
  border: 1px solid rgba(255, 152, 68, 0.24);
  font-size: 11px;
  font-weight: 700;
  color: #ffddb0;
}

.game-stage.fever .phase-strip {
  background: linear-gradient(90deg, rgba(255, 48, 36, 0.4), rgba(255, 174, 32, 0.35));
  border-color: rgba(255, 212, 72, 0.8);
  color: #fff6c2;
}

.phase-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff9c38;
  box-shadow: 0 0 8px #ff9c38;
  flex-shrink: 0;
}

.game-stage.fever .phase-dot {
  background: #ff3b30;
  box-shadow: 0 0 10px #ffd147;
  animation: blinkDot 0.45s infinite alternate;
}

@keyframes blinkDot {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

.phase-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phase-best {
  font-size: 10px;
  color: #ffd78a;
  opacity: 0.9;
  font-variant-numeric: tabular-nums;
}

/* Customer Counter Zone */
.customer-zone {
  position: relative;
  flex-shrink: 0;
  background: linear-gradient(180deg, #32181f 0%, #231116 100%);
  border: 1px solid rgba(255, 148, 72, 0.25);
  border-radius: 14px;
  padding: 14px 6px 8px;
  overflow: hidden;
}

.awning-stripes {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 9px;
  background: repeating-linear-gradient(
    90deg,
    #d92d20 0 18px,
    #fff0d6 18px 36px
  );
  opacity: 0.88;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.lantern {
  position: absolute;
  top: 7px;
  font-size: 13px;
  filter: drop-shadow(0 0 6px rgba(255, 84, 38, 0.85));
  pointer-events: none;
  animation: lanternSway 2.8s ease-in-out infinite alternate;
}

.lantern-l { left: 6px; }
.lantern-r { right: 6px; animation-delay: 0.8s; }

@keyframes lanternSway {
  from { transform: rotate(-6deg); }
  to { transform: rotate(6deg); }
}

.customer-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  min-height: 138px;
}

.customer-card {
  position: relative;
  background: linear-gradient(180deg, rgba(56, 28, 34, 0.92), rgba(34, 16, 21, 0.96));
  border: 1px solid rgba(255, 178, 112, 0.22);
  border-radius: 12px;
  padding: 6px 5px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 138px;
  transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.customer-card.empty {
  border-style: dashed;
  border-color: rgba(255, 178, 112, 0.16);
  background: rgba(26, 12, 16, 0.45);
  justify-content: center;
  color: rgba(255, 212, 172, 0.35);
  font-size: 11px;
  gap: 4px;
}

.customer-card.vip-influencer {
  border-color: rgba(255, 102, 196, 0.7);
  box-shadow: 0 0 14px rgba(255, 76, 178, 0.26);
}

.customer-card.vip-foodie {
  border-color: rgba(255, 200, 62, 0.72);
  box-shadow: 0 0 14px rgba(255, 184, 48, 0.26);
}

.customer-card.urgent {
  border-color: rgba(255, 59, 48, 0.9);
  animation: cardPanic 0.45s ease-in-out infinite alternate;
}

@keyframes cardPanic {
  from { box-shadow: 0 0 6px rgba(255, 59, 48, 0.35); }
  to { box-shadow: 0 0 16px rgba(255, 59, 48, 0.85); }
}

.customer-card.arriving {
  animation: popIn 0.28s cubic-bezier(0.22, 1.3, 0.36, 1);
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(10px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cust-badge {
  position: absolute;
  top: -1px;
  right: 4px;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, #ff3b7f, #ff8f32);
  color: #fff;
  letter-spacing: 0.2px;
}

.cust-badge.foodie {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.cust-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  width: 100%;
}

.cust-avatar {
  font-size: 26px;
  line-height: 1.05;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.4));
}

.cust-name {
  font-size: 11px;
  font-weight: 800;
  color: #ffe8cf;
  white-space: nowrap;
}

.cust-quote {
  font-size: 9px;
  color: #cfa792;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Customer Order Bubbles */
.cust-orders {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
  margin: 4px 0;
  min-height: 36px;
}

.order-chip {
  position: relative;
  width: 31px;
  height: 31px;
  border-radius: 9px;
  background: rgba(255, 245, 232, 0.11);
  border: 1.5px solid rgba(255, 206, 148, 0.34);
  display: grid;
  place-items: center;
  font-size: 18px;
  transition: transform 0.16s ease, background 0.16s ease;
}

.order-chip.matched {
  border-color: #ffd147;
  background: rgba(255, 209, 71, 0.22);
  box-shadow: 0 0 8px rgba(255, 209, 71, 0.45);
}

.order-chip.done {
  background: rgba(34, 197, 94, 0.24);
  border-color: rgba(74, 222, 128, 0.8);
  opacity: 0.72;
  transform: scale(0.9);
}

.order-chip.done::after {
  content: "✓";
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #22c55e;
  color: #052e16;
  font-size: 9px;
  font-weight: 900;
  display: grid;
  place-items: center;
}

/* Patience Bar */
.patience-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.patience-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  transition: width 0.08s linear;
}

.patience-fill.warn {
  background: linear-gradient(90deg, #f59e0b, #facc15);
}

.patience-fill.danger {
  background: linear-gradient(90deg, #dc2626, #ff4d4d);
  animation: dangerFlash 0.32s linear infinite alternate;
}

@keyframes dangerFlash {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

/* Middle Charcoal Grill Zone */
.grill-zone {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.grill-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.grill-title {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.grill-title span {
  font-size: 13px;
  font-weight: 800;
  color: #ffcf8c;
}

.grill-title small {
  font-size: 10px;
  color: var(--text-sub);
}

/* Secret Cumin / Chili Seasoning Button */
.spice-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 118, 56, 0.65);
  background: linear-gradient(135deg, #b91c1c 0%, #ea580c 100%);
  color: #fff8eb;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.35);
  transition: transform 0.12s ease, filter 0.15s ease;
}

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

.spice-btn.ready-highlight {
  border-color: #ffe266;
  box-shadow: 0 0 16px rgba(255, 196, 48, 0.72);
  animation: spiceGlow 0.75s ease-in-out infinite alternate;
}

@keyframes spiceGlow {
  from { transform: scale(1); }
  to { transform: scale(1.04); }
}

.spice-btn.on-cd {
  filter: grayscale(0.35) brightness(0.75);
}

.spice-icon {
  font-size: 18px;
  line-height: 1;
}

.spice-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.spice-copy strong {
  font-size: 12px;
  font-weight: 800;
}

.spice-copy small {
  font-size: 9px;
  color: #ffe39e;
}

.spice-cd {
  position: absolute;
  inset: 0;
  background: rgba(18, 8, 8, 0.6);
  transform-origin: left center;
  transform: scaleX(0);
  pointer-events: none;
}

/* Charcoal Pit & 6-Slot Grill Grid */
.charcoal-pit {
  position: relative;
  flex: 1;
  min-height: 158px;
  border-radius: 16px;
  padding: 9px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.03) 0 2px,
      transparent 2px 16px
    ),
    radial-gradient(ellipse at 50% 60%, rgba(255, 86, 24, 0.42), rgba(40, 12, 10, 0.96) 72%),
    #1c0909;
  border: 2px solid #59261b;
  box-shadow:
    inset 0 0 28px rgba(255, 68, 16, 0.42),
    inset 0 -8px 18px rgba(0, 0, 0, 0.65),
    0 6px 18px rgba(0, 0, 0, 0.45);
  display: flex;
  overflow: hidden;
}

.ember-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 78%, rgba(255, 118, 28, 0.35), transparent 34%),
    radial-gradient(circle at 75% 30%, rgba(255, 72, 24, 0.32), transparent 36%),
    radial-gradient(circle at 50% 50%, rgba(255, 168, 42, 0.16), transparent 48%);
  animation: emberBreathe 2.4s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes emberBreathe {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

.grill-grid {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 8px;
}

.grill-slot {
  position: relative;
  border-radius: 13px;
  border: 1.5px dashed rgba(255, 166, 98, 0.25);
  background: rgba(24, 10, 10, 0.66);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  overflow: hidden;
  padding: 4px;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.grill-slot:active {
  transform: scale(0.95);
}

.grill-slot.empty::before {
  content: "+ 空炉位";
  font-size: 11px;
  color: rgba(255, 186, 134, 0.34);
  font-weight: 600;
}

.grill-slot.cooking {
  border-style: solid;
  border-color: rgba(255, 140, 42, 0.72);
  background: radial-gradient(circle at 50% 62%, rgba(255, 112, 28, 0.28), rgba(34, 14, 12, 0.88));
}

.grill-slot.perfect {
  border-style: solid;
  border-color: #ffd147;
  background: radial-gradient(circle at 50% 50%, rgba(255, 206, 62, 0.34), rgba(56, 26, 12, 0.9));
  box-shadow: 0 0 18px rgba(255, 209, 71, 0.58), inset 0 0 14px rgba(255, 218, 92, 0.32);
}

.grill-slot.warning {
  border-style: solid;
  border-color: #ff453a;
  background: radial-gradient(circle at 50% 50%, rgba(255, 59, 48, 0.42), rgba(58, 12, 12, 0.94));
  box-shadow: 0 0 18px rgba(255, 59, 48, 0.75);
  animation: warnJitter 0.22s ease-in-out infinite alternate;
}

@keyframes warnJitter {
  from { transform: translateY(0) rotate(-1deg); }
  to { transform: translateY(-1.5px) rotate(1deg); }
}

.grill-slot.burnt {
  border-style: solid;
  border-color: #52525b;
  background: radial-gradient(circle at 50% 50%, rgba(45, 42, 46, 0.92), rgba(16, 14, 16, 0.96));
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.8);
}

.slot-emoji {
  font-size: 30px;
  line-height: 1;
  z-index: 2;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.45));
  transition: transform 0.15s ease, filter 0.2s ease;
}

.grill-slot.perfect .slot-emoji {
  animation: sizzleBounce 0.65s ease-in-out infinite alternate;
}

@keyframes sizzleBounce {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-3px) scale(1.08); }
}

.grill-slot.burnt .slot-emoji {
  filter: grayscale(1) brightness(0.32) contrast(1.4);
}

.slot-status {
  font-size: 10px;
  font-weight: 800;
  z-index: 2;
  line-height: 1.1;
  white-space: nowrap;
}

.grill-slot.cooking .slot-status { color: #ffb56b; }
.grill-slot.perfect .slot-status { color: #ffe77a; text-shadow: 0 0 6px rgba(255, 204, 0, 0.75); }
.grill-slot.warning .slot-status { color: #ff8e88; }
.grill-slot.burnt .slot-status { color: #a1a1aa; }

.slot-progress-bar {
  width: 86%;
  height: 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  overflow: hidden;
  z-index: 2;
  margin-top: 2px;
}

.slot-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.06s linear;
}

.grill-slot.cooking .slot-progress-fill { background: linear-gradient(90deg, #f97316, #fbbf24); }
.grill-slot.perfect .slot-progress-fill { background: linear-gradient(90deg, #fde047, #f59e0b); }
.grill-slot.warning .slot-progress-fill { background: linear-gradient(90deg, #ef4444, #ff2d55); }
.grill-slot.burnt .slot-progress-fill { background: #52525b; width: 100% !important; }

.slot-spice-tag {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 11px;
  padding: 1px 4px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.9);
  border: 1px solid #ffd147;
  color: #fff;
  font-weight: 800;
  z-index: 3;
  box-shadow: 0 0 8px rgba(255, 100, 38, 0.75);
}

.slot-demand-dot {
  position: absolute;
  top: 5px;
  left: 5px;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 6px;
  background: rgba(34, 197, 94, 0.88);
  color: #052e16;
  z-index: 3;
}

/* Bottom Controls: Ingredients + Upgrades */
.controls-zone {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ingredient-tray {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.ing-btn {
  position: relative;
  overflow: hidden;
  border: 1.5px solid rgba(255, 176, 106, 0.32);
  border-radius: 12px;
  background: linear-gradient(180deg, #3c1c20 0%, #261014 100%);
  color: #fff4e8;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.1s ease, border-color 0.15s ease;
}

.ing-btn:active {
  transform: scale(0.94);
  border-color: #ffd147;
}

.ing-btn.ing-beer {
  border-color: rgba(56, 189, 248, 0.5);
  background: linear-gradient(180deg, #16334a 0%, #0d1f30 100%);
}

.ing-btn.ing-beer.needed {
  border-color: #7dd3fc;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.55);
}

.ing-emoji {
  font-size: 23px;
  line-height: 1.05;
  z-index: 2;
}

.ing-name {
  font-size: 11px;
  font-weight: 800;
  z-index: 2;
}

.ing-meta {
  font-size: 9px;
  color: #e6bfa6;
  z-index: 2;
}

.ing-meta em {
  font-style: normal;
  color: #ffd147;
  font-weight: 700;
}

.beer-cd-fill {
  position: absolute;
  inset: 0;
  background: rgba(5, 18, 30, 0.68);
  transform-origin: bottom center;
  transform: scaleY(0);
  pointer-events: none;
  z-index: 3;
}

/* Upgrade Bar */
.upgrade-bar {
  background: rgba(31, 14, 19, 0.92);
  border: 1px solid rgba(255, 166, 88, 0.22);
  border-radius: 12px;
  padding: 6px 7px 7px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.upgrade-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  color: #dfbaa5;
}

.wallet-badge {
  color: #ffd98a;
  background: rgba(255, 196, 62, 0.14);
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 200, 62, 0.3);
}

.wallet-badge strong {
  color: #ffe378;
  font-variant-numeric: tabular-nums;
}

.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.upg-btn {
  border: 1px solid rgba(255, 168, 92, 0.24);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(64, 30, 32, 0.9), rgba(40, 17, 20, 0.95));
  color: #fff2e4;
  padding: 5px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.1s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.upg-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.upg-btn.affordable {
  border-color: rgba(255, 209, 71, 0.85);
  box-shadow: 0 0 10px rgba(255, 184, 48, 0.32);
  background: linear-gradient(180deg, rgba(98, 48, 22, 0.95), rgba(56, 24, 16, 0.96));
}

.upg-btn.maxed,
.upg-btn:disabled {
  opacity: 0.52;
  cursor: default;
}

.upg-top, .upg-bot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
}

.upg-name {
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.upg-lv {
  font-size: 9px;
  font-weight: 800;
  color: #7dd3fc;
}

.upg-desc {
  font-size: 9px;
  color: #cfa993;
}

.upg-cost {
  font-size: 10px;
  font-weight: 800;
  color: #ffd147;
  font-variant-numeric: tabular-nums;
}

/* Floating VFX Layer */
.fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 22;
  overflow: hidden;
}

.float-popup {
  position: absolute;
  font-weight: 900;
  font-size: 14px;
  white-space: nowrap;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: floatRise 0.95s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.float-popup.gold { color: #ffe36e; font-size: 16px; }
.float-popup.spice { color: #ff8040; font-size: 13px; }
.float-popup.bad { color: #ff6b6b; font-size: 13px; }
.float-popup.info { color: #93c5fd; font-size: 12px; }

@keyframes floatRise {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.75); }
  18% { opacity: 1; transform: translate(-50%, -14px) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -56px) scale(0.95); }
}

.fly-item {
  position: absolute;
  font-size: 26px;
  pointer-events: none;
  z-index: 25;
  transform: translate(-50%, -50%);
  transition: transform 0.34s cubic-bezier(0.2, 0.85, 0.3, 1), opacity 0.34s ease;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.55));
}

.smoke-puff {
  position: absolute;
  font-size: 24px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: smokeUp 0.7s ease-out forwards;
}

@keyframes smokeUp {
  0% { opacity: 0.95; transform: translate(-50%, -50%) scale(0.7); }
  100% { opacity: 0; transform: translate(-50%, -120%) scale(1.65); }
}

/* Phase Transition Banner */
.phase-banner {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  width: 90%;
  padding: 12px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.96), rgba(234, 88, 12, 0.96));
  border: 2px solid #ffe066;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65), 0 0 28px rgba(255, 168, 36, 0.55);
  color: #fffbe8;
  text-align: center;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.5px;
  z-index: 28;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.22, 1.3, 0.36, 1);
}

.phase-banner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.phase-banner small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  color: #ffefc2;
}

/* Overlays: Start & End Screens */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(14, 6, 9, 0.84);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.start-card,
.receipt-card {
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  border-radius: 20px;
  padding: 16px 15px;
  background: linear-gradient(180deg, #2e141a 0%, #1c0c10 100%);
  border: 1.5px solid rgba(255, 174, 92, 0.38);
  box-shadow:
    0 20px 44px rgba(0, 0, 0, 0.72),
    0 0 32px rgba(255, 92, 38, 0.24);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.neon-sign {
  text-align: center;
  padding: 12px 10px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 94, 38, 0.36), transparent 70%),
    rgba(22, 8, 12, 0.78);
  border: 1.5px solid rgba(255, 108, 56, 0.55);
  box-shadow: inset 0 0 22px rgba(255, 76, 36, 0.25);
}

.sign-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 196, 48, 0.18);
  border: 1px solid rgba(255, 209, 71, 0.45);
  color: #ffe285;
  margin-bottom: 5px;
}

.neon-sign h2 {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff6e0;
  text-shadow:
    0 0 10px rgba(255, 90, 32, 0.9),
    0 0 24px rgba(255, 59, 48, 0.65);
}

.sign-sub {
  margin-top: 2px;
  font-size: 16px;
  font-weight: 800;
  color: #ffd147;
  letter-spacing: 3px;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-btn {
  border-radius: 13px;
  border: 1.5px solid rgba(255, 174, 104, 0.25);
  background: rgba(48, 22, 27, 0.8);
  color: #f4d8c4;
  padding: 9px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.mode-btn strong {
  font-size: 12px;
  font-weight: 800;
}

.mode-btn span {
  font-size: 10px;
  color: #cda691;
}

.mode-btn.active {
  border-color: #ffd147;
  background: linear-gradient(180deg, rgba(168, 42, 28, 0.72), rgba(92, 24, 20, 0.88));
  color: #fff9ec;
  box-shadow: 0 0 16px rgba(255, 146, 48, 0.35);
}

.mode-btn.active span {
  color: #ffe39e;
}

.how-to-box {
  background: rgba(20, 9, 13, 0.65);
  border: 1px solid rgba(255, 168, 96, 0.2);
  border-radius: 14px;
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.35;
  color: #f3dac8;
}

.step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff7a18, #ff3b30);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.step-icon {
  font-size: 15px;
  flex-shrink: 0;
}

.step-row strong {
  color: #ffe185;
}

.best-strip {
  text-align: center;
  font-size: 12px;
  color: #e6c6b0;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 209, 71, 0.09);
  border: 1px dashed rgba(255, 209, 71, 0.32);
}

.best-strip strong {
  color: #ffd147;
  font-size: 14px;
}

.primary-cta {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #fffcf5;
  background: linear-gradient(135deg, #ff512f 0%, #f09819 100%);
  box-shadow:
    0 8px 20px rgba(255, 81, 47, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease;
}

.primary-cta:active {
  transform: scale(0.97);
}

/* End Screen Receipt Styling */
.receipt-card {
  gap: 11px;
}

.receipt-top {
  text-align: center;
  border-bottom: 1.5px dashed rgba(255, 190, 120, 0.28);
  padding-bottom: 10px;
}

.receipt-stamp {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(74, 222, 128, 0.55);
  color: #86efac;
  margin-bottom: 4px;
}

.receipt-stamp.early {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(248, 113, 113, 0.6);
  color: #fca5a5;
}

.receipt-top h3 {
  font-size: 18px;
  font-weight: 900;
  color: #ffdf9a;
}

.receipt-mode {
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 2px;
}

.rank-showcase {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 174, 62, 0.1);
  border: 1px solid rgba(255, 200, 72, 0.3);
}

.rank-medal {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 900;
  flex-shrink: 0;
  background: linear-gradient(135deg, #ffd147, #ff6b18);
  color: #361006;
  box-shadow: 0 0 18px rgba(255, 196, 48, 0.55);
}

.rank-medal.rank-A { background: linear-gradient(135deg, #ff7a18, #ef4444); color: #fff; }
.rank-medal.rank-B { background: linear-gradient(135deg, #38bdf8, #2563eb); color: #fff; }
.rank-medal.rank-C { background: linear-gradient(135deg, #71717a, #3f3f46); color: #e4e4e7; box-shadow: none; }

.rank-title {
  font-size: 17px;
  font-weight: 900;
  color: #fff6e0;
}

.rank-comment {
  font-size: 11px;
  color: #dfb8a2;
  margin-top: 2px;
  line-height: 1.35;
}

.revenue-hero {
  text-align: center;
  padding: 10px;
  border-radius: 14px;
  background: rgba(18, 7, 11, 0.72);
  border: 1px solid rgba(255, 209, 71, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.revenue-hero span {
  font-size: 11px;
  color: var(--text-sub);
}

.revenue-hero strong {
  font-size: 32px;
  font-weight: 900;
  color: #ffd147;
  text-shadow: 0 0 16px rgba(255, 209, 71, 0.45);
  font-variant-numeric: tabular-nums;
}

.new-record-pill {
  display: none;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ef4444, #f59e0b);
  color: #fff;
}

.new-record-pill.show {
  display: inline-block;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-cell {
  background: rgba(45, 20, 25, 0.8);
  border: 1px solid rgba(255, 174, 108, 0.18);
  border-radius: 11px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-cell span {
  font-size: 10px;
  color: var(--text-sub);
}

.stat-cell strong {
  font-size: 16px;
  font-weight: 800;
  color: #fff5ea;
  font-variant-numeric: tabular-nums;
}

.end-actions {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 8px;
}

.secondary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 12px 10px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  color: #ffe8d2;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 206, 154, 0.28);
}

.secondary-cta:active {
  transform: scale(0.97);
}
