/* UZYTAK Spacery 360 — tour player */
:root {
  --accent: #d6a740;
  --bg: rgba(16, 17, 20, .72);
  --bg-solid: #15161a;
  --fg: #f4f2ee;
  --muted: #b9b6ae;
  --line: rgba(255, 255, 255, .14);
  --r: 12px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0b0b0d; color: var(--fg); font: 15px/1.4 var(--font); overflow: hidden; }
#uz-app, .uz-root { position: fixed; inset: 0; }
.uz-root canvas.uz-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.uz-root canvas.uz-gl.dragging { cursor: grabbing; }
.uz-root canvas.uz-gl.over-hotspot { cursor: pointer; }
button { font: inherit; color: inherit; }
.uz-glass { background: var(--bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--r); }

/* top bar */
.uz-top { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; gap: 8px; align-items: flex-start; pointer-events: none; }
.uz-top > * { pointer-events: auto; }
.uz-brand { display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 8px; min-width: 0; max-width: min(60vw, 520px); text-decoration: none; color: inherit; }
.uz-brand img { height: 34px; width: auto; max-width: 120px; object-fit: contain; flex: none; }
.uz-brand .t { min-width: 0; }
.uz-brand .t b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uz-brand .t span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uz-spacer { flex: 1; }
.uz-tools { display: flex; gap: 4px; padding: 4px; flex-wrap: wrap; justify-content: flex-end; }
.uz-btn { width: 40px; height: 40px; border-radius: 9px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; }
.uz-btn:hover, .uz-btn.on { background: rgba(255, 255, 255, .12); }
.uz-btn.on { color: var(--accent); }
.uz-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.uz-btn[hidden] { display: none; }
.uz-lang { height: 40px; border-radius: 9px; border: 0; background: transparent; color: var(--fg); padding: 0 6px; cursor: pointer; max-width: 140px; }
.uz-lang option { background: var(--bg-solid); }

/* bottom: scenes + timeline */
.uz-bottom { position: absolute; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.uz-bottom > * { pointer-events: auto; max-width: 100%; }
.uz-scenes { display: flex; gap: 8px; padding: 8px; overflow-x: auto; scrollbar-width: thin; }
.uz-scene { flex: none; width: 128px; border: 2px solid transparent; border-radius: 9px; padding: 0; background: #000; cursor: pointer; overflow: hidden; position: relative; }
.uz-scene img { width: 100%; height: 64px; object-fit: cover; display: block; opacity: .85; }
.uz-scene span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 12px; padding: 14px 6px 4px; background: linear-gradient(transparent, rgba(0,0,0,.85)); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uz-scene.on { border-color: var(--accent); }
.uz-scene.on img, .uz-scene:hover img { opacity: 1; }
.uz-scene .badge3d { position: absolute; top: 4px; right: 4px; font-size: 10.5px; font-weight: 700; background: var(--accent); color: #111; border-radius: 5px; padding: 1px 5px; }
.uz-scenes.collapsed .uz-scene { display: none; }
.uz-timeline { display: flex; align-items: center; gap: 6px; padding: 6px 8px; flex-wrap: wrap; justify-content: center; }
.uz-timeline .lbl { font-size: 12.5px; color: var(--muted); padding: 0 4px; }
.uz-chip { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 5px 11px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.uz-chip.on { background: var(--accent); color: #111; border-color: var(--accent); font-weight: 600; }
.uz-chip.b { border-style: dashed; border-color: var(--accent); }

/* floor plan */
.uz-plan { position: absolute; left: 10px; top: 76px; width: min(300px, 44vw); padding: 8px; }
.uz-plan h4 { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; gap: 6px; }
.uz-plan h4 select { background: transparent; color: var(--fg); border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.uz-plan .wrap { position: relative; }
.uz-plan .wrap > img { width: 100%; display: block; border-radius: 6px; background: #fff; }
.uz-mk { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #fff; border: 3px solid #333; cursor: pointer; padding: 0; }
.uz-mk.on { background: var(--accent); border-color: #111; z-index: 2; }
.uz-cone { position: absolute; width: 90px; height: 90px; margin: -45px 0 0 -45px; pointer-events: none; z-index: 1; }
.uz-cone path { fill: var(--accent); opacity: .45; }
.uz-plan[hidden] { display: none; }

/* compare split */
.uz-split { position: absolute; top: 0; bottom: 0; width: 44px; margin-left: -22px; cursor: ew-resize; touch-action: none; display: grid; place-items: center; }
.uz-split::before { content: ""; position: absolute; top: 0; bottom: 0; left: 21px; width: 2px; background: var(--accent); box-shadow: 0 0 8px rgba(0,0,0,.6); }
.uz-split b { position: relative; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #111; display: grid; place-items: center; font-size: 15px; }
.uz-split-lbl { position: absolute; top: 76px; padding: 4px 10px; font-size: 13px; font-weight: 600; }

/* modal */
.uz-modal { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.55); z-index: 20; padding: 14px; }
.uz-modal[hidden] { display: none; }
.uz-card { width: min(560px, 100%); max-height: 88vh; overflow: auto; padding: 18px 20px; background: var(--bg-solid); border: 1px solid var(--line); border-radius: 16px; position: relative; }
.uz-card h3 { margin: 0 34px 8px 0; font-size: 19px; }
.uz-card p { margin: 0 0 10px; color: #dedbd4; white-space: pre-line; }
.uz-card img { width: 100%; border-radius: 10px; margin: 6px 0 10px; }
.uz-card a.cta { display: inline-block; background: var(--accent); color: #111; font-weight: 600; text-decoration: none; padding: 9px 16px; border-radius: 9px; margin: 4px 6px 0 0; }
.uz-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); cursor: pointer; font-size: 20px; line-height: 1; }

/* 3D model viewer */
.uz-model { position: absolute; inset: 0; z-index: 15; background: radial-gradient(ellipse at 50% 40%, #3a3c42, #121316 75%); }
.uz-model[hidden] { display: none; }
.uz-model canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.uz-model .bar { position: absolute; left: 50%; transform: translateX(-50%); bottom: max(14px, env(safe-area-inset-bottom)); display: flex; gap: 6px; align-items: center; padding: 5px 8px; white-space: nowrap; max-width: calc(100% - 20px); overflow-x: auto; }
.uz-model.embedded .bar { bottom: 112px; }
.uz-model .dims { font-size: 13px; color: var(--muted); padding: 0 6px; }
.uz-model .ttl { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); padding: 7px 14px; font-weight: 600; white-space: nowrap; }
.uz-model.embedded .ttl { top: 76px; }
.uz-model .uz-x { top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 2; }
.uz-measure-lbl { position: absolute; transform: translate(-50%, -130%); background: var(--accent); color: #111; font-weight: 700; padding: 3px 8px; border-radius: 6px; font-size: 13px; pointer-events: none; white-space: nowrap; }
.uz-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 12px 18px; text-align: center; pointer-events: none; transition: opacity .6s; max-width: 86vw; opacity: 0; }

/* loading */
.uz-loading { position: absolute; inset: 0; display: grid; place-items: center; z-index: 30; background: #0b0b0d; transition: opacity .5s; }
.uz-loading.done { opacity: 0; pointer-events: none; }
.uz-spin { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--accent); animation: uzspin 0.9s linear infinite; margin: 0 auto 12px; }
@keyframes uzspin { to { transform: rotate(360deg); } }
.uz-progress { position: absolute; left: 0; top: 0; height: 3px; background: var(--accent); width: 0; transition: width .3s, opacity .4s; z-index: 25; }

/* credit */
.uz-credit { position: absolute; right: 12px; bottom: max(8px, env(safe-area-inset-bottom)); font-size: 11px; color: rgba(255,255,255,.55); text-decoration: none; text-shadow: 0 1px 2px #000; z-index: 3; }
.uz-credit b { color: rgba(255,255,255,.8); letter-spacing: .06em; }

/* cardboard */
.uz-reticle { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 2px solid rgba(255,255,255,.9); pointer-events: none; z-index: 12; }
.uz-reticle i { position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); transform: scale(0); }
.uz-exitvr { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 13; padding: 8px 14px; cursor: pointer; }
.uz-root.cardboard .uz-top, .uz-root.cardboard .uz-bottom, .uz-root.cardboard .uz-plan, .uz-root.cardboard .uz-credit { display: none; }

/* editor */
.uz-edit { position: absolute; right: 10px; top: 76px; width: 290px; padding: 10px; font-size: 13px; z-index: 6; max-height: calc(100vh - 200px); overflow: auto; }
.uz-edit h4 { margin: 0 0 6px; color: var(--accent); }
.uz-edit button, .uz-edit select, .uz-edit input { width: 100%; margin: 3px 0; padding: 6px 8px; border-radius: 7px; border: 1px solid var(--line); background: #24262c; color: var(--fg); cursor: pointer; font-size: 13px; }
.uz-edit .xy { font-family: Consolas, monospace; color: var(--muted); margin-bottom: 6px; }
.uz-cross { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; pointer-events: none; z-index: 5; }
.uz-cross::before, .uz-cross::after { content: ""; position: absolute; background: #ff3b6b; }
.uz-cross::before { left: 12px; top: 0; width: 2px; height: 26px; }
.uz-cross::after { top: 12px; left: 0; height: 2px; width: 26px; }

@media (max-width: 640px) {
  .uz-brand img { height: 28px; }
  .uz-brand .t b { font-size: 13.5px; }
  .uz-btn { width: 36px; height: 36px; }
  .uz-scene { width: 96px; }
  .uz-scene img { height: 52px; }
  .uz-plan { top: auto; bottom: 150px; width: 52vw; }
  .uz-tools { max-width: 46vw; }
  .uz-lang { max-width: 92px; }
}
.uz-top, .uz-bottom, .uz-plan { z-index: 4; }
.uz-model.embedded { z-index: 2; }
.uz-model.embedded .uz-x { display: none; }
