@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&display=swap');

/* Utilise les variables du thème global */
:root {
  /* Alias pour compatibilité */
  --bg-elev: var(--bg-elevated);
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --brand-600: var(--brand-dark);
}

body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.maze-full-center {
  display: flex;
  justify-content: center;
  padding: 60px 20px;
}

.maze-success-block {
  background-color: var(--bg-elev);
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  color: var(--text);
  max-width: 780px;
  width: 100%;
}

.maze-title {
  font-size: 24px;
  margin-bottom: 22px;
  font-weight: 900;
  color: var(--brand);
}

.maze-topbar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.maze-level {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-600);
}

.maze-timer {
  font-size: 18px;
  font-weight: 900;
  color: var(--brand);
}

.maze-canvas-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.maze-canvas-layer {
  position: relative;
  width: 500px;
  height: 500px;
}

#mazeCanvas {
  background-color: var(--bg);
  border-radius: var(--radius);
  border: 2px solid var(--brand);
  width: 500px;
  height: 500px;
  box-shadow: inset 0 0 10px rgba(79, 140, 255, 0.15);
}

/* HUD sous le canvas */
.maze-hud {
  min-height: 22px;
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

/* Légende */
.maze-legend {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px 16px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
  text-align: left;
}

.legend-item { display: flex; align-items: center; gap: 10px; }
.legend-svg { width: 18px; height: 18px; display: inline-block; }

/* Overlay Pickups */
.pickup-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity .18s ease, transform .18s ease;
}

.pickup-overlay.show {
  opacity: 1;
  transform: scale(1);
}

.pickup-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  color: #0d0f14;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
  border: 2px solid rgba(0,0,0,.08);
  animation: pickupFade .65s ease forwards;
}

.pickup-card img {
  width: 28px;
  height: 28px;
}

.pickup-card .txt {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

@keyframes pickupFade {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

@keyframes flashBlock {
  0%   { background-color: var(--bg-elev); }
  50%  { background-color: #102840; }
  100% { background-color: var(--bg-elev); }
}

#maze-block.flash { animation: flashBlock 0.3s ease-in-out; }

/* Responsive */
@media (max-width: 600px) {
  .maze-canvas-layer, #mazeCanvas { width: 90vw; height: 90vw; }
  .maze-legend { grid-template-columns: repeat(2, 1fr); }
  .pickup-card { transform: scale(.92); }
}

