/* Roka TV — designed at 1280×720, scaled to the screen by main.js.
   Targets webOS 4+ (Chromium 53): no CSS grid, no flex gap, no inset,
   no aspect-ratio, no backdrop-filter. */

/* Fonts: css/fonts.css (embedded Baloo, built by dev/make-fonts-css.py) */

:root {
  --ink: #FFFFFF;
  --muted: #C7D3FF;
  --soft: #DDE6FF;
  --navy: #10144A;
  --glass: rgba(255,255,255,0.09);
  --glass-line: rgba(255,255,255,0.16);
  --sun: linear-gradient(135deg, #FFD21F, #FF8A1F);
  --sky: linear-gradient(135deg, #1E6BFF, #22D3EE);
  --leaf: linear-gradient(135deg, #7ED321, #2EAD3A);
  --live: linear-gradient(135deg, #FF3B3B, #D7151F);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0A1450; }
body { font-family: 'Baloo', sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased; }
/* LG's webOS forces its own font (and normal weight) on every element of an app; these !important
   rules keep Baloo and the weights below. Every font-weight in this file is !important for that reason. */
body, body * { font-family: 'Baloo', sans-serif !important; }
b, strong, h1, h2, h3, th { font-weight: 700 !important; }
button, input { font-family: inherit; color: inherit; }
img { display: block; }

#app {
  position: absolute; top: 0; left: 0; width: 1280px; height: 720px; overflow: hidden;
  transform-origin: 0 0;
  /* "عالم روكا": doodles in the logo colours (play, TV, stars, hearts, notes) — work/bg-options has the other ideas */
  background: url(../assets/bg.svg) center / cover no-repeat, #0A1450;
}

/* ---------- focus ---------- */
/* Only transform animates: shadows and backgrounds snap, so a focus move costs one cheap
   composite instead of repainting a large blurred glow every frame (matters most on TVs). */
.f { outline: none; cursor: pointer; transition: transform .12s ease-out; }
.f.focused { box-shadow: 0 0 0 4px #FFFFFF, 0 0 18px rgba(255,210,31,0.7); }
.card.f.focused, .poster.f.focused, .chan.f.focused { transform: scale(1.05); z-index: 2; }

/* ---------- scrolling ---------- */
.clip { overflow: hidden; position: relative; }
.track { transition: transform .18s ease-out; will-change: transform; }
.row-track { white-space: nowrap; padding: 10px 6px; }
.row-track > * { display: inline-block; vertical-align: top; white-space: normal; margin-left: 20px; }

/* ---------- top bar ---------- */
#topbar { position: absolute; top: 18px; right: 36px; left: 36px; height: 76px; display: none; align-items: center; z-index: 5; }
#topbar.on { display: flex; }
#topbar .logo { width: 72px; height: 74px; object-fit: contain; margin-left: 20px; }
#topbar .spacer { flex: 1; }
#clock { font-size: 20px; font-weight: 600 !important; }
.exit-btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,90,90,0.55); background: rgba(255,59,59,0.18); color: #FF8A8A; display: flex; align-items: center; justify-content: center; margin-right: 16px; flex-shrink: 0; }
.exit-btn:hover, .exit-btn.focused { background: var(--live); color: #FFF; }
.login-exit { position: absolute; top: 24px; left: 28px; margin: 0; z-index: 3; }
[dir=ltr] .exit-btn { margin-right: 0; margin-left: 16px; }
[dir=ltr] .login-exit { left: auto; right: 28px; margin: 0; }
.exit-btn.to-servers { border-color: rgba(255,255,255,0.28); background: rgba(255,255,255,0.12); color: #FFF; }
.exit-btn.to-servers:hover, .exit-btn.to-servers.focused { background: var(--sun); color: var(--navy); }
[dir=ltr] .exit-btn.to-servers svg { transform: scaleX(-1); }

/* saved servers list */
.srv-clip { max-height: 312px; margin: 4px -10px 0; }
.srv-list { padding: 8px 10px; }
.srv-row { display: flex; align-items: center; margin-bottom: 12px; }
.srv { flex: 1; min-width: 0; height: 80px; border-radius: 24px; background: rgba(10,20,80,0.55); border: 1px solid rgba(255,255,255,0.16); display: flex; align-items: center; padding: 0 16px; }
.srv.last { border-color: rgba(255,210,31,0.7); }
.srv .ic { width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800 !important; flex-shrink: 0; margin-left: 14px; }
.srv .tx { flex: 1; min-width: 0; }
.srv .nm { font-size: 21px; font-weight: 800 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv .ds { font-size: 14px; color: var(--muted); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv .st { flex-shrink: 0; margin-right: 12px; padding: 4px 12px; border-radius: 999px; font-size: 14px; font-weight: 700 !important; background: rgba(126,211,33,0.22); color: #B9F27A; }
.srv .st.warn { background: rgba(255,138,31,0.25); color: #FFC07A; }
.srv .st.bad { background: rgba(255,59,59,0.28); color: #FF9A9A; }
.srv-del { width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255,90,90,0.5); background: rgba(255,59,59,0.15); color: #FF8A8A; display: flex; align-items: center; justify-content: center; margin-right: 12px; flex-shrink: 0; }
.srv-del:hover, .srv-del.focused { background: var(--live); color: #FFF; }
[dir=ltr] .srv .ic { margin-left: 0; margin-right: 14px; }
[dir=ltr] .srv .ds { text-align: left; }
[dir=ltr] .srv .st { margin-right: 0; margin-left: 12px; }
[dir=ltr] .srv-del { margin-right: 0; margin-left: 12px; }

#confirm { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 30; display: none; align-items: center; justify-content: center; background: rgba(5,10,42,0.72); }
#confirm.on { display: flex; }
#confirm .dlg { width: 460px; padding: 30px 34px 34px; border-radius: 34px; text-align: center; background: linear-gradient(160deg, #1B2C8F, #12095A); border: 1px solid rgba(255,255,255,0.22); box-shadow: 0 30px 80px rgba(0,0,0,0.5); }
#confirm img { width: 110px; height: 112px; object-fit: contain; margin: 0 auto 6px; }
#confirm h3 { margin: 0 0 22px; font-size: 28px; font-weight: 800 !important; }
#confirm .row { display: flex; justify-content: center; }
#confirm .btn { margin: 0 8px; }
.btn.danger { background: var(--live); }
#subinfo { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; margin-left: 16px; border-radius: 999px; font-size: 16px; font-weight: 600 !important; background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.18); }
#subinfo:before { content: ''; width: 10px; height: 10px; border-radius: 50%; margin-left: 8px; background: #7ED321; box-shadow: 0 0 10px #7ED321; }
#subinfo.warn { background: rgba(255,138,31,0.22); border-color: #FF8A1F; }
#subinfo.warn:before { background: #FF8A1F; box-shadow: 0 0 10px #FF8A1F; }
#subinfo.bad { background: rgba(255,59,59,0.25); border-color: #FF3B3B; }
#subinfo.bad:before { background: #FF3B3B; box-shadow: 0 0 10px #FF3B3B; }
[dir=ltr] #subinfo { margin-left: 0; margin-right: 16px; }
[dir=ltr] #subinfo:before { margin-left: 0; margin-right: 8px; }
.pills { display: flex; background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.18); border-radius: 999px; padding: 6px; }
.pill { height: 44px; padding: 0 22px; border-radius: 999px; border: 0; background: transparent; font-size: 18px; font-weight: 500 !important; margin-left: 4px; display: flex; align-items: center; }
.pill.on { background: var(--sun); color: var(--navy); font-weight: 800 !important; }
.pill.focused { box-shadow: 0 0 0 3px #FFFFFF, 0 0 22px rgba(255,210,31,0.7); }

/* ---------- screens ---------- */
.screen { position: absolute; top: 0; left: 0; width: 1280px; height: 720px; display: none; z-index: 2; }
.screen.active { display: block; }
.below-bar { position: absolute; top: 108px; right: 36px; left: 36px; bottom: 0; }
h2.row-title { margin: 0 6px 0 0; font-size: 23px; font-weight: 700 !important; }

.btn { height: 58px; padding: 0 30px; border-radius: 999px; border: 0; font-size: 19px; font-weight: 700 !important; display: inline-flex; align-items: center; margin-left: 12px; background: rgba(255,255,255,0.14); }
.btn.primary { background: var(--sun); color: var(--navy); font-weight: 800 !important; }
.btn.green { background: var(--leaf); }
.btn .ico { margin-left: 10px; }

.chip { height: 42px; padding: 0 18px; border-radius: 999px; border: 0; font-size: 16px; background: rgba(255,255,255,0.10); }
.chip.on { background: var(--sky); font-weight: 700 !important; }

.badge-live { display: inline-flex; align-items: center; background: var(--live); padding: 2px 14px; border-radius: 999px; font-size: 15px; font-weight: 700 !important; box-shadow: 0 0 20px rgba(255,59,59,0.6); }
.badge-live:before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #FFF; margin-left: 8px; }

.empty { padding: 40px; font-size: 20px; color: var(--muted); text-align: center; }

/* ---------- login ---------- */
#s-login .wrap { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; padding: 0 72px;
  background: radial-gradient(circle at 15% 50%, rgba(255,210,31,0.30) 0%, transparent 35%); }
#s-login .panel { flex: 1; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 36px; padding: 34px 44px; }
#s-login h1 { margin: 0; font-size: 40px; font-weight: 800 !important; line-height: 1.15; }
#s-login .sub { margin: 2px 0 16px; font-size: 19px; color: var(--soft); }
#s-login .side { width: 360px; margin-right: 56px; text-align: center; }
#s-login .side img { width: 270px; height: 276px; object-fit: contain; margin: 0 auto 10px; }
#s-login .side p { font-size: 16px; color: var(--soft); line-height: 1.5; margin: 0; }
.tabs { display: inline-flex; background: rgba(10,20,80,0.55); border-radius: 999px; padding: 6px; margin-bottom: 16px; }
.tabs .chip { background: transparent; margin-left: 4px; height: 44px; font-size: 17px; }
.tabs .chip.on { background: var(--sky); }
.fields { overflow: hidden; margin: 0 -9px; }
.field { float: right; width: 50%; padding: 0 9px 12px; font-size: 16px; color: var(--soft); }
.field.wide { width: 100%; }
.field input { display: block; width: 100%; height: 54px; border-radius: 18px; border: 2px solid rgba(255,255,255,0.18); background: rgba(10,20,80,0.6); font-size: 19px; padding: 0 18px; margin-top: 4px; }
.field input.focused, .field input:focus { border-color: #FFD21F; box-shadow: 0 0 0 3px #FFFFFF, 0 0 24px rgba(255,210,31,0.6); }
.err { color: #FF8A8A; font-size: 17px; min-height: 26px; margin: 4px 0; }
.note { margin-top: 12px; font-size: 14px; color: #AFC0F5; }

.grad-text { background: var(--sun); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-bar { display: flex; justify-content: space-between; }
.actions { display: flex; align-items: center; }
.set-btns { margin-top: 18px; }
.full-h { height: 100%; }

/* ---------- home ---------- */
.page { position: absolute; top: 100px; right: 36px; left: 36px; bottom: 0; padding-top: 8px; }
.rows .row { margin-bottom: 8px; }
.card.ch { width: 200px; }
.card.ch .thumb { height: 104px; background: rgba(255,255,255,0.06); }
.card.ch .thumb img { object-fit: contain; padding: 14px; }
.row-track .poster { float: none; margin: 0 0 0 20px; }
[dir=ltr] .row-track .poster { margin: 0 20px 0 0; }
.hero-wrap { display: flex; height: 300px; margin-bottom: 16px; }
.hero { position: relative; flex: 1; min-width: 0; height: 300px; border-radius: 32px; overflow: hidden; background: var(--sky); }
/* brand panel beside the featured title */
.brand { width: 280px; flex-shrink: 0; margin-right: 18px; border-radius: 32px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 42%, rgba(255,210,31,0.38) 0%, rgba(255,210,31,0) 62%), rgba(255,255,255,0.07); border: 1px solid var(--glass-line); }
.brand img { width: 200px; height: 204px; object-fit: contain; filter: drop-shadow(0 12px 26px rgba(0,0,0,0.45)); }
.brand .name { margin-top: 4px; font-size: 40px; font-weight: 800 !important; line-height: 1; letter-spacing: 0.5px; color: #FFF; text-shadow: 0 4px 18px rgba(0,0,0,0.45); }
.brand .name span { background: var(--sun); -webkit-background-clip: text; background-clip: text; color: transparent; }
[dir=ltr] .brand { margin-right: 0; margin-left: 18px; }
.hero .bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.hero .shade { position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(270deg, rgba(10,20,80,0.96) 0%, rgba(10,20,80,0.78) 42%, rgba(10,20,80,0.05) 75%); }
.hero .txt { position: absolute; top: 30px; right: 40px; width: 560px; }
.hero .kicker { font-size: 17px; color: var(--soft); }
.hero h1 { margin: 6px 0 4px; font-size: 50px; font-weight: 800 !important; line-height: 1.08; max-height: 124px; overflow: hidden; }
.hero .meta { font-size: 18px; color: var(--soft); margin-bottom: 18px; }
.home-rows { position: absolute; top: 424px; right: 30px; left: 0; bottom: 0; }

.card { width: 262px; border-radius: 24px; background: var(--glass); border: 1px solid var(--glass-line); overflow: hidden; }
.card .thumb { height: 140px; position: relative; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .bar { position: absolute; bottom: 0; right: 0; left: 0; height: 6px; background: rgba(0,0,0,0.35); }
.card .bar i { display: block; height: 6px; background: #FFF; }
.card .cap { padding: 8px 16px 12px; }
.card .t { font-size: 18px; font-weight: 700 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .s { font-size: 14px; color: var(--muted); }
.tile { width: 150px; height: 96px; border-radius: 22px; background: var(--glass); display: flex !important; align-items: center; justify-content: center; text-align: center; padding: 8px; font-size: 16px; font-weight: 700 !important; overflow: hidden; }
.tile img { max-width: 120px; max-height: 70px; object-fit: contain; }
.initials { display: flex; align-items: center; justify-content: center; font-weight: 800 !important; color: #FFF; }

/* ---------- live ---------- */
.live-cols { display: flex; height: 100%; padding-bottom: 26px; }
.col-cats { width: 210px; margin-left: 18px; }
.col-chans { width: 400px; margin-left: 20px; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 30px; padding: 12px; }
.col-prev { flex: 1; min-width: 0; }
.vlist { padding: 8px 8px 30px; }
.vlist > * { display: block; margin-bottom: 8px; }
.cat { width: 100%; height: 50px; border-radius: 18px; border: 0; background: rgba(255,255,255,0.07); font-size: 18px; display: flex !important; align-items: center; padding: 0 14px; text-align: right; }
.cat .dot { width: 12px; height: 12px; border-radius: 50%; margin-left: 10px; flex-shrink: 0; }
.cat .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat.on { background: var(--leaf); font-weight: 800 !important; }
.chan { height: 70px; border-radius: 20px; display: flex !important; align-items: center; padding: 0 12px; }
.chan.on { background: rgba(255,255,255,0.12); }
.chan .num { width: 38px; font-size: 15px; color: var(--muted); text-align: center; flex-shrink: 0; }
.chan .lg { width: 50px; height: 50px; border-radius: 16px; overflow: hidden; flex-shrink: 0; margin-left: 12px; background: rgba(255,255,255,0.1); }
.chan .lg img { width: 100%; height: 100%; object-fit: contain; }
.chan .nm { flex: 1; min-width: 0; font-size: 18px; font-weight: 700 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chan .fav { color: #FF5A5A; font-size: 18px; margin-right: 6px; }
.chans-head { display: flex; justify-content: space-between; align-items: center; padding: 0 8px 6px; font-size: 21px; font-weight: 700 !important; }
.chans-head #lv-count { font-size: 15px; color: var(--muted); font-weight: 400 !important; }
.chans-clip { height: calc(100% - 40px); }
.prev-box { height: 300px; border-radius: 30px; overflow: hidden; position: relative; border: 2px solid var(--glass-line); }
.prev-box .badge-live { position: absolute; top: 16px; right: 16px; }
.prev-box .hint { position: absolute; bottom: 14px; left: 14px; background: rgba(10,20,80,0.75); padding: 3px 14px; border-radius: 999px; font-size: 15px; }
.prev-box .msg { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 17px; }
.epg { margin-top: 14px; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 26px; padding: 14px 22px; }
.epg:empty { display: none; }
.epg .now { font-size: 16px; color: #FFD21F; font-weight: 700 !important; }
.epg h3 { margin: 0; font-size: 26px; font-weight: 800 !important; line-height: 1.25; }
.epg p { margin: 2px 0 0; font-size: 16px; color: var(--soft); line-height: 1.45; max-height: 46px; overflow: hidden; }
.epg .next { margin-top: 8px; font-size: 15px; color: var(--muted); }
.epg .next b { color: #22D3EE; margin-left: 8px; }

/* ---------- grids (movies / series) ---------- */
.chips-row { height: 62px; }
.chips-row .row-track > * { margin-left: 10px; }
.grid-clip { position: absolute; top: 70px; right: 0; left: 0; bottom: 0; }
.grid { overflow: hidden; padding: 12px 8px 40px; }
.poster { float: right; width: 176px; height: 264px; margin: 0 0 22px 22px; border-radius: 24px; overflow: hidden; position: relative; }
.poster:nth-child(6n) { margin-left: 0; }
.poster img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.poster .grad { position: absolute; bottom: 0; left: 0; right: 0; height: 60%; background: linear-gradient(0deg, rgba(10,20,80,0.92) 0%, rgba(10,20,80,0) 100%); }
.poster .rate { position: absolute; top: 10px; left: 10px; background: rgba(10,20,80,0.75); padding: 0 10px; border-radius: 999px; font-size: 14px; font-weight: 700 !important; color: #FFD21F; }
.poster .t { position: absolute; bottom: 12px; right: 14px; left: 14px; font-size: 18px; font-weight: 800 !important; line-height: 1.2; max-height: 44px; overflow: hidden; }
.poster .done { position: absolute; bottom: 0; right: 0; height: 6px; background: #FFF; }

/* ---------- details ---------- */
#s-details .art { position: absolute; top: 0; left: 0; width: 780px; height: 440px; overflow: hidden; }
#s-details .art img { width: 100%; height: 100%; object-fit: cover; }
#s-details .art .s1 { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(270deg, #0B2280 0%, rgba(11,34,128,0) 50%); }
#s-details .art .s2 { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(0deg, #0A1450 0%, rgba(10,20,80,0) 40%); }
#s-details .info { position: absolute; top: 40px; right: 48px; width: 580px; }
#s-details .kick { font-size: 16px; color: #FFD21F; font-weight: 700 !important; }
#s-details h1 { margin: 0; font-size: 50px; font-weight: 800 !important; line-height: 1.1; max-height: 112px; overflow: hidden; }
#s-details .meta .star { color: #FFD21F; font-weight: 700 !important; }
#s-details .meta { font-size: 17px; color: var(--soft); margin: 8px 0; }
#s-details .meta span { margin-left: 14px; display: inline-block; }
#s-details .plot { font-size: 17px; line-height: 1.55; color: var(--soft); max-height: 79px; overflow: hidden; margin-bottom: 16px; }
#s-details .tabs-row { position: absolute; top: 392px; right: 48px; left: 48px; }
#s-details .tabs-row .tabs { margin: 0; }
#s-details .d-body { position: absolute; top: 456px; right: 42px; left: 0; bottom: 0; }
#s-details .about { padding: 6px 6px 0 48px; display: flex; }
#s-details .about p { flex: 1; margin: 0; font-size: 18px; line-height: 1.6; color: var(--soft); max-height: 230px; overflow: hidden; }
#s-details .facts { width: 340px; flex-shrink: 0; margin-right: 34px; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 24px; padding: 14px 20px; }
#s-details .facts div { display: flex; justify-content: space-between; font-size: 16px; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
#s-details .facts div:last-child { border-bottom: 0; }
#s-details .facts span { color: var(--muted); }
.person { width: 132px; text-align: center; border-radius: 22px; padding: 10px 6px 12px; }
.person .ava { width: 88px; height: 88px; margin: 0 auto 8px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 800 !important; border: 3px solid rgba(255,255,255,0.35); }
.person .nm { font-size: 15px; font-weight: 600 !important; line-height: 1.3; }
.person.focused { background: rgba(255,255,255,0.1); }

/* ---------- settings ---------- */
.set-box { background: var(--glass); border: 1px solid var(--glass-line); border-radius: 32px; padding: 26px 32px; margin-bottom: 18px; }
.set-box h3 { margin: 0 0 8px; font-size: 24px; }
.set-box .kv { font-size: 18px; color: var(--soft); line-height: 1.7; }
.set-box .kv b { color: #FFF; }

/* ---------- player ---------- */
#video { position: absolute; display: none; background: #000; z-index: 1; }
#video.full { display: block; top: 0; left: 0; width: 1280px; height: 720px; z-index: 3; }
#video.preview { display: block; }
#s-player { z-index: 4; }
#osd { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transition: opacity .3s; }
#osd.hide { opacity: 0; }
#osd .top { position: absolute; top: 24px; right: 32px; left: 32px; display: flex; align-items: center; }
#osd .chbox { display: flex; align-items: center; background: rgba(10,20,80,0.8); border: 1px solid rgba(255,255,255,0.2); border-radius: 999px; padding: 8px 8px 8px 24px; }
#osd .chbox .lg { width: 54px; height: 54px; border-radius: 50%; overflow: hidden; margin-left: 14px; }
#osd .chbox .lg img { width: 100%; height: 100%; object-fit: contain; background: #FFF; }
#osd .chbox .nm { font-size: 22px; font-weight: 800 !important; }
#osd .chbox .sm { font-size: 14px; color: var(--soft); }
#osd .top .spacer { flex: 1; }
#osd .top img.logo { width: 64px; height: 66px; object-fit: contain; }
#osd .bottom { position: absolute; bottom: 24px; right: 32px; left: 32px; background: rgba(10,20,80,0.85); border: 1px solid rgba(255,255,255,0.2); border-radius: 34px; padding: 18px 32px 20px; }
#osd .kick { font-size: 16px; color: #FFD21F; font-weight: 700 !important; }
#osd h1 { margin: 0; font-size: 34px; font-weight: 800 !important; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#osd .prog { display: flex; align-items: center; margin: 10px 0 8px; font-size: 16px; color: var(--soft); direction: ltr; }
#osd .prog .b { flex: 1; height: 10px; background: rgba(255,255,255,0.18); border-radius: 5px; margin: 0 16px; position: relative; }
#osd .prog .b i { position: absolute; left: 0; top: 0; height: 10px; border-radius: 5px; background: linear-gradient(90deg, #FFD21F, #FF8A1F, #FF3B3B); }
#osd .prog .b b { position: absolute; top: -6px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: #FFF; box-shadow: 0 0 14px rgba(255,210,31,0.9); }
#osd .prog .b em { display: none; position: absolute; bottom: 22px; transform: translateX(-50%); background: #FFD21F; color: #10144A; font-style: normal; font-weight: 800 !important; font-size: 16px; padding: 2px 10px; border-radius: 10px; white-space: nowrap; }
#osd .prog .b em.on { display: block; }
/* bigger invisible hit area so the thin bar is easy to click */
#osd .prog .b.seekable { cursor: pointer; }
#osd .prog .b.seekable:after { content: ''; position: absolute; left: 0; right: 0; top: -14px; bottom: -14px; }
#osd .prog .b.seekable:hover { height: 14px; margin-top: -2px; }
#osd .prog .b.seekable:hover i { height: 14px; }
#osd .keys { font-size: 15px; color: var(--muted); }
#osd .keys b { color: #FFF; background: rgba(255,255,255,0.14); padding: 0 8px; border-radius: 8px; margin: 0 4px; }
#osd .zap { position: absolute; top: 140px; left: 32px; width: 250px; }
#osd .zap div { background: rgba(10,20,80,0.8); border-radius: 22px; padding: 8px 14px; margin-bottom: 10px; font-size: 15px; }
#osd .zap small { display: block; font-size: 13px; color: var(--muted); }
#pstate { position: absolute; top: 50%; left: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; background: rgba(10,20,80,0.7); display: none; align-items: center; justify-content: center; font-size: 18px; text-align: center; }
#pstate.on { display: flex; }

/* ---------- misc ---------- */
#loading { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: none; align-items: center; justify-content: center; z-index: 20; background: rgba(10,20,80,0.35); }
#loading.on { display: flex; }
.spinner { width: 64px; height: 64px; border-radius: 50%; border: 6px solid rgba(255,255,255,0.2); border-top-color: #FFD21F; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#toast { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); background: rgba(10,20,80,0.92); border: 1px solid rgba(255,255,255,0.25); padding: 10px 26px; border-radius: 999px; font-size: 18px; z-index: 21; display: none; white-space: nowrap; }
#toast.on { display: block; }

/* ---------- English / French (left-to-right): mirror the RTL layout ---------- */
[dir=ltr] .row-track > * { margin-left: 0; margin-right: 20px; }
[dir=ltr] .chips-row .row-track > * { margin-left: 0; margin-right: 10px; }
[dir=ltr] h2.row-title { margin: 0 0 0 6px; }
[dir=ltr] #topbar .logo { margin-left: 0; margin-right: 20px; }
[dir=ltr] .pill, [dir=ltr] .tabs .chip { margin-left: 0; margin-right: 4px; }
[dir=ltr] .btn { margin-left: 0; margin-right: 12px; }
[dir=ltr] .btn .ico { margin-left: 0; margin-right: 10px; }
[dir=ltr] .badge-live:before { margin-left: 0; margin-right: 8px; }
[dir=ltr] .field { float: left; }
[dir=ltr] #s-login .side { margin-right: 0; margin-left: 56px; }
[dir=ltr] .hero .shade { background: linear-gradient(90deg, rgba(10,20,80,0.96) 0%, rgba(10,20,80,0.78) 42%, rgba(10,20,80,0.05) 75%); }
[dir=ltr] .hero .txt { right: auto; left: 40px; }
[dir=ltr] .home-rows { right: 0; left: 30px; }
[dir=ltr] .col-cats { margin-left: 0; margin-right: 18px; }
[dir=ltr] .col-chans { margin-left: 0; margin-right: 20px; }
[dir=ltr] .cat { text-align: left; }
[dir=ltr] .cat .dot { margin-left: 0; margin-right: 10px; }
[dir=ltr] .chan .lg { margin-left: 0; margin-right: 12px; }
[dir=ltr] .chan .fav { margin-right: 0; margin-left: 6px; }
[dir=ltr] .prev-box .badge-live { right: auto; left: 16px; }
[dir=ltr] .prev-box .hint { left: auto; right: 14px; }
[dir=ltr] .epg .next b { margin-left: 0; margin-right: 8px; }
[dir=ltr] .poster { float: left; margin: 0 22px 22px 0; }
[dir=ltr] .poster:nth-child(6n) { margin-right: 0; }
[dir=ltr] .poster .rate { left: auto; right: 10px; }
[dir=ltr] .poster .done { right: auto; left: 0; }
[dir=ltr] #s-details .art { left: auto; right: 0; }
[dir=ltr] #s-details .art .s1 { background: linear-gradient(90deg, #0B2280 0%, rgba(11,34,128,0) 50%); }
[dir=ltr] #s-details .info { right: auto; left: 48px; }
[dir=ltr] #s-details .d-body { right: 0; left: 42px; }
[dir=ltr] #s-details .about { padding: 6px 48px 0 6px; }
[dir=ltr] #s-details .facts { margin-right: 0; margin-left: 34px; }
[dir=ltr] #s-details .meta span { margin-left: 0; margin-right: 14px; }
[dir=ltr] #osd .chbox { padding: 8px 24px 8px 8px; }
[dir=ltr] #osd .chbox .lg { margin-left: 0; margin-right: 14px; }
[dir=ltr] #osd .zap { left: auto; right: 32px; }
.btn.demo { background: var(--sky); font-weight: 800 !important; }

/* search */
.search-box { display: flex; align-items: center; height: 64px; padding: 0 22px; border-radius: 999px; background: rgba(10,20,80,0.7); border: 2px solid rgba(255,255,255,0.2); color: var(--soft); }
.search-box input { flex: 1; min-width: 0; height: 56px; margin-right: 12px; border: 0; background: transparent; font-size: 22px; outline: none; }
.search-box:focus-within, .search-box input.focused { border-color: #FFD21F; }
.search-res { position: absolute; top: 84px; right: 0; left: 0; bottom: 0; }
[dir=ltr] .search-box input { margin-right: 0; margin-left: 12px; }
[dir=ltr] .pill svg { margin-left: 0 !important; margin-right: 6px; }

/* details: cast photos, trailer button */
.person .ava.photo { overflow: hidden; background: rgba(255,255,255,0.1); }
.person .ava.photo img, .person .ava.photo .initials { width: 100%; height: 100%; object-fit: cover; }
.person .role { font-size: 13px; color: var(--muted); line-height: 1.25; max-height: 34px; overflow: hidden; }
.btn.trailer { background: rgba(255,59,59,0.22); border: 1px solid rgba(255,90,90,0.5); }
/* settings: language + TMDB side by side */
.set-row { display: flex; }
.set-row .set-box { flex: 1; min-width: 0; }
.set-row .set-box + .set-box { margin-right: 18px; }
[dir=ltr] .set-row .set-box + .set-box { margin-right: 0; margin-left: 18px; }
.kv.small { font-size: 15px; line-height: 1.5; margin-bottom: 10px; }
.key-row { display: flex; align-items: center; }
.key-in { flex: 1; min-width: 0; height: 52px; border-radius: 16px; border: 2px solid rgba(255,255,255,0.18); background: rgba(10,20,80,0.6); font-size: 17px; padding: 0 16px; margin-left: 12px; }
.key-in.focused, .key-in:focus { border-color: #FFD21F; }
[dir=ltr] .key-in { margin-left: 0; margin-right: 12px; }

/* player extras: options button, skip intro, next episode, options panel, kids limit */
#osd .opts-btn { width: 50px; height: 50px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.25); background: rgba(10,20,80,0.75); color: #FFF; display: flex; align-items: center; justify-content: center; margin-left: 14px; }
[dir=ltr] #osd .opts-btn { margin-left: 0; margin-right: 14px; }
.skip-btn { position: absolute; bottom: 210px; left: 48px; display: none; height: 54px; padding: 0 24px; border-radius: 999px; border: 2px solid #FFF; background: rgba(10,20,80,0.85); color: #FFF; font-size: 19px; font-weight: 700 !important; z-index: 5; }
.skip-btn.on { display: block; }
.skip-btn small, .next-card small { opacity: 0.7; font-size: 13px; }
[dir=ltr] .skip-btn { left: auto; right: 48px; }
.next-card { position: absolute; bottom: 200px; left: 40px; width: 520px; display: none; background: rgba(10,20,80,0.94); border: 1px solid rgba(255,255,255,0.25); border-radius: 28px; padding: 16px; z-index: 6; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.next-card.on { display: flex; }
.next-card .thumb { width: 190px; height: 108px; border-radius: 18px; overflow: hidden; flex-shrink: 0; margin-left: 16px; }
.next-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.next-card .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.next-card .tx b { font-size: 19px; line-height: 1.3; }
.next-card #p-next-count { font-size: 15px; color: #FFD21F; margin: 2px 0 8px; }
.next-card .row { display: flex; }
.next-card .btn { height: 44px; padding: 0 18px; font-size: 16px; margin-left: 8px; }
[dir=ltr] .next-card { left: auto; right: 40px; }
[dir=ltr] .next-card .thumb { margin-left: 0; margin-right: 16px; }
.opts { position: absolute; top: 0; bottom: 0; left: 0; width: 420px; display: none; background: rgba(8,14,60,0.96); border-right: 1px solid rgba(255,255,255,0.2); padding: 30px 28px; z-index: 7; overflow: hidden; }
.opts.on { display: block; }
.opts h3 { margin: 0 0 16px; font-size: 26px; }
.opts .sec { margin-bottom: 18px; }
.opts .lbl { font-size: 15px; color: var(--muted); margin-bottom: 8px; }
.opts .chips { display: flex; flex-wrap: wrap; }
.opts .chip { margin: 0 0 8px 8px; height: 44px; }
.opts .none { color: var(--muted); font-size: 16px; margin-bottom: 18px; }
[dir=ltr] .opts { left: auto; right: 0; border-right: 0; border-left: 1px solid rgba(255,255,255,0.2); }
[dir=ltr] .opts .chip { margin: 0 8px 8px 0; }
.limit { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: rgba(10,20,80,0.97); z-index: 8; }
.limit.on { display: flex; }
.limit img { width: 160px; height: 164px; object-fit: contain; }
.limit h2 { font-size: 34px; margin: 10px 0 6px; }
.limit p { font-size: 18px; color: var(--soft); max-width: 640px; }

/* guide (EPG grid) */
.gd-head { position: relative; height: 34px; margin-top: 4px; }
.gd-times { position: absolute; top: 0; right: 190px; left: 0; height: 34px; }
.gd-times span { position: absolute; top: 6px; font-size: 15px; color: var(--muted); }
.gd-clip { position: absolute; top: 104px; right: 0; left: 0; bottom: 0; }
.gd-row { display: flex; height: 70px; margin-bottom: 8px; }
.gd-ch { width: 182px; flex-shrink: 0; margin-left: 8px; display: flex; align-items: center; background: rgba(10,20,80,0.6); border-radius: 18px; padding: 0 10px; overflow: hidden; }
.gd-ch .lg { width: 42px; height: 42px; border-radius: 12px; overflow: hidden; flex-shrink: 0; margin-left: 10px; }
.gd-ch .lg img { width: 100%; height: 100%; object-fit: contain; }
.gd-ch span { flex: 1; min-width: 0; font-size: 15px; font-weight: 700 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gd-ch i { font-style: normal; color: #22D3EE; font-size: 18px; margin-right: 4px; }
.gd-line { position: relative; flex: 1; min-width: 0; overflow: hidden; }
.gd-p { position: absolute; top: 0; height: 70px; border-radius: 16px; padding: 8px 12px; background: rgba(255,255,255,0.08); overflow: hidden; }
.gd-p.past { opacity: 0.55; }
.gd-p.past.replay { opacity: 0.85; background: rgba(34,211,238,0.14); }
.gd-p.now { background: linear-gradient(135deg, rgba(255,59,59,0.55), rgba(255,138,31,0.5)); }
.gd-p .tt { font-size: 15px; font-weight: 700 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gd-p .tt b { margin-left: 6px; font-weight: 400 !important; }
.gd-p .tt .live { color: #FFF; }
.gd-p .tt .bell { color: #FFD21F; }
.gd-p .tm { font-size: 12px; opacity: 0.8; }
.gd-p.focused { transform: none; opacity: 1; }
.gd-load, .gd-empty { padding: 22px 16px; font-size: 14px; color: var(--muted); }
.gd-now { position: absolute; top: 0; bottom: 0; width: 3px; background: #FF3B3B; box-shadow: 0 0 10px #FF3B3B; z-index: 3; pointer-events: none; }
[dir=ltr] .gd-times { right: 0; left: 190px; }
[dir=ltr] .gd-ch { margin-left: 0; margin-right: 8px; }
[dir=ltr] .gd-ch .lg { margin-left: 0; margin-right: 10px; }
[dir=ltr] .gd-p .tt b { margin-left: 0; margin-right: 6px; }

/* profiles */
.prof-btn { width: 48px; height: 48px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.35); font-size: 20px; font-weight: 800 !important; color: #FFF; margin-right: 14px; flex-shrink: 0; }
[dir=ltr] .prof-btn { margin-right: 0; margin-left: 14px; }
.prof-wrap { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.prof-head { text-align: center; margin-bottom: 26px; }
.prof-head img { width: 110px; height: 112px; object-fit: contain; margin: 0 auto; }
.prof-head h1 { margin: 6px 0 0; font-size: 40px; font-weight: 800 !important; }
.prof-row { display: flex; justify-content: center; }
.prof { width: 170px; margin: 0 14px; text-align: center; border-radius: 28px; padding: 14px 8px 16px; }
.prof .ava { width: 140px; height: 140px; margin: 0 auto 10px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 60px; font-weight: 800 !important; position: relative; border: 4px solid rgba(255,255,255,0.3); }
.prof.add .ava { background: rgba(255,255,255,0.08); border-style: dashed; font-size: 56px; color: var(--muted); }
.prof .lock { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); background: #10144A; border: 2px solid #FFD21F; color: #FFD21F; font-size: 13px; padding: 1px 10px; border-radius: 999px; }
.prof .nm { font-size: 21px; font-weight: 700 !important; }
.prof.cur .ava { border-color: #FFD21F; }
.prof.focused { background: rgba(255,255,255,0.1); }
.prof-form { display: flex; align-items: center; margin-top: 26px; }
.prof-form input { width: 300px; height: 56px; border-radius: 18px; border: 2px solid rgba(255,255,255,0.2); background: rgba(10,20,80,0.7); font-size: 19px; padding: 0 18px; margin-left: 12px; }
.prof-form input.focused, .prof-form input:focus { border-color: #FFD21F; }
.prof-form .chip { height: 52px; margin-left: 12px; }
[dir=ltr] .prof-form input, [dir=ltr] .prof-form .chip { margin-left: 0; margin-right: 12px; }

/* settings: profiles box */
.settings { padding-bottom: 40px; }
.prof-list { display: flex; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.prof-item { display: flex; align-items: center; background: rgba(10,20,80,0.55); border-radius: 999px; padding: 4px 6px 4px 16px; margin: 0 0 8px 10px; }
.prof-item .dot { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800 !important; margin-left: 10px; }
.prof-item b { font-size: 17px; }
.prof-item em { font-style: normal; font-size: 13px; color: #FFD21F; margin-right: 8px; }
.prof-item .srv-del { width: 40px; height: 40px; margin-right: 8px; }
.key-row .lbl, .lim-row .lbl { font-size: 16px; color: var(--muted); margin-left: 14px; white-space: nowrap; }
.pin-in { max-width: 160px; letter-spacing: 6px; }
.lim-row { display: flex; align-items: center; margin-top: 12px; }
.lim-row .chip { margin-left: 8px; }
[dir=ltr] .prof-item { padding: 4px 16px 4px 6px; margin: 0 10px 8px 0; }
[dir=ltr] .prof-item .dot { margin-left: 0; margin-right: 10px; }
[dir=ltr] .key-row .lbl, [dir=ltr] .lim-row .lbl { margin-left: 0; margin-right: 14px; }
[dir=ltr] .lim-row .chip { margin-left: 0; margin-right: 8px; }

/* PIN pad */
#confirm .dlg.pin { width: 380px; }
#confirm .dots { display: flex; justify-content: center; margin: 4px 0 6px; direction: ltr; }
#confirm .dots i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.6); margin: 0 8px; }
#confirm .dots i.on { background: #FFD21F; border-color: #FFD21F; }
#confirm .msg { min-height: 24px; color: #FF9A9A; font-size: 16px; }
#confirm .pad { direction: ltr; width: 270px; margin: 6px auto 0; overflow: hidden; }
#confirm .key { float: left; width: 74px; height: 58px; margin: 6px 7px; border-radius: 18px; border: 0; background: rgba(255,255,255,0.12); font-size: 24px; font-weight: 700 !important; }
#confirm .key.x { background: rgba(255,59,59,0.3); }

/* screensaver */
#saver { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 40; display: none; background: #050A2A; overflow: hidden; }
#saver.on { display: block; }
#saver .slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.6s ease; }
#saver .slide.on { opacity: 1; }
#saver .slide img { width: 100%; height: 100%; object-fit: cover; animation: kenburns 10s ease-out both; }
@keyframes kenburns { from { transform: scale(1.0) translate(0, 0); } to { transform: scale(1.14) translate(-2%, -1.5%); } }
#saver .shade { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(0deg, rgba(5,10,42,0.85) 0%, rgba(5,10,42,0) 45%); }
#saver .clock { position: absolute; bottom: 40px; right: 56px; font-size: 76px; font-weight: 800 !important; text-shadow: 0 6px 30px rgba(0,0,0,0.6); }
#saver .logo { position: absolute; bottom: 36px; left: 48px; width: 110px; height: 112px; object-fit: contain; }
[dir=ltr] #saver .clock { right: auto; left: 56px; }
[dir=ltr] #saver .logo { left: auto; right: 48px; }
#confirm h3 { white-space: pre-line; }

#confirm .dlg-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.18); margin: -8px 20px 22px; direction: ltr; overflow: hidden; }
#confirm .dlg-bar i { display: block; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #FFD21F, #FF8A1F, #FF3B3B); }
#confirm .dlg { width: 500px; }

.hero .hero-bar { width: 380px; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.2); margin: -8px 0 18px; overflow: hidden; direction: ltr; }
.hero .hero-bar i { display: block; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #FFD21F, #FF8A1F, #FF3B3B); }

/* "ROKA TV" wordmark (Luckiest Guy) */
.brand .wm { width: 236px; height: auto; margin-top: 6px; }
.wm-inline { height: 46px; width: auto; vertical-align: middle; display: inline-block; margin: -6px 4px 0; }

/* ---- ads (js/stats.js) ---- */
.ad-tag { position: absolute; top: 6px; right: 8px; background: rgba(0,0,0,0.6); color: #FFF; font-size: 11px; font-weight: 700 !important; padding: 1px 8px; border-radius: 999px; pointer-events: none; }
[dir=ltr] .ad-tag { right: auto; left: 8px; }
.ad-home { position: relative; height: 130px; margin-bottom: 16px; border-radius: 24px; overflow: hidden; background: rgba(255,255,255,0.06); }
.ad-home img { width: 100%; height: 100%; object-fit: cover; display: block; }
#ad-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 9; pointer-events: none; display: none; }
#ad-layer.on { display: block; }
#ad-layer > div { position: absolute; pointer-events: auto; border-radius: 16px; overflow: hidden; box-shadow: 0 14px 40px rgba(0,0,0,0.5); animation: ad-in .5s ease-out both; transition: opacity .3s; }
#ad-layer img { display: block; }
#ad-layer .ad-strip { bottom: 24px; left: 50%; transform: translateX(-50%); }
#ad-layer .ad-strip img { height: 110px; width: auto; max-width: 1000px; object-fit: contain; }
#ad-layer.osd .ad-strip { opacity: 0; pointer-events: none; }
#ad-layer .ad-side { top: 140px; right: 32px; }
[dir=ltr] #ad-layer .ad-side { right: auto; left: 32px; }
#ad-layer .ad-side img { max-width: 320px; max-height: 280px; width: auto; height: auto; }
@keyframes ad-in { from { opacity: 0; margin-bottom: -20px; } to { opacity: 1; margin-bottom: 0; } }

/* ---- phone ↔ TV (js/pair.js) ---- */
#s-login .side.with-qr img { width: 150px; height: 153px; }
.pair-box { display: flex; align-items: center; text-align: right; background: rgba(255,255,255,0.09); border: 1px solid rgba(255,255,255,0.16); border-radius: 24px; padding: 14px; }
[dir=ltr] .pair-box { text-align: left; }
.pair-box .qr { width: 150px; height: 150px; flex-shrink: 0; background: #FFF; border-radius: 14px; padding: 6px; margin-left: 14px; }
[dir=ltr] .pair-box .qr { margin-left: 0; margin-right: 14px; }
.pair-box .qr svg { width: 100%; height: 100%; display: block; }
.pair-box .tx b { display: block; font-size: 18px; line-height: 1.3; margin-bottom: 6px; }
.pair-box .tx span { display: block; font-size: 14px; color: var(--soft); line-height: 1.45; }
.pair-box .tx .code { margin-top: 8px; color: var(--muted); font-size: 13px; }
.pair-box .tx .code { word-break: break-all; }
.pair-box .tx .num { display: block; font-style: normal; font-weight: 800 !important; font-size: 26px; line-height: 1.2; color: #FFD21F; letter-spacing: 2px; white-space: nowrap; }

/* ---- free channel lists (login → قنوات مجانية) ---- */
.free-help { font-size: 17px; color: var(--soft); margin: 4px 0 12px; }
.free-grid { margin: 0 -5px; }
.free-chip { display: inline-block; width: 128px; height: 74px; margin: 5px; border-radius: 20px; font-size: 16px; font-weight: 700 !important; vertical-align: top; }
.free-chip .ic { display: block; font-size: 22px; line-height: 1.2; }
.login-bar .chip { white-space: nowrap; }
.kc-list .chip { margin: 0 0 10px 10px; }
[dir=ltr] .kc-list .chip { margin: 0 10px 10px 0; }
.chip.kc.on:before { content: '✓ '; }

/* ---- look & feel (js/looks.js) ---- */
html.th-night, html.th-night body { background: #07080C; }
html.th-night #app { background: linear-gradient(160deg, #1A1C26 0%, #07080C 70%); }
html.th-purple, html.th-purple body { background: #1A0636; }
html.th-purple #app { background: linear-gradient(160deg, #4A1585 0%, #1A0636 75%); }
html.th-purple { --sun: linear-gradient(135deg, #FF8AE2, #B44CFF); }
html.th-ocean, html.th-ocean body { background: #04202C; }
html.th-ocean #app { background: linear-gradient(160deg, #0D5A70 0%, #04202C 75%); }
html.th-ocean { --sun: linear-gradient(135deg, #6CF5CF, #1FB6FF); }
html.th-purple .f.focused { box-shadow: 0 0 0 4px #FFFFFF, 0 0 18px rgba(255,138,226,0.7); }
html.th-ocean .f.focused { box-shadow: 0 0 0 4px #FFFFFF, 0 0 18px rgba(108,245,207,0.7); }
.sw { display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: -2px; margin-left: 8px; border: 2px solid rgba(255,255,255,0.6); }
[dir=ltr] .sw { margin-left: 0; margin-right: 8px; }
.sw-roka { background: linear-gradient(135deg, #0B2280, #1A0B4A); } .sw-night { background: #111319; }
.sw-purple { background: linear-gradient(135deg, #4A1585, #B44CFF); } .sw-ocean { background: linear-gradient(135deg, #0D5A70, #6CF5CF); }

/* card size: rows zoom; poster grids change how many fit in a line (6 normal, 7 small, 5 large) */
html.cd-s .row-track > .card, html.cd-s .row-track > .poster { zoom: 0.88; }
html.cd-l .row-track > .card, html.cd-l .row-track > .poster { zoom: 1.14; }
html.cd-s .grid .poster { width: 148px; height: 222px; }
html.cd-l .grid .poster { width: 212px; height: 318px; }
html.cd-s .grid .poster:nth-child(6n), html.cd-l .grid .poster:nth-child(6n) { margin-left: 22px; }
html.cd-s .grid .poster:nth-child(7n), html.cd-l .grid .poster:nth-child(5n) { margin-left: 0; }
html.cd-s[dir=ltr] .grid .poster:nth-child(6n), html.cd-l[dir=ltr] .grid .poster:nth-child(6n) { margin-right: 22px; }
html.cd-s[dir=ltr] .grid .poster:nth-child(7n), html.cd-l[dir=ltr] .grid .poster:nth-child(5n) { margin-right: 0; }

/* text size */
html.tx-l .card .t, html.tx-l .poster .t, html.tx-l .chan .nm { font-size: 21px; }
html.tx-l .card .s, html.tx-l .chan .num { font-size: 16px; }
html.tx-l #s-details .plot { font-size: 19px; max-height: 88px; }
html.tx-l .kv { font-size: 18px; }
html.tx-xl .card .t, html.tx-xl .poster .t, html.tx-xl .chan .nm { font-size: 24px; }
html.tx-xl .poster .t { max-height: 58px; }
html.tx-xl .card .s, html.tx-xl .chan .num { font-size: 18px; }
html.tx-xl #s-details .plot { font-size: 21px; max-height: 98px; }
html.tx-xl .kv { font-size: 20px; }

/* less motion */
html.calm *, html.calm *:before, html.calm *:after { transition: none !important; animation: none !important; }
html.calm .card.f.focused, html.calm .poster.f.focused, html.calm .chan.f.focused { transform: none; }

/* ---- multi-view (js/multi.js) ---- */
#s-multi { background: #000; }
.mv-grid { position: absolute; top: 0; left: 0; width: 1280px; height: 720px; padding: 8px; }
.mv-cell { position: relative; float: right; width: 624px; height: 344px; margin: 0 0 8px 8px; background: #0A1450; border-radius: 14px; overflow: hidden; }
[dir=ltr] .mv-cell { float: left; margin: 0 8px 8px 0; }
.mv-cell video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; background: #000; display: none; }
.mv-cell.on video { display: block; }
.mv-cell.on .mv-empty { display: none; }
.mv-empty { position: absolute; top: 50%; left: 0; right: 0; margin-top: -40px; text-align: center; font-size: 44px; line-height: 1; color: var(--muted); }
.mv-empty span { display: block; font-size: 18px; margin-top: 10px; }
.mv-name { position: absolute; top: 10px; right: 12px; background: rgba(10,20,80,0.8); border-radius: 999px; padding: 2px 14px; font-size: 15px; font-weight: 700 !important; display: none; }
[dir=ltr] .mv-name { right: auto; left: 12px; }
.mv-cell.on .mv-name { display: block; }
.mv-snd { position: absolute; bottom: 10px; left: 12px; width: 38px; height: 38px; border-radius: 50%; background: #FFD21F; color: #10144A; display: none; align-items: center; justify-content: center; }
[dir=ltr] .mv-snd { left: auto; right: 12px; }
.mv-cell.on.snd .mv-snd { display: flex; }
.mv-cell.f.focused { box-shadow: inset 0 0 0 5px #FFD21F; }
.mv-hint { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font-size: 13px; color: rgba(255,255,255,0.55); pointer-events: none; }
.mv-pick { position: absolute; top: 40px; left: 50%; width: 960px; height: 640px; margin-left: -480px; display: none; background: rgba(10,20,80,0.97); border: 1px solid rgba(255,255,255,0.2); border-radius: 28px; padding: 20px; }
.mv-pick.on { display: block; }
.mv-pick h3 { margin: 0 0 12px; font-size: 22px; }
.mv-pick-clip { height: 560px; }

/* ---- player control bar ---- */
#osd .ctrl { display: flex; justify-content: center; margin: 4px 0 8px; }
.cbtn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 96px; height: 70px; margin: 0 5px; border: 0; border-radius: 18px; background: rgba(255,255,255,0.09); color: #FFF; font-size: 13px; font-weight: 700 !important; }
.cbtn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 4px; }
.cbtn[data-key="c:play"] svg { fill: currentColor; }
.cbtn.on { color: #FF5A5A; }
.cbtn.on svg { fill: currentColor; }
.cbtn.dim { opacity: 0.4; }
.cbtn.f.focused { background: #FFD21F; color: #10144A; box-shadow: 0 0 0 3px #FFFFFF; transform: scale(1.06); }
#osd .bottom { padding-bottom: 14px; }
.skip-btn { bottom: 290px; }
.next-card { bottom: 280px; }
.cbtn { width: 92px; margin: 0 4px; }
#confirm .dlg.lang-dlg { width: 760px; }
#confirm .lang-dlg .row { display: flex; flex-wrap: wrap; justify-content: center; }
#confirm .lang-dlg .btn { min-width: 160px; margin: 6px; }
.ic-globe { vertical-align: -3px; margin-left: 6px; }
[dir=ltr] .ic-globe { margin-left: 0; margin-right: 6px; }

/* ---- profile pictures & editor ---- */
.ava-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.prof .ava { overflow: visible; }
.prof .ava .ava-img { position: absolute; top: 0; left: 0; }
.prof .pen { position: absolute; top: -4px; right: -4px; width: 40px; height: 40px; border-radius: 50%; background: #FFD21F; color: #10144A; font-size: 22px; line-height: 40px; }
.prof-btn { overflow: hidden; padding: 0; }
.prof-btn .ava-img { width: 100%; height: 100%; }
.prof-item .dot { overflow: hidden; }
.prof-item .dot .ava-img { width: 100%; height: 100%; }
.prof-actions { margin-top: 28px; }
.pe-wrap { position: absolute; top: 60px; left: 60px; right: 60px; display: flex; }
.pe-left { width: 320px; text-align: center; flex-shrink: 0; }
.pe-ava { width: 200px; height: 200px; margin: 0 auto 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 84px; font-weight: 800 !important; border: 5px solid #FFD21F; overflow: hidden; }
.pe-name { width: 280px; height: 56px; border-radius: 18px; border: 2px solid rgba(255,255,255,0.2); background: rgba(10,20,80,0.7); font-size: 20px; padding: 0 18px; margin-bottom: 14px; text-align: center; }
.pe-name.focused, .pe-name:focus { border-color: #FFD21F; }
.pe-right { flex: 1; margin-right: 40px; }
[dir=ltr] .pe-right { margin-right: 0; margin-left: 40px; }
.pe-right h3 { margin: 0 0 12px; font-size: 24px; }
.pe-grid { margin: 0 -6px; }
.ava-pick { width: 86px; height: 86px; margin: 6px; border-radius: 50%; border: 4px solid transparent; background: rgba(255,255,255,0.08); padding: 0; vertical-align: top; }
.ava-pick img { width: 100%; height: 100%; border-radius: 50%; }
.ava-pick.on { border-color: #FFD21F; }
.ava-pick.letter { font-size: 15px; font-weight: 700 !important; color: #FFF; }
.pe-photos { margin-top: 14px; }
.pe-photos .btn { margin-left: 10px; }
[dir=ltr] .pe-photos .btn { margin-left: 0; margin-right: 10px; }
.pe-qr { margin-top: 14px; max-width: 520px; }
.pe-actions { position: absolute; bottom: 40px; left: 0; right: 0; text-align: center; }
.pe-actions .btn { margin: 0 8px; }
.btn.danger { background: rgba(255,90,90,0.22); color: #FFB3B3; }

/* Content disclaimer at the bottom of home and settings */
.disclaimer { margin: 10px 20px 30px; padding: 14px 22px; border-radius: 18px; font-size: 14px; line-height: 1.7; color: var(--muted); text-align: center; }
.disclaimer.f.focused { box-shadow: none; background: rgba(255,255,255,0.08); color: var(--soft); }

/* Portrait poster in a wide spot: blurred fill + sharp poster on the side (js/ui.js wideArtHTML) */
.hero .bg.blur, #s-details .art img.bg.blur { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(22px) brightness(0.75); transform: scale(1.2); }
#s-details .art img.bg { position: absolute; top: 0; left: 0; }
.hero .pin { position: absolute; top: 22px; left: 36px; height: 256px; width: 171px; object-fit: cover; border-radius: 16px; box-shadow: 0 14px 34px rgba(0,0,0,0.5); z-index: 1; }
#s-details .art img.pin { position: absolute; top: 40px; left: 70px; width: 240px; height: 360px; object-fit: cover; border-radius: 20px; box-shadow: 0 16px 40px rgba(0,0,0,0.5); z-index: 1; }
[dir=ltr] .hero .pin { left: auto; right: 36px; }
[dir=ltr] #s-details .art img.pin { left: auto; right: 70px; }

/* 4-channel picker: sections column + channels column */
.mv-cols { display: flex; }
.mv-cols .mv-pick-clip { flex: 1; min-width: 0; }
.mv-cols .mv-cats-clip { flex: 0 0 340px; margin-left: 16px; }
[dir=ltr] .mv-cols .mv-cats-clip { margin-left: 0; margin-right: 16px; }
.mv-cat .nm { font-size: 17px; }
/* Version + update check on one line at the top of settings */
.about-box { display: flex; align-items: center; padding-top: 18px; padding-bottom: 18px; }
.about-box h3 { margin: 0; }
.about-box .kv { margin: 0 24px; }
.about-box .btn { margin: 0 auto 0 0; }
[dir=ltr] .about-box .btn { margin: 0 0 0 auto; }
/* Header carousel (5 newest) */
.hero-art { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.hero-art.in { animation: heroIn 0.6s ease-out; }
@keyframes heroIn { from { opacity: 0; } to { opacity: 1; } }
.hero-dots { position: absolute; bottom: 18px; right: 40px; z-index: 2; }
[dir=ltr] .hero-dots { right: auto; left: 40px; }
.hero-dots .dot { display: inline-block; width: 12px; height: 12px; padding: 0; margin: 0 0 0 8px; border: 0; border-radius: 6px; background: rgba(255,255,255,0.35); vertical-align: middle; }
[dir=ltr] .hero-dots .dot { margin: 0 8px 0 0; }
.hero-dots .dot.on { width: 34px; background: #FFD21F; }
.hero-dots .dot.f.focused { box-shadow: 0 0 0 3px #FFFFFF; }
.hero .txt { z-index: 2; }
.hero .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Top 10 row: big rank number on each poster */
.top10 .poster .rank { position: absolute; bottom: 34px; right: 8px; font-size: 64px; line-height: 1; font-weight: 800 !important; color: #FFD21F;
  text-shadow: 0 0 2px #10144A, 0 4px 14px rgba(0,0,0,0.7); -webkit-text-stroke: 2px #10144A; }
[dir=ltr] .top10 .poster .rank { right: auto; left: 8px; }

/* Profile editor: country */
.pe-country { display: block; margin-top: 14px; }
.pe-cont { margin-top: 8px; font-size: 15px; color: var(--soft); }
.pe-countries { margin-top: 12px; }
.pe-countries .chip { margin: 0 0 10px 10px; }
[dir=ltr] .pe-countries .chip { margin: 0 10px 10px 0; }

/* Today's matches on Home */
.match { position: relative; float: none; display: inline-block; vertical-align: top; width: 380px; height: 196px; margin: 0 0 0 20px; padding: 14px 18px; border-radius: 24px;
  background: var(--glass); border: 1px solid var(--glass-line); }
[dir=ltr] .match { margin: 0 20px 0 0; }
.match.is-live { border-color: rgba(255,59,59,0.7); }
.match .mh { font-size: 14px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match .slot { font-style: normal; font-weight: 700 !important; padding: 2px 10px; border-radius: 999px; margin-left: 8px; color: #10144A; }
[dir=ltr] .match .slot { margin-left: 0; margin-right: 8px; }
.match .slot-local { background: #7ED321; }
.match .slot-cont { background: #FFD21F; }
.match .slot-world { background: #22D3EE; }
.match .mb { display: flex; align-items: center; margin-top: 14px; }
.match .tm { flex: 1; min-width: 0; text-align: center; }
.match .tm img { width: 56px; height: 56px; object-fit: contain; display: block; margin: 0 auto 6px; }
.match .tm span { display: block; font-size: 15px; font-weight: 700 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match .mid { width: 110px; text-align: center; flex-shrink: 0; }
.match .mt, .match .ms { display: block; font-size: 28px; font-weight: 800 !important; }
.match .mdone { font-size: 13px; color: var(--muted); }
.match .badge-live { font-size: 12px; }
.match .mch { margin-top: 8px; font-size: 13px; color: var(--soft); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Header: a short plot under the title (2 lines) */
.hero .hero-plot { font-size: 16px; line-height: 1.5; color: var(--soft); max-height: 48px; overflow: hidden; margin: -8px 0 14px; }
.hero .hero-plot:empty { display: none; }
.hero h1 { font-size: 42px; max-height: 96px; }
.hero .txt { top: 24px; }
/* Top bar: check for updates */
.exit-btn.upd-btn { border-color: rgba(255,255,255,0.28); background: rgba(255,255,255,0.12); color: #FFF; }
.exit-btn.upd-btn:hover, .exit-btn.upd-btn.focused { background: #7ED321; color: var(--navy); }
/* Top bar with the update button: keep the pill and clock on one line */
#subinfo, #clock { white-space: nowrap; flex-shrink: 0; }
#subinfo { margin-left: 12px; padding: 0 12px; font-size: 15px; }
#topbar .exit-btn { width: 44px; height: 44px; margin-right: 10px; }
[dir=ltr] #topbar .exit-btn { margin-right: 0; margin-left: 10px; }
#mainnav { flex-shrink: 1; min-width: 0; }
