/* ========================================
   SYNTH UNIVERSE — main.css
   synthverse.ru
   ======================================== */

/* RESET & BASE */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #05080f;
  --s1:        #0a0f1a;
  --s2:        #0f1825;
  --s3:        #162030;
  --s4:        #1c2840;

  --cyan:      #00d4e8;
  --cyan-dim:  rgba(0,212,232,0.12);
  --cyan-glow: rgba(0,212,232,0.25);
  --violet:    #8b5cf6;
  --rose:      #f43f5e;
  --amber:     #f59e0b;
  --green:     #10b981;
  --sky:       #7dd3fc;
  --indigo:    #818cf8;
  --lime:      #86efac;
  --peach:     #fb923c;
  --pink:      #f472b6;

  --border:    rgba(0,212,232,0.12);
  --border-md: rgba(0,212,232,0.2);
  --border-hi: rgba(0,212,232,0.35);
  --grid:      rgba(0,212,232,0.045);

  --text:      #c8d8f0;
  --text-dim:  #7a90b0;
  --muted:     #4a6280;

  --mono:      'Share Tech Mono', monospace;
  --display:   'Rajdhani', sans-serif;

  --nav-h:     48px;
  --panel-w:   280px;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--display);
  height: 100%;
  overflow: hidden;
}

/* SCANLINES */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.04) 3px,
    rgba(0,0,0,0.04) 4px
  );
}

/* ROOT LAYOUT */
.root {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ── NAV ── */
.nav {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 0;
  flex-shrink: 0;
  background: var(--s1);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 50;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan);
  letter-spacing: .14em;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-right: 28px;
  flex-shrink: 0;
  cursor: default;
  user-select: none;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  flex-shrink: 0;
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,212,232,.45); }
  50%       { opacity: .55; box-shadow: 0 0 0 6px rgba(0,212,232,0); }
}

.tabs {
  display: flex;
  gap: 4px;
  flex: 1;
}

.tab {
  padding: 6px 18px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .09em;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  transition: all .2s;
  text-transform: uppercase;
}

.tab:hover {
  color: var(--text-dim);
  border-color: var(--border);
}

.tab.on {
  color: var(--cyan);
  border-color: rgba(0,212,232,.32);
  background: rgba(0,212,232,.07);
}

.nav-stats {
  display: flex;
  gap: 20px;
  flex-shrink: 0;
}

.nav-stat {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .04em;
}

.nav-stat b {
  color: var(--cyan);
  font-weight: 700;
}

/* ── BODY ── */
.body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── MAP PANE ── */
.map-pane {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.map-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}

#world-map {
  width: 100%;
  height: 100%;
  display: block;
}

/* Map elements */
.country-path {
  cursor: pointer;
  transition: filter .22s ease;
}
.country-path:hover  { filter: brightness(1.55); }
.country-path.active { filter: brightness(2.1) drop-shadow(0 0 5px rgba(0,212,232,.55)); }

.city-node { cursor: pointer; }

.city-ring {
  animation: city-ring 2.6s ease-in-out infinite;
}

@keyframes city-ring {
  0%, 100% { r: 9; opacity: .14; }
  50%       { r: 14; opacity: .04; }
}

/* Map Tooltip */
.map-tooltip {
  position: absolute;
  z-index: 30;
  background: var(--s2);
  border: 1px solid var(--border-md);
  border-radius: 8px;
  padding: 12px 14px;
  min-width: 190px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .14s;
  font-family: var(--mono);
  font-size: 10px;
}

.map-tooltip.show { opacity: 1; }

.mt-name {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 7px;
  letter-spacing: .03em;
}

.mt-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  margin-top: 3px;
}

.mt-row span { color: var(--text); font-weight: 700; }

.mt-genres {
  margin-top: 8px;
  color: var(--indigo);
  font-size: 9px;
  letter-spacing: .04em;
  line-height: 1.6;
}

/* ── PANEL ── */
.panel {
  width: var(--panel-w);
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  background: var(--s1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-align: center;
  padding: 24px;
}

.panel-empty-icon {
  font-size: 36px;
  opacity: .18;
  line-height: 1;
}

.panel-empty-text {
  line-height: 1.8;
  opacity: .7;
}

.panel-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.panel-head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
}

.ph-scene {
  font-size: 14px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: .04em;
  padding-right: 28px;
}

.ph-country {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}

.ph-period {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--amber);
  margin-top: 3px;
}

.panel-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: color .2s;
  padding: 2px 4px;
}

.panel-close:hover { color: var(--rose); }

.panel-scroll {
  overflow-y: auto;
  flex: 1;
  padding-bottom: 12px;
}

.panel-scroll::-webkit-scrollbar { width: 3px; }
.panel-scroll::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 2px; }

/* Panel sections */
.p-section {
  padding: 11px 16px 7px;
}

.p-section-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: .13em;
  text-transform: uppercase;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.p-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Genres */
.genre-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.genre-tag {
  padding: 3px 9px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 9px;
  border: 1px solid;
  letter-spacing: .05em;
  white-space: nowrap;
}

/* Cities */
.city-list-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(0,212,232,.04);
}

.city-list-item:last-child { border-bottom: none; }

.city-list-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.city-list-name {
  font-size: 12px;
  font-weight: 500;
  flex: 1;
}

/* Artists */
.artist-item {
  padding: 7px 0;
  border-bottom: 1px solid rgba(0,212,232,.04);
}

.artist-item:last-child { border-bottom: none; }

.artist-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.artist-location {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--violet);
  margin-top: 3px;
}

.artist-releases {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.65;
}

.artist-releases .rel-year { color: var(--amber); }

/* Influences */
.influence-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 9px;
}

.inf-badge {
  font-size: 8px;
  padding: 2px 6px;
  border-radius: 2px;
  flex-shrink: 0;
  letter-spacing: .04em;
}

.inf-badge.from {
  color: var(--rose);
  border: 1px solid rgba(244,63,94,.25);
  background: rgba(244,63,94,.08);
}

.inf-badge.to {
  color: var(--green);
  border: 1px solid rgba(16,185,129,.25);
  background: rgba(16,185,129,.08);
}

.inf-name {
  color: var(--text);
  flex: 1;
}

.inf-note {
  color: var(--muted);
  font-size: 8px;
  margin-top: 1px;
}

/* Description */
.scene-desc {
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-dim);
}

/* ── TIMELINE PANE ── */
.timeline-pane {
  position: absolute;
  inset: var(--nav-h) 0 0 0;
  background: var(--bg);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 40;
}

.timeline-pane.show { display: flex; }

.tl-header {
  padding: 12px 20px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  background: var(--s1);
}

.tl-title {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: .1em;
  flex-shrink: 0;
}

.tl-filters {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.tl-filter {
  padding: 4px 13px;
  font-family: var(--mono);
  font-size: 9px;
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  transition: all .2s;
  letter-spacing: .07em;
}

.tl-filter:hover { color: var(--text-dim); border-color: var(--border-md); }
.tl-filter.on { color: var(--cyan); border-color: rgba(0,212,232,.32); background: rgba(0,212,232,.07); }

.tl-body {
  flex: 1;
  overflow: hidden;
  position: relative;
}

#tl-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tl-tooltip {
  position: absolute;
  z-index: 60;
  background: var(--s2);
  border: 1px solid var(--border-md);
  border-radius: 7px;
  padding: 11px 14px;
  min-width: 215px;
  max-width: 270px;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 10px;
  opacity: 0;
  transition: opacity .14s;
}

.tl-tooltip.show { opacity: 1; }

.tlt-name {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 7px;
  line-height: 1.35;
}

.tlt-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.tlt-row span { color: var(--text); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  :root { --panel-w: 100%; }
  .body { flex-direction: column; }
  .map-pane { height: 55vh; }
  .panel { width: 100%; border-left: none; border-top: 1px solid var(--border); height: 45vh; }
  .nav-stats { display: none; }
  .nav-logo span { display: none; }
}

@media (max-width: 480px) {
  .tabs { gap: 2px; }
  .tab { padding: 5px 10px; font-size: 9px; }
}

/* ── Scene cards (country panel) ── */
.scene-card {
  padding: 8px 12px;
  margin-bottom: 5px;
  background: var(--s2);
  border-radius: 5px;
  cursor: pointer;
  transition: background .15s;
}
.scene-card:hover { background: var(--s3); }
.sc-name   { font-size:12px; font-weight:600; color:var(--text); }
.sc-meta   { font-family:var(--mono); font-size:9px; color:var(--amber); margin-top:2px; }
.sc-genres { font-family:var(--mono); font-size:9px; color:var(--muted); margin-top:2px; line-height:1.5; }
.sc-artists{ font-family:var(--mono); font-size:9px; color:var(--violet); margin-top:2px; }

/* Loading */
.p-loading {
  padding: 24px 16px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .1em;
}
