/* Reji panel — tasarım sistemi
   Koyu, sıcak vurgulu ve cam yüzeyli bir arayüz. Tüm ölçüler token üzerinden. */

:root {
  /* Zemin katmanları */
  --bg: #0a0c11;
  --bg-2: #0d1016;
  --surface: rgba(255, 255, 255, .038);
  --surface-2: rgba(255, 255, 255, .06);
  --surface-3: rgba(255, 255, 255, .09);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);

  /* Metin */
  --text: #eef1f7;
  --muted: #9099ad;
  --faint: #6b7385;

  /* Marka & durum */
  --accent: #ffb020;
  --accent-2: #ff8a3d;
  --accent-soft: rgba(255, 176, 32, .14);
  --accent-ink: #1b1200;
  --live: #ff5364;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #ff6b6b;
  --info: #7aa2ff;

  /* Şekil */
  --r-sm: 9px;
  --r: 13px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* Gölge */
  --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
  --sh-2: 0 14px 34px -22px rgba(0, 0, 0, .95), 0 2px 8px -4px rgba(0, 0, 0, .6);
  --sh-3: 0 26px 60px -28px rgba(0, 0, 0, 1);
  --ring: 0 0 0 3px rgba(255, 176, 32, .28);

  --font: "Inter var", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --header-h: 60px;
}

* { box-sizing: border-box; }
::selection { background: var(--accent-soft); color: var(--text); }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv05", "ss01", "tnum" 0;
}

/* Zemindeki yumuşak ışık — arayüze derinlik verir, içeriği bozmaz. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(255, 176, 32, .10), transparent 60%),
    radial-gradient(760px 460px at 92% 4%, rgba(122, 162, 255, .09), transparent 62%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 42%);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }

/* ---------------------------------------------------------------- Kabuk */

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  /* Izgara öğeleri varsayılan olarak içeriği kadar genişler; sabit genişlikli
     oturum kartları sayfayı yatay kaydırılır hâle getirmesin. */
  grid-template-columns: minmax(0, 1fr);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--header-h);
  padding: 0 clamp(14px, 3vw, 28px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .14em;
  flex: none;
}
.brand .dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 4px rgba(255, 176, 32, .16), 0 0 18px rgba(255, 176, 32, .55);
}
.brand span:last-child { background: linear-gradient(180deg, #fff, #b9c0d0); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 1 auto;
  margin-right: auto;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
  justify-content: flex-start;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 500;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.nav a .ic { font-size: 14px; opacity: .85; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active {
  color: #1b1200;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px -8px rgba(255, 150, 32, .9);
  font-weight: 650;
}
.nav a.active .ic { opacity: 1; }

.conn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  flex: none;
}
.conn i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, .18);
}
.conn.on i { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, .18); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

main {
  padding: 26px clamp(14px, 3vw, 28px) 64px;
  max-width: 1320px;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
  animation: rise .28s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h1 {
  font-size: clamp(19px, 2.4vw, 23px);
  font-weight: 680;
  letter-spacing: -.02em;
  margin: 0 0 18px;
}
h2 {
  font-size: 11px;
  margin: 0 0 12px;
  color: var(--faint);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.small { font-size: 12px; }

/* --------------------------------------------------------------- Kartlar */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, .052), rgba(255, 255, 255, .018));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--sh-2);
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .18), transparent);
  pointer-events: none;
}
.grid .card:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--sh-3); }
.card.offline { opacity: .58; }
.card.offline:hover { transform: none; }

.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head .name { font-weight: 640; font-size: 15px; letter-spacing: -.01em; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: .01em;
}
.badge.live { background: rgba(255, 83, 100, .14); border-color: rgba(255, 83, 100, .3); color: #ff8a95; }
.badge.ok { background: rgba(52, 211, 153, .13); border-color: rgba(52, 211, 153, .28); color: #6ee7b7; }
.badge.warn { background: rgba(251, 191, 36, .13); border-color: rgba(251, 191, 36, .3); color: #fcd34d; }
.badge.off { background: var(--surface); color: var(--faint); }

/* Şu an oynuyor */
.now { display: grid; grid-template-columns: 78px 1fr; gap: 14px; align-items: start; }
.poster {
  width: 78px; height: 108px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
  object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  color: var(--faint); font-size: 24px;
  box-shadow: var(--sh-1);
}
.title { font-weight: 620; font-size: 15px; line-height: 1.3; letter-spacing: -.01em; }
.sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.progress {
  height: 5px;
  background: rgba(255, 255, 255, .08);
  border-radius: 999px;
  margin: 12px 0 5px;
  overflow: hidden;
}
.progress > div {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 12px rgba(255, 176, 32, .5);
  transition: width .9s linear;
}
.times {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--muted);
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------- Butonlar */

.controls { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
/* Dar kartlarda da tek satır: ikonlar biraz küçülür, kaydırak boşluğu doldurur. */
.controls .btn.icon { width: 34px; height: 34px; }
.controls input[type=range] { flex: 1 1 56px; width: auto !important; min-width: 48px; }
.controls .spacer { flex: 0 1 auto; }
.btn.icon { filter: saturate(.92); }

.btn {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 13px;
  color: var(--text);
  font-weight: 550;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  line-height: 1.15;
  white-space: nowrap;
  transition: background .16s var(--ease), border-color .16s var(--ease), transform .12s var(--ease), color .16s var(--ease);
}
.btn:hover:not(:disabled) { background: var(--surface-3); border-color: var(--line-2); }
.btn:active:not(:disabled) { transform: scale(.965); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 660;
  box-shadow: 0 8px 22px -12px rgba(255, 150, 32, .95);
}
.btn.primary:hover:not(:disabled) { filter: brightness(1.07); }
.btn.danger { color: var(--danger); border-color: rgba(255, 107, 107, .22); }
.btn.danger:hover:not(:disabled) { background: rgba(255, 107, 107, .12); border-color: rgba(255, 107, 107, .4); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn.icon { padding: 0; width: 36px; height: 36px; font-size: 15px; }
.btn.small { padding: 5px 10px; font-size: 12px; }

/* Komut gönderilirken: buton kilitlenir ve içinden ışık geçer. */
.btn.busy { pointer-events: none; color: transparent; overflow: hidden; }
.btn.busy::after {
  content: "";
  position: absolute;
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .25);
  border-top-color: var(--accent);
  animation: spin .6s linear infinite;
}
.btn.primary.busy::after { border-color: rgba(0, 0, 0, .25); border-top-color: var(--accent-ink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------- Formlar */

input[type=text], input[type=password], input[type=search], input[type=number], select, textarea {
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  color: var(--text);
  min-width: 0;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
input::placeholder { color: var(--faint); }
input:hover, select:hover { border-color: var(--line-2); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 176, 32, .16); background: rgba(0, 0, 0, .4); }
select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%239099ad' stroke-width='1.6' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 11px center;
}
input[type=range] { accent-color: var(--accent); height: 22px; }
input[type=search]::-webkit-search-cancel-button { filter: invert(.6); }

/* --------------------------------------------------------------- Tablolar */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--r);
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th {
  position: sticky; top: 0; z-index: 1;
  color: var(--faint);
  font-weight: 650; font-size: 11px;
  text-transform: uppercase; letter-spacing: .09em;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px);
}
tbody tr { transition: background .15s var(--ease); }
tbody tr:hover td { background: var(--surface); }
tbody tr:last-child td { border-bottom: 0; }

/* --------------------------------------------------------------- Kumanda */

.remote { display: grid; grid-template-columns: 1fr; gap: 16px; max-width: 460px; margin: 0 auto; }
.dpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 212px;
  margin: 0 auto 12px;
}
.dpad .btn {
  aspect-ratio: 1;
  width: 100%; height: auto;
  font-size: 17px;
  border-radius: var(--r);
  background: var(--surface-2);
}
.dpad .btn:hover:not(:disabled) { background: var(--surface-3); }
.dpad .ok {
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-weight: 750;
  font-size: 15px;
  border-color: transparent;
  box-shadow: 0 10px 26px -14px rgba(255, 150, 32, .95);
}
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keys .btn { padding: 11px 6px; font-size: 13px; }

/* ----------------------------------------------------------------- Giriş */

.login { min-height: calc(100vh - 40px); display: grid; place-items: center; padding: 20px; }
.login .card { width: min(380px, 94vw); padding: 30px; box-shadow: var(--sh-3); }
.login h1 { display: flex; align-items: center; gap: 12px; font-size: 24px; margin-bottom: 4px; }
.login h1 .dot {
  width: 15px; height: 15px; border-radius: 50%;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 4px rgba(255, 176, 32, .16), 0 0 20px rgba(255, 176, 32, .6);
}
.login .lead { color: var(--muted); margin: 0 0 22px; font-size: 13.5px; }
.field { display: grid; gap: 7px; margin: 14px 0; }
.field label { font-size: 12px; color: var(--muted); font-weight: 550; }
.error { color: var(--danger); font-size: 13px; min-height: 18px; }

/* ---------------------------------------------------------------- Grafik */

.bars { display: flex; align-items: flex-end; gap: 4px; height: 110px; padding: 8px 0; }
.bars > div {
  flex: 1;
  background: linear-gradient(180deg, var(--accent), rgba(255, 138, 61, .45));
  border-radius: 4px 4px 2px 2px;
  min-height: 3px;
  position: relative;
  transition: filter .15s var(--ease);
}
.bars > div:hover { filter: brightness(1.25); }
.bars > div span {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  font-size: 11px; color: var(--text);
  background: rgba(12, 14, 20, .96);
  border: 1px solid var(--line-2);
  padding: 5px 9px; border-radius: 8px;
  white-space: nowrap; display: none; z-index: 5;
  box-shadow: var(--sh-2);
}
.bars > div:hover span { display: block; }

.log {
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(0, 0, 0, .34);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  max-height: 380px;
  overflow: auto;
  white-space: pre-wrap;
  color: #c3cad9;
}
.log .warn { color: var(--warn); }
.log .error, .log .fatal { color: var(--danger); }
.log .t { color: var(--faint); }

/* ------------------------------------------------------------ Liste & rozet */

.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 8px;
  margin: 0 -8px;
  border-radius: var(--r);
  border-bottom: 1px solid var(--line);
  transition: background .15s var(--ease);
}
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--surface); }
.thumb {
  width: 44px; height: 62px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  object-fit: cover; flex: none;
}
.pill {
  display: inline-block;
  font-size: 10.5px; font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.tabs {
  display: flex;
  gap: 3px;
  margin-bottom: 16px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  /* Dar ekranda sekmeler sayfayı genişletmesin, kendi içinde kaysın. */
  max-width: 100%;
  width: max-content;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs .btn { flex: none; }
.tabs .btn { background: transparent; border-color: transparent; border-radius: 999px; color: var(--muted); }
.tabs .btn:hover:not(.active) { background: var(--surface-2); color: var(--text); }
.tabs .btn.active {
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 650;
}

.empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--muted);
  padding: 38px 24px;
  text-align: center;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .012);
  font-size: 13.5px;
  width: 100%;
}
.empty .ico { color: var(--faint); margin-bottom: 4px; }
.empty-title { color: var(--text); font-weight: 620; font-size: 14.5px; }
.empty-text { max-width: 42ch; line-height: 1.5; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 9px 18px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* -------------------------------------------------------------- Bildirim */

#toasts {
  position: fixed;
  right: 18px; bottom: 18px;
  display: grid; gap: 10px;
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom);
}
.toast {
  background: rgba(16, 19, 26, .96);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--muted);
  border-radius: var(--r);
  padding: 12px 16px;
  box-shadow: var(--sh-3);
  max-width: 380px;
  font-size: 13px;
  animation: toast-in .25s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.toast.err { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }

/* --------------------------------------------------------------- Tooltip */

#tip {
  position: fixed;
  z-index: 300;
  max-width: 260px;
  padding: 7px 11px;
  border-radius: 9px;
  background: rgba(16, 19, 26, .97);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  box-shadow: var(--sh-3);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .14s var(--ease), transform .14s var(--ease);
  backdrop-filter: blur(10px);
}
#tip.show { opacity: 1; transform: none; }
#tip::after {
  content: "";
  position: absolute;
  left: var(--tip-x, 50%);
  width: 8px; height: 8px;
  transform: translateX(-50%) rotate(45deg);
  background: rgba(16, 19, 26, .97);
  border: 1px solid var(--line-2);
}
#tip[data-side="top"]::after { bottom: -5px; border-left: 0; border-top: 0; }
#tip[data-side="bottom"]::after { top: -5px; border-right: 0; border-bottom: 0; }

/* ---------------------------------------------------- Mobil alt navigasyon */

.tabbar { display: none; }

@media (max-width: 900px) {
  .nav a span.lbl { display: none; }
  .nav a { padding: 7px 11px; }
}

@media (max-width: 720px) {
  :root { --header-h: 54px; }
  .topbar { gap: 10px; }
  .topbar .nav { display: none; }
  main { padding: 18px 14px calc(92px + env(safe-area-inset-bottom)); }
  .grid { grid-template-columns: 1fr; }
  .card { padding: 15px; border-radius: var(--r); }
  .keys { grid-template-columns: repeat(4, 1fr); gap: 7px; }
  .login { min-height: 82vh; }
  #toasts { right: 12px; left: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }

  /* Alt sekme çubuğu — başparmakla erişilebilir yükseklikte */
  .tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    display: flex;
    justify-content: space-around;
    gap: 2px;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 95%, transparent);
    backdrop-filter: saturate(160%) blur(22px);
    -webkit-backdrop-filter: saturate(160%) blur(22px);
    border-top: 1px solid var(--line);
  }
  .tabbar a {
    flex: 1;
    display: grid;
    justify-items: center;
    gap: 3px;
    padding: 7px 2px;
    border-radius: var(--r-sm);
    color: var(--faint);
    font-size: 10.5px;
    font-weight: 550;
    transition: color .16s var(--ease), background .16s var(--ease);
  }
  .tabbar a .ic { font-size: 17px; line-height: 1; }
  .tabbar a.active { color: var(--accent); background: var(--accent-soft); }
}

@media (max-width: 420px) {
  .now { grid-template-columns: 62px 1fr; gap: 11px; }
  .poster { width: 62px; height: 86px; }
  .keys { grid-template-columns: repeat(2, 1fr); }
  .controls .btn.icon { width: 34px; height: 34px; }
}

/* İşaretçisi olmayan (dokunmatik) cihazlarda tooltip gösterilmez. */
@media (hover: none) {
  #tip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ============================================================== Konsol ekranı */

.page-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 2px; }
.page-sub { margin: 0; color: var(--muted); font-size: 13px; }

/* Oturum şeridi */
.sessions-wrap { margin-bottom: 18px; }
.sessions {
  display: flex;
  min-width: 0;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}
.sessions::-webkit-scrollbar { height: 6px; }
.sessions::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 999px; }

.session {
  flex: 0 0 auto;
  width: 260px;
  scroll-snap-align: start;
  display: grid;
  gap: 5px;
  text-align: left;
  padding: 13px 15px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
  color: var(--text);
  box-shadow: var(--sh-1);
  transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.session:hover { border-color: var(--line-2); transform: translateY(-2px); }
.session.active {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: linear-gradient(180deg, rgba(255, 176, 32, .13), rgba(255, 176, 32, .04));
  box-shadow: 0 10px 28px -18px rgba(255, 150, 32, .9), inset 0 0 0 1px rgba(255, 176, 32, .12);
}
.session.off { opacity: .62; }
.session-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.session-top .dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--faint); box-shadow: 0 0 0 3px rgba(255, 255, 255, .05);
}
.session-top .dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, .18); }
.session-name { font-weight: 640; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-now { font-size: 12.5px; color: var(--text); opacity: .82; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-meta { font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* İki sütunlu yönetim alanı */
.console { display: grid; grid-template-columns: minmax(330px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; min-width: 0; }
.console > * { min-width: 0; }
.console-left { display: grid; gap: 14px; position: sticky; top: calc(var(--header-h) + 14px); }
.console-right { min-width: 0; }
.pane { padding: 14px 16px 16px; }
.pane-body { min-height: 460px; }

/* Sekme içi tür seçiciler */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px; font-weight: 550;
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.chip:hover { color: var(--text); background: var(--surface-2); }
.chip.active {
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); border-color: transparent; font-weight: 650;
}

.scroll-list { max-height: min(56vh, 560px); overflow-y: auto; padding-right: 4px; }
.scroll-list::-webkit-scrollbar { width: 8px; }
.scroll-list::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 999px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb.ph { display: grid; place-items: center; font-size: 18px; }

.diag-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.pane .log { max-height: 240px; }

@media (max-width: 1080px) {
  .console { grid-template-columns: 1fr; }
  .console-left { position: static; }
}

@media (max-width: 720px) {
  .session { width: 216px; }
  .pane { padding: 12px 13px 14px; }
  /* Liste kendi içinde kayar: filtre değişince sayfa kısalıp yukarı zıplamaz. */
  .scroll-list { max-height: 62vh; }
  .pane-body { min-height: 0; }
}

/* ========================================================== İkonlar & ölçüler */

.ico { width: 18px; height: 18px; flex: none; display: block; }
.ico.xs { width: 15px; height: 15px; }
.ico.lg { width: 26px; height: 26px; }
.btn .ico { margin: 0; }
.btn.icon .ico { width: 17px; height: 17px; }
.btn.lg { width: 44px; height: 44px; }
.btn.lg .ico { width: 20px; height: 20px; }
.btn.primary-soft { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent); }
.btn.primary-soft:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.btn.icon.on { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.grow { flex: 1; min-width: 0; }
.clamp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0 0 12px; line-height: 1.5; }

/* Başlık sağındaki sayaçlar */
.head-stats { display: flex; gap: 10px; }
.stat {
  display: grid; gap: 1px;
  padding: 8px 14px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  min-width: 78px;
}
.stat-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600; }
.stat-value { font-size: 17px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat.live .stat-value { color: var(--accent); }
.stat.warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.stat.warn .stat-value { color: var(--warn); }

/* Oturum kartındaki mini ilerleme */
.session { gap: 6px; }
.session-bar { height: 3px; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.session-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 999px; }
.session-meta { display: inline-flex; align-items: center; gap: 5px; }
.session-meta .ico { width: 13px; height: 13px; opacity: .7; }
.session-top .badge .ico { width: 12px; height: 12px; }

/* Şu an oynuyor */
.now-card .now { grid-template-columns: 92px 1fr; gap: 16px; }
.now-text { min-width: 0; }
.poster { width: 92px; height: 128px; }
.poster.ph { color: var(--faint); }
.seek {
  position: relative;
  height: 6px; margin: 14px 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
}
.seek.seekable { cursor: pointer; padding: 7px 0; height: 6px; background-clip: content-box; }
.seek-fill {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 12px rgba(255, 176, 32, .45);
  transition: width .9s linear;
}
.seek-knob {
  position: absolute; top: 50%; left: 0; width: 0; height: 0;
  pointer-events: none;
}
.seek.seekable:hover .seek-fill { filter: brightness(1.12); }
.now-card .times { margin-top: 2px; }

.vol { display: inline-flex; align-items: center; gap: 7px; flex: 1 1 110px; min-width: 92px; }
.vol input[type=range] { flex: 1 1 auto; width: auto !important; min-width: 48px; }
.vol-val { font-size: 11.5px; color: var(--muted); min-width: 22px; text-align: right; }

/* Kumanda kartı */
.remote-card .card-head { margin-bottom: 12px; }
.remote-card.collapsed .remote-body { display: none; }
.remote-card.collapsed { padding-bottom: 10px; }
.remote-card.collapsed .card-head { margin-bottom: 0; }
.remote-toggle { margin: -4px -6px -4px 0; }
.keys .btn { display: inline-flex; gap: 5px; align-items: center; justify-content: center; }
.keys { grid-template-columns: repeat(2, 1fr); }
.shortcuts {
  display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--faint); font-size: 11.5px;
}
.kbd {
  font-family: var(--mono); font-size: 10.5px;
  padding: 2px 6px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--muted);
}

/* Katalog arama satırı */
.search-row { position: relative; margin-bottom: 12px; }
.search-row .search-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-row input[type=search] { padding-left: 36px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; }
.chip .ico { opacity: .8; }
.chip.active .ico { opacity: 1; }

/* Dizi sezon/bölüm paneli */
.series-panel {
  margin: 4px 0 12px;
  padding: 14px;
  border-radius: var(--r);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  background: linear-gradient(180deg, rgba(255, 176, 32, .07), rgba(255, 255, 255, .02));
  animation: rise .2s var(--ease);
}
.series-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.series-err { display: flex; align-items: center; gap: 8px; color: var(--danger); font-size: 13px; }
.season-chips { margin-bottom: 10px; }
.episodes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.episode {
  display: flex; align-items: center; gap: 11px; min-width: 0;
  padding: 8px 9px; border-radius: var(--r-sm);
  transition: background .15s var(--ease);
}
.episode:hover { background: var(--surface-2); }
.episode .btn.ep-play { width: 34px; height: 34px; }
.episode .btn.ep-play .ico { width: 15px; height: 15px; }
.ep-no {
  font-size: 11.5px; font-weight: 650; color: var(--accent);
  background: var(--accent-soft); border-radius: 6px;
  padding: 3px 7px; flex: none;
}

/* Yükleniyor iskeletleri */
.skel-row { display: flex; align-items: center; gap: 12px; padding: 11px 8px; }
.skel {
  display: block; height: 11px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.1), rgba(255,255,255,.05));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
.skel.line { flex: 1; }
.skel.line.short { flex: 0 0 62px; }
.skel.thumb-skel { width: 44px; height: 62px; border-radius: 8px; flex: none; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.list-item.compact { padding: 7px 8px; }
.progress.thin { height: 4px; margin: 7px 0 3px; }
.tabs .btn { display: inline-flex; align-items: center; gap: 7px; }

@media (max-width: 720px) {
  .head-stats { width: 100%; }
  .stat { flex: 1; }
  .now-card .now { grid-template-columns: 74px 1fr; gap: 12px; }
  .poster { width: 74px; height: 104px; }
  /* Dokunma hedefleri en az 44px */
  .btn.icon { width: 42px; height: 42px; }
  .controls { gap: 8px; }
  .episodes { max-height: none; }
  .keys { grid-template-columns: repeat(2, 1fr); }
}
