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

/* ----- NProgress (loading bar) ----- */
#nprogress { pointer-events: none; }
#nprogress .bar {
  background: #260c78;
  position: fixed;
  z-index: 1031;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
}
#nprogress .peg {
  display: block;
  position: absolute;
  right: 0;
  width: 100px;
  height: 100%;
  box-shadow: 0 0 10px #260c78, 0 0 5px #260c78;
  opacity: 1;
  transform: rotate(3deg) translate(0, -4px);
}

body {
  background: radial-gradient(circle at top, #1a1a1f 0%, #0e0e10 60%);
  color: #efeff1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  min-height: 100vh;
}

/* ----- Header ----- */
header {
  padding: 28px 28px 18px;
  border-bottom: 1px solid #2a2a2d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: rgba(14, 14, 16, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
h1 {
  margin: 0;
  font-family: "Archivo", -apple-system, sans-serif;
  font-style: italic;
  font-weight: 900;
  font-size: 32px;
  letter-spacing: .3px;
  line-height: 1;
}
h1 a { text-decoration: none; color: inherit; display: inline-block; }
h1 a:hover { opacity: .85; }
h1 .kafi, h1 .roleplay { color: #ffffff; }

.meta {
  font-size: 13px;
  color: #adadb8;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.meta b { color: #efeff1; font-weight: 600; }
.pill {
  background: #1f1f23;
  border: 1px solid #2a2a2d;
  padding: 4px 10px;
  border-radius: 999px;
}

/* ----- Main / grid ----- */
main {
  padding: 28px;
  max-width: 1400px;
  margin: 0 auto;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

/* ----- Card ----- */
.card {
  background: #18181b;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s ease, border-color .15s ease;
  border: 1px solid #26262a;
  display: flex;
  flex-direction: column;
}
.card:hover {
  box-shadow: 0 10px 28px rgba(38, 12, 120, .35);
  border-color: #260c78;
}
.thumb { position: relative; aspect-ratio: 16/9; background: #000; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #18181b, #2a2a2d);
  color: #444; font-size: 36px;
}
.live {
  position: absolute; top: 8px; left: 8px;
  background: #eb0400; color: white;
  font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 4px;
  letter-spacing: .5px;
}
.viewers {
  position: absolute; bottom: 8px; left: 8px;
  background: rgba(0, 0, 0, .78); color: white;
  font-size: 12px; font-weight: 600;
  padding: 3px 8px; border-radius: 4px;
  display: flex; align-items: center; gap: 5px;
}
.viewers::before { content: ""; width: 7px; height: 7px; background: #eb0400; border-radius: 50%; }
.duration {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0, 0, 0, .78); color: #ccc;
  font-size: 11px; padding: 3px 8px; border-radius: 4px;
}
.body { padding: 12px 14px 14px; }
.title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.channel { font-size: 13px; color: #adadb8; }

/* ----- States ----- */
.empty { padding: 80px 20px; text-align: center; color: #adadb8; }
.empty h2 { color: #efeff1; }
.error {
  background: #311; color: #fbb;
  padding: 12px 16px; border-radius: 8px;
  margin-bottom: 16px; font-size: 14px;
  border: 1px solid #532;
}
.setup {
  background: #1a1f2e; color: #cde;
  padding: 18px 22px; border-radius: 10px;
  border: 1px solid #2a3548; line-height: 1.5;
}
.setup code {
  background: #0c1018; padding: 1px 6px; border-radius: 4px;
  font-size: 13px; color: #fff;
}

.grid.refreshing { opacity: .55; transition: opacity .2s; }
