:root {
  --bg: #fff;
  --panel: #fff;
  --panel-2: #fdf5f8;
  --line: #f6d8e4;
  --text: #33272d;
  --muted: #a08a94;
  --accent: #ff3d8b;
  --accent-2: #ff63a7;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--accent);
}
.brand:hover { text-decoration: none; }
.left-over {
  font-size: 13px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 4px 12px;
  border-radius: 999px;
}
.lang-switch {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.topbar-mid {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.user-level {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--accent);
  background: var(--panel-2);
  border: 1px solid var(--accent-2);
  padding: 4px 10px;
  border-radius: 999px;
}
.tier-info {
  max-width: 1100px;
  margin: 16px auto 0;
  padding: 12px 18px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.7;
}
.tier-info p { margin: 0; }
.tier-active {
  color: var(--text);
  font-weight: 700;
}
.tier-active::before { content: "★ "; color: var(--accent); }

.foot {
  margin-top: 40px;
  padding: 18px 22px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  border-top: 1px solid var(--line);
}

.btn {
  display: inline-block;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 18px;
  font-size: 15px;
  cursor: pointer;
}
.btn:hover { background: #fbe9f1; text-decoration: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 0;
  font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  font-weight: 600;
}
.btn-ghost:hover { background: #fbe9f1; }

/* Premium tier picker: three plans side by side, wrap on narrow screens */
.tier-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 0 auto 16px;
}
.tier-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.tier-opt:hover { border-color: var(--accent); }
.tier-opt input { margin: 0; accent-color: var(--accent); }
.tier-opt:has(input:checked) { border-color: var(--accent); background: #fbe9f1; }

.gate, .limit {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.gate-box {
  max-width: 460px;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 30px;
  text-align: center;
}
.badge-18 {
  display: inline-block;
  font-size: 26px;
  font-weight: 800;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 50%;
  width: 74px;
  height: 74px;
  line-height: 70px;
  margin-bottom: 16px;
}

.grid-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  padding: 24px 22px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(255, 61, 139, .18);
}
.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #ffe3ef, #ffd0e4);
  display: flex;
  align-items: center;
  justify-content: center;
}
.thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.play-ico {
  position: absolute;
  color: rgba(255, 61, 139, .35);
  font-size: 44px;
}
.btn-watch {
  position: relative;
  margin-top: 56px;
  background: rgba(255, 61, 139, .92);
  border: 0;
  color: #fff;
  font-weight: 600;
  padding: 9px 22px;
  border-radius: 999px;
  cursor: pointer;
}
.btn-watch:hover { filter: brightness(1.15); }
.card-title {
  margin: 12px 14px 2px;
  font-size: 16px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meta { margin: 0 14px 14px; font-size: 13px; color: var(--muted); }

.pager {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 22px 26px;
}

.watch { max-width: 960px; margin: 0 auto; padding: 22px; }
.watch-title { font-size: 20px; margin: 0 0 14px; }
.watch-thumb, .player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}
.watch-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Item 15: custom control bar (no native controls → no Download menu) */
.player-wrap { position: relative; }
.player { width: 100%; aspect-ratio: 16 / 9; background: #000; display: block; }
.pbar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .72));
}
.pb-btn {
  background: none; border: 0; cursor: pointer;
  color: #fff; font-size: 15px; line-height: 1;
  padding: 4px 6px; border-radius: 6px;
}
.pb-btn:hover { background: rgba(255, 255, 255, .18); }
.pb-seek { flex: 1; height: 4px; cursor: pointer; accent-color: var(--accent); }
.pb-vol { width: 70px; height: 4px; cursor: pointer; accent-color: var(--accent); }
.pb-time { color: #fff; font-size: 12px; white-space: nowrap; }
.pb-menu {
  position: absolute; bottom: 42px; right: 52px;
  display: none; min-width: 170px;
  background: rgba(20, 12, 16, .94);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 8px; padding: 10px; z-index: 5;
}
.pb-menu.open { display: block; }
.pb-menu-head { color: #fff; font-size: 12px; margin-bottom: 8px; }
.pb-chips { display: flex; gap: 6px; margin-bottom: 8px; }
.pb-chip {
  background: none; border: 1px solid rgba(255, 255, 255, .3);
  color: #fff; font-size: 12px; cursor: pointer;
  padding: 3px 8px; border-radius: 6px;
}
.pb-chip.on { background: var(--accent); border-color: var(--accent); }
.pb-menu-item {
  width: 100%; background: none; border: 0; cursor: pointer;
  color: #fff; font-size: 13px; text-align: left;
  padding: 5px 2px; border-radius: 6px;
}
.pb-menu-item:hover { background: rgba(255, 255, 255, .15); }

/* Item 15b: fit the control bar on narrow phone screens */
@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; gap: 8px; }
  .topbar-mid { gap: 6px; }
  .topbar-mid .muted { display: none; }
  /* Menu button wraps to its own left-aligned row on phones; anchor the
     dropdown left so the list stays on-screen (right: 0 overflowed left) */
  .menu-list { left: 0; right: auto; min-width: 150px; }
  .tier-info { margin: 12px 10px 0; }
  .pbar { gap: 4px; padding: 4px 6px; }
  .pb-vol { display: none; }
  .pb-btn { font-size: 13px; padding: 3px 5px; }
  .pb-time { font-size: 10px; }
  .pb-menu { right: 40px; }
}

/* Item 15c: true fullscreen on phones (drop 16:9 so it fills the screen) */
.player-wrap:fullscreen {
  background: #000;
  display: flex;
  flex-direction: column;
}
.player-wrap:fullscreen .player {
  flex: 1;
  width: 100%;
  height: 100%;
  aspect-ratio: none;
  object-fit: contain;
}
.player-wrap:-webkit-full-screen .player {
  flex: 1;
  width: 100%;
  height: 100%;
  aspect-ratio: none;
  object-fit: contain;
}

/* Item 16: align the login/register form fields (same .gate-box pattern) */
.gate-box form { text-align: left; }
.gate-box form label { display: block; margin-bottom: 14px; }
.gate-box form input {
  display: block; width: 100%;
  padding: 10px 12px; margin-top: 4px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--text); font: inherit;
}
.gate-box form .btn { width: 100%; }

/* Item 17: top-bar dropdown (pure CSS, opens on hover / keyboard focus) */
.topbar-menu { position: relative; }
.menu-btn {
  background: var(--panel-2);
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.menu-list {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  /* The 8px top padding bridges the visual gap so the cursor can reach
     the list without leaving the hover area (it used to close early). */
  padding: 8px 6px 6px;
  min-width: 180px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(255, 61, 139, .12);
  z-index: 20;
}
.topbar-menu:hover .menu-list,
.topbar-menu:focus-within .menu-list { display: block; }
.menu-item {
  display: block;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  border-radius: calc(var(--radius) - 4px);
  white-space: nowrap;
}
/* Invisible bridge across the 8px gap above the list: keeps the hover
   alive while the cursor travels from the button to the first item. */
.menu-list::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: -6px;
  right: -6px;
  height: 8px;
}
.menu-item:hover { background: var(--panel-2); color: var(--accent); text-decoration: none; }
.vote-badge { margin-left: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }

.vote-row { display: flex; gap: 10px; margin: 14px 0 0; }
.vote-form { margin: 0; }
.vote-btn {
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.vote-btn:hover { border-color: var(--accent); }
.vote-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.vote-n { font-size: 13px; opacity: .85; }

/* item 22 — premium pay box */
.pay-box { text-align: center; }
.pay-qr { margin: 14px auto 0; }
.pay-qr img {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  display: block;
  margin: 0 auto 6px;
}
.pay-address {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  word-break: break-all;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 12px 0;
}
.pay-amount { font-size: 18px; font-weight: 700; margin: 4px 0; }
.pay-box form { text-align: left; margin-top: 16px; }
.premium-ok {
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
}
@media (max-width: 560px) {
  .pay-qr img { width: 180px; height: 180px; }
}
