/* ============================================================
   Free2Watch — Comika × Elmakko
   Aesthetic: dark luxury cinema / coffee speakeasy.
   Accent: --amber (#C8922A) warm coffee gold.
   Gate is always dark. Player follows site theme toggle.
============================================================ */

:root {
  --amber:       #C8922A;
  --amber-light: #E8A930;
  --amber-dim:   rgba(200, 146, 42, 0.16);
  --amber-glow:  rgba(200, 146, 42, 0.07);
  --f2w-dark:    #060C1C;
  --f2w-border:  rgba(200, 146, 42, 0.2);
}

.f2w-body {
  min-height: 100svh;
}

/* Lock body scroll while gate is visible */
.f2w-body:has(#gateScreen.active) {
  overflow: hidden;
  height: 100svh;
}

/* Suppress theme grain on gate (player section can have it) */
.f2w-gate ~ * .f2w-body::after,
.f2w-body .f2w-gate ~ body::after { display: none; }

/* Hide shared chrome — footer and mobile pill not needed here */
.f2w-body .site-footer { display: none !important; }

/* mn-pill: sembunyikan di semua viewport, termasuk dalam media query mobile */
.f2w-body .mn-pill,
body.f2w-body .mn-pill,
[data-theme] body.f2w-body .mn-pill { display: none !important; }
@media (max-width: 820px) {
  .f2w-body .mn-pill,
  body.f2w-body .mn-pill { display: none !important; }
}

/* Topbar: always dark-tinted on this page (gate is always dark) */
.f2w-body .site-top {
  background: rgba(4, 8, 20, 0.75);
  border-bottom: 1px solid rgba(200, 146, 42, 0.1);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
[data-theme="light"] .f2w-body .site-top {
  background: rgba(255, 251, 242, 0.82);
  border-bottom-color: rgba(200, 146, 42, 0.15);
}


/* ============================================================
   SCREEN SWITCHING
============================================================ */
.f2w-screen { display: none; }

.f2w-gate.active  { display: flex; flex-direction: column; }
.f2w-player.active { display: block; }

/* ============================================================
   GATE SCREEN
============================================================ */
.f2w-gate {
  position: relative;
  height: 100svh;
  min-height: 560px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(180deg, #02060F 0%, #060C1C 35%, #090E1E 100%);
}

/* Warm radial glow — cafe light ambience */
.f2w-gate::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -15%;
  transform: translateX(-50%);
  width: 90vmax;
  height: 70vmax;
  border-radius: 50%;
  background: radial-gradient(
    ellipse,
    rgba(200, 146, 42, 0.10) 0%,
    rgba(200, 146, 42, 0.04) 40%,
    transparent 68%
  );
  pointer-events: none;
  z-index: 0;
}

/* Ambient top haze */
.f2w-gate::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(0,0,0,.45) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.f2w-gate-noise {
  position: absolute;
  inset: 0;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 150px;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
}

/* Subtle horizontal scan-line texture */
.f2w-gate-scan {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(255, 255, 255, 0.008) 3px,
    rgba(255, 255, 255, 0.008) 4px
  );
  pointer-events: none;
  z-index: 0;
}

.f2w-gate-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(5.5rem, 12vh, 9rem) clamp(1.5rem, 5vw, 3rem) clamp(3.5rem, 7vh, 6rem);
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

/* ---- Collab badge ---- */
.f2w-collab-badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .32rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--f2w-border);
  background: var(--amber-dim);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--amber-light);
  margin-bottom: 2.4rem;
  white-space: nowrap;
}
.f2w-badge-x { opacity: .55; }

/* ---- Coffee cup illustration ---- */
.f2w-cup-wrap {
  margin-bottom: 1.8rem;
  filter: drop-shadow(0 0 22px rgba(200, 146, 42, .22));
}
.f2w-cup {
  width: clamp(80px, 14vw, 112px);
  height: auto;
  color: var(--amber);
}

/* Steam wisps */
@keyframes f2w-steam {
  0%   { opacity: 0;   transform: translateY(2px) scaleX(1); }
  15%  { opacity: .75; }
  80%  { opacity: .25; transform: translateY(-18px) scaleX(1.1); }
  100% { opacity: 0;   transform: translateY(-26px) scaleX(.85); }
}
.f2w-steam { animation: f2w-steam 2.6s ease-out infinite; transform-origin: center bottom; }
.f2w-steam-1 { animation-delay: 0s; }
.f2w-steam-2 { animation-delay: .55s; }
.f2w-steam-3 { animation-delay: 1.1s; }

/* ---- Gate copy ---- */
.f2w-gate-headline {
  font-family: var(--f-h);
  font-size: clamp(2.2rem, 7vw, 3.8rem);
  line-height: 1.04;
  color: #EEF4FF;
  letter-spacing: -.015em;
  margin-bottom: .6rem;
}

.f2w-gate-sub {
  color: rgba(180, 195, 220, .55);
  font-size: clamp(.875rem, 2vw, 1rem);
  line-height: 1.65;
  max-width: 38ch;
  margin-bottom: 2.4rem;
}

/* ---- Gate form ---- */
.f2w-gate-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .7rem;
}

.f2w-input-wrap {
  position: relative;
  width: 100%;
}

.f2w-input {
  width: 100%;
  padding: 1.1rem 3.4rem 1.1rem 1.4rem;
  border-radius: 12px;
  border: 1.5px solid rgba(200, 146, 42, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: #EEF4FF;
  font-family: 'Courier New', monospace;
  font-size: 1.05rem;
  letter-spacing: .1em;
  text-align: center;
  outline: none;
  transition: border-color .25s, box-shadow .25s, background .25s;
  -webkit-appearance: none;
}
.f2w-input::placeholder {
  font-family: var(--f-b);
  letter-spacing: 0;
  color: rgba(180, 195, 220, .28);
  font-size: .88rem;
}
.f2w-input:focus {
  border-color: var(--amber);
  background: rgba(200, 146, 42, 0.05);
  box-shadow: 0 0 0 4px rgba(200, 146, 42, 0.09), 0 0 28px rgba(200, 146, 42, 0.07);
}

.f2w-show-pwd {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  padding: .28rem;
  color: rgba(180, 195, 220, .35);
  transition: color .2s;
  cursor: pointer;
  line-height: 0;
}
.f2w-show-pwd:hover { color: var(--amber); }
.f2w-show-pwd svg { width: 17px; height: 17px; }

/* Shake animation on wrong password */
@keyframes f2w-shake {
  0%, 100% { transform: translateX(0); }
  18%  { transform: translateX(-7px); }
  36%  { transform: translateX(7px); }
  54%  { transform: translateX(-5px); }
  72%  { transform: translateX(5px); }
  88%  { transform: translateX(-2px); }
}
.f2w-input-wrap.shake {
  animation: f2w-shake .42s var(--ease, cubic-bezier(.16,1,.3,1));
}

/* Error message */
.f2w-error {
  min-height: 1.3em;
  font-size: .8rem;
  color: #FF7262;
  text-align: center;
  opacity: 0;
  transition: opacity .18s;
}
.f2w-error.visible { opacity: 1; }

/* ---- Submit button ---- */
.f2w-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: 1.05rem 1.8rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #b87e22 0%, var(--amber) 45%, var(--amber-light) 100%);
  color: #05090E;
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .04em;
  cursor: pointer;
  transition: transform .3s var(--ease), box-shadow .3s, opacity .2s;
  border: none;
  outline: none;
  position: relative;
  overflow: hidden;
}
.f2w-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.18) 0%, transparent 55%);
  opacity: 0;
  transition: opacity .22s;
}
.f2w-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(200, 146, 42, .38);
}
.f2w-submit:hover::before { opacity: 1; }
.f2w-submit:active:not(:disabled) { transform: translateY(0); }
.f2w-submit:disabled { opacity: .55; cursor: not-allowed; }

.f2w-submit svg { width: 17px; height: 17px; transition: transform .2s; flex-shrink: 0; }
.f2w-submit:hover:not(:disabled) svg { transform: translateX(3px); }

/* Spinner state */
.f2w-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0,0,0,.25);
  border-top-color: #05090E;
  border-radius: 50%;
  animation: f2w-spin .65s linear infinite;
  flex-shrink: 0;
}
@keyframes f2w-spin { to { transform: rotate(360deg); } }

.f2w-submit.loading .f2w-submit-label { display: none; }
.f2w-submit.loading .f2w-submit-arrow { display: none; }
.f2w-submit.loading .f2w-spinner { display: block; }

/* Hint beneath form */
.f2w-gate-hint {
  margin-top: 1.4rem;
  font-size: .82rem;
  color: rgba(180, 195, 220, .38);
  line-height: 1.55;
  max-width: 36ch;
}

/* ---- Gate entrance — staggered fade-up per element ---- */
@keyframes f2w-enter {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.f2w-gate.active .f2w-collab-badge  { animation: f2w-enter .65s var(--ease, cubic-bezier(.16,1,.3,1)) .08s both; }
.f2w-gate.active .f2w-cup-wrap      { animation: f2w-enter .78s var(--ease, cubic-bezier(.16,1,.3,1)) .22s both; }
.f2w-gate.active .f2w-gate-headline { animation: f2w-enter .72s var(--ease, cubic-bezier(.16,1,.3,1)) .38s both; }
.f2w-gate.active .f2w-gate-sub      { animation: f2w-enter .65s var(--ease, cubic-bezier(.16,1,.3,1)) .52s both; }
.f2w-gate.active .f2w-gate-form     { animation: f2w-enter .65s var(--ease, cubic-bezier(.16,1,.3,1)) .66s both; }
.f2w-gate.active .f2w-gate-hint     { animation: f2w-enter .55s var(--ease, cubic-bezier(.16,1,.3,1)) .80s both; }

/* Gate exit animation */
@keyframes f2w-gate-exit {
  to { opacity: 0; transform: scale(1.03); }
}
.f2w-gate.exiting {
  animation: f2w-gate-exit .45s var(--ease, cubic-bezier(.16,1,.3,1)) forwards;
  pointer-events: none;
}

/* ============================================================
   PLAYER SCREEN
============================================================ */
.f2w-player {
  background: var(--bg);
  /* site-top: padding 14px×2 + logo 34px + border 1px = 63px */
  padding-top: 63px;
  padding-bottom: clamp(1.25rem, 3vw, 2.5rem);
}

/* Entrance animation */
@keyframes f2w-player-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.f2w-player.entering {
  animation: f2w-player-in .55s var(--ease, cubic-bezier(.16,1,.3,1)) .35s both;
}

/* ---- Player topbar ---- */
.f2w-player-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.4rem clamp(1.25rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--line);
}

.f2w-crumb {
  display: flex;
  align-items: center;
  gap: .8rem;
}

.f2w-crumb-label {
  font-family: var(--f-h);
  font-size: .85rem;
  letter-spacing: .06em;
  color: rgba(180, 195, 220, .4);
}

.f2w-verified {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .74rem;
  font-weight: 700;
  color: var(--amber);
  background: var(--amber-dim);
  border: 1px solid var(--f2w-border);
  padding: .28rem .78rem;
  border-radius: 999px;
  letter-spacing: .02em;
}

/* ---- Video stage (full-width black bar) ---- */
.f2w-stage {
  width: 100%;
  background: #000;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.f2w-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.f2w-video {
  width: 100%;
  height: 100%;
  display: block;
}
.f2w-video:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* ---- Watermark overlay ---- */
.f2w-watermark {
  position: absolute;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  font-family: 'Courier New', monospace;
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .03em;
  color: rgba(255, 255, 255, 0.15);
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
  white-space: nowrap;
  z-index: 10;
  transition: top 1.2s ease, left 1.2s ease;
  line-height: 1.4;
  max-width: 50%;           /* jangan overflow ke kanan */
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 600px) {
  .f2w-watermark { font-size: .68rem; }
}

/* Session-expired overlay */
.f2w-expired {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 20, .92);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.4rem;
  text-align: center;
  padding: 2rem;
  color: rgba(180, 195, 220, .75);
  font-size: .9rem;
}
.f2w-expired.visible { display: flex; }
.f2w-expired p { max-width: 28ch; line-height: 1.55; }

/* ---- Below-player layout ---- */
.f2w-below { padding-top: 0; }

.f2w-episode-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
@media (max-width: 820px) {
  .f2w-episode-grid { grid-template-columns: 1fr; }
}

/* Episode main info */
.f2w-ep-eyebrow {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: .45rem;
}

.f2w-ep-title {
  font-family: var(--f-h);
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  color: var(--ink2);
  line-height: 1.1;
  letter-spacing: -.01em;
  margin-bottom: .8rem;
}

.f2w-ep-desc {
  color: var(--muted);
  font-size: .93rem;
  line-height: 1.7;
  max-width: 54ch;
  margin-bottom: 1.2rem;
}

.f2w-ep-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.f2w-tag {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .07em;
  color: rgba(180, 195, 220, .45);
  border: 1px solid rgba(180, 195, 220, .1);
  padding: .22rem .6rem;
  border-radius: 999px;
  text-transform: uppercase;
}
.f2w-tag-amber {
  color: var(--amber);
  border-color: var(--f2w-border);
  background: var(--amber-dim);
}

/* Side cards */
.f2w-side { display: flex; flex-direction: column; gap: .9rem; }

.f2w-card {
  padding: 1.4rem;
  border-radius: 16px;
  border: 1px solid rgba(200, 146, 42, 0.13);
  background: linear-gradient(135deg, rgba(200, 146, 42, 0.055) 0%, rgba(200, 146, 42, 0.018) 100%);
}

.f2w-card-icon { width: 22px; height: 22px; color: var(--amber); margin-bottom: .6rem; display: block; }

.f2w-card h3 {
  font-family: var(--f-h);
  font-size: .95rem;
  color: var(--ink2);
  margin-bottom: .35rem;
}

.f2w-card p {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: .9rem;
}

.f2w-btn-coffee {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .82rem 1.2rem;
  border-radius: 10px;
  background: var(--amber);
  color: #05090E;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .04em;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: transform .28s var(--ease), box-shadow .28s, background .2s;
}
.f2w-btn-coffee:hover {
  background: var(--amber-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(200, 146, 42, .3);
}
.f2w-btn-coffee svg { width: 13px; height: 13px; flex-shrink: 0; }

.f2w-share-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
}

.f2w-btn-ig,
.f2w-btn-tiktok {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .72rem .8rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform .22s var(--ease), box-shadow .22s;
  text-decoration: none;
  white-space: nowrap;
  border: none;
}
.f2w-btn-ig svg,
.f2w-btn-tiktok svg { width: 15px; height: 15px; flex-shrink: 0; }

.f2w-btn-ig {
  background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #fff;
}
.f2w-btn-ig:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220, 39, 67, .3);
}

.f2w-btn-tiktok {
  background: #000;
  color: #fff;
}
.f2w-btn-tiktok:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}

/* ep-header row: badges above episode title */
.f2w-ep-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 1rem;
}

/* CTA band */
.f2w-player .cta-band {
  margin-top: clamp(1rem, 3vw, 2rem);
  margin-bottom: 0;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 480px) {
  .f2w-gate-content { padding-left: 1.25rem; padding-right: 1.25rem; }
  .f2w-player-topbar { padding-left: 1.25rem; padding-right: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  .f2w-steam,
  .f2w-gate.active .f2w-collab-badge,
  .f2w-gate.active .f2w-cup-wrap,
  .f2w-gate.active .f2w-gate-headline,
  .f2w-gate.active .f2w-gate-sub,
  .f2w-gate.active .f2w-gate-form,
  .f2w-gate.active .f2w-gate-hint,
  .f2w-gate.exiting,
  .f2w-player.entering { animation: none !important; }
}
