:root {
  color-scheme: dark;
  --bg: #080808;
  --surface: #111112;
  --text: #f7f7f8;
  --muted: #8d8e92;
  --red: #eb334a;
  --line: #222326;
  --page-width: 1280px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Arial, Helvetica, sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.site-header {
  height: 61px;
  border-bottom: 1px solid #1e1e20;
  background: #09090a;
}
.header-inner {
  width: min(var(--page-width), calc(100% - 30px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.brand-mark {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  padding-left: 2px;
  border: 1px solid #ff7480;
  border-radius: 50%;
  color: #fff;
  background: radial-gradient(circle at 35% 25%, #ff8791, #b70e32 72%);
  box-shadow: 0 0 9px #e3344d44;
  font-size: 9px;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.site-announcement { width: min(var(--page-width), calc(100% - 30px)); margin: 12px auto 0; padding: 10px 13px; border: 1px solid #38272a; border-radius: 6px; color: #e0bec1; background: #1b1113; font-size: 11px; }
.brand-name { font-family: Georgia, 'Times New Roman', serif; font-size: 16px; font-style: italic; font-weight: 700; letter-spacing: -.06em; text-shadow: 0 1px 3px #000; }
.brand-name span { color: #fa7180; }
.brand-name small { margin-left: 2px; color: #f062ca; font-size: 9px; letter-spacing: -.02em; }
.search-box {
  width: 150px;
  height: 38px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #191a1d;
  border-radius: 22px;
  background: #111214;
  transition: width .2s, border-color .2s;
}
.search-box:focus-within { width: 225px; border-color: #37383d; }
.search-box svg { width: 14px; height: 14px; flex: 0 0 auto; fill: none; stroke: #777a80; stroke-width: 1.8; }
.search-box input { width: 100%; min-width: 0; outline: 0; border: 0; color: #e5e5e7; background: transparent; font-size: 11px; }
.search-box input::placeholder { color: #676a70; }

.catalog-view, .watch-view { width: min(var(--page-width), calc(100% - 20px)); margin: 11px auto 30px; }
.catalog-view[hidden], .watch-view[hidden] { display: none; }
.video-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 14px; }
.video-card { min-width: 0; }
.thumbnail-button {
  position: relative;
  width: 100%;
  display: block;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #080808;
  cursor: pointer;
  aspect-ratio: 16 / 9;
}
.thumbnail-art {
  position: absolute;
  inset: 0;
  background-image: url('assets/drama-contact-sheet.png');
  background-size: 200% 200%;
  background-position: var(--poster-position, 0% 0%);
  background-repeat: no-repeat;
  transition: transform .22s ease, filter .22s ease;
}
.thumbnail-art::after { content: ''; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(0,0,0,.52)); }
.thumbnail-glow, .thumbnail-title { display: none; }
.thumbnail-button:hover .thumbnail-art { transform: scale(1.025); filter: brightness(1.08); }
.duration-badge {
  position: absolute;
  z-index: 1;
  right: 6px;
  bottom: 6px;
  padding: 3px 5px;
  border-radius: 3px;
  color: #fff;
  background: rgba(0,0,0,.78);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.card-title { margin: 8px 0 0; overflow: hidden; color: #f6f6f7; font-size: 13px; font-weight: 700; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.card-views { margin: 26px 0 0; color: #898b90; font-size: 11px; }
.empty-state { padding: 48px 10px; color: var(--muted); text-align: center; }
.empty-state[hidden] { display: none; }
.empty-state h1 { margin: 0 0 8px; color: var(--text); font-size: 19px; }
.empty-state p { margin: 0; font-size: 12px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 13px; margin: 34px 0 8px; color: #85868b; font-size: 10px; }
.pagination button { width: 28px; height: 28px; border: 1px solid #2b2c30; border-radius: 5px; background: #151619; cursor: pointer; font-size: 18px; line-height: 20px; }
.pagination button:disabled { color: #55565a; opacity: .55; cursor: default; }

.watch-view { margin-top: 14px; }
.watch-card { overflow: hidden; border-radius: 12px; background: #09090a; }
.watch-player { position: relative; width: 100%; overflow: hidden; border-radius: 12px; background: #000; aspect-ratio: 16 / 9; }
.watch-player video, .watch-player iframe { display: block; width: 100%; height: 100%; border: 0; background: #000; object-fit: contain; }
.watch-cover { position: absolute; inset: 0; overflow: hidden; background-image: url('assets/drama-contact-sheet.png'); background-position: var(--poster-position, 100% 0%); background-size: 200% 200%; }
.watch-cover::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.34); }
.watch-play { position: absolute; z-index: 1; top: 50%; left: 50%; width: 76px; height: 76px; transform: translate(-50%,-50%); display: grid; place-items: center; border: 1px solid rgba(255,255,255,.82); border-radius: 50%; background: rgba(0,0,0,.43); cursor: pointer; }
.watch-play span { width: 47px; height: 47px; display: grid; place-items: center; padding-left: 3px; border-radius: 50%; color: #fff; background: #cb26b5; box-shadow: 0 0 19px #d425b577; font-size: 17px; }
.watch-controls-preview { position: absolute; z-index: 1; right: 15px; bottom: 13px; left: 15px; display: flex; align-items: center; gap: 13px; color: #eee; font-size: 11px; text-shadow: 0 1px 3px #000; }
.watch-controls-preview i { height: 3px; flex: 1; border-radius: 3px; background: #aaa8; }
.watch-info { padding: 19px 0 0; }
.watch-info h1 { margin: 0 0 7px; color: #f5f5f6; font-size: 18px; font-weight: 700; }
.watch-info > p { margin: 0; color: #8b8d92; font-size: 12px; }
.watch-actions { display: flex; gap: 10px; margin-top: 19px; }
.action-button { min-width: 0; height: 42px; flex: 1; display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 0; border-radius: 24px; color: #f1f1f3; background: #18191b; cursor: pointer; font-size: 12px; }
.action-button:hover { background: #222326; }
.like-button .heart { color: #ff3048; font-size: 17px; }
.like-button.liked .heart { color: #ff1837; text-shadow: 0 0 10px #ff183755; }
.related-section { margin-top: 25px; }
.related-section h2 { margin: 0 0 12px; color: #f4f4f5; font-size: 16px; }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.related-grid .card-title { margin: 7px 8px 0; font-size: 11px; }
.related-grid .card-views { margin: 5px 8px 9px; font-size: 9px; }
.related-grid .video-card { overflow: hidden; border-radius: 9px; background: #111214; }
.related-grid .thumbnail-button { border-radius: 8px 8px 0 0; }
.site-footer { min-height: 50px; padding: 0 max(15px, calc((100vw - var(--page-width)) / 2)); display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid #1c1c1e; color: #686a70; background: #09090a; font-size: 9px; }
.footer-brand { color: #c5c5c8; font-weight: 700; letter-spacing: .03em; }
.footer-admin-link { color: #777a80; text-decoration: none; }
.footer-admin-link:hover { color: #ddd; }

@media (min-width: 1050px) {
  .video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
}
@media (min-width: 1450px) {
  .video-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .site-header { height: 56px; }
  .header-inner { width: calc(100% - 24px); }
  .brand-mark { width: 23px; height: 23px; }
  .brand-name { font-size: 14px; }
  .search-box { width: 135px; height: 33px; padding: 0 10px; }
  .search-box:focus-within { width: 165px; }
  .search-box input { font-size: 10px; }
  .catalog-view, .watch-view { width: calc(100% - 16px); margin-top: 9px; }
  .video-grid { gap: 12px 9px; }
  .thumbnail-button { border-radius: 9px; }
  .card-title { margin-top: 7px; font-size: 11px; }
  .card-views { margin-top: 20px; font-size: 9px; }
  .duration-badge { right: 4px; bottom: 4px; font-size: 8px; }
  .watch-card, .watch-player { border-radius: 9px; }
  .watch-info { padding-top: 15px; }
  .watch-info h1 { font-size: 16px; }
  .watch-info > p { font-size: 10px; }
  .watch-actions { gap: 7px; margin-top: 15px; }
  .action-button { height: 38px; font-size: 10px; }
  .related-section { margin-top: 22px; }
  .related-section h2 { font-size: 14px; }
  .related-grid { gap: 8px; }
  .related-grid .card-title { margin: 6px 6px 0; font-size: 9px; }
  .related-grid .card-views { margin: 4px 6px 7px; font-size: 8px; }
  .site-footer { padding: 0 9px; font-size: 8px; }
}
@media (max-width: 370px) {
  .video-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-box { width: 122px; }
}
.watch-ad-slot { width: 100%; margin: 18px 0; }
.watch-ad-frame { display: block; width: 100%; min-height: 90px; border: 0; border-radius: 12px; background: #111; }
.direct-ad-overlay { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 20px; background: #000b; }
.direct-ad-panel { width: min(100%, 420px); padding: 30px 24px; border: 1px solid #333; border-radius: 20px; background: #151515; color: #fff; text-align: center; box-shadow: 0 24px 80px #0009; }
.direct-ad-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 50%; background: #7317b5; font-size: 22px; }
.direct-ad-panel h2 { margin: 0 0 10px; font-size: 22px; }
.direct-ad-panel p { margin: 0 0 22px; color: #bbb; line-height: 1.5; }
.direct-ad-button { width: 100%; min-height: 48px; border: 0; border-radius: 999px; background: #8b21c9; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
