/* Pocket TV — televizyon görünümü. Solda çerçeveli bir televizyon, sağda kanal rehberi. */
:root {
  --bg0: #090c13; --bg1: #131824; --panel: #121722; --line: #ffffff17; --text: #eef1f7; --dim: #98a3b8;
  --accent: #6c4df2; --warn: #f59e0b; --bad: #ef4444; --ok: #34d399; --lcd: #72ff8c;
  --glow: 228 70% 62%;          /* ekranın arkasından sızan ışık: kanala göre değişir */
  --bar: 36px;                  /* pencere başlık şeridi */
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg0); color: var(--text); font: 14px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif; overflow: hidden; user-select: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: #ffffff12; border-radius: 8px; padding: 8px 14px; }
button:hover { border-color: #ffffff40; background: #ffffff1c; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.12); }
button.icon { width: 40px; height: 40px; padding: 0; font-size: 20px; line-height: 1; }
input[type=search], input[type=text], input[type=password], select { background: #00000059; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; outline: none; }
input:focus, select:focus, button:focus-visible { border-color: var(--accent); outline: none; }
::-webkit-scrollbar { width: 9px; } ::-webkit-scrollbar-thumb { background: #ffffff22; border-radius: 5px; } ::-webkit-scrollbar-track { background: transparent; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
.grow { flex: 1; }
.code { flex: none; min-width: 30px; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .5px; padding: 2px 5px; border-radius: 4px; background: #ffffff1a; color: #c9d3e6; }

/* ---- Başlık şeridi ve oda */
#titlebar { position: fixed; top: 0; left: 0; right: 0; height: var(--bar); z-index: 25; display: flex; align-items: center; gap: 8px; padding: 0 14px; -webkit-app-region: drag; color: #ffffff8c; font-size: 12px; letter-spacing: .4px; }
#titlebar img { width: 16px; height: 16px; border-radius: 4px; }
body.mac #titlebar { padding-left: 84px; }
#room { position: fixed; inset: 0; display: flex; gap: 20px; padding: calc(var(--bar) + 6px) 24px 22px;
  background: radial-gradient(900px 620px at 36% 44%, hsl(var(--glow) / .10), transparent 70%), linear-gradient(var(--bg0), var(--bg1)); transition: background .8s; }
body.on #room { background: radial-gradient(1000px 680px at 36% 44%, hsl(var(--glow) / .30), transparent 70%), linear-gradient(var(--bg0), var(--bg1)); }
body.noguide #room { background-position: center; }

/* ---- Televizyon */
#tv { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#set { width: min(100%, calc((100vh - var(--bar) - 28px - 58px - 56px - 14px) * 16 / 9)); min-width: 320px; padding: 14px 14px 0; border-radius: 20px;
  background: linear-gradient(#2b2d33, #121317 34%, #0a0b0d); border: 1px solid #ffffff14; border-top-color: #ffffff4d;
  box-shadow: 0 18px 40px #000000a6, 0 0 0 1px #000 inset; transition: box-shadow .8s; }
body.on #set { box-shadow: 0 18px 40px #000000a6, 0 0 90px hsl(var(--glow) / .35), 0 0 0 1px #000 inset; }
#screen { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 5px; overflow: hidden; box-shadow: 0 0 0 2px #000; }
#screen.idle { cursor: none; }
#video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.glass { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(135deg, #ffffff12, #ffffff04 28%, transparent 46%); }

#standby { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: repeating-linear-gradient(#ffffff06 0 1px, transparent 1px 4px), radial-gradient(closest-side, #1c1d21, #050506); }
#standby .tvicon { width: 58px; height: 58px; stroke-width: 1.1; color: #ffffff59; }
#standby .logo { font-size: 22px; font-weight: 600; letter-spacing: 9px; color: #ffffff8c; padding-left: 9px; }
#standbyHint { color: #ffffff73; }
#powerOn { display: flex; align-items: center; gap: 9px; border-radius: 22px; padding: 10px 22px; font-weight: 600; font-size: 15px; }
#powerOn svg { width: 17px; height: 17px; stroke-width: 2.3; }

#message { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 40px; font-size: 17px; color: #d5dcea; pointer-events: none; background: #000000a6; }
#osd { position: absolute; top: 22px; inset-inline-end: 22px; display: flex; align-items: center; gap: 14px; padding: 10px 18px; border-radius: 14px; background: #0000009e; box-shadow: 0 6px 18px #00000080; pointer-events: none; transition: opacity .4s; max-width: 70%; }
#osd.fade { opacity: 0; }
#osd .num { font: 800 42px/1 "Segoe UI", system-ui, sans-serif; font-variant-numeric: tabular-nums; color: var(--lcd); }
#osd .name { font-size: 21px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#osd .meta { color: #ffffffcc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#status { position: absolute; inset-inline-start: 16px; top: 16px; padding: 6px 13px; border-radius: 18px; background: #000000b8; border: 1px solid #ffffff26; font-size: 13.5px; max-width: 70%; transition: opacity .4s; }
#status.ok { border-color: var(--ok); } #status.bad { border-color: var(--bad); } #status.fade { opacity: 0; }

#controls { position: absolute; left: 0; right: 0; bottom: 0; display: none; align-items: center; gap: 10px; padding: 34px 14px 12px; background: linear-gradient(transparent, #000000c4); transition: opacity .25s; }
body.on #controls { display: flex; }
#screen.idle #controls { opacity: 0; pointer-events: none; }
#controls .live { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: 1px; }
#controls .live i { width: 7px; height: 7px; border-radius: 50%; background: #ff3b30; box-shadow: 0 0 6px #ff3b30; }
#langLabel { display: flex; align-items: center; gap: 8px; }
#langLabel span { color: #e3e8f2; text-shadow: 0 1px 3px #000; }
#controls select, .glassbtn { background: #ffffff2e; border: 1px solid #ffffff33; border-radius: 18px; height: 34px; padding: 0 12px; backdrop-filter: blur(6px); }
#controls select option { background: #1a1f2c; }
.glassbtn { width: 36px; padding: 0; display: flex; align-items: center; justify-content: center; }

/* Ön panel */
#panel { height: 56px; display: flex; align-items: center; gap: 7px; padding: 0 6px; }
#led { width: 7px; height: 7px; border-radius: 50%; background: #ff453a; box-shadow: 0 0 6px #ff453a; opacity: .8; margin-inline: 6px 4px; }
body.on #led { background: #30d158; box-shadow: 0 0 7px #30d158; opacity: 1; }
#panel .brand { font-size: 11px; font-weight: 600; letter-spacing: 3.6px; color: #ffffff80; white-space: nowrap; }
#display { min-width: 150px; max-width: 320px; height: 29px; display: flex; align-items: center; gap: 9px; padding: 0 13px; border-radius: 7px; background: #000000c2; border: 1px solid #ffffff14;
  font: 500 12.5px/1 Consolas, "Cascadia Mono", ui-monospace, Menlo, monospace; white-space: nowrap; overflow: hidden; }
#display b { color: var(--lcd); font-weight: 600; } #display span { color: #ffffffd9; overflow: hidden; text-overflow: ellipsis; } #display em { color: #ffffff59; font-style: normal; letter-spacing: 1.5px; }
#panel button { width: 31px; height: 29px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 7px; background: #ffffff12; border-color: #ffffff1a; color: #ffffffcc; }
#panel button:hover { background: #ffffff26; color: #fff; }
#panel button svg { width: 14px; height: 14px; stroke-width: 2.2; }
#fav.on { color: #ffd60a; } #fav.on svg { fill: #ffd60a; }
body.on #power { color: #ff453a; }
body:not(.on) #fav { display: none; }
#panel .sep { width: 1px; height: 20px; background: #ffffff26; margin: 0 3px; }

/* Ayak */
#stand { display: flex; flex-direction: column; align-items: center; height: 56px; width: min(48%, 380px); }
#stand .neck { width: 86px; height: 34px; background: linear-gradient(90deg, #0c0d0f, #2a2c31, #0c0d0f); }
#stand .foot { width: 100%; height: 11px; border-radius: 6px; background: linear-gradient(#3a3c42, #111214); border: 1px solid #ffffff1f; box-shadow: 0 10px 16px #000000b3; }

/* ---- Kanal rehberi */
#guide { position: relative; width: 340px; flex: none; display: flex; flex-direction: column; gap: 11px; padding: 14px; border-radius: 20px; background: #111622eb; border: 1px solid #ffffff17; box-shadow: 0 12px 26px #00000080; min-height: 0; }
body.noguide #guide { display: none; }
#scope { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border-radius: 12px; text-align: start; background: #ffffff12; border-color: transparent; }
#scope .text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#scope b { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#scope small { color: var(--dim); font-size: 12px; }
#scope svg { color: var(--dim); }
#scopeCode { font-size: 12px; padding: 5px 7px; min-width: 36px; background: var(--accent); color: #fff; }
#countries { position: absolute; top: 70px; left: 14px; right: 14px; bottom: 14px; z-index: 3; overflow-y: auto; padding: 6px; border-radius: 14px; background: #1a2030; border: 1px solid #ffffff26; box-shadow: 0 16px 34px #000000b3; }
#countries button { display: flex; width: 100%; align-items: center; gap: 9px; border: 0; background: none; border-radius: 8px; padding: 8px 9px; text-align: start; }
#countries button:hover { background: #ffffff14; }
#countries button.on { background: var(--accent); color: #fff; }
#countries button .n { margin-inline-start: auto; color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; }
#countries button.on .n { color: #e6e0ff; }
.searchbox { display: flex; align-items: center; gap: 8px; height: 35px; padding: 0 12px; border-radius: 10px; background: #00000059; border: 1px solid var(--line); color: var(--dim); }
.searchbox:focus-within { border-color: var(--accent); }
.searchbox input { flex: 1; min-width: 0; border: 0; background: none; padding: 0; color: var(--text); }
#banner { padding: 9px 11px; border-radius: 10px; background: #6c4df226; border: 1px solid #6c4df24d; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
#banner.warn { background: #f59e0b21; border-color: #f59e0b52; }
#banner button { align-self: flex-start; padding: 5px 12px; }
#grid { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; margin-inline-end: -6px; padding-inline-end: 6px; }
.row { display: flex; align-items: center; gap: 10px; height: 48px; flex: none; padding: 0 8px; border-radius: 11px; cursor: pointer; }
.row:hover, .row:focus-visible { background: #ffffff14; outline: none; }
.row .num { width: 30px; text-align: end; font: 600 12px/1 Consolas, "Cascadia Mono", ui-monospace, Menlo, monospace; color: #ffffff66; }
.row .badge { width: 34px; height: 34px; flex: none; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: #fffffff2;
  background: linear-gradient(135deg, hsl(var(--h) 55% 52%), hsl(calc(var(--h) + 28) 62% 30%)); }
.row .text { flex: 1; min-width: 0; }
.row .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font-size: 11.5px; color: #ffffff80; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .air { display: none; align-items: center; gap: 4px; font-size: 9px; font-weight: 800; letter-spacing: .8px; padding: 3px 7px; border-radius: 10px; background: #00000059; white-space: nowrap; }
.row .air::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ff3b30; }
.row .star { width: 26px; height: 26px; padding: 0; border: 0; background: none; font-size: 15px; color: #ffffff40; flex: none; }
.row .star:hover { color: #fff; background: none; } .row .star.on { color: #ffd60a; }
.row.on { background: linear-gradient(90deg, var(--accent), #6c4df2a6); }
.row.on .num { color: #fff; } .row.on .meta { color: #ffffffd9; } .row.on .air { display: flex; }
.empty { padding: 60px 0; text-align: center; color: var(--dim); }

/* ---- Tam ekran: yalnızca görüntü */
body.immersive #titlebar, body.immersive #guide, body.immersive #panel, body.immersive #stand { display: none; }
body.immersive #room { padding: 0; background: #000; }
body.immersive #tv { display: block; }
body.immersive #set { width: 100vw; min-width: 0; height: 100vh; padding: 0; border: 0; border-radius: 0; background: #000; box-shadow: none; }
body.immersive #screen { width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0; }
body.immersive .glass { display: none; }

/* ---- Ayarlar */
#settings { position: fixed; inset: 0; z-index: 20; background: linear-gradient(var(--bg0), var(--bg1)); overflow-y: auto; padding-top: var(--bar); }
.sheet { max-width: 760px; margin: 0 auto; padding: 10px 22px 60px; }
.sheet header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
h1 { font-size: 21px; font-weight: 600; margin: 0; }
#settings section { margin-top: 16px; padding: 16px; background: #ffffff0d; border: 1px solid var(--line); border-radius: 14px; }
#settings section h2 { margin: 0 0 10px; font-size: 16px; }
#settings section p { margin: 8px 0; color: #c3ccdb; white-space: pre-line; user-select: text; }
#settings section p.dim { color: var(--dim); font-size: 13.5px; }
#settings section p.good { color: var(--ok); } #settings section p.bad { color: #fca5a5; }
#settings .row, .rowline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; height: auto; padding: 0; cursor: default; border-radius: 0; }
#settings .row:hover { background: none; }
#settings .row input { flex: 1; min-width: 220px; }
a { color: #a99bff; cursor: pointer; text-decoration: underline; }
.value { min-width: 150px; text-align: center; }

#toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 30; padding: 9px 18px; border-radius: 20px; background: #000d; border: 1px solid #fff3; }

/* ---- Rehberin altındaki "uygulamayı indir" bağlantısı (web sürümü) */
#getApp { text-align: center; font-size: 12.5px; color: #b9aeff; text-decoration: none; padding: 7px 10px; border-radius: 10px; background: #6c4df21f; border: 1px solid #6c4df240; }
#getApp:hover { background: #6c4df238; color: #fff; }

/* ---- Web sürümü: pencere başlık şeridi yok */
body.web { --bar: 0px; }
body.web #titlebar { display: none; }
body.web #room { padding-top: 20px; }
body.web #settings { padding-top: 8px; }

/* ---- Dar ekran (telefon, dikey tablet): televizyon üstte, rehber altta */
@media (max-width: 900px) {
  body { overflow: auto; }
  #room { position: static; min-height: 100vh; flex-direction: column; gap: 14px; padding: calc(var(--bar) + 12px) 12px 16px; }
  body.web #room { padding-top: 12px; }
  #tv { flex: none; }
  #set { width: 100%; min-width: 0; padding: 8px 8px 0; border-radius: 14px; }
  #stand { display: none; }
  #panel { height: 50px; gap: 5px; padding: 0 2px; }
  #panel .brand, #panel #guideToggle, #panel .sep { display: none; }
  #display { min-width: 0; flex: 1; }
  #panel .grow { display: none; }
  #guide { width: auto; flex: none; height: 62vh; min-height: 360px; border-radius: 16px; padding: 12px; }
  body.noguide #guide { display: flex; }
  #osd { top: 10px; inset-inline-end: 10px; padding: 7px 12px; gap: 9px; }
  #osd .num { font-size: 26px; } #osd .name { font-size: 15px; } #osd .meta { font-size: 11.5px; }
  #status { inset-inline-start: 8px; top: 8px; font-size: 12px; padding: 5px 10px; }
  #controls { padding: 24px 8px 8px; gap: 6px; }
  #langLabel span { display: none; }
  #standby .logo { font-size: 16px; letter-spacing: 6px; } #standby .tvicon { width: 40px; height: 40px; } #standbyHint { font-size: 12px; text-align: center; padding: 0 12px; }
  #powerOn { padding: 8px 18px; font-size: 14px; }
  .sheet { padding: 6px 12px 50px; }
}
