:root {
  --bg: #0f1115;
  --panel: #181b22;
  --line: #262a33;
  --text: #e8e9ec;
  --muted: #8b90a0;
  --accent: #e5a50a;
  --error: #ff6b6b;
  --ok: #4cc38a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid var(--line);
}
[hidden] { display: none !important; }
.brand { font-weight: 800; font-size: 20px; letter-spacing: .5px; color: var(--text); text-decoration: none; }
a.brand:hover { opacity: .85; }
.login-brand { font-size: 28px; text-align: center; margin-bottom: 18px; }
.brand span { color: var(--accent); }
#userbox { display: flex; gap: 12px; align-items: center; color: var(--muted); }

button {
  background: var(--accent); color: #111; border: 0; border-radius: 6px;
  padding: 8px 14px; font-weight: 600; cursor: pointer;
}
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
input {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; font: inherit;
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.card {
  max-width: 360px; margin: 12vh auto; padding: 28px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.card h1 { margin: 0 0 18px; font-size: 20px; }
.card label { display: block; margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.card label input { margin-top: 5px; }
.card button { width: 100%; margin-top: 6px; }
.error { color: var(--error); min-height: 1.4em; margin: 10px 0 0; }
.muted { color: var(--muted); }

main {
  display: grid; grid-template-columns: 1fr 360px; gap: 20px;
  padding: 20px; max-width: 1500px; margin: 0 auto;
}
@media (max-width: 900px) { main { grid-template-columns: 1fr; padding: 12px; } }

/* ───── Lejátszó ───── */
#stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000;
  border-radius: 8px; overflow: hidden; user-select: none;
}
#stage video { width: 100%; height: 100%; display: block; background: #000; }
/* állókép forrásváltáskor: ugyanúgy illeszkedik, mint a videó */
.pl-freeze { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; pointer-events: none; }
.pl-freeze[hidden] { display: none; }
#stage.pl-fs, #stage:fullscreen { border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100vh; }
/* Teljes képernyőn a böngésző a videót külön „overlay” rétegként adhatja a videókártyának (főleg
   AMD-n, nem 16:9-es, fekete csíkos filmeknél). Egyes meghajtókkal ilyenkor a fölötte lévő vezérlősáv
   nem látszik. A szinte 1-es átlátszóság ezt megakadályozza, a képen semmi nem látszik belőle. */
#stage:fullscreen video, #stage.pl-fs video { opacity: .999; }
#stage.pl-idle { cursor: none; }

.pl-bar {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 28px 12px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
  transition: opacity .25s;
}
#stage.pl-idle .pl-bar { opacity: 0; pointer-events: none; }

.pl-progress { position: relative; height: 14px; cursor: pointer; touch-action: none; outline: none; }
.pl-progress::before, .pl-buffered, .pl-hover, .pl-played {
  content: ''; position: absolute; left: 0; top: 5px; height: 4px; border-radius: 2px; transition: height .1s, top .1s;
}
.pl-progress::before { right: 0; background: rgba(255,255,255,.25); }
.pl-buffered { background: rgba(255,255,255,.4); width: 0; }
/* az egér helyéig: áttetsző fehér réteg a betöltött/be nem töltött rész fölött – mindkettő világosabb lesz */
.pl-hover { background: rgba(255,255,255,.35); width: 0; transition: height .1s, top .1s; }
.pl-played { background: var(--accent); width: 0; }
.pl-progress:hover::before, .pl-progress:hover .pl-buffered, .pl-progress:hover .pl-hover, .pl-progress:hover .pl-played { top: 4px; height: 6px; }
.pl-thumb {
  position: absolute; top: 1px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
  background: var(--accent); transform: scale(0); transition: transform .1s;
}
.pl-progress:hover .pl-thumb, .pl-progress:focus-visible .pl-thumb { transform: scale(1); }
.pl-tip {
  position: absolute; bottom: 18px; transform: translateX(-50%); padding: 2px 6px; border-radius: 4px;
  background: rgba(20,20,20,.9); color: #fff; font-size: 12px; white-space: nowrap; pointer-events: none;
}

.pl-row { display: flex; align-items: center; gap: 4px; height: 40px; }
.pl-spacer { flex: 1; }
.pl-btn {
  width: 40px; height: 40px; padding: 8px; border: 0; border-radius: 6px; background: transparent;
  color: #fff; cursor: pointer; display: grid; place-items: center;
}
.pl-btn:hover { background: rgba(255,255,255,.12); }
.pl-btn svg { width: 24px; height: 24px; fill: currentColor; }
.pl-btn[hidden] { display: none; }
#stage.pl-menu-open .pl-gear > svg { transform: rotate(30deg); }
.pl-gear > svg { transition: transform .2s; }
/* Az idő és a hangerő-csoport ugyanazzal a lekerekítéssel (6px), mint a vezérlősáv gombjai. */
.pl-time {
  color: #eee; font: inherit; font-size: 13px; font-weight: 400; margin-left: 4px; padding: 0 10px; border: 0; border-radius: 6px;
  height: 40px; display: inline-flex; align-items: center;   /* ugyanolyan magas, mint a gombok */
  background: transparent; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer;
}
.pl-time:hover { background: rgba(255,255,255,.12); }
.pl-vol { display: flex; align-items: center; border-radius: 6px; }
/* Kinyitott hangerőnél a háttér a hangszórót és a csúszkát együtt fogja körbe. */
.pl-vol:hover, .pl-vol:focus-within { background: rgba(255,255,255,.12); }
.pl-vol .pl-mute:hover { background: transparent; }
/* Hangerő: vékony fehér csík, fehér gomb – keret és kijelölés nélkül */
#stage .pl-volume {
  -webkit-appearance: none; appearance: none; width: 0; height: 20px; margin: 0; padding: 0;
  border: 0; border-radius: 0; outline: none; background: transparent; opacity: 0; cursor: pointer;
  transition: width .2s, opacity .2s;
}
#stage .pl-volume:focus, #stage .pl-volume:focus-visible { outline: none; }
#stage .pl-volume::-webkit-slider-runnable-track {
  height: 3px; border-radius: 2px;
  background: linear-gradient(to right, #fff var(--vol, 100%), rgba(255,255,255,.3) var(--vol, 100%));
}
#stage .pl-volume::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border-radius: 50%; background: #fff; border: 0;
}
#stage .pl-volume::-moz-range-track { height: 3px; border-radius: 2px; background: rgba(255,255,255,.3); }
#stage .pl-volume::-moz-range-progress { height: 3px; border-radius: 2px; background: #fff; }
#stage .pl-volume::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }
#stage .pl-vol:hover .pl-volume, #stage .pl-volume:focus { width: 72px; opacity: 1; margin-right: 10px; }

/* Felirat gomb: bekapcsolva aláhúzás, mint a YouTube-on */
.pl-cc { position: relative; }
.pl-cc.pl-on::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: 6px; height: 3px; border-radius: 2px; background: var(--accent);
}
/* HD jelvény a fogaskeréken és a menüben */
.pl-gear { position: relative; }
.pl-gear-badge {
  position: absolute; top: 4px; right: 1px; padding: 0 3px; border-radius: 3px; background: #e5262f; color: #fff;
  font-size: 9px; font-weight: 700; line-height: 13px; letter-spacing: .2px; pointer-events: none;
}
.pl-gear-badge[hidden] { display: none; }
.pl-badge { font-size: 10px; font-weight: 700; margin-left: 2px; vertical-align: super; line-height: 0; color: #ff4e45; }
.pl-item-value .pl-badge { color: #ff4e45; }
.pl-icon { width: 24px; height: 24px; display: grid; place-items: center; }
.pl-icon svg { width: 22px; height: 22px; fill: currentColor; }

.pl-menu {
  position: absolute; z-index: 5; right: 12px; bottom: 64px; min-width: 300px; max-width: calc(100% - 24px);
  max-height: calc(100% - 80px); overflow-y: auto; padding: 8px 0; border-radius: 10px;
  background: rgba(28,28,28,.92); backdrop-filter: blur(6px); box-shadow: 0 6px 24px rgba(0,0,0,.4);
}
.pl-menu[hidden] { display: none; }
.pl-item, .pl-head {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border: 0; border-radius: 0;
  background: transparent; color: #fff; font: inherit; font-size: 14px; font-weight: 400; text-align: left; cursor: pointer;
}
.pl-item:hover, .pl-head:hover { background: rgba(255,255,255,.1); }
.pl-item-label { flex: 1; }
.pl-item-value { color: #bbb; font-size: 13px; }
.pl-chev { color: #bbb; font-size: 18px; line-height: 1; }
.pl-head { border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: 6px; padding-left: 8px; font-weight: 600; }
.pl-head svg { width: 22px; height: 22px; fill: currentColor; }
.pl-check { width: 20px; height: 20px; display: grid; place-items: center; }
.pl-check svg { width: 20px; height: 20px; fill: currentColor; }
.pl-selected .pl-item-label { font-weight: 600; }

.pl-sub {
  position: absolute; left: 5%; right: 5%; bottom: 6%; display: flex; flex-direction: column; align-items: center;
  gap: 2px; pointer-events: none; transition: bottom .25s; text-align: center;
}
#stage:not(.pl-idle) .pl-sub { bottom: 70px; }
.pl-sub span {
  background: rgba(0,0,0,.72); color: #fff; padding: 2px 8px; border-radius: 3px;
  font-size: clamp(14px, 2.6vw, 26px); line-height: 1.35; white-space: pre-line;
}
#stage.pl-fs .pl-sub span { font-size: clamp(20px, 3vw, 40px); }

.pl-spinner {
  position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px;
  border: 4px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%;
  animation: pl-spin .9s linear infinite; pointer-events: none;
}
.pl-spinner[hidden] { display: none; }
@keyframes pl-spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  .pl-vol .pl-volume { display: none; }
  .pl-menu { right: 6px; left: 6px; min-width: 0; }
}
#nowPlaying { display: flex; justify-content: space-between; gap: 12px; padding: 10px 2px; flex-wrap: wrap; }
#status { color: var(--muted); font-size: 13px; }
#status.ok { color: var(--ok); }
#status.err { color: var(--error); }

#library {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  display: flex; flex-direction: column; max-height: calc(100vh - 110px);
}
.libhead { display: flex; gap: 10px; align-items: center; padding: 12px; border-bottom: 1px solid var(--line); }
#count { color: var(--muted); font-size: 13px; white-space: nowrap; }
#films { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
#films li {
  padding: 9px 10px; border-radius: 6px; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
}
#films li:hover { background: #20242d; }
#films li.active { background: #2a2618; }
#films .name { font-weight: 500; overflow-wrap: anywhere; }
#films .meta { color: var(--muted); font-size: 12px; }
#empty { padding: 16px; margin: 0; }

/* ───── Lejátszó animációk ───── */
/* Lejátszás ↔ szünet ikon átalakulása */
.pl-btn.pl-play { padding: 0; }
.pl-play svg.pl-morph { width: 36px; height: 36px; display: block; }
.pl-morph path { fill: currentColor; transition: d .18s ease-in-out; }

/* Hangerő ikon: hullámok a hangerő szerint, némításnál áthúzás */
.pl-volicon .pl-spk { fill: currentColor; }
.pl-volicon .pl-w1, .pl-volicon .pl-w2, .pl-volicon .pl-x {
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
  transform-box: view-box; transform-origin: 9px 12px;
  transition: opacity .18s ease, transform .18s ease;
}
.pl-volicon .pl-x { transform-origin: 18px 12px; opacity: 0; transform: scale(.4); }
.pl-vol-low .pl-w2 { opacity: 0; transform: scale(.7); }
.pl-vol-mute .pl-w1, .pl-vol-mute .pl-w2 { opacity: 0; transform: scale(.6); }
.pl-vol-mute .pl-x { opacity: 1; transform: scale(1); }

/* Középen felvillanó lejátszás / szünet jel */
.pl-flash {
  position: absolute; z-index: 1; left: 50%; top: 50%; width: 72px; height: 72px; min-width: 72px; aspect-ratio: 1 / 1;
  margin: -36px 0 0 -36px; box-sizing: border-box;
  border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center;
  opacity: 0; pointer-events: none;
}
.pl-flash svg { width: 40px; height: 40px; fill: currentColor; }

.pl-flash.pl-flash-go { animation: pl-flash .9s ease-out forwards; }
@keyframes pl-flash {
  0% { opacity: 1; transform: scale(.85); }
  45% { opacity: .9; transform: scale(1.1); }
  100% { opacity: 0; transform: scale(1.5); }
}
/* Felső szöveges visszajelzés (hangerő %, tekerés) */
.pl-toast {
  position: absolute; z-index: 3; left: 50%; top: 10%; transform: translateX(-50%);
  padding: 8px 16px; border-radius: 4px; background: rgba(0,0,0,.6); color: #fff;
  font-size: 18px; font-weight: 500; pointer-events: none; opacity: 0; transition: opacity .3s;
}
.pl-toast.pl-toast-on { opacity: 1; transition: opacity .1s; }
@media (prefers-reduced-motion: reduce) {
  .pl-morph path, .pl-volicon path { transition: none; }
  .pl-flash.pl-flash-go { animation-duration: .01s; }
}

/* Oldalsó tekerés-számláló (+5, +10 … / -5, -10 …) */
.pl-seek {
  position: absolute; z-index: 3; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 28px;
  background: rgba(0,0,0,.45); color: #fff; font-size: 22px; font-weight: 600;
  pointer-events: none; opacity: 0; transition: opacity .35s;
}
.pl-seek.pl-seek-on { opacity: 1; transition: opacity .1s; }
.pl-seek-right { right: 8%; flex-direction: row-reverse; }   /* „+10 mp ▸▸▸” */
.pl-seek-left { left: 8%; }                                   /* „◂◂◂ -10 mp” */
.pl-seek-arrows { display: flex; gap: 2px; }
.pl-seek-arrows i {
  width: 0; height: 0; border-top: 8px solid transparent; border-bottom: 8px solid transparent;
  border-left: 11px solid #fff; opacity: .25;
}
.pl-seek-left .pl-seek-arrows { flex-direction: row-reverse; }
.pl-seek-left .pl-seek-arrows i { border-left: 0; border-right: 11px solid #fff; }
.pl-seek-on .pl-seek-arrows i { animation: pl-chev .75s linear; }
.pl-seek-on .pl-seek-arrows i:nth-child(2) { animation-delay: .12s; }
.pl-seek-on .pl-seek-arrows i:nth-child(3) { animation-delay: .24s; }
@keyframes pl-chev { 0%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ───── Együtt nézés ───── */
#party { padding: 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.party-head { display: flex; align-items: center; gap: 8px; }
.party-head strong { flex: 1; }
button.small { padding: 5px 10px; font-size: 13px; }
#partyInfo { font-size: 13px; color: var(--muted); line-height: 1.5; }
#partyInfo b { color: var(--text); font-weight: 600; }
.party-members { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.party-member {
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  background: #1d2029; border-radius: 6px; padding: 4px 8px; font-size: 12px; color: var(--text);
}
.party-member.host .pm-name { color: var(--accent); }
.pm-state { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pm-state::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: currentColor; }
.pm-ok { color: var(--ok); }
.pm-warn { color: var(--accent); }
.pm-bad { color: var(--error); }
.pm-unknown { color: var(--muted); }
#partyRooms { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
#partyRooms:empty { display: none; }
#partyRooms li {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; background: #1d2029; font-size: 13px;
}
#partyRooms li .room-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#partyRooms li .room-film { color: var(--muted); }
#films.locked li { cursor: not-allowed; opacity: .55; }
#films.locked li.active { opacity: 1; }
#partyBadge {
  font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #3a3118; color: var(--accent); white-space: nowrap;
}
.party-hint { margin-top: 6px; padding: 5px 8px; border-radius: 6px; background: #2a2618; color: var(--accent); font-size: 12px; }
.party-clock {
  display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px;
  padding: 5px 8px; border-radius: 6px; background: #1d2029;
}
.pc-label { font-size: 12px; color: var(--muted); }
.pc-time { font-size: 14px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
#partySync { font-size: 13px; color: var(--muted); }
#partySync summary { cursor: pointer; color: var(--text); padding: 2px 0; }
#partySync label { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; }
#partySync select {
  background: #1d2029; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; font: inherit;
}
#syncHint { margin: 8px 0 0; font-size: 12px; line-height: 1.4; }

/* ───── Jobb klikkes menü (Ismétlés, Statisztikák) ───── */
.pl-ctx {
  position: absolute; z-index: 30; min-width: 220px; padding: 8px 0; border-radius: 12px;
  background: rgba(28,28,28,.9); backdrop-filter: blur(8px); box-shadow: 0 4px 24px rgba(0,0,0,.4);
}
.pl-ctx-item {
  display: flex; align-items: center; gap: 14px; width: 100%; height: 40px; padding: 0 16px 0 14px;
  border: 0; background: transparent; color: #fff; font: inherit; font-size: 13px; font-weight: 600;
  text-align: left; cursor: pointer;
}
.pl-ctx-item:hover { background: rgba(255,255,255,.1); }
.pl-ctx-item > svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
.pl-ctx-label { flex: 1; }
.pl-ctx-check { width: 20px; height: 20px; flex: none; }
.pl-ctx-check svg { width: 20px; height: 20px; fill: currentColor; }

/* ───── Statisztikák panel ───── */
.pl-stats {
  position: absolute; z-index: 4;   /* a fogaskerék menü (5) és a jobb klikkes menü fölé ne kerüljön */ top: 10px; left: 10px; max-width: calc(100% - 20px); max-height: calc(100% - 80px);
  overflow: auto; padding: 8px 38px 8px 10px; border-radius: 8px; background: rgba(28,28,28,.82);
  color: #fff; font-size: 11px; line-height: 1.45; pointer-events: auto;
}
.pl-stats-grid { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 10px; }
.pl-stats-k { font-weight: 700; text-align: right; white-space: nowrap; }
.pl-stats-v { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.pl-stats-g { display: flex; align-items: center; gap: 10px; min-height: 16px; }
.pl-stats-g canvas { width: 160px; height: 10px; flex: none; }
.pl-stats-g span { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; white-space: nowrap; }
.pl-stats-close {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,255,255,.1); color: #fff; cursor: pointer;
  transition: background .15s;
}
.pl-stats-close svg { width: 16px; height: 16px; fill: currentColor; }
.pl-stats-close:hover { background: rgba(255,255,255,.25); }
@media (max-width: 600px) { .pl-stats { font-size: 10px; } .pl-stats-g canvas { width: 90px; } }

/* ───── Kikapcsolási időzítő: „Lejárt az idő” ablak (a képernyő közepén, teljes képernyőn is) ───── */
.pl-sleepdlg {
  position: fixed; z-index: 1000; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(460px, calc(100vw - 32px)); padding: 22px 24px 24px; border-radius: 12px;
  background: #fff; color: #0f0f0f; box-shadow: 0 8px 40px rgba(0,0,0,.45); text-align: left;
}
.pl-dlg-title { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.pl-dlg-text { font-size: 14px; line-height: 1.4; margin-bottom: 22px; }
.pl-dlg-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pl-dlg-buttons button {
  height: 40px; border: 0; border-radius: 20px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.pl-dlg-add { background: #f2f2f2; color: #0f0f0f; }
.pl-dlg-add:hover { background: #e5e5e5; }
.pl-dlg-close { background: #0f0f0f; color: #fff; }
.pl-dlg-close:hover { background: #272727; }
.pl-dlg-buttons button:focus-visible { outline: 2px solid #3ea6ff; outline-offset: 2px; }

/* ───── Prémium felirat a fejlécben ───── */
#premiumTag {
  font-style: normal; font-weight: 700; font-size: 12px; letter-spacing: .6px; text-transform: uppercase;
  margin-left: 10px; padding: 3px 9px; border-radius: 999px; vertical-align: 3px;
  color: #1a1203; background: linear-gradient(135deg, #f6d365 0%, #e5a50a 55%, #c98a00 100%);
  box-shadow: 0 0 0 1px rgba(229,165,10,.35), 0 2px 10px rgba(229,165,10,.25);
}

/* ───── Admin felület ───── */
#adminDlg {
  width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
#adminDlg::backdrop { background: rgba(0,0,0,.6); }
#adminDlg[open] { display: flex; flex-direction: column; }
.adm-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 8px; }
.adm-head h2 { margin: 0; font-size: 18px; }
.adm-x { background: transparent; color: var(--muted); width: 32px; height: 32px; padding: 0; border-radius: 50%; font-size: 16px; }
.adm-x:hover { background: rgba(255,255,255,.08); color: var(--text); }
.adm-add { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; align-items: center; padding: 8px 20px 0; }
#admError { padding: 0 20px; margin: 8px 0 4px; font-size: 13px; }
#admError.adm-ok { color: var(--ok); }
.adm-tablewrap { overflow: auto; padding: 0 20px; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 8px; border-bottom: 1px solid var(--line); }
.adm-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.adm-actions { text-align: right; white-space: nowrap; }
.adm-actions button { padding: 5px 10px; font-size: 13px; margin-left: 6px; }
.adm-del:hover, .adm-armed { color: var(--error) !important; border-color: var(--error) !important; }
.adm-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.adm-master { background: rgba(229,165,10,.15); color: var(--accent); }
.adm-note { padding: 0 20px 16px; margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.adm-note code { color: var(--text); }
.adm-pwform { display: flex; gap: 8px; }
.adm-pwform input { flex: 1; }
.adm-pwform button { padding: 6px 12px; white-space: nowrap; }

/* Prémium kapcsoló */
.adm-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.adm-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.adm-switch span {
  position: relative; width: 34px; height: 20px; border-radius: 10px; background: var(--line); transition: background .15s; flex: none;
}
.adm-switch span::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s;
}
.adm-switch input:checked + span { background: var(--accent); }
.adm-switch input:checked + span::after { transform: translateX(14px); }
.adm-switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.adm-switch em { font-style: normal; font-size: 13px; color: var(--muted); }

@media (max-width: 640px) {
  .adm-add { grid-template-columns: 1fr; }
  .adm-table th:nth-child(3), .adm-table td:nth-child(3) { display: none; }
  #premiumTag { margin-left: 6px; }
}

/* Admin fülek és Bitráták */
.adm-head { gap: 16px; }
.adm-tabs { display: flex; gap: 4px; margin-right: auto; }
.adm-tab { background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 6px; font-weight: 600; }
.adm-tab:hover { background: rgba(255,255,255,.06); color: var(--text); }
.adm-tab-on { background: rgba(229,165,10,.15); color: var(--accent); }
.adm-panel { display: flex; flex-direction: column; min-height: 0; }
.adm-panel[hidden] { display: none !important; }
.adm-intro { padding: 4px 20px 8px; margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.adm-intro b { color: var(--text); }
.enc-input { display: inline-flex; align-items: center; gap: 6px; }
.enc-input input { width: 110px; padding: 6px 8px; text-align: right; }
.enc-input em { font-style: normal; color: var(--muted); font-size: 13px; }
.enc-changed td:first-child { color: var(--accent); font-weight: 600; }
.enc-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 0; }
#encMsg { margin: 0; padding: 0; font-size: 13px; }
#encMsg.adm-ok { color: var(--ok); }
.enc-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.enc-changed .enc-input input { border-color: var(--accent); }
.enc-na { text-align: center; }
.enc-table td { vertical-align: top; }
.enc-sep td { padding-top: 18px; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--line); }
.enc-note { font-size: 12px; line-height: 1.4; }


/* ───── Görgetősáv: vékony, sötét, lekerekített; rámutatáskor a kiemelőszín ───── */
/* Chrome, Edge, Safari */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.16); border-radius: 999px;
  border: 2px solid transparent; background-clip: padding-box;      /* a csík körül kis hézag marad */
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(229,165,10,.75); }
::-webkit-scrollbar-thumb:active { background-color: var(--accent); }
::-webkit-scrollbar-corner { background: transparent; }
/* A lejátszó menüiben és a statisztikában még vékonyabb */
.pl-menu::-webkit-scrollbar, .pl-stats::-webkit-scrollbar { width: 6px; }
.pl-menu::-webkit-scrollbar-thumb, .pl-stats::-webkit-scrollbar-thumb { border-width: 1px; background-color: rgba(255,255,255,.25); }
/* Firefox */
@supports (-moz-appearance: none) {
  * { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
}
.adm-add-switch { white-space: nowrap; }
.adm-add-switch em { min-width: 52px; }
/* Admin → Lejátszó */
.pl-cfg-table td { vertical-align: middle; }
.pl-cfg-table select {
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 10px; font: inherit; font-size: 14px; min-width: 190px;
}
.pl-cfg-table select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.pl-cfg-table .enc-input input { width: 80px; }
#plMsg { margin: 0; padding: 0; font-size: 13px; }
#plMsg.adm-ok { color: var(--ok); }
/* Mentés üzenete a gombok sorában, balra (nem a lap alján) */
.enc-actions { align-items: center; padding-bottom: 16px; }
.enc-actions .adm-msg { flex: 1; margin: 0; padding: 0 !important; min-height: 0; font-size: 13px; }
/* Számmezők az admin felületen: fel-le nyilak nélkül (sima mező) */
#adminDlg input[type=number] { -moz-appearance: textfield; appearance: textfield; }
#adminDlg input[type=number]::-webkit-outer-spin-button,
#adminDlg input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
/* Lejátszó → Hangerő: a szám balra igazítva */
.pl-cfg-table .enc-input input { text-align: left; }
/* Amíg nincs film kiválasztva: a lejátszás gomb és az idősáv halvány, nem kattintható */
#stage.pl-nosrc .pl-play, #stage.pl-nosrc .pl-progress { opacity: .4; cursor: default; }
#stage.pl-nosrc .pl-play:hover { background: transparent; }


/* Szoba elhagyása / bezárulása: kérdés */
#choiceDlg, #resumeDlg {
  width: min(460px, calc(100vw - 32px)); padding: 22px 24px 20px; border-radius: 12px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
#choiceDlg::backdrop, #resumeDlg::backdrop { background: rgba(0,0,0,.55); }
#choiceDlg h2, #resumeDlg h2 { margin: 0 0 8px; font-size: 18px; }
#choiceDlg p, #resumeDlg p { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.choice-buttons { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.choice-buttons [hidden] { display: none !important; }

/* A film címe alatt az együtt nézés jelzése */
.np-main { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; }

/* ───── Admin → Szerver ───── */
#adminDlg.adm-wide { width: min(1080px, calc(100vw - 32px)); }
.srv { padding: 4px 20px 18px; overflow: auto; }
.srv h3 { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.srv-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.srv-card { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.srv-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 13px; border-top: 1px solid rgba(255,255,255,.04); }
.srv-row:first-of-type { border-top: 0; }
.srv-row > span { color: var(--muted); white-space: nowrap; }
.srv-row b { font-weight: 600; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.srv-row code { font-size: 11px; font-weight: 400; color: var(--muted); }
.srv-sub { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.srv-ok { color: var(--ok); } .srv-warn { color: var(--accent); } .srv-bad { color: var(--error); }
.srv-sec { margin-top: 16px; }
.srv-sec .adm-tablewrap { padding: 0; }
.srv-count { font-weight: 600; color: var(--text); background: rgba(255,255,255,.08); border-radius: 999px; padding: 1px 8px; margin-left: 4px; text-transform: none; letter-spacing: 0; }
.srv-empty { margin: 4px 0 0; font-size: 13px; }
.srv-table td { font-size: 13px; }
.srv-log {
  max-height: 260px; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.55;
}
.srv-l { white-space: pre-wrap; overflow-wrap: anywhere; }
.srv-l span { color: var(--muted); margin-right: 8px; }
.srv-l em { font-style: normal; color: #7aa2f7; margin-right: 8px; }
.srv-l-warn { color: var(--accent); } .srv-l-err { color: var(--error); }
@media (max-width: 820px) { .srv-cards { grid-template-columns: 1fr; } }

/* Admin: a fejléc (cím + fülek) és a gombsor minden fülön fix, csak a középső rész görög. */
#adminDlg[open] { overflow: hidden; }
#adminDlg .adm-head { flex: none; }
#adminDlg .adm-panel { flex: 1 1 auto; min-height: 0; overflow: hidden; }
#adminDlg #encForm, #adminDlg #plForm { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
#adminDlg .adm-panel .adm-tablewrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
#adminDlg .adm-panel > :not(.adm-tablewrap):not(#encForm):not(#plForm):not(.srv),
#adminDlg #encForm > :not(.adm-tablewrap), #adminDlg #plForm > :not(.adm-tablewrap) { flex: none; }
#adminDlg .adm-panel > .srv { flex: 1 1 auto; min-height: 0; overflow: auto; }
#adminDlg .adm-tablewrap thead th { position: sticky; top: 0; z-index: 1; background: var(--panel); }
/* Admin → Bitráták: prémium sorok */
.enc-prem td { background: rgba(229,165,10,.04); }
.enc-prem-name { white-space: nowrap; }
.enc-pill { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: rgba(229,165,10,.15); color: var(--accent); vertical-align: 1px; }

/* ───── Lejátszó: sebesség oldal (csúszka) ───── */
.pl-speed { padding: 6px 16px 10px; }
.pl-speed-val { text-align: center; font-size: 22px; font-weight: 700; margin: 6px 0 12px; font-variant-numeric: tabular-nums; }
.pl-speed-row { display: flex; align-items: center; gap: 10px; }
.pl-speed-btn {
  width: 34px; height: 34px; flex: none; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.14); color: #fff; font-size: 20px; font-weight: 600; line-height: 1; cursor: pointer;
}
.pl-speed-btn:hover:not(:disabled) { background: rgba(255,255,255,.24); }
.pl-speed-btn:disabled { opacity: .35; cursor: default; }
/* A csúszka: kitöltve az aktuális értékig; nem prémiumnál a 2× fölötti rész csíkozott (zárolt). */
.pl-speed-range {
  --fill: 20%; --lock: 100%;
  --track:
    linear-gradient(90deg, #fff 0 var(--fill), transparent var(--fill)),
    repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 3px, rgba(255,255,255,.22) 3px 6px) right 0 / calc(100% - var(--lock)) 100% no-repeat,
    linear-gradient(90deg, rgba(255,255,255,.3) 0 var(--lock), rgba(255,255,255,.1) var(--lock));
  flex: 1; min-width: 0; height: 20px; margin: 0; padding: 0; border: 0; border-radius: 0; cursor: pointer;
  -webkit-appearance: none; appearance: none; background: transparent; box-shadow: none;
}
/* Az általános „input:focus” sárga kerete ide nem kell (az a csúszkán át futott). */
.pl-speed-range:focus, .pl-speed-range:focus-visible { outline: none; box-shadow: none; }
/* A sáv külön elem, a gomb fölötte, középre igazítva – így a vonal nem fut át a gombon. */
.pl-speed-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--track); }
.pl-speed-range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--track); }
.pl-speed-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin-top: -6px; border: 0; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.pl-speed-range::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.pl-speed-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(229,165,10,.6); }
.pl-speed-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px rgba(229,165,10,.6); }
.pl-speed-chips { display: flex; gap: 8px; margin-top: 14px; }
.pl-speed-chip {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0; border: 0; border-radius: 999px;
  background: rgba(255,255,255,.12); color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; position: relative;
}
.pl-speed-chip:hover { background: rgba(255,255,255,.2); }
.pl-speed-chip.pl-on { background: #fff; color: #111; }
.pl-speed-chip small { position: absolute; top: 100%; margin-top: 3px; font-size: 11px; font-weight: 400; color: #bbb; }
.pl-speed-chips:has(small) { margin-bottom: 28px; }
.pl-speed-note { margin-top: 14px; font-size: 12px; color: #bbb; text-align: center; }
.pl-speed-note b { color: var(--accent); }
/* Menüpont alatti kisebb szöveg (pl. „Nagyobb bitráta”, „A videó végén” alatt a hátralévő idő) */
.pl-opt-sub { display: block; font-size: 11px; font-weight: 400; color: #aaa; margin-top: 2px; }

/* ───── Lejátszó: saját buborék a gombokhoz („Némítás [M]”) ───── */
.pl-btip {
  position: absolute; z-index: 6; left: 0; bottom: 64px; display: flex; align-items: center; gap: 7px;
  padding: 5px 9px; border-radius: 6px; background: rgba(20,20,20,.95); color: #fff; font-size: 13px; font-weight: 600;
  white-space: nowrap; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.pl-btip.pl-btip-on { opacity: 1; transform: none; }
.pl-btip-key {
  min-width: 18px; padding: 0 4px; border: 1px solid rgba(255,255,255,.75); border-radius: 4px;
  font: inherit; font-size: 11px; line-height: 16px; text-align: center;
}
.pl-btip-key + .pl-btip-key { margin-left: -3px; }

/* ───── Admin → Seederek ───── */
.sd-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.sd-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 400;
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
}
.sd-chip:hover { border-color: rgba(255,255,255,.25); }
.sd-chip.sd-on { border-color: var(--accent); background: rgba(229,165,10,.1); }
.sd-chip b { font-weight: 700; }
.sd-chip span { color: var(--muted); }
.sd-chip em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--ok); }
.sd-dot { width: 8px; height: 8px; border-radius: 50%; background: #5b8def; flex: none; }
.sd-dot.sd-busy { background: var(--ok); }
.sd-folders { display: flex; flex-direction: column; gap: 4px; }
.sd-folder { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; }
.sd-folder code { overflow-wrap: anywhere; min-width: 0; }
.sd-folder span { color: var(--muted); white-space: nowrap; }
.sd-missing span { color: var(--error); }
.sd-total { float: right; font-size: 12px; font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }

/* Első indítás (mesteradmin létrehozása) */
.setup-note { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.setup-note b { color: var(--text); }
#setupForm[hidden], #loginForm[hidden] { display: none; }

/* ───── Megtekintések ───── */
/* Filmlista: hol tart a néző (vékony csík a cím alatt) */
.film-prog { display: block; height: 3px; margin-top: 6px; border-radius: 2px; background: rgba(255,255,255,.1); overflow: hidden; }
.film-prog i { display: block; height: 100%; background: var(--accent); }
.film-prog.film-done i { background: var(--ok); }
/* Folytatás / elölről kérdés */
#resumeDlg { width: min(560px, calc(100vw - 32px)); }
#resumeDlg h2 { overflow-wrap: anywhere; }
#resumeDlg p { margin-bottom: 10px; }
.resume-bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,.1); overflow: hidden; margin: 0 0 20px; }
.resume-bar i { display: block; height: 100%; background: var(--accent); }
/* Saját előzmények ablak (az admin ablak mintájára) */
#histDlg {
  width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
#histDlg::backdrop { background: rgba(0,0,0,.6); }
#histDlg[open] { display: flex; flex-direction: column; overflow: hidden; }
#histDlg .adm-head { flex: none; gap: 12px; }
#histDlg .adm-head h2 { margin-right: auto; }
#histDlg #histClear { padding: 5px 10px; font-size: 13px; }
#histDlg #histClear[hidden] { display: none; }
#histDlg .adm-msg { flex: none; margin: 0; padding: 0 20px; min-height: 0; font-size: 13px; }
#histDlg .adm-tablewrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
#histDlg .adm-tablewrap thead th { position: sticky; top: 0; z-index: 1; background: var(--panel); }
.hs-pad { flex: none; height: 16px; }
.hist-table td { vertical-align: middle; }
.hist-name { font-weight: 500; overflow-wrap: anywhere; }
.hist-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.hist-off { color: var(--error); }
.hist-prog { width: 190px; }
.hist-bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,.1); overflow: hidden; }
.hist-bar i { display: block; height: 100%; background: var(--accent); }
.hist-done { color: var(--ok); font-weight: 600; font-size: 13px; }
.hist-when { white-space: nowrap; color: var(--muted); font-size: 13px; }
.hist-go { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hist-go:empty { display: none; }
.hist-go button { padding: 4px 10px; font-size: 12px; }
.hist-go button:disabled { opacity: .45; cursor: not-allowed; }
.hist-table .adm-actions button:disabled { opacity: .45; cursor: not-allowed; }
/* Admin → Előzmények */
.hs-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; padding: 4px 20px 10px; }
.hs-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.hs-form input { width: 150px; height: 38px; box-sizing: border-box; }
.hs-form .adm-msg { flex: 1 1 100%; margin: 0; padding: 0 !important; min-height: 0; font-size: 13px; }
#hsMsg.adm-ok { color: var(--ok); }
.hs-filter { display: flex; gap: 8px; align-items: center; padding: 0 20px 8px; }
.hs-filter select {
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 10px; font: inherit; font-size: 14px; min-width: 220px;
}
.hs-filter select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.hs-form button { height: 38px; }
.hs-filter button { padding: 5px 10px; font-size: 13px; }
.hs-filter button[hidden] { display: none; }
@media (max-width: 640px) {
  .hist-table th:nth-last-child(2), .hist-table td.hist-when { display: none; }
  .hist-prog { width: auto; }
}
