/* ==========================================================
   NEON MAPS THEME – SPARKADE.me
   Primary color system + modules
   ========================================================== */

:root {
  --neon-color: #0ff;
  --neon-color-dark: rgba(0, 255, 255, 0.4);
}

/* ---------- General ---------- */
body {
  background: #000;
  color: #0ff;
  font-family: 'Orbitron', sans-serif;
  text-align: center;
  margin: 0;
}
.neon { text-shadow: 0 0 8px #0ff; }

.neon-btn {
  background: transparent;
  border: 1px solid var(--neon-color);
  color: var(--neon-color);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.neon-btn:hover {
  background: var(--neon-color);
  color: #000;
}

/* ---------- Header ---------- */
header, footer {
  background: rgba(0, 0, 0, 0.6);
  padding: 10px 20px;
  border-bottom: 1px solid var(--neon-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.header-left h2 {
  margin: 0;
  color: var(--neon-color);
  text-shadow: 0 0 5px var(--neon-color), 0 0 10px var(--neon-color);
}
.header-left p {
  margin: 0;
  font-size: 0.8em;
  color: #ccc;
}

/* ---------- Stats Panel ---------- */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Courier New', monospace;
  font-size: 1em;
  color: var(--neon-color);
  text-shadow: 0 0 3px var(--neon-color), 0 0 8px var(--neon-color);
  white-space: nowrap;
}
.divider { opacity: 0.5; margin: 0 6px; }
.stat-label { font-weight: bold; letter-spacing: 1px; }
.stat-val {
  color: #ff0;
  text-shadow: 0 0 4px #ff0, 0 0 8px #ff0, 0 0 12px #ff0;
  transition: text-shadow 0.2s ease-in-out;
}

/* ---------- Animations ---------- */
@keyframes terminalPulse {
  0%, 100% { opacity: 0.85; text-shadow: 0 0 3px #ff0, 0 0 6px #ff0, 0 0 12px #ff0; }
  50% { opacity: 1; text-shadow: 0 0 10px #ff0, 0 0 20px #ff0, 0 0 25px var(--neon-color); }
}
.pulse { animation: terminalPulse 2s infinite; }

/* ---------- Glitch Blink ---------- */
@keyframes glitchBlink {
  0%, 97%, 100% { opacity: 1; filter: none; }
  98% { opacity: 0.3; filter: blur(1px) brightness(2); }
  99% { opacity: 0.7; filter: hue-rotate(30deg) brightness(1.2); }
}
.glitch { animation: glitchBlink 25s infinite; }

/* ---------- Context Bar ---------- */
#context-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  margin: 6px auto 0;
  max-width: 80%;
  border-top: 1px solid var(--neon-color);
  border-bottom: 1px solid var(--neon-color);
  background: rgba(0, 0, 0, 0.75);
  border-radius: 6px;
  box-shadow: 0 0 8px var(--neon-color-dark),
              inset 0 0 6px var(--neon-color),
              0 0 15px var(--neon-color);
  animation: neonPulse 4s ease-in-out infinite;
  transition: opacity 0.6s ease;
  z-index: 600;
}

#context-bar:not(.show) {
  display: none;
}

/* ---------- Side Action Bar ---------- */
.action-side-bar {
  position: absolute;
  top: 80px;
  left: 55px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 6px;
  border: 1px solid var(--neon-color);
  border-radius: 10px;
  background: rgba(0,0,0,0.65);
  box-shadow: 0 0 8px var(--neon-color),
              inset 0 0 6px var(--neon-color),
              0 0 15px var(--neon-color-dark);
  animation: sidePulse 4s ease-in-out infinite;
  z-index: 1200;
}
/* Hidden by default until login */
.action-side-bar:not(.show) {
  display: none;
}


.action-icon {
  font-size: 22px;
  padding: 6px 8px;
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--neon-color);
  border-radius: 8px;
  color: var(--neon-color);
  cursor: pointer;
  transition: all 0.2s ease, box-shadow 0.3s ease;
  text-shadow: 0 0 6px var(--neon-color-dark);
}
.action-icon:hover,
.action-icon.active {
  background: var(--neon-color);
  color: #000;
  box-shadow: 0 0 10px var(--neon-color), 0 0 25px var(--neon-color-dark);
}

@keyframes sidePulse {
  0%, 100% { box-shadow: 0 0 8px var(--neon-color), inset 0 0 6px var(--neon-color); }
  50% { box-shadow: 0 0 14px var(--neon-color-dark), inset 0 0 10px var(--neon-color-dark); }
}

/* ---------- Overlays ---------- */
.overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  z-index: 2000;
  color: var(--neon-color);
  justify-content: center;
  align-items: center;
  transition: opacity 0.4s ease;
}
.overlay.active { display: flex; opacity: 1; }
.overlay-content {
  background: rgba(10,10,10,0.9);
  border: 1px solid var(--neon-color);
  border-radius: 12px;
  padding: 20px;
  color: var(--neon-color);
  max-width: 600px;
  text-align: left;
  box-shadow: 0 0 20px var(--neon-color-dark);
}

/* ---------- Neon Pulse ---------- */
@keyframes neonPulse {
  0%, 100% { box-shadow: 0 0 8px var(--neon-color), inset 0 0 6px var(--neon-color); }
  50% { box-shadow: 0 0 14px var(--neon-color-dark), inset 0 0 10px var(--neon-color-dark); }
}

/* ---------- Collect Wins Glow ---------- */
@keyframes collectPulse {
  0%, 100% {
    box-shadow: 0 0 8px #ff0, 0 0 16px #ff0, 0 0 24px #ff0;
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 16px #ff0, 0 0 28px #ff0, 0 0 40px #fff700;
    transform: scale(1.05);
  }
}

.collect-pulse {
  animation: collectPulse 2s ease-in-out infinite;
  border-color: #ff0 !important;
  color: #000 !important;
  background: #ff0 !important;
  text-shadow: 0 0 6px #ff0;
}

.neon-table th, .neon-table td {
  border: 1px solid var(--neon-color);
  padding: 4px 8px;
  color: var(--neon-color);
}
.neon-table th {
  background: rgba(0,255,255,0.15);
  text-shadow: 0 0 4px var(--neon-color);
}

.neon-scroll-area {
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 8px;
}

.neon-card {
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--neon-color);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 12px;
  box-shadow: 0 0 8px var(--neon-color-dark);
  transition: transform 0.2s, box-shadow 0.3s;
}
.neon-card:hover {
  transform: scale(1.02);
  box-shadow: 0 0 12px var(--neon-color);
}
.progress-wrap {
  width: 100%;
  height: 8px;
  background: rgba(0,255,255,0.1);
  border: 1px solid var(--neon-color-dark);
  border-radius: 6px;
  overflow: hidden;
  margin: 6px 0;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #39ff14, #0ff, #b300ff);
  animation: colorShift 5s linear infinite;
}
.addr-line { font-size: 0.9em; color: #ff0; }
.neon-small { font-size: 0.85em; color: #aaa; }

.copy-btn.copied {
  background: #39ff14 !important;
  color: #000 !important;
  text-shadow: 0 0 6px #39ff14;
}

/* add to neon_map.css or neon_map_core.css */
.neon-box {
  border: 1px solid var(--neon-color);
  padding: 10px 16px;
  border-radius: 10px;
  box-shadow: 0 0 12px var(--neon-color-dark);
}
.neon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px 12px;
}
.loading { color: #ff0; text-align: center; }

/* Neon Stats inner modal */
.stats-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid var(--neon-color);
  border-radius: 10px;
  box-shadow: 0 0 25px var(--neon-color-dark);
  padding: 20px;
  color: var(--neon-color);
  max-width: 480px;
  width: 90%;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.stats-modal.active { display: flex !important; }

.neon-input {
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--neon-color);
  border-radius: 6px;
  color: var(--neon-color);
  padding: 4px 8px;
  text-align: center;
}
.neon-input:focus {
  outline: none;
  box-shadow: 0 0 8px var(--neon-color);
}

/* ==========================================================
   BLOCK STATUS INDICATOR — Neon Pulse + Sparks
   ========================================================== */
#block-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9em;
  color: var(--neon-color);
  margin-top: 6px;
  cursor: pointer;
}

.neon-status-dot {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: red;
  box-shadow: 0 0 10px red, 0 0 20px red;
  transition: background 0.4s ease, box-shadow 0.4s ease, transform 0.2s ease;
}

.neon-status-text {
  text-shadow: 0 0 4px var(--neon-color);
}

/* general pulse toggle from JS */
.neon-status-dot.pulse {
  box-shadow: 0 0 18px var(--neon-color), 0 0 30px var(--neon-color);
}

/* subtle status states */
.neon-status-dot.status-good {
  animation: blockStatusHeartbeat 2s infinite;
}
.neon-status-dot.status-running {
  animation: blockStatusHeartbeatFast 1.2s infinite;
}
.neon-status-dot.status-warn {
  animation: blockStatusHeartbeat 1.6s infinite;
}
.neon-status-dot.status-bad {
  animation: blockStatusHeartbeatSlow 2.4s infinite;
}

/* little sparks */
.neon-status-dot .spark {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(0, 255, 255, 0.9);
  opacity: 0;
  pointer-events: none;
}

.neon-status-dot .spark-1 {
  top: -4px;
  left: 6px;
  animation: sparkDrift 2.5s infinite;
}
.neon-status-dot .spark-2 {
  top: 10px;
  left: -2px;
  animation: sparkDrift 3s infinite 0.4s;
}
.neon-status-dot .spark-3 {
  top: 10px;
  left: 10px;
  animation: sparkDrift 3.2s infinite 0.8s;
}

/* Heartbeat glows */
@keyframes blockStatusHeartbeat {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 10px #39ff14, 0 0 20px #39ff14;
  }
  50% {
    transform: scale(1.12);
    box-shadow: 0 0 20px #0ff, 0 0 32px #0ff;
  }
}
@keyframes blockStatusHeartbeatFast {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 10px #ff0, 0 0 20px #ff0;
  }
  50% {
    transform: scale(1.2);
    box-shadow: 0 0 22px #fff700, 0 0 36px #fff700;
  }
}
@keyframes blockStatusHeartbeatSlow {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 10px #f00, 0 0 22px #f00;
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 16px #ff5555, 0 0 28px #ff5555;
  }
}

/* Spark drift animation */
@keyframes sparkDrift {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.6);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-4px, -8px) scale(1.2);
  }
}

/* ==========================================================
   BLOCK STATUS MINI PANEL — Mobile Friendly
   ========================================================== */
#block-status-panel {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: flex-end;
  align-items: flex-start;
  z-index: 3000;
  pointer-events: none;
}

#block-status-panel.show {
  display: flex;
  pointer-events: auto;
}

.block-panel-inner {
  margin: 80px 16px 0 0;
  background: rgba(10, 10, 10, 0.97);
  border: 1px solid var(--neon-color);
  border-radius: 10px;
  box-shadow: 0 0 25px var(--neon-color-dark);
  padding: 14px 16px 12px 16px;
  width: min(320px, 90vw);
  color: var(--neon-color);
  font-size: 0.8rem;
  font-family: 'Courier New', monospace;
  pointer-events: auto;
}

.block-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-weight: bold;
  text-shadow: 0 0 6px var(--neon-color);
}

.block-panel-close {
  background: transparent;
  border: 1px solid var(--neon-color);
  color: var(--neon-color);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  text-align: center;
}
.block-panel-close:hover {
  background: var(--neon-color);
  color: #000;
}

.block-panel-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.block-panel-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.block-panel-row strong {
  min-width: 90px;
}

/* Coverage bar */
.block-panel-coverage-bar {
  margin: 4px 0 6px 0;
  width: 100%;
  height: 6px;
  border-radius: 4px;
  border: 1px solid var(--neon-color-dark);
  background: rgba(0, 255, 255, 0.08);
  overflow: hidden;
}
.block-panel-coverage-bar #bs-coverage-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f00, #ff0, #39ff14);
  box-shadow: 0 0 6px #39ff14;
  transition: width 0.4s ease;
}

/* Mobile: center the panel more */
@media (max-width: 600px) {
  #block-status-panel {
    justify-content: center;
    align-items: flex-start;
  }
  .block-panel-inner {
    margin: 80px auto 0 auto;
  }
}


/* ==========================================================
   GAMES DETAIL – DevShops + Speedways
   ========================================================== */

.game-detail {
  margin: 0;
}

.devshop-detail h3,
.speedway-detail h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.mini-map-wrap {
  position: relative;
  margin-top: 0.75rem;
  border: 1px solid var(--neon-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 15px var(--neon-color-dark);
}

/* Medium (450px) mini-maps as requested */
.mini-map {
  width: 100%;
  height: 450px;
}

.mini-map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9em;
  color: #ff0;
  background: radial-gradient(circle at 50% 0%, rgba(0,255,255,0.08), transparent);
  text-shadow: 0 0 6px #ff0;
  pointer-events: none;
  animation: neonPulse 2s ease-in-out infinite;
}

.devshop-detail .mini-map {
  border-color: #b300ff;
  box-shadow: 0 0 12px rgba(179, 0, 255, 0.7);
}

.speedway-detail .mini-map {
  border-color: #ff1744;
  box-shadow: 0 0 12px rgba(255, 23, 68, 0.7);
}

.neon-list {
  list-style: none;
  padding-left: 1rem;
  margin: 0.25rem 0;
}
.neon-list li {
  margin-bottom: 0.25rem;
}

/* ===========================
   GAMES MINI-MAPS
   =========================== */

.mini-map-wrap {
  position: relative;
  margin-top: 12px;
  border: 1px solid var(--neon-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 15px var(--neon-color-dark);
}

.mini-map {
  width: 100%;
  height: 450px;
}

.mini-map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content:center;
  align-items:center;
  color:#ff0;
  text-shadow:0 0 6px #ff0;
  animation: neonPulse 2s infinite;
  background: rgba(0,0,0,0.35);
}

/* DevShop mini-map neon frame */
.devshop-detail .mini-map-wrap {
  border-color:#b300ff;
  box-shadow:0 0 15px #b300ff80;
}

/* Speedway mini-map neon frame */
.speedway-detail .mini-map-wrap {
  border-color:#ff1744;
  box-shadow:0 0 15px #ff174480;
}

.neon-list {
  list-style:none;
  padding-left:1rem;
}
.neon-list li {
  margin-bottom:4px;
}
