:root {
  --bg: #0b0e13;
  --panel: rgba(22, 27, 34, 0.72);
  --panel-solid: #161b22;
  --panel2: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #3b82f6;
  --ok: #2ea043;
  --alarm: #f85149;
  --warn: #d29922;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--text);
  font: 14px/1.45 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: transparent;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { text-align: right; }
.error { color: var(--alarm); margin-top: 8px; min-height: 18px; }

/* Aurora-Hintergrund (ReactBits-inspiriert) */
.aurora {
  position: fixed; inset: -25% -10% auto -10%; height: 75vh; z-index: 0; pointer-events: none;
  filter: blur(70px); opacity: 0.4;
  background:
    radial-gradient(38% 60% at 18% 28%, #1d4ed8 0%, transparent 62%),
    radial-gradient(34% 55% at 72% 22%, #0e7490 0%, transparent 62%),
    radial-gradient(46% 52% at 48% 42%, #7c3aed 0%, transparent 62%);
  background-repeat: no-repeat;
  animation: auroraDrift 20s ease-in-out infinite alternate;
}
@keyframes auroraDrift {
  0% { transform: translate3d(-3%, -2%, 0) scale(1); }
  50% { transform: translate3d(3%, 2%, 0) scale(1.12); }
  100% { transform: translate3d(-2%, 3%, 0) scale(1.06); }
}

/* Buttons */
button {
  cursor: pointer; border-radius: 9px; border: 1px solid var(--border);
  background: var(--panel2); color: var(--text); padding: 8px 14px; font-size: 14px;
  transition: border-color .15s, background .15s, transform .05s;
}
button:hover { border-color: var(--accent); }
button:active { transform: translateY(1px); }
button.primary { background: linear-gradient(180deg, #4790ff, var(--accent)); border-color: transparent; color: #fff; font-weight: 600; box-shadow: 0 4px 14px rgba(59,130,246,.35); }
button.primary:hover { filter: brightness(1.08); }
button.ghost { background: transparent; }
button.small { padding: 5px 11px; font-size: 13px; }
button.wide { width: 100%; }

input, select {
  background: rgba(0,0,0,.25); border: 1px solid var(--border); color: var(--text);
  border-radius: 9px; padding: 9px 11px; font-size: 14px; width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }

/* Brand + Shiny-Text (ReactBits-inspiriert) */
.brand { font-size: 18px; font-weight: 800; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; }
.brand.big { font-size: 30px; justify-content: center; }
.logo { filter: drop-shadow(0 0 6px rgba(59,130,246,.6)); }
.shiny {
  background: linear-gradient(100deg, #e6edf3 18%, #ffffff 34%, #5aa2ff 50%, #e6edf3 66%);
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: -200% center; } }

/* Login */
.login-overlay { position: fixed; inset: 0; display: grid; place-items: center; z-index: 30; }
.login-card {
  background: var(--panel); backdrop-filter: blur(14px); border: 1px solid var(--border); border-radius: 18px;
  padding: 38px 34px; width: 330px; text-align: center; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.login-card p { margin: 0 0 8px; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 16px; padding: 12px 20px;
  background: rgba(13,17,23,.7); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.topbar .status { flex: 1; color: var(--muted); font-size: 13px; }
.actions { display: flex; gap: 8px; }

/* App-Container ueber der Aurora (Login behaelt sein position:fixed aus .login-overlay) */
#app { position: relative; z-index: 1; }

/* Ticker (Laufband, kein Label, kein Hover-Stop) */
.ticker { position: relative; z-index: 1; background: rgba(248,81,73,.08); border-bottom: 1px solid var(--border); overflow: hidden; }
.ticker-viewport { overflow: hidden; display: flex; align-items: center; }
.ticker-track { display: inline-flex; white-space: nowrap; will-change: transform; animation: tickerScroll 55s linear infinite; }
.ticker-item { padding: 7px 16px; font-size: 13px; font-weight: 600; color: var(--text); }
.ticker-sep { color: var(--alarm); align-self: center; font-weight: 800; }
@keyframes tickerScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Layout */
.grid {
  position: relative; z-index: 1; display: grid; gap: 16px; padding: 16px;
  grid-template-columns: 1.4fr 1fr; grid-template-areas: "watch chart" "signals chart";
}
.ticker-panel { grid-area: watch; }
.chart-panel { grid-area: chart; }
.signals-panel { grid-area: signals; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; grid-template-areas: "watch" "chart" "signals"; } }

.panel {
  background: var(--panel); backdrop-filter: blur(12px) saturate(120%);
  border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,.28); animation: rise .4s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 10px; }
.panel-head h2 { font-size: 15px; margin: 0; }

/* Filter-Chips */
.filters { display: flex; gap: 8px; margin: 4px 0 12px; }
.chip { padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel2); border: 1px solid var(--border); color: var(--muted); }
.chip:hover { color: var(--text); }
.chip.active { color: #fff; border-color: var(--accent); background: rgba(59,130,246,.18); }
.chip.ok.active { border-color: var(--ok); background: rgba(46,160,67,.18); }
.chip.cr.active { border-color: var(--alarm); background: rgba(248,81,73,.18); }
.chip-count { opacity: .8; font-weight: 800; }

/* Such-Box */
.add-box { margin-bottom: 12px; }
.search-results { margin-top: 6px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--panel-solid); max-height: 300px; overflow-y: auto; }
.search-results:empty { display: none; }
.sr-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: rgba(59,130,246,.14); }
.sr-sym { font-weight: 700; min-width: 92px; }
.sr-name { flex: 1; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-ex { font-size: 11px; color: var(--muted); background: var(--panel2); padding: 1px 6px; border-radius: 5px; }
.sr-add { color: var(--ok); font-weight: 800; font-size: 16px; }
.sr-empty { padding: 10px 12px; color: var(--muted); }

/* Tabelle */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr { cursor: pointer; transition: background .12s; }
tbody tr:hover { background: var(--panel2); }
tr.selected { background: rgba(59,130,246,.12); }
tr.crossed-row td:first-child { box-shadow: inset 3px 0 0 var(--alarm); }
.sym-name { font-weight: 600; }
.sym-ticker { color: var(--muted); font-size: 12px; }

/* Badges */
.badge { font-size: 11px; padding: 3px 9px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.badge.ok { background: rgba(46,160,67,.16); color: var(--ok); }
.badge.crossed { background: rgba(248,81,73,.16); color: var(--alarm); }

/* Zeile entfernen */
.row-x { opacity: 0; background: transparent; border: none; color: var(--muted); padding: 2px 7px; font-size: 13px; }
tbody tr:hover .row-x { opacity: 1; }
.row-x:hover { color: var(--alarm); border-color: transparent; }

/* Chart */
.tvchart { height: 320px; border-radius: 10px; overflow: hidden; background: var(--panel2); }
.levels { margin-top: 12px; }
.levels table { font-size: 13px; }
.levels .mode-label { color: var(--accent); font-weight: 700; font-size: 12px; margin: 10px 0 2px; }
.lv-inband { color: var(--alarm); font-weight: 700; }

/* Signale */
.signals { display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; }
.signal { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; background: var(--panel2); border-radius: 9px; border-left: 3px solid var(--alarm); }
.signal .t { color: var(--muted); font-size: 12px; white-space: nowrap; }
.signal .s { font-weight: 700; }
.signals .empty { color: var(--muted); padding: 14px; text-align: center; }

/* Settings-Drawer */
.drawer { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; justify-content: flex-end; z-index: 40; backdrop-filter: blur(2px); }
.drawer-body {
  width: 460px; max-width: 100%; height: 100%; display: flex; flex-direction: column;
  background: rgba(18,23,30,.92); backdrop-filter: blur(16px); border-left: 1px solid var(--border);
  box-shadow: -20px 0 60px rgba(0,0,0,.5);
}
.drawer-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; background: rgba(18,23,30,.96); border-bottom: 1px solid var(--border);
}
.drawer-head h2 { margin: 0; font-size: 16px; }
.drawer-head-right { display: flex; align-items: center; gap: 10px; }
.save-hint { font-size: 12px; color: var(--ok); opacity: 0; transition: opacity .2s; }
.save-hint.show { opacity: 1; }
.icon-x { font-size: 17px; width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.icon-x:hover { background: var(--panel2); border-color: var(--alarm); color: var(--alarm); }
.drawer-scroll { padding: 6px 18px 28px; overflow-y: auto; }

.field-group { margin: 8px 0; }
.cat-label { font-size: 11px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: var(--accent); margin: 18px 0 6px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 7px; }
.drawer-scroll > .cat-label:first-of-type { margin-top: 10px; padding-top: 4px; border-top: none; }
.group-label { display: block; font-weight: 700; margin-bottom: 8px; font-size: 13px; }
.field { margin: 8px 0; }
.field label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.check input { width: auto; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; }
.line-checks-v { display: flex; flex-direction: column; gap: 4px; }
.line-checks-v .check { padding: 7px 11px; border-radius: 8px; background: var(--panel2); font-weight: 600; }
.line-checks-v .check:hover { background: rgba(59,130,246,.1); }
.line-row { justify-content: flex-start; gap: 9px; }
.line-row .line-name { flex: 1; font-variant-numeric: tabular-nums; }
.line-row .lineColor { width: 36px; height: 24px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: transparent; cursor: pointer; }
.line-row .lineColor::-webkit-color-swatch-wrapper { padding: 2px; }
.line-row .lineColor::-webkit-color-swatch { border: none; border-radius: 4px; }
.chart-msg { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 13px; }

/* Info-Tooltip (i im Kreis) */
.info {
  display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px;
  border-radius: 50%; border: 1px solid var(--muted); color: var(--muted); font-size: 10px;
  font-style: italic; font-weight: 700; cursor: help; margin-left: 6px; vertical-align: middle; position: relative;
}
.info:hover { border-color: var(--accent); color: var(--accent); }
.info::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: 150%; transform: translateX(-50%);
  width: 230px; background: #0b0e13; border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px;
  font-size: 12px; font-style: normal; font-weight: 400; line-height: 1.4; color: var(--text);
  box-shadow: 0 10px 26px rgba(0,0,0,.5); opacity: 0; visibility: hidden; transition: opacity .15s; z-index: 60; pointer-events: none;
}
.info:hover::after { opacity: 1; visibility: visible; }
.group-label .info { font-size: 9px; }

/* MikeMana Radio (Mini-Player) */
.radio {
  position: fixed; left: 16px; bottom: 16px; z-index: 25; width: 268px;
  background: linear-gradient(165deg, rgba(46,30,68,.94), rgba(16,21,28,.96)); backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.1); border-radius: 16px; box-shadow: 0 18px 44px rgba(0,0,0,.55); overflow: hidden;
}
.radio-head { display: flex; align-items: center; gap: 10px; padding: 9px 11px; cursor: pointer; }
.radio-cover-sm { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; background: #222; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.radio-head-info { flex: 1; min-width: 0; }
.radio-brand { font-size: 12px; font-weight: 800; letter-spacing: .3px; background: linear-gradient(90deg,#c4b5fd,#93c5fd); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.radio-now { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radio-toggle { color: var(--muted); transition: transform .25s; flex-shrink: 0; }
.radio.collapsed .radio-body { display: none; }
.radio:not(.collapsed) .radio-toggle { transform: rotate(90deg); }
.radio-body { padding: 6px 16px 16px; }
.radio-track { font-size: 15px; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radio-artist { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 12px; }
.radio-seek { width: 100%; }
.radio-times { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; margin: 5px 0 12px; }
.radio-controls { display: flex; align-items: center; justify-content: center; gap: 22px; margin-bottom: 14px; }
.radio-btn { background: transparent; border: none; color: var(--muted); font-size: 18px; padding: 4px; border-radius: 8px; line-height: 1; transition: color .15s, transform .05s; }
.radio-btn:hover { color: #fff; }
.radio-btn:active { transform: scale(.9); }
.radio-btn.play { background: #fff; color: #111; width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; padding: 0; box-shadow: 0 4px 16px rgba(255,255,255,.16); }
.radio-btn.play:hover { color: #111; filter: brightness(.93); }
.radio.playing .radio-btn.play { box-shadow: 0 0 0 4px rgba(147,197,253,.22), 0 4px 18px rgba(147,197,253,.4); }
.radio-btn:disabled { opacity: .3; cursor: default; }
.radio-btn:disabled:hover { color: var(--muted); }
.radio-volrow { display: flex; align-items: center; gap: 9px; }
.radio-volrow .radio-vol { flex: 1; }
.radio-vol-ic { font-size: 12px; opacity: .6; }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 4px; background: rgba(255,255,255,.18); border-radius: 4px; padding: 0; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
@media (max-width: 700px) { .radio { left: 8px; right: 8px; bottom: 8px; width: auto; } }

/* Segmented Switch (Pivot-Modus) */
.seg { display: inline-flex; background: rgba(0,0,0,.25); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 3px; }
.seg-btn { background: transparent; border: none; color: var(--muted); padding: 7px 20px; border-radius: 8px; font-weight: 600; font-size: 13px; transition: background .15s, color .15s; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: linear-gradient(180deg, #4790ff, var(--accent)); color: #fff; box-shadow: 0 2px 10px rgba(59,130,246,.4); }

/* Gesperrtes Chat-ID-Feld + Stift */
#tgChatId[readonly] { opacity: .55; cursor: default; }
#btnEditChat.unlocked { border-color: var(--accent); color: var(--accent); }

/* Tagesänderung in der Ticker-Liste */
.chg { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chg-up { color: var(--ok); }
.chg-down { color: var(--alarm); }
.chg-flat { color: var(--muted); }

/* Body: keinen horizontalen Scroll */
body { overflow-x: hidden; }
