/* ============================================================
   Rares — Canal cu de toate | temă albastră, pixelată
   Layout canal tip YouTube: banner → pfp → nume → @handle →
   abonați + ultimul video → videoclipuri → playlisturi
   ============================================================ */

:root {
  --bg: #070d1f;
  --bg-2: #0a1428;
  --panel: #0e1c3d;
  --panel-2: #12244f;
  --line: #1e3a6e;
  --blue: #3b82f6;
  --blue-2: #60a5fa;
  --blue-3: #2563eb;
  --blue-dark: #1e40af;
  --cyan: #22d3ee;
  --sky: #9cc8ff;
  --ink: #e8f1ff;
  --muted: #8aa3c8;
  --gold: #facc15;
  --green: #22c55e;
  --pixel-font: 'Press Start 2P', monospace;
  --body-font: 'Rubik', system-ui, sans-serif;
  --container: 1080px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--body-font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

::selection { background: var(--blue); color: #fff; }

.container { width: min(var(--container), 92%); margin-inline: auto; }

img, svg { display: block; max-width: 100%; }
a { color: var(--sky); text-decoration: none; }
a:hover { color: #fff; }

.pixel-label {
  font-family: var(--pixel-font);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--sky);
}

/* ---------- fundal: grilă pixelată ---------- */
.pixel-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 40%, transparent 100%);
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(7, 13, 31, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--line);
  box-shadow: 0 4px 0 rgba(30, 64, 175, 0.25);
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 58px;
}
.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--pixel-font);
  font-size: 13px;
  color: var(--ink);
}
.nav__logo-block {
  width: 16px;
  height: 16px;
  background: var(--blue);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.35),
    0 0 0 2px var(--blue-dark);
  image-rendering: pixelated;
}
.nav__logo-accent { color: var(--blue-2); }
.nav__sub {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--pixel-font);
  font-size: 11px;
  color: var(--ink);
  background: var(--panel);
  border: 2px solid var(--blue-dark);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
  padding: 7px 12px;
  margin-left: auto;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.nav__sub:hover { background: var(--panel-2); transform: translateY(-1px); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4); }

.pixel-ico {
  display: inline-block;
  width: 14px;
  height: 14px;
  image-rendering: pixelated;
}
.pixel-ico--users {
  background:
    linear-gradient(#0f2a55, #0f2a55) 0 0 / 5px 5px no-repeat,
    linear-gradient(#9cc8ff, #9cc8ff) 5px 0 / 4px 5px no-repeat,
    linear-gradient(#0f2a55, #0f2a55) 9px 0 / 5px 5px no-repeat,
    linear-gradient(#9cc8ff, #9cc8ff) 0 5px / 6px 4px no-repeat,
    linear-gradient(#0f2a55, #0f2a55) 8px 5px / 6px 4px no-repeat;
}

/* ============================================================
   BANNER
   ============================================================ */
.banner {
  position: relative;
  padding-top: 58px; /* înălțimea nav-ului fix */
  background: var(--bg-2);
  border-bottom: 3px solid var(--blue-dark);
}
.banner__img {
  width: 100%;
  height: clamp(180px, 32vw, 300px);
  object-fit: cover;
  display: block;
}
/* fallback fără imagine: gradient pixelat */
.banner--gradient {
  height: clamp(180px, 32vw, 300px);
  background:
    radial-gradient(ellipse 70% 60% at 50% 20%, rgba(37, 99, 235, 0.45), transparent 70%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%),
    repeating-linear-gradient(45deg, rgba(59, 130, 246, 0.08) 0 8px, transparent 8px 16px);
}

/* ============================================================
   HEADER CANAL (pfp + nume + @handle + abonați + ultimul video)
   ============================================================ */
.channel { position: relative; }
.channel__inner {
  display: grid;
  grid-template-columns: auto 1fr minmax(280px, 340px);
  gap: 26px;
  align-items: start;
  padding: 28px 0 34px;
}
.channel__avatar {
  width: clamp(88px, 10vw, 120px);
  aspect-ratio: 1;
  object-fit: cover;
  border: 4px solid var(--blue-dark);
  border-radius: 10px;
  background: var(--panel);
  box-shadow:
    0 6px 0 rgba(30, 64, 175, 0.45),
    0 0 26px rgba(59, 130, 246, 0.3);
}
.channel__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding-top: 6px;
}
.channel__name {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  line-height: 1.25;
  font-weight: 800;
  color: var(--ink);
}
.channel__pseudo {
  font-size: 1rem;
  color: var(--muted);
}
.channel__stats {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 4px;
  flex-wrap: wrap;
}
.channel__subs-count {
  font-family: var(--pixel-font);
  font-size: 14px;
  color: var(--ink);
  text-shadow: 2px 2px 0 var(--blue-dark);
}
.channel__subs-hint { font-size: 0.75rem; }
.channel__subs-hint[data-state='error'] { color: #fca5a5; }

/* --- ultimul video din header --- */
.channel__latest { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.latest-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.latest-card:hover { color: var(--ink); transform: translateY(-2px); border-color: var(--blue-3); }
.latest-card__thumb {
  width: 150px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 2px solid var(--blue-dark);
  background: #081226;
}
.latest-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.latest-card__title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.latest-card__date { font-size: 0.75rem; color: var(--muted); }

/* ============================================================
   SECȚIUNI
   ============================================================ */
.section { padding: 56px 0 70px; }
.section--alt { background: var(--bg-2); border-block: 2px solid var(--line); box-shadow: inset 0 6px 0 rgba(30, 64, 175, 0.2); }
.section__title {
  font-family: var(--pixel-font);
  font-size: clamp(1rem, 2.6vw, 1.3rem);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.empty { color: var(--muted); }

/* bara multigaming lipită de videoclipuri (sus) și playlisturi (jos) */
#videouri { padding-bottom: 0; }
#playlisturi { padding-top: 0; }

/* ============================================================
   VIDEOURI (grilă tip YouTube)
   ============================================================ */
.videos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}
.video {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--ink);
}
.video:hover { color: var(--ink); }
.video__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #081226;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.08) 1px, transparent 1px);
  background-size: 20px 20px;
  border: 3px solid var(--line);
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.video:hover .video__thumb { border-color: var(--blue-3); }
.video__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.18s ease;
}
.video:hover .video__thumb img { transform: scale(1.04); }
.video__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}
.video__title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video__meta { font-size: 0.8rem; color: var(--muted); }

/* ============================================================
   PLAYLISTURI
   ============================================================ */
.playlists {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 24px;
}
.playlist {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 3px solid var(--blue-dark);
  border-radius: 10px;
  box-shadow:
    0 6px 0 rgba(30, 64, 175, 0.35),
    0 0 26px rgba(59, 130, 246, 0.18);
  padding: 12px;
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.playlist:hover { color: var(--ink); transform: translateY(-3px); box-shadow: 0 8px 0 rgba(30, 64, 175, 0.35), 0 0 32px rgba(59, 130, 246, 0.3); }
.playlist__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(ellipse 70% 60% at 50% 30%, rgba(37, 99, 235, 0.4), transparent 70%),
    linear-gradient(180deg, var(--panel-2), var(--bg));
  border: 2px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.playlist__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.playlist__play {
  color: var(--blue-2);
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.5));
}
.playlist__title {
  font-family: var(--pixel-font);
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.4;
}
.playlist__desc { font-size: 0.85rem; color: var(--muted); }
.playlist__status {
  margin-top: auto;
  font-family: var(--pixel-font);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--green);
  background: rgba(34, 197, 94, 0.12);
  border: 2px solid rgba(34, 197, 94, 0.4);
  padding: 7px 10px;
  display: inline-block;
  align-self: flex-start;
}
.playlist__status--soon { color: var(--gold); border-color: rgba(250, 204, 21, 0.4); background: rgba(250, 204, 21, 0.1); }

/* ============================================================
   ANIMAȚII (reparate)
   ============================================================ */

/* --- EchoText (numele canalului) --- */
.echo-text {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  line-height: 0.9;
  letter-spacing: -0.04em;
  user-select: none;
  contain: layout style;
  font-kerning: normal;
  text-rendering: geometricPrecision;
}
.echo-text__echo {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  transform-origin: 50% 50%;
  will-change: transform, opacity;
  backface-visibility: hidden;
}
.echo-text__echo--front {
  position: relative;
  z-index: 2;
  opacity: 1;
  filter: none;
  text-shadow: 0 0.035em 0 rgba(255, 255, 255, 0.04);
  will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
  .echo-text__echo:not(.echo-text__echo--front) { display: none; }
  .echo-text__echo--front { transform: none !important; }
}

/* --- SpecularButton (butonul Abonează-te) --- */
.specular-button {
  --sb-radius: 18px;
  --sb-tint: #ffffff;
  --sb-tint-opacity: 0;
  --sb-blur: 0px;
  --sb-text-color: #f5f5f5;

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  margin: 0;
  font-family: var(--pixel-font);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--sb-text-color);
  background: color-mix(in srgb, var(--sb-tint) calc(var(--sb-tint-opacity) * 100%), transparent);
  border-radius: var(--sb-radius);
  backdrop-filter: blur(var(--sb-blur));
  -webkit-backdrop-filter: blur(var(--sb-blur));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  outline: none;
  transition: transform 0.15s ease;
}
.specular-button:hover { color: var(--sb-text-color); }
.specular-button:active { transform: scale(0.97); }
.specular-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--sb-text-color) 60%, transparent);
  outline-offset: 3px;
}
.specular-button--sm { font-size: 0.85rem; padding: 10px 22px; }
.specular-button--md { font-size: 1rem; padding: 14px 30px; }
.specular-button--lg { font-size: 1.15rem; padding: 18px 40px; }
.specular-button__fx { position: absolute; inset: -20px; pointer-events: none; z-index: 1; }
.specular-button__fx canvas { display: block; width: 100%; height: 100%; }
.specular-button__label { position: relative; z-index: 2; }
.channel__info .specular-button { margin-top: 14px; }

/* --- TextLoop (marquee) --- */
.marquee {
  background: linear-gradient(180deg, rgba(30, 64, 175, 0.28), rgba(7, 13, 31, 0.15));
  padding: 0;
  overflow: hidden;
}
.text-loop { position: relative; width: 100%; overflow: hidden; }
.text-loop-svg { display: block; width: 100%; height: auto; }
.text-loop-text { user-select: none; }
.text-loop-measure { visibility: hidden; pointer-events: none; }

/* --- ElectricBorder (carduri de playlisturi) --- */
.electric {
  --electric-border-color: #5227FF;
  position: relative;
  border-radius: inherit;
  overflow: visible;
  isolation: isolate;
}
.eb-canvas-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}
.eb-canvas { display: block; }
.eb-content { position: relative; border-radius: inherit; z-index: 1; }
.eb-layers { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0; }
.eb-glow-1,
.eb-glow-2,
.eb-background-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-sizing: border-box;
}
.eb-glow-1 { border: 2px solid oklch(from var(--electric-border-color) l c h / 0.6); filter: blur(1px); }
.eb-glow-2 { border: 2px solid oklch(from var(--electric-border-color) l c h); filter: blur(4px); }
.eb-background-glow { z-index: -1; transform: scale(1.1); filter: blur(32px); opacity: 0.3; background: linear-gradient(-30deg, var(--electric-border-color), transparent, var(--electric-border-color)); }

/* conținutul cardului de playlist rămâne coloană flex, ca înainte de înfășurare */
.playlist .eb-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--bg-2);
  border-top: 3px solid var(--line);
  box-shadow: 0 -6px 0 rgba(30, 64, 175, 0.2);
  padding: 46px 0 30px;
}
.footer__inner { display: grid; gap: 26px; }
.footer__logo {
  font-family: var(--pixel-font);
  font-size: 13px;
  color: var(--ink);
}
.footer__brand p { color: var(--muted); font-size: 0.92rem; max-width: 560px; margin-top: 10px; }
.footer__note { font-size: 0.78rem; color: var(--muted); opacity: 0.75; border-top: 2px solid var(--line); padding-top: 18px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .channel__inner {
    grid-template-columns: auto 1fr;
  }
  .channel__latest {
    grid-column: 1 / -1;
  }
}
@media (max-width: 520px) {
  .channel__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .channel__avatar { margin-inline: auto; }
  .channel__info { align-items: center; }
  .channel__stats { justify-content: center; }
  .latest-card { flex-direction: column; align-items: center; text-align: center; }
  .latest-card__thumb { width: 100%; }
  .section { padding: 44px 0 56px; }
}
