/* style.css — shared + performance-optimiert (index + streamer) */

/* ---------- Theme ---------- */
:root{
  --primary:#6366f1;
  --primary-600:#4f46e5;

  --bg:#0b1020;
  --overlay:rgba(10,14,26,.82);

  --text:#f8fafc;
  --muted:#aab1c6;

  --card:rgba(23,30,48,.72);
  --border:rgba(255,255,255,.10);

  --radius:12px;
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial,sans-serif;
  color:var(--text);
  background:var(--bg);
  overflow-x:hidden;
}
a{color:inherit;text-decoration:none}
img{display:block;max-width:100%}

/* ---------- Background (leichter als vorher) ---------- */
/* Tipp: wenn du unbedingt ein Bild willst, nimm KEIN "fixed" Attachment.
   Das Element ist ohnehin fixed, dadurch wirkt es wie fixed ohne heavy cost. */
.bg{
  position:fixed;
  inset:0;
  z-index:-1;
  background:
    radial-gradient(70vw 55vw at 80% -10%, rgba(99,102,241,.14), transparent 60%),
    radial-gradient(60vw 45vw at -10% 20%, rgba(79,70,229,.10), transparent 60%),
    linear-gradient(var(--overlay),var(--overlay)),
    url("images/Tawi_Banner.png") center/cover no-repeat;
}

/* ---------- Layout ---------- */
.container{max-width:1200px;margin:0 auto;padding:0 16px}
main{padding-top:20px}
section{padding:30px 0}

/* ---------- Header / Nav (ohne Blur) ---------- */
.header{
  position:sticky;
  top:0;
  z-index:50;
  height:60px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(8,12,22,.92);
  border-bottom:1px solid var(--border);
}
.nav{
  width:100%;
  max-width:1200px;
  padding:0 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}
.brand{
  font-weight:900;
  letter-spacing:.2px;
  background:linear-gradient(90deg,var(--primary),rgba(165,180,252,.95));
  -webkit-background-clip:text;background-clip:text;color:transparent;
  font-size:1rem;
}
.links{display:flex;gap:1rem;align-items:center}
.link{
  padding:.35rem .2rem;
  font-weight:700;
  letter-spacing:.2px;
  color:#eaf0ff;
  font-size:14px;
  border-bottom:2px solid transparent;
}
.link.active{border-bottom-color:rgba(165,180,252,.9)}

/* Mobile menu (ohne Animationen) */
.menu-btn{
  display:none;
  background:none;
  border:0;
  color:var(--text);
  font-size:1.3rem;
  cursor:pointer;
}
@media(max-width:820px){
  .menu-btn{display:block}
  .links{
    position:fixed;
    top:60px;
    left:0;right:0;
    display:none;
    flex-direction:column;
    align-items:center;
    gap:1rem;
    background:rgba(8,12,22,.96);
    border-bottom:1px solid var(--border);
    padding:1rem 0;
    z-index:60;
  }
  .links.open{display:flex}
}

/* ---------- Typography ---------- */
h1{
  margin:0 0 10px;
  font-size: clamp(28px, 5vw, 44px);
  line-height:1.12;
  background:linear-gradient(90deg,rgba(165,180,252,.95),#fff);
  -webkit-background-clip:text;background-clip:text;color:transparent;
}
h2{
  margin:0 0 10px;
  font-size: clamp(18px,2.5vw,24px);
  background:linear-gradient(90deg,var(--primary),rgba(165,180,252,.95));
  -webkit-background-clip:text;background-clip:text;color:transparent;
}
h3{margin:0}
.lead{color:var(--muted);font-size:14px;margin:0 0 20px 0}

/* ---------- Cards (ohne Shadow/Blur für scroll performance) ---------- */
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:1rem;
}

/* ---------- Grid ---------- */
.grid{display:grid;gap:1rem}
.cols-4{grid-template-columns:repeat(4,1fr)}
.cols-3{grid-template-columns:repeat(3,1fr)}
.cols-2{grid-template-columns:repeat(2,1fr)}
@media(max-width:1024px){.cols-4{grid-template-columns:repeat(2,1fr)}}
@media(max-width:768px){.cols-4,.cols-3,.cols-2{grid-template-columns:1fr}}

/* Stat Keys/Values (für deine "k"/"v" Blöcke) */
.k{color:var(--muted);font-size:12px;margin-bottom:6px}
.v{font-weight:900;letter-spacing:.2px;font-size:22px}

/* ---------- Buttons (ohne Transition/Transform) ---------- */
.btn{
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  padding:.45rem .8rem;
  border-radius:8px;
  font-weight:700;
  letter-spacing:.1px;
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  font-size:14px;
  cursor:pointer;
}
.btn:hover{background:rgba(255,255,255,.10)}
.btn.primary{
  background:linear-gradient(90deg,var(--primary-600),var(--primary));
  border-color:transparent;
}
.btn.mini{padding:.35rem .65rem;font-size:12px}
.btn.mini.active{
  background:linear-gradient(90deg,var(--primary-600),var(--primary));
  border-color:transparent;
}

/* ---------- Footer ---------- */
footer{
  margin-top:30px;
  padding:20px 0;
  border-top:1px solid var(--border);
  background:rgba(8,12,22,.92);
}
.foot{
  max-width:1200px;
  margin:0 auto;
  padding:0 16px;
  text-align:center;
  color:var(--muted);
  font-size:12px;
}

/* ---------- Generic helpers ---------- */
.emptyCell{color:var(--muted);padding:18px 12px;text-align:center}

/* ---------- Loading (ohne Animation) ---------- */
.loading{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:40px;
  text-align:center;
}
.loading-spinner{
  width:36px;height:36px;
  border:3px solid rgba(255,255,255,.14);
  border-top-color:rgba(165,180,252,.9);
  border-radius:50%;
  margin-bottom:14px;
}

/* =======================================================================
   STREAMER PAGE (shared, aber streamer-spezifische Klassen)
   ======================================================================= */

/* Streamer Header */
.streamer-header{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:18px;
  align-items:flex-start;
  padding:18px;
}
.streamer-avatar{
  width:100px;
  height:100px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.14);
  background-size:cover;
  background-position:center;
  background-color:rgba(255,255,255,.05);
}
.streamer-name{margin:0 0 6px 0;font-size:28px;font-weight:900}
.streamer-login{color:var(--muted);font-size:14px;margin-bottom:12px}
.streamer-bio{
  color:var(--text);
  font-size:13px;
  line-height:1.55;
  margin-bottom:12px;
  max-height:110px;
  overflow:auto;
  background:rgba(255,255,255,.03);
  padding:12px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.10);
}
.streamer-meta{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:12px;
}
.streamer-meta-item{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--muted)}
.streamer-actions{display:flex;gap:10px;flex-wrap:wrap}

/* Badge */
.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:4px 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:800;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  color:var(--muted);
}
.badge.live{
  border-color:rgba(239, 68, 68, 0.28);
  background:rgba(239, 68, 68, 0.10);
  color:#ef4444;
}

/* Performance Metrics */
.metric-grid{display:grid;gap:10px}
.metric-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:8px 0;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.metric-row:last-child{border-bottom:none}

/* Charts */
.chart-container{position:relative;height:300px;width:100%}
.chart-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:14px;
  flex-wrap:wrap;
  gap:12px;
}
.chart-tabs{
  display:flex;
  gap:8px;
  border:1px solid var(--border);
  border-radius:10px;
  padding:4px;
  background:rgba(255,255,255,.03);
}
.chart-tab{
  padding:8px 14px;
  background:transparent;
  border:none;
  border-radius:8px;
  color:var(--muted);
  cursor:pointer;
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}
.chart-tab:hover{background:rgba(255,255,255,.08)}
.chart-tab.active{background:var(--primary);color:#fff}
.chart-wrapper{display:none}
.chart-wrapper.active{display:block}

/* Lists */
.stream-item{padding:14px;border-bottom:1px solid var(--border)}
.stream-item:last-child{border-bottom:none}
.stream-title{font-weight:900;margin-bottom:6px;font-size:14px}
.stream-meta{display:flex;justify-content:space-between;gap:10px;align-items:center;font-size:12px;color:var(--muted)}

.game-item{padding:14px;border-bottom:1px solid var(--border)}
.game-item:last-child{border-bottom:none}

/* Clips */
.clip-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
  gap:14px;
}
.clip-card{
  background:rgba(255,255,255,.03);
  border-radius:12px;
  overflow:hidden;
  border:1px solid var(--border);
  cursor:pointer;
}
.clip-card:hover{background:rgba(255,255,255,.05)}
.clip-thumbnail{
  position:relative;
  padding-top:56.25%;
  background:#000;
  overflow:hidden;
}
.clip-thumbnail img{
  position:absolute;inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
}
.clip-duration{
  position:absolute;
  bottom:6px;
  right:6px;
  background:rgba(0,0,0,.70);
  color:#fff;
  padding:2px 6px;
  border-radius:6px;
  font-size:11px;
  font-weight:700;
}
.clip-info{padding:12px}
.clip-title{
  font-weight:900;
  font-size:13px;
  margin-bottom:8px;
  line-height:1.3;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.clip-meta{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:11px;
  color:var(--muted);
}
.clip-views{color:rgba(165,180,252,.95);font-weight:900}

/* ---------- Scroll Performance Boost (Chrome/Edge) ---------- */
/* Hilft besonders bei vielen Clips/VODs */
.stream-item,
.game-item,
.clip-card{
  content-visibility:auto;
  contain-intrinsic-size: 240px;
}

/* ---------- Responsive streamer ---------- */
@media (max-width: 768px) {
  .streamer-header{grid-template-columns:1fr;text-align:center}
  .streamer-avatar{margin:0 auto}
  .streamer-actions{justify-content:center}
  .clip-grid{grid-template-columns:1fr}
  .chart-header{flex-direction:column;align-items:flex-start}
  .chart-tabs{width:100%;overflow-x:auto}
}
