:root {
  --navy: #101827;
  --navy-2: #1f3156;
  --blue: #7ea2ff;
  --blue-2: #4b6ee7;
  --red: #e2183c;
  --paper: #ffffff;
  --cream: #f7f2e8;
  --muted: #596478;
  --line: rgba(16, 26, 55, 0.12);
  --shadow: 0 24px 60px rgba(16, 24, 39, 0.16);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--navy);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(126, 162, 255, 0.28), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(226, 24, 60, 0.12), transparent 30%),
    linear-gradient(135deg, #f8f3ea 0%, #eef2f7 52%, #dfe8f8 100%);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(120deg, transparent 0 46%, rgba(16, 24, 39, 0.05) 46% 47%, transparent 47% 100%);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 82%);
}

body.is-drawing-fullscreen {
  overflow: hidden;
}

body.is-drawing-fullscreen::after {
  position: fixed;
  inset: 0;
  z-index: 40;
  content: "";
  background:
    radial-gradient(circle at center, rgba(79, 116, 223, 0.28), transparent 42%),
    rgba(10, 16, 30, 0.72);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.event-mark,
.event-copy {
  display: flex;
  align-items: center;
  gap: 16px;
}

.emt {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 3px solid var(--navy);
  border-radius: 999px;
  font-weight: 900;
  letter-spacing: -0.08em;
}

.divider {
  width: 1px;
  height: 48px;
  background: rgba(16, 26, 55, 0.24);
}

.hsd {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 900;
  letter-spacing: -0.05em;
}

.hsd b {
  color: var(--red);
}

.event-copy {
  align-items: flex-end;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}

.event-copy span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.event-copy strong {
  font-size: 22px;
}

.hero,
.stage,
.results {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: center;
  padding: 36px 42px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.58)),
    radial-gradient(circle at 80% 16%, rgba(126, 162, 255, 0.28), transparent 36%);
}

.hero::after {
  position: absolute;
  right: 36px;
  bottom: 32px;
  width: 132px;
  height: 8px;
  content: "";
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red), var(--blue-2));
}

.hero-copy,
.import-card {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 18px;
  color: var(--red);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(50px, 7.2vw, 96px);
  font-weight: 900;
  line-height: 0.96;
  letter-spacing: -0.07em;
}

.hero-copy p {
  max-width: 610px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 21px;
  line-height: 1.55;
}

.import-card {
  display: grid;
  gap: 14px;
}

.file-drop {
  display: flex;
  min-height: 196px;
  padding: 26px;
  border: 1px solid rgba(16, 24, 39, 0.1);
  border-radius: 24px;
  flex-direction: column;
  justify-content: center;
  background: var(--navy);
  color: white;
  box-shadow: 0 18px 42px rgba(16, 24, 39, 0.22);
  transition: 180ms ease;
}

.file-drop:hover {
  transform: translateY(-2px);
  border-color: var(--blue-2);
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-drop span {
  width: fit-content;
  margin-bottom: 28px;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  background: white;
}

.file-drop strong {
  display: block;
  font-size: 24px;
  line-height: 1.12;
}

.file-drop small {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.45;
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  margin-top: 18px;
  padding: 22px;
}

.draw-card {
  display: grid;
  gap: 18px;
  min-height: 462px;
}

.draw-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px;
}

.draw-card__top span,
.results > div > span {
  color: var(--blue-2);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.draw-card__top strong {
  padding: 10px 16px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
}

.winner-display {
  position: relative;
  display: grid;
  min-height: 320px;
  place-items: center;
  padding: 34px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 30px;
  text-align: center;
  background:
    radial-gradient(circle at center, rgba(111, 147, 242, 0.24), transparent 52%),
    linear-gradient(145deg, #fff 0%, #f2f8ff 100%);
  box-shadow: inset 0 0 0 1px rgba(16, 26, 55, 0.04);
}

body.is-drawing-fullscreen .winner-display {
  position: fixed;
  inset: 0;
  z-index: 80;
  min-height: auto;
  border-radius: 0;
  grid-template-rows: auto auto auto;
  align-content: center;
  justify-items: center;
  gap: 28px;
  color: white;
  background:
    radial-gradient(circle at 50% 42%, rgba(126, 162, 255, 0.26), transparent 36%),
    linear-gradient(145deg, #0b1222 0%, #14213d 58%, #0d1628 100%);
  box-shadow: 0 34px 120px rgba(16, 24, 39, 0.48);
  isolation: isolate;
}

.fullscreen-brand {
  position: fixed;
  left: 36px;
  top: 28px;
  z-index: 100;
  display: none;
  align-items: center;
  gap: 16px;
  color: white;
  pointer-events: none;
}

body.is-drawing-fullscreen .fullscreen-brand {
  display: flex;
}

.fullscreen-brand .emt {
  border-color: rgba(255, 255, 255, 0.92);
}

.fullscreen-brand .divider {
  background: rgba(255, 255, 255, 0.35);
}

.fullscreen-brand .hsd {
  color: white;
}

body.is-drawing-fullscreen .winner-display.is-rolling::after {
  display: none;
}

body.is-drawing-fullscreen .winner-display strong {
  max-width: min(1180px, 92vw);
  font-size: clamp(48px, 7.4vw, 112px);
  line-height: 1.08;
  color: white;
  letter-spacing: -0.04em;
  text-align: center;
  text-shadow: 0 8px 34px rgba(0, 0, 0, 0.42);
}

body.is-drawing-fullscreen .winner-display small {
  font-size: clamp(18px, 2vw, 30px);
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
}

body.is-drawing-fullscreen .winner-display__kicker {
  color: #9fb8ff;
}

.winner-display::before {
  position: absolute;
  inset: 18px;
  content: "";
  border: 1px solid rgba(79, 116, 223, 0.14);
  border-radius: 24px;
  pointer-events: none;
}

.winner-display.is-celebrating {
  animation: winnerPop 720ms ease both;
}

.winner-display.is-rolling strong {
  animation: rollName 90ms linear infinite alternate;
}

.winner-display.is-rolling {
  background:
    radial-gradient(circle at 50% 48%, rgba(226, 24, 60, 0.18), transparent 26%),
    radial-gradient(circle at center, rgba(111, 147, 242, 0.38), transparent 58%),
    linear-gradient(145deg, #fff 0%, #eef5ff 100%);
  animation: stagePulse 1100ms ease-in-out infinite alternate;
}

body.is-drawing-fullscreen .winner-display.is-rolling {
  background:
    radial-gradient(circle at 50% 42%, rgba(226, 24, 60, 0.18), transparent 28%),
    radial-gradient(circle at center, rgba(126, 162, 255, 0.34), transparent 56%),
    linear-gradient(145deg, #0b1222 0%, #14213d 58%, #0d1628 100%);
}

.winner-display.is-rolling::after {
  position: absolute;
  inset: -40%;
  content: "";
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.72) 48%, transparent 58%);
  animation: stageSweep 1200ms linear infinite;
  pointer-events: none;
}

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

.confetti-piece {
  position: absolute;
  top: var(--start-y);
  width: 10px;
  height: 18px;
  border-radius: 3px;
  background: var(--blue-2);
  transform: translate3d(0, 0, 0) rotate(0deg);
  animation: confettiBurst 3600ms cubic-bezier(0.16, 0.82, 0.24, 1) forwards;
}

.winner-display__kicker {
  position: relative;
  z-index: 3;
  color: var(--blue-2);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.winner-display strong {
  position: relative;
  z-index: 3;
  display: block;
  max-width: 100%;
  color: var(--navy);
  font-size: clamp(44px, 7.5vw, 96px);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -0.055em;
  text-wrap: balance;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

.winner-display small {
  position: relative;
  z-index: 3;
  max-width: 720px;
  color: var(--muted);
  font-size: 16px;
}

.actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 150px;
  gap: 12px;
}

.primary-button,
.backup-button,
.secondary-button {
  min-height: 62px;
  border-radius: 18px;
  font-weight: 900;
  transition: 180ms ease;
}

.primary-button {
  border: 0;
  color: white;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  box-shadow: 0 16px 30px rgba(16, 26, 55, 0.24);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--navy);
  background: rgba(255, 255, 255, 0.78);
}

.backup-button {
  border: 1px solid rgba(79, 116, 223, 0.35);
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
}

.primary-button:not(:disabled):hover,
.backup-button:not(:disabled):hover,
.secondary-button:hover,
.prize-card:hover {
  transform: translateY(-2px);
}

.primary-button:disabled,
.backup-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.prizes {
  display: grid;
  gap: 14px;
}

.prize-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 136px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  text-align: left;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.72);
  transition: 180ms ease;
}

.prize-card.is-active {
  border-color: rgba(79, 116, 223, 0.7);
  background: #fff;
  box-shadow: 0 14px 34px rgba(79, 116, 223, 0.18);
}

.prize-card.is-done {
  cursor: not-allowed;
  opacity: 0.52;
}

.prize-card span {
  display: grid;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 18px;
  color: white;
  font-size: 22px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
}

.prize-card strong,
.prize-card small {
  display: block;
}

.prize-card strong {
  font-size: 18px;
  line-height: 1.15;
  text-transform: uppercase;
}

.prize-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.results {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  margin-top: 22px;
  padding: 24px;
}

.results h2 {
  margin: 4px 0 0;
  font-size: 30px;
}

.backup-results {
  box-shadow: 0 18px 48px rgba(16, 24, 39, 0.12);
}

.winner-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
}

.winner-list li {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.winner-list details {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.winner-list summary {
  cursor: pointer;
  font-weight: 800;
}

.winner-list summary::marker {
  color: var(--blue-2);
}

.winner-contact {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

@keyframes rollName {
  from {
    opacity: 0.72;
    transform: scale(0.99);
  }

  to {
    opacity: 1;
    transform: scale(1.01);
  }
}

@keyframes stagePulse {
  from {
    box-shadow: inset 0 0 0 1px rgba(16, 26, 55, 0.04), 0 0 0 rgba(79, 116, 223, 0);
  }

  to {
    box-shadow: inset 0 0 0 1px rgba(16, 26, 55, 0.04), 0 22px 70px rgba(79, 116, 223, 0.24);
  }
}

@keyframes stageSweep {
  from {
    transform: translateX(-34%) rotate(8deg);
  }

  to {
    transform: translateX(34%) rotate(8deg);
  }
}

@keyframes winnerPop {
  0% {
    box-shadow: 0 0 0 rgba(79, 116, 223, 0);
    transform: scale(1);
  }

  45% {
    box-shadow: 0 0 0 12px rgba(79, 116, 223, 0.12), 0 26px 80px rgba(226, 24, 60, 0.16);
    transform: scale(1.015);
  }

  100% {
    box-shadow: inset 0 0 0 1px rgba(16, 26, 55, 0.04);
    transform: scale(1);
  }
}

@keyframes confettiBurst {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.6) rotate(0deg);
  }

  10% {
    opacity: 1;
  }

  55% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--drift), var(--fall), 0) scale(1) rotate(var(--spin));
  }
}

@media (max-width: 900px) {
  .app {
    width: min(100% - 20px, 680px);
    padding-top: 16px;
  }

  .topbar,
  .event-mark {
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
  }

  .event-copy {
    align-items: flex-start;
    text-align: left;
  }

  .hero,
  .stage,
  .results {
    grid-template-columns: 1fr;
  }

  .hero,
  .stage,
  .results {
    padding: 18px;
  }

  .eyebrow {
    margin-bottom: 8px;
  }

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

@media (max-width: 520px) {
  .emt {
    width: 52px;
    height: 52px;
    font-size: 14px;
  }

  .divider {
    height: 40px;
  }

  .hsd {
    font-size: 30px;
  }

  h1 {
    font-size: clamp(46px, 15vw, 68px);
    line-height: 0.96;
  }

  .hero-copy p {
    font-size: 17px;
  }

  .file-drop {
    min-height: 170px;
    padding: 20px;
  }

  .file-drop span {
    margin-bottom: 18px;
  }

  .winner-display {
    min-height: 260px;
    padding: 22px 14px;
  }

  body.is-drawing-fullscreen .winner-display {
    inset: 0;
    border-radius: 0;
  }

  .fullscreen-brand {
    left: 16px;
    top: 14px;
    transform: scale(0.82);
    transform-origin: left top;
  }

  .prize-card {
    min-height: 112px;
  }
}
