@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@400;600;700;900&family=Rajdhani:wght@400;500;600;700&display=swap');

:root {
  --bg:         #0e1a1b;
  --surface:    #141f20;
  --surface-2:  #1a2a2b;
  --surface-3:  #243536;
  --border:     rgba(255,255,255,0.07);
  --violet:     #9f53ec;
  --orange:     #ff9d00;
  --blue:       #4fc3f7;
  --blue-dim:   rgba(79,195,247,0.12);
  --green:      #4caf82;
  --red:        #ef5350;
  --yellow:     #ffd740;
  --text:       #cfe0e2;
  --text-dim:   #6a8587;
  --radius:     14px;
  --radius-sm:  8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Rajdhani', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 1.5rem 1.5rem 3rem;
  margin-left: 250px;
  transition: margin-left 0.3s ease;
}
body.sidebar-collapsed { margin-left: 0; }

h1 {
  font-family: 'Exo 2', sans-serif;
  text-align: center;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 40px rgba(159,83,236,0.4);
}

/* ── Map Switch ── */
.map-switch {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.map-switch button {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 9px 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}
.map-switch button:hover {
  background: var(--surface-3);
  color: var(--text);
  transform: translateY(-2px);
}
.map-switch button.active {
  background: var(--blue-dim);
  border-color: var(--blue);
  color: var(--blue);
  box-shadow: 0 0 14px rgba(79,195,247,0.2);
}

/* ── Timer bubble ── */
.timer-section {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.middle-bubble {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.timer-top {
  display: flex;
  justify-content: center;
  align-items: center;
}

#play-btn {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 9px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(79,195,247,0.3);
  background: var(--blue-dim);
  color: var(--blue);
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all 0.2s ease;
}
#play-btn:hover {
  background: rgba(79,195,247,0.22);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(79,195,247,0.2);
}

#timer-display {
  font-family: 'Exo 2', sans-serif;
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--yellow);
  text-shadow: 0 0 20px rgba(255,215,64,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  letter-spacing: 0.04em;
}

#timer-display input {
  width: 72px;
  text-align: center;
  font-family: 'Exo 2', sans-serif;
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--yellow);
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(255,215,64,0.3);
  outline: none;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}
#timer-display input:focus { border-color: var(--yellow); }
#timer-display input::-webkit-outer-spin-button,
#timer-display input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.timer-sep {
  color: rgba(255,215,64,0.6);
  font-weight: 900;
  user-select: none;
}

#time-slider {
  width: 100%;
  direction: rtl;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}
#time-slider::-webkit-slider-runnable-track {
  height: 6px;
  background: linear-gradient(to right, var(--blue), var(--yellow));
  border-radius: 3px;
}
#time-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--surface);
  cursor: pointer;
  margin-top: -6px;
  transition: transform 0.15s;
  box-shadow: 0 0 6px rgba(79,195,247,0.4);
}
#time-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
#time-slider::-moz-range-track {
  height: 6px;
  background: linear-gradient(to right, var(--blue), var(--yellow));
  border-radius: 3px;
}
#time-slider::-moz-range-thumb {
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--surface);
  cursor: pointer;
}

/* ── Map Container ── */
.map-wrapper {
  display: flex;
  justify-content: center;
}

.map-container {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.map-container img#map-img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  pointer-events: none;
}

#spawns-container,
#towers-container {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.spawn,
.tower {
  position: absolute;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transition: transform 0.2s, opacity 0.2s;
  /* size driven by inline style from JS */
}

.spawn:hover  { transform: translate(-50%, -50%) scale(1.18); }
.tower:hover  { transform: translate(-50%, -50%) scale(1.15); }

.tower.destroyed { opacity: 0.75; }
.tower.disabled  { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ── Fixed Tooltip ── */
.pokemon-tooltip {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9000;
  background: linear-gradient(160deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid rgba(79,195,247,0.3);
  border-radius: var(--radius);
  box-shadow: 0 12px 48px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  pointer-events: none;
  width: 520px;
  max-width: 560px;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.pokemon-tooltip.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.pokemon-tooltip .gif-container {
  width: 160px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  padding: 14px;
  flex-shrink: 0;
}
.pokemon-tooltip .gif-container img {
  max-width: 100%;
  max-height: 130px;
  object-fit: contain;
}

.pokemon-tooltip .separator {
  width: 1px;
  background: rgba(79,195,247,0.25);
  flex-shrink: 0;
}

.pokemon-tooltip .info-content {
  padding: 18px 20px;
  color: var(--text-dim);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}
.pokemon-tooltip .info-content h3 {
  font-family: 'Exo 2', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--yellow);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
}
.pokemon-tooltip .info-content p {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0;
}
.pokemon-tooltip .info-content strong {
  color: var(--text);
  font-weight: 700;
}

/* ── Footer ── */
footer {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ── Responsive ── */
@media (max-width: 860px) {
  body { margin-left: 0; padding: 1rem 0.75rem 2rem; }

  .middle-bubble { max-width: 100%; }

  .pokemon-tooltip {
    bottom: 1rem;
    right: 1rem;
    width: calc(100vw - 2rem);
    max-width: 340px;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 1.3rem; }
  #timer-display { font-size: 2rem; }
  #timer-display input { font-size: 1.8rem; width: 56px; }
  .map-switch button { font-size: 0.75rem; padding: 7px 12px; }
}