/* ============================================================
   BENTENG786 — INTRO GATE (video feed splash)
   Port dari template AMP TikTok-style ke vanilla HTML.
   Tema: gold (#facc15) + navy (#0b0f17) + hijau (#00bb7f)
   Latar: landing page terlihat BLUR di belakang gate.
   ============================================================ */

html.gate-open,
html.gate-open body { overflow: hidden; }

#gate {
  --gold-1: #fde047;
  --gold-2: #facc15;
  --gold-3: #eab308;
  --gold-4: #854d0e;
  --green: #00bb7f;
  --ink: #0b0f17;
  --panel: rgba(13, 18, 27, .82);
  --line: rgba(250, 204, 21, .34);
  --muted: rgba(255, 255, 255, .72);
  --cta-h: 58px;
  --nav-h: 66px;
  --shell-w: min(100vw, 430px);

  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 10, 16, .45);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  backdrop-filter: blur(20px) saturate(1.15);
  font-family: "IBM Plex Sans Condensed", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #fff;
  opacity: 1;
  transition: opacity .32s ease;
}

#gate.closing { opacity: 0; }
#gate.closed  { display: none; }

#gate * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

#gate a { color: inherit; }

/* ---------- SHELL (kanvas mobile 430px) ---------- */
#gate .app-shell {
  position: relative;
  width: var(--shell-w);
  height: 100%;
  overflow: hidden;
  background: #0b0f17;
  isolation: isolate;
  box-shadow: 0 0 0 1px rgba(250, 204, 21, .14);
}

#gate .app-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 90;
  border: 1px solid rgba(250, 204, 21, .30);
  pointer-events: none;
}

#gate .app-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 89;
  pointer-events: none;
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, .76),
    inset 0 0 80px rgba(0, 0, 0, .36);
}

/* ---------- TOPBAR ---------- */
#gate .topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  min-height: 70px;
  padding: max(12px, env(safe-area-inset-top)) 12px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(180deg, rgba(4, 6, 10, .92) 0%, rgba(4, 6, 10, .34) 68%, transparent 100%);
}

#gate .brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

#gate .brand-favicon {
  position: relative;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(250, 204, 21, .76);
  border-radius: 9px;
  background: #0d121b;
  box-shadow: 0 0 18px rgba(250, 204, 21, .38);
}

#gate .brand-favicon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#gate .brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1;
}

#gate .brand-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--gold-2);
  white-space: nowrap;
}

#gate .brand-status {
  margin-top: 5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, .62);
  text-transform: uppercase;
  white-space: nowrap;
}

#gate .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(0, 187, 127, .10), 0 0 11px rgba(0, 187, 127, .65);
  animation: gate-pulse-dot 1.8s ease-in-out infinite;
}

/* ---------- TOMBOL SILANG (masuk ke landing) ---------- */
#gate .top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#gate .gate-close {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  border: 1px solid rgba(250, 204, 21, .55);
  background: rgba(13, 18, 27, .80);
  box-shadow: 0 6px 18px rgba(250, 204, 21, .22), inset 0 0 14px rgba(250, 204, 21, .05);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform .18s ease, box-shadow .18s ease;
}

#gate .gate-close svg {
  width: 20px;
  height: 20px;
  stroke: var(--gold-1);
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(250, 204, 21, .45));
}

#gate .gate-close:hover {
  box-shadow: 0 6px 26px rgba(250, 204, 21, .45), inset 0 0 16px rgba(250, 204, 21, .10);
}

#gate .gate-close:active { transform: scale(.94); }

#gate .gate-close::after {
  content: "";
  position: absolute;
  z-index: 3;
  top: -65%;
  bottom: -65%;
  left: -55%;
  width: 34%;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-220%) rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .72), transparent);
  animation: gate-sheen 3.8s cubic-bezier(.4, 0, .2, 1) infinite;
}

#gate .gate-close-label {
  position: absolute;
  top: 54px;
  right: 0;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 1.4px;
  color: rgba(250, 204, 21, .85);
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
}

/* ---------- FEED SLIDE ---------- */
#gate .feed {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

#gate .feed::-webkit-scrollbar { display: none; }

#gate .slide {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #0b0f17;
}

#gate .slide::before,
#gate .slide::after {
  content: "";
  position: absolute;
  z-index: 8;
  width: 155px;
  height: 2px;
  top: 92px;
  background: linear-gradient(90deg, transparent, var(--gold-2));
  opacity: .62;
  pointer-events: none;
}

#gate .slide::before {
  left: -35px;
  transform: rotate(36deg);
}

#gate .slide::after {
  right: -35px;
  transform: rotate(-36deg) scaleX(-1);
}

#gate .media-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #0b0f17;
}

#gate .media-layer video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#gate .slide-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .54) 0%, rgba(0, 0, 0, .04) 28%, rgba(0, 0, 0, .10) 54%, rgba(0, 0, 0, .90) 100%),
    radial-gradient(circle at 50% 72%, rgba(250, 204, 21, .16), transparent 30%);
}

#gate .tech-grid {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: .09;
  pointer-events: none;
  background-image:
    linear-gradient(30deg, rgba(250, 204, 21, .45) 1px, transparent 1px),
    linear-gradient(150deg, rgba(0, 187, 127, .30) 1px, transparent 1px);
  background-size: 32px 56px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 30%, transparent 62%, #000 100%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 30%, transparent 62%, #000 100%);
}

#gate .gold-scan {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 21%;
  z-index: 5;
  height: 1px;
  opacity: .78;
  background: linear-gradient(90deg, transparent, rgba(253, 224, 71, .90), transparent);
  box-shadow: 0 0 18px rgba(250, 204, 21, .45);
  animation: gate-scan-line 5.4s ease-in-out infinite;
  pointer-events: none;
}

#gate .tap-zone {
  position: absolute;
  inset: 0;
  z-index: 6;
  cursor: pointer;
}

#gate .sound-hint {
  position: absolute;
  z-index: 25;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 188px;
  padding: 11px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid rgba(250, 204, 21, .38);
  background: rgba(4, 6, 10, .72);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .38), inset 0 0 18px rgba(250, 204, 21, .04);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2px;
  pointer-events: none;
  animation: gate-hint-float 2.4s ease-in-out infinite;
  transition: opacity .25s ease, visibility .25s ease;
}

#gate .sound-hint.hide { opacity: 0; visibility: hidden; }

#gate .sound-hint svg {
  width: 16px;
  height: 16px;
  color: var(--gold-1);
}

#gate .watermark {
  position: absolute;
  z-index: 7;
  top: calc(13% + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: 82%;
  text-align: center;
  pointer-events: none;
}

#gate .watermark-mark {
  display: block;
  font-size: clamp(30px, 9vw, 48px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 5px;
  color: rgba(250, 204, 21, .18);
  text-shadow: 0 0 28px rgba(250, 204, 21, .20);
}

#gate .watermark-sub {
  margin-top: 8px;
  display: block;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, .20);
  text-transform: uppercase;
}

/* ---------- ACTION RAIL ---------- */
#gate .action-rail {
  position: absolute;
  right: 10px;
  bottom: calc(var(--nav-h) + var(--cta-h) + env(safe-area-inset-bottom) + 62px);
  z-index: 20;
  width: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

#gate .action-link {
  width: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: #fff;
}

#gate .action-icon {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid rgba(250, 204, 21, .32);
  background: linear-gradient(145deg, rgba(18, 24, 33, .88), rgba(4, 6, 10, .70));
  box-shadow: 0 8px 20px rgba(0, 0, 0, .30), inset 0 0 16px rgba(250, 204, 21, .04);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  overflow: hidden;
  isolation: isolate;
}

#gate .action-icon svg {
  width: 21px;
  height: 21px;
  stroke: #fff;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(250, 204, 21, .20));
}

#gate .action-link:first-child .action-icon svg { stroke: var(--gold-1); }

#gate .action-count {
  max-width: 50px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, .86);
  text-shadow: 0 2px 6px rgba(0, 0, 0, .88);
  white-space: nowrap;
}

#gate .avatar-box {
  position: relative;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 14px;
  border: 2px solid transparent;
  background:
    linear-gradient(#0d121b, #0d121b) padding-box,
    linear-gradient(135deg, #fde047, #facc15, #00bb7f) border-box;
  box-shadow: 0 0 18px rgba(250, 204, 21, .30);
}

#gate .avatar-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- DOT NAV 1 2 3 4 ---------- */
#gate .dot-nav {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#gate .dot {
  position: relative;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(250, 204, 21, .38);
  background: rgba(4, 6, 10, .72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, .78);
  font-size: 12px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, color .18s ease, background .18s ease;
}

#gate .dot:hover {
  border-color: rgba(250, 204, 21, .8);
  color: var(--gold-1);
}

#gate .dot.active {
  background: linear-gradient(135deg, #fde047, #facc15 55%, #eab308);
  border-color: #fde047;
  color: #0b0f17;
  box-shadow: 0 0 16px rgba(250, 204, 21, .55);
  transform: scale(1.12);
}

#gate .dot:active { transform: scale(.92); }

/* ---------- SLIDE COPY ---------- */
#gate .slide-copy {
  position: absolute;
  left: 48px;
  right: 70px;
  bottom: calc(var(--nav-h) + var(--cta-h) + env(safe-area-inset-bottom) + 51px);
  z-index: 18;
}

#gate .eyebrow {
  width: fit-content;
  margin-bottom: 8px;
  padding: 6px 9px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 7px;
  border: 1px solid rgba(250, 204, 21, .30);
  background: rgba(7, 10, 15, .62);
  color: var(--gold-1);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.25px;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

#gate .eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-2);
  box-shadow: 0 0 9px rgba(250, 204, 21, .80);
}

#gate .slide-title {
  max-width: 330px;
  font-size: clamp(19px, 5.5vw, 25px);
  font-weight: 800;
  line-height: 1.19;
  letter-spacing: -.25px;
  color: #fff;
  text-shadow: 0 3px 18px rgba(0, 0, 0, .82);
}

#gate .slide-title em {
  color: var(--gold-1);
  font-style: normal;
}

#gate .slide-desc {
  max-width: 320px;
  margin-top: 7px;
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
  line-height: 1.55;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .90);
}

#gate .channel-row {
  margin-top: 11px;
  display: flex;
  align-items: center;
  gap: 7px;
}

#gate .channel-avatar {
  position: relative;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  display: block;
  overflow: hidden;
  border-radius: 9px;
  border: 1px solid rgba(250, 204, 21, .55);
  background: #0d121b;
  color: var(--gold-1);
  text-decoration: none;
}

#gate .channel-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#gate .channel-meta { min-width: 0; flex: 1; }

#gate .channel-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

#gate .channel-note {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  color: rgba(255, 255, 255, .62);
  font-size: 8px;
  white-space: nowrap;
}

#gate .subscribe-btn {
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .8px;
  color: #0b0f17;
  background: linear-gradient(135deg, #fde047, #facc15 55%, #eab308);
  box-shadow: 0 5px 18px rgba(250, 204, 21, .30);
  transition: transform .18s ease;
}

#gate .subscribe-btn:active { transform: scale(.94); }

/* ---------- BOTTOM CTA ---------- */
#gate .bottom-cta {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 7px);
  z-index: 55;
  height: var(--cta-h);
  padding: 6px;
  display: grid;
  grid-template-columns: 1fr 1.16fr;
  gap: 7px;
  border: 1px solid rgba(250, 204, 21, .22);
  border-radius: 15px;
  background: rgba(5, 8, 13, .82);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .45), inset 0 0 18px rgba(250, 204, 21, .025);
  -webkit-backdrop-filter: blur(13px);
  backdrop-filter: blur(13px);
}

#gate .cta-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .9px;
  overflow: hidden;
  isolation: isolate;
  transition: transform .18s ease;
}

#gate .cta-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#gate .cta-btn:active { transform: scale(.96); }

#gate .cta-cs {
  color: #7dffd4;
  border: 1px solid rgba(0, 187, 127, .40);
  background: rgba(10, 24, 19, .82);
}

#gate .cta-topup {
  color: #0b0f17;
  border: 1px solid #fde047;
  background: linear-gradient(135deg, #fde047 0%, #facc15 42%, #ca8a04 100%);
  box-shadow: 0 6px 20px rgba(250, 204, 21, .25);
}

/* ---------- BOTTOM NAV ---------- */
#gate .bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 54;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 6px 6px calc(5px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  border-top: 1px solid rgba(250, 204, 21, .16);
  background: rgba(3, 5, 8, .96);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .40);
}

#gate .nav-link {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: 32px 12px;
  align-content: end;
  justify-items: center;
  gap: 3px;
  padding: 0 2px 2px;
  color: rgba(255, 255, 255, .60);
  text-decoration: none;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}

#gate .nav-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
}

#gate .nav-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#gate .nav-link.active { color: var(--gold-1); }

#gate .nav-link.active .nav-icon {
  border-color: rgba(250, 204, 21, .26);
  background: rgba(250, 204, 21, .08);
}

#gate .nav-link > span:last-child {
  width: 100%;
  height: 12px;
  display: block;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
}

/* ---------- KEYFRAMES ---------- */
@keyframes gate-pulse-dot {
  0%, 100% { opacity: .45; transform: scale(.86); }
  50%      { opacity: 1;   transform: scale(1.1); }
}

@keyframes gate-hint-float {
  0%, 100% { transform: translate(-50%, -50%); }
  50%      { transform: translate(-50%, calc(-50% - 5px)); }
}

@keyframes gate-scan-line {
  0%, 100% { opacity: .16; transform: translateY(-25px) scaleX(.72); }
  50%      { opacity: .82; transform: translateY(145px) scaleX(1); }
}

@keyframes gate-sheen {
  0%, 55%  { opacity: 0; transform: translateX(-220%) rotate(18deg); }
  60%      { opacity: 1; }
  100%     { opacity: 0; transform: translateX(320%) rotate(18deg); }
}

@media (prefers-reduced-motion: reduce) {
  #gate .live-dot,
  #gate .sound-hint,
  #gate .gold-scan,
  #gate .gate-close::after { animation: none; }
}