:root {
  --bg: #0b0c0f;
  --surface: #16181d;
  --surface-2: #20232a;
  --border: #2a2e37;
  --text: #f2f3f5;
  --muted: #8b919c;
  --accent: #e5383b;
  --accent-text: #fff;
  --star: #f5c542;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---------- Giriş ---------- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login form {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
}
.login h1 { margin: 0 0 8px; font-size: 40px; letter-spacing: -0.02em; }
.login p { margin: 0; color: var(--muted); }
.login input {
  height: 64px;
  padding: 0 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 22px;
}
.login input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.login .error { color: var(--accent); min-height: 1.4em; }
.login .brand { width: 220px; margin: 28px auto 0; }
.login .pw { position: relative; }
.login .pw input { width: 100%; padding-right: 110px; }
.login .pw button {
  position: absolute;
  top: 8px;
  right: 8px;
  bottom: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;
}

.btn {
  height: 64px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-text);
  font-size: 20px;
  font-weight: 600;
}

.logo span { color: var(--accent); }

/* ---------- Üst bar ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  padding: 16px 24px 12px;
  display: grid;
  gap: 12px;
}
.top-row { display: flex; align-items: center; gap: 16px; }
.top .logo { font-size: 28px; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.search {
  flex: 1;
  height: 52px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 18px;
  min-width: 0;
}
.search:focus { outline: 2px solid var(--accent); border-color: transparent; }
.ghost {
  height: 52px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
}

.chips { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 17px;
}
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .count { color: var(--muted); margin-left: 6px; font-size: 14px; }
.chip[aria-pressed="true"] .count { color: inherit; opacity: 0.6; }

/* ---------- Kanal ızgarası ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 8px 24px 40px;
}
.card {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0;
  overflow: hidden;
  text-align: left;
}
.card:active { transform: scale(0.98); }
.card .thumb {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
}
.card img {
  position: absolute;
  inset: 22px 28px 6px;
  width: calc(100% - 56px);
  height: calc(100% - 28px);
  object-fit: contain;
}
.card .initials { font-size: 34px; font-weight: 700; color: var(--muted); }
.card .meta { padding: 10px 14px 12px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.card .name { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge {
  flex: none;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
}
.star {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 48px;
  height: 48px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}
.star[aria-pressed="true"] { color: var(--star); }

.empty { padding: 60px 24px; color: var(--muted); text-align: center; grid-column: 1 / -1; }

/* ---------- Oynatıcı ---------- */
.player {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #000;
  display: none;
}
.player.open { display: block; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player .bar {
  position: absolute;
  inset: 0 0 auto 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 40px;
  background: linear-gradient(#000c, transparent);
  transition: opacity 0.3s;
}
.player .title { flex: 1; font-size: 22px; font-weight: 600; }
.player .title small { color: var(--muted); font-weight: 400; margin-left: 8px; font-size: 15px; }
.icon-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 0;
  background: #ffffff1f;
  color: #fff;
  font-size: 26px;
  display: grid;
  place-items: center;
}
.player .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 80px;
  height: 120px;
  border-radius: var(--radius);
  font-size: 40px;
  transition: opacity 0.3s;
}
.player .prev { left: 16px; }
.player .next { right: 16px; }
.player.idle .bar, .player.idle .nav { opacity: 0; pointer-events: none; }
.player.idle { cursor: none; }

.status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  text-align: center;
}
.status > div { display: grid; gap: 16px; justify-items: center; pointer-events: auto; }
.status[hidden] { display: none; }
.status .msg { font-size: 20px; color: #ddd; }
.status .btn { padding: 0 28px; }
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #ffffff33;
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Telefon ---------- */
@media (max-width: 640px) {
  .top { padding: 12px 16px 8px; }
  .top-row { flex-wrap: wrap; gap: 10px; }
  .top-row .logo { flex: 1; font-size: 24px; }
  .search { order: 3; flex-basis: 100%; height: 46px; }
  .ghost { height: 44px; }
  .chip { height: 42px; padding: 0 16px; font-size: 15px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; padding: 8px 16px 32px; }
  .card .meta { padding: 8px 10px 10px; font-size: 15px; }
  .player .nav { width: 52px; height: 88px; font-size: 32px; }
  .icon-btn { width: 52px; height: 52px; font-size: 22px; }
  .player .title { font-size: 18px; }
}
