:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  background: #000;
  color: #fff;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-height: 100vh; }
[hidden] { display: none !important; }

/* Layar preview pertama, 9:16 seperti source asli. */
.preview-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}
.preview-card {
  position: relative;
  width: 100%;
  max-width: 450px;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
.preview-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: brightness(.90);
  pointer-events: none;
}
.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgb(0 0 0 / 72%);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  z-index: 2;
  transition: background .2s ease, scale .2s ease;
}
.play-button:hover, .play-button:focus-visible {
  background: rgb(255 255 255 / 20%);
  scale: 1.08;
}
.play-button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.play-triangle {
  width: 0;
  height: 0;
  margin-left: 5px;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 20px solid #fff;
}
.video-title, .preview-message {
  position: absolute;
  left: 12px;
  padding: 7px 10px;
  border-radius: 5px;
  background: rgb(0 0 0 / 65%);
  color: #fff;
  font-size: 13px;
  z-index: 2;
}
.video-title {
  bottom: 12px;
  margin: 0;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-message {
  top: 12px;
  right: 12px;
  line-height: 1.4;
  margin: 0;
}

/* Halaman video kedua: dua slot iklan mengapit pemutar. */
.watch-page {
  min-height: 100vh;
  padding: 12px;
}
.watch-layout {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.ad-slot {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.ad-slot-top { min-height: 50px; }
.ad-slot-bottom { min-height: 250px; }
.watch-video-block {
  width: 100%;
  max-width: 450px;
}
.watch-video {
  width: 100%;
  max-height: 75vh;
  display: block;
  background: #111;
  border-radius: 6px;
  object-fit: contain;
}
.video-error {
  margin-top: 12px;
  border: 1px solid #555;
  border-radius: 6px;
  background: #191919;
  padding: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.video-error a { color: #91c8ff; }

@media (max-width: 480px) {
  .preview-card { max-width: 350px; border-radius: 4px; }
  .play-button { width: 54px; height: 54px; }
  .play-triangle {
    border-top-width: 11px;
    border-bottom-width: 11px;
    border-left-width: 17px;
  }
  .watch-page { padding: 8px 4px; }
}
