:root {
  --bg: #0b0d10;
  --panel: #14171c;
  --text: #f2f4f7;
  --muted: #9aa3ae;
  --accent: #19c58b;
  --accent-ink: #04261a;
  --danger: #ff6b6b;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
}
.screen.active { display: flex; }

.stage {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #000;
}

video, #overlay, #editor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
video { object-fit: cover; }

.hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.2s;
}
.hint.found { background: rgba(25, 197, 139, 0.85); color: var(--accent-ink); }

.notice {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  background: var(--panel);
}

.shutter {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid var(--text);
  background: var(--text);
  box-shadow: inset 0 0 0 4px var(--panel);
  cursor: pointer;
}
.shutter:active { transform: scale(0.94); }

.icon-btn {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
}
.icon-btn svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}
.icon-btn.placeholder { visibility: hidden; }

.btn {
  flex: 1;
  min-height: 48px;
  padding: 0 10px;
  white-space: nowrap;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: rgba(255, 255, 255, 0.08); }
.notice .btn { flex: 0; white-space: nowrap; }

.result {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background: #1b1f25;
}
.result img {
  max-width: 100%;
  max-height: calc(100% - 48px);
  object-fit: contain;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  background: #fff;
}
.info { margin: 0; color: var(--muted); font-size: 12px; text-align: center; word-break: break-all; }

.busy {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 10;
}
.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

a.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
