/* doemlang.eu – Twitch Multi-Stream */

:root {
    --bg: #f6f6f3;
    --surface: #ffffff;
    --ink: #111112;
    --text: #1b1b1d;
    --muted: #707074;
    --faint: #a4a4a8;
    --line: #e3e3de;
    --line-strong: #c9c9c3;
    --hover: #eeeeea;
    --accent: #ff4f1f;
    --danger: #d4321c;
    --radius: 6px;
    --font: "Inter var", Inter, "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d0d0e;
        --surface: #151517;
        --ink: #f1f1ee;
        --text: #e6e6e3;
        --muted: #8e8e93;
        --faint: #5c5c61;
        --line: #252528;
        --line-strong: #3a3a3e;
        --hover: #1d1d20;
        --accent: #ff6a3d;
        --danger: #ff6b55;
    }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 var(--font);
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem); font-weight: 650; letter-spacing: -.025em; line-height: 1.1; }
.label { font-size: .8rem; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: var(--mono); font-size: .8rem; letter-spacing: -.01em; }
.ico { width: 17px; height: 17px; flex: none; }
::selection { background: var(--accent); color: #fff; }

/* ---------------------------------------------------------------- Wortmarke */

.wordmark {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    text-decoration: none;
    font-size: .95rem;
    letter-spacing: -.01em;
    white-space: nowrap;
}
.wm-domain { font-weight: 700; color: var(--ink); }
.wm-domain::after { content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 2px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.wm-sep { color: var(--faint); }
.wm-app { color: var(--muted); font-weight: 500; }

/* ---------------------------------------------------------------- Bedienelemente */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
    font: 500 .92rem/1 var(--font);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s, border-color .12s, color .12s, transform .12s;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.primary:hover { background: var(--text); }
.btn.primary .ico:last-child { transition: transform .15s; }
.btn.primary:hover .ico:last-child { transform: translateX(2px); }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); }
.btn.small { height: 32px; padding: 0 11px; font-size: .85rem; gap: 6px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.btn-meta { opacity: .55; margin-left: -3px; }

.icon-btn {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: var(--muted);
    cursor: pointer;
    text-decoration: none;
    transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); }

.text-link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--text);
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 3px;
}
.text-link:hover { text-decoration-color: var(--accent); }

.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: .8rem; font-weight: 500; color: var(--muted); }
input[type=text], input[type=password], select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: .92rem;
    transition: border-color .12s, box-shadow .12s;
}
input::placeholder { color: var(--faint); }
input:hover, select:hover { border-color: var(--muted); }
input:focus, select:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent);
}
.btn:focus-visible, .icon-btn:focus-visible, .drop:focus-visible, .tile:focus-visible, a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.alert { color: var(--danger); font-size: .9rem; font-weight: 500; }

/* ---------------------------------------------------------------- Kopfzeile */

.bar { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.bar-inner { max-width: 1180px; margin: 0 auto; height: 56px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bar-right { display: flex; align-items: center; gap: 14px; }
.bar-right form { margin: 0; }

/* ---------------------------------------------------------------- Login & Hinweisseiten */

.page-auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth { width: 100%; max-width: 360px; }
.auth h1 { font-size: 1.9rem; margin: 44px 0 8px; }
.auth > .muted { font-size: .95rem; }
.auth .alert { margin-top: 18px; }
.auth-form { display: grid; gap: 16px; margin-top: 28px; }
.auth-form .btn { justify-self: start; margin-top: 4px; }
.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 12px);
    background: var(--ink);
    color: var(--bg);
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: .88rem;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s, transform .18s;
    z-index: 200;
    max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); color: #fff; }

/* ---------------------------------------------------------------- Anmeldung */

.auth { max-width: 400px; }
.btn.twitch { margin-top: 28px; height: 44px; padding: 0 20px; background: #9146ff; border-color: #9146ff; color: #fff; font-weight: 600; }
.btn.twitch:hover { background: #772ce8; border-color: #772ce8; }
.btn.twitch .ico { width: 18px; height: 18px; }
.steps { margin: 24px 0 0; padding-left: 20px; display: grid; gap: 10px; color: var(--text); font-size: .93rem; }
.steps a { text-underline-offset: 3px; }

/* ---------------------------------------------------------------- Kopfzeile */

.me { display: inline-flex; align-items: center; gap: 9px; font-size: .9rem; font-weight: 500; }
.me img { width: 26px; height: 26px; border-radius: 50%; }

/* ---------------------------------------------------------------- Auswahl */

.pick { max-width: 1180px; margin: 0 auto; padding: 36px 24px 64px; }
body.has-tray .pick { padding-bottom: 120px; }
.pick-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 32px; }
.pick-head .muted { margin-top: 8px; }
.pick-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.search { position: relative; display: block; }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input { padding-left: 36px; width: 220px; }
.add { display: flex; align-items: center; gap: 2px; margin: 0; }
.add input { width: 170px; }
.add .icon-btn { height: 40px; width: 40px; }

.group { margin-top: 8px; }
.group + .group { margin-top: 44px; }
.group h2 { margin-bottom: 14px; display: flex; gap: 8px; align-items: baseline; }
.count { color: var(--faint); font-weight: 500; }
.empty { padding: 18px 0; }

.mark {
    position: absolute;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    opacity: 0;
    transform: scale(.7);
    transition: opacity .12s, transform .12s;
}
.mark .ico { width: 15px; height: 15px; }
.on .mark { opacity: 1; transform: scale(1); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px 18px; }
.card {
    display: grid;
    gap: 10px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    min-width: 0;
}
.thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--hover);
    outline: 2px solid transparent;
    outline-offset: 2px;
    transition: outline-color .12s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.card:hover .thumb img { transform: scale(1.03); }
.card.on .thumb { outline-color: var(--accent); }
.card .mark { top: 8px; right: 8px; }
.badge-live, .badge-viewers {
    position: absolute;
    bottom: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.4;
}
.badge-live { left: 8px; background: #e5352b; color: #fff; text-transform: uppercase; letter-spacing: .04em; }
.badge-viewers { left: 52px; background: rgb(0 0 0 / .62); color: #fff; font-variant-numeric: tabular-nums; }
.meta { display: flex; gap: 10px; min-width: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; background: var(--hover); }
.meta-text { display: grid; min-width: 0; line-height: 1.35; }
.meta-text strong { font-weight: 600; font-size: .93rem; color: var(--ink); }
.meta-text .title, .meta-text .game { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .84rem; }
.meta-text .game { color: var(--muted); }

.offline { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.off-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 36px 7px 8px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: none;
    color: var(--muted);
    font: inherit;
    font-size: .9rem;
    text-align: left;
    cursor: pointer;
    min-width: 0;
    transition: background .12s, color .12s, border-color .12s;
}
.off-item span:not(.mark) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.off-item .avatar { width: 28px; height: 28px; filter: grayscale(1); opacity: .7; }
.off-item:hover { background: var(--hover); color: var(--text); }
.off-item.on { border-color: var(--accent); color: var(--text); }
.off-item .mark { right: 8px; width: 20px; height: 20px; }
.off-item .mark .ico { width: 13px; height: 13px; }

/* ---------------------------------------------------------------- Auswahlleiste */

.tray {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
}
.tray-inner { max-width: 1180px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 10px; }
.chips { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 30px;
    padding: 0 4px 0 11px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 500;
}
.chip.is-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #e5352b; margin-right: 3px; }
.chip-x { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.chip-x:hover { background: var(--hover); color: var(--text); }
.chip-x .ico { width: 13px; height: 13px; }

/* ---------------------------------------------------------------- Ansehen */

body.watching { overflow: hidden; }
.watch {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    background: #0b0b0c;
    color: #e6e6e3;
    --hover: #1d1d20;
    --muted: #8e8e93;
    --text: #e6e6e3;
    --line-strong: #3a3a3e;
}
.watch-bar { height: 44px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 8px; border-bottom: 1px solid #1d1d20; }
.watch-bar .btn { color: #b9b9bd; }
.watch-names { flex: 1; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.wname { flex: none; height: 28px; padding: 0 10px; border: 0; border-radius: var(--radius); background: none; color: #8e8e93; font: 500 .84rem/1 var(--font); cursor: pointer; }
.wname:hover { color: #e6e6e3; background: #1d1d20; }
.wname.on { color: #fff; box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.watch-actions { display: flex; align-items: center; gap: 2px; }
.watch-sep { width: 1px; height: 20px; margin: 0 6px; background: #2a2a2e; }
@media (max-width: 760px) {
    #playAll, #pauseAll { font-size: 0; gap: 0; padding: 0 9px; }
}
.watch .icon-btn.on { color: var(--accent); }
.watch-body { flex: 1; display: flex; min-height: 0; }
.stage { position: relative; flex: 1; min-width: 0; margin: 6px; }
.tile { position: absolute; background: #000; border-radius: 4px; overflow: hidden; transition: left .2s, top .2s, width .2s, height .2s; }
.tile-player { position: absolute; inset: 0; }
.tile iframe { width: 100%; height: 100%; border: 0; display: block; }
.tile.is-audio { box-shadow: 0 0 0 2px var(--accent); }
.tile-ui {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s, visibility .15s;
}
.tile:hover .tile-ui, .tile-ui:focus-within, .tile.dragging .tile-ui { opacity: 1; visibility: visible; }
.tile-grip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 32px;
    padding: 0 10px 0 6px;
    border-radius: var(--radius);
    background: rgb(0 0 0 / .65);
    color: #ddd;
    cursor: grab;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
    min-width: 0;
}
.tile-grip:hover { background: rgb(0 0 0 / .8); color: #fff; }
.tile-grip .ico { width: 16px; height: 16px; flex: none; }
.tile-name { font-size: .8rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.dragging { transition: none; z-index: 5; opacity: .88; box-shadow: 0 12px 40px rgb(0 0 0 / .6), 0 0 0 2px var(--accent); }
.tile.dragging .tile-grip { cursor: grabbing; }
.stage.is-dragging iframe { pointer-events: none; }
.stage.is-dragging { cursor: grabbing; }
.tile-btns { display: flex; gap: 2px; background: rgb(0 0 0 / .65); border-radius: var(--radius); padding: 2px; pointer-events: auto; }
.tile-btn { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 4px; background: none; color: #ddd; cursor: pointer; padding: 0; }
.tile-btn:hover { background: rgb(255 255 255 / .14); color: #fff; }
.tile-btn .ico { width: 16px; height: 16px; }

.chat { width: 340px; flex: none; display: flex; flex-direction: column; border-left: 1px solid #1d1d20; }
.chat select { height: 36px; border-radius: 0; border: 0; border-bottom: 1px solid #1d1d20; background: #0b0b0c; color: #e6e6e3; font-weight: 500; }
.chat-frame { flex: 1; min-height: 0; }
.chat-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------------------------------------------------------------- Kleinere Bildschirme */

@media (max-width: 760px) {
    .bar-inner, .pick, .tray-inner { padding-left: 16px; padding-right: 16px; }
    .me span { display: none; }
    .pick-tools, .search, .search input, .add { width: 100%; }
    .add input { flex: 1; width: auto; }
    .cards { grid-template-columns: 1fr; }
    .watch-body { flex-direction: column; }
    .chat { width: auto; height: 42%; border-left: 0; border-top: 1px solid #1d1d20; }
    .tile-ui { opacity: 1; visibility: visible; }
}
