/* ===== Root theme (dark, bordeaux accents) ===== */
:root {
    --bg: #1b1c1e;
    /* anthracite */
    --panel: #202226;
    /* cards */
    --bg-footer: #151617;
    /* ticker bar */
    --text: #f2f2f2;
    --muted: #cfcfcf;
    --accent: #800020;
    /* bordeaux */
    --ok: #00c853;
    /* connected green */
    --danger: #dc3545;
    --speed: 20s;
    /* default ticker loop duration */
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --bar-h: 89px;
}

/* Standardhöhe der Bar */

html,
body {
    margin: 0;
    padding: 0;
    color: var(--text);
    font-family: system-ui, Segoe UI, Arial, sans-serif;
    background: transparent;
}

/* Add .bg to <body> if you want a solid dark backdrop instead of transparency */
body.bg {
    background: var(--bg);
}

/* ===== Shared UI atoms ===== */
button {
    padding: 11px 16px;
    border-radius: 10px;
    border: 1px solid #3a3a3a;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

button.secondary {
    background: #2b2d31;
}

button.danger {
    background: var(--danger);
    border-color: #a52834;
}

label {
    display: block;
    margin: 12px 0 10px;
}

input[type="text"],
input[type="number"],
input[type="password"] {
    width: 100%;
    padding: 13px 15px;
    border-radius: 10px;
    background: #25272c;
    color: #fff;
    border: 1px solid #333;
    outline: none;
}

input::placeholder {
    color: #bdbdbd;
}

.w120 {
    width: 120px
}

.w160 {
    width: 160px
}

.w200 {
    width: 200px
}

.spacer {
    flex: 1
}

/* Toggle switch (used everywhere) */
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex: 0 0 auto;
}

.switch input {
    display: none;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #4a4a4a;
    border: 1px solid #333;
    border-radius: 999px;
    transition: all .2s ease;
}

.slider:before {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 22px;
    height: 22px;
    background: #ddd;
    border-radius: 50%;
    transition: all .2s ease;
}

.switch input:checked+.slider {
    background: var(--ok);
}

.switch input:checked+.slider:before {
    transform: translateX(22px);
}

/* Simple flex row helper (Control only) */
.row {
    display: flex;
    gap: 22px;
    align-items: center;
    flex-wrap: wrap;
    margin: 14px 0;
}

.muted {
    color: var(--muted);
    font-size: 14px;
    margin-top: 8px;
}

/* Cards / layout (Control) */
.wrap {
    max-width: 1060px;
    margin: 40px auto;
    padding: 0 22px;
}

h2 {
    margin: 0 0 18px;
}

h3 {
    margin: 0 0 12px;
}

.card {
    background: var(--panel);
    border: 1px solid #2a2c31;
    border-radius: 14px;
    padding: 26px;
    margin: 26px 0;
}

.list {
    margin-top: 14px;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 0;
    border-bottom: 1px dashed #333;
}

.list-item:last-child {
    border-bottom: 0;
}

/* Login overlay (Control) */
#lock {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .78);
    backdrop-filter: saturate(120%) blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#lock .panel {
    width: min(520px, 90vw);
    background: #202226;
    border: 1px solid #2a2c31;
    border-radius: 16px;
    padding: 26px;
}

#lock h3 {
    margin: 0 0 12px;
}

#lock .err {
    color: #ff6b6b;
    min-height: 18px;
}

/* Connection status (Overlay) */
.status {
    position: absolute;
    right: 16px;
    top: 10px;
    font-style: italic;
    opacity: .9;
    z-index: 60;
}

.status.connected {
    color: var(--ok);
}

.status.disconnected {
    color: var(--text);
}

/* Popup banner (Overlay) */
#banner {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 12px;
    background: rgba(0, 0, 0, .75);
    color: #fff;
    font-weight: 700;
    font-size: 28px;
    opacity: 0;
    transition: opacity .25s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
    z-index: 50;
}

#banner.show {
    opacity: 1;
}

/* Footer ticker (Overlay) */
#footer {
    position: absolute;
    left: 0;
    right: 0;
    height: var(--bar-h);
    background: var(--bg-footer);
    display: flex;
    align-items: center;
    padding: 0;
    color: var(--text);
    font-size: 18px;
    z-index: 10;
    /* sichtbare obere UND untere Kante */
    border-top: 1px solid #222;
    border-bottom: 1px solid #111;
    /* falls die äußerste Pixelreihe vom Browser-Source gecropped wird,
     sichern die inset-Schatten die Kanten innerhalb der Fläche */
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04),
        inset 0 -1px 0 rgba(0, 0, 0, 0.60);
}

#ticker-rail {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: var(--bar-h);
}

#ticker {
    position: absolute;
    white-space: nowrap;
    line-height: var(--bar-h);
    will-change: transform;
    animation: scroll var(--speed) linear infinite;
}

#ticker {
    position: absolute;
    white-space: nowrap;
    line-height: 70px;
    will-change: transform;
    animation: scroll var(--speed) linear infinite;
}

/* seamless loop: JS duplicates content to 200% width and we translate -50% */
@keyframes scroll {
    from {
        transform: translateX(0)
    }

    to {
        transform: translateX(-50%)
    }
}

/* Bubbles / separators (Overlay) */
.chip {
    display: inline-block;
    margin: 0 20px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(128, 0, 32, .18);
    border: 1px solid rgba(128, 0, 32, .5);
    color: var(--text);
    font-weight: 600;
}

.chip .sym {
    color: #ffdde9;
}

.sep {
    margin: 0 16px;
    opacity: .6;
}

.sep.cat {
    margin: 0 28px;
    opacity: .85;
    font-weight: 700;
}