:root {
  --bg: #0f0d15;
  --panel: rgba(15, 12, 22, 0.92);
  --panel-border: #fbbf24;
  --accent: #f43f5e;
  --accent-dark: #9f1239;
  --lime: #4ade80;
  --cyan: #22d3ee;
  --ink: #0a0910;
  --tile-a: #c9d2d0;
  --tile-b: #e8eceb;
  --wood: #83512f;
  --belt: #0a0a0a;
  --belt-line: #3a3a3a;
  --cashier: #2dd4bf;
  --office: #4b5563;
  --queue-mark: rgba(0, 0, 0, 0.12);
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  --ready: #22c55e;
  --busy: #f43f5e;
  --standby: #f59e0b;
  --busy-soft: rgba(244, 63, 94, 0.15);
  --standby-soft: rgba(245, 158, 11, 0.18);
  --ready-soft: rgba(34, 197, 94, 0.15);
  --glass: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glow-gold: rgba(251, 191, 36, 0.3);
}

* { box-sizing: border-box; }

button {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #f0e6d6;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(99, 55, 180, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, #1a1425 0%, #0f0d15 60%, #080710 100%);
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.game {
  min-height: 100vh;
  min-height: 100svh;
  height: 100svh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.hud, .footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.04);
  padding: 10px 16px;
  border-radius: 10px;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 11px;
  line-height: 1.6;
  backdrop-filter: blur(16px);
}

.hud {
  position: relative;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  background: linear-gradient(180deg, rgba(32, 22, 56, 0.96) 0%, rgba(18, 12, 34, 0.96) 70%, rgba(10, 8, 22, 0.98) 100%);
  border: 2px solid #31224f;
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgba(251, 191, 36, 0.55),
    0 10px 24px rgba(0, 0, 0, 0.45),
    inset 0 2px 0 rgba(255,255,255,0.08),
    inset 0 -2px 0 rgba(0,0,0,0.3);
  overflow: hidden;
}

/* Animated gold top edge stripe */
.hud::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: repeating-linear-gradient(90deg,
    #fbbf24 0 6px,
    #d97706 6px 12px,
    #7c2d12 12px 18px,
    #d97706 18px 24px);
  opacity: 0.9;
}

.hud-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
}

/* Dedicated row below the main stats. Hosts the daily-goal chips on the
   left and the pop-up badges (combo / event) on the right. The reserved
   min-height keeps the main stats row from shifting when badges toggle,
   and the space-between layout gives the badges a natural partner on
   the row so they never look orphaned in the corner. */
.hud-row-alerts {
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  flex-wrap: wrap;
}

.hud-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  position: relative;
}

.hud .stat {
  padding: 6px 10px;
  border: 1px solid #2f2550;
  background:
    linear-gradient(180deg,
      rgba(255,255,255,0.08) 0%,
      rgba(255,255,255,0.02) 45%,
      rgba(0,0,0,0.2) 100%),
    rgba(8, 4, 20, 0.8);
  border-radius: 6px;
  white-space: nowrap;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.1),
    inset 0 -2px 0 rgba(0,0,0,0.35),
    0 2px 0 rgba(0,0,0,0.25);
  color: #e2e8f0;
  transition: all 0.2s ease;
  text-shadow: none;
}

.hud .stat:hover {
  background:
    linear-gradient(180deg,
      rgba(255,255,255,0.14) 0%,
      rgba(255,255,255,0.05) 45%,
      rgba(0,0,0,0.2) 100%),
    rgba(24, 14, 38, 0.85);
  transform: translateY(-1px);
}

.hud .stat b {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 15px;
  letter-spacing: 0.2px;
}

.progress-cluster {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 220px;
}

.progress-line {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #fde68a;
  padding: 3px 8px;
  border-left: 3px solid #fbbf24;
  background: rgba(0,0,0,0.35);
  border-radius: 0 4px 4px 0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 -1px 0 rgba(0,0,0,0.3);
  text-shadow: none;
}

.progress-line b {
  color: #fde047;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 14px;
}

.progress-line small {
  color: #fff7d6;
  font-size: 10px;
}

/* Flat inline-stat variant for progression info (STORE LV, STARS) —
   keeps the gold accent from the old progress-cluster but flows inline
   with the other stats so the top row reads as a single balanced line. */
.hud .stat.progress-stat {
  border-left: 3px solid #fbbf24;
  color: #fde68a;
}
.hud .stat.progress-stat b {
  color: #fde047;
}
.hud .stat small {
  color: #fff7d6;
  font-size: 9px;
  margin-left: 4px;
  opacity: 0.9;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 600;
}

/* Goals section (left of the alerts row). */
.hud-goals-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.hud-goals-label {
  white-space: nowrap;
  color: #fde68a;
  font-size: 8px;
  padding: 4px 8px;
  border-left: 3px solid #fbbf24;
  background: rgba(0,0,0,0.35);
  border-radius: 0 4px 4px 0;
}

.hud-goals-label small {
  color: #fff7d6;
  font-size: 8px;
}

/* Alerts section (right of the alerts row) — holds combo + event badges
   side by side so they never overlap or squish between other stats. */
.hud-alerts-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.hud-goals {
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.hud-goal {
  font-size: 7px;
  line-height: 1;
  padding: 3px 5px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  transition: all 0.3s ease;
}

.hud-goal.done {
  border-color: rgba(74, 222, 128, 0.4);
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.08);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.1);
}

.hud-goal.fail {
  border-color: rgba(244, 63, 94, 0.5);
  color: #fecaca;
  background: rgba(244, 63, 94, 0.08);
}

/* Combo multiplier stat — lives in the dedicated alerts row so it never
   pushes the other HUD stats (SCORE/HOURS/HAPPY SHOPPERS/WALKOUTS). */
.hud .stat.combo-stat {
  --combo-color: #fde047;
  border-color: var(--combo-color);
  color: var(--combo-color);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(0,0,0,0.25)),
    rgba(16, 8, 32, 0.9);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.12),
    inset 0 -2px 0 rgba(0,0,0,0.4),
    0 0 14px color-mix(in srgb, var(--combo-color) 60%, transparent);
  animation: comboPulse 0.9s ease-in-out infinite;
}
.hud .stat.combo-stat b {
  color: var(--combo-color);
  text-shadow: 0 0 10px color-mix(in srgb, var(--combo-color) 80%, transparent), 1px 1px 0 rgba(0,0,0,0.8);
}
.hud .stat.combo-stat .combo-count {
  color: #fff7d6;
  font-size: 8px;
  margin-left: 4px;
  opacity: 0.85;
}
.hud .stat.combo-stat.combo-mega {
  animation: comboMegaPulse 0.45s ease-in-out infinite;
}
@keyframes comboPulse {
  0%, 100% { transform: translateY(0); filter: brightness(1); }
  50% { transform: translateY(-1px); filter: brightness(1.18); }
}
@keyframes comboMegaPulse {
  0%, 100% { transform: translateY(0) scale(1); filter: brightness(1.05); }
  50% { transform: translateY(-2px) scale(1.05); filter: brightness(1.4); }
}

/* Event banner stat (Option 2) */
.hud .stat.event-stat {
  --event-color: #f59e0b;
  border-color: var(--event-color);
  color: var(--event-color);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.1), rgba(0,0,0,0.3)),
    rgba(24, 12, 4, 0.9);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.1),
    inset 0 -2px 0 rgba(0,0,0,0.35),
    0 0 16px color-mix(in srgb, var(--event-color) 55%, transparent);
  animation: eventPulse 1.2s ease-in-out infinite;
}
.hud .stat.event-stat b {
  color: var(--event-color);
  text-shadow: 0 0 10px color-mix(in srgb, var(--event-color) 80%, transparent), 1px 1px 0 rgba(0,0,0,0.8);
}
.hud .stat.event-stat .event-countdown {
  color: #fff;
  font-size: 9px;
  margin-left: 4px;
  opacity: 0.9;
}
@keyframes eventPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}

/* Checkout pop multiplier decoration (Option 1) */
.checkout-pop.with-mult {
  font-size: 11px;
  filter: drop-shadow(0 0 6px currentColor);
}

/* VIP customer gold halo (Option 2) */
.customer.vip::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #f0abfc;
  box-shadow: 0 0 14px rgba(240, 171, 252, 0.8);
  pointer-events: none;
  animation: vipHalo 1.2s ease-in-out infinite;
}
@keyframes vipHalo {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

/* Locked cashier card (Option 3) — semi-transparent with lock overlay */
.staff-card.locked-unavailable {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.7);
  position: relative;
}
.staff-card.locked-unavailable::before {
  content: attr(data-lock-text);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #fde047;
  text-shadow: 0 0 6px rgba(253, 224, 71, 0.8), 1px 1px 0 rgba(0,0,0,0.8);
  background: rgba(0, 0, 0, 0.55);
  border-radius: 10px;
  z-index: 2;
  pointer-events: none;
  white-space: pre-line;
  text-align: center;
}
.staff-card .trait-badge {
  display: block;
  font-size: 6.5px;
  color: #a5f3fc;
  margin-top: 2px;
  opacity: 0.85;
  font-family: 'Press Start 2P', monospace;
  letter-spacing: 0.3px;
}
.summary-unlock {
  grid-column: 1 / -1;
  padding: 10px 14px;
  border: 2px solid #facc15;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.2), rgba(180, 83, 9, 0.2));
  color: #fde68a;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  text-align: center;
  margin: 6px 0;
  animation: comboMegaPulse 1.2s ease-in-out infinite;
}
.summary-unlock small {
  display: block;
  font-size: 8px;
  color: #fef9c3;
  margin-top: 4px;
  letter-spacing: 0;
}

.stat b, .footer-bar b {
  color: var(--lime);
  text-shadow: 0 0 8px rgba(74, 222, 128, 0.55), 1px 1px 0 rgba(0,0,0,0.7);
}
/* Color-code key stats for readability */
#moneyLabel { color: #fde047; text-shadow: 0 0 10px rgba(253, 224, 71, 0.6), 1px 1px 0 rgba(0,0,0,0.7); }
#clockLabel { color: #a5f3fc; text-shadow: 0 0 8px rgba(165, 243, 252, 0.5), 1px 1px 0 rgba(0,0,0,0.7); }
#dayLabel   { color: #fca5a5; text-shadow: 0 0 8px rgba(252, 165, 165, 0.5), 1px 1px 0 rgba(0,0,0,0.7); }
#hoursLabel { color: #fcd34d; text-shadow: 0 0 8px rgba(252, 211, 77, 0.5), 1px 1px 0 rgba(0,0,0,0.7); }
#walkoutLabel { color: #fb7185; text-shadow: 0 0 8px rgba(251, 113, 133, 0.5), 1px 1px 0 rgba(0,0,0,0.7); }
#servedLabel { color: #86efac; text-shadow: 0 0 8px rgba(134, 239, 172, 0.55), 1px 1px 0 rgba(0,0,0,0.7); }
#storeStatus { color: #4ade80; text-shadow: 0 0 10px rgba(74, 222, 128, 0.6), 1px 1px 0 rgba(0,0,0,0.7); }

.footer-bar {
  font-size: 10px;
  border-radius: 8px;
  background:
    repeating-linear-gradient(180deg,
      transparent 0 2px,
      rgba(255,255,255,0.02) 2px 3px),
    linear-gradient(180deg, #181022 0%, #0a0514 100%);
  border: 3px solid #1a0a30;
  box-shadow:
    0 0 0 2px #fbbf24,
    0 0 0 4px #1a0a30,
    0 4px 0 rgba(0,0,0,0.4),
    inset 0 2px 0 rgba(255,255,255,0.05);
}
.footer-bar .selected { color: var(--cyan); text-shadow: 0 0 8px rgba(34, 211, 238, 0.55), 1px 1px 0 rgba(0,0,0,0.7); }
