/* 360-video player — styles for the videosphere, play gate, control bar and
   quality menu. Standalone: every design token has a fallback, so it works with
   or without a host design system. Override --v360-* / --yellow / --font on a
   parent to theme it. */

.v360 {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 78vh;
  background: #0b0b0b radial-gradient(120% 90% at 50% 20%, #1c1c1c 0%, #060606 70%) no-repeat;
  border-radius: var(--radius-card, 20px);
  overflow: hidden;
  isolation: isolate;
}
.v360 a-scene,
.v360 canvas.a-canvas {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

/* play gate */
.v360-gate {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  cursor: pointer;
  background-size: cover;
  background-position: center;
  background-color: #101010;
  color: #fff;
  border: 0;
  width: 100%;
  font-family: var(--font, system-ui, sans-serif);
  transition: opacity .4s ease;
}
.v360-gate::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.15), rgba(0,0,0,.55));
  z-index: 0;
}
.v360-gate__btn, .v360-gate__label, .v360-gate__hint { position: relative; z-index: 1; }
.v360-gate__btn {
  width: 92px; height: 92px;
  border-radius: 50%;
  background: var(--yellow, #FFF500);
  display: grid; place-items: center;
  transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 8px 40px rgba(255,245,0,.28);
}
.v360-gate:hover .v360-gate__btn { transform: scale(1.06); }
.v360-gate__btn svg { width: 34px; height: 34px; margin-left: 5px; fill: #000; }
.v360-gate__label { font-size: 20px; font-weight: 600; letter-spacing: .01em; }
.v360-gate__hint { font-size: 14px; color: #cfcfcf; letter-spacing: .04em; }
.v360-gate.is-loading .v360-gate__btn { animation: v360-spin 1s linear infinite; box-shadow: none; }
@keyframes v360-spin { to { transform: rotate(360deg); } }
.v360-gate.is-hidden { opacity: 0; pointer-events: none; }

/* control bar */
.v360-controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(0deg, rgba(0,0,0,.72), rgba(0,0,0,0));
  opacity: 0;
  transition: opacity .25s ease;
  font-family: var(--font, system-ui, sans-serif);
  color: #fff;
}
.v360.is-active:hover .v360-controls,
.v360.is-active.show-controls .v360-controls { opacity: 1; }
.v360-controls button {
  background: none; border: 0; color: #fff; cursor: pointer;
  display: grid; place-items: center; padding: 4px;
}
.v360-controls button svg { width: 22px; height: 22px; fill: #fff; }
.v360-seek {
  flex: 1;
  -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 3px;
  background: rgba(255,255,255,.28);
  cursor: pointer;
}
.v360-seek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--yellow, #FFF500);
}
.v360-seek::-moz-range-thumb {
  width: 14px; height: 14px; border: 0; border-radius: 50%;
  background: var(--yellow, #FFF500);
}
.v360-time { font-size: 13px; font-variant-numeric: tabular-nums; color: #eaeaea; min-width: 96px; text-align: right; }

/* quality menu */
.v360-quality { position: relative; }
.v360-quality__btn {
  font-family: var(--font, system-ui, sans-serif); font-size: 12px; font-weight: 600; letter-spacing: .02em;
  color: #fff; white-space: nowrap;
  padding: 5px 12px !important;
  border-radius: var(--radius-pill, 100px) !important;
  background: rgba(255,255,255,.14) !important;
  min-width: 58px;
}
.v360-quality__btn:hover,
.v360-quality.is-open .v360-quality__btn { background: rgba(255,255,255,.26) !important; }
.v360-quality__menu {
  position: absolute; right: 0; bottom: calc(100% + 10px);
  min-width: 148px; padding: 6px;
  background: rgba(18,18,18,.95); border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
  display: none; flex-direction: column; gap: 2px;
}
.v360-quality.is-open .v360-quality__menu { display: flex; }
.v360-quality__item {
  display: flex !important; align-items: center; justify-content: space-between;
  gap: 16px; width: 100%;
  padding: 9px 12px !important; border-radius: 8px !important;
  font-family: var(--font, system-ui, sans-serif); font-size: 13px; color: #e8e8e8; white-space: nowrap;
}
.v360-quality__item:hover { background: rgba(255,255,255,.10) !important; }
.v360-quality__item.is-active { color: var(--yellow, #FFF500); }
.v360-quality__item .v360-q-sub { font-size: 11px; color: #9a9a9a; }

/* drag hint */
.v360-drag-hint {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 6; padding: 7px 16px; border-radius: var(--radius-pill, 100px);
  background: rgba(0,0,0,.5); color: #fff; font-size: 13px; letter-spacing: .03em;
  pointer-events: none; opacity: 0; transition: opacity .4s ease;
  font-family: var(--font, system-ui, sans-serif);
}
.v360.is-active .v360-drag-hint.show { opacity: 1; }

/* 360.strongnormal.ru additions (lisacorp/strong#554) */
.v360-controls button.v360-gyro svg { fill: rgba(255,255,255,.55); }
.v360-controls button.v360-gyro.is-on svg { fill: var(--yellow, #FFF500); }
/* fullscreen: real API and the iPhone fallback both fill the screen */
.v360:fullscreen { max-height: none; border-radius: 0; aspect-ratio: auto; width: 100%; height: 100%; }
.v360:-webkit-full-screen { max-height: none; border-radius: 0; aspect-ratio: auto; width: 100%; height: 100%; }
.v360.is-pseudo-full {
  position: fixed; inset: 0; z-index: 2147483000;
  width: 100vw; height: 100vh; height: 100dvh;
  max-height: none; aspect-ratio: auto; border-radius: 0;
}
.v360.is-pseudo-full .v360-controls { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
html.v360-lock, html.v360-lock body { overflow: hidden; overscroll-behavior: none; }
/* the seek bar shrinks first, so quality and fullscreen stay inside on 320 px phones */
.v360-seek { min-width: 0; }
.v360-controls > * { flex-shrink: 0; }
.v360-controls > .v360-seek { flex-shrink: 1; }
