/* UPVC Club — "Try at Home" camera visualizer */
.viz-page { background: #05070c; color: #fff; overflow: hidden; }
.viz-page .site-header, .viz-page .dock, .viz-page .wa-fab, .viz-page .mobile-menu { display: none !important; }

.viz {
  position: fixed; inset: 0; display: grid; grid-template-rows: auto 1fr auto;
  height: 100vh; height: 100dvh; background: #05070c;
}
@media (min-width: 1024px) {
  .viz { grid-template-columns: 1fr 400px; grid-template-rows: auto 1fr; }
  .viz-top { grid-column: 1 / -1; }
  .viz-panel { grid-row: 2; grid-column: 2; border-left: 1px solid rgba(255, 255, 255, 0.08); border-top: 0 !important; overflow-y: auto; }
}

/* Top bar */
.viz-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px; background: #0b1b33; z-index: 5;
}
.viz-top-title { min-width: 0; text-align: center; flex: 1; }
.viz-top-title b { display: block; font-size: 15px; letter-spacing: -0.01em; }
.viz-top-title span { display: block; font-size: 12px; color: rgba(255, 255, 255, 0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viz-icon {
  width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.08); color: #fff; transition: background-color 0.2s;
}
.viz-icon:hover { background: rgba(255, 255, 255, 0.16); }
.viz-icon.is-on { background: var(--red); }

/* Stage */
.viz-stage { position: relative; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; background: #111; }
.viz-stage video, .viz-stage .viz-photo { position: absolute; inset: 0; width: 100%; height: 100%; }
.viz-stage video { object-fit: cover; }
.viz-stage .viz-photo { object-fit: contain; }
.viz-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.viz-quad-hit { position: absolute; inset: 0; }
.viz-handle {
  position: absolute; left: 0; top: 0; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  display: grid; place-items: center; touch-action: none; cursor: grab; z-index: 3;
}
.viz-handle::before {
  content: ""; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--red);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45); transition: transform 0.2s;
}
.viz-handle:active { cursor: grabbing; }
.viz-handle:active::before, .viz-handle.is-drag::before { transform: scale(1.35); }
.viz-handle:focus-visible::before { outline: 3px solid #fff; outline-offset: 3px; }
.viz-outline { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.viz-outline polygon { fill: none; stroke: rgba(255, 255, 255, 0.9); stroke-width: 1.5; stroke-dasharray: 6 6; }
.viz-clean .viz-handle, .viz-clean .viz-outline { display: none; }
.viz-hint {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 4; max-width: calc(100% - 28px);
  padding: 9px 14px; border-radius: 999px; background: rgba(5, 7, 12, 0.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; transition: opacity 0.4s; text-align: center;
}
.viz-hint .material-icons-outlined { font-size: 18px; color: var(--red); }
.viz-hint.is-gone { opacity: 0; pointer-events: none; }
.viz-paused-badge { position: absolute; right: 14px; bottom: 14px; z-index: 4; padding: 6px 12px; border-radius: 999px; background: var(--red); font-size: 12px; font-weight: 700; display: none; }
.viz-paused .viz-paused-badge { display: block; }

/* Start screen */
.viz-start {
  position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 24px; text-align: center;
  background: radial-gradient(120% 80% at 50% 0%, #163a70 0%, #0b1b33 55%, #05070c 100%);
}
.viz-start-inner { max-width: 440px; display: grid; gap: 14px; justify-items: center; }
.viz-start h1 { font-size: clamp(32px, 7vw, 48px); line-height: 1.02; letter-spacing: -0.04em; font-weight: 700; }
.viz-start h1 .serif { color: var(--red); }
.viz-start p { color: rgba(255, 255, 255, 0.7); }
.viz-start-art { width: 180px; height: 150px; position: relative; margin-bottom: 6px; }
.viz-start-art svg { width: 100%; height: 100%; }
.viz-start .btn { width: 100%; max-width: 340px; }
.viz-start .btn-ghost { --btn-fg: #fff; border-color: rgba(255, 255, 255, 0.3); }
.viz-start small { color: rgba(255, 255, 255, 0.5); font-size: 12px; display: flex; gap: 6px; align-items: center; }
.viz-error { margin-top: 6px; padding: 12px 14px; border-radius: 14px; background: rgba(222, 27, 27, 0.16); color: #ffd6d3; font-size: 14px; font-weight: 600; text-align: left; display: none; }
.viz-error.is-on { display: block; }

/* Panel */
.viz-panel {
  background: #0b1b33; border-top: 1px solid rgba(255, 255, 255, 0.08); z-index: 5;
  padding: 10px 0 calc(12px + env(safe-area-inset-bottom, 0px));
  display: grid; gap: 10px; align-content: start;
}
.viz-tabs { display: flex; gap: 4px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
.viz-tabs::-webkit-scrollbar { display: none; }
.viz-tab { padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, 0.6); white-space: nowrap; }
.viz-tab[aria-selected="true"] { background: rgba(255, 255, 255, 0.12); color: #fff; }
.viz-opts { display: flex; gap: 10px; overflow-x: auto; padding: 4px 12px 6px; scrollbar-width: none; min-height: 96px; align-items: flex-start; }
.viz-opts::-webkit-scrollbar { display: none; }
@media (min-width: 1024px) {
  .viz-panel { padding: 20px 0; gap: 16px; }
  .viz-opts { flex-wrap: wrap; overflow: visible; padding: 4px 20px; }
  .viz-tabs { padding: 0 20px; }
}
.viz-opt {
  flex: none; width: 84px; display: grid; gap: 6px; justify-items: center; padding: 8px 6px; border-radius: 16px;
  font-size: 11px; font-weight: 700; color: rgba(255, 255, 255, 0.75); text-align: center; line-height: 1.2;
  border: 1.5px solid transparent; transition: border-color 0.2s, background-color 0.2s;
}
.viz-opt:hover { background: rgba(255, 255, 255, 0.06); }
.viz-opt[aria-pressed="true"] { border-color: var(--red); background: rgba(222, 27, 27, 0.12); color: #fff; }
.viz-opt-thumb { width: 56px; height: 48px; display: grid; place-items: center; }
.viz-opt-thumb svg { max-width: 100%; max-height: 100%; width: auto; height: auto; }
.viz-swatch { width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.85); box-shadow: inset 0 -6px 12px rgba(0, 0, 0, 0.25); }
.viz-glass { width: 44px; height: 44px; border-radius: 10px; border: 2px solid rgba(255, 255, 255, 0.7); background-image: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.5) 45%, transparent 50%), linear-gradient(45deg, #6c7a8c, #c9d3dd); }
.viz-sliders { display: grid; gap: 14px; width: 100%; padding: 4px 4px; }
.viz-slider { display: grid; grid-template-columns: 90px 1fr 40px; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.8); }
.viz-slider output { text-align: right; color: rgba(255, 255, 255, 0.55); font-variant-numeric: tabular-nums; }
.viz-slider input[type="range"] { width: 100%; accent-color: var(--red); }
.viz-toggles { display: flex; gap: 8px; flex-wrap: wrap; }
.viz-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); font-size: 13px; font-weight: 700; }
.viz-toggle .material-icons-outlined { font-size: 18px; }

.viz-actions { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 0 14px; }
@media (min-width: 1024px) { .viz-actions { padding: 8px 20px 0; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 18px; } }
.viz-actions .left { display: flex; gap: 8px; }
.viz-actions .right { display: flex; justify-content: flex-end; }
.viz-shutter {
  width: 68px; height: 68px; border-radius: 50%; border: 4px solid #fff; background: transparent; display: grid; place-items: center;
  transition: transform 0.2s;
}
.viz-shutter::before { content: ""; width: 52px; height: 52px; border-radius: 50%; background: #fff; transition: transform 0.2s, background-color 0.2s; }
.viz-shutter:active { transform: scale(0.92); }
.viz-shutter:hover::before { background: var(--red); }
.viz-quote { display: inline-flex; align-items: center; gap: 6px; padding: 12px 16px; border-radius: 999px; background: var(--red); color: #fff; font-weight: 700; font-size: 14px; }
.viz-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 7; }

/* Result sheet & help */
.viz-sheet {
  position: fixed; inset: 0; z-index: 20; background: rgba(3, 5, 10, 0.86); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: grid; place-items: center; padding: 16px; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0s linear 0.3s;
}
.viz-sheet.is-open { opacity: 1; visibility: visible; transition: opacity 0.3s; }
.viz-sheet-card { width: min(720px, 100%); max-height: 100%; overflow: auto; background: #0b1b33; border-radius: 24px; padding: 16px; display: grid; gap: 14px; }
.viz-sheet-card img { width: 100%; max-height: 58vh; object-fit: contain; border-radius: 14px; background: #000; }
.viz-sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.viz-sheet-actions .btn { width: 100%; padding: 14px 16px; }
.viz-sheet-actions .btn-ghost { --btn-fg: #fff; border-color: rgba(255, 255, 255, 0.25); }
.viz-sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.viz-sheet-head h2 { font-size: 20px; letter-spacing: -0.02em; }
.viz-steps { display: grid; gap: 12px; counter-reset: s; }
.viz-steps li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; color: rgba(255, 255, 255, 0.8); }
.viz-steps li::before { counter-increment: s; content: counter(s); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--red); font-weight: 800; }
.viz-steps b { color: #fff; display: block; }
.viz-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 30px); z-index: 30;
  padding: 12px 18px; border-radius: 999px; background: #fff; color: var(--ink); font-weight: 700; font-size: 14px;
  opacity: 0; transition: opacity 0.3s, transform 0.4s var(--ease-out); pointer-events: none; max-width: calc(100% - 32px); text-align: center;
}
.viz-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.viz-quote { white-space: nowrap; }
.viz-quote .material-icons-outlined { font-size: 18px; }
@media (max-width: 400px) {
  .viz-actions { gap: 6px; padding: 0 10px; }
  .viz-actions .left { gap: 5px; }
  .viz-actions .viz-icon { width: 38px; height: 38px; }
  .viz-shutter { width: 62px; height: 62px; }
  .viz-shutter::before { width: 46px; height: 46px; }
  .viz-quote { padding: 11px 13px; }
}

/* Start screen: hide the option panel so the buttons are never cut off, and allow scrolling on short screens */
.viz.is-start .viz-panel { display: none; }
.viz-start { overflow-y: auto; place-items: safe center; -webkit-overflow-scrolling: touch; }
.viz-start-inner { padding-block: 8px 24px; }
@media (max-height: 760px) {
  .viz-start-art { width: 120px; height: 100px; }
  .viz-start h1 { font-size: 30px; }
  .viz-start-inner { gap: 10px; }
  .viz-start .btn { padding-block: 13px; }
}
