/* Układ Twitcha, paleta i typografia NexoraHost */
:root {
  --tlo: #08090a; --panel: #0f1011; --panel2: #161718; --panel3: #1d1f21;
  --obrys: #23252a; --obrys2: #383b3f;
  --papier: #fff; --jasny: #d0d6e0; --mgla: #9a9fa8; --mgla2: #7a7e85;
  --akcent: #dcf23a; --akcent-jasny: #e8f86e; --akcent-25: rgba(220, 242, 58, .25);
  --live: #eb0400;
  --nav-h: 50px; --side-w: 240px; --chat-w: 340px;
  color-scheme: dark;
}
* { box-sizing: border-box }
html, body { margin: 0 }
body { background: var(--tlo); color: var(--jasny); font: 400 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased }
a { color: inherit; text-decoration: none }
img { display: block }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer }
:focus-visible { outline: 2px solid var(--akcent); outline-offset: 2px }
h1, h2, h3 { font-family: "Plus Jakarta Sans", Inter, sans-serif; color: var(--papier) }

/* ---------- górny pasek ---------- */
.top { position: fixed; inset: 0 0 auto 0; z-index: 30; height: var(--nav-h); display: flex; align-items: center; gap: 24px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--obrys) }
.brand { display: flex; align-items: center; gap: 10px; font: 600 15px/1 "Plus Jakarta Sans", Inter, sans-serif; color: var(--papier); white-space: nowrap }
.brand b { color: var(--akcent) }
.brand-mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 4px; background: var(--akcent); color: var(--tlo); font-weight: 800 }
.top-nav { display: flex; gap: 4px }
.top-nav a { padding: 6px 10px; border-radius: 4px; font-weight: 600 }
.top-nav a:hover { background: var(--panel2); color: var(--papier) }
.top-nav a.on { color: var(--akcent) }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 4px; font-size: 13px; font-weight: 600; white-space: nowrap; transition: background .15s }
.btn-accent { background: var(--akcent); color: var(--tlo) }
.btn-accent:hover { background: var(--akcent-jasny) }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--obrys); background: var(--panel2); font-size: 12px; font-weight: 600; white-space: nowrap }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--mgla2) }
.pill.live { color: #fff }
.pill.live i { background: var(--live); box-shadow: 0 0 0 3px rgba(235, 4, 0, .25) }

/* ---------- szkielet: pasek boczny + treść ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); padding-top: var(--nav-h); min-height: 100vh }
.side { position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h)); overflow-y: auto; padding: 10px 0; background: var(--panel); border-right: 1px solid var(--obrys) }
.side h2 { margin: 4px 10px 8px; font: 600 13px/1.4 Inter, sans-serif; text-transform: uppercase; letter-spacing: .04em }
.side-item { display: flex; align-items: center; gap: 10px; padding: 5px 10px }
.side-item:hover { background: var(--panel2) }
.side-item.on { background: var(--panel2); box-shadow: inset 3px 0 var(--akcent) }
.side-item img { width: 56px; height: 32px; flex: none; border-radius: 3px; object-fit: cover; background: var(--panel3) }
.side-text { min-width: 0; flex: 1; display: flex; flex-direction: column }
.side-text b, .side-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.side-text b { font-size: 13px; font-weight: 600; color: var(--papier) }
.side-text small, .side-len { font-size: 12px; color: var(--mgla) }
main { min-width: 0 }

/* ---------- strona kanału ---------- */
.banner { height: clamp(120px, 20vw, 280px); background: linear-gradient(120deg, #121407, var(--panel) 60%) center / cover }
.ch-head { display: flex; align-items: center; gap: 16px; padding: 20px 30px 0 }
.ch-head > div { min-width: 0 }
.ch-actions { margin-left: auto }
.avatar { --ring: var(--akcent); position: relative; flex: none; width: 64px; height: 64px; padding: 3px; border-radius: 50%; background: var(--ring) }
.avatar img { width: 100%; height: 100%; border: 3px solid var(--tlo); border-radius: 50%; object-fit: cover }
.avatar.live { --ring: var(--live) }
.avatar.live::after { content: "NA ŻYWO"; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); padding: 0 5px; border-radius: 3px; background: var(--live); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px }
.ch-name { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2 }
.ch-sub { color: var(--mgla); font-size: 13px }
.tabs { display: flex; gap: 24px; margin-top: 18px; padding: 0 30px; border-bottom: 1px solid var(--obrys) }
.tabs a { margin-bottom: -1px; padding: 10px 0; border-bottom: 2px solid transparent; font-weight: 600 }
.tabs a:hover { color: var(--papier) }
.tabs a.on { color: var(--akcent); border-color: var(--akcent) }
.section { padding: 24px 30px }
.section > h2 { margin: 0 0 18px; font-size: 26px; font-weight: 300 }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px 20px }
.empty { padding: 80px 30px; text-align: center; color: var(--mgla) }

/* karta VOD – twitchowe „wysunięcie” miniatury z akcentem w tle */
.card { display: block; min-width: 0 }
.tw { position: relative; transition: background .1s }
.tw::before, .tw::after { content: ""; position: absolute; width: 6px; height: 6px; background: var(--akcent); transform: scale(0); transition: transform .1s }
.tw::before { top: -6px; left: 0; clip-path: polygon(0 100%, 100% 0, 100% 100%); transform-origin: 0 100% }
.tw::after { right: -6px; bottom: 0; clip-path: polygon(0 0, 100% 0, 0 100%); transform-origin: 0 0 }
.thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--panel3); transition: transform .1s }
.thumb img { width: 100%; height: 100%; object-fit: cover }
.card:hover .tw, .card:focus-visible .tw { background: var(--akcent) }
.card:hover .tw::before, .card:hover .tw::after, .card:focus-visible .tw::before, .card:focus-visible .tw::after { transform: scale(1) }
.card:hover .thumb, .card:focus-visible .thumb { transform: translate(6px, -6px) }
.tag { position: absolute; padding: 0 4px; border-radius: 2px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 13px; line-height: 20px }
.tl { top: 10px; left: 10px } .bl { bottom: 10px; left: 10px } .br { bottom: 10px; right: 10px }
.progress { position: absolute; inset: auto 0 0 0; height: 4px; background: rgba(255, 255, 255, .25) }
.progress i { display: block; height: 100% ; background: var(--akcent) }
.card-meta { display: flex; gap: 10px; margin-top: 10px }
.card-meta img { width: 40px; height: 40px; flex: none; border-radius: 50%; object-fit: cover }
.card-text { min-width: 0 }
.card-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--papier); font-weight: 600 }
.card:hover .card-title { color: var(--akcent) }
.card-ch { color: var(--mgla); font-size: 13px }
.chip { display: inline-block; margin-top: 4px; padding: 0 8px; border-radius: 999px; background: var(--panel3); font-size: 12px; font-weight: 600; line-height: 20px }

.about { max-width: 900px }
.about-box { padding: 20px; border: 1px solid var(--obrys); border-radius: 6px; background: var(--panel) }
.about-box p { margin: 0 0 16px; white-space: pre-line }
.stats { display: flex; flex-wrap: wrap; gap: 8px 32px; color: var(--mgla); font-size: 13px }
.stats b { display: block; color: var(--papier); font: 300 24px/1.2 "Plus Jakarta Sans", Inter, sans-serif }

/* ---------- strona filmu ---------- */
body.watch .app { grid-template-columns: var(--side-w) minmax(0, 1fr) var(--chat-w) }
body.watch main { height: calc(100vh - var(--nav-h)); overflow-y: auto }
.player { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100vh - var(--nav-h) - 120px); overflow: hidden; background: #000; user-select: none }
.player video { display: block; width: 100%; height: 100%; object-fit: contain }
.player:not(.paused):not(.show) { cursor: none }
.ctrl { position: absolute; inset: auto 0 0 0; padding: 40px 10px 4px; background: linear-gradient(transparent, rgba(0, 0, 0, .8)); opacity: 0; transition: opacity .2s }
.player.paused .ctrl, .player.show .ctrl, .player:has(.menu.open) .ctrl, .player:focus-within .ctrl { opacity: 1 }
.player.wait::after { content: ""; position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px; border: 4px solid rgba(255, 255, 255, .2); border-top-color: var(--akcent); border-radius: 50%; animation: spin .8s linear infinite }
@keyframes spin { to { transform: rotate(360deg) } }

.seek { position: relative; height: 16px; display: flex; align-items: center; cursor: pointer; touch-action: none }
.seek-track { position: relative; width: 100%; height: 4px; background: rgba(255, 255, 255, .25); transition: height .1s }
.seek:hover .seek-track { height: 6px }
.seek-buf, .seek-fill { position: absolute; inset: 0 auto 0 0 }
.seek-buf { background: rgba(255, 255, 255, .35) }
.seek-fill { background: var(--akcent) }
.seek-mark { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(0, 0, 0, .85) }
.seek-knob { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--akcent); transform: scale(0); transition: transform .1s }
.seek:hover .seek-knob { transform: scale(1) }
.seek-tip { display: none; position: absolute; bottom: 20px; transform: translateX(-50%); padding: 3px 7px; border-radius: 3px; background: rgba(0, 0, 0, .9); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none }
.seek:hover .seek-tip { display: block }
.ctrl-row { display: flex; align-items: center; gap: 2px }
.ib { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 4px; color: #fff }
.ib:hover { background: rgba(255, 255, 255, .15) }
.ib svg { width: 20px; height: 20px }
.player.paused .i-pause, .player:not(.paused) .i-play, .player.muted .i-vol, .player:not(.muted) .i-muted, .player.fs .i-fs, .player:not(.fs) .i-unfs { display: none }
.vol { width: 80px; accent-color: var(--akcent) }
.time { margin-left: 8px; color: #fff; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap }
.spacer { flex: 1 }
.menu { display: none; position: absolute; right: 10px; bottom: 50px; min-width: 180px; padding: 6px; border: 1px solid var(--obrys); border-radius: 6px; background: var(--panel); box-shadow: 0 8px 30px rgba(0, 0, 0, .6) }
.menu.open { display: block }
.menu h4 { margin: 4px 8px 6px; color: var(--mgla); font-size: 12px; font-weight: 600 }
.menu button { display: block; width: 100%; padding: 6px 8px; border-radius: 4px; text-align: left; font-size: 13px }
.menu button:hover { background: var(--panel2) }
.menu button.on { color: var(--akcent) }

.info { padding: 18px 20px 30px }
.info-row { display: flex; gap: 14px; align-items: flex-start }
.info-row .avatar { width: 56px; height: 56px }
.info-text { flex: 1; min-width: 0 }
.info-name { font: 700 18px/1.3 "Plus Jakarta Sans", Inter, sans-serif; color: var(--papier) }
.vod-title { margin: 2px 0 6px; font: 600 15px/1.4 Inter, sans-serif; overflow-wrap: anywhere }
.vod-sub { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--mgla); font-size: 13px }
.vod-sub .game { color: var(--akcent); font-weight: 600 }
.info h3 { margin: 26px 0 10px; font-size: 15px; font-weight: 500 }
.chaps { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px }
.chap { display: flex; flex: none; gap: 10px; align-items: center; min-width: 200px; padding: 8px; border: 1px solid var(--obrys); border-radius: 6px; background: var(--panel); text-align: left }
.chap:hover { border-color: var(--akcent-25) }
.chap.on { border-color: var(--akcent) }
.chap img { width: 36px; height: 48px; border-radius: 2px; object-fit: cover; background: var(--panel3) }
.chap b { display: block; color: var(--papier); font-size: 13px }
.chap small { color: var(--mgla); font-size: 12px }

/* czat powtórkowy */
.chat { position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h)); display: flex; flex-direction: column; min-width: 0; background: var(--panel); border-left: 1px solid var(--obrys) }
.chat-head { flex: none; height: 50px; display: grid; place-items: center; border-bottom: 1px solid var(--obrys); color: var(--papier); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em }
.chat-list { flex: 1; overflow-y: auto; padding: 10px 0; overflow-anchor: none; overscroll-behavior: contain }
.msg { padding: 5px 20px; font-size: 13px; line-height: 20px; overflow-wrap: anywhere }
.msg:hover { background: var(--panel2) }
.msg .ts { margin-right: 5px; color: var(--mgla2); font-size: 12px; font-variant-numeric: tabular-nums }
.msg .badge { display: inline-block; width: 18px; height: 18px; margin: -2px 3px 0 0; vertical-align: middle }
.msg .name { font-weight: 700 }
.msg .emote { display: inline-block; height: 28px; width: auto; margin: -5px 0; vertical-align: middle }
.msg a { color: var(--akcent); text-decoration: underline }
.chat-empty { padding: 20px; color: var(--mgla); text-align: center }
.chat-paused { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); padding: 6px 14px; border: 1px solid var(--obrys2); border-radius: 4px; background: var(--panel3); color: var(--papier); font-size: 13px; font-weight: 600; white-space: nowrap; box-shadow: 0 6px 20px rgba(0, 0, 0, .5) }
.chat-paused[hidden] { display: none }

/* tryb kinowy i pełny ekran */
body.theater .top, body.theater .side, body.theater .info { display: none }
body.theater .app { grid-template-columns: minmax(0, 1fr) var(--chat-w); padding-top: 0 }
body.theater main { height: 100vh; overflow: hidden }
body.theater .player, .player.fs { height: 100vh; max-height: none; aspect-ratio: auto }
body.theater .chat { top: 0; height: 100vh }

/* ---------- mniejsze ekrany ---------- */
@media (max-width: 1100px) {
  .side { display: none }
  .app { grid-template-columns: minmax(0, 1fr) }
  body.watch .app { grid-template-columns: minmax(0, 1fr) var(--chat-w) }
}
@media (max-width: 800px) {
  .top { gap: 12px }
  .top-nav, .top .pill { display: none }
  .ch-head, .tabs, .section { padding-left: 16px; padding-right: 16px }
  .ch-actions { display: none }
  .grid { grid-template-columns: minmax(0, 1fr) }
  body.watch .app, body.theater .app { display: flex; flex-direction: column; height: auto }
  body.watch main { display: contents }
  .player { order: 1; max-height: none }
  .chat { order: 2; position: static; height: 60vh; border-left: 0; border-top: 1px solid var(--obrys) }
  .info { order: 3; padding: 16px }
  .vol { display: none }
}
