:root {
  --bg: #0d0f14;
  --bg2: #141824;
  --card: #191e2c;
  --card2: #1f2638;
  --line: #2a3148;
  --text: #e8eaf2;
  --muted: #8b93ad;
  --gold: #f5c518;
  --red: #e50914;
  --green: #2ecc71;
  --blue: #00a8e8;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(229,9,20,.14), transparent),
    radial-gradient(900px 400px at 10% -5%, rgba(245,197,24,.08), transparent),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
a { color: inherit; text-decoration: none; }
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 24px 16px 60px; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px;
  background: rgba(13,15,20,.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo { font-size: 22px; font-weight: 800; color: var(--gold); white-space: nowrap; }
.logo small { font-size: 11px; font-weight: 300; color: var(--muted); margin-inline-start: 6px; }
.topbar nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar nav > a { color: var(--muted); font-size: 14px; padding: 6px 4px; border-bottom: 2px solid transparent; }
.topbar nav > a:hover { color: var(--text); }
.topbar nav > a.cta {
  color: #111; background: var(--gold); border-radius: 20px; padding: 6px 14px; font-weight: 600;
}
.topbar nav > a.cta:hover { filter: brightness(1.1); }

/* ---------- generic ---------- */
.btn {
  display: inline-block; cursor: pointer; border: none; border-radius: 10px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 18px; color: #111; background: var(--gold);
  transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.danger { background: var(--red); color: #fff; }
.btn:disabled { opacity: .5; cursor: wait; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

input, textarea, select {
  width: 100%; font-family: inherit; font-size: 14px;
  background: var(--bg2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; outline: none;
}
input:focus, textarea:focus { border-color: var(--gold); }
textarea { resize: vertical; min-height: 80px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 18px;
}
.page-title { font-size: 26px; font-weight: 800; margin: 8px 0 4px; }
.page-sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }

.chip {
  display: inline-block; font-size: 11px; padding: 2px 10px; border-radius: 20px;
  background: var(--card2); border: 1px solid var(--line); color: var(--muted);
}
.chip.gold { color: var(--gold); border-color: #574a12; }
.chip.blue { color: var(--blue); border-color: #12495c; }

/* ---------- item cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.item-card { display: flex; flex-direction: column; gap: 10px; transition: transform .15s, border-color .15s; cursor: pointer; }
.item-card:hover { transform: translateY(-3px); border-color: #3a4364; }
.item-head { display: flex; gap: 14px; align-items: flex-start; }
.item-emoji {
  flex: none; width: 64px; height: 64px; border-radius: 14px; font-size: 34px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--card2), #12151f); border: 1px solid var(--line);
}
.item-title { font-size: 17px; font-weight: 700; line-height: 1.4; }
.item-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.item-summary { color: var(--muted); font-size: 13.5px; line-height: 1.9; }
.item-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }

.vote { display: flex; gap: 6px; }
.vote button {
  cursor: pointer; font-family: inherit; font-size: 13px;
  background: var(--bg2); color: var(--muted);
  border: 1px solid var(--line); border-radius: 20px; padding: 4px 12px;
}
.vote button:hover { color: var(--text); }
.vote .on-up { color: var(--green); border-color: var(--green); }
.vote .on-down { color: var(--red); border-color: var(--red); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 8px; margin: 14px 0 18px; flex-wrap: wrap; }
.tabs button {
  cursor: pointer; font-family: inherit; font-size: 13.5px;
  background: var(--card); color: var(--muted); border: 1px solid var(--line);
  border-radius: 20px; padding: 7px 16px;
}
.tabs button.active { background: var(--gold); color: #111; font-weight: 700; border-color: var(--gold); }

/* ---------- hero ---------- */
.hero {
  border-radius: 20px; padding: 34px 28px; margin-bottom: 10px;
  background: linear-gradient(120deg, rgba(229,9,20,.25), rgba(245,197,24,.10) 55%, transparent), var(--card);
  border: 1px solid var(--line);
}
.hero h1 { font-size: 30px; font-weight: 800; margin-bottom: 8px; }
.hero h1 em { color: var(--gold); font-style: normal; }
.hero p { color: var(--muted); max-width: 640px; line-height: 2; }

/* ---------- comments ---------- */
.comment { display: flex; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card2); border: 2px solid var(--line);
}
.avatar.sm { width: 30px; height: 30px; font-size: 15px; }
.comment-body { flex: 1; }
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.comment-text { font-size: 14px; line-height: 1.9; }

/* spoiler */
.spoiler-wrap { position: relative; overflow: hidden; border-radius: 10px; }
.spoiler-wrap .comment-text { filter: blur(6px); user-select: none; pointer-events: none; }
.spoiler-cover {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(229,9,20,.12); backdrop-filter: blur(1px);
  font-size: 13px; color: #ffb3b8; cursor: pointer;
}
.spoiler-cover:hover { background: rgba(229,9,20,.2); }

.spoiler-note {
  display: none; margin-top: 8px; font-size: 12.5px; line-height: 1.8;
  border-radius: 10px; padding: 8px 12px;
}
.spoiler-note.warn { display: block; background: rgba(229,9,20,.15); border: 1px solid rgba(229,9,20,.4); color: #ffb3b8; }
.spoiler-note.okay { display: block; background: rgba(46,204,113,.1); border: 1px solid rgba(46,204,113,.35); color: #a8f0c8; }
.check-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.check-row input { width: auto; }

/* ---------- chat ---------- */
.chat-box { display: flex; flex-direction: column; height: 480px; }
.chat-msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 6px 2px; }
.chat-msg { display: flex; gap: 8px; font-size: 13.5px; line-height: 1.8; }
.chat-msg .who { font-weight: 700; white-space: nowrap; }
.chat-msg .time { color: var(--muted); font-size: 10.5px; margin-inline-start: 6px; }
.chat-input { display: flex; gap: 8px; margin-top: 10px; }
.chat-input input { flex: 1; }

/* ---------- profile / forms ---------- */
.form { max-width: 620px; margin: 0 auto; }
.form input, .form textarea, .form select { margin-bottom: 2px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.emoji-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.emoji-pick button {
  cursor: pointer; font-size: 20px; width: 42px; height: 42px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
}
.emoji-pick button.sel { border-color: var(--gold); background: rgba(245,197,24,.12); }

.msg { margin-top: 12px; font-size: 13.5px; border-radius: 10px; padding: 10px 14px; display: none; }
.msg.error { display: block; background: rgba(229,9,20,.15); border: 1px solid rgba(229,9,20,.4); color: #ffb3b8; }
.msg.ok { display: block; background: rgba(46,204,113,.12); border: 1px solid rgba(46,204,113,.4); color: #a8f0c8; }

.section { margin-top: 34px; }
.detail-head { display: flex; gap: 20px; align-items: flex-start; }
.detail-emoji {
  flex: none; width: 110px; height: 110px; border-radius: 20px; font-size: 58px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--card2), #12151f); border: 1px solid var(--line);
}
.empty { text-align: center; color: var(--muted); padding: 50px 0; font-size: 15px; }

/* ---------- live search autocomplete ---------- */
.ac-wrap { position: relative; }
.ac-list {
  display: none; position: absolute; top: 100%; inset-inline: 0; z-index: 30;
  background: var(--card2); border: 1px solid var(--line); border-radius: 12px;
  margin-top: 4px; overflow: hidden; box-shadow: 0 12px 30px rgba(0,0,0,.5);
}
.ac-list.open { display: block; }
.ac-item {
  display: flex; gap: 10px; align-items: center; width: 100%; text-align: right;
  background: transparent; border: none; cursor: pointer; padding: 8px 12px;
  font-family: inherit; color: var(--text); border-bottom: 1px solid var(--line);
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: rgba(245,197,24,.1); }
.ac-item img { width: 34px; height: 50px; object-fit: cover; border-radius: 6px; flex: none; background: var(--bg2); }
.ac-noimg { width: 34px; height: 50px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex: none; background: var(--bg2); border-radius: 6px; }
.ac-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ac-t b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-t small { color: var(--muted); font-size: 11.5px; }
.ac-empty { padding: 12px; font-size: 13px; color: var(--muted); text-align: center; }
#s-picked { display: flex; gap: 12px; align-items: flex-start; }
.picked-poster { width: 64px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); flex: none; }

/* ---------- news (image cards) ---------- */
.news-img { width: 86px; height: 86px; object-fit: cover; border-radius: 12px; flex: none; background: var(--card2); border: 1px solid var(--line); }
.news-img.big { width: 120px; height: 120px; }
.news-strip .news-card { align-items: center; }
a.news-item { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 12px; color: inherit; }
a.news-item:hover { border-color: var(--gold); }

/* ---------- schedule table ---------- */
.table-wrap { overflow-x: auto; }
table.sched { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.sched th { text-align: right; color: var(--muted); font-weight: 600; font-size: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sched td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.sched tr:last-child td { border-bottom: none; }
.sched tbody tr:hover { background: rgba(245,197,24,.04); }
.day-chip { display: inline-block; background: rgba(245,197,24,.12); color: var(--gold); border: 1px solid #574a12; border-radius: 10px; padding: 3px 12px; font-weight: 700; font-size: 12.5px; white-space: nowrap; }

/* ---------- slider (now playing) ---------- */
.slider { position: relative; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); min-height: 300px; background: var(--card); }
.slides { position: relative; min-height: 300px; }
.slide { display: none; }
.slide.active { display: flex; animation: fadeIn .5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: scale(1.015); } to { opacity: 1; transform: none; } }
.slide-cover { flex: none; width: 300px; }
.slide-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.slide-info { flex: 1; padding: 34px 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  background: linear-gradient(90deg, transparent, rgba(13,15,20,.4) 60%), radial-gradient(600px 300px at 90% 0%, rgba(229,9,20,.12), transparent); }
.slide-info h2 { font-size: 20px; font-weight: 800; }
.slide-info p { color: var(--muted); line-height: 1.9; max-width: 520px; font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.slide-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.slide-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  background: rgba(13,15,20,.7); color: var(--text); border: 1px solid var(--line); font-size: 24px; line-height: 1;
}
.slide-arrow:hover { background: var(--gold); color: #111; }
.slide-arrow { opacity: 1; transition: opacity .2s, background .15s; }
.slide-arrow:hover { opacity: 1; }
.slide-arrow.prev { left: 12px; }
.slide-arrow.next { right: 12px; }
/* row arrows on hover */
.row-scroll { position: relative; }
.slide-dots { position: absolute; bottom: 12px; right: 24px; display: flex; gap: 6px; z-index: 5; }
.slide-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--line); cursor: pointer; transition: background .2s, width .2s; }
.slide-dots span.on { background: var(--gold); width: 22px; border-radius: 6px; }

/* ---------- poster rows ---------- */
.row-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.row-head h2 { font-size: 19px; }
.row-scroll { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x proximity; }
.row-scroll::-webkit-scrollbar { height: 8px; }
.row-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.poster-card { flex: none; width: 168px; scroll-snap-align: start; transition: transform .15s; }
.poster-card:hover { transform: translateY(-4px); }
.p-cover { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 2/3; background: var(--card2); }
.p-cover img { width: 100%; height: 100%; display: block; }
.p-badge { position: absolute; top: 8px; right: 8px; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 12px; }
.p-badge.quality { background: rgba(0,168,232,.9); color: #fff; }
.p-badge.buzz { background: rgba(229,9,20,.9); color: #fff; }
.p-badge.now { background: rgba(245,197,24,.92); color: #111; }
.p-badge.gem { background: rgba(46,204,113,.9); color: #08240f; }
.p-title { font-size: 13.5px; font-weight: 700; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; direction: ltr; }
.p-sub { font-size: 11px; color: var(--muted); text-align: left; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-meta { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
.p-meta .chip { font-size: 10px; padding: 1px 8px; }

/* ---------- news ---------- */
.news-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.news-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  transition: border-color .15s;
}
.news-card:hover { border-color: var(--gold); }
.news-emoji { flex: none; width: 40px; height: 40px; font-size: 22px; display: flex; align-items: center; justify-content: center; background: var(--card2); border-radius: 10px; }
.news-emoji.big { width: 52px; height: 52px; font-size: 28px; border-radius: 14px; }
.news-title { font-size: 13.5px; font-weight: 700; line-height: 1.7; margin-bottom: 4px; }
.news-item { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 12px; }

/* ---------- rating boxes ---------- */
.rates { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.rate-box { min-width: 110px; text-align: center; border-radius: 12px; padding: 10px 16px; background: var(--bg2); border: 1px solid var(--line); }
.rate-val { font-size: 21px; font-weight: 800; }
.rate-label { font-size: 11px; color: var(--muted); margin-top: 3px; }
.rate-box.imdb { border-color: #574a12; } .rate-box.imdb .rate-val { color: var(--gold); }
.rate-box.google .rate-val { color: #6ea8ff; }
.rate-box.meta .rate-val { color: #ffd166; }
.rate-box.rt .rate-val { color: #ff6b57; }

/* ---------- detail cover ---------- */
.detail-cover { flex: none; width: 210px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.detail-cover img { display: block; width: 100%; }

.footer { text-align: center; padding: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; }

/* ============================================================

/* ---------- shell layout (main + left social bar) ---------- */
.shell {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px;
  width: 100%; max-width: 1280px; margin: 0 auto;
  padding: 24px 16px 60px; align-items: start;
}
main { max-width: none; padding: 0; }
.social-bar {
  position: sticky; top: 70px;
  display: flex; flex-direction: column; gap: 14px;
}
.tiny { font-size: 11px; }
.btn.small { padding: 6px 12px; font-size: 12.5px; }
.btn.tiny { padding: 3px 10px; font-size: 11.5px; border-radius: 16px; }

/* ---------- nav badges ---------- */
.nav-ico { position: relative; font-size: 17px; }
.nav-ico .badge, .dm-side .badge {
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 10px; padding: 1px 6px; line-height: 1.5;
}
.nav-ico .badge { position: absolute; top: -6px; left: -10px; }

/* ---------- social bar cards ---------- */
.sb-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px;
}
.sb-card h4 { font-size: 13.5px; margin-bottom: 10px; }
.sb-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; align-items: center; }
.sb-story {
  background: none; border: none; cursor: pointer; flex: none;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-family: inherit; color: var(--text); padding: 0;
}
.sb-story small { font-size: 10.5px; color: var(--muted); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-ring {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  border: 2.5px solid transparent;
  background: linear-gradient(var(--card), var(--card)) padding-box,
              linear-gradient(135deg, var(--gold), var(--red) 60%, #8e44ad) border-box;
}
.sb-ring.add { font-size: 22px; color: var(--gold); }
.sb-ring.seen {
  background: linear-gradient(var(--card2), var(--card2)) padding-box, var(--line) border-box;
  color: var(--muted);
}
.sb-me { display: flex; gap: 10px; align-items: center; }
.sb-me b { display: block; }
.sb-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.sb-actions .btn { flex: 1; text-align: center; }
.sb-promo { font-size: 14px; line-height: 1.8; }
.sb-user {
  display: flex; gap: 8px; align-items: center; padding: 7px 0;
  border-bottom: 1px solid var(--line); color: inherit;
}
.sb-user:last-of-type { border-bottom: none; }
.sb-u-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.5; }
.sb-u-info b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-cta {
  display: block; text-align: center; padding: 12px; border-radius: 14px; font-weight: 700; color: var(--gold);
  background: linear-gradient(120deg, rgba(229,9,20,.18), rgba(245,197,24,.12)), var(--card);
  border: 1px solid var(--line); transition: border-color .15s;
}
.sb-cta:hover { border-color: var(--gold); }

/* ---------- overlay & modal ---------- */
#overlay {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(5,7,12,.82); backdrop-filter: blur(4px);
}
#overlay.open { display: flex; }
.modal {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px; width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
  animation: fadeIn .25s ease;
}
.modal.list { max-width: 380px; }
.modal h3 { margin-bottom: 6px; }

/* ---------- story viewer ---------- */
.modal.story { max-width: 420px; padding: 0; background: transparent; border: none; overflow: visible; }
.story-view {
  position: relative; border-radius: 18px; overflow: hidden;
  background: #05070c; max-height: 82vh; display: flex; flex-direction: column;
  border: 1px solid var(--line);
}
.story-view img, .story-view video { width: 100%; max-height: 62vh; object-fit: contain; background: #000; }
.story-progress { display: flex; gap: 4px; padding: 10px 12px 0; }
.story-progress i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.25); }
.story-progress i.done { background: #fff; }
.story-head { display: flex; gap: 8px; align-items: center; padding: 10px 12px; color: #fff; }
.story-close {
  margin-inline-start: auto; background: rgba(255,255,255,.15); border: none;
  color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 14px;
}
.story-caption { padding: 10px 14px 14px; color: #fff; font-size: 14px; line-height: 1.9; }
.story-text-only {
  padding: 40px 24px; font-size: 20px; line-height: 2.1; color: #fff;
  min-height: 220px; display: flex; align-items: center; justify-content: center; text-align: center;
}

/* ---------- feed composer ---------- */
.composer textarea { min-height: 72px; }
.composer-bar { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.file-btn { cursor: pointer; }
.post-ref-chip {
  margin-top: 8px; font-size: 13px; color: var(--gold);
  background: rgba(245,197,24,.07); border: 1px solid #574a12;
  border-radius: 10px; padding: 6px 10px; display: inline-block;
}
.feed-stories { margin-bottom: 16px; }

/* ---------- posts ---------- */
.post { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.post-head { display: flex; gap: 10px; align-items: center; }
.post-who { flex: 1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.post-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.post-del:hover { color: var(--red); }
.post-text { font-size: 14.5px; line-height: 2; white-space: pre-wrap; }
.post-media {
  width: 100%; max-height: 480px; object-fit: cover;
  border-radius: 14px; border: 1px solid var(--line); background: #000;
}
.post-actions { display: flex; gap: 8px; align-items: center; }
.post-actions button {
  cursor: pointer; font-family: inherit; font-size: 13px;
  background: var(--bg2); color: var(--muted);
  border: 1px solid var(--line); border-radius: 20px; padding: 5px 14px;
}
.post-actions button:hover { color: var(--text); }
.p-like.on { color: var(--green); border-color: var(--green); }
.p-dislike.on { color: var(--red); border-color: var(--red); }
.post-ref {
  align-self: flex-start; font-size: 13px; color: var(--gold);
  border: 1px solid #574a12; border-radius: 10px; padding: 4px 10px;
  background: rgba(245,197,24,.06);
}
.post-comments { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.pcomment { display: flex; gap: 8px; font-size: 13px; line-height: 1.8; align-items: flex-start; }
.pcomment-form { display: flex; gap: 6px; margin-top: 4px; }
.pcomment-form input { flex: 1; }

/* ---------- DM ---------- */
.dm-list { display: flex; flex-direction: column; gap: 10px; }
a.dm-row { display: flex; gap: 12px; align-items: center; color: inherit; }
a.dm-row:hover { border-color: var(--gold); }
.dm-row.unread { border-color: var(--gold); }
.dm-info { flex: 1; min-width: 0; }
.dm-last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.dm-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.dm-thread-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.dm-thread .chat-box { height: 58vh; }
.dm-msg { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.dm-msg.mine { align-items: flex-start; }
.dm-bubble {
  max-width: 78%; padding: 8px 14px; border-radius: 16px;
  background: var(--card2); font-size: 14px; line-height: 1.9;
  border: 1px solid var(--line); white-space: pre-wrap;
}
.dm-msg.mine .dm-bubble {
  background: linear-gradient(135deg, #4a3a10, #6b5a12);
  border-color: #574a12; color: #ffe9a8;
}
.dm-bubble.sp { filter: blur(6px); user-select: none; cursor: pointer; }

/* ---------- notifications ---------- */
.notif-row {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  margin-bottom: 8px; color: inherit; font-size: 14px;
}
.notif-row.unread { border-color: #574a12; background: rgba(245,197,24,.05); }
.rec-row { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; color: inherit; }
.rec-row:hover { border-color: var(--gold); }
.rec-cover { width: 44px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; }

/* ---------- profile ---------- */
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.profile-info { flex: 1; min-width: 220px; }
.profile-stats { display: flex; gap: 16px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.stat { background: none; border: none; color: var(--muted); font-size: 13px; font-family: inherit; padding: 0; }
button.stat { cursor: pointer; }
.stat b { color: var(--text); font-size: 15px; margin-inline-end: 4px; }
button.stat:hover b { color: var(--gold); }
.profile-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.profile-actions .btn { text-align: center; }

/* ---------- admin panel ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.stat-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 10px; }
.stat-card b { font-size: 24px; color: var(--gold); }
.stat-card span { font-size: 12px; color: var(--muted); }

/* ---------- responsive ---------- */

/* ============================================================

/* small poster cover on suggestion cards (was huge — fixed) */
.item-cover {
  flex: none; width: 64px; height: 90px; border-radius: 10px; overflow: hidden;
  background: linear-gradient(135deg, var(--card2), #12151f); border: 1px solid var(--line);
}
.item-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* photo avatars */
.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

/* poster grid for section pages */
.grid-posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.grid-posters .poster-card { width: auto; }

/* language button */
#lang-btn { margin-inline-start: 4px; color: var(--gold); font-weight: 700; }

/* wider detail cover inside item page */
/* ---------- round 3: filters, schedule thumbs, 3-col grid ---------- */
.ww-filters { display: flex; gap: 10px; margin: 0 0 16px; flex-wrap: wrap; }
.ww-filters select { width: auto; min-width: 170px; }

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.sched-show { display: flex; gap: 10px; align-items: center; min-width: 180px; }
.sched-thumb { width: 34px; height: 48px; object-fit: cover; border-radius: 6px; flex: none; border: 1px solid var(--line); background: var(--card2); }
.sched-show-info b { font-size: 13.5px; }
.sched-show-info small { display: block; line-height: 1.5; }

/* prevent browser scroll-anchoring jumps when content renders/loads */
body { overflow-anchor: none; }

/* ---------- pagination ---------- */
.pager { display: flex; gap: 10px; justify-content: center; align-items: center; margin: 22px 0; flex-wrap: wrap; }
.pager .btn[disabled] { opacity: .35; cursor: default; }
.pager .muted.small { font-size: 12.5px; min-width: 70px; text-align: center; }

/* ---------- slider: uniform cover size so layout never jumps ---------- */
.slide-cover { width: 300px; min-width: 300px; height: 100%; }
.slide-cover img { width: 100%; height: 100%; min-height: 300px; max-height: 460px; object-fit: cover; object-position: center top; display: block; }
.slide { align-items: stretch; }
.slide-info { min-height: 300px; }

/* ---------- slider: fixed height, never resizes between slides ---------- */
.slider, .slides { height: 300px; min-height: 300px; }
.slide { height: 300px; }
.slide-cover { height: 300px; width: 210px; min-width: 210px; }
.slide-cover img { height: 300px; width: 210px; min-height: 0; max-height: none; object-fit: cover; }
.slide-info { height: 300px; overflow: hidden; padding: 20px 24px; }

/* ---------- schedule table fixed height ---------- */
.hm-sched-wrap { min-height: 320px; }
.p-badge.mini { background: rgba(142,68,173,.9); color: #fff; }

/* ---------- section link buttons ---------- */
.sec-btn { flex: none; font-size: 12.5px; font-weight: 700; color: var(--gold); background: rgba(245,197,24,.08); border: 1px solid #574a12; border-radius: 18px; padding: 6px 14px; transition: background .15s, transform .1s; white-space: nowrap; }
.sec-btn:hover { background: rgba(245,197,24,.18); transform: translateY(-1px); }

/* ---------- cast strip / person profile / favorites ---------- */
.cast-block { margin-top: 18px; }
.cast-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.cast-card { flex: none; width: 108px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.cast-img { width: 96px; height: 128px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); background: var(--card2); }
.cast-img.noimg { display: flex; align-items: center; justify-content: center; font-size: 34px; }
.cast-card small b { font-size: 12px; display: block; }
a.cast-card:hover .cast-img { border-color: var(--gold); }
.person-photo { width: 130px; height: 180px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); }
.btn.gold-fav { background: linear-gradient(120deg, #f5c518, #e50914); color: #fff; }
.nav-fav, #nav-fav { color: var(--muted); font-size: 14px; }
#nav-fav:hover { color: var(--text); }

.sec-btn.gold { background: linear-gradient(120deg, rgba(245,197,24,.2), rgba(229,9,20,.15)); border-color: var(--gold); color: var(--gold); }
.sec-btn.gold:hover { background: rgba(245,197,24,.3); }

/* ---------- topbar search ---------- */
.top-search-wrap { position: relative; }
.top-search-wrap input { width: 200px; padding: 6px 12px; font-size: 13px; border-radius: 18px; background: var(--bg2); border: 1px solid var(--line); color: var(--text); }
.top-search-wrap input:focus { border-color: var(--gold); width: 260px; }
.top-search-wrap .ac-list { top: 100%; inset-inline: 0; }

/* ---------- beautiful calendar grid ---------- */
.sched-calendar table.sched { border-collapse: collapse; }
.sched-calendar .sched th { background: var(--bg2); color: var(--gold); font-weight: 700; font-size: 13px; padding: 12px 16px; border-bottom: 2px solid var(--gold); }
.sched-calendar .sched td { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sched-calendar .sched td[rowspan] { background: rgba(245,197,24,.04); border-inline-end: 2px solid var(--gold); }
.sched-calendar .sched tr:hover td { background: rgba(245,197,24,.05); }
.sched-calendar .sched tr:last-child td { border-bottom: none; }
.sched-calendar .sched .day-chip { background: linear-gradient(120deg, rgba(245,197,24,.15), rgba(229,9,20,.1)); border: 1px solid var(--gold); color: var(--gold); font-size: 14px; padding: 8px 18px; border-radius: 12px; }
.sched-calendar .sched .sched-thumb { width: 42px; height: 60px; border-radius: 8px; }

/* ---------- login required modal ---------- */
#login-required-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: rgba(5,7,12,.85); backdrop-filter: blur(6px); }
.login-req-box { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 36px; max-width: 420px; text-align: center; animation: fadeIn .3s ease; }
.login-req-icon { font-size: 48px; margin-bottom: 12px; }
.login-req-box h2 { font-size: 19px; margin-bottom: 10px; }
.login-req-box p { color: var(--muted); font-size: 14px; line-height: 2; margin-bottom: 20px; }
.login-req-btns { display: flex; gap: 10px; justify-content: center; }
.login-req-btn { min-width: 140px; text-align: center; }

/* ============================================================

/* ---------- topbar: stack on mobile, horizontal scroll nav ---------- */

/* ---------- shell: social bar below content on mobile ---------- */

/* ---------- hero/slider ---------- */

/* ---------- grid: 1 col on mobile, 2 on tablet ---------- */

/* ---------- sections & rows ---------- */

/* ---------- schedule table: horizontal scroll, larger touch targets ---------- */

/* ---------- detail page (movie/series profile) ---------- */

/* ---------- comments & chat ---------- */

/* ---------- profile page ---------- */

/* ---------- forms & modals ---------- */

/* ---------- dm & notifications ---------- */

/* ---------- pagination ---------- */

/* ---------- admin panel ---------- */

/* ---------- login modal ---------- */

/* ---------- footer ---------- */

/* ---------- touch: larger tap targets ---------- */

/* ---------- tablet (768-1024) ---------- */

/* ---------- landscape phone ---------- */

/* ============================================================

/* ---------- ≤1024px: tablet & small desktop ---------- */

/* ---------- ≤768px: large phone / small tablet ---------- */

/* ---------- ≤640px: phone — app-like layout ---------- */

/* ---------- ≤480px: small phones ---------- */

/* ---------- touch devices ---------- */

/* ---------- landscape phone ---------- */

/* ---------- RESPONSIVE (mobile + tablet only) ---------- */

/* ============================================================
   COMPREHENSIVE RESPONSIVE — iPhone, Android, Tablet
   ============================================================ */

/* ---------- topbar: stack on mobile, horizontal scroll nav ---------- */
@media (max-width: 768px) {
  .topbar { flex-direction: column; padding: 10px 12px; gap: 6px; }
  .topbar .logo { font-size: 18px; }
  .topbar nav { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; justify-content: flex-start; gap: 10px; padding-bottom: 4px; }
  .topbar nav::-webkit-scrollbar { display: none; }
  .topbar nav > a { white-space: nowrap; font-size: 13px; padding: 4px 6px; }
  .topbar nav > a.cta { padding: 5px 12px; font-size: 12px; }
  .top-search-wrap { width: 100% !important; }
  .top-search-wrap input { width: 100% !important; }
}

/* ---------- shell: social bar below content on mobile ---------- */
@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr !important; }
  .social-bar { position: static !important; order: -1; margin-bottom: 10px; }
  .sb-card { padding: 10px; }
}

/* ---------- hero/slider ---------- */
@media (max-width: 640px) {
  .slider, .slides { height: auto !important; min-height: 0 !important; }
  .slide { flex-direction: column !important; height: auto !important; }
  .slide-cover { width: 100% !important; min-width: 0 !important; height: 280px !important; }
  .slide-cover img { width: 100% !important; height: 280px !important; object-fit: cover; }
  .slide-info { padding: 16px !important; min-height: 0 !important; height: auto !important; }
  .slide-info h2 { font-size: 18px !important; }
  .slide-info p { font-size: 13px !important; -webkit-line-clamp: 3 !important; }
  .slide-meta { font-size: 11px !important; }
  .slide-arrow { width: 32px !important; height: 32px !important; font-size: 18px !important; }
}

/* ---------- grid: 1 col on mobile, 2 on tablet ---------- */
@media (max-width: 640px) {
  .grid, .grid-3 { grid-template-columns: 1fr !important; }
  .grid-posters { grid-template-columns: repeat(3, 1fr) !important; gap: 10px; }
  .poster-card { width: 100% !important; }
}

/* ---------- sections & rows ---------- */
@media (max-width: 640px) {
  .section { margin-top: 24px; }
  .row-head h2 { font-size: 16px !important; }
  .row-scroll { -webkit-overflow-scrolling: touch; }
  .news-strip { grid-template-columns: 1fr !important; }
  .news-card { flex-direction: row; }
  .news-img { width: 70px !important; height: 70px !important; }
  .news-img.big { width: 90px !important; height: 90px !important; }
}

/* ---------- schedule table: horizontal scroll, larger touch targets ---------- */
@media (max-width: 768px) {
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .sched th { padding: 8px 10px; font-size: 11px; }
  .sched td { padding: 10px 10px; font-size: 13px; }
  .sched-thumb { width: 40px !important; height: 56px !important; }
  .sched-show-info b { font-size: 13px !important; }
  .day-chip { font-size: 12px !important; padding: 4px 12px !important; }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; justify-content: flex-start; padding-bottom: 4px; }
  .tabs button { white-space: nowrap; font-size: 12px; padding: 6px 12px; }
  .tabs::-webkit-scrollbar { display: none; }
  .ww-filters { flex-direction: column; }
  .ww-filters select { width: 100% !important; min-width: 0 !important; }
}

/* ---------- detail page (movie/series profile) ---------- */
@media (max-width: 640px) {
  .detail-head { flex-direction: column !important; }
  .detail-cover { width: 100% !important; max-width: 280px !important; margin: 0 auto !important; }
  .page-title { font-size: 20px !important; }
  .rates { flex-wrap: wrap; }
  .rate-box { min-width: 90px !important; padding: 8px 12px !important; }
  .rate-val { font-size: 17px !important; }
  .cast-row { gap: 8px; }
  .cast-card { width: 84px !important; }
  .cast-img { width: 76px !important; height: 100px !important; }
  .cast-card small b { font-size: 10.5px !important; }
}

/* ---------- comments & chat ---------- */
@media (max-width: 640px) {
  .comment { flex-direction: column; gap: 6px; }
  .chat-box { height: 420px !important; }
  .chat-input input { font-size: 14px !important; }
  .post-text { font-size: 14px !important; }
  .post-media { max-height: 350px !important; }
}

/* ---------- profile page ---------- */
@media (max-width: 640px) {
  .profile-head { flex-direction: column !important; text-align: center; }
  .profile-actions { flex-direction: row !important; flex-wrap: wrap; justify-content: center; }
  .profile-stats { justify-content: center !important; }
  .person-photo { width: 100px !important; height: 140px !important; }
}

/* ---------- forms & modals ---------- */
@media (max-width: 640px) {
  .form { max-width: 100% !important; padding: 14px !important; }
  .modal { max-width: 100% !important; margin: 10px; padding: 16px !important; }
  .row { flex-direction: column !important; gap: 0 !important; }
  .composer-bar { flex-wrap: wrap; }
  .login-req-box { margin: 16px !important; padding: 24px !important; }
}

/* ---------- dm & notifications ---------- */
@media (max-width: 640px) {
  .dm-list { gap: 8px; }
  .dm-row { padding: 10px !important; }
  .notif-row { padding: 10px !important; }
  .dm-bubble { max-width: 92% !important; font-size: 13px !important; }
}

/* ---------- pagination ---------- */
@media (max-width: 640px) {
  .pager { gap: 6px; }
  .pager .btn { padding: 6px 12px !important; font-size: 12px !important; }
}

/* ---------- admin panel ---------- */
@media (max-width: 768px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .stat-card b { font-size: 18px !important; }
}

/* ---------- login modal ---------- */
@media (max-width: 480px) {
  .login-req-box { margin: 12px !important; padding: 24px 16px !important; }
  .login-req-icon { font-size: 36px !important; }
  .login-req-box h2 { font-size: 16px !important; }
  .login-req-btns { flex-direction: column !important; }
}

/* ---------- footer ---------- */
@media (max-width: 640px) {
  .footer { padding: 14px !important; font-size: 11px !important; }
}

/* ---------- touch: larger tap targets ---------- */
@media (pointer: coarse) {
  .btn { min-height: 40px; }
  .vote button { padding: 6px 14px !important; min-height: 36px; }
  .tabs button { min-height: 38px; }
  .chip { font-size: 11px !important; padding: 3px 10px !important; }
  input, textarea, select { min-height: 44px; font-size: 16px !important; }
  .sb-story { min-width: 56px; }
  .ac-item { padding: 12px 14px !important; }
}

/* ---------- tablet (768-1024) ---------- */
@media (min-width: 769px) and (max-width: 1024px) {
  .shell { grid-template-columns: 1fr 260px !important; }
  .grid-3 { grid-template-columns: repeat(2, 1fr) !important; }
  .detail-head { gap: 16px; }
  .detail-cover { width: 180px !important; }
  .slide-cover { width: 240px !important; min-width: 240px !important; }
  .slide-cover img { width: 240px !important; height: 360px !important; }
  .slider, .slides, .slide, .slide-info { height: 360px !important; }
  .social-bar { position: sticky !important; }
}
