:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #111413;
  color: #f4f1eb;
  --panel: rgba(17, 20, 19, 0.76);
  --panel-strong: rgba(17, 20, 19, 0.92);
  --line: rgba(244, 241, 235, 0.18);
  --muted: #c8c0b3;
  --text: #f4f1eb;
  --accent: #14b8a6;
  --accent-strong: #0f766e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --clear: #22c55e;
  --blur: #38bdf8;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(18, 23, 22, 0.18), rgba(18, 23, 22, 0.56)),
    #111413;
}

.camera-stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 520px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.1), transparent 42%),
    linear-gradient(315deg, rgba(245, 158, 11, 0.12), transparent 38%),
    #151817;
}

.camera-video,
.overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: scaleX(-1);
}

.camera-video {
  object-fit: cover;
  transition: filter 160ms ease;
}

.camera-video.is-blurred {
  filter: blur(var(--blur-size, 12px));
}

.overlay-canvas {
  pointer-events: none;
}

.overlay-canvas.is-hidden {
  opacity: 0;
}

.top-bar {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: min(560px, calc(100vw - 150px));
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: blur(18px);
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 2px solid rgba(244, 241, 235, 0.88);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #111413 0 22%, transparent 24%),
    conic-gradient(from 120deg, var(--accent), #f59e0b, #ef4444, var(--accent));
}

h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: 0;
}

.brand-lockup p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.status-badge {
  min-width: 116px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  backdrop-filter: blur(18px);
}

.status-badge.clear {
  border-color: rgba(34, 197, 94, 0.42);
  box-shadow: inset 0 -3px 0 rgba(34, 197, 94, 0.56);
}

.status-badge.blur {
  border-color: rgba(56, 189, 248, 0.48);
  box-shadow: inset 0 -3px 0 rgba(56, 189, 248, 0.6);
}

.status-badge.warn {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: inset 0 -3px 0 rgba(245, 158, 11, 0.58);
}

.status-badge.error {
  border-color: rgba(239, 68, 68, 0.56);
  box-shadow: inset 0 -3px 0 rgba(239, 68, 68, 0.62);
}

.control-panel {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  display: grid;
  gap: 12px;
  width: min(320px, calc(100vw - 36px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  backdrop-filter: blur(18px);
}

.primary-action {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #061211;
  font-weight: 800;
  cursor: pointer;
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.68;
}

.range-control,
.switch-control {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.range-control input {
  width: 180px;
  accent-color: var(--accent);
}

.switch-control input {
  width: 42px;
  height: 22px;
  accent-color: var(--accent);
}

.finger-strip {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: min(520px, calc(100vw - 380px));
}

.finger-strip span {
  min-width: 82px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  backdrop-filter: blur(18px);
}

.finger-strip span.is-active {
  border-color: rgba(20, 184, 166, 0.55);
  color: var(--text);
  background: rgba(15, 118, 110, 0.42);
}

.message-box {
  position: absolute;
  left: 50%;
  bottom: 92px;
  z-index: 4;
  width: min(560px, calc(100vw - 36px));
  transform: translateX(-50%);
  padding: 14px 16px;
  border: 1px solid rgba(245, 158, 11, 0.42);
  border-radius: 8px;
  background: rgba(41, 31, 14, 0.92);
  color: #fff7df;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  backdrop-filter: blur(18px);
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .camera-stage {
    min-height: 100svh;
  }

  .top-bar {
    top: 12px;
    left: 12px;
    right: 12px;
    align-items: stretch;
  }

  .brand-lockup {
    max-width: calc(100vw - 148px);
  }

  h1 {
    font-size: 15px;
  }

  .brand-lockup p,
  .range-control,
  .switch-control {
    font-size: 12px;
  }

  .status-badge {
    min-width: 104px;
    font-size: 13px;
  }

  .control-panel {
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
  }

  .range-control input {
    width: min(190px, 52vw);
  }

  .finger-strip {
    left: 12px;
    right: 12px;
    bottom: 172px;
    max-width: none;
  }

  .finger-strip span {
    min-width: calc(50% - 4px);
  }

  .message-box {
    bottom: 258px;
  }
}
