:root {
  color-scheme: dark;
  --bg: #0d0f13; --surface: #15181f; --surface-2: #1d212b; --surface-3: #272c38;
  --line: #2a2f3b; --line-strong: #3a4150;
  --text: #f0f2f6; --muted: #9aa1b1; --faint: #6f7686;
  --accent: #5865f2; --accent-hover: #6b77f5; --accent-soft: rgba(88, 101, 242, .16); --accent-text: #b4bcff;
  --ok: #4ad08a; --ok-soft: rgba(74, 208, 138, .13);
  --bad: #ff8080; --bad-soft: rgba(255, 128, 128, .12);
  --warn: #f2bd5b; --warn-soft: rgba(242, 189, 91, .13);
  --radius: 12px; --radius-sm: 8px; --topbar: 60px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar) + 1rem); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
h1 { font-size: 1.75rem; line-height: 1.2; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 1.15rem; line-height: 1.3; letter-spacing: -.01em; margin: 2.25rem 0 .85rem; }
h3 { font-size: .95rem; margin: 0 0 .75rem; }
p { margin: 0 0 .75rem; }
a { color: var(--accent-text); text-underline-offset: 2px; }
code { font-family: var(--mono); background: var(--surface-3); padding: .12em .4em; border-radius: 5px; font-size: .85em; overflow-wrap: anywhere; }
svg.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Górny pasek */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(13, 15, 19, .86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: var(--topbar); max-width: 1240px; margin: 0 auto; padding: .5rem 1rem; }
.topbar nav { display: flex; align-items: center; gap: 1.1rem; min-width: 0; }
.topbar nav > a:not(.button) { color: var(--muted); text-decoration: none; font-size: .925rem; }
.topbar nav > a:not(.button):hover { color: var(--text); }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; color: var(--text); text-decoration: none; }
.brand img { width: 28px; height: 28px; display: block; }
.who { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .925rem; min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 16ch; }

/* Układ */
.page { max-width: 1120px; margin: 0 auto; padding: 2rem 1rem 4rem; }
.page > .flash { margin-bottom: 1rem; }
.panel { display: grid; grid-template-columns: 236px minmax(0, 1fr); max-width: 1240px; margin: 0 auto; }
.panel > .flash { grid-column: 1 / -1; margin: 1rem 1rem 0; }
.sidebar { position: sticky; top: var(--topbar); align-self: start; height: calc(100vh - var(--topbar)); overflow-y: auto; border-right: 1px solid var(--line); padding: 1.25rem .75rem; }
.back { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .85rem; text-decoration: none; padding: 0 .5rem; }
.back:hover { color: var(--text); }
.guild-head { display: flex; align-items: center; gap: .65rem; margin: .9rem 0 1.1rem; padding: 0 .5rem; min-width: 0; }
.guild-name { font-weight: 650; margin: 0; line-height: 1.25; overflow-wrap: anywhere; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: .65rem; padding: .5rem .6rem; border-radius: var(--radius-sm); color: var(--muted); font-size: .94rem; text-decoration: none; }
.sidebar nav a:hover { background: var(--surface); color: var(--text); }
.sidebar nav a[aria-current="page"] { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.sidebar nav a[aria-current="page"] svg { color: var(--accent-text); }
.panel-body { padding: 2rem 1.5rem 4rem; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head p { margin: .3rem 0 0; color: var(--muted); }
.narrow { max-width: 680px; }

/* Awatary */
.avatar { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); color: var(--text); font-weight: 650; font-size: .9rem; overflow: hidden; object-fit: cover; }
.avatar.sm { width: 28px; height: 28px; font-size: .78rem; }
.avatar.lg { width: 48px; height: 48px; font-size: 1.15rem; border-radius: 14px; }
.avatar.square { border-radius: 10px; }

/* Karty i siatki */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 1rem; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem; min-width: 0; }
.card > :last-child { margin-bottom: 0; }
.card-label { display: flex; align-items: center; gap: .45rem; margin: 0 0 .6rem; color: var(--muted); font-size: .85rem; font-weight: 500; }
.stat { font-size: 2rem; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.guild { display: flex; align-items: center; gap: .85rem; text-decoration: none; color: var(--text); transition: border-color .15s, background .15s; }
.guild:hover { border-color: var(--line-strong); background: var(--surface-2); }
.guild strong { display: block; overflow-wrap: anywhere; line-height: 1.3; }
.guild-text { min-width: 0; flex: 1; }
.guild svg.icon { color: var(--faint); }
.dim strong { color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.empty { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 2.25rem 1rem; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty svg.icon { width: 1.6em; height: 1.6em; color: var(--faint); }
.empty p { margin: 0; }

/* Przyciski */
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 40px; padding: .45rem .95rem; border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--accent); color: #fff; font: inherit; font-size: .94rem; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
button:hover, .button:hover { background: var(--accent-hover); }
button:disabled { opacity: .45; cursor: not-allowed; }
.secondary { background: var(--surface-2); border-color: var(--line-strong); color: var(--text); }
.secondary:hover { background: var(--surface-3); }
.danger { background: transparent; border-color: rgba(255, 128, 128, .55); color: var(--bad); }
.danger:hover { background: var(--bad-soft); }
.link { background: none; border: 0; min-height: 0; padding: 0; color: var(--accent-text); font-weight: 500; }
.link:hover { background: none; text-decoration: underline; }
.button.lg { min-height: 46px; padding: .6rem 1.2rem; font-size: 1rem; }
.chip { white-space: nowrap; min-height: 28px; padding: .15rem .6rem; border-color: var(--line-strong); background: var(--surface-2); color: var(--text); font-size: .82rem; font-weight: 500; border-radius: 999px; }
.chip:hover:not(:disabled) { background: var(--bad-soft); border-color: rgba(255, 128, 128, .55); }
.chip:disabled { opacity: 1; cursor: default; color: var(--muted); }
.chips { display: flex; gap: .3rem; flex-wrap: wrap; }
.actions, .buttons { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.buttons { margin-bottom: 1rem; }

/* Formularze */
input, select { width: 100%; min-height: 40px; padding: .45rem .7rem; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--text); font: inherit; font-size: .94rem; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder { color: var(--faint); }
select { appearance: none; padding-right: 2rem; background: var(--bg) url("chevron.svg") no-repeat right .6rem center; }
input[type="checkbox"] { width: 18px; min-height: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.stack { display: flex; flex-direction: column; gap: .9rem; align-items: stretch; }
.stack label { display: flex; flex-direction: column; gap: .35rem; font-size: .875rem; font-weight: 500; color: var(--muted); }
.stack label.check, .check { flex-direction: row; display: flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 400; font-size: .94rem; }
.stack > button, .stack > .button { align-self: flex-start; }
.inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.inline input, .inline select { width: auto; flex: 1 1 140px; min-width: 0; }
.inline label { font-size: .875rem; color: var(--muted); }
.search { max-width: 460px; margin-bottom: .8rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }

/* Komunikaty i stany */
.flash { display: block; margin: 0 0 1rem; padding: .65rem .9rem; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); font-size: .94rem; }
.flash-ok { border-color: rgba(74, 208, 138, .45); background: var(--ok-soft); }
.flash-error { border-color: rgba(255, 128, 128, .45); background: var(--bad-soft); }
.flash-warn { border-color: rgba(242, 189, 91, .45); background: var(--warn-soft); }
.status { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; margin: 0; }
.status::before { content: ""; width: .55em; height: .55em; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 .22em color-mix(in srgb, currentColor 20%, transparent); }
.online { color: var(--ok); }
.offline { color: var(--bad); }
.badge { display: inline-flex; align-items: center; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-accent { background: var(--accent-soft); color: var(--accent-text); }

/* Tabele i listy */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: .8rem; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .018); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.person { display: flex; align-items: center; gap: .65rem; min-width: 150px; }
.person > div { min-width: 0; line-height: 1.3; }
.place { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: .82rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.place-1 { background: rgba(242, 189, 91, .18); color: var(--warn); }
.place-2 { background: rgba(200, 208, 222, .15); color: #d4dae6; }
.place-3 { background: rgba(214, 145, 96, .17); color: #e0a67c; }
.plain { list-style: none; margin: 0 0 1rem; padding: 0; }
.plain li { padding: .55rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; font-size: .94rem; }
.plain li:last-child { border-bottom: 0; }
.tracks { margin: 0; padding: 0; list-style: none; counter-reset: track; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tracks li { counter-increment: track; display: flex; gap: .85rem; padding: .6rem .9rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; font-size: .94rem; }
.tracks li:last-child { border-bottom: 0; }
.tracks li::before { content: counter(track); color: var(--faint); font-variant-numeric: tabular-nums; min-width: 1.2em; text-align: right; }
.tracks:empty, .live-list:empty { padding: 1rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: none; color: var(--muted); font-size: .94rem; }
.tracks:empty::before { content: "Kolejka jest pusta."; }
.live-list:empty::before { content: "Nie ma jeszcze poleceń."; }
.now-playing { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; padding: .8rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.now-playing svg.icon { width: 1.4em; height: 1.4em; color: var(--accent-text); }
.now-playing p { margin: 0; font-weight: 500; overflow-wrap: anywhere; min-width: 0; }

/* Strona główna */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 3rem; align-items: center; padding: 2.5rem 0 3.5rem; }
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.25rem); line-height: 1.08; letter-spacing: -.03em; margin: 1rem 0; }
.hero .lead { font-size: 1.1rem; color: var(--muted); max-width: 54ch; margin-bottom: 1.5rem; }
.pill { display: inline-flex; padding: .3rem .75rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: .85rem; }
.mock { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; overflow: hidden; box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .8); }
.mock-head { padding: .7rem 1rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .875rem; font-weight: 600; }
.mock-body { display: flex; flex-direction: column; gap: 1rem; padding: 1rem; }
.mock-msg { display: flex; gap: .7rem; min-width: 0; }
.mock-msg > div { min-width: 0; flex: 1; }
.mock-name { font-weight: 650; font-size: .875rem; margin: 0 0 .2rem; }
.mock-name em { font-style: normal; font-size: .68rem; font-weight: 700; padding: .05rem .3rem; margin-left: .3rem; border-radius: 4px; background: var(--accent); color: #fff; vertical-align: 1px; }
.mock-msg p { margin: 0; font-size: .9rem; }
.mock-card { margin-top: .35rem; padding: .65rem .8rem; border-left: 3px solid var(--accent); border-radius: 6px; background: var(--surface-2); font-size: .875rem; }
.mock-card strong { display: block; }
.mock-input { margin: 0 1rem 1rem; padding: .6rem .8rem; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--faint); font-size: .875rem; }
.section-head { margin: 0 0 1.25rem; }
.section-head h2 { font-size: 1.6rem; letter-spacing: -.02em; margin: 0 0 .3rem; }
.section-head p { color: var(--muted); margin: 0; }
.feature h3 { display: flex; align-items: center; gap: .6rem; font-size: 1.02rem; margin-bottom: .85rem; }
.feature-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-text); }
dl { margin: 0; }
dt { margin-top: .7rem; }
dt:first-child { margin-top: 0; }
dd { margin: .2rem 0 0; color: var(--muted); font-size: .9rem; }
.band { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 2rem; align-items: center; margin-top: 3.5rem; padding: 2rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.band h2 { font-size: 1.6rem; letter-spacing: -.02em; margin: 0 0 .6rem; }
.band p { color: var(--muted); margin: 0; }
.sources { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.sources li { padding: .35rem .8rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-2); font-size: .9rem; }

/* Błędy */
.center { max-width: 480px; margin: 5rem auto; text-align: center; }
.center .code { font: 700 4rem/1 var(--mono); letter-spacing: -.04em; color: var(--surface-3); margin-bottom: 1rem; }
.center h1 { margin-bottom: .6rem; }
.center p { color: var(--muted); margin-bottom: 1.5rem; }

/* Oglądanie */
.watch { max-width: 1120px; margin: 0 auto; }
.watch-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.watch-head h1 { overflow-wrap: anywhere; }
.watch-head p { margin: .25rem 0 0; color: var(--muted); font-size: .94rem; }
.stage { position: relative; aspect-ratio: 16 / 9; margin: 0 0 1rem; display: flex; align-items: center; justify-content: center; background: #000; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stage video, .stage iframe, .stage > div { width: 100%; height: 100%; border: 0; }
.join { min-height: 48px; padding: .6rem 1.4rem; font-size: 1rem; }

@media (max-width: 860px) {
  .hero, .band { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .hero { padding-top: 1rem; }
  .band { padding: 1.25rem; }
  .topbar nav .anchor { display: none; }
}
@media (max-width: 720px) {
  .panel { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: .9rem 1rem .6rem; overflow: visible; }
  .back { padding: 0; }
  .guild-head { padding: 0; margin: .6rem 0 .7rem; }
  .sidebar nav { flex-direction: row; overflow-x: auto; margin: 0 -1rem; padding: 0 1rem .3rem; scrollbar-width: none; }
  .sidebar nav a { white-space: nowrap; flex: none; }
  .panel-body { padding: 1.25rem 1rem 3rem; }
  .who span { display: none; }
  h1 { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
