/* =====================================================================
   AsiaStream Download Page (/d/:id) — Light-Sakuga skin
   Ink #0f172a · Canvas #f8fafc · Orange #f97316 · Purple #c026d3
   ===================================================================== */
html body.light-theme {
  background: #f8fafc !important;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(15, 23, 42, .07) 1px, transparent 0) !important;
  background-size: 22px 22px !important;
  color: #0f172a !important;
}
html body.light-theme canvas#matrixCanvas { display: none !important; }

/* ---------- Header (synced 1:1 with index.html) ---------- */
html body.light-theme > header {
  background: rgba(255, 255, 255, .94) !important;
  border: none !important;
  border-bottom: 1.5px solid #e2e8f0 !important;
  box-shadow: 0 2px 12px rgba(15, 23, 42, .04) !important;
  backdrop-filter: blur(12px) !important;
}
html body.light-theme > header .text-white { color: #0f172a !important; }
html body.light-theme > header a span.text-transparent {
  background-image: linear-gradient(90deg, #f97316, #c026d3) !important;
}
html body.light-theme > header:not(.as-site-header) a > div > span.font-mono {
  background: #fff7ed !important; color: #c2410c !important;
  border: 1.5px solid #0f172a !important;
}
html body.light-theme .dl-nav-link {
  position: relative; color: #334155 !important; font-weight: 700;
  padding: 4px 0; transition: color .15s ease;
}
html body.light-theme .dl-nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2.5px;
  background: linear-gradient(90deg, #f97316, #c026d3); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform .22s cubic-bezier(.22,1,.36,1);
}
html body.light-theme .dl-nav-link:hover { color: #0f172a !important; }
html body.light-theme .dl-nav-link:hover::after { transform: scaleX(1); }

/* ---------- Player frame ---------- */
html body.light-theme .video-frame {
  border: 2.5px solid #0f172a !important;
  box-shadow: 6px 6px 0 #0f172a !important;
  border-radius: 18px !important;
  background: #0f172a !important;
}

/* ---------- Title + meta chips ---------- */
html body.light-theme .vid-title {
  color: #0f172a !important; font-weight: 900 !important;
  letter-spacing: -.01em;
}
html body.light-theme .meta-tag-row > span {
  border: 2px solid #0f172a !important;
  border-radius: 999px !important;
  box-shadow: 2px 2px 0 #0f172a !important;
  font-weight: 800 !important;
  background: #ffffff !important;
  color: #0f172a !important;
  padding: 4px 11px !important;
}
html body.light-theme .meta-tag-row > span[class*="emerald"] { background: #d1fae5 !important; color: #047857 !important; }
html body.light-theme .meta-tag-row > span[class*="sky"]     { background: #dbeafe !important; color: #1d4ed8 !important; }
html body.light-theme .meta-tag-row > span[class*="cyan"]    { background: #cffafe !important; color: #0e7490 !important; }

/* ---------- Main download card ---------- */
html body.light-theme .master-dl-card {
  background: #ffffff !important;
  border: 2.5px solid #0f172a !important;
  border-radius: 20px !important;
  box-shadow: 6px 6px 0 #0f172a !important;
}
html body.light-theme .master-dl-card::before,
html body.light-theme .master-dl-card::after { display: none !important; }

/* Countdown box */
html body.light-theme #countdownBox {
  background: #fffbeb !important;
  border: 2px solid #0f172a !important;
  box-shadow: 3px 3px 0 #0f172a !important;
}
html body.light-theme #countdownBox .text-amber-300,
html body.light-theme #countdownBox .text-amber-400 { color: #b45309 !important; }
html body.light-theme #countdownBox #timer { color: #0f172a !important; }
html body.light-theme #countdownBox .text-gray-400 { color: #475569 !important; }
html body.light-theme #countdownBox .text-emerald-400 { color: #047857 !important; }
html body.light-theme #countdownBox .bg-gray-800 {
  background: #ffffff !important;
  border: 2px solid #0f172a !important;
  height: 12px !important;
}
html body.light-theme #progressBar {
  background: repeating-linear-gradient(-45deg, #f97316 0 10px, #fb923c 10px 20px) !important;
  background-size: 28px 28px !important;
  animation: asDlStripes .8s linear infinite;
  border-right: 2px solid #0f172a;
}
@keyframes asDlStripes { to { background-position: 28px 0; } }

/* Resolution selector */
html body.light-theme #qualitySelectorBox {
  background: #f8fafc !important;
  border: 2px solid #0f172a !important;
}
html body.light-theme #qualitySelectorBox > span { color: #0f172a !important; font-weight: 900 !important; }
html body.light-theme #qualitySelectorBox button {
  border: 2px solid #0f172a !important;
  background: #ffffff !important;
  color: #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease !important;
}
html body.light-theme #qualitySelectorBox button.bg-amber-500,
html body.light-theme #qualitySelectorBox button[class*="bg-amber-500"] {
  background: #f97316 !important; color: #ffffff !important;
}
html body.light-theme #qualitySelectorBox button:not([disabled]):hover { transform: translate(-1px,-1px) !important; box-shadow: 3px 3px 0 #0f172a !important; }
html body.light-theme #qualitySelectorBox button[disabled] {
  background: #f1f5f9 !important; color: #94a3b8 !important; box-shadow: none !important;
  border-style: dashed !important; opacity: 1 !important;
}

/* Big download button */
html body.light-theme .pulsing-dl-btn {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 45%, #c026d3 100%) !important;
  color: #ffffff !important;
  border: 3px solid #0f172a !important;
  box-shadow: 6px 6px 0 #0f172a !important;
  text-shadow: 2px 2px 0 rgba(15, 23, 42, .35) !important;
  animation: none !important;
  position: relative; overflow: hidden;
  transition: transform .14s cubic-bezier(.22,1,.36,1), box-shadow .14s ease !important;
}
html body.light-theme .pulsing-dl-btn::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-18deg);
  animation: asDlSheen 2.8s ease-in-out infinite;
}
@keyframes asDlSheen { 0%, 55% { left: -60%; } 100% { left: 130%; } }
html body.light-theme .pulsing-dl-btn:hover { transform: translate(-2px,-3px) !important; box-shadow: 8px 9px 0 #0f172a !important; }
html body.light-theme .pulsing-dl-btn:active { transform: translate(4px,4px) !important; box-shadow: 2px 2px 0 #0f172a !important; }
html body.light-theme .pulsing-dl-btn svg { filter: drop-shadow(2px 2px 0 rgba(15,23,42,.35)); }

/* Security pills */
html body.light-theme .security-pill-card {
  background: #ffffff !important;
  border: 2px solid #0f172a !important;
  box-shadow: 2px 2px 0 #0f172a !important;
}
html body.light-theme .security-pill-card.text-emerald-400 { background: #ecfdf5 !important; color: #047857 !important; }
html body.light-theme .security-pill-card.text-cyan-400 { background: #ecfeff !important; color: #0e7490 !important; }
html body.light-theme .security-pill-card.text-amber-400 { background: #fffbeb !important; color: #b45309 !important; }

/* Toolbar buttons */
html body.light-theme .master-dl-card .border-t { border-top: 2px dashed #0f172a !important; }
html body.light-theme .dl-tool-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px !important;
  background: #ffffff !important; color: #0f172a !important;
  border: 2px solid #0f172a !important; border-radius: 12px !important;
  box-shadow: 3px 3px 0 #0f172a !important;
  font-size: 12px; font-weight: 800 !important;
  transition: transform .12s cubic-bezier(.22,1,.36,1), box-shadow .12s ease, background-color .12s ease !important;
}
html body.light-theme .dl-tool-btn:hover { background: #fff7ed !important; transform: translate(-1px,-2px) !important; box-shadow: 4px 5px 0 #0f172a !important; }
html body.light-theme .dl-tool-btn:active { transform: translate(2px,2px) !important; box-shadow: 1px 1px 0 #0f172a !important; }
html body.light-theme .dl-tool-btn.dl-tool-warn { background: #fff1f2 !important; color: #be123c !important; }
html body.light-theme a.dl-tool-btn.ml-auto { background: linear-gradient(135deg, #f97316, #c026d3) !important; color: #ffffff !important; }
html body.light-theme a.dl-tool-btn.ml-auto:hover { background: linear-gradient(135deg, #fb923c, #d946ef) !important; }

/* Ad slots: neutral light placeholders */
html body.light-theme #adSlotTop728,
html body.light-theme #adSlotMid300,
html body.light-theme #adSlotNative {
  background: #ffffff !important;
  border: 2px dashed #cbd5e1 !important;
}

/* ---------- Modals ---------- */
html body.light-theme .dl-modal-backdrop { background: rgba(15, 23, 42, .45) !important; backdrop-filter: blur(4px) !important; }
html body.light-theme .dl-modal-card {
  background: #ffffff !important; color: #0f172a !important;
  border: 2.5px solid #0f172a !important; border-radius: 20px !important;
  box-shadow: 7px 7px 0 #0f172a !important;
  animation: asDlPop .24s cubic-bezier(.22,1,.36,1);
}
@keyframes asDlPop { from { opacity: 0; transform: translateY(10px) scale(.95) rotate(-.6deg); } to { opacity: 1; transform: none; } }
html body.light-theme .dl-modal-card h3 { color: #0f172a !important; font-weight: 900 !important; }
html body.light-theme .dl-modal-card label,
html body.light-theme .dl-modal-card p { color: #475569 !important; font-weight: 700; }
html body.light-theme .dl-modal-close {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  background: #ffffff !important; color: #0f172a !important;
  border: 2px solid #0f172a !important; border-radius: 10px !important;
  box-shadow: 2px 2px 0 #0f172a !important; font-weight: 900;
}
html body.light-theme .dl-modal-close:hover { background: #0f172a !important; color: #ffffff !important; }
html body.light-theme .dl-modal-input {
  width: 100%; background: #f8fafc !important; color: #0f172a !important;
  border: 2px solid #0f172a !important; border-radius: 12px !important;
  padding: 9px 12px !important; box-shadow: 2px 2px 0 #e2e8f0 !important;
}
html body.light-theme .dl-modal-input:focus { outline: none; border-color: #f97316 !important; box-shadow: 3px 3px 0 #f97316 !important; }
html body.light-theme .dl-modal-card button[type="submit"] {
  background: #f97316 !important; color: #ffffff !important;
  border: 2px solid #0f172a !important; box-shadow: 3px 3px 0 #0f172a !important; font-weight: 900 !important;
}

/* ---------- Footer ---------- */
html body.light-theme > footer { border-top: 2px solid #0f172a !important; }
html body.light-theme .dl-foot-link { color: #334155 !important; font-weight: 700; transition: color .15s ease; }
html body.light-theme .dl-foot-link:hover { color: #ea580c !important; }
html body.light-theme > footer .text-gray-600 { color: #64748b !important; }

@media (prefers-reduced-motion: reduce) {
  html body.light-theme #progressBar,
  html body.light-theme .pulsing-dl-btn::after { animation: none !important; }
}

html body.light-theme .dl-modal-card a.text-amber-400 { color: #c2410c !important; font-weight: 800; }

/* ---------- Synced site header / footer ---------- */
html body.light-theme .as-brand-text { color: #0f172a !important; }
html body.light-theme .as-brand-grad {
  background: linear-gradient(90deg, #f97316, #c026d3); -webkit-background-clip: text; background-clip: text;
  color: transparent !important; -webkit-text-fill-color: transparent !important;
}
html body.light-theme .as-brand-sub { color: #ea580c !important; }
html body.light-theme .as-portal-cta {
  background: linear-gradient(135deg, #f97316 0%, #c026d3 100%) !important;
  color: #ffffff !important; border: 2px solid #0f172a !important; box-shadow: 3px 3px 0 #0f172a !important;
  transition: transform .14s cubic-bezier(.22,1,.36,1), box-shadow .14s ease !important;
}
html body.light-theme .as-portal-cta:hover { transform: translate(-1px,-2px); box-shadow: 4px 5px 0 #0f172a !important; }
html body.light-theme .as-portal-cta:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 #0f172a !important; }
html body.light-theme > footer.as-site-footer { border-top: 2.5px solid #0f172a !important; background: transparent !important; color: #334155 !important; }
html body.light-theme .as-foot-muted { color: #64748b !important; }
html body.light-theme .as-foot-portal { color: #ea580c !important; font-weight: 900 !important; }
html body.light-theme .as-foot-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: #ffffff; color: #0f172a; border: 1.5px solid #0f172a; box-shadow: 2px 2px 0 #0f172a; font-weight: 700;
}
html body.light-theme .as-chip-ok { background: #ecfdf5; color: #047857; }
html body.light-theme .as-dot { width: 6px; height: 6px; border-radius: 50%; background: #10b981; animation: asDot 1.6s ease-in-out infinite; }
@keyframes asDot { 50% { opacity: .35; } }
@media (max-width: 767px) { html body.light-theme .as-portal-cta span:first-child { display: none; } }

/* Full-width header/footer exactly like main site */
html body.light-theme > header.as-site-header {
  border: 0 !important; border-bottom: 2.5px solid #0f172a !important; border-radius: 0 !important;
  box-shadow: 0 2px 0 rgba(15,23,42,.06) !important; background: rgba(255,255,255,.96) !important;
}
html body.light-theme > footer.as-site-footer { background: #ffffff !important; }
html body.light-theme .as-chip-ok { background: #ffffff !important; }