/* drama02.com — short-drama portal clone */
:root {
  --bg: #1e1e1e;
  --bg-2: #262626;
  --card: #2c2c2c;
  --accent: #ff1469;
  --accent-2: #ff4d8d;
  --text: #ffffff;
  --muted: #a5a5a5;
  --radius: 10px;
  --nav-h: 58px;
  --max: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.4;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ---------- Header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px;
  background: rgba(30, 30, 30, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.hdr__brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 20px; letter-spacing: .3px; }
.hdr__logo {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #ff6a00); font-size: 17px;
}
.hdr__brand span { color: var(--accent); }
.hdr__logo svg { width: 18px; height: 18px; color: #fff; }
.btn-dl svg { width: 15px; height: 15px; }
.btn-dl {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 13px;
  padding: 9px 16px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(255, 20, 105, .35);
  transition: transform .15s, box-shadow .15s;
}
.btn-dl:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(255, 20, 105, .5); }
.hdr__tag { display: none; color: var(--muted); font-size: 12px; }

/* ---------- Search by ID ---------- */
.search { max-width: var(--max); margin: 20px auto 6px; padding: 0 16px; }
.search__inner {
  background: linear-gradient(135deg, rgba(255, 20, 105, .12), rgba(123, 47, 247, .10));
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px; padding: 22px 18px; text-align: center;
}
.search__head { font-size: 22px; font-weight: 800; }
.search__sub { color: var(--muted); font-size: 13px; margin-top: 5px; }
.search__form {
  display: flex; align-items: center; gap: 8px; margin: 16px auto 0;
  max-width: 520px; background: var(--bg-2);
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 999px;
  padding: 6px 6px 6px 14px; transition: border-color .15s, box-shadow .15s;
}
.search__form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 20, 105, .18); }
.search__icon { display: grid; place-items: center; color: var(--muted); }
.search__icon svg { width: 20px; height: 20px; }
.search__input {
  flex: 1; background: none; border: none; outline: none;
  color: #fff; font-size: 15px; padding: 8px 4px; min-width: 0;
}
.search__input::placeholder { color: #7a7a7a; }
.search__btn {
  background: var(--accent); color: #fff; font-weight: 700; font-size: 14px;
  padding: 10px 22px; border-radius: 999px; white-space: nowrap;
  transition: transform .15s, background .15s;
}
.search__btn:hover { background: var(--accent-2); transform: translateY(-1px); }

.search__result { max-width: 520px; margin: 0 auto; overflow: hidden;
  max-height: 0; opacity: 0; transition: max-height .3s ease, opacity .3s ease, margin .3s; }
.search__result.show { max-height: 600px; opacity: 1; margin-top: 16px; }
.result-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center; padding: 24px 16px 22px; border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .09);
  background:
    radial-gradient(130% 90% at 50% -10%, rgba(255, 20, 105, .18), transparent 55%),
    linear-gradient(180deg, #2b2130, #1d1822);
  animation: resIn .4s cubic-bezier(.2, .7, .3, 1) both;
}
@keyframes resIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.result-poster {
  position: relative; display: block; width: 240px; max-width: 84%;
  padding: 3px; border-radius: 18px; cursor: pointer;
  background: linear-gradient(150deg, #ff1469, #b23bff 55%, #7b2ff7);
  box-shadow: 0 16px 46px rgba(255, 20, 105, .32), 0 10px 26px rgba(0, 0, 0, .55);
  transition: transform .2s, box-shadow .2s;
}
.result-poster:hover { transform: translateY(-3px); box-shadow: 0 22px 56px rgba(255, 20, 105, .45), 0 12px 30px rgba(0, 0, 0, .6); }
.result-poster img { width: 100%; height: auto; display: block; border-radius: 15px; }
.result-poster::after {
  content: ""; position: absolute; inset: 3px; border-radius: 15px; pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, .35), transparent 42%);
}
.result-playbtn {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  background: #1877f2; color: #fff; font-weight: 800; font-size: 15px;
  padding: 11px 26px; border-radius: 999px;
  box-shadow: 0 10px 26px rgba(24, 119, 242, .6); transition: transform .18s, background .18s;
}
.result-playbtn::before {
  content: ""; position: absolute; inset: -7px; border-radius: 999px; pointer-events: none;
  border: 2px solid rgba(255, 255, 255, .45); animation: playPulse 2s ease-out infinite;
}
@keyframes playPulse { 0% { transform: scale(.92); opacity: .7; } 100% { transform: scale(1.35); opacity: 0; } }
.result-poster:hover .result-playbtn { background: #3b8bff; transform: translate(-50%, -50%) scale(1.06); }
.result-playbtn svg { width: 15px; height: 15px; }

.result-info { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.result-badges { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; }
.rb { font-size: 11px; font-weight: 800; padding: 4px 11px; border-radius: 999px; letter-spacing: .4px; }
.rb--id { background: rgba(255, 255, 255, .12); color: #fff; }
.rb--hd { background: linear-gradient(135deg, #ff1469, #ff6a00); color: #fff; }
.result-title {
  font-size: 20px; font-weight: 800; line-height: 1.3; max-width: 320px;
  background: linear-gradient(90deg, #ffffff, #ffd9c8);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.result-empty { padding: 16px; background: var(--card); border-radius: 12px; color: var(--muted); font-size: 14px; }

/* ---------- Hero carousel ---------- */
.hero { max-width: var(--max); margin: 14px auto 4px; padding: 0 16px; }
.hero__track {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 6px; scrollbar-width: none;
}
.hero__track::-webkit-scrollbar { display: none; }
.hero__slide {
  scroll-snap-align: center; flex: 0 0 84%; max-width: 560px;
  position: relative; border-radius: 16px; overflow: hidden;
  aspect-ratio: 3 / 2; display: flex; align-items: flex-end;
}
@media (min-width: 720px) { .hero__slide { flex-basis: 48%; } }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hero__slide::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, .82) 6%, rgba(0, 0, 0, .1) 60%, transparent);
}
.hero__body { position: relative; z-index: 2; padding: 18px 18px 20px; width: 100%; }
.hero__genre { font-size: 11px; color: var(--accent-2); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.hero__title { font-size: 20px; font-weight: 800; margin: 6px 0 12px; line-height: 1.25; }
.hero__play {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: #111; font-weight: 800; font-size: 14px;
  padding: 9px 22px; border-radius: 999px;
}
.hero__play svg { width: 14px; height: 14px; }

/* ---------- Sections / rows ---------- */
.section { max-width: var(--max); margin: 26px auto 0; padding: 0 16px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section__title { font-size: 19px; font-weight: 800; display: inline-flex; align-items: center; gap: 8px; }
.section__ic { width: 20px; height: 20px; color: var(--accent); flex: none; }
.section__more { font-size: 12px; color: var(--muted); }
.row {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px;
  scroll-snap-type: x proximity; scrollbar-width: none;
}
.row::-webkit-scrollbar { height: 0; }

/* ---------- Card (poster) ---------- */
.card { scroll-snap-align: start; flex: 0 0 33%; max-width: 150px; min-width: 118px; }
@media (min-width: 720px) { .card { flex-basis: 18%; } }
.poster {
  position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius);
  overflow: hidden; display: flex; align-items: flex-end;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .4);
  transition: transform .18s;
}
.card:hover .poster { transform: translateY(-4px); }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster__grad { position: absolute; inset: 0; }
.poster__grad::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .18), transparent 55%);
}
.poster__overlay {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, .78) 4%, transparent 55%);
}
.poster__play {
  position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%) scale(.8);
  z-index: 3; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 20, 105, .92); box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
  opacity: 0; transition: opacity .18s, transform .18s;
}
.poster__play svg { width: 20px; height: 20px; color: #fff; margin-left: 2px; }
.card:hover .poster__play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.poster__name {
  position: relative; z-index: 2; padding: 8px 9px 10px; font-size: 12.5px;
  font-weight: 700; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.poster__tag {
  position: absolute; top: 7px; left: 7px; z-index: 2;
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px);
  font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 6px; color: #fff;
}
.poster__ep {
  position: absolute; top: 7px; right: 7px; z-index: 2;
  background: var(--accent); font-size: 10px; font-weight: 700;
  padding: 3px 7px; border-radius: 6px;
}
.poster__rank {
  position: absolute; left: -6px; bottom: -14px; z-index: 2;
  font-size: 72px; font-weight: 900; color: #fff;
  -webkit-text-stroke: 3px rgba(0, 0, 0, .55); line-height: 1;
  text-shadow: 0 4px 10px rgba(0, 0, 0, .5);
}
.card--ranked .poster__name { padding-left: 44px; }

/* ---------- Player modal ---------- */
.player {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(0, 0, 0, .92); align-items: center; justify-content: center;
}
.player.open { display: flex; }
.player__box {
  position: relative; width: min(430px, 94vw); aspect-ratio: 9 / 16;
  max-height: 92vh; background: #000; border-radius: 14px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .7);
}
.player__box video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player__close {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 36px; height: 36px; border-radius: 50%; background: rgba(0, 0, 0, .55);
  font-size: 20px; display: grid; place-items: center; color: #fff;
}
.player__meta {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none;
  padding: 40px 16px 16px; background: linear-gradient(to top, rgba(0, 0, 0, .75), transparent);
}
.player__meta .g { color: var(--accent-2); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.player__meta .t { font-size: 17px; font-weight: 800; margin-top: 4px; }
.player__note { margin-top: 6px; font-size: 11px; color: var(--muted); }

/* ---------- Promo strip ---------- */
.promo {
  max-width: var(--max); margin: 30px auto 0; padding: 18px 16px;
}
.promo__inner {
  background: linear-gradient(120deg, #2a1030, #3a0f24);
  border: 1px solid rgba(255, 20, 105, .3); border-radius: 16px;
  padding: 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.promo h3 { font-size: 18px; font-weight: 800; display: inline-flex; align-items: center; gap: 8px; }
.promo__ic { width: 20px; height: 20px; color: var(--accent); flex: none; }
.promo p { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------- Footer ---------- */
.ftr { max-width: var(--max); margin: 36px auto 0; padding: 24px 16px 40px; border-top: 1px solid rgba(255, 255, 255, .07); }
.ftr__links { display: flex; gap: 22px; flex-wrap: wrap; font-size: 13px; color: var(--muted); font-weight: 600; }
.ftr__links a:hover { color: #fff; }
.ftr__copy { margin-top: 14px; font-size: 12px; color: #6d6d6d; }

/* ---------- Bottom nav (mobile) ---------- */
.bnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: var(--nav-h);
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; background: rgba(20, 20, 20, .96); backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, .07);
}
.bnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 10.5px; color: var(--muted); font-weight: 600;
}
.bnav a.active { color: var(--accent); }
.bnav svg { width: 22px; height: 22px; }

@media (min-width: 900px) {
  .hdr__tag { display: block; }
  .bnav { display: none; }
  body { padding-bottom: 0; }
}
