/* ============================================================
   HackGame / HackOS – Stylesheet
   Tokens zuerst, dann Landing, dann Desktop. Mobile-first ab 820px.
   ============================================================ */

:root {
  /* Palette: tiefes Blauschwarz, Mint-Teal als Systemfarbe, Amber = Fokus */
  --bg:      #0a0e15;
  --bg-deep: #060a10;
  --panel:   #101725;
  --panel-2: #16202f;
  --line:    #223048;
  --text:    #cfdaea;
  --dim:     #7b8ba1;
  --accent:  #3ce6c4;
  --accent-dim: #1c8f7a;
  --energy:  #ffb454;
  --hc:      #c39bff;
  --danger:  #ff5f6d;
  --ok:      #7ee38a;

  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 6px;
  --topbar-h: 52px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* dezentes Grid im Hintergrund, die "Platine" des OS */
body.landing, body.desktop {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
  background-attachment: fixed;
  background-color: var(--bg);
}
body.landing { background-image:
    linear-gradient(rgba(34,48,72,.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,48,72,.35) 1px, transparent 1px); }
body.desktop { background-image:
    linear-gradient(rgba(34,48,72,.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,48,72,.25) 1px, transparent 1px); }

h1, h2, h3 { font-family: var(--mono); font-weight: 700; letter-spacing: -0.01em; }
p { font-family: var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.hidden { display: none !important; }

/* ---------- Buttons ---------- */

.btn {
  font-family: var(--mono);
  font-size: 13px;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .05s;
}
.btn:hover:not(:disabled) { border-color: var(--accent-dim); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #06251f;
  font-weight: 700;
}
.btn-primary:hover:not(:disabled) { background: #5cf0d3; border-color: #5cf0d3; }

.btn-ghost { background: transparent; }
.btn-small { padding: 6px 12px; font-size: 12px; }

/* ---------- Fenster-Chrome (das Signatur-Element) ---------- */

.window {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.window-titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--line);
}
.window-dots { display: flex; gap: 6px; }
.window-dots i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--line); display: block;
}
.window-dots i:first-child { background: var(--accent-dim); }
.window-path {
  font-size: 12px;
  color: var(--dim);
  letter-spacing: .04em;
}
.window-body { padding: 18px; }

/* ============================================================
   LANDING
   ============================================================ */

.landing-grid {
  max-width: 1060px;
  margin: 0 auto;
  padding: 48px 20px 32px;
  display: grid;
  gap: 40px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

.boot-log {
  font-size: 12px;
  color: var(--dim);
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  min-height: 96px;
  margin: 0 0 26px;
  white-space: pre-wrap;
}
.boot-log .ok { color: var(--ok); }

.landing-intro h1 {
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.12;
  margin: 0 0 16px;
}
.lede { color: var(--dim); font-size: 16px; max-width: 46ch; margin: 0 0 22px; }

.feature-list {
  list-style: none; padding: 0; margin: 0;
  font-family: var(--sans); color: var(--text);
}
.feature-list li { padding: 5px 0; }
.feature-list .glyph { color: var(--accent); font-family: var(--mono); margin-right: 8px; }

/* Auth-Panel */
.auth-panel { max-width: 420px; width: 100%; }

.auth-tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.auth-tab {
  flex: 1;
  padding: 9px;
  font-family: var(--mono);
  font-size: 13px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--dim);
  cursor: pointer;
}
.auth-tab.active { border-color: var(--accent); color: var(--accent); }

.auth-form { display: flex; flex-direction: column; gap: 6px; }
.auth-form label {
  font-size: 12px; color: var(--dim);
  letter-spacing: .05em; margin-top: 8px;
}
.auth-form .hint { color: var(--dim); opacity: .7; text-transform: none; letter-spacing: 0; }
.auth-form input {
  font-family: var(--mono);
  font-size: 14px;
  padding: 10px 12px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
}
.auth-form input:focus { border-color: var(--accent-dim); outline: none; }
.auth-form .btn { margin-top: 16px; }

.fineprint { font-size: 11px; color: var(--dim); margin: 10px 0 0; }
.form-error {
  margin: 14px 0 0;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  background: rgba(255, 95, 109, .07);
}

.landing-footer {
  max-width: 1060px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--dim);
  border-top: 1px solid var(--line);
}

/* ============================================================
   DESKTOP (app.html)
   ============================================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--line);
}

.topbar-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.os-badge {
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  color: var(--bg-deep);
  background: var(--accent);
  padding: 2px 7px;
  border-radius: 3px;
}
.tb-nick { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-level { font-size: 12px; color: var(--dim); white-space: nowrap; }

.topbar-xp { flex: 1; max-width: 260px; display: flex; flex-direction: column; gap: 3px; }
.bar { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; transition: width .4s; }
.bar-xp { background: var(--accent); }
.bar-energy { background: var(--energy); }
.bar-label { font-size: 10px; color: var(--dim); letter-spacing: .04em; }

.topbar-stats { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.stat { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.stat-key { font-size: 10px; color: var(--dim); letter-spacing: .1em; }
.stat-val { font-weight: 700; }
.val-energy { color: var(--energy); }
.val-hc { color: var(--hc); }

.desktop-layout {
  display: grid;
  grid-template-columns: 88px 1fr;
  min-height: calc(100vh - var(--topbar-h));
}

.dock {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  background: rgba(6, 10, 16, .6);
}
.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--dim);
  font-family: var(--mono);
  cursor: pointer;
}
.dock-item:hover { color: var(--text); }
.dock-item.active { color: var(--accent); border-color: var(--line); background: var(--panel); }
.dock-glyph { font-size: 18px; line-height: 1; }
.dock-label { font-size: 10px; letter-spacing: .06em; }

.workspace {
  padding: 22px;
  max-width: 980px;
  width: 100%;
}

/* ---------- Karten & Listen im Workspace ---------- */

.view-title { font-size: 20px; margin: 0 0 4px; }
.view-sub { color: var(--dim); font-family: var(--sans); margin: 0 0 20px; font-size: 14px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card.locked { opacity: .55; }
.card h3 { margin: 0; font-size: 15px; }
.card .desc { font-family: var(--sans); color: var(--dim); font-size: 13px; margin: 0; }

.kv { display: flex; justify-content: space-between; font-size: 12px; }
.kv .k { color: var(--dim); }
.kv .v { font-weight: 700; }
.kv .v.good { color: var(--ok); }
.kv .v.energy { color: var(--energy); }
.kv .v.hc { color: var(--hc); }

.tier-heading {
  margin: 26px 0 12px;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.tier-heading:first-of-type { margin-top: 0; }

.chance-bar { height: 5px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.chance-fill { height: 100%; background: var(--accent); }

.level-pips { display: flex; gap: 3px; }
.pip { width: 14px; height: 6px; border-radius: 2px; background: var(--panel-2); }
.pip.on { background: var(--accent); }

.countdown { color: var(--energy); font-weight: 700; }

.banner {
  border: 1px solid var(--accent-dim);
  background: rgba(60, 230, 196, .06);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.banner.warn { border-color: var(--energy); background: rgba(255, 180, 84, .06); }

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  color: var(--dim);
  font-family: var(--sans);
}

.badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: .08em;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--line);
  color: var(--dim);
}
.badge.hc { color: var(--hc); border-color: var(--hc); }
.badge.eur { color: var(--energy); border-color: var(--energy); }

/* ---------- Toasts ---------- */

.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 32px));
}
.toast {
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  animation: toast-in .18s ease-out;
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--ok); }
.toast strong { display: block; margin-bottom: 2px; }

@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (min-width: 820px) {
  .landing-grid {
    grid-template-columns: 1.2fr .9fr;
    align-items: start;
    padding-top: 72px;
    gap: 56px;
  }
  .auth-panel { justify-self: end; position: sticky; top: 40px; }
}

@media (max-width: 819px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px 14px; }
  .topbar-xp { order: 3; flex-basis: 100%; max-width: none; }
  .btn-logout { display: none; } /* Logout wandert am Handy in die Übersicht */

  .desktop-layout { grid-template-columns: 1fr; }
  .dock {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    flex-direction: row;
    justify-content: space-around;
    border-right: none;
    border-top: 1px solid var(--line);
    background: var(--bg-deep);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    z-index: 30;
  }
  .dock-item { flex: 1; padding: 6px 2px; }
  .workspace { padding: 16px 14px 96px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Utility-Abstände (ersetzen Inline-Styles wegen striktem CSP) */
.mt { margin-top: 16px; }
.mt-lg { margin-top: 20px; }

/* Sub-Tabs (Rig, Farm, Grid) */
.subtabs { display: flex; gap: 6px; margin-bottom: 14px; }
.subtab {
  padding: 8px 16px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .05em;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--dim);
  cursor: pointer;
}
.subtab.active { border-color: var(--accent); color: var(--accent); background: var(--panel); }

/* Tagesbonus-Badge und Erfolgs-Häkchen */
.badge.daily { color: var(--energy); border-color: var(--energy); }
.badge.good { color: var(--ok); border-color: var(--ok); }

/* Rangliste */
.rank-list { display: flex; flex-direction: column; gap: 2px; }
.rank-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 13px;
}
.rank-row:nth-child(odd) { background: var(--panel-2); }
.rank-row.me { border-color: var(--accent); }
.rank-num { color: var(--dim); }
.rank-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-val { color: var(--dim); }

/* Modul-Raritäten */
.card.rarity-rare { border-color: #4a7fd4; }
.card.rarity-epic { border-color: var(--hc); }
.card.rarity-legendary { border-color: var(--energy); }
.badge.rarity-badge-common { color: var(--dim); }
.badge.rarity-badge-rare { color: #6fa3f0; border-color: #4a7fd4; }
.badge.rarity-badge-epic { color: var(--hc); border-color: var(--hc); }
.badge.rarity-badge-legendary { color: var(--energy); border-color: var(--energy); }

/* Auswahl- und Eingabefelder in Karten (Agenten, Syndikat) */
.select-label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--dim); }
.select-label select, .select-label input {
  font-family: var(--mono);
  font-size: 13px;
  padding: 8px 10px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
}
.select-label select:focus, .select-label input:focus { border-color: var(--accent-dim); outline: none; }

/* Netz-Operation: SVG-Karte */
.net-map-wrap {
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  margin-bottom: 12px;
}
.net-map { display: block; width: 100%; height: auto; }
.net-edge { stroke: var(--line); stroke-width: 1.5; }
.net-edge.active { stroke: var(--accent-dim); stroke-width: 2; }
.net-node circle { fill: var(--panel-2); stroke: var(--line); stroke-width: 1.5; }
.net-node .net-glyph {
  fill: var(--dim); font-family: var(--mono); font-size: 13px;
  font-weight: 700; text-anchor: middle; pointer-events: none;
}
.net-node .net-chance {
  fill: var(--energy); font-family: var(--mono); font-size: 10px; text-anchor: middle;
}
.net-node.visited circle { stroke: var(--accent-dim); }
.net-node.visited .net-glyph { fill: var(--accent-dim); }
.net-node.current circle { fill: var(--accent); stroke: var(--accent); }
.net-node.current .net-glyph { fill: var(--bg-deep); }
.net-node.reachable { cursor: pointer; }
.net-node.reachable circle { stroke: var(--accent); stroke-width: 2.5; }
.net-node.reachable .net-glyph { fill: var(--text); }
.net-node.reachable:hover circle { fill: rgba(60, 230, 196, .15); }
.net-node.reachable:focus-visible circle { stroke: var(--energy); }
.net-legend { font-size: 12px; color: var(--dim); display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 8px; }
.net-legend-item b { color: var(--text); font-family: var(--mono); margin-right: 3px; }

/* Rechtsseiten (Impressum, Datenschutz) */
.legal-page { display: block; max-width: 720px; }
.legal-page h1 { font-size: 30px; margin: 0 0 18px; }
.legal-page h2 { font-size: 16px; margin: 26px 0 8px; color: var(--accent); }
.legal-page p { color: var(--text); font-size: 14px; }

/* Text-Links in Formularen (Passwort vergessen, zurück) */
.link-button {
  background: none;
  border: none;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  padding: 4px;
  margin-top: 4px;
  text-decoration: underline;
}
.link-button:hover { color: var(--accent); }
.form-error.info-box { color: var(--accent); border-color: var(--accent-dim); background: rgba(60,230,196,.06); }
.account-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.danger-text { color: var(--danger); }
.danger-text:hover { border-color: var(--danger); }

/* Saison-Ligen: kleine Farbpunkte */
.league-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: 4px; vertical-align: middle; }
.league-bronze  { background: #a97142; }
.league-silber  { background: #b8c0c8; }
.league-gold    { background: #e6c14b; }
.league-platin  { background: #7fd4e6; }
.league-diamant { background: #6fa3f0; }
.league-legende { background: var(--hc); }
.badge.league-bronze  { color: #c99; border-color: #a97142; }
.badge.league-silber  { color: #ccd; border-color: #b8c0c8; }
.badge.league-gold    { color: var(--energy); border-color: #e6c14b; }
.badge.league-platin  { color: #7fd4e6; border-color: #7fd4e6; }
.badge.league-diamant { color: #6fa3f0; border-color: #6fa3f0; }
.badge.league-legende { color: var(--hc); border-color: var(--hc); }

/* Saisonpass: zweispaltige Stufen-Ansicht */
.pass-claim-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.pass-head, .pass-row {
  display: grid;
  grid-template-columns: 70px 1fr 1fr;
  gap: 8px;
  align-items: stretch;
}
.pass-head { margin-bottom: 6px; }
.pass-col-head {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--dim); padding: 6px 10px; text-align: center;
}
.pass-col-head.premium { color: var(--hc); }
.pass-grid { display: flex; flex-direction: column; gap: 6px; }
.pass-row { opacity: .5; }
.pass-row.reached { opacity: 1; }
.pass-tier {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--panel-2); border-radius: var(--radius); padding: 6px;
}
.pass-tier-num { font-weight: 700; font-size: 15px; }
.pass-tier-pts { font-size: 10px; color: var(--dim); }
.pass-cell {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px; font-size: 13px; position: relative;
}
.pass-cell.pass-hc .pass-reward { color: var(--hc); font-weight: 700; }
.pass-cell.pass-drink .pass-reward { color: var(--energy); }
.pass-cell.pass-cosmetic .pass-reward { color: var(--accent); }
.pass-cell.ready { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-dim); }
.pass-cell.claimed { opacity: .5; }
.pass-check { color: var(--ok); font-weight: 700; }
.pass-lock { opacity: .6; }

@media (max-width: 560px) {
  .pass-head, .pass-row { grid-template-columns: 48px 1fr 1fr; gap: 5px; }
  .pass-cell { padding: 8px 6px; font-size: 12px; }
}

/* OAuth-Login-Buttons */
.oauth-buttons { margin-top: 16px; }
.oauth-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--dim); font-size: 12px; }
.oauth-divider::before, .oauth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.btn-oauth {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; margin-bottom: 8px; text-decoration: none;
}
.btn-oauth:hover { text-decoration: none; border-color: var(--accent-dim); }
.oauth-glyph {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 4px;
  background: var(--panel-2); font-weight: 700; font-size: 12px;
}

/* Clan-Chat */
.chat { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chat-feed {
  height: 280px; overflow-y: auto; padding: 12px;
  background: var(--bg-deep); display: flex; flex-direction: column; gap: 8px;
}
.chat-empty { color: var(--dim); text-align: center; margin: auto; font-size: 13px; }
.chat-msg {
  display: flex; align-items: baseline; gap: 8px; font-size: 13px;
  padding: 4px 6px; border-radius: var(--radius); position: relative;
}
.chat-msg:hover { background: var(--panel); }
.chat-msg.mine .chat-nick { color: var(--accent); }
.chat-msg.deleted { opacity: .5; font-style: italic; }
.chat-nick { font-weight: 700; color: var(--dim); flex-shrink: 0; }
.chat-text { color: var(--text); word-break: break-word; }
.chat-tools { margin-left: auto; display: flex; gap: 4px; opacity: 0; flex-shrink: 0; }
.chat-msg:hover .chat-tools { opacity: 1; }
.chat-tool {
  background: none; border: none; color: var(--dim); cursor: pointer;
  font-size: 13px; padding: 0 4px; line-height: 1;
}
.chat-tool:hover { color: var(--danger); }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--panel); }
.chat-input input {
  flex: 1; font-family: var(--mono); font-size: 13px; padding: 9px 12px;
  background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text);
}
.chat-input input:focus { border-color: var(--accent-dim); outline: none; }

/* Spieler-Markt */
.rarity-badge-common   { color: var(--dim); }
.rarity-badge-rare     { color: #6fa3f0; border-color: #6fa3f0; }
.rarity-badge-epic     { color: #b57ce6; border-color: #b57ce6; }
.rarity-badge-legendary { color: var(--hc); border-color: var(--hc); }

/* KI-Copilot ORAKEL */
.btn-orakel {
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  background: rgba(60, 230, 196, .06);
  font-family: var(--mono);
  letter-spacing: .05em;
}
.btn-orakel:hover { background: rgba(60, 230, 196, .14); border-color: var(--accent); }

.copilot-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .5);
  z-index: 40; backdrop-filter: blur(2px);
}
.copilot {
  position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 92vw;
  z-index: 41; display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--accent-dim);
  box-shadow: -12px 0 40px rgba(0, 0, 0, .45);
}
.copilot.hidden, .copilot-backdrop.hidden { display: none; }
.copilot-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--bg-deep);
}
.copilot-title { font-family: var(--mono); font-weight: 700; color: var(--accent); letter-spacing: .08em; }
.copilot-mode {
  font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--hc);
  border: 1px solid currentColor; border-radius: 4px; padding: 1px 5px;
}
.copilot-mode:empty { display: none; }
.copilot-x {
  background: none; border: none; color: var(--dim); cursor: pointer; font-size: 15px; padding: 2px 6px;
}
.copilot-x:hover { color: var(--accent); }
.copilot-x:first-of-type { margin-left: auto; }
.copilot-feed {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px;
  background: var(--bg-deep);
}
.cp-msg { display: flex; flex-direction: column; gap: 3px; max-width: 92%; }
.cp-who { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.cp-text {
  font-size: 13.5px; line-height: 1.5; padding: 10px 13px; border-radius: 12px; word-break: break-word;
}
.cp-orakel { align-self: flex-start; }
.cp-orakel .cp-text { background: var(--panel-2); border: 1px solid var(--line); border-top-left-radius: 3px; }
.cp-orakel .cp-who { color: var(--accent); }
.cp-user { align-self: flex-end; align-items: flex-end; }
.cp-user .cp-text { background: rgba(60, 230, 196, .1); border: 1px solid var(--accent-dim); border-top-right-radius: 3px; }
.copilot-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); }
.cp-chip {
  font-family: var(--mono); font-size: 11px; color: var(--dim); cursor: pointer;
  background: var(--bg-deep); border: 1px solid var(--line); border-radius: 14px; padding: 5px 10px;
}
.cp-chip:hover { color: var(--accent); border-color: var(--accent-dim); }
.copilot-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--panel); }
.copilot-input input {
  flex: 1; font-family: var(--mono); font-size: 13px; padding: 10px 12px;
  background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text);
}
.copilot-input input:focus { border-color: var(--accent); outline: none; }

@media (max-width: 560px) {
  .copilot { width: 100vw; max-width: 100vw; }
  .btn-orakel { padding: 6px 8px; font-size: 11px; }
}

/* Botnetz */
.ref-note {
  background: rgba(60, 230, 196, .08); border: 1px solid var(--accent-dim);
  color: var(--accent); border-radius: var(--radius); padding: 10px 12px;
  font-size: 13px; margin: 0 0 14px;
}
.bn-code-card { text-align: center; }
.bn-code {
  font-family: var(--mono); font-size: 28px; font-weight: 700; letter-spacing: .3em;
  color: var(--accent); padding: 10px 0 14px; text-shadow: 0 0 18px var(--accent-dim);
}
.bn-link-row { display: flex; gap: 8px; }
.bn-link {
  flex: 1; font-family: var(--mono); font-size: 12px; padding: 9px 12px;
  background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--radius); color: var(--dim);
}
.bn-ok { color: var(--ok); }
.bn-wait { color: var(--energy); }
.bn-pending { color: var(--dim); }
.bn-blocked { color: var(--danger); }

/* ORAKEL: Badge und proaktive Hinweise */
.copilot-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; margin-left: 6px; padding: 0 4px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 8px; line-height: 1;
}
.copilot-alerts { display: flex; flex-direction: column; gap: 6px; padding: 12px 12px 0; }
.copilot-alerts:empty { display: none; }
.cp-alert {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 9px 11px; border-radius: var(--radius); cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  font-size: 12.5px; font-family: inherit;
}
.cp-alert:hover { border-color: var(--accent-dim); }
.cp-alert-ic {
  flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
}
.cp-alert-good .cp-alert-ic { background: rgba(60,230,196,.15); color: var(--ok); }
.cp-alert-warn .cp-alert-ic { background: rgba(240,110,90,.15); color: var(--danger); }
.cp-alert-info .cp-alert-ic { background: var(--bg-deep); color: var(--dim); }
.cp-alert-tx { flex: 1; line-height: 1.4; }

/* Clan-Kriege */
.war-card { text-align: center; }
.war-score { display: flex; align-items: center; justify-content: center; gap: 18px; }
.war-side { display: flex; flex-direction: column; gap: 2px; min-width: 90px; }
.war-label { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.war-points { font-family: var(--mono); font-size: 32px; font-weight: 700; color: var(--text); }
.war-points.good { color: var(--ok); text-shadow: 0 0 16px var(--accent-dim); }
.war-points.bad { color: var(--danger); }
.war-vs { font-size: 22px; color: var(--dim); }

/* Erste Schritte (Onboarding) */
.ob-card h3 { margin-bottom: 4px; }
.ob-row {
  display: flex; align-items: center; gap: 11px; padding: 9px 0;
  border-top: 1px solid var(--line);
}
.ob-row:first-of-type { border-top: none; }
.ob-mark { flex-shrink: 0; width: 18px; text-align: center; color: var(--dim); font-size: 14px; }
.ob-done .ob-mark { color: var(--accent); }
.ob-text { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.ob-desc { font-size: 12px; color: var(--dim); }
.ob-action { flex-shrink: 0; }
.ob-reward { font-size: 12px; color: var(--dim); font-family: var(--mono); }
.ob-check { font-size: 12px; color: var(--accent); }

/* Spielerprofil */
.muted { color: var(--dim); }
.rank-clickable { cursor: pointer; }
.rank-clickable:hover { background: var(--panel-2); }
.profile-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 60;
}
.profile-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(440px, 92vw); max-height: 88vh; overflow-y: auto; z-index: 61;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.profile-top { display: flex; align-items: center; justify-content: space-between; }
.profile-top h2 { margin: 0; font-size: 20px; }
.icon-button {
  background: none; border: none; color: var(--dim); font-size: 18px; cursor: pointer;
  padding: 4px 8px; border-radius: var(--radius);
}
.icon-button:hover { color: var(--text); background: var(--panel-2); }
.profile-sub { color: var(--dim); font-size: 13px; margin: 2px 0 16px; }
.profile-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.profile-stat {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 6px; text-align: center;
}
.profile-stat .n { display: block; font-family: var(--mono); font-size: 20px; font-weight: 700; color: var(--accent); }
.profile-stat .l { display: block; font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.profile-h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); margin: 18px 0 8px; }
.profile-achs { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-ach {
  font-size: 12px; padding: 4px 9px; border-radius: 20px;
  background: rgba(60,230,196,.1); border: 1px solid var(--accent-dim); color: var(--accent);
}
.profile-loading { text-align: center; color: var(--dim); padding: 30px; }

/* Konto-Einstellungen */
.set-row { display: flex; gap: 8px; }
.set-row input { flex: 1; }
.set-col { display: flex; flex-direction: column; gap: 8px; }
.set-col input, .set-row input {
  background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); padding: 9px 11px; font: inherit;
}
.set-msg { font-size: 13px; min-height: 18px; margin: 6px 0 0; color: var(--dim); }
.set-msg.ok { color: var(--ok); }
.set-msg.err { color: var(--danger); }

/* Ankündigungs-Banner */
.banner.announce { align-items: center; border-color: var(--accent-dim); background: rgba(60,230,196,.06); }
.announce-tag {
  display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--accent); border: 1px solid var(--accent-dim);
  border-radius: 4px; padding: 1px 6px; margin-right: 6px;
}

/* Benachrichtigungen */
.notif-list { display: flex; flex-direction: column; }
.notif-row { padding: 10px 0; border-top: 1px solid var(--line); }
.notif-row:first-child { border-top: none; }
.notif-unread { border-left: 2px solid var(--accent); padding-left: 10px; margin-left: -12px; }
.notif-time { font-size: 11px; color: var(--dim); margin-top: 3px; }

/* Tagesziele */
.dg-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.dg-row:first-of-type { border-top: none; }
.dg-info { flex: 1; }
.dg-title { font-size: 13px; margin-bottom: 5px; }
.dg-bar { height: 5px; background: var(--bg-deep); border-radius: 3px; overflow: hidden; }
.dg-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.dg-count { font-size: 11px; color: var(--dim); margin-top: 3px; font-family: var(--mono); }
.dg-action { flex-shrink: 0; }

/* Hilfsklassen (ersetzen frühere inline-styles wegen strenger CSP) */
.war-sub { text-align: center; margin: 6px 0 0; }
.war-hist-h { color: var(--dim); font-size: 12px; letter-spacing: .08em; }
.sub-tight { margin: 6px 0 0; }

/* Kleine Hilfsklassen für die Auth-Seiten (statt inline-styles, CSP) */
.mt-0 { margin-top: 0; }
.w-narrow { max-width: 440px; }
.auth-title { font-size: 22px; margin: 0 0 12px; }

/* Clan-Mitglieder-Knöpfe */
.rank-actions { display: inline-flex; gap: 5px; margin-left: 10px; flex-wrap: wrap; }
.clan-mini { padding: 3px 8px; font-size: 11px; }

/* Missions-Slot-Karte */
.slot-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
