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

:root {
  --bg: #0f0f14;
  --surface: #1a1a24;
  --surface2: #22222f;
  --accent: #a78bfa;
  --accent2: #818cf8;
  --text: #e2e2f0;
  --muted: #8888aa;
  --radius: 12px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Ad layout ── */
.content-with-ads {
  display: grid;
  grid-template-columns: 160px 1fr 160px;
  grid-template-areas: "ad-left list ad-right";
  gap: 1.2rem;
  align-items: start;
}

.ad-left  { grid-area: ad-left; }
.ad-right { grid-area: ad-right; }
.list-area { grid-area: list; }

.ad-slot {
  position: sticky;
  top: 1rem;
  min-height: 600px;
  background: var(--surface);
  border: 1px dashed #2a2a40;
  border-radius: var(--radius);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
}

/* Narrow screens: stack ads above and below the list */
@media (max-width: 900px) {
  .content-with-ads {
    grid-template-columns: 1fr;
    grid-template-areas:
      "ad-left"
      "list"
      "ad-right";
  }

  .ad-slot {
    position: static;
    min-height: 90px;
    width: 100%;
  }
}

/* ── Language bar ── */
.lang-bar {
  display: flex;
  justify-content: flex-end;
  gap: 0.3rem;
  padding: 0.4rem 1rem;
  background: #0c0c11;
  border-bottom: 1px solid #1e1e30;
}

.lang-btn {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.lang-btn:hover { color: var(--text); background: var(--surface2); }
.lang-btn.active { color: var(--accent); background: #2a2060; }

/* ── Header ── */
header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-bottom: 1px solid #2a2a40;
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
}

header h1 {
  font-size: 2.2rem;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.4rem;
}

.subtitle {
  color: var(--muted);
  margin-bottom: 1.4rem;
  font-size: 0.95rem;
}

/* ── Filters ── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  max-width: 700px;
  margin: 0 auto;
}

.filters input,
.filters select {
  background: var(--surface2);
  border: 1px solid #333350;
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.filters input { flex: 1 1 200px; }
.filters select { flex: 0 0 auto; }

.filters input:focus,
.filters select:focus { border-color: var(--accent); }

.filters button {
  background: var(--accent);
  color: #0f0f14;
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.filters button:hover { opacity: 0.85; }

.clear-btn {
  color: var(--muted);
  text-decoration: none;
  align-self: center;
  font-size: 0.85rem;
  padding: 0.5rem 0.6rem;
}
.clear-btn:hover { color: var(--text); }

/* ── Main ── */
main {
  flex: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem 1.2rem 2rem;
  width: 100%;
}

.count {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* ── Sections ── */
.vtuber-section { margin-bottom: 2.5rem; }

.section-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #2a2a40;
}

.section-empty {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 1rem 0;
}

/* Pulsing red dot for live section heading */
.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f87171;
  flex-shrink: 0;
  animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.75); }
}

/* Info tooltip next to section heading */
.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
  outline: none;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--muted);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  font-family: Georgia, 'Times New Roman', serif;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.info-tooltip:hover .info-icon,
.info-tooltip:focus .info-icon {
  color: var(--text);
  border-color: var(--text);
}

.info-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: #2a2a40;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 400;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #3a3a55;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 10;
}

.info-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #2a2a40;
}

.info-tooltip:hover .info-bubble,
.info-tooltip:focus .info-bubble {
  opacity: 1;
  visibility: visible;
}

/* Live card highlight */
.card--live { border-color: #4a1a1a; }
.card--live:hover { border-color: #f87171; }

/* Upcoming card highlight */
.card--upcoming { border-color: #1a2a40; }
.card--upcoming:hover { border-color: var(--accent2); }

/* Live badge */
.badge.live-badge {
  background: #7f1d1d;
  color: #fca5a5;
  animation: pulse-dot 1.8s ease-in-out infinite;
}

/* ── Card Grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

.card {
  background: var(--surface);
  border: 1px solid #2a2a40;
  border-radius: var(--radius);
  display: flex;
  gap: 1rem;
  padding: 1.2rem;
  min-height: 140px;
  transition: transform 0.2s, border-color 0.2s;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.card-avatar {
  font-size: 2.4rem;
  line-height: 1;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-avatar img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.card-name {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge.agency    { background: #2a2060; color: #a78bfa; }
.badge.language  { background: #1a2a40; color: #60a5fa; }
.badge.viewers   { background: #1a2a1a; color: #86efac; }
.badge.scheduled { background: #20203a; color: #b4b4f0; text-transform: none; letter-spacing: 0; }

.upcoming-title {
  font-size: 0.82rem;
  color: #b0b0c8;
  font-style: italic;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.live-title {
  font-size: 0.82rem;
  color: #fca5a5;
  font-style: italic;
  line-height: 1.4;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  font-size: 0.75rem;
  color: #7070a0;
  background: var(--surface2);
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
}

.platform-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.platform-btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  text-decoration: none;
  transition: opacity 0.15s;
}
.platform-btn:hover { opacity: 0.8; }

.platform-yt     { background: #2a1a1a; color: #f87171; }
.platform-twitch { background: #1f1535; color: #a78bfa; }
.platform-bili   { background: #0f1f35; color: #60a5fa; }
.platform-nico   { background: #1a1a10; color: #facc15; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}
.empty-state a {
  display: inline-block;
  margin-top: 0.8rem;
  color: var(--accent);
  text-decoration: none;
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 1.2rem 1rem 1.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid #1e1e30;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-nav { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.footer-nav a { color: var(--accent); text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.footer-nav .sep { color: #444460; }
.footer-note { font-size: 0.75rem; color: #55556a; }

/* ── Legal pages ── */
.legal-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-bottom: 1px solid #2a2a40;
  padding: 1.5rem 2rem;
}

.back-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}
.back-link:hover { text-decoration: underline; }

.legal-header h1 {
  font-size: 1.8rem;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.3rem;
}

.legal-date { color: var(--muted); font-size: 0.82rem; }

.legal-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.legal-main section { display: flex; flex-direction: column; gap: 0.6rem; }

.legal-main h2 {
  font-size: 1.05rem;
  color: var(--accent);
  border-bottom: 1px solid #2a2a40;
  padding-bottom: 0.3rem;
}

.legal-main h3 { font-size: 0.95rem; color: var(--text); }

.legal-main p, .legal-main li {
  font-size: 0.9rem;
  color: #b0b0c8;
  line-height: 1.7;
}

.legal-main ul {
  padding-left: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.legal-main a { color: var(--accent); }
.legal-main a:hover { text-decoration: underline; }

.contribute-main {
  max-width: 560px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.contribute-intro {
  font-size: 0.95rem;
  color: #b0b0c8;
  line-height: 1.7;
}

.contribute-banner {
  font-size: 0.9rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  line-height: 1.6;
}

.contribute-banner--ok {
  background: rgba(60, 200, 120, 0.12);
  border: 1px solid rgba(60, 200, 120, 0.4);
  color: #7fe0a6;
}

.contribute-banner--info {
  background: rgba(90, 150, 240, 0.12);
  border: 1px solid rgba(90, 150, 240, 0.4);
  color: #9bbcf5;
}

.contribute-banner--err {
  background: rgba(240, 90, 110, 0.12);
  border: 1px solid rgba(240, 90, 110, 0.4);
  color: #f59bab;
}

.contribute-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.contribute-form label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.contribute-form input {
  background: var(--surface2);
  border: 1px solid #333350;
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.contribute-form input:focus { border-color: var(--accent); }

.contribute-form button {
  align-self: flex-start;
  background: var(--accent);
  color: #0f0f14;
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1.4rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.contribute-form button:hover { opacity: 0.85; }

.contribute-link { color: inherit; }
.contribute-link:hover { color: var(--accent); }
