/* A2K 2026 palette, taken from the website tailwind.config.ts — the same as
   every other demo. */
:root {
  --navy: #0a1628;
  --navy-light: #132240;
  --outline: #24345c;
  --lime: #d4ff00;
  --cyan: #38bdf8;
  --light: #f1f5f9;
  --muted: #94a3b8;
  --red: #ff3b4d;
}

* { box-sizing: border-box; }

/* An element with its own display (grid, flex) would otherwise stay visible
   when hidden: the countdown stuck on « 1 » was exactly that. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--navy);
  color: var(--light);
  font-family: Poppins, system-ui, sans-serif;
}

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 90% -10%, #1565c033, transparent 55%),
    radial-gradient(ellipse at -10% 110%, #d4ff0014, transparent 50%),
    var(--navy);
}

button, input { font: inherit; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 10px;
}

.logo { height: 34px; width: auto; }

.tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--lime);
  border: 1px solid #d4ff0055;
  border-radius: 6px;
  padding: 5px 9px;
}

.screen {
  flex: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 8px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.screen[hidden] { display: none; }

.eyebrow {
  margin: 10px 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(26px, 7.4vw, 36px);
  line-height: 1.12;
  letter-spacing: -1px;
}

h1 em, h2 em { font-style: normal; color: var(--lime); }

h2 { margin: 0 0 14px; font-size: 26px; }

.poster {
  position: relative;
  aspect-ratio: 4 / 3;
  max-height: 34svh;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--outline);
  background: var(--navy-light);
}

.poster video { width: 100%; height: 100%; object-fit: cover; display: block; }

.live {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(10, 22, 40, .8);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

.live::first-letter { color: var(--red); }

.pitch { margin: 14px 0 10px; font-size: 15px; line-height: 1.5; }

.offers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}

.offers li {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--outline);
  background: var(--navy-light);
}

.adapt { margin: 0 0 18px; font-size: 14px; color: var(--muted); line-height: 1.5; }

.primary, .ghost {
  min-height: 54px;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 22px;
}

.primary { border: 0; background: var(--lime); color: var(--navy); }
.primary:disabled { opacity: .55; cursor: wait; }
.ghost { border: 1px solid var(--outline); background: transparent; color: var(--light); }
.primary:focus-visible, .ghost:focus-visible, input:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }

.fineprint { margin: 10px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

/* The booth: the programme as large as the screen allows, portrait. */
body[data-screen="booth"] .topbar { display: none; }

.booth { max-width: none; padding: 0; gap: 0; }

.stage {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  background: #000;
  min-height: 0;
}

#program {
  display: block;
  height: calc(100svh - 96px - env(safe-area-inset-bottom, 0px));
  width: auto;
  max-width: 100vw;
  object-fit: contain;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 22, 40, .35);
}

.overlay span {
  font-size: 140px;
  font-weight: 800;
  color: var(--lime);
  text-shadow: 0 6px 30px rgba(0, 0, 0, .6);
  animation: pop .9s ease-out;
}

@keyframes pop { from { transform: scale(1.6); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); } }

.rec {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(10, 22, 40, .85);
  font-size: 14px;
  font-weight: 700;
}

.rec i { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: blink 1s infinite; }
.rec b { font-variant-numeric: tabular-nums; color: var(--lime); }
@keyframes blink { 50% { opacity: .2; } }

.hint {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(10, 22, 40, .85);
  font-size: 14px;
  text-align: center;
}

.booth-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--navy);
}

.booth-actions button { flex: 1; max-width: 420px; }

/* The result. */
.result {
  width: 100%;
  max-height: 46svh;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  background: #000;
  border-radius: 16px;
  border: 1px solid var(--outline);
}

.again { margin-top: 14px; }

.email { margin-top: 12px; padding: 16px; border-radius: 16px; border: 1px solid var(--outline); background: var(--navy-light); }
.email[hidden] { display: none; }
.email label { display: block; font-weight: 600; margin-bottom: 10px; }
.email { display: grid; gap: 10px; }
.email label { margin-bottom: 0; }
.email input {
  width: 100%;
  min-height: 54px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--outline);
  background: var(--navy);
  color: #fff;
  font-size: 16px;
}
.email .fineprint { text-align: left; }

.status { margin: 10px 0 0; font-size: 14px; color: #bdecc6; min-height: 1em; }

/* The match and the camera, drawn by the programme and never shown directly. */
/* Real size, behind everything: iOS Safari stops refreshing the frames of a
   video it considers invisible (too small, or fully transparent), and the
   canvas then draws black. */
.source { position: fixed; left: 0; top: 0; width: 180px; height: auto; opacity: .01; z-index: -1; pointer-events: none; }

.brand { display: inline-flex; border-radius: 6px; }
.brand:focus-visible, .site-link:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; }

.site-footer {
  padding: 18px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--outline);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.site-footer p { margin: 0 0 10px; line-height: 1.5; }
.site-link {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid #d4ff0066;
  color: var(--lime);
  font-weight: 600;
  text-decoration: none;
}
.site-link:hover { background: #d4ff0014; }
.version { margin: 12px 0 0 !important; font-size: 10px; color: #56657d; }
body[data-screen="booth"] .site-footer { display: none; }

/* A computer: the same phone-shaped programme, centred. */
@media (min-width: 900px) {
  .screen:not(.booth) { max-width: 560px; }
}

.email-done { display: flex; align-items: center; gap: 12px; margin: 12px 0 0; padding: 16px; border-radius: 16px;
  border: 1px solid var(--outline); background: var(--navy-light); font-weight: 600; }
.email-done span:first-child { color: var(--lime); font-size: 22px; }
