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

:root {
  --bg:          #050805;
  --bg-surface:  #0a100a;
  --bg-card:     #0b140b;
  --bg-hover:    #0f1f0f;
  --border:      rgba(0, 255, 65, 0.06);
  --border-hi:   rgba(0, 255, 65, 0.2);

  --neon:        #00ff41;
  --neon-50:     rgba(0, 255, 65, 0.5);
  --neon-25:     rgba(0, 255, 65, 0.25);
  --neon-10:     rgba(0, 255, 65, 0.1);
  --neon-05:     rgba(0, 255, 65, 0.05);

  --cyan:        #00e5ff;
  --cyan-50:     rgba(0, 229, 255, 0.5);
  --cyan-15:     rgba(0, 229, 255, 0.15);

  --red:         #ff003c;
  --red-50:      rgba(255, 0, 60, 0.5);
  --red-15:      rgba(255, 0, 60, 0.15);

  --text:        #6a8a6a;
  --text-bright: #b0d8b0;
  --text-dim:    #2a4a2a;
  --text-muted:  #406040;

  --font-mono:   'JetBrains Mono', monospace;
  --font-vt:     'VT323', monospace;
  --radius:      2px;
}

html { font-size: 15px; }

body {
  font-family: var(--font-mono);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ── CRT EFFECTS ──────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 1px,
    rgba(0, 0, 0, 0.035) 1px,
    rgba(0, 0, 0, 0.035) 2px
  );
  pointer-events: none;
  z-index: 10000;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 4, 0, 0.5) 100%);
  pointer-events: none;
  z-index: 9999;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.blink { animation: blink 1s step-end infinite; }

@keyframes flicker {
  0%, 92%, 94%, 97%, 100% { opacity: 1; }
  93% { opacity: 0.82; }
  96% { opacity: 0.9; }
}

/* ── CATALOG HEADER ───────────────────────────────── */
.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo-glyph {
  font-family: var(--font-vt);
  color: var(--neon);
  font-size: 1.8rem;
  line-height: 1;
  text-shadow: 0 0 8px var(--neon-50), 0 0 16px var(--neon-25);
}

.logo-text {
  font-family: var(--font-vt);
  font-size: 2.4rem;
  color: var(--neon);
  letter-spacing: 0.14em;
  animation: flicker 8s linear infinite;
  text-shadow:
    -0.5px 0 rgba(255, 0, 60, 0.35),
    0.5px 0 rgba(0, 229, 255, 0.35),
    0 0 10px var(--neon-50),
    0 0 24px var(--neon-25),
    0 0 48px var(--neon-10);
}

.catalog-meta {
  display: flex;
  gap: 0.5rem;
}

.meta-pill {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--neon-05);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: 1px;
  letter-spacing: 0.04em;
}

/* ── LIVE TERMINAL ─────────────────────────────────── */
.live-section {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.live-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 2.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 6px var(--red-50);
  animation: live-blink 1.5s ease infinite;
}

@keyframes live-blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--red-50), 0 0 14px var(--red-15); }
  50% { opacity: 0.3; box-shadow: none; }
}

.live-label {
  font-family: var(--font-vt);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--red);
  text-shadow: 0 0 8px var(--red-50);
}

.live-terminal {
  background: #000;
}

.live-terminal iframe {
  display: block;
  margin: 0 auto;
}

/* ── TIMELINE FEED ────────────────────────────────── */
.timeline-feed {
  padding: 2rem 2.5rem 6rem;
  min-height: 40vh;
}

.feed-loading {
  text-align: center;
  padding: 4rem 0;
  font-family: var(--font-vt);
  font-size: 1.2rem;
  color: var(--neon);
  text-shadow: 0 0 8px var(--neon-25);
}

.empty-state {
  text-align: center;
  padding: 6rem 2rem;
}

.empty-glyph {
  font-size: 2.5rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-text {
  font-family: var(--font-vt);
  font-size: 1.1rem;
  color: var(--text-dim);
}

/* ── TIMELINE ─────────────────────────────────────── */
.timeline {
  position: relative;
  margin-left: 1.5rem;
  padding-left: 3.5rem;
}

/* The vertical bar */
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--neon),
    var(--neon-25) 15%,
    var(--neon-10) 85%,
    transparent
  );
  box-shadow: 0 0 6px var(--neon-25), 0 0 14px var(--neon-10);
  animation: bar-glow 5s ease-in-out infinite;
}

@keyframes bar-glow {
  0%, 100% { box-shadow: 0 0 4px var(--neon-25), 0 0 8px var(--neon-10); }
  50% { box-shadow: 0 0 8px var(--neon-50), 0 0 18px var(--neon-25); }
}

/* ── TIMELINE ENTRY ───────────────────────────────── */
.tl-entry {
  position: relative;
  padding-bottom: 0.4rem;
  animation: entry-in 0.4s ease both;
}

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

/* ── NODE ─────────────────────────────────────────── */
.tl-node {
  position: absolute;
  left: -3.5rem;
  top: 1rem;
  width: 10px;
  height: 10px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--neon);
  box-shadow: 0 0 6px var(--neon-50), 0 0 14px var(--neon-25);
  z-index: 2;
  transition: background 0.2s, box-shadow 0.2s;
}

/* Connector line from node to card */
.tl-node::after {
  content: '';
  position: absolute;
  left: calc(100% + 2px);
  top: 50%;
  width: calc(3.5rem - 14px);
  height: 1px;
  background: linear-gradient(to right, var(--neon-50), var(--neon-10));
  transition: background 0.2s;
}

.tl-entry:hover .tl-node {
  background: var(--neon);
  box-shadow: 0 0 10px var(--neon), 0 0 22px var(--neon-50), 0 0 40px var(--neon-25);
}

.tl-entry:hover .tl-node::after {
  background: linear-gradient(to right, var(--neon), var(--neon-25));
}

/* ── CARD ─────────────────────────────────────────── */
.tl-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 2px solid var(--neon-25);
  padding: 0.9rem 1.2rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.3s;
  border-radius: var(--radius);
  max-width: 600px;
}

.tl-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-hi);
  border-left-color: var(--neon-50);
  box-shadow:
    0 0 24px var(--neon-05),
    inset 0 0 40px var(--neon-05);
}

.tl-timestamp {
  font-family: var(--font-vt);
  font-size: 1.4rem;
  color: var(--neon);
  text-shadow: 0 0 6px var(--neon-25);
  margin-bottom: 0.5rem;
  letter-spacing: 0.03em;
}

/* ── COMMANDS ─────────────────────────────────────── */
.tl-commands {
  margin-bottom: 0.5rem;
}

.tl-cmd {
  font-size: 0.72rem;
  color: var(--text-bright);
  padding: 0.12rem 0;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 520px;
}

.tl-cmd::before {
  content: '$ ';
  color: var(--neon);
  opacity: 0.45;
}

.tl-cmd-empty {
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 0.12rem 0;
  line-height: 1.5;
}

.tl-cmd-empty::before {
  content: '> ';
  opacity: 0.25;
}

.tl-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.62rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ── GAP ──────────────────────────────────────────── */
.tl-gap {
  position: relative;
  padding: 0.3rem 0;
  margin-left: -2rem;
}

.tl-gap-label {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  padding: 0.1rem 0.5rem;
  background: var(--bg);
  border: 1px dashed rgba(0, 255, 65, 0.08);
  border-radius: 1px;
  display: inline-block;
}

/* ── VISITOR STATS ─────────────────────────────────── */
.stats-section {
  padding: 0 2.5rem 3rem;
}

.stats-inner {
  margin-left: 1.5rem;
  padding-left: 3.5rem;
  border-left: 2px solid var(--neon-05);
  padding-top: 1.5rem;
  max-width: 500px;
}

.stats-label {
  font-family: var(--font-vt);
  font-size: 1rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.stats-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 36px;
  margin-bottom: 0.5rem;
}

.stats-bar {
  flex: 1;
  background: var(--neon);
  opacity: 0.3;
  border-radius: 1px 1px 0 0;
  min-width: 3px;
  transition: opacity 0.15s, box-shadow 0.15s;
}

.stats-bar:hover {
  opacity: 1;
  box-shadow: 0 0 6px var(--neon-50);
}

.stats-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.58rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ── PLAYER VIEW ───────────────────────────────────── */
.player-chrome {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.player-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.5rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.back-btn:hover {
  color: var(--neon);
  border-color: var(--neon-25);
}

.back-arrow { font-size: 0.85rem; }

.now-playing {
  font-family: var(--font-vt);
  font-size: 1.1rem;
  color: var(--neon);
  text-shadow: 0 0 6px var(--neon-25);
}

.player-controls {
  display: flex;
  gap: 0.3rem;
}

.ctrl-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ctrl-btn:hover {
  color: var(--neon);
  border-color: var(--neon-25);
}

.ctrl-btn:disabled {
  opacity: 0.2;
  cursor: default;
}

/* ── PLAYER STAGE ──────────────────────────────────── */
.player-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: #000;
}

#player-container {
  width: 100%;
  height: 100%;
  position: relative;
}

#player-container .ap-wrapper,
#player-container .ap-player {
  width: 100% !important;
  height: 100% !important;
}

/* ── INTERMISSION ──────────────────────────────────── */
.intermission {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 50;
}

.intermission-inner { text-align: center; }

.intermission-time {
  font-family: var(--font-vt);
  font-size: 4rem;
  color: var(--neon);
  text-shadow: 0 0 12px var(--neon-50), 0 0 30px var(--neon-25);
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.intermission-label {
  font-family: var(--font-vt);
  font-size: 1.2rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 2rem;
}

.intermission-next {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.intermission-next span {
  color: var(--cyan);
  text-shadow: 0 0 6px var(--cyan-50);
}

.intermission-countdown {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* ── PLAYER BOTTOM TIMELINE ────────────────────────── */
.player-timeline {
  height: 32px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  padding: 0 1.5rem;
}

.tl-track {
  display: flex;
  height: 100%;
  align-items: center;
  gap: 1px;
}

.tl-seg {
  height: 6px;
  border-radius: 1px;
  transition: height 0.15s;
}

.tl-seg.active { height: 10px; }

.tl-seg.rec {
  background: var(--neon);
  opacity: 0.35;
}

.tl-seg.rec.active { opacity: 1; box-shadow: 0 0 6px var(--neon-50); }
.tl-seg.rec:hover { opacity: 1; height: 12px; }

.player-timeline .tl-gap {
  height: 2px;
  background: var(--border);
  margin-left: 0;
  padding: 0;
}

.tl-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--neon);
  box-shadow: 0 0 6px var(--neon-50);
  pointer-events: none;
  transition: left 0.3s ease;
  display: none;
}

/* ── SCROLLBAR ─────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--neon-10); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--neon-25); }

/* ── RESPONSIVE ────────────────────────────────────── */
@media (max-width: 640px) {
  .catalog-header { padding: 0.8rem 1.2rem; }
  .live-header { padding: 0.5rem 1.2rem; }
  .timeline-feed { padding: 1.5rem 1rem 4rem; }
  .timeline { margin-left: 0.5rem; padding-left: 2.5rem; }
  .tl-node { left: -2.5rem; }
  .tl-node::after { width: calc(2.5rem - 14px); }
  .tl-card { max-width: none; }
  .tl-cmd { max-width: none; }
  .player-top-bar { padding: 0.5rem 1rem; }
  .tl-gap { margin-left: -1rem; }
}
