/* ===== VAPOR RENDERER — synthwave mines scene ===== */

.mines-grid.vapor-scene-root {
  display: block;
  max-width: 500px;
  width: 100%;
  height: min(500px, 68vh);
  aspect-ratio: auto;
  position: relative;
}

/* ── Scene container ── */

.vapor-scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* ── Sky ── */

.vapor-sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    #0d0421 0%,
    #21084e 22%,
    #6b1a6e 44%,
    #d4366e 62%,
    #f4724a 78%,
    #ffc36b 90%,
    #ffde87 100%
  );
}

/* ── Stars ── */

.vapor-star {
  position: absolute;
  border-radius: 50%;
  background: #ffd6f0;
  animation: vapor-twinkle 2.8s ease-in-out infinite;
  pointer-events: none;
}

.vapor-star.cyan {
  background: #bdf0ff;
}

@keyframes vapor-twinkle {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50%       { opacity: 0.25; transform: scale(0.6); }
}

/* ── Sun ── */

.vapor-sun {
  position: absolute;
  width: 120px;
  height: 60px;
  left: 50%;
  transform: translateX(-50%);
  bottom: 47%;
  overflow: hidden;
  border-radius: 120px 120px 0 0;
  animation: vapor-sun-pulse 4s ease-in-out infinite;
  z-index: 1;
}

@keyframes vapor-sun-pulse {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 20px rgba(255, 170, 100, 0.7)); }
  50%       { filter: brightness(1.15) drop-shadow(0 0 40px rgba(255, 170, 100, 0.9)); }
}

.vapor-sun-body {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    #ffe488 0%,
    #ffb04c 30%,
    #ff6090 60%,
    #cc20ff 100%
  );
}

.vapor-sun-slit {
  position: absolute;
  left: 0;
  right: 0;
  background: #2a0a5a;
  z-index: 1;
}

/* ── Sun glow halo ── */

.vapor-sun-halo {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 150, 100, 0.45) 0%, transparent 70%);
  width: 300px;
  height: 300px;
  left: 50%;
  bottom: 44%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
  animation: vapor-halo-pulse 4s ease-in-out infinite;
}

@keyframes vapor-halo-pulse {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50%       { opacity: 1;   transform: translateX(-50%) scale(1.08); }
}

/* ── Horizon line ── */

.vapor-horizon {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  bottom: 46%;
  background: linear-gradient(to right, transparent, #ff8cd7, #ff8cd7, transparent);
  box-shadow: 0 0 14px rgba(255, 140, 215, 0.8), 0 0 40px rgba(255, 140, 215, 0.3);
  z-index: 1;
}

/* ── Perspective grid floor ── */

.vapor-floor {
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  height: 46%;
  overflow: hidden;
  background: linear-gradient(to bottom, #1a044a 0%, #080212 100%);
}

.vapor-floor-grid {
  position: absolute;
  inset: 0;
  /* perspective grid via background-image */
  background-image:
    /* horizontal lines */
    repeating-linear-gradient(
      to bottom,
      transparent 0px,
      transparent calc(var(--row-h) - 1px),
      rgba(24, 224, 255, 0.55) calc(var(--row-h) - 1px),
      rgba(24, 224, 255, 0.55) var(--row-h)
    );
  --row-h: 14%;
}

.vapor-floor-grid-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ── City silhouette ── */

.vapor-city {
  position: absolute;
  left: 0; right: 0;
  bottom: 46%;
  height: 60px;
  z-index: 1;
  pointer-events: none;
}

.vapor-city-svg {
  width: 100%;
  height: 100%;
}

/* ── Palm trees ── */

.vapor-palms {
  position: absolute;
  left: 0; right: 0;
  bottom: 46%;
  height: 100px;
  z-index: 2;
  pointer-events: none;
}

/* ── Scanline overlay ── */

.vapor-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.08) 0px,
    rgba(0,0,0,0.08) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 10;
}

/* ── Tile grid overlay ── */

.vapor-tile-grid {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 6px;
  width: min(300px, 68vmin);
  height: min(300px, 68vmin);
  filter: drop-shadow(0 0 30px rgba(42, 10, 90, 0.8));
}

/* ── Tile base ── */

.vapor-tile {
  background: rgba(20, 5, 50, 0.75);
  border: 1px solid rgba(255, 170, 255, 0.35);
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Audiowide', 'Courier New', monospace;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 170, 255, 0.6);
  user-select: none;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(4px);
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}

/* Inner shimmer lines on hidden tiles */
.vapor-tile.tile-hidden::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent 30%,
    rgba(255, 170, 255, 0.06) 50%,
    transparent 70%
  );
}

.vapor-tile.tile-hidden:hover:not(.tile-disabled) {
  border-color: rgba(255, 170, 255, 0.75);
  box-shadow:
    0 0 12px rgba(255, 170, 255, 0.25) inset,
    0 0 8px rgba(255, 170, 255, 0.15);
  background: rgba(40, 10, 80, 0.85);
}

.vapor-tile.tile-disabled {
  cursor: default;
}

/* ── Safe tile ── */

.vapor-tile.tile-safe {
  background: rgba(0, 220, 180, 0.10);
  border-color: rgba(0, 255, 200, 0.60);
  box-shadow:
    0 0 16px rgba(0, 255, 200, 0.20) inset,
    0 0 6px rgba(0, 255, 200, 0.15);
  color: #00ffcc;
  text-shadow: 0 0 8px rgba(0, 255, 200, 0.80);
  cursor: default;
}

.vapor-tile.tile-safe::before { display: none; }

/* ── Mine hit ── */

.vapor-tile.tile-mine {
  background: rgba(255, 0, 170, 0.18);
  border-color: rgba(255, 0, 170, 0.75);
  box-shadow:
    0 0 24px rgba(255, 0, 170, 0.35) inset,
    0 0 16px rgba(255, 0, 170, 0.20);
  color: #ff00aa;
  cursor: default;
  animation: vapor-mine-explode 0.4s ease;
}

.vapor-tile.tile-mine::after {
  content: '✸';
  font-size: 20px;
  text-shadow: 0 0 12px rgba(255, 0, 170, 0.9);
}

.vapor-tile.tile-mine::before { display: none; }

@keyframes vapor-mine-explode {
  0%   { transform: scale(1);    filter: brightness(1); }
  30%  { transform: scale(1.15); filter: brightness(3) saturate(2); }
  100% { transform: scale(1);    filter: brightness(1); }
}

/* ── Auto-revealed mines ── */

.vapor-tile.tile-auto-revealed,
.vapor-tile.tile-mine-revealed {
  background: rgba(255, 0, 170, 0.04);
  border-color: rgba(255, 0, 170, 0.25);
  color: rgba(255, 0, 170, 0.45);
  opacity: 1;
  cursor: default;
}

.vapor-tile.tile-auto-revealed::after,
.vapor-tile.tile-mine-revealed::after {
  content: '✸';
  font-size: 14px;
}

.vapor-tile.tile-auto-revealed::before,
.vapor-tile.tile-mine-revealed::before {
  display: none;
}

/* ── Flip animation (reused by mine-flip class) ── */

.vapor-tile.tile-flip {
  animation: mines-flip 0.30s ease;
}
