:root {
  --bg: #0d0f12;
  --panel: #161a1f;
  --panel2: #1e232a;
  --line: #2a3038;
  --text: #eef1f4;
  --muted: #8c96a3;
  --accent: #e82127;
  --gold: #f5c542;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 18px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }
input { font: inherit; color: var(--text); }
.muted { color: var(--muted); }
.error { color: #ff6b6b; min-height: 1.4em; }

/* Giriş */
#login { display: grid; place-items: center; height: 100%; padding: 16px; }
.card { width: min(460px, 100%); background: var(--panel); padding: 32px; border-radius: 16px;
  display: grid; gap: 14px; }
.card h1 { margin: 0; }
.card label { display: grid; gap: 6px; font-size: 15px; color: var(--muted); }
.card input { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; font-size: 20px; }
.primary { background: var(--accent); padding: 16px; border-radius: 10px; font-weight: 600; font-size: 20px; }
.ghost { background: transparent; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.small { font-size: 15px; }

/* Ana ekran */
#main { display: flex; height: 100%; }
#sidebar { width: 260px; flex: none; background: var(--panel); display: flex; flex-direction: column;
  border-right: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 22px; padding: 18px 20px; color: var(--accent); }
#cats { flex: 1; overflow-y: auto; padding: 0 10px 10px; }
#cats button { display: flex; justify-content: space-between; width: 100%; text-align: left;
  background: transparent; padding: 14px 12px; border-radius: 10px; font-size: 17px; }
#cats button .n { color: var(--muted); font-size: 14px; }
#cats button.active { background: var(--panel2); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
#logoutBtn { margin: 10px; }
#content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#topbar { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
#search { flex: 1; max-width: 560px; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 16px; font-size: 19px; }
#grid { flex: 1; overflow-y: auto; padding: 16px; display: grid; gap: 12px; align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.ch { position: relative; background: var(--panel); border-radius: 12px; padding: 12px; min-height: 120px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.ch:active { background: var(--panel2); }
.ch img { width: 96px; height: 54px; object-fit: contain; }
.ch .ph { width: 96px; height: 54px; display: grid; place-items: center; background: var(--panel2);
  border-radius: 8px; color: var(--muted); font-weight: 700; }
.ch .name { font-size: 16px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ch .star { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; background: transparent;
  color: var(--muted); font-size: 22px; }
.ch .star.on { color: var(--gold); }
.empty { grid-column: 1 / -1; color: var(--muted); padding: 40px; text-align: center; }

/* Oynatıcı: Fullscreen API yerine CSS ile tam ekran */
#player { position: fixed; inset: 0; background: #000; z-index: 10; }
#video { width: 100%; height: 100%; object-fit: contain; background: #000; }
#overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between;
  transition: opacity .3s; }
#overlay.hide { opacity: 0; }
.bar { display: flex; align-items: center; gap: 12px; padding: 16px; }
.bar.top { background: linear-gradient(#000c, #0000); }
.bar.bottom { background: linear-gradient(#0000, #000c); justify-content: center; }
#nowTitle { flex: 1; font-size: 22px; font-weight: 600; text-align: center; }
.ctl { background: #fff2; backdrop-filter: blur(6px); border-radius: 12px; padding: 14px 22px; font-size: 20px; min-width: 64px; }
#favBtn.on { color: var(--gold); }
#playerMsg { align-self: center; background: #000a; padding: 14px 22px; border-radius: 12px; font-size: 20px; max-width: 80%; text-align: center; }
#playerMsg:empty { display: none; }

@media (max-width: 700px) {
  #sidebar { width: 170px; }
  #grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .ctl { padding: 12px 14px; font-size: 17px; }
}
