/* ============================================================
   FLYFELT · 3D-ШОУРУМ — стили страницы и пульта
   ============================================================ */
.o3d-page {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.o3d-hero { border-bottom: none; padding-bottom: 10px; }

/* ---------- сцена ---------- */
.o3d-stage-wrap { margin-bottom: 26px; }
.o3d-canvas-box {
  position: relative;
  width: 100%;
  height: min(66vh, 700px);
  min-height: 380px;
  border-radius: 22px;
  overflow: hidden;
  background: #f0eadf;
  box-shadow: 0 30px 80px -34px rgba(52, 42, 28, 0.45), inset 0 0 0 1px var(--line-soft);
  touch-action: none;
}
#o3dCanvas { width: 100%; height: 100%; display: block; }

/* загрузочная вуаль */
.o3d-veil {
  position: absolute; inset: 0; z-index: 5;
  display: grid; place-items: center; align-content: center; gap: 12px;
  background: linear-gradient(180deg, #faf8f5, #f0eadf);
  transition: opacity .7s ease;
}
.o3d-veil.off { opacity: 0; pointer-events: none; }
.o3d-veil__mark {
  width: 54px; height: 54px; border-radius: 14px;
  background: var(--ink); color: var(--bg);
  display: grid; place-items: center;
  font: 700 26px/1 var(--font-display);
  animation: o3dPulse 1.4s ease-in-out infinite;
}
.o3d-veil__txt { font: 400 14px/1 var(--font-body); color: var(--ink-mute); letter-spacing: .04em; }
@keyframes o3dPulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.92); opacity: .75; } }

/* подсказка */
.o3d-hint {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 4;
  background: rgba(26, 24, 22, 0.82); color: #f3ede2;
  font: 400 13px/1.5 var(--font-body);
  padding: 11px 18px; border-radius: 14px;
  text-align: center; max-width: 86%;
  box-shadow: 0 14px 34px -14px rgba(0,0,0,.5);
  transition: opacity .4s ease, transform .4s ease;
  pointer-events: none;
}
.o3d-hint b { color: #fff; }
.o3d-hint.off { opacity: 0; transform: translateX(-50%) translateY(8px); }

/* тулбар выбранной панели (как в конструкторе) */
.o3d-tool {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 4;
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(26,24,22,.9); color: #f3ede2;
  border-radius: 999px; padding: 6px 10px;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.55);
}
.o3d-tool[hidden] { display: none !important; }
.o3d-tool__btn {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: none; border: none; color: #f3ede2; cursor: pointer;
  font: 600 12px/1 var(--font-body);
  transition: background .15s ease;
}
.o3d-tool__btn:hover { background: rgba(255,255,255,.14); }
.o3d-tool__btn svg { width: 17px; height: 17px; }
.o3d-tool__btn--danger:hover { background: #b4553f; }
.o3d-tool__angle { display: inline-flex; align-items: center; gap: 2px; font: 500 13px/1 var(--font-body); }
.o3d-tool__input {
  width: 44px; background: rgba(255,255,255,.1); color: #fff;
  border: 1px solid rgba(255,255,255,.18); border-radius: 8px;
  font: 600 13px/1.4 var(--font-body); text-align: center; padding: 5px 2px;
  -moz-appearance: textfield; appearance: textfield;
}
.o3d-tool__input:focus { outline: none; border-color: var(--accent); }
.o3d-tool__sep { width: 1px; height: 20px; background: rgba(255,255,255,.16); margin: 0 3px; }

/* ---------- пульт ---------- */
.o3d-dock {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "tabs actions" "chips actions" "sizes actions";
  align-items: center; gap: 8px 14px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  box-shadow: 0 14px 40px -22px rgba(52,42,28,.35);
  padding: 10px 12px;
}
.o3d-tabs { grid-area: tabs; display: flex; gap: 4px; }
.o3d-tab {
  font: 600 12.5px/1 var(--font-body); letter-spacing: .03em;
  color: var(--ink-soft);
  background: none; border: 1px solid transparent; border-radius: 999px;
  padding: 8px 14px; cursor: pointer; transition: all .2s ease;
}
.o3d-tab:hover { color: var(--ink); border-color: var(--line); }
.o3d-tab.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
/* десктоп: карточки переносятся рядами — видны ВСЕ решения без прокрутки */
.o3d-chips { grid-area: chips; display: flex; flex-wrap: wrap; gap: 6px; padding: 2px; min-width: 0; }
.o3d-chips::-webkit-scrollbar { display: none; }
.o3d-chip {
  flex: none;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  min-width: 74px; padding: 8px 10px 7px;
  background: none; border: 1px solid var(--line); border-radius: 13px;
  cursor: pointer; transition: all .2s ease;
  color: var(--ink-soft);
}
.o3d-chip svg { width: 38px; height: 34px; fill: none; stroke: currentColor; stroke-width: 2; }
.o3d-chip img {
  width: 44px; height: 34px; object-fit: contain; display: block;
  filter: drop-shadow(0 2px 3px rgba(52,42,28,.18));
}
.o3d-chip span { font: 500 10.5px/1 var(--font-body); letter-spacing: .02em; white-space: nowrap; }
.o3d-chip:hover { border-color: var(--accent-soft, #b79b74); color: var(--ink); }
.o3d-chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.o3d-chip.on img { filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)) brightness(1.12); }

/* размеры (из конструктора) */
.o3d-sizes { grid-area: sizes; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; min-width: 0; }
.o3d-sizes::-webkit-scrollbar { display: none; }
.o3d-size {
  flex: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 12px;
  background: none; border: 1px solid var(--line); border-radius: 11px;
  cursor: pointer; transition: all .2s ease;
  color: var(--ink-soft);
}
.o3d-size b { font: 600 12px/1 var(--font-body); letter-spacing: .02em; }
.o3d-size span { font: 400 10px/1 var(--font-body); color: inherit; opacity: .75; white-space: nowrap; }
.o3d-size:hover { border-color: var(--accent-soft, #b79b74); color: var(--ink); }
.o3d-size.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.o3d-actions { grid-area: actions; display: flex; align-items: center; gap: 8px; flex: none; }
.o3d-color {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 13.5px/1 var(--font-body); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  background: none; padding: 12px 16px; cursor: pointer; transition: all .2s;
}
.o3d-color:hover { border-color: var(--accent); }
.o3d-color__dot { width: 17px; height: 17px; border-radius: 50%; border: 1px solid rgba(0,0,0,.14); background: #7a8c5e; }
.o3d-ghost {
  font: 600 13.5px/1 var(--font-body); color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 999px;
  background: none; padding: 12px 16px; cursor: pointer; transition: all .2s;
}
.o3d-ghost:hover { color: #b4553f; border-color: #b4553f; }
.o3d-go {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 14px/1 var(--font-body); color: #fff;
  background: linear-gradient(135deg, #b79b74, var(--accent));
  border: none; border-radius: 999px; padding: 13px 20px;
  cursor: pointer; transition: all .25s;
  box-shadow: 0 10px 26px -10px var(--accent);
}
.o3d-go b { background: rgba(255,255,255,.22); border-radius: 999px; min-width: 22px; height: 20px; line-height: 20px; text-align: center; font-size: 12px; padding: 0 6px; }
.o3d-go:hover { transform: translateY(-1px); box-shadow: 0 14px 34px -10px var(--accent); }
.o3d-go:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* пояснение */
.o3d-note { max-width: 760px; margin: 0 auto 70px; }
.o3d-note p { font: 400 14px/1.65 var(--font-body); color: var(--ink-mute); text-align: center; }

/* ---------- мобильные ---------- */
@media (max-width: 920px) {
  .o3d-canvas-box { height: 56vh; min-height: 330px; border-radius: 16px; }
  .o3d-dock {
    grid-template-columns: 1fr;
    grid-template-areas: "tabs" "chips" "sizes" "actions";
    gap: 10px; padding: 10px;
  }
  .o3d-tool { top: 10px; max-width: 96%; }
  .o3d-tool__btn { width: 38px; height: 38px; }
  .o3d-tabs { justify-content: center; }
  /* мобилка: обратно в одну строку со свайпом (пальцем листается нормально) */
  .o3d-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .o3d-actions { justify-content: space-between; }
  .o3d-go { flex: 1 1 auto; justify-content: center; }
  .o3d-chip { min-width: 66px; }
  .o3d-hint { font-size: 12px; bottom: 12px; }
  .o3d-note { margin-bottom: 40px; }
}

/* кинематографичная виньетка поверх сцены */
.o3d-canvas-box::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 42%, transparent 62%, rgba(52, 42, 28, 0.14) 100%);
}

/* переключатель фото-зон */
.o3d-scenes {
  position: absolute; top: 14px; left: 14px; z-index: 4;
  display: inline-flex; gap: 4px;
  background: rgba(26,24,22,.55); backdrop-filter: blur(6px);
  border-radius: 999px; padding: 4px;
}
.o3d-scene {
  font: 600 12.5px/1 var(--font-body); letter-spacing: .03em;
  color: #f3ede2; background: none; border: none; border-radius: 999px;
  padding: 9px 16px; cursor: pointer; transition: all .2s ease;
}
.o3d-scene.on { background: #f3ede2; color: #1a1816; }
@media (max-width: 920px) {
  .o3d-scenes { top: 10px; left: 10px; }
  .o3d-tool { top: 10px; left: auto; right: 10px; transform: none; }
}

/* хотспоты-переходы (как в турах) */
.o3d-spot {
  position: absolute; z-index: 4;
  width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.22);
  backdrop-filter: blur(3px);
  box-shadow: 0 0 0 2px rgba(255,255,255,.75), 0 8px 22px -8px rgba(0,0,0,.5);
  display: grid; place-items: center;
  transition: transform .2s ease, background .2s ease;
  animation: o3dSpotPulse 2.2s ease-in-out infinite;
}
.o3d-spot span {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,.35);
}
.o3d-spot:hover { transform: scale(1.15); background: rgba(255,255,255,.4); }
@keyframes o3dSpotPulse { 0%,100% { box-shadow: 0 0 0 2px rgba(255,255,255,.75), 0 8px 22px -8px rgba(0,0,0,.5); } 50% { box-shadow: 0 0 0 6px rgba(255,255,255,.35), 0 8px 22px -8px rgba(0,0,0,.5); } }

/* бейдж текущей зоны */
.o3d-zonebadge {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%) translateY(-6px);
  z-index: 4; pointer-events: none;
  background: rgba(26,24,22,.72); color: #f3ede2;
  font: 600 12px/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase;
  padding: 9px 18px; border-radius: 999px;
  opacity: 0; transition: opacity .35s ease, transform .35s ease;
  backdrop-filter: blur(4px);
}
.o3d-zonebadge.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* чипы-«персонажи»: парение и вращение при наведении */
.o3d-chips { perspective: 520px; }
.o3d-chip img, .o3d-chip svg { transition: transform .25s ease; transform-style: preserve-3d; }
.o3d-chip:hover img, .o3d-chip:hover svg {
  animation: o3dChipSpin 1.4s linear infinite;
  filter: drop-shadow(0 10px 14px rgba(52,42,28,.35));
}
.o3d-chip.on img, .o3d-chip.on svg { animation: o3dChipSpin 2.2s linear infinite; }
@keyframes o3dChipSpin {
  0%   { transform: rotateY(0deg)   translateY(0); }
  25%  { transform: rotateY(90deg)  translateY(-4px); }
  50%  { transform: rotateY(180deg) translateY(0); }
  75%  { transform: rotateY(270deg) translateY(-4px); }
  100% { transform: rotateY(360deg) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .o3d-chip:hover img, .o3d-chip:hover svg, .o3d-chip.on img, .o3d-chip.on svg { animation: none; }
}
