/* ================================================================
   ALIEN RADIO — Futuristic Sci-Fi HUD Stylesheet
   ================================================================ */

:root {
  --neon-cyan:    #00fff7;
  --neon-green:   #00ff88;
  --neon-purple:  #cc44ff;
  --neon-orange:  #ff8800;
  --neon-red:     #ff2244;
  --neon-blue:    #0088ff;
  --bg-deep:      #040810;
  --bg-dark:      #060d1a;
  --bg-panel:     #0a1428;
  --bg-card:      #0d1e38;
  --border-dim:   rgba(0, 255, 247, 0.15);
  --border-glow:  rgba(0, 255, 247, 0.55);
  --text-primary: #c8f0ff;
  --text-dim:     #4a7a99;
  --font-mono:    'Share Tech Mono', 'Courier New', monospace;
  --font-hud:     'Orbitron', 'Arial', sans-serif;
}

/* Fonts are loaded via <link> in HTML for optimal performance */

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

html { font-size: 14px; scroll-behavior: smooth; }

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-mono);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Starfield background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(0,255,247,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 55%, rgba(200,240,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 20%, rgba(204,68,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 80%, rgba(0,255,136,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 40%, rgba(200,240,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 20% 90%, rgba(0,136,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 95% 10%, rgba(0,255,247,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 70%, rgba(200,240,255,0.2) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* Scanline overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* ── Layout ── */
#app { position: relative; z-index: 2; }

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ── Header ── */
.site-header {
  border-bottom: 1px solid var(--border-dim);
  background: linear-gradient(180deg, rgba(0,255,247,0.04) 0%, transparent 100%);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-symbol {
  font-size: 2rem;
  animation: pulse-symbol 2s ease-in-out infinite;
}

@keyframes pulse-symbol {
  0%, 100% { filter: drop-shadow(0 0 6px var(--neon-cyan)); opacity: 1; }
  50%       { filter: drop-shadow(0 0 18px var(--neon-cyan)); opacity: 0.85; }
}

.logo-title {
  font-family: var(--font-hud);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.25em;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}

.logo-subtitle {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green);
  animation: blink 1.4s step-end infinite;
}

.dot.orange { background: var(--neon-orange); box-shadow: 0 0 8px var(--neon-orange); animation-delay: 0.5s; }
.dot.purple { background: var(--neon-purple); box-shadow: 0 0 8px var(--neon-purple); animation-delay: 1s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 1; }
  40% { opacity: 0.2; }
}

.header-time {
  font-family: var(--font-hud);
  font-size: 0.75rem;
  color: var(--neon-cyan);
  letter-spacing: 0.1em;
}

/* ── Daily metals ticker ── */
.metals-ticker {
  background: linear-gradient(90deg, transparent, rgba(255,136,0,0.08), transparent);
  border-top: 1px solid rgba(255,136,0,0.2);
  border-bottom: 1px solid rgba(255,136,0,0.2);
  padding: 0.3rem 0;
  overflow: hidden;
  position: relative;
}

.ticker-track {
  display: flex;
  gap: 3rem;
  animation: ticker-scroll 40s linear infinite;
  white-space: nowrap;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--neon-orange);
}

.ticker-label { color: var(--text-dim); }
.ticker-value { color: var(--neon-orange); }
.ticker-up    { color: var(--neon-green); }
.ticker-down  { color: var(--neon-red); }

.metals-ticker::before,
.metals-ticker::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 60px;
  z-index: 2;
  pointer-events: none;
}
.metals-ticker::before { left: 0; background: linear-gradient(90deg, var(--bg-deep), transparent); }
.metals-ticker::after  { right: 0; background: linear-gradient(-90deg, var(--bg-deep), transparent); }

/* ── Main grid ── */
.main-grid {
  display: grid;
  grid-template-columns: 280px 1fr 300px;
  grid-template-rows: auto;
  gap: 1rem;
  padding: 1rem;
  min-height: calc(100vh - 120px);
}

@media (max-width: 1100px) {
  .main-grid { grid-template-columns: 1fr 1fr; }
  .col-right  { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .main-grid { grid-template-columns: 1fr; }
}

/* ── HUD Panel card ── */
.hud-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.hud-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border-dim);
  font-family: var(--font-hud);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--neon-cyan);
}

.panel-title-group { display: flex; align-items: center; gap: 0.5rem; }
.panel-icon { font-size: 0.9rem; }

.panel-badge {
  background: rgba(0,255,247,0.1);
  border: 1px solid rgba(0,255,247,0.3);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  font-size: 0.6rem;
  color: var(--neon-cyan);
}

.panel-body { padding: 0.75rem; }

/* ── Channel Scanner ── */
.scanner-display {
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  padding: 1rem;
  text-align: center;
  margin-bottom: 0.75rem;
  position: relative;
  overflow: hidden;
}

.scanner-display::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,255,247,0.04) 0%, transparent 50%);
  pointer-events: none;
}

.freq-display {
  font-family: var(--font-hud);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--neon-cyan);
  text-shadow: 0 0 20px rgba(0,255,247,0.7);
  letter-spacing: 0.05em;
  line-height: 1.1;
}

.freq-unit {
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.2em;
  margin-top: 0.2rem;
}

.channel-name {
  font-family: var(--font-hud);
  font-size: 0.75rem;
  color: var(--neon-green);
  letter-spacing: 0.15em;
  margin-top: 0.5rem;
  text-transform: uppercase;
}

.signal-bar-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.6rem;
  justify-content: center;
}

.sig-bar {
  width: 6px;
  border-radius: 2px;
  background: rgba(0,255,247,0.15);
  transition: all 0.3s ease;
}

.sig-bar.active { background: var(--neon-cyan); box-shadow: 0 0 6px rgba(0,255,247,0.6); }

/* Scanner controls */
.scanner-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.hud-btn {
  background: rgba(0,255,247,0.05);
  border: 1px solid rgba(0,255,247,0.2);
  border-radius: 4px;
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  padding: 0.4rem 0.3rem;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s ease;
  text-align: center;
}

.hud-btn:hover {
  background: rgba(0,255,247,0.12);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0,255,247,0.2), inset 0 0 10px rgba(0,255,247,0.05);
  color: #fff;
}

.hud-btn.active {
  background: rgba(0,255,247,0.18);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 14px rgba(0,255,247,0.35);
}

.hud-btn.green { color: var(--neon-green); border-color: rgba(0,255,136,0.2); }
.hud-btn.green:hover { background: rgba(0,255,136,0.12); border-color: var(--neon-green); box-shadow: 0 0 10px rgba(0,255,136,0.2); }
.hud-btn.orange { color: var(--neon-orange); border-color: rgba(255,136,0,0.2); }
.hud-btn.orange:hover { background: rgba(255,136,0,0.12); border-color: var(--neon-orange); box-shadow: 0 0 10px rgba(255,136,0,0.2); }
.hud-btn.red { color: var(--neon-red); border-color: rgba(255,34,68,0.2); }
.hud-btn.red:hover { background: rgba(255,34,68,0.12); border-color: var(--neon-red); }
.hud-btn.full { grid-column: 1 / -1; }

/* Volume knob */
.volume-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.vol-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  min-width: 35px;
}

.vol-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: rgba(0,255,247,0.15);
  border-radius: 2px;
  outline: none;
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
  cursor: pointer;
}

.vol-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
  cursor: pointer;
  border: none;
}

/* Channel list */
.channel-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.channel-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  font-size: 0.7rem;
}

.channel-item:hover {
  background: rgba(0,255,247,0.05);
  border-color: var(--border-dim);
}

.channel-item.active {
  background: rgba(0,255,247,0.08);
  border-color: rgba(0,255,247,0.3);
}

.ch-num {
  font-family: var(--font-hud);
  font-size: 0.6rem;
  color: var(--text-dim);
  min-width: 22px;
}

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

.ch-info { flex: 1; min-width: 0; }

.ch-name {
  color: var(--text-primary);
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-freq {
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}

.ch-sig {
  font-family: var(--font-hud);
  font-size: 0.6rem;
  color: var(--text-dim);
}

/* ── Centre: Visualizer + Now Playing ── */
.col-center { display: flex; flex-direction: column; gap: 1rem; }

.now-playing-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.now-playing-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-green), transparent);
}

.np-art {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: conic-gradient(
    var(--neon-purple) 0deg,
    var(--neon-cyan) 120deg,
    var(--neon-green) 240deg,
    var(--neon-purple) 360deg
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
  animation: spin-art 8s linear infinite paused;
  box-shadow: 0 0 20px rgba(204,68,255,0.4);
}

.np-art.playing { animation-play-state: running; }

@keyframes spin-art {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.np-info { flex: 1; }
.np-channel {
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-family: var(--font-hud);
}
.np-title {
  font-family: var(--font-hud);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.08em;
  margin: 0.2rem 0;
}
.np-artist { font-size: 0.7rem; color: var(--text-dim); }

.np-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.np-btn {
  background: none;
  border: 1px solid rgba(0,255,247,0.2);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.np-btn:hover { color: var(--neon-cyan); border-color: var(--neon-cyan); box-shadow: 0 0 10px rgba(0,255,247,0.3); }
.np-btn.play-btn {
  width: 42px; height: 42px;
  background: rgba(0,255,247,0.1);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  font-size: 1.1rem;
}
.np-btn.play-btn:hover { background: rgba(0,255,247,0.2); box-shadow: 0 0 16px rgba(0,255,247,0.4); }

/* ── Visualizer Canvas ── */
.visualizer-wrap {
  position: relative;
  flex: 1;
}

#visualizer {
  width: 100%;
  height: 220px;
  display: block;
  background: var(--bg-deep);
  border-radius: 4px;
  border: 1px solid var(--border-dim);
}

.vis-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  border-radius: 4px;
}

.vis-overlay::before {
  content: 'SPECTRUM ANALYSIS';
  position: absolute;
  top: 6px; left: 10px;
  font-family: var(--font-hud);
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  color: rgba(0,255,247,0.3);
}

.vis-type-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.vis-type-btn {
  background: rgba(0,255,247,0.04);
  border: 1px solid rgba(0,255,247,0.15);
  border-radius: 3px;
  color: var(--text-dim);
  font-size: 0.62rem;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  transition: all 0.15s ease;
}

.vis-type-btn:hover, .vis-type-btn.active {
  background: rgba(0,255,247,0.1);
  border-color: rgba(0,255,247,0.4);
  color: var(--neon-cyan);
}

/* ── AI Dashboard ── */
.ai-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ai-card {
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  padding: 0.5rem 0.6rem;
  position: relative;
  overflow: hidden;
  cursor: default;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.ai-card:hover {
  border-color: rgba(0,255,247,0.35);
  box-shadow: 0 0 12px rgba(0,255,247,0.1);
}

.ai-card.active-ai {
  border-color: rgba(0,255,136,0.4);
  box-shadow: 0 0 14px rgba(0,255,136,0.15);
}

.ai-symbol {
  font-size: 1.1rem;
  line-height: 1;
  margin-bottom: 0.2rem;
}

.ai-name {
  font-family: var(--font-hud);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--neon-cyan);
  text-transform: uppercase;
}

.ai-role {
  font-size: 0.58rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
  line-height: 1.3;
}

.ai-progress {
  height: 2px;
  background: rgba(0,255,247,0.1);
  border-radius: 1px;
  margin-top: 0.4rem;
  overflow: hidden;
}

.ai-progress-bar {
  height: 100%;
  border-radius: 1px;
  background: var(--neon-green);
  width: 0%;
  transition: width 0.6s ease;
}

.ai-status-text {
  font-size: 0.55rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
  font-family: var(--font-mono);
}

/* ── Giro Quantum Core ── */
.giro-core-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem 0;
}

.giro-core {
  position: relative;
  width: 120px;
  height: 120px;
}

.giro-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

.ring-1 {
  width: 120px; height: 120px;
  border-color: rgba(0,255,247,0.3);
  animation: ring-spin 6s linear infinite;
  box-shadow: 0 0 10px rgba(0,255,247,0.15);
}
.ring-2 {
  width: 90px; height: 90px;
  border-color: rgba(204,68,255,0.4);
  animation: ring-spin 4s linear infinite reverse;
}
.ring-3 {
  width: 60px; height: 60px;
  border-color: rgba(0,255,136,0.35);
  animation: ring-spin 3s linear infinite;
}

@keyframes ring-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

.ring-1::before, .ring-2::before, .ring-3::before {
  content: '';
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  top: -3px; left: 50%;
  transform: translateX(-50%);
}

.ring-1::before { background: var(--neon-cyan); box-shadow: 0 0 8px var(--neon-cyan); }
.ring-2::before { background: var(--neon-purple); box-shadow: 0 0 8px var(--neon-purple); }
.ring-3::before { background: var(--neon-green); box-shadow: 0 0 8px var(--neon-green); }

.giro-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 28px; height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,255,247,0.5), rgba(0,255,247,0.05));
  box-shadow: 0 0 20px rgba(0,255,247,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

/* ── Verified commit feed ── */
.commit-feed {
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,136,0,0.3) transparent;
}

.commit-feed::-webkit-scrollbar { width: 4px; }
.commit-feed::-webkit-scrollbar-track { background: transparent; }
.commit-feed::-webkit-scrollbar-thumb { background: rgba(255,136,0,0.3); border-radius: 2px; }

.tx-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255,136,0,0.08);
  font-size: 0.63rem;
  animation: tx-appear 0.4s ease-out;
}

@keyframes tx-appear {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tx-icon { font-size: 0.8rem; flex-shrink: 0; }
.tx-hash { font-family: var(--font-mono); color: var(--neon-orange); font-size: 0.6rem; }
.tx-action { color: var(--text-dim); font-size: 0.58rem; }
.tx-value { color: var(--neon-green); font-family: var(--font-hud); font-size: 0.6rem; margin-top: 0.1rem; }

/* ── Signal Meter ── */
.signal-meters { display: flex; flex-direction: column; gap: 0.4rem; }

.sig-meter-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.62rem;
}

.sig-meter-label { color: var(--text-dim); min-width: 55px; }

.sig-meter-bar {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}

.sig-meter-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}

.fill-cyan   { background: linear-gradient(90deg, rgba(0,255,247,0.4), var(--neon-cyan)); box-shadow: 0 0 6px rgba(0,255,247,0.4); }
.fill-green  { background: linear-gradient(90deg, rgba(0,255,136,0.4), var(--neon-green)); }
.fill-purple { background: linear-gradient(90deg, rgba(204,68,255,0.4), var(--neon-purple)); }
.fill-orange { background: linear-gradient(90deg, rgba(255,136,0,0.4), var(--neon-orange)); }

.sig-meter-val {
  font-family: var(--font-hud);
  font-size: 0.6rem;
  min-width: 34px;
  text-align: right;
  color: var(--neon-cyan);
}

/* ── Scanning animation ── */
.scan-line {
  height: 100%;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--neon-cyan), transparent);
  position: absolute;
  top: 0;
  animation: scan 3s linear infinite;
  opacity: 0.4;
  pointer-events: none;
}

@keyframes scan {
  from { left: 0; }
  to   { left: 100%; }
}

/* ── Waveform mini strip ── */
.mini-wave {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 24px;
}

.wave-bar {
  flex: 1;
  background: var(--neon-cyan);
  border-radius: 1px 1px 0 0;
  opacity: 0.7;
  transition: height 0.15s ease;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border-dim);
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--text-dim); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--neon-cyan); }

/* ── Scrollbar global ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(0,255,247,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,255,247,0.4); }

/* ── Utility ── */
.text-cyan   { color: var(--neon-cyan); }
.text-green  { color: var(--neon-green); }
.text-purple { color: var(--neon-purple); }
.text-orange { color: var(--neon-orange); }
.text-red    { color: var(--neon-red); }
.text-dim    { color: var(--text-dim); }

.mt-1 { margin-top: 0.4rem; }
.mt-2 { margin-top: 0.75rem; }
.divider {
  border: none;
  border-top: 1px solid var(--border-dim);
  margin: 0.6rem 0;
}

/* ── Tooltip ── */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,20,40,0.95);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.6rem;
  white-space: nowrap;
  color: var(--text-primary);
  pointer-events: none;
  z-index: 999;
}

/* ── Modal overlay ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 16, 0.85);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 0 40px rgba(0,255,247,0.15);
  position: relative;
}

.modal-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  border-radius: 8px 8px 0 0;
}

.modal-title {
  font-family: var(--font-hud);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--neon-cyan);
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover { color: var(--neon-cyan); }

.modal-option-list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }

.modal-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--border-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.72rem;
  color: var(--text-primary);
}

.modal-option:hover {
  background: rgba(0,255,247,0.07);
  border-color: rgba(0,255,247,0.35);
  color: var(--neon-cyan);
}

.option-icon { font-size: 1rem; }
.option-label { font-family: var(--font-hud); font-size: 0.68rem; letter-spacing: 0.08em; }
.option-desc { font-size: 0.58rem; color: var(--text-dim); margin-top: 0.1rem; }

/* ── Notification toast ── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-end;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 5px;
  padding: 0.5rem 0.85rem;
  font-size: 0.68rem;
  color: var(--text-primary);
  box-shadow: 0 0 20px rgba(0,255,247,0.1);
  animation: toast-in 0.3s ease, toast-out 0.3s ease 2.7s forwards;
  max-width: 280px;
}

.toast .toast-icon { margin-right: 0.4rem; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateX(20px); }
}

/* ══════════════════════════════════════════════════════════════════
   HAMBURGER DRAWER
══════════════════════════════════════════════════════════════════ */
.ham-btn {
  background: none;
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  color: var(--neon-cyan);
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.ham-btn:hover { background: rgba(0,255,247,0.08); border-color: var(--border-glow); }
.ham-icon { display: block; }

.ham-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4,8,16,0.65);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.ham-overlay.open { opacity: 1; pointer-events: all; }

.ham-drawer {
  position: fixed;
  top: 0; left: 0;
  width: 270px;
  height: 100%;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-glow);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  scrollbar-width: thin;
}
.ham-drawer.open { transform: translateX(0); }

.ham-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border-dim);
}
.ham-brand {
  font-family: var(--font-hud);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--neon-cyan);
}
.ham-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: color 0.2s;
}
.ham-close:hover { color: var(--neon-cyan); }

.ham-section-label {
  padding: 0.6rem 1rem 0.15rem;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-family: var(--font-hud);
}
.ham-link {
  display: block;
  padding: 0.55rem 1rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.75rem;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}
.ham-link:hover { background: rgba(0,255,247,0.07); color: var(--neon-cyan); }
.ham-divider { height: 1px; background: var(--border-dim); margin: 0.5rem 0; }
.ham-footer {
  margin-top: auto;
  padding: 1rem;
  font-size: 0.58rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  border-top: 1px solid var(--border-dim);
}

/* ══════════════════════════════════════════════════════════════════
   HEADER — left / right groups
══════════════════════════════════════════════════════════════════ */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-left  { display: flex; align-items: center; gap: 0.75rem; }
.header-right { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

/* User badge */
.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.65rem;
}
.user-badge-name {
  font-family: var(--font-hud);
  font-size: 0.65rem;
  color: var(--neon-cyan);
  letter-spacing: 0.08em;
}
.user-token-count {
  font-family: var(--font-hud);
  font-size: 0.65rem;
  color: var(--neon-orange);
  min-width: 40px;
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════════
   AUTH MODAL
══════════════════════════════════════════════════════════════════ */
.auth-modal { max-width: 380px; }

.auth-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.auth-tab {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--font-hud);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  padding: 0.35rem;
  text-transform: uppercase;
  transition: all 0.2s;
}
.auth-tab.active,
.auth-tab:hover {
  background: rgba(0,255,247,0.1);
  border-color: var(--border-glow);
  color: var(--neon-cyan);
}

.auth-form-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.auth-label {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-family: var(--font-hud);
}
.auth-input {
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.45rem 0.65rem;
  transition: border-color 0.2s;
  width: 100%;
}
.auth-input:focus { outline: none; border-color: var(--border-glow); }

.auth-actions { margin-bottom: 0.5rem; }

.auth-msg {
  font-size: 0.65rem;
  min-height: 1.2em;
  color: var(--neon-red);
  font-family: var(--font-mono);
}
.auth-msg.ok { color: var(--neon-green); }

/* ══════════════════════════════════════════════════════════════════
   WALLET MODAL
══════════════════════════════════════════════════════════════════ */
.wallet-modal-box { max-width: 440px; }
.wallet-not-logged { color: var(--text-dim); font-size: 0.75rem; padding: 0.5rem 0; }

.wallet-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(255,136,0,0.1), rgba(0,255,247,0.05));
  border: 1px solid rgba(255,136,0,0.25);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.wallet-symbol { font-size: 2.5rem; }
.wallet-tokens {
  font-family: var(--font-hud);
  font-size: 2rem;
  font-weight: 900;
  color: var(--neon-orange);
  line-height: 1;
}
.wallet-token-label {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  margin-top: 0.15rem;
}
.wallet-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.wallet-stat {
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  padding: 0.5rem 0.65rem;
}
.wallet-stat-label {
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-family: var(--font-hud);
  margin-bottom: 0.15rem;
}
.wallet-stat-val {
  font-family: var(--font-hud);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--neon-cyan);
}

.wallet-progress {
  margin-bottom: 0.75rem;
}
.wallet-progress-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  font-family: var(--font-hud);
  margin-bottom: 0.3rem;
  display: flex;
  justify-content: space-between;
}
.wallet-progress-bar {
  height: 6px;
  background: rgba(0,255,247,0.1);
  border-radius: 3px;
  overflow: hidden;
}
.wallet-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-green));
  border-radius: 3px;
  transition: width 0.6s ease;
  box-shadow: 0 0 8px rgba(0,255,247,0.5);
}

/* ══════════════════════════════════════════════════════════════════
   RESEARCH MODAL
══════════════════════════════════════════════════════════════════ */
.research-overlay {}
.research-modal-box {
  max-width: 760px;
  width: 95%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
}
.research-modal-body {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,255,247,0.2) transparent;
  margin-top: 0.5rem;
}

/* Research article typography */
.research-article { font-family: var(--font-mono); color: var(--text-primary); }
.research-header { margin-bottom: 1.25rem; }
.research-meta-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.research-medium,
.research-era,
.research-network {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--font-hud);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  border: 1px solid var(--border-dim);
}
.research-medium { color: var(--neon-cyan); border-color: rgba(0,255,247,0.3); }
.research-era    { color: var(--neon-green); border-color: rgba(0,255,136,0.3); }
.research-network{ color: var(--neon-orange); border-color: rgba(255,136,0,0.3); }

.research-title {
  font-family: var(--font-hud);
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--neon-cyan);
  margin-bottom: 0.3rem;
  line-height: 1.2;
}
.research-subtitle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 400;
  margin-bottom: 0.6rem;
  font-style: italic;
}
.research-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.research-tag {
  font-size: 0.58rem;
  background: rgba(204,68,255,0.1);
  border: 1px solid rgba(204,68,255,0.3);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  color: var(--neon-purple);
  font-family: var(--font-hud);
}

.research-abstract,
.research-section {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-dim);
}
.research-section-heading {
  font-family: var(--font-hud);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: var(--neon-green);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.research-section-body {
  font-size: 0.76rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.research-links-section { margin-bottom: 1rem; }
.research-links-list { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.5rem; }
.research-link {
  color: var(--neon-cyan);
  text-decoration: none;
  font-size: 0.72rem;
  transition: color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.research-link:hover { color: var(--neon-green); text-decoration: underline; }

.research-footer {
  font-size: 0.58rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  padding-top: 0.5rem;
  font-family: var(--font-hud);
  border-top: 1px solid var(--border-dim);
}

/* ══════════════════════════════════════════════════════════════════
   MINI-GAME MODAL
══════════════════════════════════════════════════════════════════ */
.minigame-box { max-width: 380px; }
.minigame-body {}
.minigame-arena {
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-radius: 6px;
  height: 160px;
  position: relative;
  overflow: hidden;
  margin-bottom: 0.75rem;
  cursor: crosshair;
}
.minigame-node {
  position: absolute;
  font-size: 1.6rem;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s;
  animation: float-node 2.5s ease-in-out infinite;
  filter: drop-shadow(0 0 8px var(--neon-cyan));
  line-height: 1;
}
.minigame-node:hover { transform: scale(1.3); }
@keyframes float-node {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
.minigame-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.68rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.minigame-stats strong { color: var(--neon-cyan); }

/* ══════════════════════════════════════════════════════════════════
   TOKEN ACTION BAR (sticky bottom)
══════════════════════════════════════════════════════════════════ */
.token-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: 82px;
  background: linear-gradient(180deg, transparent 0%, rgba(4,8,16,0.97) 30%);
  border-top: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  z-index: 150;
  padding: 0 1rem;
  backdrop-filter: blur(12px);
}

.tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  flex: 1 1 0;
  max-width: 180px;
  min-width: 0;
  min-height: 58px;
  padding: 0.55rem 0.7rem;
  font-family: var(--font-hud);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.2s ease;
  position: relative;
  text-decoration: none;
}
.tab-btn:hover {
  background: rgba(0,255,247,0.1);
  border-color: var(--border-glow);
  color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0,255,247,0.2);
  transform: translateY(-2px);
}
.tab-icon { font-size: 1.35rem; line-height: 1; }
.tab-label { font-size: 0.64rem; line-height: 1.15; text-align: center; }
.tab-count {
  position: absolute;
  top: -6px; right: -6px;
  background: var(--neon-orange);
  color: var(--bg-deep);
  font-size: 0.5rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 0.1rem 0.3rem;
  min-width: 18px;
  text-align: center;
  font-family: var(--font-hud);
}
.tab-token  { border-color: rgba(255,136,0,0.3); }
.tab-token:hover  { border-color: var(--neon-orange); color: var(--neon-orange); box-shadow: 0 0 12px rgba(255,136,0,0.3); }
.tab-projects { border-color: rgba(0,255,247,.38); }
.tab-research { border-color: rgba(0,255,136,.35); }
.tab-build { border-color: rgba(255,136,0,.4); }
.tab-commits { border-color: rgba(204,68,255,.4); }
.tab-mushroom-icon { animation: mushroom-pulse 2.5s ease-in-out infinite; }
@keyframes mushroom-pulse {
  0%, 100% { filter: drop-shadow(0 0 4px var(--neon-green)); }
  50%       { filter: drop-shadow(0 0 12px var(--neon-green)) brightness(1.3); }
}
.tab-mint { border-color: rgba(255,136,0,0.3); }
.tab-mint:hover { border-color: var(--neon-orange); color: var(--neon-orange); box-shadow: 0 0 12px rgba(255,136,0,0.3); }

/* push page content above the token bar */
body { padding-bottom: 94px; }

/* adjust toast position above token bar */
#toast-container { bottom: 100px; }

@media (max-width: 540px) {
  .token-action-bar { gap: .28rem; padding: 0 .35rem; }
  .tab-btn { min-height: 62px; padding: .45rem .22rem; }
  .tab-icon { font-size: 1.15rem; }
  .tab-label { font-size: .48rem; letter-spacing: .04em; }
}


/* Real market and repository data */
.ticker-unit { color: var(--text-dim); font-size: .62rem; }
.commit-item { color: inherit; text-decoration: none; display: flex; }
.commit-item:hover { border-color: var(--border-glow); background: rgba(0,255,247,.05); }


/* Piano-only mode: no blinking, spinning, pulsing, scanning, or flicker. */
.logo-symbol, .dot, .np-art, .giro-ring, .scan-line,
.ring-1, .ring-2, .ring-3, .ticker-track {
  animation: none !important;
}
