:root{
  --bg: #0b0f16;             /* echtes dunkles Blau-Schwarz */
  --panel: #111827;          /* solides Panel */
  --panel2: #0f172a;         /* leichter Verlauf */
  --text: rgba(240, 244, 255, 0.92);
  --muted: rgba(240, 244, 255, 0.65);
  --neon: rgba(90, 255, 190, 0.95);
  --neon2: rgba(130, 180, 255, 0.95);
  --warn: rgba(255, 210, 90, 0.95);
  --sub: rgba(255, 120, 220, 0.95);
  --shadow: 0 18px 60px rgba(0,0,0,0.55);
  --radius: 16px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial;
  color: var(--text);
}

#frame{
  height:100%;
  width:100%;
  position:relative;
  overflow:hidden;
}

#chat{
  position:absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel2) 100%);
  border: 1px solid rgba(120, 255, 210, 0.14);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}

/* subtle CRT vibe */
#scanlines{
  position:absolute;
  inset:0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.02),
    rgba(255,255,255,0.02) 1px,
    rgba(0,0,0,0) 3px,
    rgba(0,0,0,0) 6px
  );
  pointer-events:none;
  mix-blend-mode: overlay;
  opacity: 0.15;
}

#glow{
  position:absolute;
  inset:-40px;
  background: radial-gradient(circle at 20% 15%, rgba(90,255,190,0.12), transparent 45%),
              radial-gradient(circle at 85% 25%, rgba(130,180,255,0.12), transparent 45%),
              radial-gradient(circle at 45% 95%, rgba(255,120,220,0.10), transparent 55%);
  filter: blur(14px);
  pointer-events:none;
}

#topbar{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.12);
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

.brand .dot{
  width:10px;height:10px;border-radius:50%;
  background: var(--neon);
  box-shadow: 0 0 14px rgba(90,255,190,0.65);
}

.hint{
  font-size: 12px;
  color: var(--muted);
  opacity: 0.85;
}

#log{
  position:relative;
  height: calc(100% - 44px);
  padding: 12px;
  overflow-y: auto;
  scroll-behavior: smooth; /* smooth scroll */
}

/* hide scrollbars but keep scrolling */
#log::-webkit-scrollbar { width: 8px; }
#log::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 10px; }
#log::-webkit-scrollbar-track { background: rgba(0,0,0,0); }

.msg{
  display:flex;
  gap:10px;
  padding: 8px 10px;
  margin: 0 0 10px 0;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.16);
  backdrop-filter: blur(6px);
}

.msg.sub{
  border-color: rgba(255,120,220,0.22);
  box-shadow: 0 0 0 1px rgba(255,120,220,0.10), 0 0 18px rgba(255,120,220,0.10);
}

.badges{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  min-width: 18px;
  margin-top: 2px;
}

.badge{
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.20);
}

.badge.broadcaster{ background: rgba(255,70,70,0.95); box-shadow: 0 0 10px rgba(255,70,70,0.35); }
.badge.mod{ background: rgba(90,255,190,0.95); box-shadow: 0 0 10px rgba(90,255,190,0.35); }
.badge.vip{ background: rgba(130,180,255,0.95); box-shadow: 0 0 10px rgba(130,180,255,0.35); }
.badge.subscriber{ background: rgba(255,120,220,0.95); box-shadow: 0 0 10px rgba(255,120,220,0.35); }
.badge.founder{ background: rgba(255,210,90,0.95); box-shadow: 0 0 10px rgba(255,210,90,0.35); }

.content{
  flex:1;
  min-width: 0;
}

.header{
  display:flex;
  align-items:baseline;
  gap:10px;
  margin-bottom: 3px;
}

.user{
  font-weight: 800;
  font-size: 14px;
  text-shadow: 0 0 10px rgba(90,255,190,0.08);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
}

.meta{
  font-size: 12px;
  color: var(--muted);
}

.text{
  font-size: 14px;
  line-height: 1.35;
  word-wrap: break-word;
}

.emote{
  height: 28px;
  vertical-align: middle;
  margin: 0 2px;
  transform: translateY(2px);
  image-rendering: auto;
}

.bits{
  color: var(--warn);
  font-weight: 800;
}

.fade-in{
  animation: fadeIn 180ms ease-out;
}

@keyframes fadeIn{
  from { opacity:0; transform: translateY(6px); }
  to   { opacity:1; transform: translateY(0); }
}
