/* TS3 Viewer — Nightmare Theme
   Styles für das HTML-Fragment von https://api.n8m4re.com/ts3viewer/view.php
   (lag früher inline im Fragment und wurde bei jedem Poll mitgeschickt). */

.ts3-viewer {
    position: relative;
    width: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    color: #e4e4e7;
    line-height: 1.6;
}

.ts3-viewer ul { list-style: none; margin: 0; padding: 0 0 0 20px; }
.ts3-viewer > .ts3-content > ul { padding-left: 0; }
.ts3-viewer img { width: 14px; height: 14px; vertical-align: middle; opacity: 0.85; filter: brightness(1.1); }

.ts3-viewer li {
    padding: 6px 8px 6px 28px;
    margin: 1px 0;
    border-radius: 6px;
    background-repeat: no-repeat;
    background-position: 6px 9px;
    background-size: 16px;
    transition: background-color 0.2s ease;
    position: relative;
    cursor: default;
}
.ts3-viewer li:hover { background-color: rgba(168, 85, 247, 0.1); }

/* Zeile = Name links, Icons rechts */
.ts3-viewer .row-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ts3-viewer .name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts3-viewer .icon { flex: 0 0 auto; display: flex; gap: 3px; align-items: center; }
.ts3-viewer .icon img { opacity: 0.6; transition: opacity 0.2s, transform 0.15s ease; }
.ts3-viewer .icon img:hover { opacity: 1; transform: scale(1.2); }
.ts3-viewer .count { flex: 0 0 auto; font-size: 11px; color: #71717a; font-variant-numeric: tabular-nums; }
.ts3-viewer .group-tag { color: #a1a1aa; font-weight: 400; }

/* Server */
.ts3-viewer li.ts3-server {
    background-image: url('https://api.n8m4re.com/ts3viewer/img/server_green.png');
    background-position: 8px center;
    font-weight: 600;
    font-size: 14px;
    color: #c084fc;
    padding: 10px 8px 10px 32px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.15);
    margin-bottom: 4px;
    border-radius: 6px 6px 0 0;
}

/* Channels */
.ts3-viewer li.channel { background-image: url('https://api.n8m4re.com/ts3viewer/img/channel_green_subscribed.png'); color: #a1a1aa; }
.ts3-viewer li.pwchannel { background-image: url('https://api.n8m4re.com/ts3viewer/img/channel_private.png'); color: #71717a; }
.ts3-viewer li.channel_red { background-image: url('https://api.n8m4re.com/ts3viewer/img/channel_red.png'); color: #f87171; }
.ts3-viewer li.channel.has-clients > .row-line .name,
.ts3-viewer li.pwchannel.has-clients > .row-line .name { color: #e4e4e7; }

/* Spacer */
.ts3-viewer li.spacer { padding-left: 8px; color: #52525b; font-size: 11px; letter-spacing: 2px; }
.ts3-viewer li.spacer:hover { background-color: transparent; }
.ts3-viewer li.spacer > div { overflow: hidden; white-space: nowrap; }
/* Unter-Channels eines Spacers: normale Schrift, kaum eingerückt */
.ts3-viewer ul.spacer-children { padding-left: 0; margin-top: 2px; font-size: 13px; letter-spacing: normal; }
.ts3-viewer .spacer-center { text-align: center; }
.ts3-viewer .spacer-right { text-align: right; }
.ts3-viewer .spacer-line { overflow: hidden; text-overflow: clip; letter-spacing: 0; }

/* Clients */
.ts3-viewer li.player { background-image: url('https://api.n8m4re.com/ts3viewer/img/player_off.png'); font-weight: 500; color: #e4e4e7; }
.ts3-viewer li.player:hover, .ts3-viewer li.player_on:hover { background-color: rgba(74, 222, 128, 0.08); }
.ts3-viewer li.player_on { background-image: url('https://api.n8m4re.com/ts3viewer/img/player_on.png'); font-weight: 600; color: #4ade80; }
.ts3-viewer li.player_commander { background-image: url('https://api.n8m4re.com/ts3viewer/img/player_commander.png'); font-weight: 500; color: #e4e4e7; }
.ts3-viewer li.player_commander_on { background-image: url('https://api.n8m4re.com/ts3viewer/img/player_commander_on.png'); font-weight: 600; color: #4ade80; }
.ts3-viewer li.input_muted { background-image: url('https://api.n8m4re.com/ts3viewer/img/input_muted.png'); font-weight: 500; color: #71717a; }
.ts3-viewer li.head { background-image: url('https://api.n8m4re.com/ts3viewer/img/output_muted.png'); font-weight: 500; color: #71717a; }
.ts3-viewer li.away { background-image: url('https://api.n8m4re.com/ts3viewer/img/away.png'); font-weight: 500; color: #52525b; font-style: italic; }

/* Links */
.ts3-viewer a { color: inherit; text-decoration: none; transition: color 0.2s; }
.ts3-viewer a:hover, .ts3-viewer a:focus-visible { color: #c084fc; text-shadow: 0 0 8px rgba(192, 132, 252, 0.3); }
.ts3-viewer a:focus-visible { outline: 1px solid rgba(192, 132, 252, 0.6); outline-offset: 2px; border-radius: 3px; }

/* Leerer Server */
.ts3-viewer .ts3-empty { padding: 6px 8px 2px; color: #52525b; font-size: 12px; text-align: center; }

/* Stats + Join */
.ts3-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 14px 16px;
    border-top: 1px solid rgba(168, 85, 247, 0.1);
    margin-top: 8px;
}
.ts3-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ts3-stat-value { font-size: 14px; font-weight: 600; color: #c084fc; font-variant-numeric: tabular-nums; transition: color 0.2s; }
.ts3-stat:hover .ts3-stat-value { color: #e9d5ff; }
.ts3-stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: #52525b; font-weight: 500; }
.ts3-stat-divider { width: 1px; height: 28px; background: rgba(168, 85, 247, 0.15); }

.ts3-join {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.12);
    color: #e9d5ff !important;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.ts3-join:hover, .ts3-join:focus-visible {
    background: rgba(168, 85, 247, 0.25);
    border-color: rgba(192, 132, 252, 0.7);
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.35);
    text-shadow: none !important;
}

/* Error (Fragment vom Server) */
.ts3-error { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 2rem; color: #f87171; font-size: 14px; font-weight: 500; }
.ts3-error-icon { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #f87171; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex-shrink: 0; }

.ts3-content { padding: 16px 20px; }

@media (max-width: 576px) {
    .ts3-content { padding: 12px 10px; }
    .ts3-viewer ul { padding-left: 14px; }
    .ts3-stats { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .ts3-viewer li, .ts3-viewer .icon img, .ts3-join { transition: none; }
}
