:root {
  --space: #07060b;
  --work: #f3eee6;
  --game: #ff3b5c;
  --team: #e7b84a;
  --crimson: #bf1238;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

html {
  color-scheme: dark;
}

body {
  overflow: hidden;
  background: var(--space);
  color: var(--work);
  font-family: Syne, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.nebula,
.vignette,
#field {
  position: fixed;
  inset: 0;
}

.nebula {
  z-index: 0;
  background:
    radial-gradient(ellipse 58% 48% at 76% 28%, rgba(191, 18, 56, 0.5), transparent 68%),
    radial-gradient(ellipse 42% 36% at 14% 82%, rgba(231, 184, 74, 0.16), transparent 70%),
    radial-gradient(ellipse 36% 30% at 48% 46%, rgba(255, 59, 92, 0.1), transparent 72%);
}

main {
  position: fixed;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  padding: clamp(1.35rem, 4.5vw, 4.25rem);
  pointer-events: none;
  user-select: none;
  animation: rise 0.9s ease both;
}

.slots {
  display: flex;
  gap: clamp(0.7rem, 2vw, 1.15rem);
  margin: 0;
  font-size: clamp(1.7rem, 4.4vw, 2.55rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.slot {
  width: 1.85em;
  height: 1.85em;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: rgba(243, 238, 230, 0.42);
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.08), transparent 58%),
    rgba(0, 0, 0, 0.28);
  box-shadow:
    inset 0 10px 16px rgba(0, 0, 0, 0.45),
    0 0 0 1.5px rgba(243, 238, 230, 0.28);
  transition: transform 0.2s ease, color 0.2s ease, background 0.25s ease, box-shadow 0.2s ease;
}

.slot.is-target {
  color: rgba(243, 238, 230, 0.82);
  box-shadow:
    inset 0 10px 16px rgba(0, 0, 0, 0.4),
    0 0 0 1.5px rgba(243, 238, 230, 0.72),
    0 0 22px rgba(243, 238, 230, 0.18);
}

.slot.is-over {
  transform: translateY(-6px) scale(1.08);
  color: var(--work);
}

.slot.is-wrong {
  box-shadow:
    inset 0 10px 16px rgba(0, 0, 0, 0.4),
    0 0 0 1.5px var(--game);
  color: var(--game);
}

.slot.is-filled {
  color: #14080c;
  box-shadow:
    inset 0 -8px 12px rgba(0, 0, 0, 0.18),
    0 0 0 1.5px transparent,
    0 10px 24px rgba(0, 0, 0, 0.28);
}

.slot[data-letter="W"].is-filled {
  background: var(--work);
}

.slot[data-letter="G"].is-filled {
  background: var(--game);
}

.slot[data-letter="T"].is-filled {
  background: var(--team);
}

.slot.is-landed {
  animation: land 0.48s ease;
}

.falling-letter {
  position: fixed;
  z-index: 6;
  left: 0;
  top: 0;
  margin: 0;
  color: #14080c;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.bravo {
  position: fixed;
  z-index: 5;
  left: 50%;
  top: 38%;
  width: min(28rem, calc(100% - 2rem));
  margin: 0;
  text-align: center;
  transform: translate(-50%, -50%) scale(0.88);
  opacity: 0;
  filter: blur(10px);
  pointer-events: none;
}

.bravo::after {
  content: "";
  position: absolute;
  inset: -55% -35%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(243, 238, 230, 0.16), transparent 42%),
    radial-gradient(circle, rgba(255, 59, 92, 0.14), transparent 52%),
    radial-gradient(circle, rgba(231, 184, 74, 0.12), transparent 58%);
  opacity: 0;
  transform: scale(0.7);
}

.bravo.is-visible {
  animation: bravo-pop 1.05s cubic-bezier(0.22, 1, 0.36, 1) both;
  pointer-events: none;
}

.bravo.is-visible::after {
  animation: bravo-halo 1.55s ease both;
}

.bravo-title,
.bravo-mail {
  display: block;
  opacity: 0;
  transform: translateY(16px);
}

.bravo.is-visible .bravo-title {
  animation: bravo-line 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
}

.bravo.is-visible .bravo-mail {
  animation: bravo-line 0.78s ease 0.42s both;
}

.bravo-title {
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
  text-shadow:
    0 0 28px rgba(243, 238, 230, 0.22),
    0 18px 36px rgba(0, 0, 0, 0.35);
}

.bravo-mail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.85rem;
  color: rgba(243, 238, 230, 0.82);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  pointer-events: auto;
}

.bravo-mail svg {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
}

.bravo-mail:hover,
.bravo-mail:focus-visible {
  color: var(--work);
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

#field {
  z-index: 2;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: default;
}

.vignette {
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.5) 100%);
}

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

::selection {
  background: var(--team);
  color: var(--space);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes bravo-pop {
  0% {
    opacity: 0;
    filter: blur(12px);
    transform: translate(-50%, -50%) scale(0.82);
  }
  48% {
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, -50%) scale(1.05);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes bravo-line {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes bravo-halo {
  0% {
    opacity: 0;
    transform: scale(0.65);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0.32;
    transform: scale(1.12);
  }
}

@keyframes land {
  0% {
    transform: scale(1.22);
  }
  55% {
    transform: scale(0.94);
  }
  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  main,
  .bravo,
  .bravo.is-visible,
  .bravo.is-visible::after,
  .bravo.is-visible .bravo-title,
  .bravo.is-visible .bravo-mail,
  .slot,
  .slot.is-landed {
    animation: none;
  }

  .bravo.is-visible {
    opacity: 1;
    filter: none;
    transform: translate(-50%, -50%);
  }

  .bravo.is-visible .bravo-title,
  .bravo.is-visible .bravo-mail {
    opacity: 1;
    transform: none;
  }
}
