/* /live/livestreams.animations.css */
:root{
  --bg:#04060A;
  --text:#E7EAEE;
  --muted:#B9C2CF;
  --line:rgba(255,255,255,.12);
  --panel:rgba(10,13,20,.92);

  /* fallbacks (theme.css should provide these for data-theme="red") */
  --accent: var(--accent, #ff4b4b);
  --accent-light: var(--accent-light, #ff7a7a);
  --glow-soft: var(--glow-soft, rgba(255,75,75,.14));
  --glow-med: var(--glow-med, rgba(255,75,75,.26));

  --radius:16px;
  --shadow-lg:0 24px 60px rgba(0,0,0,.85);
  --shadow-md:0 18px 40px rgba(0,0,0,.75);
}

*{ box-sizing:border-box; margin:0; padding:0; }
html,body{ height:100%; }

/* ✅ RESTORE YOUR BACKGROUND + RED THEME FEEL */
body.theme-essence{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  background:var(--bg);
  color:var(--text);
  font-family:Inter,system-ui,"Segoe UI",Roboto,Arial,sans-serif;
  overflow-x:hidden;
  position:relative;
}

body.theme-essence::before{
  content:"";
  position:fixed;
  inset:0;
  background:
    linear-gradient(115deg, rgba(0,0,0,.95), rgba(0,0,0,.90)),
    url("/assets/background.jpg") center/cover no-repeat fixed;
  z-index:-4;
}

body.theme-essence::after{
  content:"";
  position:fixed;
  inset:0;
  background:
    linear-gradient(180deg, rgba(3,5,7,0) 0, rgba(3,5,7,.70) 45%, rgba(3,5,7,.96) 100%),
    radial-gradient(70% 60% at 10% 10%, var(--glow-med), transparent 60%),
    radial-gradient(60% 50% at 100% 100%, var(--glow-soft), transparent 65%);
  mix-blend-mode:soft-light;
  z-index:-3;
  pointer-events:none;
}

/* animated spotlight overlay */
.spotlight{
  position:fixed;
  inset:-20%;
  z-index:-2;
  pointer-events:none;
  opacity:.75;
  background:
    radial-gradient(24% 22% at 18% 22%, rgba(255,255,255,.06), transparent 60%),
    radial-gradient(30% 28% at 72% 20%, rgba(255,255,255,.04), transparent 62%),
    radial-gradient(26% 26% at 72% 78%, var(--glow-soft), transparent 62%),
    radial-gradient(30% 28% at 18% 78%, var(--glow-med), transparent 60%);
  filter:blur(10px);
  transform:translate3d(0,0,0);
}

@media (prefers-reduced-motion:no-preference){
  .spotlight{ animation: drift 14s ease-in-out infinite; }
  @keyframes drift{
    0%,100%{ transform:translate3d(0,0,0) scale(1); opacity:.68; }
    50%{ transform:translate3d(-2.5%, 1.5%, 0) scale(1.04); opacity:.9; }
  }
}

/* reveal */
.reveal{
  opacity:0;
  transform:translateY(14px);
  filter:blur(4px);
  transition:opacity .65s ease, transform .65s ease, filter .65s ease;
}
.reveal.in{
  opacity:1;
  transform:none;
  filter:none;
}

/* hero */
.hero{
  padding:146px 20px 18px;
  display:flex;
  justify-content:center;
  text-align:center;
}
.hero-inner{
  width:min(1120px, 92vw);
  position:relative;
}
.hero-inner::before{
  content:"";
  position:absolute;
  inset:-14px -10px;
  border-radius:28px;
  background:
    radial-gradient(90% 70% at 50% 0%, rgba(255,255,255,.08), transparent 65%),
    radial-gradient(70% 90% at 0% 60%, var(--glow-soft), transparent 62%),
    radial-gradient(70% 90% at 100% 60%, var(--glow-med), transparent 62%);
  border:1px solid rgba(255,255,255,.08);
  opacity:.45;
  pointer-events:none;
}
.eyebrow{
  letter-spacing:.22em;
  text-transform:uppercase;
  font-weight:900;
  font-size:.78rem;
  color:#cfd6e1;
  opacity:.9;
  margin-bottom:6px;
}

/* shimmering title */
.shine{ background-size:200% 100%; }
@media (prefers-reduced-motion:no-preference){
  .shine{ animation: shine 4.5s ease-in-out infinite; }
  @keyframes shine{
    0%,100%{ background-position:0% 50%; }
    50%{ background-position:100% 50%; }
  }
}

.hero h1{
  margin:0;
  font-size:clamp(2.35rem, 2.6rem + 1.2vw, 3.35rem);
  line-height:1.06;
  font-weight:950;
  background:linear-gradient(90deg, var(--accent), var(--accent-light), var(--accent));
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  text-shadow:0 0 22px rgba(0,0,0,.35);
}
.hero-sub{
  color:#cbd3dc;
  max-width:820px;
  margin:12px auto 0;
  line-height:1.6;
  font-size:1.03rem;
}
.hero-strip{
  margin:18px auto 0;
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:9px 16px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.35);
  color:var(--muted);
  font-size:.9rem;
  box-shadow:0 0 0 1px rgba(0,0,0,.55) inset, 0 10px 24px rgba(0,0,0,.45);
  backdrop-filter:blur(10px);
}
.hero-dot{
  width:9px;
  height:9px;
  border-radius:50%;
  background:radial-gradient(circle at 30% 30%, #fff, #35e58c);
  box-shadow:0 0 10px rgba(53,229,140,.9);
}
@media (prefers-reduced-motion:no-preference){
  .hero-dot{ animation: pulse 1.6s ease-in-out infinite; }
  @keyframes pulse{
    0%,100%{ transform:scale(1); filter:brightness(1); }
    50%{ transform:scale(1.25); filter:brightness(1.15); }
  }
}

/* headers */
.view-header{
  padding:0 20px 8px;
  display:flex;
  justify-content:center;
}
.view-header-inner{ width:min(1200px, 94vw); }
.live-header-with-toggle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:12px;
}
.live-header h2,
.directory-header h2{
  font-size:1.1rem;
  letter-spacing:.18em;
  text-transform:uppercase;
  font-weight:900;
  color:#e1e6f0;
}
.live-header small,
.directory-header small{
  color:var(--muted);
  font-size:.85rem;
}

/* wraps */
.live-wrap,
.directory-wrap{
  padding:0 20px 56px;
  display:flex;
  justify-content:center;
}
.live-inner,
.directory-inner{ width:min(1200px, 94vw); }

.grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:18px;
}
@media (max-width:900px){
  .grid{ grid-template-columns:1fr; }
}

/* stream card */
.stream-card{
  position:relative;
  border-radius:var(--radius);
  border:1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(120% 140% at 0% 0%, var(--glow-soft), transparent 55%),
    var(--panel);
  box-shadow:var(--shadow-md), 0 0 0 1px rgba(0,0,0,.70) inset;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  transform:translateZ(0);
  transition:transform .22s ease, box-shadow .22s ease, border-color .22s ease, background .22s ease, filter .22s ease;
}
.stream-card::before{
  content:"";
  position:absolute;
  inset:0;
  background:radial-gradient(180% 220% at -10% -10%, var(--glow-med), transparent 52%);
  opacity:0;
  pointer-events:none;
  transition:opacity .22s ease;
}
.stream-card::after{
  content:"";
  position:absolute;
  inset:-40% -20%;
  background:linear-gradient(115deg, transparent 30%, rgba(255,255,255,.12), transparent 55%);
  opacity:0;
  transform:translateX(-20%) rotate(10deg);
  pointer-events:none;
}
.stream-card:hover{
  transform:translateY(-6px) scale(1.01);
  border-color:rgba(255,255,255,.16);
  background:
    radial-gradient(150% 200% at 0% 0%, var(--glow-med), transparent 60%),
    var(--panel);
  box-shadow:var(--shadow-lg), 0 0 0 1px rgba(0,0,0,.70) inset, 0 0 0 1px var(--glow-soft);
  filter:saturate(1.05);
}
.stream-card:hover::before{ opacity:1; }
@media (prefers-reduced-motion:no-preference){
  .stream-card:hover::after{
    opacity:.65;
    animation:sweep .9s ease forwards;
  }
  @keyframes sweep{
    from{ transform:translateX(-20%) rotate(10deg); }
    to{ transform:translateX(30%) rotate(10deg); }
  }
}

.player-wrap{
  position:relative;
  width:100%;
  aspect-ratio:16/9;
  background:#000;
  overflow:hidden;
}
.player-wrap iframe{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
}
.player-wrap::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:42%;
  background:linear-gradient(to top, rgba(3,5,7,.95), rgba(3,5,7,.45), transparent);
  opacity:.65;
  pointer-events:none;
  transition:opacity .22s ease;
}
.stream-card:hover .player-wrap::after{ opacity:.9; }

.stream-meta{
  padding:12px 14px 10px;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.stream-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.stream-name{ font-weight:900; font-size:1.02rem; }
.stream-handle{ font-size:.82rem; color:var(--muted); }

.live-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 10px;
  border-radius:999px;
  background:rgba(255,72,96,.10);
  border:1px solid rgba(255,72,96,.75);
  color:#ffb3c0;
  font-size:.74rem;
  text-transform:uppercase;
  letter-spacing:.14em;
  font-weight:900;
  box-shadow:0 0 18px rgba(255,72,96,.60);
}
.live-pill-dot{
  width:7px;
  height:7px;
  border-radius:50%;
  background:radial-gradient(circle at 30% 30%, #fff, #ff485f);
  box-shadow:0 0 10px rgba(255,72,95,.9);
}
@media (prefers-reduced-motion:no-preference){
  .live-pill-dot{ animation: livepulse 1.2s ease-in-out infinite; }
  @keyframes livepulse{
    0%,100%{ transform:scale(1); }
    50%{ transform:scale(1.35); }
  }
}

.stream-title{ font-size:.92rem; color:#e5e8f2; margin-top:4px; }
.stream-game{ font-size:.8rem; color:var(--muted); }

.stream-footer{
  padding:0 14px 12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  font-size:.82rem;
  color:var(--muted);
}
.stream-footer a{
  color:var(--accent-light);
  text-decoration:none;
}
.stream-footer a:hover{ text-decoration:underline; }
.stream-uptime{
  font-weight:900;
  font-size:.82rem;
  color:#e9edf6;
}

/* loading / status */
#live-loading{
  margin-top:18px;
  font-size:.9rem;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:8px;
}
.spinner{
  width:16px;
  height:16px;
  border-radius:999px;
  border:2px solid rgba(255,255,255,.20);
  border-top-color:var(--accent-light);
  animation:spin 0.7s linear infinite;
}
@keyframes spin { to { transform:rotate(360deg); } }

.status-box{
  margin-top:18px;
  border-radius:14px;
  border:1px dashed rgba(255,255,255,.20);
  background:rgba(3,5,7,.80);
  padding:12px 14px;
  font-size:.9rem;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:10px;
  backdrop-filter:blur(10px);
}
.status-box strong{ color:#e9edf6; }
.status-dot{
  width:9px;
  height:9px;
  border-radius:999px;
  background:radial-gradient(circle at 30% 30%, #fff, #ff5e5e);
  box-shadow:0 0 10px rgba(255,94,94,.9);
}
.status-dot.ok{
  background:radial-gradient(circle at 30% 30%, #fff, #35e58c);
  box-shadow:0 0 10px rgba(53,229,140,.9);
}

/* toggle buttons */
.view-toggle{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
}
.toggle-btn{
  padding:7px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.15);
  background:rgba(0,0,0,.35);
  color:#cbd3dc;
  font-size:.78rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.14em;
  cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.toggle-btn:hover{
  transform:translateY(-1px);
  border-color:rgba(255,255,255,.20);
  box-shadow:0 0 0 1px var(--glow-soft) inset, 0 10px 22px rgba(0,0,0,.35);
}
.toggle-btn.is-active{
  background:linear-gradient(90deg, var(--accent), var(--accent-light));
  color:#0b0b0f;
  border-color:transparent;
  box-shadow:0 0 16px var(--glow-med);
}
.view-hidden{ display:none !important; }

@media (max-width:640px){
  .live-header-with-toggle{
    flex-direction:column;
    align-items:flex-start;
  }
  .view-toggle{
    width:100%;
    justify-content:flex-start;
    flex-wrap:wrap;
  }
}

/* offline + directory */
.offline-section{ margin-top:24px; }
.offline-section h3{
  font-size:.9rem;
  text-transform:uppercase;
  letter-spacing:.16em;
  color:#e1e6f0;
  margin-bottom:10px;
}
.offline-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(210px, 1fr));
  gap:12px;
}
.offline-card{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(7,9,14,.95);
  transition:transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.offline-card:hover{
  transform:translateY(-2px);
  border-color:rgba(255,255,255,.14);
  box-shadow:0 16px 34px rgba(0,0,0,.55);
}
.offline-avatar{
  width:38px;
  height:38px;
  border-radius:999px;
  object-fit:cover;
  background:#111;
  flex-shrink:0;
}
.offline-text{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}
.offline-name{
  font-size:.9rem;
  font-weight:800;
  white-space:nowrap;
  text-overflow:ellipsis;
  overflow:hidden;
}
.offline-handle{
  font-size:.78rem;
  color:var(--muted);
  white-space:nowrap;
  text-overflow:ellipsis;
  overflow:hidden;
}
.offline-link{
  margin-left:auto;
  font-size:.78rem;
  color:var(--accent-light);
  text-decoration:none;
  flex-shrink:0;
}
.offline-link:hover{ text-decoration:underline; }

.directory-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(230px, 1fr));
  gap:16px;
}
.dir-card{
  display:flex;
  gap:12px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(8,10,16,.95);
  transition:transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.dir-card:hover{
  transform:translateY(-3px);
  border-color:rgba(255,255,255,.16);
  box-shadow:0 20px 44px rgba(0,0,0,.65);
}
.dir-avatar{
  width:52px;
  height:52px;
  border-radius:999px;
  object-fit:cover;
  background:#111;
  flex-shrink:0;
}
.dir-body{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}
.dir-name{ font-weight:900; }
.dir-role{
  font-size:.8rem;
  color:var(--muted);
}
.dir-handle{
  font-size:.85rem;
  color:var(--accent-light);
  text-decoration:none;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:36ch;
}
.dir-handle:hover{ text-decoration:underline; }
.dir-footer{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:.78rem;
  margin-top:4px;
  color:var(--muted);
  gap:10px;
  flex-wrap:wrap;
}
.dir-live-tag{
  padding:3px 8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.18);
}
.dir-live-tag.on{
  border-color:rgba(255,72,96,.80);
  color:#ffb3c0;
  box-shadow:0 0 12px rgba(255,72,96,.60);
  background:rgba(255,72,96,.12);
}
.dir-x{ opacity:.85; }

/* view switching */
@media (prefers-reduced-motion:no-preference){
  #live-view, #directory-view{
    transition:opacity .25s ease, transform .25s ease;
    will-change:opacity, transform;
  }
  #live-view.view-hidden, #directory-view.view-hidden{
    opacity:0;
    transform:translateY(10px);
  }
}
