/* Lukania Wiki – eigenes Stylesheet, nachempfunden dem Erscheinungsbild von lukania.de.
   Keine Dateien des Cobalt-Themes; Farben und Maße als eigene Tokens. */

:root {
  --lk-primary: #3fa3dc;
  --lk-primary-dark: #2b86bb;
  --lk-bg: #101010;
  --lk-surface: #161616;
  --lk-surface-2: #202020;
  --lk-surface-3: #282828;
  --lk-border: #303030;
  --lk-text: #ffffff;
  --lk-text-2: #d4d4d5;
  --lk-muted: #a1a1a1;
  --lk-danger: #f5365c;
  --lk-success: #2dce89;
  --lk-warn: #fec000;
  --lk-font: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --lk-mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --lk-radius: 6px;
  --lk-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  --header-image: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--lk-bg);
  color: var(--lk-text-2);
  font-family: var(--lk-font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--lk-primary); text-decoration: none; }
a:hover, a:focus-visible { color: var(--lk-primary); text-decoration: underline; }
h1, h2, h3, h4 { color: var(--lk-text); line-height: 1.3; font-weight: 600; }
img { max-width: 100%; }
code, pre, kbd { font-family: var(--lk-mono); }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--lk-muted); }
.small { font-size: 0.85em; }
.nowrap { white-space: nowrap; }
:focus-visible { outline: 2px solid var(--lk-primary); outline-offset: 2px; }

/* ---------- Obere Navigation (wie auf lukania.de) ---------- */
.topnav { background: rgba(16, 16, 16, 0.92); border-bottom: 1px solid var(--lk-border); position: sticky; top: 0; z-index: 50; backdrop-filter: blur(6px); }
.topnav-inner { display: flex; align-items: center; min-height: 56px; gap: 16px; }
.topnav-brand { color: var(--lk-text); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.topnav-brand:hover { text-decoration: none; color: var(--lk-primary); }
.topnav-links { display: flex; list-style: none; margin: 0 0 0 auto; padding: 0; gap: 4px; }
.topnav-links a { display: block; padding: 8px 12px; color: var(--lk-text-2); font-size: 0.86rem; font-weight: 500; text-transform: uppercase; border-radius: var(--lk-radius); }
.topnav-links a i { color: var(--lk-muted); margin-right: 4px; }
.topnav-links a:hover, .topnav-links .active a { color: var(--lk-text); background: var(--lk-surface-2); text-decoration: none; }
.topnav-links .active a i { color: var(--lk-primary); }
.topnav-toggle { display: none; margin-left: auto; background: none; border: 0; color: var(--lk-text); font-size: 1.3rem; cursor: pointer; }

/* ---------- Header mit Banner ---------- */
.header {
  position: relative;
  height: 300px;
  background:
    linear-gradient(rgba(0, 0, 0, 0.1), var(--lk-bg)),
    var(--header-image) center / cover no-repeat,
    radial-gradient(ellipse at 50% 20%, rgba(63, 163, 220, 0.35), transparent 60%),
    linear-gradient(160deg, #1b2a35 0%, #121820 45%, var(--lk-bg) 100%);
}
.header-inner { height: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.logo { justify-self: center; display: block; }
.logo img { max-height: 170px; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.6)); }
.logo-text { display: block; text-align: center; color: var(--lk-text); font-size: 3.2rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; text-shadow: 0 4px 24px rgba(0, 0, 0, 0.7); line-height: 1; }
.logo-text small { display: block; font-size: 1rem; letter-spacing: 0.5em; color: var(--lk-primary); margin-top: 10px; }
.logo:hover { text-decoration: none; }
.status-box { display: flex; align-items: center; gap: 12px; background: none; border: 0; color: var(--lk-text); font: inherit; cursor: pointer; text-align: left; padding: 8px; border-radius: var(--lk-radius); }
.status-box:hover { text-decoration: none; background: rgba(255, 255, 255, 0.04); }
.discord-box { justify-self: end; text-align: right; }
.status-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; color: var(--lk-primary); border: 2px solid var(--lk-primary); box-shadow: 0 0 18px rgba(63, 163, 220, 0.35); }
.status-text b { display: block; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.04em; }
.status-text small { display: block; color: var(--lk-muted); font-size: 0.78rem; }
.status-box.copied small { color: var(--lk-success); }

/* ---------- Wiki-Leiste ---------- */
.wikibar { background: var(--lk-surface); border-top: 1px solid var(--lk-border); border-bottom: 1px solid var(--lk-border); }
.wikibar-inner { display: flex; align-items: center; gap: 16px; min-height: 58px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.wikibar-search { position: relative; flex: 1 1 280px; max-width: 460px; }
.wikibar-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--lk-muted); }
.wikibar-search input[type="search"] { width: 100%; padding: 9px 70px 9px 36px; }
.wikibar-search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.wikibar-links { display: flex; align-items: center; gap: 14px; margin-left: auto; flex-wrap: wrap; }
.wikibar-links > a:not(.btn) { color: var(--lk-text-2); font-size: 0.88rem; }
.wikibar-links > a:not(.btn) i { color: var(--lk-primary); }
kbd { background: var(--lk-surface-3); border: 1px solid var(--lk-border); border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; font-size: 0.72rem; color: var(--lk-muted); }

.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--lk-text); font-weight: 500; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; padding: 10px; z-index: 40; display: grid; gap: 4px; }
.usermenu-panel a, .usermenu-panel .linklike { display: block; padding: 6px 8px; border-radius: 4px; color: var(--lk-text-2); text-align: left; width: 100%; }
.usermenu-panel a:hover, .usermenu-panel .linklike:hover { background: var(--lk-surface-2); text-decoration: none; }

/* ---------- Inhalt ---------- */
.main { padding-top: 28px; padding-bottom: 48px; min-height: 50vh; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.layout.with-toc { grid-template-columns: minmax(0, 1fr) 260px; }
.card { background: var(--lk-surface); border: 1px solid var(--lk-border); border-radius: var(--lk-radius); box-shadow: var(--lk-shadow); }
.card-body { padding: 24px 28px; }
.card + .card { margin-top: 20px; }
.widget-header { color: var(--lk-text); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.92rem; padding: 14px 18px; background: var(--lk-surface-2); border-bottom: 1px solid var(--lk-border); border-radius: var(--lk-radius) var(--lk-radius) 0 0; position: relative; }
.widget-header::after { content: ""; position: absolute; left: 18px; bottom: -1px; width: 42px; height: 2px; background: var(--lk-primary); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.grid-2 .card + .card { margin-top: 0; }

.toc { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow: auto; }
.toc ol { list-style: none; margin: 0; padding: 12px 18px 16px; font-size: 0.88rem; }
.toc li { margin: 3px 0; }
.toc .toc-l3 { padding-left: 14px; }
.toc .toc-l4 { padding-left: 28px; }
.toc a { color: var(--lk-text-2); }
.toc a.active { color: var(--lk-primary); font-weight: 600; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 20px; justify-content: space-between; }
.page-title { margin: 0; font-size: 2rem; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 12px 0 0; color: var(--lk-muted); font-size: 0.86rem; }
.page-meta .player span { color: var(--lk-text-2); }
.page-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.contributors { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.contributors img { border-radius: 4px; }
.page-notice { margin: 16px 0 0; }
hr.sep { border: 0; border-top: 1px solid var(--lk-border); margin: 20px 0; }

.player { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.head { image-rendering: pixelated; border-radius: 3px; background: var(--lk-surface-3); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--lk-surface-3); color: var(--lk-text-2); font-size: 0.78rem; border: 1px solid var(--lk-border); }
a.badge:hover { border-color: var(--lk-primary); text-decoration: none; }
.badge-theme { background: var(--lk-primary); border-color: var(--lk-primary); color: #fff; }
.badge-warn { background: rgba(254, 192, 0, 0.12); border-color: rgba(254, 192, 0, 0.4); color: var(--lk-warn); }
.badge-ok { background: rgba(45, 206, 137, 0.12); border-color: rgba(45, 206, 137, 0.4); color: var(--lk-success); }
.badge-err { background: rgba(245, 54, 92, 0.12); border-color: rgba(245, 54, 92, 0.4); color: var(--lk-danger); }

/* ---------- Wiki-Text ---------- */
.wiki-text { color: var(--lk-text-2); overflow-wrap: anywhere; }
.wiki-text h1 { font-size: 1.7rem; }
.wiki-text h2 { font-size: 1.4rem; padding-bottom: 6px; border-bottom: 1px solid var(--lk-border); margin-top: 1.8em; }
.wiki-text h3 { font-size: 1.15rem; margin-top: 1.5em; }
.wiki-text h4 { font-size: 1rem; }
.wiki-text :is(h1, h2, h3, h4) { position: relative; }
.wiki-text .anchor { opacity: 0; margin-left: 8px; font-size: 0.8em; color: var(--lk-muted); }
.wiki-text :is(h2, h3, h4):hover .anchor { opacity: 1; }
.wiki-text blockquote { margin: 1em 0; padding: 8px 16px; border-left: 3px solid var(--lk-primary); background: var(--lk-surface-2); border-radius: 0 var(--lk-radius) var(--lk-radius) 0; }
.wiki-text code { background: var(--lk-surface-3); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }
.wiki-text pre { background: #0b0b0b; border: 1px solid var(--lk-border); padding: 14px; border-radius: var(--lk-radius); overflow: auto; }
.wiki-text pre code { background: none; padding: 0; }
.wiki-text img { border-radius: var(--lk-radius); }
.wiki-text a.missing { color: var(--lk-danger); }
.wiki-text a.external::after { content: "\f35d"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 0.65em; margin-left: 4px; vertical-align: super; color: var(--lk-muted); }
.wiki-text hr { border: 0; border-top: 1px solid var(--lk-border); }
.table-wrap { overflow-x: auto; margin: 1em 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--lk-border); text-align: left; vertical-align: top; }
th { color: var(--lk-text); background: var(--lk-surface-2); font-weight: 600; }
tr:hover td { background: rgba(255, 255, 255, 0.015); }

.wiki-box { margin: 1em 0; border: 1px solid var(--lk-border); border-left: 3px solid var(--lk-primary); border-radius: var(--lk-radius); background: var(--lk-surface-2); }
.wiki-box-title { padding: 8px 14px 0; font-weight: 600; color: var(--lk-text); }
.wiki-box-title i { color: var(--lk-primary); }
.wiki-box-body { padding: 4px 14px 8px; }
.box-warn { border-left-color: var(--lk-warn); }
.box-warn .wiki-box-title i { color: var(--lk-warn); }
.box-tip { border-left-color: var(--lk-success); }
.box-tip .wiki-box-title i { color: var(--lk-success); }
.wiki-spoiler { margin: 1em 0; border: 1px solid var(--lk-border); border-radius: var(--lk-radius); overflow: hidden; }
.wiki-spoiler summary { cursor: pointer; padding: 9px 14px; background: var(--lk-primary); color: #fff; font-weight: 600; }
.wiki-spoiler-body { padding: 8px 14px; background: var(--lk-surface-2); }

/* ---------- Formulare & Knöpfe ---------- */
input[type="text"], input[type="search"], input:not([type]), textarea, select {
  background: var(--lk-surface-2); border: 1px solid var(--lk-border); color: var(--lk-text); border-radius: var(--lk-radius);
  padding: 9px 12px; font: inherit; width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--lk-primary); outline: none; box-shadow: 0 0 0 3px rgba(63, 163, 220, 0.18); }
label { display: block; color: var(--lk-text); font-weight: 500; margin-bottom: 14px; }
label > input, label > select, label > textarea { margin-top: 6px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--lk-text-2); }
label.check input { width: auto; margin: 0; }
.hint { display: block; color: var(--lk-muted); font-size: 0.82rem; font-weight: 400; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: var(--lk-radius); border: 1px solid transparent; font: inherit; font-weight: 500; font-size: 0.9rem; cursor: pointer; color: var(--lk-text); background: var(--lk-surface-3); white-space: nowrap; }
.btn:hover { text-decoration: none; color: var(--lk-text); filter: brightness(1.12); }
.btn-theme { background: var(--lk-primary); color: #fff; }
.btn-theme:hover { color: #fff; opacity: 0.92; }
.btn-outline { background: transparent; border-color: var(--lk-primary); color: var(--lk-primary); }
.btn-outline:hover { background: var(--lk-primary); color: #fff; }
.btn-danger { background: var(--lk-danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.84rem; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--lk-primary); cursor: pointer; }
form.inline { display: inline; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.alert { padding: 12px 16px; border-radius: var(--lk-radius); margin-bottom: 20px; border: 1px solid var(--lk-border); background: var(--lk-surface); }
.alert-ok { border-color: rgba(45, 206, 137, 0.5); color: var(--lk-success); }
.alert-err { border-color: rgba(245, 54, 92, 0.5); color: var(--lk-danger); }
.alert-info { border-color: rgba(63, 163, 220, 0.5); }
.empty { color: var(--lk-muted); padding: 18px 0; text-align: center; }

/* ---------- Editor ---------- */
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; background: var(--lk-surface-2); border: 1px solid var(--lk-border); border-bottom: 0; border-radius: var(--lk-radius) var(--lk-radius) 0 0; }
.editor-toolbar button { background: none; border: 0; color: var(--lk-text-2); padding: 6px 9px; border-radius: 4px; cursor: pointer; font: inherit; font-size: 0.86rem; }
.editor-toolbar button:hover { background: var(--lk-surface-3); color: var(--lk-text); }
.editor-toolbar .sep { width: 1px; background: var(--lk-border); margin: 4px 4px; }
.editor-tabs { margin-left: auto; display: flex; gap: 2px; }
.editor-tabs button[aria-pressed="true"] { background: var(--lk-primary); color: #fff; }
textarea.editor { min-height: 460px; font-family: var(--lk-mono); font-size: 0.9rem; line-height: 1.55; border-radius: 0 0 var(--lk-radius) var(--lk-radius); resize: vertical; tab-size: 2; }
.editor-preview { min-height: 460px; border: 1px solid var(--lk-border); border-radius: 0 0 var(--lk-radius) var(--lk-radius); padding: 18px 22px; background: var(--lk-bg); }
.draft-note { font-size: 0.84rem; }

/* ---------- Verlauf & Vergleich ---------- */
.history td { vertical-align: middle; }
.size-plus { color: var(--lk-success); }
.size-minus { color: var(--lk-danger); }
.diff { width: 100%; font-family: var(--lk-mono); font-size: 0.84rem; border-collapse: collapse; }
.diff td { padding: 1px 8px; border: 0; white-space: pre-wrap; word-break: break-word; }
.diff td.no { width: 1%; min-width: 3.2em; white-space: nowrap; color: var(--lk-muted); text-align: right; user-select: none; }
.diff tr.add td.code { background: rgba(45, 206, 137, 0.1); }
.diff tr.del td.code { background: rgba(245, 54, 92, 0.1); }
.diff tr.add td.code::before { content: "+ "; color: var(--lk-success); }
.diff tr.del td.code::before { content: "− "; color: var(--lk-danger); }
.diff tr.same td.code::before { content: "  "; }
.diff ins { background: rgba(45, 206, 137, 0.35); text-decoration: none; border-radius: 2px; }
.diff del { background: rgba(245, 54, 92, 0.35); text-decoration: none; border-radius: 2px; }
.diff tr.skip td { text-align: center; color: var(--lk-muted); background: var(--lk-surface-2); padding: 4px; }

/* ---------- Listen ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--lk-border); }
.list li:last-child { border-bottom: 0; }
.changes li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.changes .summary { color: var(--lk-muted); font-style: italic; }
.letters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; }
.letters a { padding: 3px 9px; border-radius: 4px; background: var(--lk-surface-2); color: var(--lk-text-2); }
.letters a.active { background: var(--lk-primary); color: #fff; }
.columns { columns: 3 220px; }
.columns li { break-inside: avoid; }
.search-results li .headline { color: var(--lk-muted); font-size: 0.9rem; }
mark { background: rgba(63, 163, 220, 0.3); color: var(--lk-text); border-radius: 2px; padding: 0 2px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.stat { background: var(--lk-surface-2); border: 1px solid var(--lk-border); border-radius: var(--lk-radius); padding: 14px 16px; }
.stat b { display: block; font-size: 1.6rem; color: var(--lk-text); }
.stat span { color: var(--lk-muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.profile-head { display: flex; gap: 20px; align-items: center; }
.profile-head img { border-radius: var(--lk-radius); }

/* ---------- Suche (Strg+K) ---------- */
.search-modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 100; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.search-modal[hidden] { display: none; }
.search-modal-box { width: 100%; max-width: 620px; overflow: hidden; }
.search-modal-input { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--lk-border); }
.search-modal-input input { border: 0; background: none; box-shadow: none; padding: 4px 0; font-size: 1.05rem; }
.search-modal-input input:focus { box-shadow: none; }
.search-modal-results { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
.search-modal-results li a { display: block; padding: 9px 12px; border-radius: 4px; color: var(--lk-text-2); }
.search-modal-results li a[aria-selected="true"], .search-modal-results li a:hover { background: var(--lk-primary); color: #fff; text-decoration: none; }
.search-modal-hint { padding: 8px 16px; border-top: 1px solid var(--lk-border); }

/* ---------- Footer ---------- */
.footer { background: var(--lk-surface); border-top: 1px solid var(--lk-border); padding-top: 36px; color: var(--lk-muted); font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-text-header { color: var(--lk-text); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding-bottom: 8px; margin-bottom: 12px; position: relative; }
.footer-text-header::after { content: ""; position: absolute; left: 0; bottom: 0; width: 36px; height: 2px; background: var(--lk-primary); }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin: 4px 0; }
.footer a { color: var(--lk-muted); }
.footer a:hover { color: var(--lk-primary); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--lk-border); margin-top: 28px; padding-top: 16px; padding-bottom: 20px; font-size: 0.8rem; }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 960px) {
  .layout.with-toc { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; max-height: none; order: -1; }
}
@media (max-width: 860px) {
  .topnav-toggle { display: block; }
  .topnav-links { display: none; position: absolute; left: 0; right: 0; top: 56px; flex-direction: column; background: var(--lk-surface); border-bottom: 1px solid var(--lk-border); padding: 8px 16px; }
  .topnav-links.open { display: flex; }
  .topnav-inner { position: relative; }
  .header { height: 210px; }
  .header-inner { grid-template-columns: 1fr; }
  .status-box { display: none; }
  .logo-text { font-size: 2.3rem; }
  .wikibar-links span { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .card-body { padding: 18px 16px; }
  .page-title { font-size: 1.6rem; }
}
