:root {
  --red: #e8192c;
  --red-dark: #9f0f1e;
  --orange: #ff7900;
  --orange-dark: #b84400;
  --ink: #0b0b0c;
  --panel: #121214;
  --line: #2c2c30;
  --white: #ffffff;
  --muted: #b7b7bd;
}

* {
  box-sizing: border-box;
}

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

body {
  overflow-x: hidden;
  background: var(--ink);
  color: var(--white);
  font-family: "Inter", Arial, sans-serif;
}

button {
  font: inherit;
}

.war-stage {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(210px, 0.86fr) minmax(440px, 1.46fr) minmax(260px, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 3vw, 4.5rem);
  padding: clamp(2rem, 4vw, 5rem);
  overflow: hidden;
  background-color: var(--ink);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
}

.war-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 38vw;
  height: 145vh;
  left: 43%;
  top: 50%;
  translate: -50% -50%;
  rotate: 13deg;
  border-left: 1px solid rgba(232, 25, 44, 0.2);
  border-right: 1px solid rgba(232, 25, 44, 0.2);
  background: rgba(232, 25, 44, 0.035);
}

.corner {
  position: absolute;
  width: 130px;
  height: 18px;
  background: var(--red);
}

.corner--top-left {
  top: 0;
  left: 0;
  clip-path: polygon(0 0, 100% 0, 86% 100%, 0 100%);
}

.corner--bottom-right {
  right: 0;
  bottom: 0;
  clip-path: polygon(14% 0, 100% 0, 100% 100%, 0 100%);
}

.brand-panel,
.title-panel {
  position: relative;
  z-index: 2;
}

.brand-panel {
  align-self: center;
  padding-left: clamp(0rem, 1vw, 1rem);
}

.eyebrow,
.event-label,
.winner-kicker {
  display: block;
  font: 800 0.76rem/1 "Inter", sans-serif;
  letter-spacing: 0.22em;
  color: var(--red);
}

.brand-logo {
  display: block;
  width: min(100%, 360px);
  height: auto;
  margin: 1.2rem 0 1.35rem;
  object-fit: contain;
}

.brand-line {
  width: 72%;
  max-width: 250px;
  height: 4px;
  background: var(--white);
  position: relative;
}

.brand-line::after {
  content: "";
  position: absolute;
  right: -18px;
  top: 0;
  width: 12px;
  height: 4px;
  background: var(--red);
}

.game-panel {
  width: min(100%, 690px);
  justify-self: center;
  text-align: center;
}

.wheel-wrap {
  position: relative;
  width: min(100%, 610px);
  aspect-ratio: 1;
  margin-inline: auto;
  filter: drop-shadow(0 28px 38px rgba(0, 0, 0, 0.42));
}

#wheel {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.pointer {
  position: absolute;
  z-index: 5;
  top: 50%;
  right: -1.7%;
  translate: 0 -50%;
  width: 12.2%;
  aspect-ratio: 1.42;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  background: var(--orange);
  filter: drop-shadow(0 5px 0 var(--orange-dark)) drop-shadow(0 8px 9px rgba(0, 0, 0, 0.45));
}

.pointer span {
  position: absolute;
  right: 18%;
  top: 50%;
  translate: 0 -50%;
  width: 19%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--white);
}

.wheel-center {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: 19%;
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  border: clamp(5px, 0.7vw, 9px) solid var(--white);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 5px var(--red), 0 8px 20px rgba(0, 0, 0, 0.5);
}

.wheel-center strong {
  font: 900 clamp(1.2rem, 2.7vw, 2.4rem)/0.9 "Barlow Condensed", sans-serif;
  letter-spacing: -0.04em;
}

.wheel-center small {
  margin-top: 0.28rem;
  font-size: clamp(0.35rem, 0.58vw, 0.58rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--red);
}

.spin-button {
  min-width: min(86%, 330px);
  min-height: 58px;
  margin-top: clamp(1.2rem, 2vw, 2rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.95rem 1.7rem;
  border: 2px solid var(--red);
  border-radius: 0;
  background: var(--red);
  color: var(--white);
  box-shadow: 7px 7px 0 var(--white);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  transition: translate 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.spin-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spin-button:hover:not(:disabled) {
  background: var(--white);
  color: var(--red);
  translate: 3px 3px;
  box-shadow: 4px 4px 0 var(--red);
}

.spin-button:focus-visible,
.winner-card button:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 5px;
}

.spin-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.status {
  min-height: 1.4em;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.title-panel {
  padding-left: clamp(0rem, 1.8vw, 2rem);
}

.event-label {
  margin: 0 0 0.8rem;
  color: var(--white);
}

.title-panel h1 {
  max-width: 480px;
  margin: 0;
  font: 900 clamp(4.5rem, 8.2vw, 9rem)/0.73 "Barlow Condensed", sans-serif;
  letter-spacing: -0.055em;
  text-transform: uppercase;
}

.title-panel h1 span {
  display: block;
  color: var(--red);
}

.title-rule {
  width: min(100%, 330px);
  height: 8px;
  margin-top: 1.7rem;
  background: var(--red);
  clip-path: polygon(0 0, 100% 0, 95% 100%, 0 100%);
}

.title-rule i {
  display: block;
  width: 20%;
  height: 100%;
  margin-left: 28%;
  background: var(--white);
  transform: skewX(-26deg);
}

.event-copy {
  margin: 1rem 0 0;
  color: var(--muted);
  font: 700 0.82rem/1.4 "Inter", sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.winner[hidden] {
  display: none;
}

.winner {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(5, 5, 6, 0.86);
  backdrop-filter: blur(8px);
}

.winner-card {
  width: min(100%, 520px);
  position: relative;
  padding: clamp(2.1rem, 5vw, 4rem);
  border: 2px solid var(--red);
  background: var(--panel);
  text-align: center;
  box-shadow: 14px 14px 0 var(--red);
  animation: winner-in 380ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.winner-card::before,
.winner-card::after {
  content: "";
  position: absolute;
  width: 54px;
  height: 7px;
  background: var(--white);
}

.winner-card::before {
  top: 15px;
  left: -16px;
}

.winner-card::after {
  right: -16px;
  bottom: 15px;
}

.winner-card h2 {
  margin: 0.85rem 0 0;
  font: 900 clamp(2.8rem, 7vw, 5.3rem)/0.9 "Barlow Condensed", sans-serif;
  text-transform: uppercase;
}

.winner-card p {
  margin: 1.5rem 0 2rem;
  color: var(--red);
  font: 900 clamp(2rem, 5vw, 3.5rem)/1 "Barlow Condensed", sans-serif;
}

.winner-card button {
  min-height: 50px;
  padding: 0.8rem 1.4rem;
  border: 2px solid var(--white);
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.08em;
}

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

.confetti-piece {
  position: absolute;
  top: -24px;
  width: 10px;
  height: 18px;
  animation: confetti-fall var(--duration) linear forwards;
}

@keyframes winner-in {
  from {
    opacity: 0;
    transform: scale(0.84) rotate(-1.5deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes confetti-fall {
  to {
    transform: translate3d(var(--drift), 110vh, 0) rotate(900deg);
  }
}

@media (max-width: 1120px) {
  .war-stage {
    grid-template-columns: minmax(155px, 0.72fr) minmax(390px, 1.4fr) minmax(190px, 0.8fr);
    gap: 1.25rem;
    padding: 2rem;
  }

  .title-panel h1 {
    font-size: clamp(4rem, 7vw, 6.6rem);
  }
}

@media (max-width: 800px) {
  .war-stage {
    min-height: 100svh;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.4rem 1.2rem 2.5rem;
  }

  .brand-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0;
  }

  .eyebrow,
  .brand-line,
  .event-label,
  .title-rule,
  .event-copy {
    display: none;
  }

  .brand-logo {
    width: min(56vw, 245px);
    margin: 0;
  }

  .brand-panel::after {
    content: "WAR DAY";
    color: var(--red);
    font: 900 clamp(1.65rem, 8vw, 2.8rem)/0.8 "Barlow Condensed", sans-serif;
  }

  .game-panel {
    grid-row: 2;
    width: min(100%, 590px);
  }

  .wheel-wrap {
    width: min(87vw, 520px);
  }

  .title-panel {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
