:root {
  color-scheme: dark;
  --bg: #050507;
  --glass: rgba(10, 10, 14, 0.46);
  --glass-strong: rgba(10, 10, 14, 0.72);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.62);
  --accent: #ff6fb1;
}

* { box-sizing: border-box; }

html, body, #app {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  overflow: hidden;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.photo-button {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  padding: 0;
  margin: 0;
  border: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 111, 177, 0.22), transparent 30%),
    radial-gradient(circle at 20% 80%, rgba(116, 173, 255, 0.18), transparent 28%),
    #050507;
  cursor: pointer;
  overflow: hidden;
  touch-action: manipulation;
}

.photo-button:focus-visible,
.mode-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: -4px;
}

#photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  opacity: 0;
  transition: opacity 260ms ease;
  user-select: none;
  -webkit-user-drag: none;
}

#photo.ready {
  opacity: 1;
}

.mode-btn {
  position: fixed;
  z-index: 20;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 10px 18px;
  min-width: 92px;
  color: var(--text);
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.mode-btn.veil {
  color: #fff;
  border-color: rgba(255, 111, 177, 0.54);
  background: rgba(157, 36, 92, 0.58);
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  color: var(--text);
  text-align: center;
  pointer-events: none;
}

.empty-state.hidden { display: none; }

.brand {
  font-size: clamp(42px, 10vw, 92px);
  font-weight: 900;
  letter-spacing: -0.06em;
  text-shadow: 0 12px 48px rgba(0, 0, 0, 0.52);
}

.hint {
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.06em;
}

.loader {
  position: fixed;
  z-index: 18;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  margin-left: -21px;
  margin-top: -21px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.24);
  border-top-color: rgba(255, 255, 255, 0.92);
  animation: spin 840ms linear infinite;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.45));
}

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(680px, calc(100vw - 28px));
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.38);
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  #photo { transition: none; }
  .loader { animation: none; }
}
