:root {
  --background: 34 38% 94%;
  --foreground: 236 28% 13%;
  --primary: 338 82% 52%;
  --secondary: 183 76% 38%;
  --muted: 236 10% 42%;
  --destructive: 8 82% 48%;
  --border: 28 22% 78%;
  --card: 36 44% 98%;
  --shadow-sm: 0 6px 18px hsl(236 28% 13% / 0.08);
  --shadow-md: 0 14px 36px hsl(236 28% 13% / 0.12);
  --shadow-lg: 0 22px 60px hsl(236 28% 13% / 0.18);
  --transition-fast: 140ms ease;
  --transition-smooth: 260ms cubic-bezier(.2,.8,.2,1);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
}

.dark {
  --background: 236 25% 9%;
  --foreground: 34 42% 94%;
  --primary: 338 86% 62%;
  --secondary: 183 78% 48%;
  --muted: 230 12% 68%;
  --destructive: 8 82% 60%;
  --border: 235 18% 24%;
  --card: 236 24% 14%;
}

* { box-sizing: border-box; }
html, body, #root { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, hsl(var(--primary) / 0.18), transparent 32rem),
    radial-gradient(circle at bottom right, hsl(var(--secondary) / 0.16), transparent 30rem),
    hsl(var(--background));
}
button { font: inherit; -webkit-tap-highlight-color: transparent; }

.scene-shell {
  background:
    linear-gradient(150deg, hsl(236 30% 13% / 0.10), transparent 38%),
    radial-gradient(circle at 50% 20%, hsl(var(--primary) / 0.15), transparent 28rem),
    linear-gradient(180deg, hsl(30 68% 88%), hsl(28 52% 80%));
  touch-action: manipulation;
}

.iso-tile {
  width: 56px;
  height: 31px;
  border: 1px solid hsl(25 34% 58% / 0.62);
  background: linear-gradient(145deg, hsl(32 60% 78%), hsl(29 48% 69%));
  transform: rotateX(60deg) rotateZ(45deg);
  transform-origin: center;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: inset 0 0 0 1px hsl(0 0% 100% / 0.16);
}
.iso-tile:hover { filter: brightness(1.08); }

.shop-wall {
  position: absolute;
  pointer-events: none;
  opacity: .95;
  filter: drop-shadow(0 14px 18px hsl(236 25% 12% / 0.18));
}
.shop-wall-left {
  left: 24px;
  top: 185px;
  width: 338px;
  height: 94px;
  background: linear-gradient(90deg, hsl(338 70% 48%), hsl(338 65% 35%));
  transform: skewY(29deg);
  border-radius: 16px 0 0 28px;
}
.shop-wall-back {
  left: 356px;
  top: 183px;
  width: 338px;
  height: 94px;
  background: linear-gradient(90deg, hsl(183 70% 32%), hsl(183 66% 43%));
  transform: skewY(-29deg);
  border-radius: 0 16px 28px 0;
}
.shop-door {
  position: absolute;
  left: 588px;
  top: 278px;
  z-index: 180;
  font-size: 34px;
  filter: drop-shadow(0 8px 8px hsl(236 20% 10% / 0.2));
}

.shop-object, .customer {
  position: absolute;
  width: 72px;
  min-height: 76px;
  margin-left: -36px;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: transform var(--transition-smooth), filter var(--transition-fast);
}
.shop-object:hover, .customer:hover { transform: translateY(-5px) scale(1.04); }
.shop-object.selected, .customer.selected { filter: drop-shadow(0 0 14px hsl(var(--primary) / .85)); transform: translateY(-6px) scale(1.06); }
.object-shadow {
  position: absolute;
  left: 11px;
  top: 51px;
  width: 50px;
  height: 18px;
  border-radius: 50%;
  background: hsl(236 25% 12% / 0.22);
  transform: rotate(-12deg);
}
.object-body, .customer-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 58px;
  margin: 0 auto;
  border-radius: 20px;
  background: linear-gradient(145deg, hsl(var(--card)), hsl(32 48% 84%));
  border: 2px solid hsl(0 0% 100% / 0.55);
  box-shadow: var(--shadow-sm);
  font-size: 32px;
}
.chair .object-body { background: linear-gradient(145deg, hsl(338 78% 58%), hsl(338 70% 38%)); }
.desk .object-body { background: linear-gradient(145deg, hsl(183 70% 58%), hsl(183 66% 34%)); }
.decor .object-body { background: linear-gradient(145deg, hsl(48 88% 70%), hsl(25 70% 54%)); }
.object-label, .customer-name {
  display: inline-block;
  max-width: 86px;
  margin-top: 2px;
  padding: 2px 7px;
  border-radius: 999px;
  background: hsl(236 24% 12% / 0.72);
  color: white;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(8px);
}
.customer-avatar {
  width: 50px;
  height: 55px;
  border-radius: 999px 999px 18px 18px;
  background: linear-gradient(145deg, hsl(36 80% 92%), hsl(28 70% 74%));
  animation: bob 1.2s ease-in-out infinite;
}
.customer.waiting .customer-avatar { animation-duration: 2.2s; }
.customer-bubble {
  position: absolute;
  left: 43px;
  top: -8px;
  z-index: 2;
  border-radius: 999px;
  background: white;
  color: hsl(var(--foreground));
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 900;
  box-shadow: var(--shadow-sm);
}

.build-btn {
  display: flex;
  min-height: 86px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: var(--radius-md);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  font-weight: 900;
}
.build-btn:hover { transform: translateY(-3px); border-color: hsl(var(--primary) / .45); }
.build-btn small { color: hsl(var(--muted)); font-size: 11px; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@media (max-width: 520px) {
  .scene-shell { height: 500px; }
  .scene-shell > div:nth-child(2) { transform: translate(-50%, -50%) scale(.72); transform-origin: center; top: 238px; }
}

@media (min-width: 768px) {
  .scene-shell { height: 600px; }
}