/* =====================================================================
   ATLAS PLAYER — TV / phone / desktop UI
   Sized in rem; app.js sets the root font-size from the screen width,
   so the same layout scales from a phone to a 4K TV.
===================================================================== */
:root {
  --brand: #3E185B;
  --brand-2: #52247A;
  --ink: #1A0727;
  --ink-2: #12051C;
  --panel: #241035;
  --panel-2: #2E1543;
  --line: rgba(255,255,255,.09);
  --text: #F4EEF9;
  --muted: #A99BB8;
  --accent: #FFE14D;
  --red: #E3262F; --mint: #3EE07A; --cyan: #43E5F0; --mag: #D04BD6; --blue: #2B4BD6;
  --font: 'League Spartan', 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: 'VT323', 'Courier New', monospace;
  --r: .4rem; --r-lg: .9rem;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { background: var(--ink); color: var(--text); font-family: var(--font); font-size: 1rem; line-height: 1.3; -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; user-select: text; -webkit-user-select: text; }
.mono { font-family: var(--mono); letter-spacing: .04em; }
[hidden] { display: none !important; }

/* Focus = the TV "cursor" */
.f { outline: none; }
.f:focus { outline: none; }
.f.focus, .f:focus-visible { box-shadow: 0 0 0 .2rem var(--accent), 0 0 1.4rem rgba(255,225,77,.35); position: relative; z-index: 2; }

/* ---------- Screens ---------- */
.screen { position: fixed; inset: 0; display: none; }
.screen.on { display: flex; }

/* ---------- Shared bits ---------- */
.tv-ico { width: 2.2rem; height: 1.65rem; border: .17rem solid #fff; border-radius: .3rem; display: inline-flex; overflow: hidden; flex: none; }
.tv-ico i { flex: 1; }
.tv-ico i:nth-child(1){background:var(--accent)} .tv-ico i:nth-child(2){background:var(--cyan)} .tv-ico i:nth-child(3){background:var(--mint)} .tv-ico i:nth-child(4){background:var(--mag)} .tv-ico i:nth-child(5){background:var(--red)}
.boot-bars { display: flex; height: 100%; width: 100%; }
.boot-bars i { flex: 1; }
.boot-bars i:nth-child(1){background:#c0c0c0}.boot-bars i:nth-child(2){background:var(--accent)}.boot-bars i:nth-child(3){background:var(--cyan)}.boot-bars i:nth-child(4){background:var(--mint)}.boot-bars i:nth-child(5){background:var(--mag)}.boot-bars i:nth-child(6){background:var(--red)}.boot-bars i:nth-child(7){background:var(--blue)}
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .85rem 1.6rem .7rem; border-radius: var(--r); font-weight: 800; font-size: 1.05rem; line-height: 1; transition: transform .12s; }
.btn-yellow { background: var(--accent); color: var(--ink); }
.btn-ghost { background: rgba(255,255,255,.07); color: #fff; border: .1rem solid var(--line); }
.btn.focus, .btn:focus-visible { transform: scale(1.05); }

/* ---------- Boot ---------- */
#boot { align-items: center; justify-content: center; background: radial-gradient(ellipse at center, var(--brand) 0%, var(--ink) 70%); }
.boot-tv { width: 22rem; max-width: 80vw; text-align: center; }
.boot-tv .boot-bars { height: 6rem; border-radius: .6rem; overflow: hidden; border: .35rem solid #fff; box-shadow: 0 1.5rem 4rem rgba(0,0,0,.5); }
.boot-name { font-size: 2.2rem; font-weight: 800; margin-top: 1.4rem; letter-spacing: -.02em; }
.boot-msg { color: var(--accent); font-size: 1.6rem; margin-top: .3rem; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* ---------- Gate ---------- */
#gate { align-items: center; justify-content: center; background: radial-gradient(ellipse at top, var(--brand) 0%, var(--ink) 65%); padding: 1rem; overflow: auto; }
.gate { width: 46rem; max-width: 100%; text-align: center; }
.gate-head { display: flex; align-items: center; justify-content: center; gap: .7rem; font-size: 1.3rem; font-weight: 800; }
.gate h1 { font-size: 2.6rem; margin: 1.6rem 0 .5rem; letter-spacing: -.02em; line-height: 1.05; }
.gate-text { color: var(--muted); font-size: 1.15rem; margin: 0 auto 1.6rem; max-width: 36rem; }
.gate-ids { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.gate-id { background: var(--ink-2); border: .35rem solid var(--panel-2); border-radius: var(--r-lg); padding: 1rem 1.6rem .8rem; display: flex; flex-direction: column; min-width: 15rem; position: relative; overflow: hidden; }
.gate-id::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 2px, transparent 2px 4px); pointer-events: none; }
.gate-id .lbl { color: var(--cyan); font-size: 1.2rem; }
.gate-id .val { color: var(--accent); font-size: 2.7rem; line-height: 1; white-space: nowrap; }
.gate-support { margin: 1.4rem auto; max-width: 36rem; font-size: 1.1rem; white-space: pre-line; }
.gate-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.gate-poll { color: var(--muted); font-size: 1.2rem; margin-top: 1.2rem; }

/* ---------- Home ---------- */
#home { flex-direction: column; background: var(--ink); }
.bar { display: flex; align-items: center; gap: 1.5rem; padding: 1rem 2rem .8rem; background: linear-gradient(180deg, var(--ink-2), var(--ink)); border-bottom: 1px solid var(--line); flex: none; }
.logo { display: flex; align-items: center; gap: .7rem; font-size: 1.25rem; font-weight: 800; white-space: nowrap; }
.tabs { display: flex; gap: .3rem; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: .7rem 1.1rem .55rem; border-radius: 99rem; font-weight: 700; font-size: 1.05rem; color: var(--muted); white-space: nowrap; }
.tab.on { background: var(--brand); color: #fff; }
.tab.focus { background: var(--accent); color: var(--ink); box-shadow: none; }
.bar-right { display: flex; align-items: baseline; gap: 1rem; white-space: nowrap; }
.clock { font-size: 2rem; color: var(--accent); line-height: 1; }
.exp { color: var(--muted); font-size: 1.2rem; }
.exp.warn { color: var(--red); }

.body { flex: 1; display: flex; min-height: 0; }
.cats { width: 19rem; flex: none; overflow-y: auto; padding: 1rem .8rem 2rem 1.4rem; border-right: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--panel-2) transparent; }
.cat { display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left; padding: .75rem .9rem .6rem; border-radius: var(--r); font-weight: 600; font-size: 1.02rem; color: #ddd2e8; }
.cat span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat small { font-family: var(--mono); font-size: 1.2rem; color: var(--muted); }
.cat.sel { background: var(--brand); color: #fff; box-shadow: inset .25rem 0 0 var(--accent); }
.cat.focus { background: var(--accent); color: var(--ink); }
.cat.focus small { color: var(--ink); }
.cat-h { font-family: var(--mono); color: var(--cyan); font-size: 1.25rem; padding: .9rem .9rem .3rem; }

.list { flex: 1; min-width: 0; overflow-y: auto; padding: 1rem 1.2rem 3rem; scrollbar-width: thin; scrollbar-color: var(--panel-2) transparent; }
.list-h { display: flex; align-items: baseline; gap: .8rem; padding: 0 .4rem .8rem; }
.list-h h2 { margin: 0; font-size: 1.6rem; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-h .mono { color: var(--muted); font-size: 1.3rem; }
.empty { color: var(--muted); padding: 3rem 1rem; text-align: center; font-size: 1.15rem; }
.empty b { display: block; font-family: var(--mono); color: var(--accent); font-size: 2.2rem; font-weight: 400; }

/* channel rows */
.rows { display: flex; flex-direction: column; gap: .25rem; }
.ch { display: flex; align-items: center; gap: .9rem; width: 100%; text-align: left; padding: .45rem .8rem .45rem .5rem; border-radius: var(--r); min-height: 3.6rem; }
.ch:nth-child(odd) { background: rgba(255,255,255,.025); }
.ch .num { font-family: var(--mono); font-size: 1.45rem; color: var(--muted); width: 3.2rem; text-align: right; flex: none; }
.ch .lg { width: 4.4rem; height: 2.7rem; border-radius: .3rem; background: var(--panel); flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden; font-weight: 800; color: var(--muted); font-size: .9rem; }
.ch .lg img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ch .nm { flex: 1; min-width: 0; font-weight: 600; font-size: 1.08rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch .star { color: var(--accent); font-size: 1.1rem; }
.ch.playing { background: var(--panel-2); }
.ch.playing .num { color: var(--accent); }
.ch.playing .nm::before { content: '● '; color: var(--red); }
.ch.focus { background: var(--accent); color: var(--ink); }
.ch.focus .num, .ch.focus .star { color: var(--ink); }

/* poster grid */
.grid { display: flex; flex-wrap: wrap; gap: 1rem; padding: .2rem; }
.card { width: 10.4rem; text-align: left; border-radius: var(--r-lg); padding: .4rem; transition: transform .12s; }
.card .ps { width: 100%; height: 14.6rem; border-radius: var(--r); background: var(--panel) center/cover no-repeat; display: flex; align-items: flex-end; overflow: hidden; position: relative; }
.card .ps .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: .8rem; font-weight: 800; color: var(--muted); font-size: 1rem; background: linear-gradient(160deg, var(--panel-2), var(--ink-2)); }
.card .ps img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .ps .badge { position: relative; margin: .4rem; background: rgba(0,0,0,.7); color: var(--accent); font-family: var(--mono); font-size: 1.1rem; padding: .1rem .4rem; border-radius: .25rem; }
.card .tt { display: block; font-weight: 700; font-size: .98rem; margin-top: .5rem; padding: 0 .1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.focus { transform: scale(1.06); background: var(--accent); color: var(--ink); }

/* series header */
.series-head { display: flex; gap: 1.4rem; align-items: center; padding: 0 .4rem 1rem; }
.series-head .ps { width: 7rem; height: 10rem; border-radius: var(--r); background: var(--panel) center/cover; flex: none; }
.series-head h2 { margin: 0 0 .3rem; font-size: 2rem; }
.series-head .mono { color: var(--muted); font-size: 1.3rem; }
.season-h { font-family: var(--mono); color: var(--cyan); font-size: 1.5rem; padding: 1rem .4rem .3rem; }

/* preview */
.preview { width: 34rem; flex: none; padding: 1rem 1.6rem 1rem 0; display: flex; flex-direction: column; gap: 1rem; }
.pv-box { width: 100%; padding-top: 56.25%; position: relative; border-radius: var(--r-lg); overflow: hidden; background: #000; border: .3rem solid var(--panel-2); }
.pv-idle { position: absolute; inset: 0; display: flex; flex-direction: column; }
.pv-idle .boot-bars { flex: 1; opacity: .85; }
.pv-idle span { background: #000; color: #fff; text-align: center; padding: .5rem; font-size: 1.4rem; }
.pv-info { background: var(--panel); border-radius: var(--r-lg); padding: 1rem 1.2rem; min-height: 6rem; }
.pv-info b { display: block; font-size: 1.35rem; }
.pv-info small { color: var(--muted); font-size: 1rem; }
.pv-info .hint { display: block; margin-top: .7rem; color: var(--accent); font-family: var(--mono); font-size: 1.25rem; }

.keys-hint { flex: none; display: flex; gap: 1.6rem; justify-content: flex-end; padding: .45rem 2rem .5rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
.keys-hint span { display: flex; align-items: center; gap: .4rem; }
.keys-hint i { width: 1.3rem; height: .55rem; border-radius: .15rem; display: inline-block; }
.k-r{background:var(--red)} .k-g{background:var(--mint)} .k-y{background:var(--accent)} .k-c{background:var(--blue)}

/* search & settings */
.search-box { display: flex; gap: .6rem; padding: 0 .4rem 1rem; }
.search-box input { flex: 1; background: var(--panel); border: .15rem solid var(--line); color: #fff; border-radius: var(--r); padding: .8rem 1rem .6rem; font-size: 1.2rem; }
.search-box input.focus, .search-box input:focus { border-color: var(--accent); outline: none; }
.set { max-width: 52rem; display: flex; flex-direction: column; gap: 1rem; }
.set-card { background: var(--panel); border-radius: var(--r-lg); padding: 1.2rem 1.4rem; }
.set-card h3 { margin: 0 0 .8rem; font-size: 1.25rem; }
.set-kv { display: flex; flex-wrap: wrap; gap: .4rem 2rem; }
.set-kv div { display: flex; flex-direction: column; }
.set-kv span { color: var(--muted); font-size: .9rem; }
.set-kv b { font-family: var(--mono); font-weight: 400; font-size: 1.7rem; color: var(--accent); line-height: 1.1; }
.set-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.set-row input { flex: 1; min-width: 12rem; background: var(--ink-2); border: .15rem solid var(--line); color: #fff; border-radius: var(--r); padding: .7rem .9rem .5rem; font-size: 1.05rem; }
.set-row input.focus, .set-row input:focus { border-color: var(--accent); outline: none; }
.opt { display: flex; align-items: center; gap: .8rem; width: 100%; text-align: left; padding: .8rem 1rem .65rem; border-radius: var(--r); background: rgba(255,255,255,.04); margin-bottom: .35rem; font-weight: 600; }
.opt .dot { width: .8rem; height: .8rem; border-radius: 50%; border: .15rem solid var(--muted); flex: none; }
.opt.sel .dot { background: var(--mint); border-color: var(--mint); }
.opt.focus { background: var(--accent); color: var(--ink); }
.opt small { margin-left: auto; color: var(--muted); font-family: var(--mono); font-size: 1.2rem; }
.opt.focus small { color: var(--ink); }

/* ---------- Video stage ---------- */
.stage { position: fixed; left: 0; top: 0; width: 0; height: 0; background: #000; z-index: 30; display: none; overflow: hidden; }
.stage.preview { display: block; border-radius: var(--r-lg); }
.stage.full { display: block; inset: 0; width: 100% !important; height: 100% !important; left: 0 !important; top: 0 !important; border-radius: 0; z-index: 50; }
.stage video { width: 100%; height: 100%; background: #000; display: block; object-fit: contain; }
.spinner { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); display: none; gap: .4rem; }
.spinner.on { display: flex; }
.spinner i { width: .9rem; height: .9rem; border-radius: 50%; background: var(--accent); animation: bounce 1s infinite; }
.spinner i:nth-child(2) { animation-delay: .15s; background: var(--cyan); } .spinner i:nth-child(3) { animation-delay: .3s; background: var(--mint); }
@keyframes bounce { 0%,100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-.7rem); opacity: 1; } }
.v-error { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; text-align: center; padding: 1rem; background: repeating-linear-gradient(0deg, rgba(255,255,255,.04) 0 2px, transparent 2px 4px), #0b0410; }
.v-error b { color: var(--red); font-size: 2.4rem; font-weight: 400; }
.v-error span { color: var(--muted); max-width: 30rem; }
.v-error-actions { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
.stage.preview .v-error b { font-size: 1.6rem; } .stage.preview .v-error-actions, .stage.preview .v-error span { display: none; }

.osd { position: absolute; inset: 0; display: none; flex-direction: column; justify-content: space-between; pointer-events: none; }
.stage.full .osd.on { display: flex; }
.osd-top { display: flex; align-items: center; gap: 1.2rem; padding: 1.6rem 2.4rem 3rem; background: linear-gradient(180deg, rgba(10,3,16,.92), transparent); }
.osd-num { background: var(--accent); color: var(--ink); font-size: 2.2rem; padding: .15rem .7rem 0; border-radius: .3rem; line-height: 1.1; }
.osd-num:empty { display: none; }
.osd-title { flex: 1; min-width: 0; }
.osd-title b { display: block; font-size: 1.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.osd-title small { color: var(--muted); font-size: 1.05rem; }
.osd-clock { font-size: 2.4rem; color: var(--accent); }
.osd-bottom { padding: 3rem 2.4rem 1.8rem; background: linear-gradient(0deg, rgba(10,3,16,.95), transparent); pointer-events: auto; }
.osd-progress { display: flex; align-items: center; gap: 1rem; font-size: 1.5rem; }
.osd-progress .track { flex: 1; height: .4rem; background: rgba(255,255,255,.2); border-radius: 99rem; overflow: hidden; cursor: pointer; }
.osd-progress .track i { display: block; height: 100%; width: 0; background: var(--accent); }
.osd-btns { display: flex; gap: .6rem; justify-content: center; margin-top: 1rem; }
.ob { width: 3.6rem; height: 3.6rem; border-radius: 50%; background: rgba(255,255,255,.1); font-size: 1.4rem; display: flex; align-items: center; justify-content: center; }
.ob-main { width: 4.4rem; height: 4.4rem; background: var(--brand); font-size: 1.7rem; }
.ob.focus { background: var(--accent); color: var(--ink); }
.ob.on { color: var(--accent); }
.ob.on.focus { color: var(--ink); }
.zap { position: absolute; right: 2.4rem; top: 2rem; background: var(--ink); border: .25rem solid var(--accent); color: var(--accent); font-size: 3.4rem; padding: .2rem 1rem 0; border-radius: .5rem; z-index: 3; }

/* ---------- Modal / toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(10,3,16,.78); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-box { background: var(--panel); border-radius: var(--r-lg); border-top: .4rem solid var(--accent); padding: 1.6rem 1.8rem; width: 34rem; max-width: 100%; max-height: 90%; overflow: auto; }
.modal-box h3 { margin: 0 0 .6rem; font-size: 1.6rem; }
.modal-box p { color: #ddd2e8; margin: 0 0 1.2rem; white-space: pre-line; }
.modal-box .acts { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1rem; }
.pin { display: flex; gap: .6rem; justify-content: center; margin: .6rem 0; }
.pin span { width: 3rem; height: 3.6rem; border-radius: var(--r); background: var(--ink-2); border: .15rem solid var(--line); font-family: var(--mono); font-size: 2.6rem; color: var(--accent); display: flex; align-items: center; justify-content: center; }
.pinpad { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; width: 14rem; margin: 0 auto; }
.pinpad button { width: 4.2rem; height: 3.2rem; border-radius: var(--r); background: rgba(255,255,255,.07); font-family: var(--mono); font-size: 1.8rem; }
.pinpad button.focus { background: var(--accent); color: var(--ink); }
.toast { position: fixed; left: 50%; bottom: 2.4rem; transform: translateX(-50%); background: var(--ink-2); border: .15rem solid var(--accent); color: #fff; padding: .8rem 1.4rem .65rem; border-radius: 99rem; z-index: 90; font-weight: 600; max-width: 90%; text-align: center; box-shadow: 0 1rem 2.4rem rgba(0,0,0,.5); }

/* Mouse / touch: no yellow TV cursor, a soft hover instead */
.pointer .f.focus { box-shadow: none; }
.pointer .ch.focus, .pointer .cat.focus:not(.sel), .pointer .opt.focus, .pointer .card.focus { background: transparent; color: inherit; transform: none; }
.pointer .ch.focus .num { color: var(--muted); }
.pointer .tab.focus:not(.on) { background: transparent; color: var(--muted); }
.pointer .ch:hover, .pointer .opt:hover { background: var(--panel-2); }
.pointer .cat:hover:not(.sel), .pointer .tab:hover:not(.on) { background: rgba(255,255,255,.07); color: #fff; }
.pointer .card:hover .ps { box-shadow: 0 0 0 .2rem var(--accent); }

/* ---------- Tabs without preview ---------- */
.body.no-preview .preview { display: none; }
.body.no-cats .cats { display: none; }

/* =====================================================================
   PHONES & SMALL TABLETS (portrait or narrow)
===================================================================== */
@media (max-width: 820px) {
  .bar { flex-wrap: wrap; gap: .6rem; padding: calc(.6rem + env(safe-area-inset-top)) 1rem .5rem; }
  .logo { font-size: 1.1rem; }
  .bar-right { margin-left: auto; }
  .clock { font-size: 1.6rem; }
  .tabs { order: 3; width: 100%; flex: none; }
  .tab { padding: .6rem .9rem .5rem; font-size: .98rem; }
  .body { flex-direction: column; }
  .preview { order: 1; width: 100%; padding: .6rem 1rem 0; gap: .5rem; }
  .body:not(.has-video) .preview { display: none; }
  .pv-info { display: none; }
  .cats { order: 2; width: 100%; display: flex; gap: .4rem; overflow-x: auto; overflow-y: hidden; padding: .6rem 1rem; border-right: 0; border-bottom: 1px solid var(--line); flex: none; scrollbar-width: none; }
  .cats::-webkit-scrollbar { display: none; }
  .cat { width: auto; flex: none; padding: .55rem .9rem .45rem; border-radius: 99rem; background: rgba(255,255,255,.06); }
  .cat span { max-width: 12rem; }
  .cat-h { display: none; }
  .list { order: 3; padding: .8rem .6rem calc(2rem + env(safe-area-inset-bottom)); }
  .grid { gap: .6rem; justify-content: space-between; }
  .card { width: calc(33.33% - .45rem); padding: 0; }
  .card .ps { height: auto; padding-top: 145%; }
  .card.focus { transform: none; }
  .keys-hint { display: none; }
  .gate h1 { font-size: 1.9rem; }
  .gate-id { min-width: 0; width: 100%; }
  .gate-id .val { font-size: 2.2rem; }
  .osd-top { padding: calc(1rem + env(safe-area-inset-top)) 1.2rem 2rem; }
  .osd-title b { font-size: 1.3rem; }
  .osd-clock { font-size: 1.6rem; }
  .osd-bottom { padding: 2rem 1rem calc(1rem + env(safe-area-inset-bottom)); }
  .ob { width: 2.8rem; height: 2.8rem; font-size: 1.1rem; }
  .ob-main { width: 3.4rem; height: 3.4rem; }
  .series-head .ps { width: 5rem; height: 7rem; }
  .series-head h2 { font-size: 1.4rem; }
}

/* =====================================================================
   v2 additions: fullscreen Menu button, tracks menu, add-playlist form
===================================================================== */
.osd-back { pointer-events: auto; display: flex; align-items: center; gap: .5rem; background: rgba(255,255,255,.12); color: #fff;
  border-radius: 99rem; padding: .7rem 1.2rem .55rem; font-size: 1.15rem; font-weight: 800; flex: none; }
.osd-back span { font-size: 1.05rem; }
.osd-back.focus, .osd-back:hover { background: var(--accent); color: var(--ink); box-shadow: none; }
.osd-top { pointer-events: auto; }
.stage.full:not(.osd-on) { cursor: none; }
.ob-wide { width: auto; border-radius: 99rem; padding: 0 1.1rem; gap: .5rem; font-size: 1.2rem; }
.ob-wide span { font-size: .95rem; font-weight: 700; }
.trk-h { font-family: var(--mono); color: var(--cyan); font-size: 1.3rem; margin: .6rem 0 .3rem; }
.trk-note { background: var(--ink-2); border-left: .25rem solid var(--accent); padding: .8rem 1rem; border-radius: var(--r); color: #ddd2e8; font-size: .98rem; }
.add-form { display: flex; flex-direction: column; gap: .7rem; }
.add-form label { display: flex; flex-direction: column; gap: .3rem; font-weight: 700; font-size: .95rem; }
.add-form input { background: var(--ink-2); border: .15rem solid var(--line); color: #fff; border-radius: var(--r); padding: .7rem .9rem .5rem; font-size: 1.05rem; }
.add-form input.focus, .add-form input:focus { border-color: var(--accent); outline: none; }
.ap-err { color: #ff8a8f; font-weight: 700; margin: .6rem 0 0; }
.ap-note, .set-note { color: var(--muted); font-size: .9rem; margin: .8rem 0 0; }
@media (max-width: 820px) {
  .osd-back { padding: .55rem .9rem .45rem; font-size: 1rem; }
  .ob-wide span { display: none; }
}

/* Tap / click / OK to copy the MAC address and device key */
button.gate-id { font: inherit; color: inherit; cursor: pointer; text-align: center; align-items: center; transition: transform .12s, border-color .15s; }
button.gate-id.focus, .pointer button.gate-id:hover { border-color: var(--accent); transform: scale(1.03); }
.copy-hint { font-size: .85rem; font-weight: 700; color: var(--muted); margin-top: .35rem; letter-spacing: .02em; }
.gate-id.copied { border-color: var(--mint) !important; }
.gate-id.copied .copy-hint { color: var(--mint); }
.gate-id.copied .copy-hint::after { content: ' — copied ✓'; }
.kv-copy { display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: .45rem .7rem .35rem; margin: -.45rem -.2rem; border-radius: var(--r); cursor: pointer; border: .12rem dashed transparent; }
.kv-copy span { color: var(--muted); font-size: .9rem; }
.kv-copy b { font-family: var(--mono); font-weight: 400; font-size: 1.7rem; color: var(--accent); line-height: 1.1; }
.kv-copy.focus { background: var(--accent); box-shadow: none; }
.kv-copy.focus span, .kv-copy.focus b { color: var(--ink); }
.pointer .kv-copy:hover { border-color: var(--line); background: rgba(255,255,255,.04); }
.kv-copy.copied { border-color: var(--mint); }
.kv-copy.copied span::after { content: ' — copied ✓'; color: var(--mint); }
