/* Variables and base */
:root {
  --bg1: #1a0b2e;
  --bg2: #3b0f3f;
  --bg3: #0c2a2a;
  --card: rgba(255, 255, 255, .08);
  --stroke: rgba(255, 255, 255, .14);
  --text: #fff8f1;
  --muted: rgba(255, 248, 241, .68);
  --berry: #ff3d6e;
  --coral: #ff8a3d;
  --gold: #ffd166;
  --mint: #2ee6a6;
  --sky: #5ab8ff;
  --violet: #a78bfa;
}

* {
  box-sizing: border-box;
  margin: 0;
}

body {
  font-family: system-ui, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(900px 600px at 10% -10%, #ff3d6e55, transparent 60%),
    radial-gradient(800px 600px at 110% 10%, #2ee6a640, transparent 60%),
    radial-gradient(700px 500px at 50% 120%, #ffd16630, transparent 60%),
    linear-gradient(160deg, var(--bg1), var(--bg2) 50%, var(--bg3));
  padding: 40px 24px 80px;
  overflow-x: hidden;
}

/* Snow animation */
.snow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(2px 2px at 20px 30px, #fff9, transparent),
    radial-gradient(1.5px 1.5px at 120px 80px, #fff7, transparent),
    radial-gradient(2.5px 2.5px at 200px 150px, #fff6, transparent),
    radial-gradient(1.5px 1.5px at 300px 40px, #fff8, transparent);
  background-size: 340px 220px;
  animation: snow 18s linear infinite;
  opacity: .6;
}

@keyframes snow {
  to {
    background-position: 60px 220px, -40px 220px, 30px 220px, -20px 220px;
  }
}

/* Branding */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: conic-gradient(from 200deg, var(--berry), var(--coral), var(--gold), var(--mint), var(--berry));
  box-shadow: 0 6px 20px #ff3d6e66;
}

/* Typography */
h1 {
  font-size: 32px;
}

p {
  line-height: 1.5;
}

h2 {
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -.02em;
  font-size: 24px;
  margin-bottom: 16px;
}

.grad {
  background: linear-gradient(90deg, var(--gold), var(--coral), var(--berry));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

/* Page layout */
.shell {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: auto;
  display: grid;
  gap: 24px;
}

.columns {
  display: grid;
  gap: 24px;
}

.login {
  width: 100%;
  max-width: 440px;
  margin: 20px auto;
}

/* Forms */
form {
  display: grid;
  gap: 14px;
}

label {
  line-height: 1.5;
}

fieldset {
  border: 0;
  padding: 0;
  min-width: 0;
  display: grid;
  gap: 14px;
}

legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* Form fields */
.field {
  height: 54px;
  border-radius: 16px;
  background: #0000002e;
  border: 1.5px solid var(--stroke);
  padding: 0 16px;
  width: 100%;
  color: var(--text);
  font: inherit;
}

.field:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* Buttons */
.btn {
  border-radius: 18px;
  border: 0;
  font: inherit;
  font-weight: 800;
  font-size: 16px;
  color: #2a0614;
  background: linear-gradient(90deg, var(--gold), var(--coral) 55%, var(--berry));
  box-shadow: 0 12px 30px -8px #ff3d6eaa;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 100%;
  padding: 12px;
  min-height: 48px;
}

.btn.ghost {
  background: #ffffff12;
  color: var(--text);
  box-shadow: none;
  border: 1px solid var(--stroke);
}

.btn.done {
  background: linear-gradient(90deg, var(--mint), var(--sky));
  color: #03241a;
  box-shadow: 0 12px 30px -8px #2ee6a6aa;
}

.topbar .btn {
  min-height: 40px;
  font-size: 14px;
}

/* Login code */
/* Six cells, one per digit. A cell is a digit's width (1ch with tabular
   figures) plus the letter spacing. Letter spacing also follows the last
   digit, so the text starts half a gap further right than the cells, which
   centres each digit in its cell. The font shrinks on narrow phones so all
   six cells fit. */
.otp {
  --gap: 1.4ch;
  --cell: calc(1ch + var(--gap));
  justify-self: center;
  width: calc(6 * var(--cell) + var(--gap) + 5px);
  padding: 0 2px 0 var(--gap);
  font-size: min(28px, 7vw);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--gap);
  background:
    repeating-linear-gradient(90deg, transparent 0 2px, #ffffff10 2px calc(var(--cell) - 2px), transparent calc(var(--cell) - 2px) var(--cell))
    calc(var(--gap) / 2) 0 / calc(6 * var(--cell)) 100% no-repeat,
    #0000002e;
}

/* Cards */
.card {
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px -20px #0009;
  padding: 24px;
}

/* Choices */
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1.5px solid var(--stroke);
  background: #ffffff08;
}

.choice b {
  display: block;
  font-size: 15px;
}

.names {
  display: block;
}

.choice:has(input:checked) {
  border-color: var(--gold);
  background: linear-gradient(90deg, #ffd16622, #ff3d6e18);
}

/* Chips */
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: #ffffff10;
  border: 1px solid var(--stroke);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
}

.chip:has(input:checked) {
  background: var(--gold);
  color: #2a0614;
}

.chip input, .choice input {
  accent-color: var(--gold);
}

/* Warnings */
.warn {
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(90deg, #ff8a3d2e, #ff3d6e26);
  border: 1px solid #ff8a3d80;
  margin: 12px 0;
}

/* Participants */
.people {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  list-style: none;
  padding: 0;
}

.person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: #ffffff08;
}

.person .person-name {
  flex: 1;
  font-weight: 700;
  font-size: 14px;
}

.tag {
  font-size: 11.5px;
  font-weight: 800;
  padding: 5px 9px;
  border-radius: 999px;
}

.tag.ok {
  background: #2ee6a626;
  color: var(--mint);
}

.tag.wait {
  background: #ffd16622;
  color: var(--gold);
}

/* Result reveal */
.reveal {
  border-radius: 28px;
  padding: 26px 18px;
  text-align: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(400px 200px at 50% 0%, #ffd16655, transparent),
    linear-gradient(160deg, #ff3d6e44, #a78bfa33);
  border: 1px solid #ffffff2a;
}

.reveal .big {
  font-size: 54px;
  margin: 4px 0;
}

.reveal .name {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -.03em;
  margin: 6px 0 2px;
  overflow-wrap: anywhere;
}

.reveal p {
  margin-top: 12px;
}

.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(4px 8px at 10% 20%, var(--gold) 60%, transparent 62%),
    radial-gradient(4px 8px at 85% 15%, var(--mint) 60%, transparent 62%),
    radial-gradient(5px 5px at 25% 75%, var(--berry) 60%, transparent 62%),
    radial-gradient(4px 8px at 70% 80%, var(--sky) 60%, transparent 62%),
    radial-gradient(5px 5px at 50% 10%, var(--coral) 60%, transparent 62%),
    radial-gradient(4px 8px at 92% 60%, var(--violet) 60%, transparent 62%);
  animation: celebrate 3s ease-out both;
}

@keyframes celebrate {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Footer */
.foot {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 24px;
}

/* Native progress */
progress {
  appearance: none;
  width: 100%;
  height: 10px;
  border: 0;
  border-radius: 99px;
  overflow: hidden;
  background: #ffffff14;
}

progress::-webkit-progress-bar {
  background: #ffffff14;
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--mint), var(--sky));
}

progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--mint), var(--sky));
}

/* Responsive layout and motion */
@media (min-width: 760px) {
  .columns {
    grid-template-columns: 1.2fr 1fr;
  }
}

@media (max-width: 440px) {
  body {
    padding: 24px 16px;
  }

  .card {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
  }
}
