*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --pink: #f472b6;
  --violet: #c084fc;
  --grad: linear-gradient(135deg, #f472b6, #c084fc);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* ── App container ── */
#app {
  position: fixed;
  inset: 0;
  background: #000;
}

/* ── Camera ── */
#camera {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  transition: filter 0.15s;
}

/* ── Controls overlay ── */
#controls {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

#controls.hidden {
  opacity: 0;
  pointer-events: none;
}

#controls.visible {
  opacity: 1;
}

/* ── Top bar ── */
.bar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 52px 24px 28px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
  pointer-events: all;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-star {
  color: var(--pink);
  font-size: 11px;
}

.brand-name {
  color: #fff;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 6px;
}

.icon-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.2s;
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.icon-btn:active {
  background: rgba(255,255,255,0.28);
}

/* ── Bottom bar ── */
.bar-bottom {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 24px 56px;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
  pointer-events: all;
}

/* ── Sliders ── */
.slider-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sl-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: rgba(255,255,255,0.65);
  fill: rgba(255,255,255,0.65);
  stroke: rgba(255,255,255,0.65);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: rgba(255,255,255,0.22);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--pink);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(244,114,182,0.7);
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--pink);
  cursor: pointer;
}

/* ── Buttons ── */
.btn-row {
  display: flex;
  justify-content: center;
}

.main-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--grad);
  border: none;
  color: #fff;
  padding: 13px 32px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 22px rgba(244,114,182,0.45);
  transition: transform 0.15s, box-shadow 0.15s;
}

.main-btn svg {
  width: 18px;
  height: 18px;
}

.main-btn:active {
  transform: scale(0.96);
  box-shadow: 0 2px 10px rgba(244,114,182,0.3);
}

/* ── Error screen ── */
#error-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #080808;
  display: flex;
  align-items: center;
  justify-content: center;
}

#error-screen.hidden,
#loading-screen.hidden {
  display: none;
}

/* ── Loading screen ── */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s;
}

/* ── Shared panel ── */
.panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 40px 32px;
  color: #fff;
}

.panel-icon {
  font-size: 60px;
  margin-bottom: 4px;
}

.panel h2 {
  font-size: 20px;
  font-weight: 400;
}

.panel p {
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  line-height: 1.6;
  max-width: 260px;
}

.loading-star {
  font-size: 44px;
  color: var(--pink);
  animation: glow 1.5s ease-in-out infinite;
}

.panel > p {
  color: rgba(255,255,255,0.45);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

@keyframes glow {
  0%, 100% { opacity: 1; text-shadow: 0 0 12px var(--pink); }
  50%       { opacity: 0.25; text-shadow: none; }
}
