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

:root {
  --bg: #0a0a0c;
  --surface: #111115;
  --border: #1e1e24;
  --border-hover: #3a3a4a;
  --text: #e8e8f0;
  --muted: #5a5a6e;
  --accent: #7b6cff;
  --accent-soft: rgba(123, 108, 255, 0.12);
  --accent-glow: rgba(123, 108, 255, 0.3);
  --red: #ff4f4f;
  --red-soft: rgba(255, 79, 79, 0.1);
  --green: #4fff8a;
  --green-soft: rgba(79, 255, 138, 0.08);
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Mono', monospace;
  overflow-x: hidden;
}

/* Loading screen */
#loading-screen {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  transition: opacity 1s;
}

#loading-text {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(48px, 12vw, 72px);
  color: #fff;
  opacity: 0;
  animation: ps2IntroFade 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes ps2IntroFade {
  0%   { opacity: 0; text-shadow: 0 0 50px #2196f3, 0 0 10px #2196f3, 0 0 2px #fff; filter: blur(20px); }
  40%  { opacity: 1; text-shadow: 0 0 2px #fff; filter: none; }
  85%  { opacity: 1; text-shadow: 0 0 2px #fff; filter: none; }
  100% { opacity: 0; }
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 100;
  opacity: 0.5;
}

/* Ambient glow */
body::after {
  content: '';
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(123,108,255,0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 64px 24px 80px;
}

.page-layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.main-col {
  flex: 1;
  min-width: 0;
}

.sidebar-col {
  width: 380px;
  flex-shrink: 0;
  position: sticky;
  top: 32px;
}

/* Hide mobile video label/wrap on desktop, hide sidebar on mobile */
.latest-video-mobile-label,
.latest-video-mobile { display: none; }

@media (max-width: 780px) {
  .page-layout { flex-direction: column; }
  .sidebar-col { display: none; }
  .latest-video-mobile-label,
  .latest-video-mobile { display: block; }
}

/* Header */
.header {
  margin-bottom: 48px;
  animation: fadeUp 0.6s ease both;
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 24px var(--accent-glow);
  overflow: hidden;
  padding: 4px;
}

.name-block h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.5px;
  line-height: 1;
  color: var(--text);
}

.name-block .handle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0.05em;
}

.bio {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 400px;
}

/* Section label */
.section-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  margin-top: 36px;
}

/* Link cards */
.links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  animation: fadeUp 0.6s ease both;
}

.link-card:hover {
  border-color: var(--border-hover);
  background: #14141a;
  transform: translateY(-1px);
}

.link-card.accent-yt:hover     { border-color: rgba(255,79,79,0.5);    background: var(--red-soft); }
.link-card.accent-twitch:hover { border-color: rgba(145,71,255,0.5);   background: rgba(145,71,255,0.07); }
.link-card.accent-gh:hover     { border-color: rgba(232,232,240,0.2);  background: rgba(255,255,255,0.03); }
.link-card.accent-dc:hover     { border-color: rgba(88,101,242,0.5);   background: rgba(88,101,242,0.07); }

.link-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.link-icon svg { width: 18px; height: 18px; }

.link-icon.yt     { background: var(--red-soft); }
.link-icon.twitch { background: rgba(145,71,255,0.1); }
.link-icon.gh     { background: rgba(255,255,255,0.05); }
.link-icon.dc     { background: rgba(88,101,242,0.1); }

.link-text { flex: 1; }
.link-text strong { display: block; font-size: 14px; font-weight: 500; font-family: 'Syne', sans-serif; }
.link-text span   { font-size: 11px; color: var(--muted); }

.link-arrow {
  color: var(--muted);
  font-size: 14px;
  transition: transform 0.2s, color 0.2s;
}
.link-card:hover .link-arrow { transform: translateX(3px); color: var(--text); }

/* Expandable card */
.expand-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  animation: fadeUp 0.6s ease both;
  transition: border-color 0.2s;
}

.expand-card:hover { border-color: var(--border-hover); }

.expand-trigger {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  text-align: left;
}

.expand-trigger:hover { background: rgba(255,255,255,0.02); }

.expand-chevron {
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.25s;
  font-size: 12px;
}

.expand-card.open .expand-chevron { transform: rotate(180deg); }

.expand-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.expand-card.open .expand-body { max-height: 600px; }

.expand-inner {
  padding: 0 18px 18px;
  border-top: 1px solid var(--border);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 24px;
  padding-top: 14px;
}

.settings-grid.single { grid-template-columns: 1fr; }

.setting-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.setting-key {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.setting-val {
  font-size: 13px;
  color: var(--text);
}

.setting-val.accent { color: var(--accent); }

.spec-category { margin-top: 14px; }

.spec-cat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

/* Animation delays for stagger */
.d1 { animation-delay: 0.05s; }
.d2 { animation-delay: 0.10s; }
.d3 { animation-delay: 0.15s; }
.d4 { animation-delay: 0.20s; }
.d5 { animation-delay: 0.25s; }
.d6 { animation-delay: 0.30s; }
.d7 { animation-delay: 0.35s; }
.d8 { animation-delay: 0.40s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.footer {
  margin-top: 56px;
  text-align: center;
  font-size: 11px;
  color: #2a2a35;
  animation: fadeUp 0.6s 0.5s ease both;
}

/* Discord popup */
.dc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.dc-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.dc-popup {
  background: #16161c;
  border: 1px solid var(--border-hover);
  border-radius: 14px;
  padding: 28px 24px 24px;
  max-width: 340px;
  width: 100%;
  transform: translateY(12px);
  transition: transform 0.2s ease;
}

.dc-overlay.visible .dc-popup {
  transform: translateY(0);
}

.dc-popup-icon {
  width: 48px;
  height: 48px;
  background: rgba(88,101,242,0.12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.dc-popup-title {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.dc-popup-msg {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 22px;
}

.dc-handle {
  color: var(--text);
  font-weight: 500;
}

.dc-handle-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dc-copy-btn {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid var(--border-hover);
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.dc-copy-btn:hover {
  border-color: var(--text);
  color: var(--text);
}

.dc-copy-btn.copied {
  border-color: var(--green);
  color: var(--green);
}

.dc-popup-btns {
  display: flex;
  gap: 10px;
}

.dc-btn-back {
  flex: 1;
  padding: 10px;
  background: none;
  border: 1px solid var(--border-hover);
  border-radius: 8px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.dc-btn-back:hover {
  border-color: var(--text);
  color: var(--text);
}

.dc-btn-proceed {
  flex: 1;
  padding: 10px;
  background: rgba(88,101,242,0.15);
  border: 1px solid rgba(88,101,242,0.4);
  border-radius: 8px;
  color: #8b97ff;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s, border-color 0.2s;
}

.dc-btn-proceed:hover {
  background: rgba(88,101,242,0.25);
  border-color: rgba(88,101,242,0.7);
}

/* ── Music page ────────────────────────────────────────────── */

.search-wrap {
  position: relative;
  margin-bottom: 24px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}

#search {
  width: 100%;
  padding: 12px 14px 12px 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

#search::placeholder { color: var(--muted); }
#search:focus { border-color: var(--border-hover); }

.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
  transition: border-color 0.2s;
  animation: fadeUp 0.6s ease both;
}

.video-card:hover { border-color: var(--border-hover); }

.video-card.highlight {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.video-trigger {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  cursor: pointer;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  text-align: left;
}

.video-trigger:hover { background: rgba(255,255,255,0.02); }

.video-num {
  font-size: 11px;
  color: var(--muted);
  min-width: 24px;
}

.video-info { flex: 1; }

.video-title {
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: block;
}

.video-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.video-chevron {
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.25s;
}

.video-card.open .video-chevron { transform: rotate(180deg); }

.video-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.video-card.open .video-body { max-height: 400px; }

.video-inner {
  border-top: 1px solid var(--border);
  padding: 14px 18px 18px;
}

.track-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.track {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 7px;
  transition: background 0.15s;
  text-decoration: none;
}

.track:hover { background: rgba(255,255,255,0.04); }

.track-index {
  font-size: 11px;
  color: var(--muted);
  min-width: 20px;
  text-align: right;
}

.track-info { flex: 1; }

.track-name {
  font-size: 13px;
  color: var(--text);
  display: block;
}

.track-artist {
  font-size: 11px;
  color: var(--muted);
}

.track-link {
  font-size: 11px;
  color: var(--accent);
  opacity: 0.7;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.track:hover .track-link { opacity: 1; }

.no-results {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 48px 0;
  display: none;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 36px;
  transition: color 0.2s;
}

.back-link:hover { color: var(--text); }

.copy-anchor {
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 5px;
  transition: color 0.2s, background 0.2s;
  line-height: 1;
}

.copy-anchor:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.copy-anchor.copied { color: var(--green); }

/* ── Latest video ──────────────────────────────────────────── */

.latest-video-wrap {
  border-radius: 10px;
  overflow: hidden;
}

.latest-video-loading {
  font-size: 12px;
  color: var(--muted);
  padding: 16px 0;
}

.latest-video-title {
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.latest-video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}

.latest-video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 10px;
}
