/* =====================================================================
   Nova Auth — panel administratora, motyw „kosmos” (wersja stonowana).
   Tło z gwiazdami rysuje space.js. Animacje używają tylko transform/opacity,
   więc są płynne także na monitorach 240 Hz i w 4K.
   ===================================================================== */
:root {
  --bg: #05040b;
  --panel-solid: #130f23;
  --panel-2: rgba(30, 25, 52, 0.88);
  --panel-3: rgba(46, 38, 76, 0.92);
  --field: rgba(8, 6, 16, 0.78);
  --border: rgba(160, 140, 255, 0.1);
  --border-2: rgba(170, 150, 255, 0.18);
  --text: #f1eefb;
  --text-2: #c4bedb;
  --muted: #8d87a8;
  --accent: #6418d0;
  --accent-2: #7b2ff0;
  --accent-3: #8b5cf6;
  --accent-text: #bba3ff;
  --accent-soft: rgba(123, 47, 240, 0.16);
  --accent-ring: rgba(139, 92, 246, 0.28);
  --green: #22c55e;
  --green-text: #4ade80;
  --green-soft: rgba(34, 197, 94, 0.13);
  --red: #f04459;
  --red-text: #ff8494;
  --red-soft: rgba(240, 68, 89, 0.13);
  --amber: #f5a524;
  --amber-text: #fbbf24;
  --amber-soft: rgba(245, 165, 36, 0.13);
  --blue: #3b82f6;
  --blue-text: #8db4ff;
  --blue-soft: rgba(59, 130, 246, 0.14);
  --radius: 16px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.75);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.3, 1.2, 0.5, 1);
  --font: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, -apple-system, Roboto, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "Cascadia Mono", ui-monospace, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
html, body { margin: 0; min-height: 100%; }
body {
  background: transparent;
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent-text); }
button, input, select, textarea { font: inherit; color: inherit; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent-3); width: 16px; height: 16px; margin: 0; cursor: pointer; }
::selection { background: rgba(139, 92, 246, 0.45); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.22); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(139, 92, 246, 0.4); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--accent-3); outline-offset: 2px; }

/* ============================================================ kosmos w tle */
.space { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; contain: strict; }
.nebula {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(38% 32% at 16% 20%, rgba(100, 24, 208, 0.17), transparent 70%),
    radial-gradient(30% 28% at 86% 72%, rgba(59, 130, 246, 0.07), transparent 70%),
    radial-gradient(55% 45% at 42% 114%, rgba(100, 24, 208, 0.16), transparent 70%);
  animation: nebula 90s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes nebula {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
  to { transform: translate3d(1.5%, 1%, 0) scale(1.05); }
}
#space { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.vignette { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 40%, transparent 60%, rgba(0, 0, 0, 0.45) 100%); }
#app { position: relative; z-index: 1; min-height: 100vh; }
.fps-meter {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 200;
  pointer-events: none;
  padding: 4px 10px;
  border-radius: 8px;
  font: 600 12px/1.4 var(--mono);
  color: #c8ffd8;
  background: rgba(5, 4, 11, 0.8);
  border: 1px solid rgba(74, 222, 128, 0.35);
}

/* ============================================================ wspólne animacje */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { opacity: 0.55; transform: scale(0.94); } 50% { opacity: 0.85; transform: scale(1.03); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes orbit-tilt { from { transform: rotateX(70deg) rotate(0deg); } to { transform: rotateX(70deg) rotate(360deg); } }
@keyframes ping { 75%, 100% { transform: scale(2.4); opacity: 0; } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes shake {
  15%, 85% { transform: translateX(-2px); }
  30%, 70% { transform: translateX(5px); }
  45%, 55% { transform: translateX(-5px); }
}
.spin { animation: spin 0.8s linear infinite; }

/* ============================================================ ładowanie startowe */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-emblem { position: relative; width: 120px; height: 120px; display: grid; place-items: center; }
.boot-emblem .halo, .auth-emblem .halo {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(123, 47, 240, 0.42), rgba(123, 47, 240, 0) 68%);
  animation: breathe 5s ease-in-out infinite;
}
.boot-emblem .halo { inset: 0; }
.boot-logo { position: relative; width: 70px; height: 70px; }

/* ============================================================ logowanie / setup */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-card {
  position: relative;
  width: 100%;
  max-width: 410px;
  padding: 30px 30px 26px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(24, 19, 42, 0.86), rgba(12, 10, 22, 0.9));
  border: 1px solid rgba(170, 150, 255, 0.14);
  box-shadow: 0 30px 90px -24px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: card-in 0.6s var(--ease) both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(14px); } }
.auth-card.shake { animation: shake 0.42s ease both; }
.auth-emblem { position: relative; width: 116px; height: 116px; margin: -4px auto 10px; display: grid; place-items: center; }
.auth-emblem .halo { inset: 14px; }
.auth-emblem .orbit { position: absolute; inset: 4px; border-radius: 50%; border: 1px solid rgba(196, 181, 253, 0.16); animation: orbit-tilt 28s linear infinite; }
.auth-emblem .orbit.o2 { display: none; }
.auth-emblem .orbit::after {
  content: "";
  position: absolute;
  top: -2px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: #e9e3ff;
  box-shadow: 0 0 6px 1px rgba(167, 139, 250, 0.6);
}
.auth-logo { position: relative; width: 66px; height: 66px; animation: float 8s ease-in-out infinite; filter: drop-shadow(0 6px 16px rgba(100, 24, 208, 0.45)); }
.wordmark {
  margin: 0;
  text-align: center;
  font: 800 32px/1 var(--font-display);
  letter-spacing: 0.3em;
  padding-left: 0.3em;
  background: linear-gradient(180deg, #ffffff, #d6cbff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-kicker { text-align: center; margin-top: 9px; font-size: 11px; font-weight: 700; letter-spacing: 0.34em; padding-left: 0.34em; color: var(--accent-text); text-transform: uppercase; }
.auth-sub { text-align: center; color: var(--muted); margin: 12px 0 22px; font-size: 13.5px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .btn { height: 42px; margin-top: 6px; font-size: 14px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

/* ============================================================ układ */
.layout { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(12, 9, 24, 0.9), rgba(7, 6, 15, 0.94));
  border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 20px; }
.brand-logo { position: relative; width: 36px; height: 36px; flex: none; }
.brand-logo img { width: 36px; height: 36px; display: block; filter: drop-shadow(0 3px 10px rgba(100, 24, 208, 0.4)); }
.brand-name {
  font: 800 17px/1 var(--font-display);
  letter-spacing: 0.28em;
  background: linear-gradient(180deg, #fff, #d6cbff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub { margin-top: 5px; font-size: 10px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent-text); }

.nav { position: relative; display: flex; flex-direction: column; gap: 2px; }
.nav-section { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: #6f6990; padding: 16px 12px 6px; }
.nav a {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  border-radius: 11px;
  color: var(--text-2);
  text-decoration: none;
  font-weight: 500;
  overflow: hidden;
  transition: color 0.2s, background 0.2s;
}
.nav a svg { color: var(--muted); flex: none; transition: color 0.2s; }
.nav a:hover { color: #fff; background: rgba(139, 92, 246, 0.06); }
.nav a:hover svg { color: var(--accent-text); }
.nav a.active { color: #fff; }
.nav a.active svg { color: #cdbcff; }
.nav-ind {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(90deg, rgba(123, 47, 240, 0.24), rgba(123, 47, 240, 0.05) 80%);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s var(--spring), height 0.3s var(--ease), opacity 0.3s;
}
.nav-ind::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 11px;
  bottom: 11px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #d4c6ff, #7b2ff0);
}
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 8px 2px; border-top: 1px solid var(--border); }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #8f5cff, var(--accent));
  color: #fff;
  font-weight: 700;
  flex: none;
}
.me-info { min-width: 0; flex: 1; }
.me-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-role { font-size: 12px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 14px 32px;
  background: rgba(6, 5, 12, 0.88);
  border-bottom: 1px solid var(--border);
}
.titles { min-width: 0; }
.page-title { font: 700 20px/1.2 var(--font-display); }
.page-sub { color: var(--muted); font-size: 13px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.content { padding: 26px 32px 64px; width: 100%; max-width: 1640px; margin: 0 auto; }
.banner-host { width: 100%; max-width: 1640px; margin: 0 auto; padding: 0 32px; }
.banner-host:empty { display: none; }
.stale-banner {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--amber-soft);
  border: 1px solid rgba(251, 191, 36, 0.32);
  color: #fde3b0;
  font-size: 13.5px;
  animation: fade 0.3s ease;
}
.stale-banner svg { color: var(--amber-text); flex: none; }
.page { display: flex; flex-direction: column; gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.scrim { display: none; position: fixed; inset: 0; background: rgba(2, 1, 6, 0.6); z-index: 35; animation: fade 0.2s ease; }
.menu-btn { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* wejście panelu po zalogowaniu */
@media (min-width: 901px) {
  .layout.enter .sidebar { animation: enter-left 0.5s var(--ease) backwards; }
  .layout.enter .topbar { animation: fade 0.5s var(--ease) 0.05s backwards; }
}
@keyframes enter-left { from { opacity: 0; transform: translateX(-12px); } }

/* wejście treści strony — delikatnie, kaskadowo */
.page > *, .stats > *, .dash-row > *, .grid.cols-2 > *, .stack > * { animation: rise 0.45s var(--ease) backwards; }
.page > :nth-child(2) { animation-delay: 0.04s; }
.page > :nth-child(3) { animation-delay: 0.08s; }
.page > :nth-child(n + 4) { animation-delay: 0.12s; }
.stats > :nth-child(2) { animation-delay: 0.03s; }
.stats > :nth-child(3) { animation-delay: 0.06s; }
.stats > :nth-child(4) { animation-delay: 0.09s; }
.dash-row > :nth-child(2), .grid.cols-2 > :nth-child(2), .stack > :nth-child(2) { animation-delay: 0.05s; }
.stack > :nth-child(n + 3) { animation-delay: 0.1s; }

/* szkielety ładowania */
.skel-wrap { display: flex; flex-direction: column; gap: 18px; }
.skel { position: relative; overflow: hidden; background: rgba(170, 150, 255, 0.045); border-radius: 12px; }
.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(196, 181, 253, 0.07), transparent);
  animation: shimmer 1.6s ease-in-out infinite;
}
.skel-rows { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.skel-rows .skel { height: 38px; border-radius: 9px; }
.skel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }

/* ============================================================ karty */
.card {
  position: relative;
  min-width: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(22, 18, 38, 0.9), rgba(13, 11, 24, 0.92));
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 18px 40px -30px rgba(0, 0, 0, 0.8);
}
/* delikatna krawędź podążająca za kursorem */
.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, -300px), rgba(196, 181, 253, 0.3), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-title { font: 650 15px/1.3 var(--font-display); display: flex; align-items: center; gap: 9px; }
.card-title svg { color: var(--accent-text); }
.card-desc { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.dash-row { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: stretch; }

/* hero na dashboardzie */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px;
  flex-wrap: wrap;
  background:
    radial-gradient(90% 140% at 0% 0%, rgba(123, 47, 240, 0.2), transparent 60%),
    linear-gradient(180deg, rgba(22, 18, 38, 0.9), rgba(13, 11, 24, 0.92));
}
.hero-text { min-width: 0; }
.hero-kicker { font-size: 11.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent-text); }
.hero-title { margin: 6px 0 4px; font: 700 27px/1.15 var(--font-display); }
.grad { background: linear-gradient(90deg, #fff, #d4c6ff 70%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { margin: 0; color: var(--text-2); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.stat { padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; transition: transform 0.3s var(--ease), border-color 0.3s; }
.stat:hover { transform: translateY(-1px); border-color: rgba(170, 150, 255, 0.16); }
.stat-icon { position: relative; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.stat-icon.purple { background: rgba(139, 92, 246, 0.16); color: #d6c9ff; box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.2); }
.stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: #c7dbff; box-shadow: inset 0 0 0 1px rgba(125, 170, 255, 0.2); }
.stat-icon.green { background: rgba(34, 197, 94, 0.14); color: #c2f3d3; box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.2); }
.stat-icon.amber { background: rgba(245, 165, 36, 0.14); color: #fde3b0; box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.2); }
.stat-body { min-width: 0; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat-value { font: 700 28px/1.1 var(--font-display); margin-top: 3px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat-sub { color: var(--muted); font-size: 12px; margin-top: 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.dot-stat { display: inline-flex; align-items: center; gap: 6px; }
.dot-stat b { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.dot.green { background: var(--green); }
.dot.red { background: var(--red); }
.dot.amber { background: var(--amber); }
.dot.blue { background: var(--blue); }
.dot.purple { background: var(--accent-3); }
.dot.gray { background: #6b6585; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; padding: 16px 20px; align-items: center; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; text-align: right; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.quick { display: flex; flex-direction: column; gap: 8px; padding: 0 20px 20px; }
.quick .btn { justify-content: flex-start; }

.feed { list-style: none; margin: 0; padding: 4px 0; }
.feed li { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--border); animation: rise 0.4s var(--ease) backwards; animation-delay: calc(var(--r, 0) * 25ms + 0.1s); transition: background 0.2s; }
.feed li:hover { background: rgba(139, 92, 246, 0.04); }
.feed li:last-child { border-bottom: 0; }
.feed-main { flex: 1; min-width: 0; }
.feed-msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-meta { color: var(--muted); font-size: 12px; }
.feed-time { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* gry (produkty) */
.prod { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; white-space: nowrap; color: var(--text); }
.prod-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; background: #6b6585; }
.prod-var { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.07); color: var(--text-2); }
.game-vars { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-top: -1px; }
.game-vars b { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.games { display: flex; flex-direction: column; padding: 6px 0; }
.game-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  width: 100%;
  padding: 11px 20px;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
}
.game-row:hover { background: rgba(139, 92, 246, 0.05); }
.game-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.game-num b { color: var(--text); font-size: 14px; }
.game-bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: rgba(170, 150, 255, 0.08); overflow: hidden; }
.game-bar span { display: block; height: 100%; border-radius: 4px; background: var(--accent-3); transform-origin: left; animation: bar-in 0.8s var(--ease) 0.15s backwards; }
@keyframes bar-in { from { transform: scaleX(0); } }
.games-edit { display: flex; flex-direction: column; gap: 8px; }
.game-edit-row { display: grid; grid-template-columns: 9px minmax(0, 1fr) minmax(0, 1.4fr) 80px 31px; gap: 10px; align-items: center; }
.game-edit-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #7d77a0; }
.game-id { font-family: var(--mono); font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.input.filter-select { width: auto; min-width: 150px; height: 35px; flex: none; }

/* ============================================================ przyciski */
.btn, .icon-btn, .tab, .menu-item { position: relative; overflow: hidden; isolation: isolate; }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; z-index: -1; background: radial-gradient(circle, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 70%); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 15px;
  border-radius: 11px;
  border: 1px solid var(--border-2);
  background: rgba(34, 28, 58, 0.85);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.15s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
}
.btn > :not(.ripple) { position: relative; z-index: 1; }
.btn:hover { border-color: rgba(190, 170, 255, 0.34); background: rgba(44, 36, 74, 0.9); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(180deg, #8448f5, #6a1fd8);
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: 0 6px 18px -10px rgba(123, 47, 240, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:hover { background: linear-gradient(180deg, #8f57f7, #7428e2); border-color: rgba(255, 255, 255, 0.16); }
.btn-danger { background: rgba(240, 68, 89, 0.14); color: var(--red-text); border-color: rgba(240, 68, 89, 0.3); }
.btn-danger:hover { background: rgba(240, 68, 89, 0.22); border-color: rgba(255, 120, 140, 0.45); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(139, 92, 246, 0.08); color: var(--text); border-color: var(--border); }
.btn-sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; gap: 6px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 31px;
  height: 31px;
  padding: 0;
  border-radius: 9px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.icon-btn svg { position: relative; z-index: 1; }
.icon-btn:hover { background: rgba(139, 92, 246, 0.12); color: #fff; border-color: rgba(167, 139, 250, 0.22); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.danger:hover { color: var(--red-text); background: var(--red-soft); border-color: rgba(240, 68, 89, 0.3); }
.icon-btn.ok:hover { color: var(--green-text); background: var(--green-soft); border-color: rgba(34, 197, 94, 0.3); }
.icon-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; background: transparent; border-color: transparent; }

/* ============================================================ formularze */
.input {
  width: 100%;
  height: 40px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1px solid var(--border-2);
  background: var(--field);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input::placeholder { color: #6c6688; }
.input:hover { border-color: rgba(180, 160, 255, 0.28); }
.input:focus { border-color: var(--accent-3); box-shadow: 0 0 0 3px var(--accent-ring); }
.input:disabled { opacity: 0.5; }
textarea.input { height: auto; min-height: 92px; padding: 10px 13px; resize: vertical; line-height: 1.5; }
select.input {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a99fd0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
}
select.input option { background: var(--panel-solid); }
.mono, .input.mono { font-family: var(--mono); font-size: 12.5px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.hint { font-size: 12px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.span-2 { grid-column: span 2; }
.duration { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; color: var(--text-2); user-select: none; }
.radio-list { display: flex; flex-direction: column; gap: 10px; }
.radio-opt { border: 1px solid var(--border-2); border-radius: 13px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: var(--field); transition: border-color 0.2s, background 0.2s; }
.radio-opt.selected { border-color: var(--accent-3); background: rgba(123, 47, 240, 0.07); }
.error-box { background: var(--red-soft); color: #ffa8b4; border: 1px solid rgba(240, 68, 89, 0.3); padding: 10px 12px; border-radius: 11px; font-size: 13px; animation: fade 0.3s ease; }
.info-box { background: rgba(123, 47, 240, 0.09); color: var(--text-2); border: 1px solid rgba(139, 92, 246, 0.24); padding: 12px 14px; border-radius: 11px; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.p-text { margin: 0 0 10px; color: var(--text-2); }

/* przełącznik */
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; flex: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 44px; height: 25px; border-radius: 999px; background: rgba(46, 38, 76, 0.9); border: 1px solid var(--border-2); position: relative; transition: background 0.25s, border-color 0.25s; }
.switch .track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #8f89aa;
  transition: transform 0.3s var(--spring), background 0.25s;
}
.switch input:checked + .track { background: linear-gradient(135deg, #8b5cf6, #6418d0); border-color: rgba(255, 255, 255, 0.1); }
.switch input:checked + .track::after { transform: translateX(19px); background: #fff; }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-ring); }

.setting { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.setting:last-child { border-bottom: 0; }
.setting-title { font-weight: 600; }
.setting-desc { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.form-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.card-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }

/* ============================================================ tabele */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.search { position: relative; flex: 1 1 160px; max-width: 320px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; z-index: 1; }
.search .input { padding-left: 37px; height: 35px; }
.tabs { position: relative; display: inline-flex; gap: 3px; padding: 3px; background: rgba(7, 6, 15, 0.7); border: 1px solid var(--border); border-radius: 12px; flex-wrap: wrap; }
.tab {
  z-index: 1;
  height: 30px;
  padding: 0 11px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color 0.2s;
}
.tab:hover { color: var(--text); }
.tab.active { color: #fff; }
.tab .count { font-size: 11px; color: var(--muted); background: rgba(255, 255, 255, 0.06); padding: 0 6px; border-radius: 6px; line-height: 18px; font-variant-numeric: tabular-nums; }
.tab.active .count { color: #efe9ff; background: rgba(255, 255, 255, 0.12); }
.tab-ind {
  position: absolute;
  left: 0;
  top: 0;
  height: 30px;
  width: 0;
  border-radius: 9px;
  background: rgba(123, 47, 240, 0.32);
  box-shadow: inset 0 0 0 1px rgba(196, 181, 253, 0.2);
  transition: transform 0.35s var(--spring), width 0.35s var(--spring), height 0.25s var(--ease);
  pointer-events: none;
}

.bulkbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; background: rgba(123, 47, 240, 0.12); border-bottom: 1px solid rgba(167, 139, 250, 0.16); font-size: 13px; animation: fade 0.25s ease; }
.bulkbar b { font-variant-numeric: tabular-nums; }

.table-wrap { position: relative; overflow-x: auto; overflow-y: hidden; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7d77a0;
  font-weight: 700;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background 0.15s; animation: fade 0.35s ease backwards; animation-delay: calc(var(--r, 0) * 12ms); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(139, 92, 246, 0.05); }
.table tbody tr.selected { background: rgba(123, 47, 240, 0.09); }
.table .w-check { width: 36px; padding-right: 0; }
.table .actions { text-align: right; white-space: nowrap; width: 1%; }
.table .actions .icon-btn + .icon-btn { margin-left: 2px; }
.table .nowrap { white-space: nowrap; }
.cell-sub { color: var(--muted); font-size: 12px; margin-top: 1px; }
.key-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  letter-spacing: 0.02em;
}
.key-cell svg { color: var(--accent-text); opacity: 0; transition: opacity 0.2s; flex: none; }
.key-cell:hover svg, .key-cell:focus-visible svg { opacity: 1; }
.key-cell:hover { color: #fff; }
.truncate { display: inline-block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); animation: fade 0.4s ease; }
.empty svg { color: #5f4f94; margin-bottom: 12px; }
.empty-title { color: var(--text-2); font-weight: 600; margin-bottom: 3px; font-size: 15px; }
.loading-row { padding: 40px; text-align: center; color: var(--muted); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.pager-btns { display: flex; align-items: center; gap: 8px; }

/* ============================================================ odznaki */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 23px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.green { background: var(--green-soft); color: var(--green-text); border-color: rgba(74, 222, 128, 0.18); }
.badge.red { background: var(--red-soft); color: var(--red-text); border-color: rgba(255, 132, 148, 0.18); }
.badge.amber { background: var(--amber-soft); color: var(--amber-text); border-color: rgba(251, 191, 36, 0.18); }
.badge.blue { background: var(--blue-soft); color: var(--blue-text); border-color: rgba(141, 180, 255, 0.18); }
.badge.purple { background: var(--accent-soft); color: var(--accent-text); border-color: rgba(187, 163, 255, 0.2); }
.badge.gray { background: rgba(255, 255, 255, 0.06); color: var(--text-2); border-color: rgba(255, 255, 255, 0.08); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: rgba(139, 92, 246, 0.12); color: var(--accent-text); }
.online-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; flex: none; }
.online-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--green); animation: ping 2.4s cubic-bezier(0, 0, 0.2, 1) infinite; }
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.level { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ============================================================ wykres */
.chart-wrap { position: relative; padding: 14px 16px 8px; }
.chart { width: 100%; height: 220px; display: block; overflow: visible; }
.chart .grid-line { stroke: rgba(160, 140, 255, 0.09); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar { transition: filter 0.2s; }
.chart.anim .bar { transform-box: fill-box; transform-origin: 50% 100%; animation: grow 0.7s var(--ease) backwards; animation-delay: calc(var(--b, 0) * 25ms + 0.1s); }
@keyframes grow { from { transform: scaleY(0); } }
.chart .hit { fill: transparent; }
.chart .col:hover .bar, .chart .col.active .bar { filter: brightness(1.18); }
.chart .col:hover .hit, .chart .col.active .hit { fill: rgba(167, 139, 250, 0.04); }
.chart-tip {
  position: absolute;
  pointer-events: none;
  background: #221c3a;
  border: 1px solid rgba(190, 170, 255, 0.22);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12.5px;
  box-shadow: 0 14px 36px -12px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 12px));
  opacity: 0;
  transition: opacity 0.15s, left 0.2s var(--ease), top 0.2s var(--ease);
  z-index: 2;
}
.chart-tip.show { opacity: 1; }
.chart-tip b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.chart-tip span { color: var(--muted); }
.chart-summary { display: flex; gap: 26px; padding: 0 20px 4px; flex-wrap: wrap; }
.chart-summary div { color: var(--muted); font-size: 12.5px; }
.chart-summary b { display: block; color: var(--text); font: 700 19px/1.3 var(--font-display); font-variant-numeric: tabular-nums; }

/* ============================================================ modal / menu / toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px 16px;
  background: rgba(3, 2, 8, 0.74);
  animation: fade 0.2s ease;
}
.modal {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: linear-gradient(180deg, #1a1530, #110e20);
  border: 1px solid rgba(180, 160, 255, 0.16);
  box-shadow: 0 30px 90px -20px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: modal-in 0.3s var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 4px; }
.modal-title { font: 700 18px/1.3 var(--font-display); min-width: 0; overflow-wrap: anywhere; }
.modal-body { padding: 12px 22px 6px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px 20px; flex-wrap: wrap; }
.keys-box { width: 100%; min-height: 180px; max-height: 340px; font-family: var(--mono); font-size: 12.5px; line-height: 1.7; }

.menu {
  position: absolute;
  z-index: 60;
  min-width: 230px;
  padding: 6px;
  border-radius: 14px;
  background: linear-gradient(180deg, #201a38, #161227);
  border: 1px solid rgba(180, 160, 255, 0.18);
  box-shadow: 0 20px 50px -16px rgba(0, 0, 0, 0.85);
  transform-origin: top right;
  animation: menu-in 0.2s var(--ease);
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  background: none;
  color: var(--text);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.menu-item > :not(.ripple) { position: relative; z-index: 1; }
.menu-item svg { color: var(--muted); }
.menu-item:hover { background: rgba(139, 92, 246, 0.14); }
.menu-item:hover svg { color: var(--accent-text); }
.menu-item.danger, .menu-item.danger svg { color: var(--red-text); }
.menu-item.danger:hover { background: var(--red-soft); }
.menu-sep { height: 1px; background: var(--border); margin: 5px 4px; }

#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 100; max-width: calc(100vw - 32px); }
.toast {
  position: relative;
  overflow: hidden;
  min-width: 270px;
  max-width: 400px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px 15px 15px;
  border-radius: 13px;
  background: linear-gradient(180deg, #211b3a, #16122a);
  border: 1px solid rgba(180, 160, 255, 0.18);
  box-shadow: 0 18px 44px -14px rgba(0, 0, 0, 0.85);
  font-size: 13.5px;
  animation: toast-in 0.3s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } }
.toast svg { flex: none; margin-top: 1px; }
.toast.success svg { color: var(--green-text); }
.toast.error svg { color: var(--red-text); }
.toast .life { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; transform-origin: left; background: rgba(167, 139, 250, 0.7); animation: life var(--life, 3s) linear forwards; }
.toast.error .life { background: rgba(255, 132, 148, 0.8); }
@keyframes life { to { transform: scaleX(0); } }

/* ============================================================ integracja */
.code {
  margin: 0;
  background: rgba(5, 4, 12, 0.78);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #ddd6f5;
  overflow-x: auto;
  white-space: pre;
}
.copy-field { display: flex; gap: 8px; }
.copy-field .input { flex: 1; }
.endpoints { display: flex; flex-direction: column; }
.endpoint { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--border); align-items: start; }
.endpoint:last-child { border-bottom: 0; }
.endpoint-path { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.method { font-family: var(--mono); font-size: 10.5px; font-weight: 700; padding: 2px 6px; border-radius: 5px; background: var(--green-soft); color: var(--green-text); }
.params { font-family: var(--mono); font-size: 12px; color: var(--accent-text); margin-top: 3px; overflow-wrap: anywhere; }
.steps { margin: 0; padding: 0 0 0 20px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); }
.steps code, .inline-code { font-family: var(--mono); font-size: 12px; background: rgba(139, 92, 246, 0.13); padding: 1px 6px; border-radius: 5px; color: #efe9ff; }
.codes-table td:first-child { font-family: var(--mono); font-size: 12px; color: var(--accent-text); }
.bl-form { display: grid; grid-template-columns: 150px minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.bl-form .btn { height: 40px; }
.msg-cell { min-width: 280px; max-width: 640px; overflow-wrap: anywhere; }

/* ============================================================ responsywność */
@media (max-width: 1439px) {
  .hide-xl { display: none; }
}
@media (max-width: 1279px) {
  .hide-lg { display: none; }
}
@media (max-width: 1100px) {
  .dash-row, .cols-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 268px;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.35s var(--ease);
    background: linear-gradient(180deg, #0f0b1f, #08060f);
  }
  .layout.nav-open .sidebar { transform: none; box-shadow: 30px 0 80px -20px rgba(0, 0, 0, 0.9); }
  .layout.nav-open .scrim { display: block; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 12px 16px; min-height: 62px; }
  .content { padding: 16px 16px 48px; }
  .banner-host { padding: 0 16px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .endpoint { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .topbar-right .badge { display: none; }
  .search { max-width: none; }
  .input.filter-select { flex: 1 1 140px; }
  .bl-form { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 20px 18px; }
  .hero-title { font-size: 23px; }
  .game-edit-row { grid-template-columns: 9px minmax(0, 1fr) 31px; }
  .game-edit-row .game-id, .game-edit-head { display: none; }
  .game-edit-row .game-vars-input { grid-column: 2 / 3; grid-row: 2; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .setting { flex-wrap: wrap; }
  #toasts { left: 16px; right: 16px; }
  .toast { min-width: 0; max-width: none; }
  .wordmark { font-size: 28px; }
}

/* ============================================================ wyłączone animacje */
.fx-off *, .fx-off *::before, .fx-off *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  animation-delay: 0s !important;
  transition-duration: 0.01ms !important;
}
.fx-off .nebula { animation: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
}
