:root {
  --bg: #0a0c12;
  --bg2: #0d1020;
  --card: #121627;
  --text: #e6e8ee;
  --muted: #9aa3b2;
  --accent: #9146ff; /* Twitch purple */
  --neon-green: #39ff14;
  --neon-blue: #00e5ff;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(145,70,255,0.2), transparent),
              radial-gradient(800px 400px at 80% 0%, rgba(0,229,255,0.18), transparent),
              var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
}

.topbar {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #222836;
  background: linear-gradient(90deg, rgba(145,70,255,0.12), rgba(0,229,255,0.08));
  box-shadow: 0 6px 14px rgba(0,0,0,0.35);
}
.topbar h1 { margin: 0; font-size: 20px; }
.topbar form { display: flex; gap: 8px; flex: 1; }
.topbar input {
  flex: 1;
  padding: 8px 10px;
  background: #0c0f1a;
  border: 1px solid #263048;
  color: var(--text);
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(145,70,255,0.2);
}
.topbar #watch-name { max-width: 280px; }
.topbar .mute-wrap { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); margin-left: 8px; }
.favorites { display: inline-flex; align-items: center; gap: 8px; margin-left: 12px; }
.favorites input, .favorites select, .favorites button { padding: 6px 8px; border-radius: 6px; border: 1px solid #202636; background: #0c0e12; color: var(--text); }
.favorites button { background: #1e2638; cursor: pointer; }
.favorites select { min-width: 180px; }
.topbar button {
  padding: 8px 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(145,70,255,0.4);
}

main { padding: 16px; }
.footer { padding: 10px 16px; color: var(--muted); border-top: 1px solid #222836; text-align: center; background: linear-gradient(90deg, rgba(145,70,255,0.1), rgba(0,229,255,0.06)); box-shadow: 0 -6px 14px rgba(0,0,0,0.35); }
.cutscene { position: fixed; inset: 0; background: #000; display: none; align-items: center; justify-content: center; z-index: 1000; flex-direction: column; gap: 12px; }
.cutscene video { max-width: 90vw; max-height: 90vh; border: 1px solid #263048; box-shadow: 0 0 24px rgba(145,70,255,0.4), 0 0 24px rgba(0,229,255,0.25) inset; }
.cutscene-controls { display: inline-flex; gap: 10px; }
.cutscene button { padding: 8px 12px; background: var(--accent); color: #fff; border: none; border-radius: 8px; cursor: pointer; box-shadow: 0 0 12px rgba(145,70,255,0.45); }
.cutscene #enable-sound { background: var(--neon-green); color: #071507; box-shadow: 0 0 12px rgba(57,255,20,0.6); }
.beta { position: fixed; inset: 0; background: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center; z-index: 1100; }
.beta-card { width: min(560px, 92vw); background: var(--card); border: 1px solid #263048; border-radius: 12px; padding: 18px; box-shadow: 0 0 22px rgba(145,70,255,0.35), 0 0 22px rgba(0,229,255,0.2) inset; }
.beta-card h2 { margin: 0 0 8px; }
.beta-card p { margin: 0 0 12px; color: var(--muted); }
.beta-card button { padding: 8px 12px; background: var(--accent); color: #fff; border: none; border-radius: 8px; cursor: pointer; box-shadow: 0 0 12px rgba(145,70,255,0.45); }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.column {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid #263048;
  border-radius: 8px;
  min-height: 340px;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.2) inset, 0 10px 24px rgba(0,0,0,0.35);
}
.player { position: relative; width: 100%; aspect-ratio: 16/9; background: #0c0e12; border-bottom: 1px solid #263048; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.column.alert { border-color: var(--neon-green); box-shadow: 0 0 10px rgba(57,255,20,0.6), 0 0 20px rgba(57,255,20,0.3) inset; animation: neonPulse 1.6s ease-in-out infinite; }
.column .header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid #263048;
  font-weight: 600;
}
.summary {
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  flex: 1 1 auto;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge { margin-left: 8px; font-size: 11px; color: #fff; background: var(--accent); padding: 2px 6px; border-radius: 999px; box-shadow: 0 0 10px rgba(145,70,255,0.5); }
.badge.alert { background: var(--neon-green); color: #071507; box-shadow: 0 0 12px rgba(57,255,20,0.8); }
.remove { appearance: none; border: 1px solid #2b3654; background: #1a2034; color: #e6e8ee; border-radius: 6px; padding: 3px 6px; font-size: 12px; cursor: pointer; margin-left: 8px; box-shadow: 0 0 10px rgba(0,229,255,0.25); }
.btn { appearance: none; border: 1px solid #2b3654; background: #1a2034; color: #e6e8ee; border-radius: 6px; padding: 3px 6px; font-size: 12px; cursor: pointer; margin-left: 8px; box-shadow: 0 0 10px rgba(0,229,255,0.25); }
.btn.visit { background: #263149; }
.btn.fs { background: #203042; }
.messages {
  padding: 8px 10px;
  height: 300px;
  overflow-y: auto;
}
.msg { padding: 4px 0; }
.user { color: var(--muted); margin-right: 6px; }
.msg.mention { background: rgba(57,255,20,0.12); border-radius: 4px; box-shadow: 0 0 10px rgba(57,255,20,0.25) inset; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
@keyframes neonPulse {
  0% { box-shadow: 0 0 0 rgba(57,255,20,0); }
  50% { box-shadow: 0 0 18px rgba(57,255,20,0.8), 0 0 36px rgba(57,255,20,0.45); }
  100% { box-shadow: 0 0 0 rgba(57,255,20,0); }
}

/* Mobile responsiveness */
@media (max-width: 740px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .topbar form { flex: 1 1 100%; }
  .topbar #watch-name { flex: 1 1 100%; max-width: 100%; }
  .favorites { flex: 1 1 100%; flex-wrap: wrap; }
  .favorites input, .favorites select, .favorites button { flex: 1 1 48%; }
  .grid { grid-template-columns: 1fr; gap: 8px; }
  .column .header { padding: 6px 8px; }
  .btn, .remove { padding: 3px 6px; font-size: 11px; }
  .summary { font-size: 11px; }
  .messages { height: 220px; }
}

@media (max-width: 480px) {
  .topbar h1 { font-size: 16px; }
  .badge { font-size: 10px; }
  .topbar button { padding: 6px 10px; }
}
