:root {
  --bg: #111318; --panel: #1b1e25; --line: #2a2e38; --text: #e9eaee; --muted: #9298a6;
  --accent: #f5c518; --accent-ink: #111; --ok: #4cc38a; --danger: #e5484d; --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; }
img { display: block; max-width: 100%; }
main { max-width: 1100px; margin: 0 auto; padding: 0 16px 48px; position: relative; }

/* üst çubuk */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; gap: 10px; align-items: center;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(17,19,24,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; text-decoration: none; white-space: nowrap; }
.search { flex: 1; }
.search input {
  width: 100%; padding: 9px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font-size: 16px;
}
.logout button { background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; padding: 4px; }

/* sekmeler */
.tabs { display: flex; gap: 8px; margin: 16px 0; }
.tabs a {
  flex: 1; text-align: center; padding: 10px; border-radius: var(--radius); text-decoration: none;
  background: var(--panel); color: var(--muted); font-weight: 600; border: 1px solid var(--line);
}
.tabs a.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tabs a span { opacity: .7; font-weight: 400; margin-left: 4px; }

/* afiş ızgarası */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px 10px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 16px; } }
.grid:empty { display: none; }
.card { text-decoration: none; min-width: 0; }
.card img { aspect-ratio: 2/3; width: 100%; object-fit: cover; border-radius: 8px; background: var(--panel); }
.card .t { display: block; font-size: 13px; font-weight: 600; margin-top: 6px; line-height: 1.3;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card .s { display: block; font-size: 12px; color: var(--muted); }
.month { font-size: 14px; color: var(--muted); text-transform: capitalize; margin: 22px 0 10px; font-weight: 600; }
.month:first-of-type { margin-top: 4px; }

.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.h { font-size: 16px; color: var(--muted); font-weight: 600; margin: 16px 0 8px; }

/* arama sonuçları */
.results { list-style: none; padding: 0; margin: 0; }
.results li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.r-main { flex: 1; display: flex; gap: 12px; text-decoration: none; min-width: 0; }
.r-main img { width: 56px; aspect-ratio: 2/3; object-fit: cover; border-radius: 6px; flex: none; background: var(--panel); }
.r-main span { min-width: 0; }
.r-main em { color: var(--muted); font-style: normal; }
.r-main small { display: block; color: var(--muted); font-size: 13px; }
.r-main .ov { font-size: 12px; margin-top: 2px; }
.badge { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--panel); color: var(--muted); white-space: nowrap; }
.badge.ok { color: var(--ok); }

/* butonlar */
.btn {
  display: inline-block; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn.danger { color: var(--danger); }
.btn.imdb { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* film sayfası */
.backdrop { position: absolute; inset: 0 0 auto 0; height: 300px; overflow: hidden; z-index: -1; }
.backdrop img { width: 100%; height: 100%; object-fit: cover; opacity: .28; }
.backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 30%, var(--bg)); }
.film { display: flex; gap: 16px; padding-top: 24px; align-items: flex-end; }
.film .poster { width: 120px; flex: none; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.5); aspect-ratio: 2/3; object-fit: cover; }
@media (min-width: 700px) { .film .poster { width: 220px; } .film { padding-top: 60px; gap: 28px; } }
.film h1 { font-size: 22px; line-height: 1.2; margin: 0 0 4px; }
@media (min-width: 700px) { .film h1 { font-size: 32px; } }
.film h1 span { color: var(--muted); font-weight: 400; }
.orig { color: var(--muted); margin: 0 0 6px; font-style: italic; }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 4px; }
.links { display: flex; gap: 8px; margin: 10px 0 0; }

.box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.box h2 { font-size: 17px; margin: 0 0 12px; }
.overview { margin: 0; }
.flash { background: rgba(76,195,138,.12); color: var(--ok); border-radius: 10px; padding: 10px 14px; margin: 16px 0 0; }
.watched { color: var(--ok); margin: 0 0 8px; }
.note { color: var(--muted); margin: 0 0 8px; font-style: italic; }
.muted { color: var(--muted); margin: 0 0 8px; font-size: 14px; }
details summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.watch-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.watch-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.watch-form .full, .watch-form button { grid-column: 1 / -1; }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%;
}
input[type=date] { min-height: 44px; color-scheme: dark; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.actions .del { margin-left: auto; }

.cast { list-style: none; padding: 0; margin: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 92px;
  gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.cast li { scroll-snap-align: start; font-size: 13px; line-height: 1.25; }
.cast img { width: 92px; aspect-ratio: 2/3; object-fit: cover; border-radius: 8px; margin-bottom: 6px; background: var(--bg); }
.cast b { display: block; }
.cast small { color: var(--muted); }

.posters { display: grid; grid-auto-flow: column; grid-auto-columns: 130px; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.posters img { width: 130px; aspect-ratio: 2/3; object-fit: cover; border-radius: 8px; }

/* giriş */
.login { max-width: 320px; margin: 18vh auto 0; text-align: center; }
.login h1 { margin-bottom: 24px; }
.login form { display: grid; gap: 12px; }
.error { color: var(--danger); margin: 0; }
.flash.err { background: rgba(229,72,77,.12); color: var(--danger); }
