:root {
  --bg: #0b0d10;
  --panel: #111419;
  --panel-2: #161a20;
  --line: rgba(255, 255, 255, .06);
  --line-2: rgba(255, 255, 255, .1);
  --text: #e7e9ec;
  --muted: #8a919c;
  --dim: #5c636e;
  --accent: #f2b54a;
  --accent-soft: rgba(242, 181, 74, .12);
  --radius: 10px;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #22262d; border-radius: 10px; border: 3px solid var(--bg); }

/* ---------- marka ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; font-size: 15px; }
.brand b { color: var(--accent); font-weight: 700; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: url(/favicon.svg) center/cover; }
.brand.big { font-size: 18px; justify-content: center; }
.brand.big .brand-mark { width: 30px; height: 30px; }

/* ---------- login ---------- */
body.login { display: grid; place-items: center; background: radial-gradient(800px 400px at 50% -10%, rgba(242,181,74,.08), transparent), var(--bg); }
.login-card { width: min(380px, 92vw); padding: 36px 32px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; text-align: center; }
.login-card h1 { margin: 22px 0 6px; font-size: 22px; letter-spacing: -.02em; }
.login-card .muted { color: var(--muted); margin: 0 0 26px; }
.err { color: #f87171; margin: 18px 0 0; font-size: 13px; }

/* ---------- układ ---------- */
.app { display: grid; grid-template-columns: 220px 1fr; height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 26px; background: #0d0f13; }
.side .brand { padding: 0 8px; }
nav { display: flex; flex-direction: column; gap: 2px; }
nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); cursor: pointer; font-weight: 500; transition: background .15s, color .15s; }
nav a i { font-style: normal; width: 16px; text-align: center; opacity: .7; }
nav a:hover { background: var(--panel-2); color: var(--text); }
nav a.active { background: var(--panel-2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.count { margin-left: auto; font-size: 11px; color: var(--accent); background: var(--accent-soft); padding: 1px 7px; border-radius: 20px; }
.count:empty { display: none; }
.side-foot { margin-top: auto; padding: 0 8px; display: flex; flex-direction: column; gap: 8px; }
.me { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.me img { width: 24px; height: 24px; border-radius: 50%; }
.logout { color: var(--dim); font-size: 12px; }
.logout:hover { color: var(--text); }

.main { overflow-y: auto; padding: 0 28px 40px; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: 16px 0; background: linear-gradient(var(--bg) 75%, transparent); }
.stats { display: flex; gap: 22px; }
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 17px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }

.live { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; cursor: pointer; user-select: none; }
.live input { display: none; }
.switch { width: 30px; height: 17px; border-radius: 20px; background: #262a31; position: relative; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #8a919c; transition: transform .2s, background .2s; }
.live input:checked + .switch { background: var(--accent-soft); }
.live input:checked + .switch::after { transform: translateX(13px); background: var(--accent); }

.view { display: none; }
.view.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } }

/* ---------- filtry ---------- */
.filters { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.field input { height: 36px; width: 240px; padding: 0 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; outline: none; transition: border-color .15s; }
.field.grow { flex: 1; min-width: 220px; }
.field.grow input { width: 100%; }
.field input:focus { border-color: rgba(242,181,74,.45); }
.field input::placeholder { color: var(--dim); }
.seg { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 10px; border-radius: 6px; color: var(--muted); cursor: pointer; font-size: 13px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel-2); color: var(--text); box-shadow: 0 0 0 1px var(--line-2); }
.chk { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; cursor: pointer; }
.chk input { accent-color: var(--accent); }
.cats { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; border: 1px solid var(--line); background: transparent; color: var(--dim); cursor: pointer; font-size: 12px; transition: all .15s; }
.cat-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); opacity: .5; }
.cat-chip.on { color: var(--text); border-color: color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) 10%, transparent); }
.cat-chip.on .dot { opacity: 1; }
.cat-chip:hover { color: var(--text); }
.active-range { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--accent); background: var(--accent-soft); padding: 8px 12px; border-radius: 8px; }
.active-range button { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; }

/* ---------- oś czasu ---------- */
.feed { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: clip; }
.day { position: sticky; top: 64px; z-index: 2; padding: 8px 16px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); background: #0f1216; border-bottom: 1px solid var(--line); }
.entry { display: grid; grid-template-columns: 70px 112px 1fr auto; gap: 14px; align-items: start; padding: 9px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.entry:hover { background: rgba(255,255,255,.018); }
.entry.new { animation: flash 1.4s ease; }
@keyframes flash { from { background: var(--accent-soft); } }
.entry .time { font-family: var(--mono); font-size: 12px; color: var(--dim); padding-top: 2px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; color: var(--c); white-space: nowrap; padding-top: 2px; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.entry .body { min-width: 0; }
.entry .txt { word-wrap: break-word; }
.entry .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.who { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); padding: 1px 8px; border-radius: 20px; cursor: pointer; }
.who:hover { color: var(--text); border-color: var(--line-2); }
.who small { color: var(--dim); font-family: var(--mono); font-size: 10.5px; }
.arrow { color: var(--dim); font-size: 12px; align-self: center; }
.tag { font-size: 11px; color: var(--dim); padding: 1px 7px; border: 1px dashed var(--line-2); border-radius: 20px; }
.thumb { width: 96px; height: 54px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line-2); cursor: zoom-in; transition: transform .15s; }
.thumb:hover { transform: scale(1.04); }
.details { grid-column: 3 / -1; display: none; margin-top: 8px; padding: 10px 12px; background: #0d1014; border: 1px solid var(--line); border-radius: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.entry.open .details { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; }
.details b { color: var(--dim); font-weight: 400; }
.empty { padding: 50px 20px; text-align: center; color: var(--dim); }
.more { display: flex; justify-content: center; padding: 18px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; font-weight: 500; transition: all .15s; }
.btn:hover { border-color: rgba(255,255,255,.2); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.accent { background: var(--accent); color: #1a1406; border-color: transparent; }
.btn.accent:hover { filter: brightness(1.08); }
.btn.discord { width: 100%; height: 44px; background: #5865f2; border-color: transparent; color: #fff; }
.btn.discord:hover { background: #4f5bda; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- galeria ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.shot { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: zoom-in; transition: border-color .15s, transform .15s; }
.shot:hover { border-color: var(--line-2); transform: translateY(-2px); }
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: #0d1014; }
.shot .cap { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.shot .cap .top-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.shot .cap .name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot .cap .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot .cap time { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.badge { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 4px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }

/* ---------- sesje ---------- */
.hint { color: var(--dim); font-size: 13px; margin: 0 0 14px; }
.sessions { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.session { padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: border-color .15s; }
.session:hover { border-color: rgba(242,181,74,.35); }
.session h3 { margin: 0 0 2px; font-size: 15px; letter-spacing: -.01em; }
.session .when { color: var(--muted); font-size: 13px; font-family: var(--mono); }
.session .nums { display: flex; gap: 18px; margin: 12px 0; }
.session .nums div { display: flex; flex-direction: column; }
.session .nums b { font-size: 16px; font-variant-numeric: tabular-nums; }
.session .nums span { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }
.session .ppl { display: flex; flex-wrap: wrap; gap: 4px; }
.session .ppl span { font-size: 11.5px; color: var(--muted); background: var(--panel-2); padding: 1px 8px; border-radius: 20px; }

/* ---------- gracze ---------- */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); padding: 10px 16px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; transition: background .12s; }
.table tbody tr:hover { background: rgba(255,255,255,.02); }
.mono { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.dim { color: var(--dim); }

/* ---------- online ---------- */
.online { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pcard { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.pcard .id { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; font-family: var(--mono); font-size: 13px; background: var(--accent-soft); color: var(--accent); flex: none; }
.pcard .info { flex: 1; min-width: 0; }
.pcard .info div { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .info small { color: var(--dim); font-size: 12px; }
.pcard .btn { height: 32px; padding: 0 12px; font-size: 12.5px; }

/* ---------- lightbox / toast ---------- */
.lightbox { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(5,6,8,.92); backdrop-filter: blur(6px); }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: min(1400px, 88vw); display: flex; flex-direction: column; gap: 12px; }
.lightbox img { max-width: 100%; max-height: 80vh; border-radius: 8px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lightbox figcaption { color: var(--muted); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.lightbox figcaption .t { color: var(--text); }
.lb-close { position: absolute; top: 18px; right: 22px; background: none; border: 0; font-size: 20px; color: var(--muted); cursor: pointer; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(20,23,28,.8); font-size: 26px; color: var(--muted); cursor: pointer; }
.lb-nav:hover, .lb-close:hover { color: var(--text); }
.lb-nav.prev { left: 24px; } .lb-nav.next { right: 24px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 60; background: var(--panel-2); border: 1px solid var(--line-2); padding: 10px 16px; border-radius: 8px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { flex-direction: row; align-items: center; padding: 10px 14px; overflow-x: auto; }
  nav { flex-direction: row; }
  .side-foot { display: none; }
  .main { padding: 0 14px 30px; }
  .entry { grid-template-columns: 56px 1fr; }
  .entry .pill { grid-column: 2; }
  .entry .body, .entry .thumb-wrap { grid-column: 1 / -1; }
  .stats { gap: 14px; }
}
