/* Callers: studio.html <link href="/webapp/studio_webapp.css">.
   Schema: body.studio-webapp-page; #root React mount.
   GateGuard facts:
   1) Caller: account_server/static/webapp/studio.html (stylesheet link).
   2) Glob studio* before create = only studio.html; no studio_webapp.css existed.
   3) No data files — presentation CSS only.
   4) User: "Implement the plan as specified… Don't stop until you have completed all the to-dos."
      Plan Vague 1: Funscript Studio shell styles. */
body.studio-webapp-page {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: #151020;
  background-image:
    radial-gradient(ellipse 150% 100% at 50% -20%, rgba(255, 105, 180, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 120% 90% at 100% 30%, rgba(0, 212, 255, 0.28) 0%, transparent 50%),
    linear-gradient(180deg, #1a1525 0%, #151020 40%, #0f0d15 100%);
  background-attachment: fixed;
  color: #e8edf7;
  font-family: Inter, system-ui, sans-serif;
}

.web-topbar--studio {
  position: relative;
  z-index: 5000;
  flex-shrink: 0;
  overflow: visible;
  pointer-events: auto;
}
body.studio-webapp-page .web-account,
body.studio-webapp-page .web-account-btn,
body.studio-webapp-page .web-account-menu {
  pointer-events: auto;
}
body.studio-webapp-page .web-account-menu { z-index: 5001; }

.studio-webapp-main {
  position: relative;
  height: calc(100vh - var(--web-top-h, 64px));
  width: 100%;
  overflow: hidden;
}

/* Splash — Funscript Studio open (brand cyan/pink on #151020).
   User: « a l'ouverture du studio je veux un beau logo, affichage pro, dans le theme ». */
.studio-shell-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% 42%, rgba(0, 212, 255, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 58% 58%, rgba(255, 20, 147, 0.1) 0%, transparent 50%);
}
.studio-shell-placeholder[hidden] {
  display: none !important;
}
.studio-shell-placeholder.is-leaving {
  pointer-events: none;
  animation: studioSplashOut 0.28s ease forwards;
}
@keyframes studioSplashOut {
  to { opacity: 0; transform: scale(1.02); }
}
@media (prefers-reduced-motion: reduce) {
  .studio-shell-placeholder.is-leaving { animation: none; opacity: 0; }
}

.studio-splash {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  max-width: 420px;
  animation: studioSplashIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.studio-splash-glow {
  position: absolute;
  inset: 20% 10% auto;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.22) 0%, rgba(255, 20, 147, 0.12) 45%, transparent 70%);
  filter: blur(28px);
  pointer-events: none;
  z-index: 0;
  animation: studioSplashPulse 3.2s ease-in-out infinite;
}
.studio-splash-mark {
  position: relative;
  z-index: 1;
  width: 128px;
  height: 128px;
  margin-bottom: 22px;
  display: grid;
  place-items: center;
}
.studio-splash-logo {
  width: 128px;
  height: 128px;
  filter: drop-shadow(0 0 18px rgba(0, 212, 255, 0.35));
}
.studio-splash-ring {
  transform-origin: 60px 60px;
  animation: studioSplashSpin 4.5s linear infinite;
}
.studio-splash-wave {
  stroke-dasharray: 180;
  stroke-dashoffset: 180;
  animation: studioSplashDraw 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
}

.studio-splash-wordmark {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.studio-splash-brand {
  font-size: clamp(1.55rem, 3.5vw, 2rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.studio-splash-brand .wm-my {
  font-weight: 400;
  color: #fff;
}
.studio-splash-brand .wm-hap {
  font-weight: 800;
  color: #00d4ff;
}
.studio-splash-product {
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #00d4ff 0%, #ff6bb5 55%, #ff1493 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.studio-splash-tag {
  position: relative;
  z-index: 1;
  margin: 14px 0 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(154, 163, 181, 0.95);
  letter-spacing: 0.02em;
}
.studio-splash-bar {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  width: min(220px, 55vw);
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.studio-splash-bar-fill {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00d4ff, #ff1493);
  animation: studioSplashBar 1.35s ease-in-out infinite;
}
.studio-splash-status {
  position: relative;
  z-index: 1;
  margin: 14px 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(0, 212, 255, 0.85);
  letter-spacing: 0.04em;
  min-height: 1.2em;
}

.studio-shell-placeholder.is-error .studio-splash-status {
  color: #ff8fab;
}
.studio-shell-placeholder.is-error .studio-splash-bar-fill {
  background: linear-gradient(90deg, #ff6b8a, #ff1493);
  animation: none;
  width: 100%;
}
.studio-shell-placeholder.is-error .studio-splash-glow {
  background: radial-gradient(circle, rgba(255, 20, 147, 0.22) 0%, transparent 70%);
  animation: none;
}

@keyframes studioSplashIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes studioSplashSpin {
  to { transform: rotate(360deg); }
}
@keyframes studioSplashDraw {
  to { stroke-dashoffset: 0; }
}
@keyframes studioSplashPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}
@keyframes studioSplashBar {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}

@media (prefers-reduced-motion: reduce) {
  .studio-splash,
  .studio-splash-glow,
  .studio-splash-ring,
  .studio-splash-wave,
  .studio-splash-bar-fill {
    animation: none !important;
  }
  .studio-splash-wave { stroke-dashoffset: 0; }
  .studio-splash-bar-fill { width: 100%; transform: none; }
}

.studio-phone-back {
  display: inline-flex;
  margin-top: 16px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(0, 212, 255, 0.45);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
}
.studio-react-root {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.studio-react-root:not([hidden]) {
  display: block; /* App uses absolute inset-0 — flex would collapse with only absolute child */
}

/* Timeline drawing canvas (Canvas2D web / PIXI desktop): clicks on parent handlers.
   User: « toujours vide ! » — keep 2D canvas visible; do not zero size. */
.studio-react-root .studio-glass-timeline canvas,
.studio-webapp-page .studio-glass-timeline canvas {
  pointer-events: none !important;
  display: block !important;
  max-width: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Web: keep toolbar above video but never above timeline hit-target */
.studio-webapp-page .studio-glass-toolbar {
  z-index: 30 !important;
  transform: none !important;
  will-change: auto !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(26, 21, 37, 0.92) !important;
}

/* Tooltips: opaque (backdrop-filter blanked labels → diamond-only).
   User: « Les etiquettes ne sont pas bonne sur la deuxieme image ». */
.studio-webapp-page .studio-glass-tooltip,
body .studio-glass-tooltip {
  background: rgba(26, 21, 37, 0.96) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  z-index: 10000;
}

/* Opaque timeline panel — identical contrast to desktop; no backdrop-filter over WebGL */
.studio-webapp-page .studio-glass-timeline {
  position: relative;
  z-index: 40;
  pointer-events: auto;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: #151020 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  min-height: 230px;
}
.studio-webapp-page .studio-glass-timeline .flex-1 {
  min-height: 160px;
}
