/* Aakhar TV — remote UI. Dark/glass, mobile-first. */
:root {
  --bg: #0a0a0f; --bg-2: #0d0d16; --panel: #12121d; --panel-2: #171724;
  --surface: rgba(255,255,255,0.045); --border: rgba(255,255,255,0.09); --border-strong: rgba(255,255,255,0.16);
  --text: #f3f3fb; --text-dim: #a6a6bd; --text-faint: #6b6b80;
  --accent: #7c5cff; --accent-2: #21d4fd; --danger: #ff6b6b; --ok: #3ddc97; --amber: #ffb454;
  --radius: 16px; --radius-sm: 11px;
  --font: "Inter", system-ui, -apple-system, sans-serif; --font-display: "Sora", var(--font); --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
::selection { background: rgba(124,92,255,0.4); }

.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; background: radial-gradient(1000px 600px at 75% -10%, #18122e 0%, transparent 60%), linear-gradient(180deg, var(--bg), var(--bg-2)); }
.aurora__blob { position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.4; }
.aurora__blob--1 { width: 40vw; height: 40vw; background: radial-gradient(circle, var(--accent), transparent 70%); top: -12vw; right: -6vw; }
.aurora__blob--2 { width: 34vw; height: 34vw; background: radial-gradient(circle, var(--accent-2), transparent 70%); bottom: -14vw; left: -8vw; opacity: 0.25; }

.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,0.18); border-top-color: #fff; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { display: grid; place-items: center; min-height: 100dvh; }

/* ---------- login (shared aesthetic with chat) ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login__card { width: min(400px,100%); padding: 34px 30px 28px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(160deg, var(--panel-2), var(--panel)); box-shadow: 0 30px 80px -30px #000; }
.login__brand { display: flex; flex-direction: column; align-items: center; gap: 13px; text-align: center; margin-bottom: 22px; }
.brand__mark { font-size: 40px; }
.login__title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; }
.login__sub { color: var(--text-dim); font-size: .9rem; margin-top: 3px; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 6px; }
.input { width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(255,255,255,.04); border: 1px solid var(--border); outline: none; transition: border-color .2s, box-shadow .2s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(124,92,255,.14); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 999px; font-size: 14.5px; font-weight: 600; cursor: pointer; border: 1px solid var(--border-strong); background: var(--surface); transition: transform .15s, background .2s, border-color .2s; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn--primary { color: #0a0a0f; background: linear-gradient(135deg,#fff,#d9d4ff); border-color: transparent; }
.btn--primary:not(:disabled):hover { transform: translateY(-1px); }
.btn--block { width: 100%; }
.login__error { display: flex; gap: 9px; margin-bottom: 13px; padding: 11px 14px; border-radius: var(--radius-sm); background: rgba(255,107,107,.1); border: 1px solid rgba(255,107,107,.3); color: #ffc9c9; font-size: 13.5px; }
.login__foot { margin-top: 16px; text-align: center; color: var(--text-faint); font-size: 12px; }

/* ---------- remote ---------- */
.remote { max-width: 440px; margin: 0 auto; padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 14px; min-height: 100dvh; }
.bar { display: flex; align-items: center; gap: 10px; }
.bar__title { font-family: var(--font-display); font-weight: 700; font-size: 17px; flex: 1; }
.bar__dev { padding: 7px 10px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--border); }
.iconbtn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; cursor: pointer; background: var(--surface); border: 1px solid var(--border); color: var(--text-dim); font-size: 18px; }
.iconbtn:hover { color: var(--text); border-color: var(--border-strong); }

.statusbar { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-dim); padding: 6px 2px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.bad { background: var(--danger); }
.dot.off { background: var(--amber); }
.link { background: none; border: none; color: var(--accent-2); cursor: pointer; font-size: 13px; text-decoration: underline; margin-left: auto; }
.link--block { margin: 0 auto; text-align: center; }
.empty { color: var(--text-dim); font-size: 14px; padding: 20px; text-align: center; }
.empty code { font-family: var(--mono); background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 5px; }

/* button grids */
.pad { display: flex; gap: 12px; }
.key { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; border-radius: 14px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-size: 20px; cursor: pointer; transition: transform .08s, background .15s, border-color .15s; -webkit-tap-highlight-color: transparent; user-select: none; }
.key:active { transform: scale(.94); background: rgba(124,92,255,.18); border-color: var(--accent); }
.key small { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
.pad--power .key--power { background: linear-gradient(135deg, rgba(61,220,151,.18), var(--panel-2)); }
.pad--power .key--standby { background: linear-gradient(135deg, rgba(255,107,107,.16), var(--panel-2)); }

.pad--vc { align-items: stretch; }
.rocker { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.rocker .key { width: 100%; background: var(--panel); }
.rocker__lbl { font-size: 11px; color: var(--text-faint); letter-spacing: .08em; }
.midcol { flex: 1; display: flex; flex-direction: column; gap: 8px; }

.dpad { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 56px); gap: 8px; }
.dpad__up { grid-area: 1 / 2; } .dpad__left { grid-area: 2 / 1; } .dpad__ok { grid-area: 2 / 2; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #0a0a0f; font-weight: 700; font-size: 15px; }
.dpad__right { grid-area: 2 / 3; } .dpad__down { grid-area: 3 / 2; }

.pad--media .key { min-height: 48px; font-size: 16px; }
.pad--num { flex-wrap: wrap; }
.pad--num .key { flex: 0 0 calc(33.333% - 8px); }
.key--go { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #0a0a0f; font-weight: 700; }
.numbuf { flex: 1 0 100%; text-align: center; font-family: var(--mono); font-size: 22px; letter-spacing: .2em; padding: 6px; }

/* top row: power + app shortcut chips */
.toprow { display: flex; align-items: center; gap: 12px; }
.powerbtn { flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--panel-2); color: var(--danger); font-size: 22px; cursor: pointer; display: grid; place-items: center; transition: transform .1s, box-shadow .2s, color .2s; }
.powerbtn:active { transform: scale(.92); }
.powerbtn--on { color: var(--ok); box-shadow: 0 0 14px -2px var(--ok); }
.appchips { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px; flex: 1; scrollbar-width: none; }
.appchips::-webkit-scrollbar { display: none; }
.appchip { display: flex; flex-direction: column; align-items: center; gap: 5px; background: none; border: none; cursor: pointer; flex-shrink: 0; width: 58px; }
.appchip__ico { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; font-weight: 800; color: #fff; background: var(--panel-2); border: 1px solid var(--border); transition: transform .1s; }
.appchip:active .appchip__ico { transform: scale(.9); }
.appchip__lbl { font-size: 10.5px; color: var(--text-dim); white-space: nowrap; max-width: 58px; overflow: hidden; text-overflow: ellipsis; }
.appchip--netflix .appchip__ico { background: #000; color: #e50914; }
.appchip--primevideo .appchip__ico { background: #1a98ff; color: #fff; }
.appchip--disney .appchip__ico { background: #0c1f4b; color: #fff; }
.appchip--youtube .appchip__ico { background: #fff; color: #ff0000; }
.appchip--samsungtvplus .appchip__ico { background: linear-gradient(135deg,#7c5cff,#21d4fd); color: #fff; }

/* swipe trackpad */
.trackpad { position: relative; height: 200px; border-radius: 20px; background: radial-gradient(120% 120% at 50% 0%, rgba(255,255,255,.05), rgba(255,255,255,.02)); border: 1px solid var(--border); touch-action: none; cursor: grab; user-select: none; display: grid; place-items: center; }
.trackpad:active { cursor: grabbing; background: radial-gradient(120% 120% at 50% 0%, rgba(124,92,255,.12), rgba(255,255,255,.02)); }
.trackpad__hint { color: var(--text-faint); font-size: 12.5px; pointer-events: none; }
.trackpad__num { position: absolute; top: 14px; right: 16px; font-family: var(--mono); font-size: 13px; color: var(--text-dim); cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.trackpad__num:hover { background: rgba(255,255,255,.06); color: var(--text); }
.editapps { flex-shrink: 0; width: 36px; height: 36px; font-size: 15px; }
.appedit { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.appedit__row { display: flex; align-items: center; gap: 8px; }
.appedit__row .input { flex: 1; padding: 8px 10px; font-size: 13px; min-width: 0; }
.appedit__actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.appedit__hint { font-size: 11.5px; color: var(--text-faint); }
.cloudnote { font-size: 12.5px; color: var(--text-faint); text-align: center; padding: 4px 8px; line-height: 1.5; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--border-strong); color: var(--text); padding: 11px 18px; border-radius: 999px; font-size: 13.5px; box-shadow: 0 12px 40px -12px #000; z-index: 50; max-width: 90vw; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 24px; z-index: 60; }
.modal__card { width: min(380px,100%); background: linear-gradient(160deg, var(--panel-2), var(--panel)); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.modal__title { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; margin-bottom: 10px; }
.modal__card p { color: var(--text-dim); font-size: 14px; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
