:root {
  --pink: #f7b2c3;
  --pink-strong: #ee7fa4;
  --ink: #080607;
  --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(30px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 16%, rgba(247, 178, 195, 0.22), transparent 32%),
    radial-gradient(circle at 10% 72%, rgba(238, 127, 164, 0.12), transparent 28%),
    linear-gradient(180deg, #070506 0%, #130d10 54%, #080607 100%);
  isolation: isolate;
}

.intro-screen::before,
.intro-screen::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.intro-screen::before {
  z-index: -3;
  inset: 0;
  background-image: radial-gradient(circle, rgba(247, 178, 195, 0.75) 0 1px, transparent 1.4px);
  background-size: 23px 23px;
  opacity: 0.13;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 46%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, #000, transparent 46%, #000 82%, transparent);
}

.intro-screen::after {
  z-index: -2;
  width: 145%;
  height: 15%;
  right: -24%;
  bottom: -5%;
  background: linear-gradient(90deg, rgba(247, 178, 195, 0.03), rgba(247, 178, 195, 0.18), rgba(247, 178, 195, 0.04));
  clip-path: polygon(0 38%, 18% 5%, 36% 48%, 56% 8%, 73% 45%, 100% 0, 100% 100%, 0 100%);
  transform: rotate(-4deg);
}

.intro-orbit {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(247, 178, 195, 0.16);
  border-radius: 50%;
  pointer-events: none;
}

.intro-orbit-one {
  width: 620px;
  height: 270px;
  top: -155px;
  left: 50%;
  transform: translateX(-50%);
}

.intro-orbit-two {
  width: 470px;
  height: 210px;
  top: -102px;
  left: 50%;
  border-color: rgba(255, 255, 255, 0.11);
  transform: translateX(-50%);
}

.intro-content {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(100%, 470px);
  flex-direction: column;
  align-items: center;
  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;
}

.intro-screen .eyebrow {
  margin: 0;
  color: var(--pink);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  text-shadow: none;
  text-transform: uppercase;
}

.event-logo-wrap {
  position: relative;
  width: min(100%, 390px);
  margin: 10px auto 0;
}

.event-logo-wrap::before {
  position: absolute;
  z-index: -1;
  inset: 18% 9% 8%;
  border-radius: 50%;
  background: rgba(247, 178, 195, 0.26);
  filter: blur(30px);
  content: "";
}

.event-logo {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.34));
}

.miccoli {
  display: inline-block;
  margin: 2px 0 0;
  padding: 7px 17px;
  border: 1px solid rgba(247, 178, 195, 0.48);
  border-radius: 999px;
  background: rgba(8, 6, 7, 0.72);
  color: var(--pink);
  font-size: clamp(0.72rem, 3.4vw, 0.88rem);
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.intro-copy {
  margin: clamp(30px, 6vh, 52px) 0 18px;
  color: var(--paper);
  font-size: clamp(1.12rem, 4.8vw, 1.42rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.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, #f9c3d0 0%, var(--pink) 52%, var(--pink-strong) 100%);
  color: #100a0c;
  box-shadow: 0 14px 36px rgba(238, 127, 164, 0.28);
}

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

.button-large {
  display: flex;
  width: 100%;
  min-height: 60px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  font-size: 1.05rem;
}

.button-large svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

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

.event-info {
  display: grid;
  width: 100%;
  gap: 5px;
  margin: 16px 0 0;
  padding: 15px 12px;
  border-top: 1px solid rgba(247, 178, 195, 0.22);
  border-bottom: 1px solid rgba(247, 178, 195, 0.22);
  text-transform: uppercase;
}

.event-date {
  color: var(--pink);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.event-place {
  color: var(--paper);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  line-height: 1.45;
}

.event-credits {
  display: grid;
  width: min(100%, 330px);
  grid-template-columns: 1fr 1px 1fr;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}

.credit {
  display: flex;
  min-height: 82px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.credit span {
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.credit-divider {
  width: 1px;
  height: 66px;
  background: rgba(247, 178, 195, 0.2);
}

.credit-organizer img {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.credit-powered img {
  display: block;
  width: 92px;
  height: auto;
}

.privacy-note {
  max-width: 410px;
  margin: 13px auto 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.67rem;
  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-screen { padding-top: 18px; padding-bottom: 16px; }
  .event-logo-wrap { width: min(82%, 310px); margin-top: 4px; }
  .miccoli { padding-block: 5px; }
  .intro-copy { margin-top: 18px; margin-bottom: 12px; }
  .button-large { min-height: 54px; }
  .text-button { padding-block: 9px; }
  .event-info { margin-top: 7px; padding-block: 10px; }
  .event-credits { margin-top: 8px; }
  .credit { min-height: 67px; }
  .credit-divider { height: 52px; }
  .credit-organizer img { width: 52px; height: 52px; }
  .credit-powered img { width: 76px; }
  .privacy-note { margin-top: 7px; }
}

@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;
  }
}
