/* Motti Sonar – dunkles Marine-Design mit Sonar-Grün */
:root {
  --bg: #061018;
  --bg-2: #0a1823;
  --panel: #0d1d2a;
  --panel-2: #112634;
  --line: #1b3446;
  --line-2: #26475d;
  --text: #e4f1f5;
  --muted: #8fa9b8;
  --accent: #2ee6a6;
  --accent-2: #38bdf8;
  --gold: #ffd166;
  --good: #34d399;
  --bad: #f87171;
  --twitch: #9146ff;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 15px/1.55 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color: var(--text);
  background: radial-gradient(1200px 600px at 80% -10%, #0f3140 0%, transparent 60%),
              radial-gradient(900px 500px at -10% 20%, #0b2530 0%, transparent 55%), var(--bg);
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: 18px; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
main.wrap { flex: 1; padding: 24px 0 40px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.fine { color: var(--muted); font-size: 12.5px; margin-top: 12px; }
[hidden] { display: none !important; }

/* Kopfzeile */
.top { border-bottom: 1px solid var(--line); background: #06111acc; backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand span { display: flex; flex-direction: column; }
.brand strong { font-size: 17px; letter-spacing: .02em; }
.brand small { color: var(--muted); font-size: 12px; }
nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-link { color: var(--text); text-decoration: none; padding: 6px 12px; border-radius: 8px; font-size: 14px; }
.nav-link:hover { background: var(--panel-2); }
.nav-link.active { background: var(--panel-2); color: var(--accent); }
.lang-switch { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; margin-left: 6px; }
.lang-switch a { color: var(--muted); text-decoration: none; font-size: 12px; padding: 4px 8px; }
.lang-switch a.on { background: var(--accent); color: #042018; font-weight: 700; }
.logout { display: flex; align-items: center; gap: 8px; margin-left: 6px; }
.status-chips { display: inline-flex; gap: 6px; margin-left: 6px; }
.status-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 8px; font-size: 12.5px;
  font-weight: 600; color: var(--text); text-decoration: none; background: var(--panel-2); border: 1px solid var(--line-2); }
.status-chip span { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-chip i { width: 8px; height: 8px; border-radius: 50%; background: #5b6b76; flex: none; }
.status-chip.on i { background: var(--good); box-shadow: 0 0 8px var(--good); }
.status-chip:hover { border-color: var(--accent); }
.logout img { border-radius: 50%; }
.link-btn { background: none; border: 0; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; padding: 0; text-decoration: underline; }

/* Knöpfe & Formulare */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center; cursor: pointer; text-decoration: none;
  font-family: inherit; font-weight: 600; font-size: 14px; line-height: 1; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 16px; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #042018; }
.btn.primary:hover { background: #5cf0bd; }
.btn.danger { background: transparent; border-color: #7f2d2d; color: #fca5a5; }
.btn.danger:hover { background: #3a1414; }
.btn.twitch { background: var(--twitch); border-color: var(--twitch); color: #fff; padding: 13px 20px; font-size: 15px; }
.btn.twitch:hover { background: #a36bff; }
.btn.small { padding: 7px 12px; font-size: 13px; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, .tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row .grow { flex: 1 1 220px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.notice { padding: 10px 14px; border-radius: 10px; background: #1d2b1a; border: 1px solid #3f5f2b; color: #d9f99d; font-size: 14px; }
.notice.bad { background: #2a1414; border-color: #7f2d2d; color: #fecaca; }
.notice.good { background: #0f2a20; border-color: #1f6f52; color: #bbf7d0; }

/* Karten */
.card { background: linear-gradient(180deg, var(--panel), #0b1924); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.card.narrow { max-width: 560px; margin: 40px auto; text-align: center; }
.card.done { border-color: #1f6f52; }
.done-icon { width: 56px; height: 56px; margin: 4px auto 10px; border-radius: 50%; display: grid; place-items: center;
  font-size: 30px; font-weight: 700; color: #042018; background: var(--accent); box-shadow: 0 0 30px #2ee6a655; }
.done-text { font-size: 19px; font-weight: 600; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.head-side { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.page-h { font-size: 26px; margin-bottom: 16px; }

/* Startseite */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; padding: 30px 0 20px; }
.hero h1 { font-size: clamp(30px, 4.5vw, 46px); letter-spacing: -.01em; }
.lead { font-size: 17px; color: #c7dce4; max-width: 560px; }
.hero-radar { display: flex; justify-content: center; }
.radar {
  position: relative; width: min(340px, 80vw); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle, #0f2f2d 0%, #07161b 70%);
  border: 2px solid #2ee6a699; box-shadow: 0 0 60px #2ee6a622, inset 0 0 40px #000;
}
.radar::before, .radar::after { content: ""; position: absolute; inset: 16%; border-radius: 50%; border: 1px solid #2ee6a640; }
.radar::after { inset: 33%; }
.sweep { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, #2ee6a680, transparent 70deg); animation: sweep 4s linear infinite; }
.blip { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold); animation: blip 4s ease-out infinite; }
.b1 { top: 26%; left: 64%; } .b2 { top: 62%; left: 30%; animation-delay: 1.6s; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.b3 { top: 70%; left: 70%; animation-delay: 2.8s; }
@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes blip { 0% { opacity: 1; transform: scale(1.3); } 60% { opacity: .2; transform: scale(1); } 100% { opacity: 1; } }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.features article { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.features h3 { color: var(--accent); font-size: 16px; }
.features p { margin: 0; color: var(--muted); font-size: 14px; }

/* Dashboard */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.dash-side { position: sticky; top: 76px; }
.tabs { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; }
.tab { background: none; border: 0; color: var(--muted); font-family: inherit; font-weight: 600; font-size: 13px; line-height: 1; padding: 7px 12px; border-radius: 7px; cursor: pointer; }
.tab.on { background: var(--panel-2); color: var(--accent); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 8px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat span { display: block; color: var(--muted); font-size: 12.5px; }
.stat strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.results { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.results li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; }
.chart { min-height: 200px; }
.chart .empty { padding: 50px 10px; text-align: center; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg .grid { stroke: var(--line); stroke-width: 1; }
.chart-svg .axis { fill: var(--muted); font-size: 11px; }
.chart-svg .ref { stroke: var(--gold); stroke-width: 1; stroke-dasharray: 4 4; opacity: .7; }
.chart-svg .bar { fill: var(--accent-2); }
.chart-svg .bar.good { fill: var(--good); }
.chart-svg .bar.bad { fill: var(--bad); }
.chart-svg .bar:hover, .chart-svg .dot:hover { opacity: .75; }
.chart-svg .line { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.chart-svg .dot { fill: var(--accent); }

/* Session */
.session h2 { display: flex; align-items: center; gap: 8px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 0 #ef444499; animation: live 1.6s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 10px #ef444400; } 100% { box-shadow: 0 0 0 0 #ef444400; } }
.session-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0 4px; }
.session-stats div { text-align: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; }
.session-stats strong { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.session-stats span { font-size: 11.5px; color: var(--muted); }
.small-h { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 18px 0 8px; }
.battles { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; max-height: 420px; overflow-y: auto; }
.battles li { border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: 10px; padding: 8px 10px; background: var(--bg-2); }
.battles li.win { border-left-color: var(--good); }
.battles li.loss { border-left-color: var(--bad); }
.battles li.multi { border-left-color: var(--gold); }
.b-head { display: flex; justify-content: space-between; gap: 8px; }
.b-body { font-size: 13px; color: #c7dce4; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 16px; transition: .2s; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: #7f2d2d; color: #fecaca; }

/* Einstellungen */
.choices { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.choices legend { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.choice { flex-direction: row; align-items: flex-start; gap: 10px; color: var(--text); font-size: 14px; padding: 10px 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); }
.choice:has(input:disabled) { opacity: .75; cursor: default; }
.choice span { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.choice em { color: var(--muted); font-style: normal; }
.choice small { color: var(--muted); font-size: 12.5px; }
.choice input { margin-top: 3px; accent-color: var(--accent); }
.good-text { color: var(--good) !important; }
.token-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex-direction: row !important; }
.token-row .btn { padding: 4px 10px; font-size: 12px; }
.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 14px; margin: 8px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.inline-select { flex-direction: row; align-items: center; gap: 10px; margin-top: 12px; color: var(--text); font-size: 14px; }
.commands, .custom-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.commands li { display: grid; grid-template-columns: auto 190px 1fr; align-items: center; gap: 12px; font-size: 14px; }
.cmd-on { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.cmd-word { display: flex; align-items: center; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px;
  padding-left: 10px; color: var(--accent); font-family: ui-monospace, Consolas, monospace; }
.cmd-word:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.cmd-word input { border: 0; background: transparent; color: var(--accent); font: inherit; padding: 7px 10px 7px 2px; width: 100%; min-width: 0; outline: none; }
.custom-row { display: grid; grid-template-columns: auto 190px 1fr auto; align-items: start; gap: 12px;
  padding: 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; }
.custom-row .cmd-on { margin-top: 9px; }
.custom-row .cmd-word { background: var(--panel); }
.cmd-text { width: 100%; resize: vertical; min-height: 40px; font-size: 14px; }
.cmd-texts { display: grid; gap: 6px; min-width: 0; }
.lang-tabs { display: flex; gap: 4px; }
.lang-tab { font-family: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: var(--muted); cursor: pointer;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 9px; position: relative; }
.lang-tab.on { color: var(--accent); border-color: var(--accent); }
.lang-tab.empty { opacity: .55; }
.lang-tab.chat::after { content: ""; position: absolute; top: -3px; right: -3px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.custom-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.custom-actions .btn { margin-right: 8px; }
.chip.preset { color: var(--text); font-family: inherit; font-size: 12.5px; }
.placeholders { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 6px; }
.ph-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
.chip { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--accent); background: var(--bg-2);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 9px; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.check.big { font-size: 15px; font-weight: 600; }
.choices.posts { gap: 0; margin: 4px 0 6px; }
.choices.posts .check { margin: 5px 0; }
.sticky-foot { position: sticky; bottom: 0; z-index: 5; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 35%); }
.pill { font-size: 12px; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 10px; color: var(--muted); }
.pill.good { border-color: #1f6f52; color: var(--good); }
.form-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.form-msg.good { color: var(--good); }
.form-msg.bad { color: var(--bad); }
.copy-field { width: 100%; margin-top: 10px; font-size: 12px; }
.danger-zone { border-color: #4a1d1d; }
.prose { max-width: 780px; }
.prose h2 { margin-top: 1.2em; }

.site-footer { margin-top: 30px; border-top: 1px solid var(--line); background: linear-gradient(90deg, #050d14f7, #08171ef0); }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding: 22px 0; }
.foot-brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.foot-brand img { border-radius: 50%; }
.foot-brand span { display: flex; flex-direction: column; }
.foot-brand small { color: var(--muted); font-size: 12px; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.foot-links a { color: #c7dce4; text-decoration: none; }
.foot-links a:hover { color: var(--accent); text-decoration: underline; }

@media (max-width: 960px) {
  .dash { grid-template-columns: 1fr; }
  .dash-side { position: static; order: -1; }
  .hero { grid-template-columns: 1fr; }
  .hero-radar { order: -1; }
  .radar { width: min(220px, 60vw); }
}
@media (max-width: 640px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .commands li { grid-template-columns: auto 1fr; }
  .commands li > .muted { grid-column: 2; margin-top: -6px; font-size: 13px; }
  .custom-row { grid-template-columns: auto 1fr; }
  .custom-row .cmd-texts, .custom-row .btn { grid-column: 1 / -1; }
  .custom-row .btn { justify-self: start; }
  .features { grid-template-columns: 1fr; }
  .brand small { display: none; }
  .card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .sweep, .blip, .live-dot { animation: none; }
}
