:root {
  --pink: #f5a9bd;
  --pink-strong: #ec4085;
  --ink: #100d0f;
  --panel: #1b1719;
  --paper: #fffdfd;
  --muted: #d6ccd0;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--ink);
}

body {
  min-height: 100dvh;
  color: var(--paper);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

button {
  touch-action: manipulation;
}

.app-shell {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 8%, rgba(245, 169, 189, 0.18), transparent 30%),
    radial-gradient(circle at 90% 82%, rgba(236, 64, 133, 0.13), transparent 28%),
    var(--ink);
}

.screen {
  display: none;
  width: 100%;
  min-height: 100dvh;
}

.screen.is-active {
  display: flex;
}

.intro-screen {
  position: relative;
  align-items: center;
  justify-content: center;
  padding: max(36px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
  isolation: isolate;
}

.intro-screen::before,
.intro-screen::after {
  position: absolute;
  z-index: -1;
  content: "";
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.85) 0 1.5px, transparent 1.8px);
  background-size: 26px 26px;
  opacity: 0.2;
}

.intro-screen::before {
  inset: 0 50% 56% -20%;
  transform: rotate(-12deg);
}

.intro-screen::after {
  inset: 58% -20% -10% 55%;
  transform: rotate(16deg);
}

.paint {
  position: absolute;
  z-index: -2;
  width: 130%;
  height: 18%;
  left: -15%;
  background: var(--pink);
  clip-path: polygon(0 22%, 7% 4%, 15% 28%, 23% 0, 33% 22%, 43% 8%, 53% 31%, 64% 3%, 74% 26%, 85% 6%, 100% 30%, 97% 82%, 88% 66%, 77% 92%, 64% 68%, 53% 96%, 39% 73%, 27% 98%, 14% 70%, 0 92%);
  opacity: 0.94;
}

.paint-one {
  top: 10%;
  transform: rotate(-4deg);
}

.paint-two {
  bottom: 4%;
  transform: rotate(7deg);
  background: #fff;
  opacity: 0.08;
}

.intro-content {
  width: min(100%, 520px);
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--paper);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.38);
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(4.35rem, 21vw, 7rem);
  font-weight: 950;
  letter-spacing: -0.075em;
  line-height: 0.72;
  text-transform: uppercase;
}

h1 span,
h1 strong {
  display: block;
}

h1 span {
  color: var(--ink);
  font-size: 0.58em;
  letter-spacing: -0.035em;
  line-height: 1.2;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.08);
}

h1 strong {
  color: var(--paper);
}

.miccoli {
  display: inline-block;
  margin: 20px 0 0;
  padding: 8px 18px;
  background: #000;
  color: var(--pink);
  font-size: clamp(0.88rem, 4vw, 1.12rem);
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.intro-spacer {
  height: clamp(56px, 10vh, 110px);
}

.intro-copy {
  margin: 0 0 18px;
  font-size: clamp(1.15rem, 5vw, 1.55rem);
  font-weight: 750;
}

.button {
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  padding: 14px 22px;
  font-weight: 850;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.button:focus-visible,
.text-button:focus-visible,
.icon-button:focus-visible,
.control-button:focus-visible,
.capture-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.button-primary {
  background: linear-gradient(135deg, var(--pink), var(--pink-strong));
  color: #140c10;
  box-shadow: 0 12px 34px rgba(236, 64, 133, 0.24);
}

.button-secondary {
  border: 1px solid rgba(245, 169, 189, 0.55);
  background: #211b1e;
  color: var(--paper);
}

.button-large {
  width: 100%;
  min-height: 60px;
  font-size: 1.05rem;
}

.text-button {
  border: 0;
  padding: 12px;
  background: transparent;
  color: var(--pink);
  font-size: 0.92rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.event-info {
  margin: 22px 0 0;
  color: var(--paper);
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  line-height: 1.55;
  text-transform: uppercase;
}

.privacy-note {
  max-width: 410px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.camera-screen {
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  background: #050405;
}

.compact-header {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  background: rgba(16, 13, 15, 0.96);
}

.compact-header p,
.compact-header span {
  display: block;
  margin: 0;
  text-transform: uppercase;
}

.compact-header p {
  font-size: 0.98rem;
  font-weight: 950;
  letter-spacing: 0.03em;
}

.compact-header span {
  margin-top: 2px;
  color: var(--pink);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.icon-button svg,
.control-button svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.camera-stage-wrap {
  display: grid;
  min-height: 0;
  flex: 1;
  place-items: center;
  overflow: hidden;
  background: #000;
}

.camera-stage {
  position: relative;
  width: min(100vw, calc((100dvh - 164px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 9 / 16));
  max-width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #171315;
}

.camera-stage video,
.live-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.camera-stage video {
  object-fit: cover;
}

.camera-stage.is-mirrored video {
  transform: scaleX(-1);
}

.live-frame {
  z-index: 2;
  object-fit: fill;
  pointer-events: none;
}

.camera-message {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 28px;
  background: rgba(9, 7, 8, 0.92);
  text-align: center;
}

.camera-message.is-hidden {
  display: none;
}

.camera-message p {
  max-width: 300px;
  margin: 14px auto 0;
  color: var(--paper);
  font-size: 0.9rem;
  line-height: 1.5;
}

.spinner {
  width: 34px;
  height: 34px;
  margin: auto;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

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

.camera-controls {
  display: grid;
  min-height: 100px;
  grid-template-columns: 1fr 104px 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: #0b090a;
}

.control-button {
  display: grid;
  min-width: 64px;
  border: 0;
  place-items: center;
  gap: 3px;
  background: transparent;
  color: var(--paper);
  font-size: 0.69rem;
  font-weight: 750;
}

.capture-button {
  display: grid;
  width: 78px;
  height: 78px;
  border: 4px solid var(--paper);
  border-radius: 50%;
  place-self: center;
  place-items: center;
  background: transparent;
}

.capture-button span {
  display: block;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--pink);
  transition: transform 120ms ease;
}

.capture-button:active span {
  transform: scale(0.88);
}

.result-screen {
  flex-direction: column;
  align-items: center;
  padding: max(28px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
  background:
    linear-gradient(rgba(16, 13, 15, 0.95), rgba(16, 13, 15, 0.98)),
    radial-gradient(circle at top, var(--pink-strong), transparent 42%);
}

.result-header {
  text-align: center;
}

.result-header h2 {
  margin: 0 0 16px;
  color: var(--pink);
  font-size: clamp(2.3rem, 11vw, 4rem);
  font-weight: 950;
  letter-spacing: -0.05em;
  line-height: 0.95;
  text-transform: uppercase;
}

.result-photo-wrap {
  width: min(100%, 430px);
  overflow: hidden;
  border: 2px solid rgba(245, 169, 189, 0.72);
  border-radius: 20px;
  aspect-ratio: 9 / 16;
  background: #000;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.42);
}

.result-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-actions {
  display: grid;
  width: min(100%, 430px);
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.result-actions .text-button {
  grid-column: 1 / -1;
}

.hashtag {
  margin: 8px 0 0;
  color: var(--pink);
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px));
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border: 1px solid rgba(245, 169, 189, 0.5);
  border-radius: 999px;
  transform: translate(-50%, 30px);
  background: rgba(20, 15, 18, 0.96);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

@media (min-width: 700px) {
  .app-shell {
    max-width: 540px;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.6);
  }

  body {
    background: #060506;
  }
}

@media (max-height: 720px) {
  .intro-spacer { height: 26px; }
  .intro-screen { padding-top: 22px; }
  .event-info { margin-top: 12px; }
  .privacy-note { margin-top: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
