/* Callers: gallery.html web chrome. API: none. Schema: none.
   User: « ON NE GARDE QUE GALLERIE LOCALE ET WEB… DEPORTER CES ONGLET EN HAUT ET SUPPRIMER LE LAYOUT DE GAUCHE » */
:root {
  --web-top-h: 64px;
  --web-cyan: #00d4ff;
  --web-rose: #ff1493;
  --web-rose-soft: #ff69b4;
  --web-text: #e8edf7;
  --web-muted: #9aa3b5;
  --web-line: rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, system-ui, sans-serif;
  color: var(--web-text);
}
body.library-page {
  overflow-x: hidden;
  background: var(--app-bg-color, #151020);
  background-image: var(--app-bg-image);
  background-attachment: fixed;
}

.web-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--web-top-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: rgba(21, 16, 32, 0.72);
  border-bottom: 1px solid var(--web-line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.web-brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  text-decoration: none;
}
.web-brand svg { display: block; width: 200px; height: 44px; }

.web-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.web-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--web-muted);
  border: 1px solid transparent;
  background: transparent;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.web-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.web-tab.is-active {
  color: #041018;
  background: var(--web-cyan);
  border-color: transparent;
}

.web-search {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 420px;
  margin: 0 auto;
  position: relative;
}
.web-search input {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--web-text) !important;
  font: inherit;
  font-size: 0.9rem;
  padding: 10px 14px 10px 40px;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.web-search input::placeholder { color: #6b7280; }
.web-search input:hover { border-color: rgba(255, 255, 255, 0.22); }
.web-search input:focus {
  border-color: rgba(0, 212, 255, 0.55);
  background: rgba(255, 255, 255, 0.06) !important;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.12);
}
.web-search input:-webkit-autofill,
.web-search input:-webkit-autofill:hover,
.web-search input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--web-text);
  -webkit-box-shadow: 0 0 0 1000px #1a1525 inset;
  transition: background-color 9999s ease-out;
}
.web-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  pointer-events: none;
  display: flex;
}
.web-search:focus-within .web-search-icon { color: var(--web-cyan); }

.web-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  margin-left: auto;
}
.web-credits {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  gap: 2px;
}
.web-credits-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--web-muted);
}
.web-credits-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--web-text);
}
.web-who {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.85rem;
  color: #c5cad6;
}
.plan-freemium { color: var(--web-rose-soft); }
.plan-premium { color: var(--web-cyan); }
.plan-elite { color: #c4b5fd; }
.plan-web { color: #ff69b4; }

.web-account { position: relative; }
.web-account-icon { display: none; }
.web-account-identity { display: none; }
.web-account-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 212, 255, 0.35);
  background: rgba(0, 212, 255, 0.08);
  color: #e8f7ff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.web-account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 210px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(16, 12, 24, 0.88);
  backdrop-filter: blur(14px);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.web-account-menu[hidden] { display: none; }
.web-account-menu a,
.web-account-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #e8edf7;
  font: inherit;
  font-size: 0.82rem;
  text-decoration: none;
  cursor: pointer;
}
.web-account-menu a:hover,
.web-account-menu button:hover { background: rgba(255, 255, 255, 0.06); }
.web-trial-lock {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(8, 6, 14, 0.72);
  backdrop-filter: blur(8px);
}
.web-trial-card {
  width: min(420px, calc(100% - 32px));
  padding: 22px;
  border-radius: 18px;
  border: 1px solid rgba(255, 105, 180, 0.45);
  background: #14101c;
  text-align: center;
}
.web-trial-kicker { letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.72rem; }
.web-trial-kicker span { color: #ff69b4; }
.web-trial-pay {
  margin: 12px 8px 0;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(120deg, #fff, #7ad7ff 40%, #ff69b4);
  color: #140814;
}
.web-trial-card a { display: inline-block; margin-top: 12px; color: #7ad7ff; }

.web-signout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid rgba(255, 105, 180, 0.45);
  color: var(--web-rose-soft);
  background: rgba(255, 105, 180, 0.08);
  white-space: nowrap;
}
.web-signout:hover { background: rgba(255, 105, 180, 0.16); }

.web-main {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 48px;
}

/* Sticky library toolbar sits below top chrome */
body.library-page .compact-toolbar {
  top: calc(var(--web-top-h) + 8px);
}

.pick-folder-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid rgba(0, 212, 255, 0.45);
  color: var(--web-cyan);
  background: rgba(0, 212, 255, 0.08);
}
.pick-folder-btn:hover { background: rgba(0, 212, 255, 0.16); }

.web-stub {
  text-align: center;
  padding: 80px 20px;
  color: var(--web-muted);
}
.web-stub h1 {
  margin: 0 0 10px;
  color: var(--web-text);
  font-size: 1.4rem;
}
.web-stub p { margin: 0; line-height: 1.5; }

/* Callers: player.html, gallery.html, web.html. Not studio.html.
   API: /go/lovense-banner. Schema: none.
   User: « cette bannière, je la veux dans la web app. En bas de page… Sauf sur Funscript Studio ». */
.web-lovense-banner {
  display: flex;
  justify-content: center;
  padding: 28px 16px 40px;
}
.web-lovense-banner img {
  width: min(728px, 100%);
  height: auto;
  border-radius: 8px;
}

/* Opening splash for the web app. Callers: webapp_chrome.js on body.library-page.
   API: none. Schema: none.
   User: « à l'ouverture de l'application web… Studio on le remplace par Web en rose ». */
.web-splash {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 42%, rgba(0, 212, 255, 0.16) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 58% 58%, rgba(255, 20, 147, 0.14) 0%, transparent 50%),
    rgba(15, 13, 21, 0.92);
}
.web-splash.is-leaving { pointer-events: none; animation: webSplashOut 0.28s ease forwards; }
.web-splash-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 420px;
  text-align: center;
  animation: webSplashIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.web-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;
  animation: webSplashPulse 3.2s ease-in-out infinite;
}
.web-splash-mark { position: relative; width: 128px; height: 128px; margin-bottom: 22px; }
.web-splash-logo { width: 128px; height: 128px; filter: drop-shadow(0 0 18px rgba(0, 212, 255, 0.35)); }
.web-splash-ring { transform-origin: 60px 60px; animation: webSplashSpin 4.5s linear infinite; }
.web-splash-wave { stroke-dasharray: 180; stroke-dashoffset: 180; animation: webSplashDraw 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards; }
.web-splash-wordmark { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.web-splash-brand { font-size: clamp(1.55rem, 3.5vw, 2rem); line-height: 1; letter-spacing: -0.02em; }
.web-splash-brand .wm-my { font-weight: 400; color: #fff; }
.web-splash-brand .wm-hap { font-weight: 800; color: #00d4ff; }
.web-splash-product {
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ff4d9a;
}
.web-splash-tag { position: relative; margin: 14px 0 0; font-size: 0.82rem; color: rgba(154, 163, 181, 0.95); }
.web-splash-bar { position: relative; margin-top: 28px; width: min(220px, 55vw); height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.web-splash-bar-fill { display: block; height: 100%; width: 40%; border-radius: inherit; background: linear-gradient(90deg, #00d4ff, #ff1493); animation: webSplashBar 1.35s ease-in-out infinite; }
.web-splash-status { position: relative; margin: 14px 0 0; font-size: 0.78rem; font-weight: 600; color: rgba(0, 212, 255, 0.85); letter-spacing: 0.04em; }
@keyframes webSplashIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes webSplashOut { to { opacity: 0; transform: scale(1.02); } }
@keyframes webSplashSpin { to { transform: rotate(360deg); } }
@keyframes webSplashDraw { to { stroke-dashoffset: 0; } }
@keyframes webSplashPulse { 50% { opacity: 0.65; } }
@keyframes webSplashBar { 0% { transform: translateX(-120%); } 100% { transform: translateX(280%); } }
@media (prefers-reduced-motion: reduce) {
  .web-splash-card, .web-splash-glow, .web-splash-ring, .web-splash-wave, .web-splash-bar-fill, .web-splash.is-leaving { animation: none; }
  .web-splash-wave { stroke-dashoffset: 0; }
}

@media (max-width: 900px) {
  .web-topbar,
  .web-topbar--player {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: auto;
    padding: 6px 8px 8px;
    gap: 6px;
  }
  .web-brand { grid-column: 2; grid-row: 1; justify-self: center; }
  .web-brand svg { width: min(210px, 62vw); height: 34px; }
  .web-profile {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    margin: 0;
    min-width: 0;
  }
  .web-tabs { grid-column: 1 / -1; justify-content: center; }
  .web-search { grid-column: 1 / -1; max-width: none; margin: 0; }
  .web-player-back,
  a.web-tab[href$="/studio"],
  .web-credits,
  .web-who { display: none !important; }
  .web-account-label { display: none; }
  .web-account-icon { display: block; }
  .web-account-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
  }
  .web-account-menu .web-account-identity {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 10px 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.82rem;
  }
  .web-main { width: calc(100% - 12px); padding-top: 8px; }
}
