body.pizza-page {
  --pz-cream: #fff6e2;
  --pz-cheese: #ffd45e;
  --pz-tomato: #e2402b;
  --pz-tomato-dark: #8f1d12;
  --pz-basil: #3f9b4a;
  --pz-crust: #e9a95a;
  background-color: #1b0b08;
  background-image:
    radial-gradient(circle at 30% 18%, rgba(255, 140, 60, .2), transparent 45%),
    radial-gradient(circle at 82% 82%, rgba(63, 155, 74, .14), transparent 45%),
    linear-gradient(160deg, #2a0f0a, #120605);
  background-attachment: fixed;
}

/* ---------- Scène : la pizza sur une nappe à carreaux ---------- */
.pizza-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4%;
  overflow: hidden !important;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  background:
    radial-gradient(circle at 50% 58%, rgba(255, 190, 90, .35), transparent 50%),
    radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(20, 4, 2, .75) 100%),
    repeating-linear-gradient(0deg, rgba(226, 64, 43, .55) 0 32px, transparent 32px 64px),
    repeating-linear-gradient(90deg, rgba(226, 64, 43, .55) 0 32px, transparent 32px 64px),
    #e9d8bf !important;
  border-color: rgba(226, 64, 43, .55) !important;
}

.pizza-counter {
  position: relative;
  z-index: 2;
  padding: 10px 22px 12px;
  border-radius: 18px;
  background: rgba(30, 10, 6, .82);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  text-align: center;
  color: var(--pz-cream);
  line-height: 1.1;
}
.pizza-counter strong {
  display: block;
  font-family: "Zen Dots", system-ui, sans-serif;
  font-size: clamp(26px, 7vw, 44px);
  color: var(--pz-cheese);
  text-shadow: 0 3px 0 var(--pz-tomato-dark);
  font-variant-numeric: tabular-nums;
}
.pizza-counter span { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.pizza-counter small { display: block; margin-top: 5px; font-size: 13px; color: #9fe0a3; }

.big-pizza {
  position: relative;
  z-index: 2;
  width: 62%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  filter: drop-shadow(0 16px 22px rgba(40, 8, 2, .55));
  transition: transform .12s ease;
  animation: pizza-spin 40s linear infinite;
  -webkit-tap-highlight-color: transparent;
}
.big-pizza img { width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.big-pizza:hover { transform: scale(1.04); }
.big-pizza:active { transform: scale(.95); }
.big-pizza:focus-visible { outline: 3px solid var(--pz-cheese); outline-offset: 6px; }
.big-pizza.is-hit img { animation: pizza-hit .18s ease-out; }

/* Éclairage WebGL (pizza-light.js) : la rotation passe dans le shader, la lumière reste
   en haut à gauche, et l'ombre portée part donc vers le bas à droite. */
.pizza-gl { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.big-pizza.has-light { animation: none; filter: drop-shadow(12px 18px 20px rgba(40, 8, 2, .55)); }
/* L'image reste dans la mise en page (elle donne sa taille au bouton), mais invisible. */
.big-pizza.has-light img { visibility: hidden; }
.big-pizza.is-hit .pizza-gl { animation: pizza-hit .18s ease-out; }

@keyframes pizza-spin { to { rotate: 360deg; } }
@keyframes pizza-hit { 0% { transform: scale(.93); } 100% { transform: scale(1); } }

/* Pizzas qui montent derrière la grande pizza et le compteur (z-index 2). */
.rain-layer { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.rain-pizza {
  position: absolute;
  top: 0;
  height: auto;
  opacity: .9;
  will-change: transform;
  pointer-events: none;
  user-select: none;
}

.fx-layer { position: absolute; inset: 0; z-index: 3; pointer-events: none; }

.pop {
  position: absolute;
  transform: translate(-50%, -50%);
  font: 800 22px/1 system-ui, sans-serif;
  color: #fff;
  text-shadow: 0 2px 0 var(--pz-tomato-dark), 0 0 10px rgba(0, 0, 0, .6);
  white-space: nowrap;
  animation: pop-up 1s ease-out forwards;
}
.pop-gold { color: var(--pz-cheese); font-size: 24px; }
@keyframes pop-up { from { opacity: 1; translate: 0 0; } to { opacity: 0; translate: 0 -80px; } }

.ingredient {
  position: absolute;
  height: auto;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
  pointer-events: none;
  user-select: none;
  /* Liseré clair + ombre : détache l'ingrédient de la garniture qu'il survole. */
  filter: drop-shadow(0 0 1.5px rgba(255, 248, 230, .95)) drop-shadow(0 4px 4px rgba(40, 8, 2, .45));
}

.golden {
  position: absolute;
  width: 84px; height: 84px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 102, .55), transparent 70%);
  filter: drop-shadow(0 0 14px rgba(255, 205, 80, .9));
  cursor: pointer;
  pointer-events: auto;
  animation: golden-float 12s ease-in-out forwards;
}
.golden img { display: block; width: 100%; height: 100%; pointer-events: none; }
@keyframes golden-float {
  0% { opacity: 0; transform: scale(.4) rotate(0); }
  8% { opacity: 1; transform: scale(1) rotate(20deg); }
  50% { transform: scale(1.12) rotate(-15deg); }
  88% { opacity: 1; }
  100% { opacity: 0; transform: scale(.8) rotate(10deg); }
}

.buff-bar {
  position: absolute;
  z-index: 4;
  left: 50%; bottom: 16px;
  translate: -50% 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffb347, var(--pz-tomato));
  color: #fff;
  font: 800 14px/1 system-ui, sans-serif;
  white-space: nowrap;
  box-shadow: 0 0 24px rgba(255, 110, 50, .7);
}

/* ---------- Boutique ---------- */
.shop { margin-top: 14px; color: var(--pz-cream); }
.shop-head { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 8px; }
.shop-head h3 { margin: 0; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--pz-cheese); }
.shop-head h3::before { content: ""; display: inline-block; width: 18px; height: 4px; margin: 0 8px 3px 0; border-radius: 2px; background: linear-gradient(90deg, var(--pz-basil) 0 33%, #fff 33% 66%, var(--pz-tomato) 66%); }
.shop-empty { margin: 0; font-size: 13px; opacity: .6; }

.qty-toggle { display: inline-flex; border: 1px solid rgba(255, 212, 94, .4); border-radius: 999px; overflow: hidden; }
.qty-toggle button { padding: 4px 12px; border: 0; background: transparent; color: var(--pz-cream); font: 700 13px/1.4 system-ui, sans-serif; cursor: pointer; }
.qty-toggle button.is-active { background: var(--pz-tomato); color: #fff; }

.upgrade-list, .building-list { display: flex; flex-direction: column; gap: 6px; }

.building, .upgrade {
  display: grid;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: not-allowed;
  opacity: .55;
  transition: transform .12s ease, border-color .12s ease, opacity .12s ease;
}
.building { grid-template-columns: 40px 1fr auto; }
.building[hidden] { display: none; }
.upgrade { grid-template-columns: 30px 1fr auto; padding: 6px 12px; }
.building.is-affordable, .upgrade.is-affordable { cursor: pointer; opacity: 1; border-color: rgba(255, 212, 94, .5); }
.building.is-affordable:hover, .upgrade.is-affordable:hover { transform: translateX(3px); border-color: var(--pz-cheese); }
.building.is-mystery .b-icon { filter: brightness(0); opacity: .5; }

.b-icon { font-size: 30px; text-align: center; }
.u-icon { font-size: 22px; text-align: center; }
.b-main, .u-main { display: flex; flex-direction: column; min-width: 0; }
.b-name, .u-main strong { font-size: 15px; }
.b-desc, .u-main small { font-size: 12px; opacity: .7; }
.b-cost { margin-top: 2px; font-size: 13px; color: var(--pz-cheese); font-variant-numeric: tabular-nums; }
.u-cost { font-size: 13px; color: var(--pz-cheese); white-space: nowrap; }
.b-owned { font: 700 26px/1 "Zen Dots", system-ui, sans-serif; opacity: .35; font-variant-numeric: tabular-nums; }

/* ---------- Statistiques ---------- */
.pizza-stats {
  margin: 16px 0 12px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  color: var(--pz-cream);
}
.pizza-stats summary { cursor: pointer; font-weight: 700; color: var(--pz-cheese); }
.pizza-stats dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 10px 0; font-size: 13px; }
.pizza-stats dt { opacity: .7; }
.pizza-stats dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.reset-btn { border: 1px solid rgba(255, 120, 100, .5); background: transparent; color: #ff9c8a; border-radius: 999px; padding: 5px 12px; font: 600 12px/1.4 system-ui, sans-serif; cursor: pointer; }

@media (min-width: 980px) {
  .pizza-page .game-side { position: sticky; top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .big-pizza, .golden { animation: none; }
}
