:root {
  --bg: #f7f1e8;
  --panel: rgba(255, 251, 246, 0.84);
  --ink: #20170f;
  --muted: #6e6155;
  --accent: #ff6b35;
  --accent-2: #f7c948;
  --accent-3: #0f8b8d;
  --card: rgba(255, 255, 255, 0.78);
  --card-border: rgba(32, 23, 15, 0.08);
  --shadow: 0 20px 60px rgba(41, 28, 18, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(247, 201, 72, 0.45), transparent 28%),
    radial-gradient(circle at right 20%, rgba(15, 139, 141, 0.28), transparent 24%),
    linear-gradient(135deg, #fff8ef 0%, var(--bg) 55%, #efe3d1 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  border-radius: 999px;
  filter: blur(8px);
}

body::before {
  width: 18rem;
  height: 18rem;
  left: -3rem;
  bottom: 8rem;
  background: rgba(255, 107, 53, 0.12);
}

body::after {
  width: 14rem;
  height: 14rem;
  right: 2rem;
  top: 5rem;
  background: rgba(247, 201, 72, 0.18);
}

.confetti-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 40;
}

.nominee-flash {
  position: fixed;
  left: 50%;
  top: 50%;
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  transform: translate(-50%, -50%) scale(0.4);
  opacity: 0;
  pointer-events: none;
  z-index: 45;
}

.nominee-flash.is-visible {
  animation: nominee-burst 1300ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.nominee-flash__image {
  width: min(28vw, 220px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 999px;
  border: 10px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 24px 60px rgba(32, 23, 15, 0.24),
    0 0 0 8px rgba(255, 107, 53, 0.18);
  background: rgba(255, 255, 255, 0.92);
}

.nominee-flash__label {
  margin: 0;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-weight: 700;
}

.confetti-piece {
  position: absolute;
  top: 28vh;
  width: 14px;
  height: 34px;
  border-radius: 999px;
  opacity: 0.96;
  animation: confetti-burst 1500ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.confetti-piece.is-left {
  left: -2vw;
}

.confetti-piece.is-right {
  right: -2vw;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 4rem;
}

.launch-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  transition: min-height 600ms ease;
}

.launch-stage.is-rolling,
.launch-stage.has-result {
  min-height: 23rem;
  padding-top: 1.25rem;
  align-items: start;
}

.launch-card,
.result-panel,
.options-section,
.dice-cube {
  backdrop-filter: blur(16px);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
}

.launch-card {
  width: min(720px, 100%);
  border-radius: 2rem;
  padding: 2.75rem;
  text-align: center;
  transition: transform 720ms cubic-bezier(0.22, 1, 0.36, 1), opacity 300ms ease;
}

.launch-stage.is-rolling .launch-card,
.launch-stage.has-result .launch-card {
  transform: translateY(-26vh) scale(0.92);
}

.eyebrow {
  margin: 0 0 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-3);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  line-height: 0.96;
}

h1 {
  font-size: clamp(3rem, 8vw, 6.2rem);
  margin-inline: auto;
  max-width: 8ch;
}

.intro,
.result-panel__meta,
.options-note,
.dice-status {
  color: var(--muted);
  line-height: 1.6;
}

.intro {
  max-width: 35rem;
  margin: 1.25rem auto 0;
  font-size: 1.05rem;
}

.dice-button,
.ghost-button,
.option-card {
  font: inherit;
  cursor: pointer;
}

.dice-button {
  border: 0;
  border-radius: 1.4rem;
  padding: 1rem 1.25rem;
  min-width: 240px;
  margin-top: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: white;
  background: linear-gradient(135deg, var(--accent) 0%, #ff915d 100%);
  box-shadow: 0 16px 28px rgba(255, 107, 53, 0.35);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.dice-button--centered {
  justify-content: center;
  text-align: center;
}

.dice-button--centered .dice-button__label {
  flex: 0 1 auto;
}

.dice-button:hover,
.dice-button:focus-visible {
  transform: translateY(-2px) rotate(-1deg);
  box-shadow: 0 20px 32px rgba(255, 107, 53, 0.4);
}

.dice-button:disabled,
.ghost-button:disabled {
  cursor: default;
  opacity: 0.7;
}

.dice-button__label {
  font-weight: 700;
}

.dice-button__icon {
  font-size: 1.1rem;
  letter-spacing: 0.08em;
}

.dice-stage {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 1rem;
  opacity: 0;
  transform: translate(-50%, -40%);
  transition: opacity 260ms ease, transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.launch-stage.is-rolling .dice-stage,
.launch-stage.has-result .dice-stage {
  opacity: 1;
  transform: translate(-50%, -10%);
}

.launch-stage.has-result .dice-stage {
  gap: 0.65rem;
}

.dice-cube {
  width: 180px;
  aspect-ratio: 1;
  border-radius: 2rem;
  padding: 0.9rem;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(252, 240, 227, 0.92));
  box-shadow:
    var(--shadow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.launch-stage.has-result .dice-cube {
  width: min(42vw, 250px);
  aspect-ratio: auto;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.launch-stage.is-rolling .dice-cube {
  animation: tumble 560ms linear infinite;
}

.dice-face {
  width: 100%;
  height: 100%;
  border-radius: 1.4rem;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.launch-stage.has-result .dice-face {
  aspect-ratio: 1;
  min-height: 180px;
}

.dice-status {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

.results-shell {
  margin-top: 1.5rem;
  opacity: 0;
  transform: translateY(32px);
  pointer-events: none;
  transition: opacity 420ms ease, transform 520ms ease;
}

.results-shell.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.result-panel,
.options-section {
  border-radius: 2rem;
}

.result-panel {
  padding: 2rem;
  text-align: center;
}

.result-panel__label {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.result-panel h2 {
  margin-top: 0.75rem;
  font-size: clamp(2.4rem, 5vw, 4.5rem);
}

.result-panel__meta {
  margin: 0.85rem 0 0;
}

.result-panel__badge {
  display: inline-flex;
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  background: rgba(247, 201, 72, 0.32);
  color: #6d4b00;
}

.options-section {
  margin-top: 1.2rem;
  padding: 1.75rem;
}

.options-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.options-heading h3 {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.ghost-button {
  border: 1px solid rgba(32, 23, 15, 0.12);
  border-radius: 1.4rem;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.46);
  color: var(--ink);
  transition: transform 160ms ease, background 160ms ease;
}

.ghost-button:hover,
.ghost-button:focus-visible {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.8);
}

.options-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.option-card {
  border: 1px solid var(--card-border);
  border-radius: 1.25rem;
  padding: 1rem;
  text-align: center;
  background: var(--card);
  min-height: 168px;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 0.65rem;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.option-card:hover,
.option-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(255, 107, 53, 0.45);
  background: rgba(255, 255, 255, 0.92);
}

.option-card.is-active {
  border-color: rgba(15, 139, 141, 0.42);
  background: linear-gradient(180deg, rgba(15, 139, 141, 0.12), rgba(255, 255, 255, 0.94));
  box-shadow: inset 0 0 0 1px rgba(15, 139, 141, 0.18);
}

.option-card__index {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.option-card__thumb {
  width: 100%;
  aspect-ratio: 1.8;
  border-radius: 1rem;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.option-card__name {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.option-card__tagline {
  color: var(--muted);
  line-height: 1.45;
}

@keyframes tumble {
  from {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.08);
  }
  to {
    transform: rotate(360deg) scale(1);
  }
}

@keyframes confetti-burst {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--x), var(--y), 0) rotate(var(--r));
    opacity: 0;
  }
}

@keyframes nominee-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.32) rotate(-8deg);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.92) rotate(5deg);
  }
  55% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.4) rotate(-4deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.9) rotate(8deg);
  }
}

@media (max-width: 960px) {
  .launch-stage.is-rolling .launch-card,
  .launch-stage.has-result .launch-card {
    transform: translateY(-20vh) scale(0.94);
  }

  .options-heading {
    align-items: start;
    flex-direction: column;
  }

  .options-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 1rem, 100%);
    padding-top: 0.75rem;
  }

  .launch-card,
  .result-panel,
  .options-section,
  .dice-cube {
    border-radius: 1.4rem;
  }

  .launch-card,
  .result-panel,
  .options-section {
    padding: 1.25rem;
  }

  .launch-stage.is-rolling .launch-card,
  .launch-stage.has-result .launch-card {
    transform: translateY(-16vh) scale(0.95);
  }

  .dice-cube {
    width: 144px;
  }

  .launch-stage.has-result .dice-cube {
    width: min(56vw, 220px);
  }

  .dice-button,
  .ghost-button {
    width: 100%;
  }

  .options-grid {
    grid-template-columns: 1fr;
  }
}
