/* PKTOK Vezérlő — web remote (also loaded by the desktop shell). Dark, touch-friendly, big buttons.
   Deliberately standalone (no console CSS): this page must stay tiny and load instantly on a phone. */
:root {
  --bg: #0b0e17; --panel: #141a2b; --panel2: #1b2236; --line: rgba(255,255,255,.08);
  --ink: #eef2f8; --muted: #93a0bd;
  --violet: #8b5cf6; --pink: #ec4899; --cyan: #22d3ee; --green: #34d399; --red: #ff5d6c;
  --gold: #fbbf24;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(120% 70% at 50% -10%, rgba(139,92,246,.16), transparent 60%), var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 14px 40px; }

/* ---------- buttons ---------- */
.btn { border: 0; border-radius: 11px; font-weight: 700; cursor: pointer; font-family: inherit; }
.btn.primary { background: linear-gradient(135deg, var(--violet), var(--pink)); color: #fff; }
.btn.light { background: #fff; color: #141a2b; }
.btn.big { width: 100%; padding: 14px; font-size: 15px; }
.btn.tiny { padding: 7px 13px; font-size: 12.5px; white-space: nowrap; }
.btn:active { transform: scale(.98); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 320px; text-align: center; }
.logo { width: 46px; height: 46px; border-radius: 13px; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--violet), var(--pink)); display: grid; place-items: center;
  font-weight: 800; font-size: 21px; }
.logo.sm { width: 34px; height: 34px; font-size: 15px; border-radius: 10px; margin: 0; flex: none; }
.login h1 { font-size: 20px; margin: 0 0 4px; }
.login .lead { margin: 0 0 18px; font-size: 13px; }
.field { display: block; text-align: left; margin: 10px 0; }
.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.field input { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font-size: 15px; font-family: inherit; }
.field input:focus { outline: 2px solid rgba(139,92,246,.5); border-color: transparent; }
.msg { min-height: 18px; font-size: 13px; margin: 12px 0 0; }
.msg.err { color: var(--red); }

/* ---------- top bar ---------- */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 11px;
  padding: 12px 14px; background: rgba(11,14,23,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); -webkit-app-region: drag; }
.bar .who { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.bar .who b { font-size: 15px; }
.bar .who span { font-size: 12px; color: var(--muted); }
.bar .actions { margin-left: auto; display: flex; gap: 6px; -webkit-app-region: no-drag; }
.back-btn { min-width: 36px; height: 36px; padding: 0 11px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); display: inline-flex;
  align-items: center; justify-content: center; gap: 7px; text-decoration: none; font-size: 12.5px;
  font-weight: 750; flex: none; -webkit-app-region: no-drag; }
.back-btn:hover { background: var(--panel2); }
.back-btn:active { transform: scale(.97); }
.back-arrow { font-size: 18px; line-height: 1; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font-size: 15px; cursor: pointer; }
.icon-btn:hover { background: var(--panel2); }
.icon-btn.active { background: rgba(139,92,246,.28); border-color: rgba(139,92,246,.6); }

/* ---------- channel switcher (bar name → picker) ---------- */
.bar .who.switch { cursor: pointer; border-radius: 9px; padding: 3px 7px; margin: -3px -4px;
  -webkit-app-region: no-drag; }
.bar .who.switch:hover { background: var(--panel); }
.bar .who.switch:focus-visible { outline: 2px solid rgba(139,92,246,.55); outline-offset: 1px; }
.bar .who .who-top { display: flex; align-items: center; gap: 5px; }
.bar .who .caret { font-size: 10px; color: var(--muted); line-height: 1; }

.picker { position: fixed; inset: 0; z-index: 30; display: grid; place-items: start center;
  padding: 66px 14px 16px; background: rgba(6,8,14,.66); backdrop-filter: blur(4px);
  -webkit-app-region: no-drag; }
.picker-card { width: 100%; max-width: 440px; max-height: 78vh; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.55); }
.picker-head { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.picker-search { flex: 1; min-width: 0; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--ink); font-size: 14.5px; font-family: inherit; }
.picker-search:focus { outline: 2px solid rgba(139,92,246,.5); border-color: transparent; }
.picker-list { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.chan-item { text-align: left; width: 100%; border: 1px solid var(--line); background: var(--panel2);
  border-radius: 11px; padding: 10px 13px; cursor: pointer; color: var(--ink); font-family: inherit;
  display: flex; flex-direction: column; gap: 2px; }
.chan-item:hover { background: rgba(139,92,246,.14); border-color: rgba(139,92,246,.4); }
.chan-item:active { transform: scale(.99); }
.chan-item.active { border-color: rgba(139,92,246,.6); background: rgba(139,92,246,.2); }
.chan-item b { font-size: 14.5px; line-height: 1.2; word-break: break-word; }
.chan-item span { font-size: 11.5px; color: var(--muted); word-break: break-word; }
.picker-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- install card ---------- */
.install { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start;
  gap: 13px; margin: 16px 0 7px; padding: 15px 16px; border-radius: 16px;
  border: 1px solid rgba(139,92,246,.38);
  background: linear-gradient(105deg, rgba(139,92,246,.18), rgba(236,72,153,.10));
  box-shadow: 0 12px 32px rgba(0,0,0,.12); }
.install-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--violet), var(--pink)); color: #fff; font-size: 21px;
  font-weight: 900; box-shadow: 0 8px 22px rgba(139,92,246,.25); }
.install-copy { min-width: 0; }
.install-kicker { display: block; margin-bottom: 2px; color: #c9b8ff; font-size: 10px;
  font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.install b { display: block; font-size: 15px; }
.install p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.install-btn { min-height: 38px; padding: 9px 15px; color: #fff; white-space: nowrap;
  background: linear-gradient(135deg, var(--violet), var(--pink)); font-size: 12.5px;
  box-shadow: 0 8px 22px rgba(139,92,246,.2); align-self: center; }
.install-guide { margin-top: 7px; color: var(--muted); font-size: 11.5px; }
.install-guide summary { width: fit-content; color: #c9b8ff; cursor: pointer; font-weight: 700; }
.install-guide p { max-width: 690px; margin-top: 6px; }
.installed-badge { padding: 7px 11px; border: 1px solid rgba(52,211,153,.34); border-radius: 999px;
  color: #9aebce; background: rgba(52,211,153,.11); font-size: 11.5px; font-weight: 800; }
.install.is-installed { border-color: rgba(52,211,153,.26);
  background: linear-gradient(105deg, rgba(52,211,153,.11), rgba(34,211,238,.07)); }
.install.is-installed .install-ic { background: linear-gradient(135deg, #059669, var(--cyan));
  box-shadow: 0 8px 22px rgba(52,211,153,.18); }
.install.is-installed .install-kicker { color: #9aebce; }

/* ---------- sections + button grid ---------- */
.sec-h { display: flex; align-items: center; gap: 9px; margin: 22px 2px 12px; font-size: 11.5px;
  font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.sec-h .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sec-h .dot.v { background: var(--violet); }
.sec-h .dot.s { background: var(--pink); }
.sec-h .dot.x { background: var(--cyan); }
.sec-h .hint { font-weight: 600; letter-spacing: 0; text-transform: none; color: #66718c; }
.up-btn { margin-left: auto; background: transparent; color: var(--ink); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; font-size: 11.5px; font-weight: 700; letter-spacing: 0;
  text-transform: none; cursor: pointer; white-space: nowrap; }
.up-btn:hover { background: var(--panel); }
.up-btn[disabled] { opacity: .55; cursor: default; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 11px; }
.b { position: relative; border: 1px solid var(--line); border-radius: 16px; background: var(--panel);
  padding: 14px 13px 13px; min-height: 104px; display: flex; flex-direction: column; gap: 7px;
  cursor: pointer; overflow: hidden; transition: transform .07s, background .15s; }
.b:hover { background: var(--panel2); }
.b:active { transform: scale(.97); }
.b .row { display: flex; align-items: center; justify-content: space-between; }
.b .badge { font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; }
.b .play { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.06); font-size: 14px; flex: none; }
.b .title { font-weight: 700; font-size: 14.5px; line-height: 1.22; margin-top: auto; word-break: break-word; }
.b .sub { color: var(--muted); font-size: 11.5px; }
.b::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; }
.grid.video .b::after { background: var(--violet); }
.grid.video .badge { background: rgba(139,92,246,.18); color: #c9b8ff; }
.grid.sound .b::after { background: var(--pink); }
.grid.sound .badge { background: rgba(236,72,153,.18); color: #ffb3d9; }
.grid.extra .b::after { background: var(--cyan); }
.grid.extra .badge { background: rgba(34,211,238,.16); color: #9fe9f5; }
.grid.fx .b::after { background: var(--gold); }
.grid.fx .badge { background: rgba(251,191,36,.16); color: #ffd98a; }
.sec-h .dot.p { background: var(--gold); }
/* Effect tiles are icon-led: a big emoji instead of a type badge, plus a pin toggle. */
.b.fx { min-height: 92px; }
.b.fx .emoji { font-size: 26px; line-height: 1; }
/* z-index keeps the pin above the .flash confirmation: without it the later sibling (.flash) wins
   hit-testing, so a pin tap during the 1s "Elindítva ✓" flash did nothing at all. */
.b .pin { position: absolute; top: 7px; right: 7px; z-index: 2; width: 26px; height: 26px;
  border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.04);
  color: var(--muted); font-size: 12px; line-height: 1; display: grid; place-items: center;
  cursor: pointer; padding: 0; }
.b .pin[disabled] { opacity: .35; cursor: default; }
.b .pin:hover { background: rgba(255,255,255,.1); }
.b .pin.on { background: rgba(251,191,36,.22); border-color: rgba(251,191,36,.5); color: #ffd98a; }
.b.off { opacity: .5; }
/* delete button on manual (extra video + sound) tiles */
.b.has-del .row { padding-right: 30px; }
.b .del { position: absolute; top: 7px; right: 7px; z-index: 3; width: 26px; height: 26px;
  border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.04);
  color: var(--muted); font-size: 12px; line-height: 1; display: grid; place-items: center;
  cursor: pointer; padding: 0; }
.b .del:hover { background: rgba(255,93,108,.18); border-color: rgba(255,93,108,.5); color: #ffb3bd; }
/* fired feedback */
.b.fired { background: rgba(52,211,153,.14); border-color: rgba(52,211,153,.5); }
.b .flash { position: absolute; inset: 0; display: none; place-items: center; align-content: center;
  gap: 3px; background: rgba(11,14,23,.62); color: var(--green); font-weight: 800; font-size: 13.5px; }
.b.fired .flash { display: grid; }
.b .flash .big { font-size: 24px; }
/* upload tile */
.b.up { border: 1.5px dashed rgba(255,255,255,.2); background: transparent; align-items: center;
  justify-content: center; text-align: center; color: var(--muted); gap: 5px; }
.b.up .plus { font-size: 26px; line-height: 1; }
.b.up b { color: var(--ink); font-size: 14px; }

.foot { color: #66718c; font-size: 12px; text-align: center; margin-top: 24px; line-height: 1.6; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  background: var(--panel2); border: 1px solid var(--line); border-radius: 11px; padding: 11px 17px;
  font-size: 13px; font-weight: 600; box-shadow: 0 12px 34px rgba(0,0,0,.55); z-index: 20; max-width: 90vw; }
.toast.err { color: var(--red); }
.toast.ok { color: var(--green); }

@media (max-width: 560px) {
  .bar { gap: 8px; padding-inline: 10px; }
  .back-btn { width: 36px; padding: 0; }
  .back-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
  .wrap { padding-inline: 11px; }
  .install { grid-template-columns: auto minmax(0, 1fr); gap: 11px; padding: 14px; }
  .install-btn, .installed-badge { grid-column: 1 / -1; width: 100%; text-align: center; }
  .install-ic { width: 38px; height: 38px; border-radius: 11px; }
}

@media (max-width: 370px) {
  .logo.sm { display: none; }
}
