/* Aura Camera — web test build. Mobile-first portrait, dark theme. */

:root {
  --bg: #0d0f12;
  --panel: #16191f;
  --ink: #eef1f4;
  --dim: #9aa3ad;
  --accent: #7fd4c1;
  --line: #262b33;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(13, 15, 18, 0.92);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.app-header h1 {
  font-size: 1.1rem;
  font-weight: 650;
  margin: 0;
  letter-spacing: 0.01em;
}

.badge {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0d0f12;
  background: var(--accent);
  border-radius: 999px;
  padding: 3px 10px;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 12px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------- Stage ---------- */

.stage {
  position: relative;
  background: #000;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

#gl {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  background: #000;
}

#video { display: none; }

.error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: rgba(10, 10, 12, 0.9);
  color: #ffb4a6;
  font-size: 0.95rem;
  line-height: 1.5;
}

.status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--dim);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  pointer-events: none;
}

/* ---------- Controls ---------- */

.controls {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.palette-group {
  border: none;
  margin: 0;
  padding: 0;
}

.palette-group legend {
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--dim);
  padding: 0;
  margin-bottom: 8px;
}

.chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.chip {
  border: 2px solid transparent;
  border-radius: 8px;
  min-height: 40px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  cursor: pointer;
  padding: 6px 4px;
}

.chip.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.sliders {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.slider {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.88rem;
}

.slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.slider .val {
  color: var(--dim);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  min-height: 32px; /* comfortable touch target */
}

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-toggle button,
.buttons button {
  border: 1px solid var(--line);
  background: #20252d;
  color: var(--ink);
  border-radius: 8px;
  padding: 12px 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.mode-toggle button.active,
.buttons button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0d0f12;
}

.buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.buttons button:active {
  transform: scale(0.98);
}

/* ---------- Legend ---------- */

.legend {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.legend h2,
.explainer h2 {
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--dim);
  margin: 0 0 10px;
}

.legend-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.legend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 56px;
}

.swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.lname {
  font-size: 0.68rem;
  color: var(--dim);
  text-align: center;
  line-height: 1.25;
}

.fine {
  font-size: 0.75rem;
  color: var(--dim);
  margin: 10px 0 0;
  line-height: 1.5;
}

/* ---------- Explainer ---------- */

.explainer {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.explainer p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: #d6dbe1;
  margin: 0 0 10px;
}

.explainer p:last-child { margin-bottom: 0; }

/* ---------- Wider screens ---------- */

@media (min-width: 560px) {
  .chips { grid-template-columns: repeat(4, 1fr); }
  .buttons { grid-template-columns: repeat(3, 1fr); }
}
