/* ═══════════════════════════════════════════════════════════
   AXYL WIKI – Gothic 2 Online Theme
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:       #0a0b08;
  --bg2:      #0d0f0a;
  --bg3:      #111410;
  --bg4:      #161a10;
  --bg5:      #1c2214;
  --bg6:      #222a18;

  --gold:     #c8a84b;
  --gold2:    #a08830;
  --gold3:    #e2c97a;
  --gold-glow:rgba(200,168,75,0.18);
  --gold-line:rgba(200,168,75,0.35);

  --text:     #c8d4b8;
  --text2:    #7a8a6a;
  --text3:    #4a5a3a;
  --text4:    #2a3020;

  --border:   #2a3020;
  --border2:  #3a4a2a;
  --border3:  #4a6030;

  --danger:   #8b1c1c;
  --danger2:  #b02828;
  --success:  #2e7d32;
  --success2: #43a047;

  --radius:   3px;
  --radius-md:5px;
  --radius-lg:7px;

  --font-title: 'Cinzel', 'Times New Roman', serif;
  --font-body:  'Crimson Text', 'Georgia', serif;
  --font-ui:    'Cinzel', 'Times New Roman', serif;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold3); text-decoration: underline; }
.hidden { display: none !important; }

/* ── Background atmosphere ─────────────────────────────────── */
.page-bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 100% 50% at 50% -10%,  #0e1a08 0%, transparent 55%),
    radial-gradient(ellipse 70%  40% at 100% 110%,  #091208 0%, transparent 50%),
    radial-gradient(ellipse 50%  30% at 0%   90%,   #060e05 0%, transparent 50%),
    var(--bg);
}
/* subtle noise overlay */
.page-bg::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  opacity: 0.4;
}
/* vignette */
.page-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 120% 120% at 50% 50%, transparent 40%, rgba(0,0,0,0.55) 100%);
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold2); }

/* ═══════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════ */
#siteHeader {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(180deg, #0a0d07 0%, #0e1209 100%);
}
.header-border-top {
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold2) 20%, var(--gold3) 50%, var(--gold2) 80%, transparent 100%);
}
.header-border-bottom {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--border2) 20%, var(--border3) 50%, var(--border2) 80%, transparent 100%);
  box-shadow: 0 4px 20px rgba(0,0,0,0.8);
}
.header-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 28px;
}

/* Logo */
.logo {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; flex-shrink: 0;
  transition: opacity 0.2s;
}
.logo:hover { opacity: 0.85; text-decoration: none; }
.logo-icon {
  font-size: 1.6rem;
  color: var(--gold3);
  text-shadow: 0 0 16px rgba(200,168,75,0.6), 0 0 32px rgba(200,168,75,0.3);
  line-height: 1;
}
.logo-text-wrap { display: flex; flex-direction: column; line-height: 1; }
.logo-title {
  font-family: var(--font-title);
  font-size: 1.15rem; font-weight: 900;
  letter-spacing: 0.22em;
  color: var(--gold3);
  text-shadow: 0 0 20px rgba(200,168,75,0.4);
}
.logo-sub {
  font-family: var(--font-body);
  font-size: 0.7rem; font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--text3);
  margin-top: 1px;
}

/* Nav */
#mainNav { display: flex; gap: 0; flex: 1; }
.nav-btn {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-title);
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text3);
  padding: 0 18px; height: 62px;
  position: relative;
  transition: color 0.2s;
}
.nav-btn::after {
  content: '';
  position: absolute; bottom: 0; left: 16px; right: 16px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold2), var(--gold3), var(--gold2));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s;
}
.nav-btn:hover { color: var(--text2); }
.nav-btn:hover::after { transform: scaleX(1); }
.nav-btn.active { color: var(--gold3); }
.nav-btn.active::after { transform: scaleX(1); }
.nav-admin { color: var(--danger2) !important; }
.nav-admin::after { background: linear-gradient(90deg, var(--danger), var(--danger2), var(--danger)) !important; }
.nav-admin:hover { color: #d04040 !important; }

/* Download CTA button in nav */
.nav-download {
  border: 1px solid var(--gold2) !important;
  color: var(--gold3) !important;
  border-radius: var(--radius) !important;
  padding: 6px 16px !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  margin-left: 8px;
  transition: all 0.2s !important;
  background: rgba(200,168,75,0.06) !important;
}
.nav-download::after { display: none !important; }
.nav-download:hover {
  background: rgba(200,168,75,0.14) !important;
  border-color: var(--gold3) !important;
  color: var(--gold3) !important;
  box-shadow: 0 0 14px rgba(200,168,75,0.2) !important;
}
.nav-download.active {
  background: rgba(200,168,75,0.16) !important;
  border-color: var(--gold3) !important;
  color: var(--gold3) !important;
}

/* Header right */
.header-right { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.lang-switcher { display: flex; align-items: center; gap: 7px; }
.lang-btn {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-title);
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em;
  color: var(--text3); padding: 4px;
  transition: color 0.2s;
}
.lang-btn:hover  { color: var(--text2); }
.lang-btn.active { color: var(--gold); }
.lang-sep { color: var(--text4); font-size: 0.55rem; }

/* User badge */
.auth-area { display: flex; align-items: center; gap: 10px; }
.user-badge {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-size: 0.9rem;
}
.username { color: var(--gold3); font-weight: 600; }
.role-chip {
  font-family: var(--font-title);
  font-size: 0.58rem; letter-spacing: 0.12em;
  padding: 2px 8px; border-radius: 2px;
  font-weight: 700; text-transform: uppercase;
  background: var(--bg5); color: var(--text3);
  border: 1px solid var(--border);
}
.role-chip.headadmin { background: rgba(180,30,30,0.15); color: #e05050; border-color: #8b1c1c; }
.role-chip.admin     { background: rgba(200,168,75,0.1); color: var(--gold); border-color: var(--gold2); }
.role-chip.editor    { background: rgba(61,101,52,0.15); color: var(--success2); border-color: var(--success); }

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-title);
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 7px 20px; cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
  position: relative; overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}
.btn-primary {
  background: linear-gradient(180deg, #1a2a12 0%, #111a0a 100%);
  border-color: var(--gold2);
  color: var(--gold3);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 0 12px rgba(200,168,75,0.1), inset 0 1px 0 rgba(200,168,75,0.2);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #253418 0%, #182210 100%);
  border-color: var(--gold3);
  color: #f0cc88;
  box-shadow: 0 3px 14px rgba(0,0,0,0.5), 0 0 20px rgba(200,168,75,0.22), inset 0 1px 0 rgba(200,168,75,0.3);
  transform: translateY(-1px);
}
.btn-secondary {
  background: linear-gradient(180deg, var(--bg6) 0%, var(--bg4) 100%);
  border-color: var(--border2);
  color: var(--text2);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.btn-secondary:hover { border-color: var(--gold2); color: var(--gold3); transform: translateY(-1px); }
.btn-danger {
  background: linear-gradient(180deg, #280c0c 0%, #180606 100%);
  border-color: #6b1c1c;
  color: #b84040;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.btn-danger:hover { border-color: #9b2828; color: #d05050; transform: translateY(-1px); }
.btn-ghost { background: none; border-color: transparent; color: var(--text3); box-shadow: none; }
.btn-ghost:hover { color: var(--gold); border-color: var(--border2); }
.btn-sm { padding: 4px 12px; font-size: 0.6rem; letter-spacing: 0.1em; }
.btn-icon { width: 28px; height: 28px; padding: 0; justify-content: center; }

/* Decorative divider */
.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 28px 0;
  color: var(--text4);
}
.divider::before, .divider::after {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border2), transparent);
}
.divider-icon { font-size: 0.7rem; color: var(--gold2); }

/* FAB */
.fab {
  position: fixed; bottom: 30px; right: 30px; z-index: 50;
  width: 54px; height: 54px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 300;
  background: linear-gradient(135deg, #182210, #0e1609);
  border: 1px solid var(--gold2);
  border-radius: 50%; cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6), 0 0 20px rgba(200,168,75,0.15);
  color: var(--gold3);
  transition: all 0.2s;
}
.fab:hover {
  transform: scale(1.07);
  box-shadow: 0 6px 28px rgba(0,0,0,0.7), 0 0 28px rgba(200,168,75,0.3);
  border-color: var(--gold3);
}

/* ═══════════════════════════════════════════════════════════
   MAIN LAYOUT
   ═══════════════════════════════════════════════════════════ */
#mainContent {
  max-width: 1380px;
  margin: 0 auto;
  padding: 32px 24px 100px;
  min-height: calc(100vh - 66px);
}

/* ── Section header ─────────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 32px;
  position: relative;
}
.section-title {
  font-family: var(--font-title);
  font-size: 1.35rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold3);
  text-shadow: 0 0 30px rgba(200,168,75,0.3);
  display: flex; align-items: center; gap: 14px;
}
.section-title::before,
.section-title::after {
  content: '✦';
  font-size: 0.55rem; color: var(--gold2); opacity: 0.7;
}
.section-divider {
  height: 1px; margin-bottom: 28px;
  background: linear-gradient(90deg, transparent, var(--border2) 30%, var(--border3) 50%, var(--border2) 70%, transparent);
  position: relative;
}
.section-divider::after {
  content: '☩';
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg); color: var(--border3);
  padding: 0 10px; font-size: 0.75rem;
  line-height: 1;
}

/* ── Gothic panel ───────────────────────────────────────────── */
.panel {
  background: linear-gradient(180deg, var(--bg4) 0%, var(--bg3) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}
.panel::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border3), transparent);
}

/* ═══════════════════════════════════════════════════════════
   HOME / NEWS
   ═══════════════════════════════════════════════════════════ */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
}
.news-card {
  background: linear-gradient(160deg, var(--bg5) 0%, var(--bg3) 100%);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
  position: relative;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,200,100,0.04);
}
.news-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border3), transparent);
  transition: background 0.25s;
}
.news-card::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 60px;
  background: linear-gradient(0deg, rgba(0,0,0,0.25) 0%, transparent 100%);
  pointer-events: none;
}
.news-card:hover {
  border-color: var(--gold2);
  box-shadow: 0 6px 28px rgba(0,0,0,0.6), 0 0 28px rgba(200,168,75,0.1);
  transform: translateY(-2px);
}
.news-card:hover::before {
  background: linear-gradient(90deg, transparent, var(--gold2), transparent);
}
.news-card-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.1);
}
.news-card-title {
  font-family: var(--font-title);
  font-size: 1.05rem; font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--gold3); margin-bottom: 8px; line-height: 1.35;
  text-shadow: 0 0 20px rgba(200,168,75,0.15);
}
.news-card-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.82rem; color: var(--text3);
  font-family: var(--font-body);
}
.meta-dot { color: var(--text4); font-size: 0.5rem; }
.news-card-body {
  padding: 16px 22px;
  font-size: 0.97rem; color: var(--text2); line-height: 1.74;
}
.news-card-body ul { margin: 6px 0 10px 22px; list-style: disc; }
.news-card-body ol { margin: 6px 0 10px 22px; list-style: decimal; }
.news-card-body li { margin-bottom: 4px; }
.news-card-body h1,.news-card-body h2,.news-card-body h3 { font-family: var(--font-title); color: var(--gold); margin: 10px 0 5px; }
.news-card-body p  { margin-bottom: 8px; }
.news-card-body strong { color: var(--text); font-weight: 600; }
.news-card-footer {
  padding: 10px 22px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
  background: rgba(0,0,0,0.2);
}

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 70px 24px;
  color: var(--text3);
}
.empty-icon {
  font-size: 1.8rem; margin-bottom: 16px;
  color: var(--border3); opacity: 0.6;
  display: block; font-family: var(--font-title);
  letter-spacing: 0.3em;
}
.empty-state p {
  font-family: var(--font-body); font-style: italic;
  font-size: 1rem; color: var(--text3);
}

/* Social media section */
.social-section {
  margin-top: 48px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}
.social-section-title {
  font-family: var(--font-title);
  font-size: 1.1rem; font-weight: 700; letter-spacing: 0.08em;
  color: var(--gold3); margin-bottom: 20px;
  text-align: center;
}
.social-links {
  display: flex; justify-content: center;
  gap: 14px; flex-wrap: wrap;
}
.social-link {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(160deg, var(--bg4) 0%, var(--bg3) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 24px;
  text-decoration: none;
  font-family: var(--font-title);
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text2);
  transition: all 0.18s;
  min-width: 140px; justify-content: center;
}
.social-link:hover {
  border-color: var(--gold2);
  color: var(--gold3);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.social-link-icon { font-size: 1.2rem; }
.social-edit-btn {
  display: block; margin: 18px auto 0;
  font-size: 0.78rem; color: var(--text4);
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body);
  transition: color 0.15s;
}
.social-edit-btn:hover { color: var(--gold); }

/* ═══════════════════════════════════════════════════════════
   WIKI
   ═══════════════════════════════════════════════════════════ */
.wiki-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
  align-items: start;
}

/* Sidebar */
.wiki-sidebar {
  background: linear-gradient(180deg, var(--bg4) 0%, var(--bg3) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: sticky; top: 82px;
}
.sidebar-title {
  padding: 12px 16px;
  font-family: var(--font-title);
  font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold2);
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.sidebar-title::before { content: '✦'; font-size: 0.7rem; }

/* Category tree */
.cat-tree { padding: 6px 0; }
.cat-item {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; cursor: pointer;
  font-family: var(--font-body);
  font-size: 1.05rem; color: var(--text);
  border-left: 2px solid transparent;
  transition: all 0.15s;
  user-select: none;
  line-height: 1.3;
}
.cat-item:hover { color: var(--text); background: rgba(200,168,75,0.04); border-left-color: var(--border2); }
.cat-item.active { color: var(--gold3); background: rgba(200,168,75,0.07); border-left-color: var(--gold2); }
.cat-toggle {
  width: 14px; height: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.5rem; color: var(--text4);
  transition: transform 0.18s;
}
.cat-toggle.open { transform: rotate(90deg); color: var(--gold2); }
.cat-spacer { width: 14px; flex-shrink: 0; }
.cat-name { flex: 1; }

/* Wiki main */
.wiki-search {
  display: flex; gap: 10px; margin-bottom: 20px;
}
.search-input {
  flex: 1;
  background: var(--bg4); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  padding: 9px 14px;
  font-family: var(--font-body); font-size: 0.97rem;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.search-input:focus {
  border-color: var(--gold2);
  box-shadow: 0 0 0 2px rgba(200,168,75,0.08);
}
.search-input::placeholder { color: var(--text4); font-style: italic; }

/* Wiki panel header */
.wiki-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.wiki-panel-title {
  font-family: var(--font-title);
  font-size: 1rem; font-weight: 700; letter-spacing: 0.06em;
  color: var(--gold3);
}

/* Category group headers (parent-category view) */
.cat-group-header {
  display: flex; align-items: center; gap: 10px;
  margin: 22px 0 10px;
  font-family: var(--font-title);
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold);
}
.cat-group-header::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--gold-line) 0%, transparent 100%);
}
.cat-group-count {
  font-family: var(--font-body);
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em;
  color: var(--bg); background: var(--gold2);
  padding: 1px 7px; border-radius: 999px;
  line-height: 1.5;
}

/* Entry list */
.entries-list { display: flex; flex-direction: column; gap: 6px; }
.entry-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(160deg, var(--bg4) 0%, var(--bg3) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s;
  cursor: default;
}
.entry-row:hover { border-color: var(--border2); background: linear-gradient(160deg, var(--bg5) 0%, var(--bg4) 100%); }
.entry-row-left { cursor: pointer; flex: 1; }
.entry-row-title {
  font-family: var(--font-body);
  font-size: 1rem; font-weight: 600; color: var(--text);
  transition: color 0.15s;
}
.entry-row:hover .entry-row-title { color: var(--gold3); }
.entry-row-meta { font-size: 0.8rem; color: var(--text3); margin-top: 2px; }
.entry-row-actions { display: flex; gap: 6px; flex-shrink: 0; margin-left: 12px; }

/* Entry detail */
.entry-detail {}
.entry-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-title);
  font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text3); cursor: pointer; margin-bottom: 20px;
  transition: color 0.15s;
  background: none; border: none; padding: 0;
}
.entry-back:hover { color: var(--gold); }
.entry-detail-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 8px; gap: 16px;
}
.entry-detail-title {
  font-family: var(--font-title);
  font-size: 1.8rem; font-weight: 700;
  color: var(--gold3); line-height: 1.25;
  text-shadow: 0 0 30px rgba(200,168,75,0.2);
}
.entry-detail-meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 0.84rem; color: var(--text3);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.entry-detail-meta .meta-item { display: flex; align-items: center; gap: 5px; }
.entry-detail-body {
  background: linear-gradient(160deg, var(--bg4) 0%, var(--bg3) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 32px;
  font-family: var(--font-body);
  font-size: 1.02rem; line-height: 1.8;
  color: var(--text2);
  position: relative;
}
.entry-detail-body::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border3), transparent);
}
.entry-detail-body h1 { font-family: var(--font-title); font-size: 1.3rem; font-weight: 700; color: var(--gold3); margin: 20px 0 10px; letter-spacing: 0.05em; }
.entry-detail-body h2 { font-family: var(--font-title); font-size: 1.1rem; font-weight: 600; color: var(--gold);  margin: 16px 0 8px;  letter-spacing: 0.04em; }
.entry-detail-body h3 { font-family: var(--font-title); font-size: 0.95rem; font-weight: 600; color: var(--text); margin: 14px 0 6px; letter-spacing: 0.04em; }
.entry-detail-body p  { margin-bottom: 12px; }
.entry-detail-body ul { margin: 8px 0 12px 20px; }
.entry-detail-body li { margin-bottom: 5px; }
.entry-detail-body hr { border: none; border-top: 1px solid var(--border2); margin: 20px 0; }
.entry-detail-body strong { color: var(--text); font-weight: 600; }
.entry-detail-body em { color: var(--text); font-style: italic; }

/* ── Tag ────────────────────────────────────────────────────── */
/* View toggle */
.view-toggle { display: flex; gap: 4px; }
.view-toggle-btn {
  background: var(--bg4); border: 1px solid var(--border);
  color: var(--text3); border-radius: var(--radius);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; cursor: pointer;
  transition: all 0.15s;
}
.view-toggle-btn:hover { border-color: var(--border2); color: var(--text); }
.view-toggle-btn.active { background: rgba(200,168,75,0.12); border-color: var(--gold2); color: var(--gold); }

/* Entry grid */
.entries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.entry-card {
  background: linear-gradient(160deg, var(--bg4) 0%, var(--bg3) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden; cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  display: flex; flex-direction: column;
}
.entry-card:hover {
  border-color: var(--gold2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}
.entry-card-img {
  width: 100%; aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
}
.entry-card-img img {
  max-width: 90%; max-height: 90%;
  width: auto; height: auto;
  object-fit: contain;
  display: block; transition: transform 0.2s;
}
.entry-card:hover .entry-card-img img { transform: scale(1.07); }
.entry-card-img-placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--text4); font-size: 1.6rem;
}
.entry-card-footer {
  padding: 10px 10px 8px;
  display: flex; flex-direction: column; gap: 6px;
  flex: 1;
}
.entry-card-title {
  font-family: var(--font-body);
  font-size: 0.9rem; font-weight: 600; color: var(--text);
  line-height: 1.3;
}
.entry-card:hover .entry-card-title { color: var(--gold3); }
.entry-card-actions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }

/* List view thumbnail */
.entry-row-thumb {
  width: 48px; height: 48px; flex-shrink: 0;
  border-radius: 4px; overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg2);
  margin-right: 4px;
}
.entry-row-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Entry detail — image + text side by side */
.entry-detail-content {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin-top: 8px;
}
.entry-detail-text { flex: 1; min-width: 0; }

.entry-detail-image {
  flex-shrink: 0;
  width: 240px; height: 240px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
  order: 2;
}
.entry-detail-image img {
  display: block;
  width: 100%; height: 100%;
  object-fit: contain;
}
@media (max-width: 640px) {
  .entry-detail-content { flex-direction: column; }
  .entry-detail-image { width: 100%; height: 220px; order: 0; }
}

/* Game ID badge */
/* ── Image slots (3 per entry) ───────────────────────────────── */
.form .img-slot { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; background: rgba(0,0,0,0.15); }
.img-drop-zone {
  margin-top: 8px;
  border: 1px dashed var(--border2);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: .8rem; color: var(--text3);
  cursor: default;
  transition: border-color .15s, background .15s;
  text-align: center;
}
.img-drop-zone.drag-over {
  border-color: var(--gold);
  background: var(--gold-glow);
  color: var(--gold3);
}

.entry-game-id {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(200,168,75,0.07);
  border: 1px solid rgba(200,168,75,0.2);
  border-radius: var(--radius);
  padding: 7px 14px;
  margin-bottom: 18px;
}
.entry-game-id-label {
  font-family: var(--font-title);
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold2);
}
.entry-game-id-value {
  font-family: 'Courier New', monospace;
  font-size: 0.95rem; color: var(--gold3);
  background: rgba(0,0,0,0.3);
  padding: 2px 8px; border-radius: 3px;
  user-select: all;
}
.btn-copy-id {
  background: none; border: none; cursor: pointer;
  font-size: 0.9rem; padding: 2px 4px;
  color: var(--text2); transition: color .15s, transform .1s;
  line-height: 1;
}
.btn-copy-id:hover { color: var(--gold3); transform: scale(1.15); }

/* Historia edycji */
.history-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.history-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .8rem;
}
.history-row-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.history-editor { color: var(--gold); font-weight: 600; white-space: nowrap; }
.history-date   { color: var(--text3); white-space: nowrap; }
.history-preview { color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Historia – podgląd przywracania */
.history-revert-preview {
  display: flex; flex-direction: column; gap: 0;
  border: 1px solid var(--border2); border-radius: 6px; overflow: hidden;
}
.history-revert-row {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
}
.history-revert-row:last-child { border-bottom: none; }
.history-revert-label {
  flex: 0 0 90px; padding: 8px 12px;
  background: var(--bg3); color: var(--text3);
  font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  display: flex; align-items: flex-start; padding-top: 10px;
}
.history-revert-val {
  flex: 1; padding: 8px 12px; color: var(--text);
  word-break: break-word;
}
.history-revert-body { color: var(--text2); font-size: .8rem; line-height: 1.5; }

/* Upgrade system */
.upgrade-section { margin-top: 22px; }
.upgrade-section-label {
  font-family: var(--font-title);
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold2);
  margin-bottom: 10px;
}
.upgrade-tabs {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-bottom: 0;
}
.form-accordion-hdr {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
  padding: 6px 0; margin-bottom: 8px;
}
.form-accordion-hdr:hover .form-section-label { color: var(--gold3); }
.accordion-arrow {
  font-size: .65rem; color: var(--text2);
  display: inline-block;
  transition: transform .18s;
}
.accordion-arrow.open { transform: rotate(90deg); }
.upgrade-tab-btn {
  background: var(--bg4); border: 1px solid var(--border);
  color: var(--text3); border-radius: var(--radius);
  padding: 4px 10px; font-size: 0.82rem; font-family: var(--font-title);
  letter-spacing: 0.05em; cursor: pointer;
  transition: all 0.15s;
}
.upgrade-tab-btn:hover { border-color: var(--border2); color: var(--text); }
.upgrade-tab-btn.active {
  background: rgba(200,168,75,0.14); border-color: var(--gold2); color: var(--gold);
}
.upgrade-panels { margin-top: 0; }
.upgrade-tab-panel.hidden { display: none; }
.upgrade-tab-btn.epic { border-color: rgba(160,80,220,0.35); color: #c080f0; }
.upgrade-tab-btn.epic:hover { border-color: rgba(160,80,220,0.6); color: #d4a0ff; }
.upgrade-tab-btn.epic.active { background: rgba(160,80,220,0.14); border-color: #a050dc; color: #d4a0ff; }
.upgrade-tab-btn.leg { border-color: rgba(220,180,60,0.5); color: #e8c84a; }
.upgrade-tab-btn.leg:hover { border-color: rgba(220,180,60,0.8); color: #f0d870; }
.upgrade-tab-btn.leg.active { background: rgba(220,180,60,0.14); border-color: #d4a820; color: #f0d870; }
.upgrade-section-label.epic-label { color: #c080f0; }

/* Tag */
.tag {
  display: inline-block;
  font-family: var(--font-title);
  font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 2px;
  font-weight: 700;
}
.tag-category  { background: rgba(200,168,75,0.1);  color: var(--gold);    border: 1px solid rgba(200,168,75,0.25); }
.tag-headadmin { background: rgba(180,30,30,0.15);  color: #e05050;        border: 1px solid #8b1c1c; }
.tag-editor    { background: rgba(61,101,52,0.15);  color: var(--success2); border: 1px solid var(--success); }

/* ═══════════════════════════════════════════════════════════
   CHANGELOG
   ═══════════════════════════════════════════════════════════ */
.changelog-list { display: flex; flex-direction: column; }
.cl-entry { display: flex; gap: 0; }
.cl-timeline {
  display: flex; flex-direction: column; align-items: center;
  width: 56px; flex-shrink: 0;
}
.cl-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--gold2);
  border: 2px solid var(--bg);
  box-shadow: 0 0 10px rgba(200,168,75,0.4);
  flex-shrink: 0; margin-top: 20px; z-index: 1;
}
.cl-line {
  width: 1px; flex: 1; min-height: 20px;
  background: linear-gradient(180deg, var(--border2), var(--border));
}
.cl-card {
  flex: 1; margin-bottom: 22px;
  background: linear-gradient(160deg, var(--bg4) 0%, var(--bg3) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s;
  position: relative;
}
.cl-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border3), transparent);
}
.cl-card:hover { border-color: var(--border2); }
.cl-card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(0,0,0,0.15);
}
.cl-card-left { display: flex; align-items: center; gap: 12px; }
.cl-version {
  font-family: var(--font-title);
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.1em;
  padding: 3px 10px; border-radius: 2px;
  background: rgba(200,168,75,0.12);
  color: var(--gold3);
  border: 1px solid var(--gold2);
}
.cl-title {
  font-family: var(--font-title);
  font-size: 0.9rem; font-weight: 600;
  letter-spacing: 0.04em; color: var(--text);
}
.cl-meta { font-size: 0.82rem; color: var(--text3); }
.cl-actions { display: flex; gap: 6px; }
.cl-body {
  padding: 16px 26px;
  font-family: var(--font-body);
  font-size: 0.97rem; color: var(--text2); line-height: 1.76;
}
.cl-body h1,.cl-body h2,.cl-body h3 { font-family: var(--font-title); color: var(--gold); margin: 12px 0 6px; }
.cl-body h1 { font-size: 1.1rem; }
.cl-body h2 { font-size: 0.97rem; letter-spacing: 0.04em; }
.cl-body h3 { font-size: 0.88rem; }
.cl-body p  { margin-bottom: 8px; }
.cl-body ul { margin: 6px 0 8px 18px; }
.cl-body li { margin-bottom: 4px; }
.cl-body strong { color: var(--text); }

/* ═══════════════════════════════════════════════════════════
   ADMIN PANEL
   ═══════════════════════════════════════════════════════════ */
.admin-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.admin-tab {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-title);
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text3);
  padding: 10px 22px;
  border-bottom: 2px solid transparent;
  transition: all 0.18s;
}
.admin-tab:hover  { color: var(--text2); }
.admin-tab.active { color: var(--gold3); border-bottom-color: var(--gold2); }

/* Table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 10px 16px;
  font-family: var(--font-title);
  font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}
.data-table td {
  padding: 11px 16px;
  vertical-align: middle;
  font-family: var(--font-body); font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(200,168,75,0.03); }
.td-actions { text-align: right; white-space: nowrap; }
.td-actions-inner { display: inline-flex; gap: 6px; align-items: center; }

/* ═══════════════════════════════════════════════════════════
   DOWNLOAD
   ═══════════════════════════════════════════════════════════ */
.nav-download { color: var(--gold3) !important; }
.nav-download::after { background: linear-gradient(90deg, var(--gold2), var(--gold3), var(--gold2)) !important; }

.download-hero {
  display: flex; align-items: center; justify-content: space-between;
  gap: 32px;
  background: linear-gradient(135deg, var(--bg4) 0%, var(--bg3) 60%, var(--bg2) 100%);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 48px 52px;
  margin-bottom: 32px;
  position: relative; overflow: hidden;
}
.download-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 80% 50%, rgba(200,168,75,0.07) 0%, transparent 65%);
  pointer-events: none;
}
.download-hero-text { flex: 1; }
.download-subtitle {
  font-family: var(--font-title);
  font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold2); margin-bottom: 10px;
}
.download-heading {
  font-family: var(--font-title);
  font-size: 2.6rem; font-weight: 900; letter-spacing: 0.06em;
  color: var(--gold3); line-height: 1.1;
  text-shadow: 0 0 40px rgba(200,168,75,0.25);
  margin-bottom: 16px;
}
.download-desc {
  font-family: var(--font-body);
  font-size: 1.05rem; color: var(--text2);
  line-height: 1.75; max-width: 520px;
  margin-bottom: 28px;
}
.btn-download {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-title);
  font-size: 0.9rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; text-decoration: none;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold2) 100%);
  color: #0a0704;
  padding: 14px 36px;
  border-radius: var(--radius);
  border: none; cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(200,168,75,0.3);
}
.btn-download:hover {
  background: linear-gradient(135deg, var(--gold3) 0%, var(--gold) 100%);
  box-shadow: 0 6px 28px rgba(200,168,75,0.45);
  transform: translateY(-2px);
  color: #0a0704;
}
.download-note {
  font-size: 0.8rem; color: var(--text4);
  margin-top: 14px; letter-spacing: 0.03em;
}
.download-hero-deco {
  font-size: 8rem; color: rgba(200,168,75,0.06);
  font-family: 'Cinzel', serif; font-weight: 900;
  flex-shrink: 0; line-height: 1;
  user-select: none;
}

/* Steps */
.download-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.download-step {
  display: flex; align-items: flex-start; gap: 16px;
  background: linear-gradient(160deg, var(--bg4) 0%, var(--bg3) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  transition: border-color 0.15s;
}
.download-step:hover { border-color: var(--border2); }
.step-num {
  font-family: var(--font-title); font-size: 1.8rem; font-weight: 900;
  color: var(--gold2); line-height: 1; flex-shrink: 0;
  opacity: 0.7;
}
.step-title {
  font-family: var(--font-title); font-size: 0.85rem; font-weight: 700;
  letter-spacing: 0.06em; color: var(--gold3);
  margin-bottom: 6px;
}
.step-desc {
  font-family: var(--font-body); font-size: 0.95rem; color: var(--text2);
  line-height: 1.6;
}

/* Requirements */
.download-reqs { padding: 24px 28px; }
.download-reqs-title {
  font-family: var(--font-title); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold2); margin-bottom: 16px;
}
.download-reqs-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 24px;
  font-family: var(--font-body); font-size: 0.97rem; color: var(--text2);
}
.req-label { color: var(--text3); margin-right: 4px; }

/* ═══════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════ */
.form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-label {
  font-family: var(--font-body);
  font-size: 0.92rem; font-weight: 600;
  color: var(--text2);
  display: flex; align-items: center; gap: 6px;
}
.form-input, .form-select, .form-textarea {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  padding: 11px 15px;
  font-family: var(--font-body); font-size: 1rem;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gold2);
  box-shadow: 0 0 0 3px rgba(200,168,75,0.1);
}
.form-input::placeholder { color: var(--text4); }
.form-select { cursor: pointer; }
.form-select option { background: var(--bg4); }
.form-textarea { resize: vertical; min-height: 130px; line-height: 1.7; }
.form-textarea.tall { min-height: 200px; }
.form-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  padding-top: 8px; border-top: 1px solid var(--border); margin-top: 4px;
}
.form-divider {
  border: none; border-top: 1px solid var(--border); margin: 4px 0;
}
.form-section-label {
  font-family: var(--font-title);
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold2);
  display: flex; align-items: center; gap: 10px;
  padding: 4px 0;
}
.form-section-label::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border2), transparent);
}
.form-hint {
  font-family: var(--font-body); font-style: italic;
  font-size: 0.88rem; color: var(--text4);
}

/* ═══════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.82);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.modal {
  background: linear-gradient(160deg, var(--bg5) 0%, var(--bg3) 100%);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 96vw; max-width: 1480px;
  max-height: 94vh; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 0 1px rgba(200,168,75,0.06);
  animation: modalIn 0.18s ease;
  position: relative;
}
.modal::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border3), var(--gold2), var(--border3), transparent);
}
@keyframes modalIn {
  from { transform: scale(0.96) translateY(-10px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
  background: rgba(0,0,0,0.2);
}
#modalTitle {
  font-family: var(--font-title);
  font-size: 1rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold3);
}
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text3); font-size: 1.6rem; line-height: 1;
  padding: 0 4px; transition: color 0.15s;
}
.modal-close:hover { color: var(--danger2); }
.modal-body { padding: 24px 36px; overflow-y: auto; }

/* ═══════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════ */
#toastContainer {
  position: fixed; bottom: 26px; right: 26px; z-index: 300;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
.toast {
  padding: 11px 20px;
  font-family: var(--font-title);
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  border-radius: var(--radius);
  max-width: 340px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  animation: toastIn 0.2s ease;
  border: 1px solid transparent;
}
@keyframes toastIn {
  from { transform: translateX(16px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.toast-success { background: #0d2010; color: var(--success2); border-color: var(--success); }
.toast-error   { background: #200a0a; color: #c04040;         border-color: var(--danger);  }
.toast-info    { background: #0e1a0a; color: var(--gold);     border-color: var(--gold2);   }

/* ── Confirm dialog ─────────────────────────────────────────── */
.confirm-box { text-align: center; padding: 8px 0; }
.confirm-box p {
  font-family: var(--font-body); font-size: 1rem;
  color: var(--text2); margin-bottom: 22px; line-height: 1.65;
}
.confirm-actions { display: flex; gap: 10px; justify-content: center; }

/* ── Spinner ────────────────────────────────────────────────── */
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--gold2);
  animation: spin 0.75s linear infinite;
  margin: 70px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Markdown table ─────────────────────────────────────────── */
.md-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.97rem; }
.md-table th, .md-table td { border: 1px solid var(--border2); padding: 8px 14px; text-align: left; }
.md-table th { background: var(--bg4); color: var(--gold3); font-family: var(--font-title); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
.md-table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
.md-table tr:hover td { background: rgba(200,168,75,0.05); }

/* ── Markdown toolbar ────────────────────────────────────────── */
.md-toolbar {
  display: flex; gap: 3px; flex-wrap: wrap; align-items: center;
  padding: 5px 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
}
.md-toolbar-btn {
  background: var(--bg4);
  border: 1px solid var(--border);
  color: var(--text3);
  font-family: var(--font-ui);
  font-size: 0.74rem;
  padding: 3px 9px;
  border-radius: 3px;
  cursor: pointer;
  line-height: 1.5;
  transition: color 0.14s, background 0.14s;
}
.md-toolbar-btn:hover { background: var(--bg5); color: var(--gold3); border-color: var(--border2); }
.md-toolbar-sep { width: 1px; height: 15px; background: var(--border); margin: 0 3px; }

/* ── Split editor ─────────────────────────────────────────────── */
.md-split-wrap {
  display: flex; gap: 14px; align-items: flex-start;
}
.md-split-left {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}
.md-split-left .form-textarea,
.md-split-left .md-split-textarea {
  border-radius: 0 0 var(--radius) var(--radius);
  min-height: 180px;
}
.md-split-left .form-textarea.tall,
.md-split-left .md-split-textarea.tall { min-height: 320px; }
.md-split-right {
  flex: 1; min-width: 0;
  min-height: 200px; max-height: 480px;
  overflow-y: auto;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-family: var(--font-body);
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--text);
  align-self: stretch;
}
.md-split-right h1 { font-family: var(--font-title); font-size: 1.2rem; font-weight: 700; color: var(--gold3); margin: 16px 0 8px; letter-spacing: 0.05em; }
.md-split-right h2 { font-family: var(--font-title); font-size: 1rem; font-weight: 600; color: var(--gold); margin: 14px 0 6px; letter-spacing: 0.04em; }
.md-split-right h3 { font-family: var(--font-title); font-size: 0.9rem; font-weight: 600; color: var(--text2); margin: 12px 0 5px; }
.md-split-right p  { margin-bottom: 10px; }
.md-split-right ul { margin: 6px 0 10px 22px; list-style: disc; }
.md-split-right ol { margin: 6px 0 10px 22px; list-style: decimal; }
.md-split-right li { margin-bottom: 4px; }
.md-split-right hr { border: none; border-top: 1px solid var(--border2); margin: 16px 0; }
.md-split-right strong { color: var(--text); font-weight: 600; }
.md-split-right em { font-style: italic; }
.md-char-count { font-size: 0.72rem; color: var(--text3); text-align: right; margin-top: 3px; }
@media (max-width: 860px) {
  .md-split-wrap { flex-direction: column; }
  .md-split-right { max-height: 200px; align-self: auto; }
}

/* ── Expandable cards ─────────────────────────────────────────── */
.card-expand-btn {
  display: inline-flex; align-items: center; gap: 5px;
  margin: 6px 0 14px 26px;
  padding: 5px 14px;
  background: rgba(200,168,75,0.07);
  border: 1px solid rgba(200,168,75,0.25);
  border-radius: 20px;
  color: var(--gold2);
  font-family: var(--font-title);
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.card-expand-btn:hover {
  background: rgba(200,168,75,0.15);
  border-color: rgba(200,168,75,0.5);
  color: var(--gold3);
}
.cl-body-preview {
  font-family: var(--font-body); font-size: 0.95rem;
  line-height: 1.6; color: var(--text3);
  padding: 14px 26px 4px;
}

/* ── Category entry count badge ─────────────────────────────── */
.cat-count {
  margin-left: auto;
  font-size: 0.68rem;
  background: rgba(200,168,75,0.1);
  border: 1px solid rgba(200,168,75,0.2);
  color: var(--text3);
  border-radius: 10px;
  padding: 1px 7px;
  font-family: var(--font-ui);
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

/* ── Back to top ─────────────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(200,168,75,0.1);
  border: 1px solid var(--gold2);
  color: var(--gold3);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99;
  transition: background 0.2s, transform 0.15s;
  line-height: 1;
}
.back-to-top:hover { background: rgba(200,168,75,0.22); transform: translateY(-3px); }

/* ── Sidebar toggle button (tylko mobile) ───────────────────── */
.sidebar-toggle-btn {
  display: none;
  align-items: center; gap: 8px;
  background: var(--bg4); border: 1px solid var(--border2);
  color: var(--gold); font-family: var(--font-title);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 16px; border-radius: var(--radius);
  cursor: pointer; margin-bottom: 12px;
  transition: border-color .15s;
  width: 100%;
}
.sidebar-toggle-btn:hover { border-color: var(--gold); }
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0,0,0,0.55);
}
.sidebar-overlay.active { display: block; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 860px) {
  .wiki-layout {
    grid-template-columns: 1fr;
  }
  .wiki-sidebar {
    position: fixed;
    top: 0; left: -280px;
    width: 260px; height: 100vh;
    z-index: 100;
    overflow-y: auto;
    border-radius: 0;
    border-right: 1px solid var(--border2);
    transition: left .25s cubic-bezier(.4,0,.2,1);
  }
  .wiki-sidebar.open { left: 0; }
  .sidebar-toggle-btn { display: flex; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .header-inner { gap: 12px; }
  .logo-sub { display: none; }
  .nav-btn { padding: 0 10px; font-size: 0.65rem; }
  .news-grid { grid-template-columns: 1fr; }
  #mainContent { padding: 20px 14px 80px; }
  .md-split-wrap { flex-direction: column; }
  .md-split-right { min-height: 100px; }
}
