:root {
    /* Dread Judgment: fast schwarzes Nachtblau, Violett und Blutrot */
    --bg: #090d16;
    --panel: #0f1523;
    --panel-2: #161e30;
    --line: #222c41;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --accent: #8b5cf6;
    --accent-2: #6d28d9;
    --accent-soft: #a78bfa;
    --blood: #e11d48;
    --blood-glow: rgba(225, 29, 72, .55);
    --violet-glow: rgba(139, 92, 246, .45);
    --red: #ef4444;
    --orange: #fb923c;
    --yellow: #fde68a;
    --green: #34d399;
    --blue: #60a5fa;
    --grey: #64748b;
    --radius: 12px;
    --font-display: "Cinzel", "Times New Roman", serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* versteckte Elemente bleiben versteckt, egal welche Gestaltung */
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 var(--font-body); }
a { color: #bf94ff; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.wrap { word-break: break-word; }

/* Kopfzeile */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); }
.brand-mark.big { font-size: 40px; line-height: 1; }
.channel-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.channel-nav a { color: var(--muted); padding: 6px 10px; border-radius: 6px; }
.channel-nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.channel-nav a.active { background: var(--panel-2); color: var(--text); }
.channel-name { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-right: 10px; }
.channel-name img { width: 26px; height: 26px; border-radius: 50%; }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.userbox form { margin: 0; }
.avatar { width: 28px; height: 28px; border-radius: 50%; }
.avatar-lg { width: 56px; height: 56px; border-radius: 50%; }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }
.container.wide { max-width: 1600px; }
.container.narrow { max-width: 480px; padding-top: 80px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-title { font-weight: 700; font-size: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 16px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.channel-card { display: flex; gap: 14px; align-items: center; color: var(--text); margin: 0; transition: border-color .15s; }
.channel-card:hover { border-color: var(--accent); text-decoration: none; }
.login-card { text-align: center; padding: 36px; }
.login-card .btn { margin: 16px 0; }
.empty { grid-column: 1 / -1; }

/* Elemente */
.btn { display: inline-block; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-twitch { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-twitch:hover { background: var(--accent-2); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-ghost { background: transparent; }
.btn-small { padding: 4px 10px; font-size: 12px; }
.btn-link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }
.btn-link:hover { color: var(--text); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; background: var(--panel-2); border: 1px solid var(--line); }
.role-broadcaster { background: #e91916; border-color: #e91916; color: #fff; }
.role-lead_moderator { background: #0e8a5f; border-color: #0e8a5f; color: #fff; }
.role-moderator { background: #00ad03; border-color: #00ad03; color: #fff; }
.role-vip { background: #e005b9; border-color: #e005b9; color: #fff; }
.pill-dev, .role-developer { background: #3d9bff; border-color: #3d9bff; color: #fff; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag-red { background: rgba(235, 4, 0, .18); color: #ff6b68; }
.tag-orange { background: rgba(255, 138, 61, .18); color: var(--orange); }
.tag-yellow { background: rgba(245, 197, 24, .16); color: var(--yellow); }
.tag-green { background: rgba(0, 194, 122, .16); color: var(--green); }
.tag-grey { background: rgba(160, 160, 171, .14); color: var(--muted); }
.tag-blue { background: rgba(61, 155, 255, .16); color: var(--blue); }
.status { font-size: 13px; font-weight: 600; }
.status::before { content: "●"; margin-right: 6px; }
.status-ok { color: var(--green); }
.status-warn { color: var(--yellow); }
.status-bad { color: var(--red); }
.status-off { color: var(--grey); }
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.flash-ok { background: rgba(0, 194, 122, .1); border-color: rgba(0, 194, 122, .4); }
.flash-bad { background: rgba(235, 4, 0, .1); border-color: rgba(235, 4, 0, .4); }
.flash-warn { background: rgba(245, 197, 24, .1); border-color: rgba(245, 197, 24, .4); }
.quote { color: var(--muted); font-style: italic; }

/* Statistik */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat-value { font-size: 24px; font-weight: 700; }
.stat-value.small { font-size: 15px; padding: 6px 0; }
.stat-label { color: var(--muted); font-size: 12px; }

/* Tabellen & Formulare */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding: 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table form { margin: 0; display: inline; }
input, select { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font: inherit; }
input:focus, select:focus { outline: none; border-color: var(--accent); }
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.filters .grow { flex: 1; min-width: 200px; }
.form label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.form.inline { display: flex; gap: 8px; margin-bottom: 12px; }
.form.inline input { flex: 1; }
.pager { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; }
.pager .disabled { color: var(--grey); }
.inline-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.danger-zone summary { cursor: pointer; color: var(--muted); }

/* Chat */
.chat-layout { display: grid; grid-template-columns: 1fr 380px; gap: 16px; }
@media (max-width: 1000px) { .chat-layout { grid-template-columns: 1fr; } }
.chat-panel, .action-panel { display: flex; flex-direction: column; height: calc(100vh - 120px); margin: 0; position: relative; }
.chat-tools { display: flex; gap: 12px; align-items: center; }
.chat-list, .action-list { flex: 1; overflow-y: auto; }
.msg { padding: 3px 6px; border-radius: 4px; word-break: break-word; }
.msg:hover { background: var(--panel-2); }
.msg-time { color: var(--grey); font-size: 12px; margin-right: 6px; font-variant-numeric: tabular-nums; }
.msg-name { font-weight: 700; }
.msg-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 0 4px; border-radius: 3px; margin-right: 3px; vertical-align: 1px; color: #fff; }
.msg.removed .msg-text { text-decoration: line-through; color: var(--grey); }
.msg .removed-note { color: var(--grey); font-size: 11px; margin-left: 6px; }
.msg.flash-new { animation: flashnew 1.2s ease-out; }
@keyframes flashnew { from { background: rgba(145, 71, 255, .25); } to { background: transparent; } }
.msg.hidden { display: none; }
.chat-jump { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 6px 16px; font-weight: 600; cursor: pointer; }
.act { padding: 10px 4px; border-bottom: 1px solid var(--line); }
.act-head { display: flex; justify-content: space-between; gap: 8px; }
.act-body { margin-top: 4px; font-size: 13px; }
.history .msg { padding: 5px 6px; }

/* Phase 2: Mod-Aktionen */
.msg-actions { display: inline-flex; gap: 2px; margin-right: 6px; vertical-align: 1px; }
.msg-act { background: transparent; border: 1px solid transparent; border-radius: 4px; padding: 0 3px; font-size: 13px; line-height: 18px; cursor: pointer; opacity: .35; color: var(--text); }
.msg:hover .msg-act, .msg-act:focus { opacity: 1; }
.msg-act:hover { background: var(--line); border-color: var(--line); }
.msg-act-ban:hover { background: rgba(235, 4, 0, .3); }
.action-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 18px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .65); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; width: 100%; max-width: 480px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-target { margin: 0 0 8px; }
.modal-quote { background: var(--bg); border-radius: 6px; padding: 8px 10px; margin-bottom: 12px; word-break: break-word; max-height: 120px; overflow: auto; }
.modal-label { display: block; color: var(--muted); font-size: 12px; margin: 12px 0 6px; }
.modal-reason { width: 100%; }
.modal-error { color: #ff6b68; min-height: 20px; margin-top: 10px; font-weight: 600; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips-small { margin-top: 8px; }
.chip { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chips-small .chip { font-size: 12px; padding: 2px 10px; color: var(--muted); }
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-input { width: 90px; padding: 4px 10px; border-radius: 999px; font-size: 13px; }
.btn:disabled { opacity: .6; cursor: wait; }

.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { padding: 10px 16px; border-radius: 8px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); transition: opacity .5s; max-width: 380px; }
.toast-ok { background: #0b5e3f; }
.toast-bad { background: #8a1210; }
.toast.fade { opacity: 0; }

/* Phase 3: Notizen */
.msg-flag { display: inline-block; font-size: 11px; font-weight: 700; padding: 0 4px; margin-left: 4px; border-radius: 3px; vertical-align: 1px; }
.msg-flag:hover { text-decoration: none; filter: brightness(1.2); }
.flag-strike { background: rgba(255, 138, 61, .2); color: var(--orange); }
.flag-note { background: rgba(61, 155, 255, .18); color: var(--blue); }
.modal-history { background: rgba(255, 138, 61, .08); border: 1px solid rgba(255, 138, 61, .3); border-radius: 6px; padding: 8px 10px; margin-bottom: 4px; font-size: 13px; }
.note { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: var(--panel-2); }
.note-pinned { border-color: rgba(245, 197, 24, .5); background: rgba(245, 197, 24, .06); }
.note-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.note-tools { display: flex; gap: 12px; }
.note-tools form { margin: 0; }
.note-body { white-space: pre-wrap; word-break: break-word; }
.note-form textarea { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font: inherit; resize: vertical; }
.note-form textarea:focus { outline: none; border-color: var(--accent); }
.note-form-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }

/* Phase 4: Rechte */
.center { text-align: center; }
.perm-table td, .perm-table th { vertical-align: middle; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .15s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.settings-foot { display: flex; justify-content: flex-end; margin-top: 16px; }
.plain-list { margin: 0; padding-left: 18px; }
.plain-list li { margin-bottom: 6px; }


/* =====================================================================
   Dread-Judgment-Design
   ===================================================================== */
body {
    background:
        radial-gradient(900px 500px at 0% -10%, rgba(139, 92, 246, .14), transparent 60%),
        radial-gradient(800px 500px at 100% -10%, rgba(225, 29, 72, .12), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    min-height: 100vh;
}
::selection { background: rgba(225, 29, 72, .45); }
a { color: var(--accent-soft); }
a:hover { color: #c4b5fd; }
h1, h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: .04em; }
h1 { font-size: 26px; text-shadow: 0 0 24px rgba(139, 92, 246, .25); }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: #e2e8f0; }

/* Kopfzeile */
.topbar {
    background: rgba(9, 13, 22, .82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    border-image: linear-gradient(90deg, transparent, var(--blood) 25%, var(--accent) 75%, transparent) 1;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(225, 29, 72, .6), 0 0 16px var(--blood-glow); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-title { font-family: var(--font-display); font-size: 15px; letter-spacing: .12em; text-transform: uppercase; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }
.channel-nav a { border-radius: 8px; font-weight: 500; }
.channel-nav a.active { background: linear-gradient(180deg, rgba(139, 92, 246, .22), rgba(139, 92, 246, .08)); color: #fff; box-shadow: inset 0 -2px 0 var(--accent); }
.channel-name img, .avatar { box-shadow: 0 0 0 1px var(--line); }

/* Karten */
.card, .stat {
    background: linear-gradient(180deg, rgba(22, 30, 48, .92), rgba(15, 21, 35, .92));
    border: 1px solid var(--line);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .03);
}
.stat { position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--blood), var(--accent)); }
.stat-value { font-family: var(--font-display); color: #fff; }
.channel-card { transition: border-color .2s, box-shadow .2s, transform .2s; }
.channel-card:hover { border-color: rgba(139, 92, 246, .7); box-shadow: 0 0 0 1px rgba(139, 92, 246, .3), 0 12px 40px rgba(139, 92, 246, .2); transform: translateY(-2px); }
.channel-card .avatar-lg { box-shadow: 0 0 0 2px rgba(225, 29, 72, .5), 0 0 18px var(--blood-glow); }

/* Buttons */
.btn { border-radius: 8px; transition: border-color .15s, box-shadow .15s, background .15s; }
.btn:hover { border-color: var(--accent); box-shadow: 0 0 14px rgba(139, 92, 246, .25); }
.btn-twitch { background: linear-gradient(135deg, #8b5cf6, #6d28d9); border-color: #7c3aed; }
.btn-twitch:hover { background: linear-gradient(135deg, #9d74f7, #7c3aed); box-shadow: 0 0 20px var(--violet-glow); }
.btn-danger { background: linear-gradient(135deg, #e11d48, #9f1239); border-color: #be123c; }
.btn-danger:hover { box-shadow: 0 0 20px var(--blood-glow); border-color: #fb7185; }

/* Rollen-Abzeichen passend zum Stil */
.role-broadcaster { background: linear-gradient(135deg, #e11d48, #9f1239); border-color: #e11d48; }
.role-lead_moderator { background: linear-gradient(135deg, #8b5cf6, #6d28d9); border-color: #8b5cf6; }
.role-moderator { background: #0f766e; border-color: #14b8a6; }
.role-vip { background: #a21caf; border-color: #d946ef; }
.pill-dev, .role-developer { background: #1e293b; border-color: #60a5fa; color: #bfdbfe; }

/* Tabellen & Felder */
.table th { color: #7c8aa5; border-bottom-color: var(--line); }
.table tbody tr:hover td { background: rgba(139, 92, 246, .04); }
input, select, .note-form textarea { background: #0b101b; border-color: var(--line); border-radius: 8px; }
input:focus, select:focus, .note-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 92, 246, .18); }

/* Hinweise */
.flash { border-radius: 10px; }
.flash-ok { background: rgba(52, 211, 153, .08); border-color: rgba(52, 211, 153, .35); }
.flash-bad { background: rgba(225, 29, 72, .1); border-color: rgba(225, 29, 72, .45); }
.status-bad { color: #fb7185; }
.tag-red { background: rgba(225, 29, 72, .18); color: #fda4af; }

/* Chat & Dialoge */
.msg:hover { background: rgba(139, 92, 246, .07); }
.chat-jump { background: linear-gradient(135deg, #8b5cf6, #6d28d9); box-shadow: 0 0 20px var(--violet-glow); }
.modal { background: linear-gradient(180deg, #161e30, #0f1523); border-color: rgba(139, 92, 246, .35); box-shadow: 0 0 0 1px rgba(225, 29, 72, .15), 0 30px 80px rgba(0, 0, 0, .7), 0 0 60px rgba(139, 92, 246, .15); }
.modal-overlay { background: rgba(3, 5, 10, .75); backdrop-filter: blur(3px); }
.chip.active { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.switch input:checked + span { background: linear-gradient(135deg, #8b5cf6, #e11d48); }
.toast-ok { background: linear-gradient(135deg, #065f46, #064e3b); border: 1px solid rgba(52, 211, 153, .4); }
.toast-bad { background: linear-gradient(135deg, #9f1239, #4c0519); border: 1px solid rgba(251, 113, 133, .4); }

/* Login mit Dread-Judgment-Artwork */
.login-hero {
    position: fixed; inset: 0; z-index: 0;
    background: url("../images/dj-hero.jpg") center 30% / cover no-repeat;
}
.login-hero::after {
    content: ""; position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at center, rgba(9, 13, 22, .2) 0%, rgba(9, 13, 22, .75) 75%),
        linear-gradient(180deg, rgba(9, 13, 22, .15), rgba(9, 13, 22, .9));
}
.login-card { background: rgba(12, 17, 29, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-color: rgba(139, 92, 246, .35); }
.login-icon { width: 96px; height: 96px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(225, 29, 72, .7), 0 0 40px var(--blood-glow); }
.login-card h1 { margin: 16px 0 4px; font-size: 28px; letter-spacing: .12em; text-transform: uppercase; }
.login-sub { font-family: var(--font-display); color: var(--accent-soft); letter-spacing: .2em; text-transform: uppercase; font-size: 12px; margin-bottom: 18px; }
.login-page .topbar { background: transparent; border-image: none; border-bottom: 0; backdrop-filter: none; }
.login-page main { position: relative; z-index: 1; }
.login-page .login-card { position: relative; z-index: 1; }

/* Discord-Einstellungen */
.form-label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; margin: 12px 0; }
input.full { width: 100%; }
.howto { margin-bottom: 8px; }
.howto summary { cursor: pointer; color: var(--accent-soft); font-size: 13px; }
.howto ol { margin: 8px 0 0; padding-left: 20px; }
.howto li { margin-bottom: 4px; }
.mt { margin-top: 18px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 20px; margin: 8px 0 10px; }
.check-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.settings-foot.gap { gap: 8px; }

/* Im Live-Chat schreiben */
.chat-send { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; }
.chat-send-row { display: flex; gap: 8px; align-items: center; }
.chat-send-row input { flex: 1; }
.chat-send-row input:disabled { opacity: .6; cursor: not-allowed; }
.chat-send-error { color: #fda4af; font-size: 13px; min-height: 18px; margin-top: 4px; }
.chat-reply { display: flex; justify-content: space-between; gap: 8px; align-items: center; background: rgba(139, 92, 246, .1); border: 1px solid rgba(139, 92, 246, .35); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; font-size: 13px; }
.msg-act-reply:hover { background: rgba(139, 92, 246, .3); }
.chat-panel:has(.chat-send) .chat-jump { bottom: 110px; }
.msg-actions { min-width: 106px; }

/* Offizielle Twitch-Abzeichen im Live-Chat */
.msg-badge-img { width: 18px; height: 18px; vertical-align: -4px; margin-right: 3px; border-radius: 3px; }
.msg-badge { border-radius: 4px; padding: 0 5px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }

/* Emotes */
.emote { height: 28px; width: auto; vertical-align: middle; margin: -4px 1px; }
.msg.removed .emote { opacity: .35; filter: grayscale(1); }
.mention { font-weight: 700; color: #e2e8f0; background: rgba(139, 92, 246, .18); border-radius: 4px; padding: 0 3px; }

/* Emote-Auswahl */
.chat-send { position: relative; }
.emote-btn { padding: 6px 10px; font-size: 18px; line-height: 1; }
.emote-picker { position: absolute; right: 0; bottom: calc(100% + 8px); width: min(420px, 100%); max-height: 420px; display: flex; flex-direction: column; z-index: 20;
    background: linear-gradient(180deg, #161e30, #0f1523); border: 1px solid rgba(139, 92, 246, .4); border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6), 0 0 30px rgba(139, 92, 246, .15); padding: 10px; }
.emote-search { width: 100%; margin-bottom: 8px; }
.emote-body { overflow-y: auto; padding-right: 4px; }
.emote-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 8px 2px 6px; }
.emote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 4px; }
.emote-item { background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; height: 40px; }
.emote-item:hover { background: rgba(139, 92, 246, .18); border-color: rgba(139, 92, 246, .45); }
.emote-item img { max-width: 32px; max-height: 32px; }
.emote-empty { padding: 12px; text-align: center; }
.emote-note { padding: 8px 4px; }

/* Livestream neben dem Chat */
.stream-panel { padding: 0; overflow: hidden; margin: 0; grid-area: stream; }
.stream-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.stream-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.chat-layout.with-stream {
    grid-template-columns: minmax(0, 1fr) 440px;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "stream chat" "actions chat";
    height: calc(100vh - 120px);
}
.chat-layout.with-stream .chat-panel { grid-area: chat; height: auto; min-height: 0; }
.chat-layout.with-stream .action-panel { grid-area: actions; height: auto; min-height: 140px; }
.chat-layout.with-stream .stream-frame { max-height: calc(100vh - 300px); }
#stream-toggle.active { border-color: var(--accent); background: rgba(139, 92, 246, .18); }
@media (max-width: 1000px) {
    .chat-layout.with-stream { grid-template-columns: 1fr; grid-template-areas: "stream" "chat" "actions"; height: auto; }
    .chat-layout.with-stream .chat-panel { height: 70vh; }
}
.chat-send-row input { min-width: 0; }
.chat-tools { flex-wrap: wrap; justify-content: flex-end; }
.chat-layout.with-stream { grid-template-columns: minmax(0, 1fr) 460px; }
.chat-layout.with-stream .chat-panel .card-head { flex-wrap: wrap; }
.chat-layout.with-stream .chat-tools { width: 100%; flex-wrap: nowrap; }
.chat-layout.with-stream #chat-filter { flex: 1; min-width: 0; }
.chat-layout.with-stream #chat-conn { white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
