:root {
  --black: #090b0d;
  --night: #111820;
  --panel: rgba(10, 14, 16, 0.78);
  --cream: #fff0c2;
  --yellow: #ffd53d;
  --orange: #ff7a2d;
  --red: #d92f21;
  --green: #87a052;
  --blue: #6f94a7;
  --cyan: #66fff4;
  --soil: #4b3824;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--black);
  color: var(--cream);
  overflow-x: hidden;
}

body {
  font-family: "Bahnschrift", "DIN Condensed", "Franklin Gothic Heavy", sans-serif;
}

.scene {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 48% 35%, rgba(255, 213, 61, 0.2), transparent 20rem),
    radial-gradient(circle at 76% 18%, rgba(255, 122, 45, 0.18), transparent 23rem),
    linear-gradient(180deg, #18242e 0%, #0b1116 48%, #17100b 100%);
}

.scene::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(rgba(102, 255, 244, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102, 255, 244, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 40%, black, transparent 72%);
  animation: grid-pulse 2.4s ease-in-out infinite;
}

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.18;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 50% 50%, transparent 0 52%, rgba(0, 0, 0, 0.82) 100%);
  mix-blend-mode: overlay;
}

.scene.shake {
  animation: scene-shake 420ms steps(2, end);
}

#fx {
  position: absolute;
  inset: 0;
  z-index: 9;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.intro {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  background: #07090a;
  animation: intro-out 3.1s cubic-bezier(0.6, 0, 0.2, 1) forwards;
}

.intro p,
.intro strong {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0;
}

.intro p {
  color: var(--cyan);
  font-size: clamp(1rem, 3vw, 1.6rem);
  font-weight: 900;
}

.intro strong {
  color: var(--yellow);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(3.4rem, 14vw, 9rem);
  line-height: 0.85;
  text-shadow: 0 6px 0 #6b1d17, 0 0 34px rgba(255, 213, 61, 0.55);
  transform: rotate(-2deg);
}

.radar {
  position: relative;
  width: clamp(140px, 22vw, 230px);
  aspect-ratio: 1;
  border: 2px solid rgba(102, 255, 244, 0.72);
  border-radius: 50%;
  box-shadow: 0 0 38px rgba(102, 255, 244, 0.2);
}

.radar::before,
.radar::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto 0;
  height: 2px;
  background: rgba(102, 255, 244, 0.72);
}

.radar::after {
  inset: 0 auto 0 50%;
  width: 2px;
  height: auto;
}

.radar span {
  position: absolute;
  inset: 16%;
  border: 1px solid rgba(102, 255, 244, 0.26);
  border-radius: 50%;
}

.radar span:nth-child(2) {
  inset: 32%;
}

.radar span:nth-child(3) {
  inset: 0;
  border: 0;
  border-radius: 0;
  clip-path: polygon(50% 50%, 100% 41%, 100% 59%);
  background: rgba(102, 255, 244, 0.34);
  transform-origin: 50% 50%;
  animation: sweep 1.35s linear infinite;
}

.stage {
  position: relative;
  z-index: 2;
  min-height: 100svh;
}

.hud {
  position: absolute;
  top: clamp(18px, 3vw, 34px);
  z-index: 12;
  display: grid;
  gap: 3px;
  padding: 9px 12px 8px;
  border: 1px solid rgba(102, 255, 244, 0.45);
  color: var(--cyan);
  background: var(--panel);
  box-shadow: 0 0 24px rgba(102, 255, 244, 0.1);
  transform: translateY(-24px);
  opacity: 0;
  animation: hud-in 500ms ease 2.95s forwards;
}

.hud-left {
  left: clamp(14px, 4vw, 46px);
}

.hud-right {
  right: clamp(14px, 4vw, 46px);
}

.hud span,
.hud b {
  font-size: clamp(0.65rem, 1.5vw, 0.9rem);
  line-height: 1;
  letter-spacing: 0.04em;
}

.hud b {
  color: var(--yellow);
  font-size: clamp(0.9rem, 2vw, 1.25rem);
}

.crosshair {
  position: absolute;
  top: 43%;
  left: 50%;
  z-index: 10;
  width: clamp(150px, 23vw, 280px);
  aspect-ratio: 1;
  border: 2px solid rgba(255, 213, 61, 0.74);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.72);
  animation: crosshair-in 780ms cubic-bezier(0.2, 0.9, 0.12, 1.2) 3.15s forwards,
    crosshair-float 2.4s ease-in-out 4s infinite;
}

.crosshair::before,
.crosshair::after {
  content: "";
  position: absolute;
  background: rgba(255, 213, 61, 0.74);
}

.crosshair::before {
  top: 50%;
  left: -28%;
  width: 156%;
  height: 2px;
}

.crosshair::after {
  top: -28%;
  left: 50%;
  width: 2px;
  height: 156%;
}

.crosshair i {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--yellow);
  border-style: solid;
}

.crosshair i:nth-child(1) {
  top: 14%;
  left: 14%;
  border-width: 3px 0 0 3px;
}

.crosshair i:nth-child(2) {
  top: 14%;
  right: 14%;
  border-width: 3px 3px 0 0;
}

.crosshair i:nth-child(3) {
  right: 14%;
  bottom: 14%;
  border-width: 0 3px 3px 0;
}

.crosshair i:nth-child(4) {
  bottom: 14%;
  left: 14%;
  border-width: 0 0 3px 3px;
}

.title-block {
  position: relative;
  z-index: 11;
  width: min(1080px, calc(100% - 28px));
  margin: 0 auto;
  padding-top: clamp(92px, 13vh, 122px);
  transform: translateY(40px) scale(0.94);
  opacity: 0;
  animation: title-drop 700ms cubic-bezier(0.2, 1, 0.18, 1.14) 3.35s forwards;
}

.title-block p {
  width: fit-content;
  margin: 0 0 12px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 213, 61, 0.72);
  color: var(--yellow);
  font-size: clamp(0.8rem, 2vw, 1.05rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(9, 11, 13, 0.78);
}

h1 {
  max-width: 960px;
  margin: 0;
  color: var(--cream);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(3.5rem, 12vw, 10.7rem);
  line-height: 0.78;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 5px 0 #6b1d17, 0 18px 38px rgba(0, 0, 0, 0.62);
}

h1 span,
h1 strong {
  display: block;
}

h1 strong {
  color: var(--yellow);
}

.arena {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
}

.arena::before {
  content: "";
  position: absolute;
  right: -12vw;
  bottom: 0;
  left: -12vw;
  height: clamp(210px, 35vh, 330px);
  background:
    linear-gradient(176deg, transparent 0 17%, rgba(255, 213, 61, 0.16) 18% 19%, transparent 20%),
    linear-gradient(180deg, #7b5c35 0%, var(--soil) 45%, #18100b 100%);
  clip-path: polygon(0 24%, 100% 3%, 100% 100%, 0 100%);
  box-shadow: 0 -28px 80px rgba(0, 0, 0, 0.4);
}

.ridge {
  position: absolute;
  right: -5vw;
  left: -5vw;
  background: #080909;
  opacity: 0.75;
  clip-path: polygon(0 100%, 6% 48%, 9% 68%, 15% 25%, 21% 66%, 28% 34%, 34% 72%, 42% 28%, 48% 67%, 55% 39%, 62% 74%, 70% 29%, 78% 69%, 86% 34%, 92% 66%, 100% 22%, 100% 100%);
}

.ridge-back {
  bottom: clamp(188px, 31vh, 318px);
  height: clamp(96px, 16vh, 150px);
}

.ridge-front {
  bottom: clamp(140px, 24vh, 238px);
  height: clamp(90px, 15vh, 140px);
  opacity: 0.92;
}

.track-line {
  position: absolute;
  right: -10vw;
  left: -10vw;
  z-index: 3;
  height: 15px;
  border-top: 3px dashed rgba(20, 13, 9, 0.75);
  opacity: 0;
  animation: tracks-in 900ms ease 5.1s forwards;
}

.track-one {
  bottom: clamp(92px, 14vh, 142px);
  transform: rotate(-4deg);
}

.track-two {
  bottom: clamp(148px, 21vh, 218px);
  transform: rotate(-2deg);
  animation-delay: 5.8s;
}

.tank-run {
  position: absolute;
  z-index: 6;
  width: clamp(250px, 31vw, 430px);
  filter: drop-shadow(0 24px 20px rgba(0, 0, 0, 0.55));
}

.tank-run-a {
  bottom: clamp(70px, 10vh, 105px);
  left: -34vw;
  animation: tank-a 5.5s cubic-bezier(0.12, 0.88, 0.18, 1) 3.9s forwards;
}

.tank-run-b {
  right: -36vw;
  bottom: clamp(104px, 15vh, 156px);
  animation: tank-b 5.2s cubic-bezier(0.12, 0.88, 0.18, 1) 4.35s forwards;
}

.tank-run-c {
  bottom: clamp(172px, 25vh, 246px);
  left: -30vw;
  width: clamp(170px, 22vw, 300px);
  animation: tank-c 5.1s cubic-bezier(0.12, 0.88, 0.18, 1) 4.8s forwards;
}

.tank-svg {
  display: block;
  width: 100%;
  overflow: visible;
  transform-origin: 50% 70%;
  animation: tank-bob 460ms ease-in-out infinite;
}

.tank-run-b .tank-svg {
  transform: scaleX(-1);
}

.tank-svg .shadow {
  fill: rgba(0, 0, 0, 0.42);
}

.tank-svg .track {
  fill: #111414;
  stroke: #34302a;
  stroke-width: 8;
}

.tank-svg .wheels circle {
  fill: #d8ca98;
  stroke: #171716;
  stroke-width: 9;
  animation: wheel-spin 460ms linear infinite;
  transform-origin: center;
}

.tank-svg .body,
.tank-svg .plate,
.tank-svg .dome {
  stroke: rgba(0, 0, 0, 0.4);
  stroke-width: 4;
}

.tank-svg .plate,
.tank-svg .dome {
  fill: #718345;
}

.tank-svg .barrel {
  fill: #d4c786;
  stroke: rgba(0, 0, 0, 0.4);
  stroke-width: 3;
}

.is2 .plate,
.is2 .dome {
  fill: #647784;
}

.mini .body,
.mini .plate,
.mini .dome {
  fill: #7b8e48;
}

.tank-svg text {
  fill: #fff0c2;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 32px;
  letter-spacing: 0;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.38);
  stroke-width: 5;
}

.tank-run-b text {
  display: none;
}

.tank-run-b::after {
  content: "ИС-2";
  position: absolute;
  right: 19%;
  bottom: 35%;
  z-index: 2;
  color: #fff0c2;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  line-height: 1;
  text-shadow:
    2px 0 rgba(0, 0, 0, 0.45),
    -2px 0 rgba(0, 0, 0, 0.45),
    0 2px rgba(0, 0, 0, 0.45),
    0 -2px rgba(0, 0, 0, 0.45);
}

.stamps {
  position: absolute;
  inset: 0;
  z-index: 14;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.stamp {
  position: absolute;
  max-width: min(1000px, calc(100% - 26px));
  margin: 0;
  padding: clamp(14px, 3vw, 26px) clamp(14px, 4vw, 42px);
  border: clamp(3px, 0.55vw, 7px) solid currentColor;
  color: var(--yellow);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(2.25rem, 8vw, 7.4rem);
  line-height: 0.88;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
  background: rgba(9, 11, 13, 0.86);
  box-shadow: 0 18px 0 rgba(0, 0, 0, 0.42), 0 0 50px rgba(255, 213, 61, 0.18);
  opacity: 0;
}

.stamp-birthday {
  top: 35%;
  transform: translateY(-50%) rotate(-4deg) scale(1.8);
  animation: stamp-hit 820ms cubic-bezier(0.12, 1.35, 0.18, 1) 7s forwards,
    stamp-exit 480ms ease 8.35s forwards;
}

.stamp-debt {
  bottom: clamp(54px, 8vh, 88px);
  color: var(--cream);
  transform: rotate(2deg) scale(1.9);
  animation: stamp-hit-final 900ms cubic-bezier(0.12, 1.35, 0.18, 1) 8.85s forwards;
}

.stamp-debt::first-line {
  color: var(--yellow);
}

.replay {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 240, 194, 0.52);
  border-radius: 50%;
  color: var(--cream);
  font-size: 1.35rem;
  cursor: pointer;
  background: rgba(9, 11, 13, 0.72);
  backdrop-filter: blur(10px);
}

.replay:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.scene.restarting * {
  animation: none !important;
}

@keyframes intro-out {
  0%,
  72% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.18);
  }
}

@keyframes sweep {
  to {
    transform: rotate(1turn);
  }
}

@keyframes hud-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes title-drop {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes crosshair-in {
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes crosshair-float {
  50% {
    transform: translate(-50%, -52%) scale(1.04);
  }
}

@keyframes tank-a {
  0% {
    transform: translateX(0) rotate(-1deg);
  }
  50% {
    transform: translateX(56vw) rotate(2deg);
  }
  100% {
    transform: translateX(126vw) rotate(-1deg);
  }
}

@keyframes tank-b {
  0% {
    transform: translateX(0) rotate(1deg);
  }
  54% {
    transform: translateX(-54vw) rotate(-2deg);
  }
  100% {
    transform: translateX(-126vw) rotate(1deg);
  }
}

@keyframes tank-c {
  0% {
    transform: translateX(0) rotate(-2deg);
  }
  100% {
    transform: translateX(122vw) rotate(1deg);
  }
}

@keyframes tank-bob {
  50% {
    transform: translateY(-5px) rotate(0.7deg);
  }
}

@keyframes wheel-spin {
  to {
    transform: rotate(1turn);
  }
}

@keyframes tracks-in {
  to {
    opacity: 0.85;
  }
}

@keyframes stamp-hit {
  0% {
    opacity: 0;
    transform: translateY(-50%) rotate(-4deg) scale(1.8);
  }
  62% {
    opacity: 1;
    transform: translateY(-50%) rotate(-4deg) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(-50%) rotate(-4deg) scale(1);
  }
}

@keyframes stamp-hit-final {
  0% {
    opacity: 0;
    transform: rotate(2deg) scale(1.9);
  }
  62% {
    opacity: 1;
    transform: rotate(2deg) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: rotate(2deg) scale(1);
  }
}

@keyframes stamp-exit {
  to {
    opacity: 0;
    transform: translateY(-50%) rotate(-8deg) scale(0.7);
  }
}

@keyframes scene-shake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(-10px, 5px);
  }
  40% {
    transform: translate(8px, -7px);
  }
  60% {
    transform: translate(-5px, -4px);
  }
  80% {
    transform: translate(6px, 6px);
  }
}

@keyframes grid-pulse {
  50% {
    opacity: 0.48;
  }
}

@media (max-width: 760px) {
  .hud {
    top: 12px;
    padding: 7px 9px;
  }

  .hud-right {
    display: none;
  }

  .title-block {
    padding-top: 86px;
  }

  h1 {
    max-width: 470px;
    font-size: clamp(3.35rem, 17vw, 5.7rem);
  }

  .crosshair {
    top: 45%;
    width: 170px;
  }

  .tank-run {
    width: 255px;
  }

  .tank-run-a {
    left: -270px;
    bottom: 90px;
  }

  .tank-run-b {
    right: -280px;
    bottom: 128px;
  }

  .tank-run-c {
    left: -220px;
    bottom: 226px;
    width: 180px;
  }

  .stamp {
    font-size: clamp(2.05rem, 12vw, 4.2rem);
  }

  .stamp-birthday {
    top: 42%;
  }

  .stamp-debt {
    bottom: 72px;
  }
}

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

  .intro {
    display: none;
  }

  .title-block,
  .hud,
  .crosshair,
  .stamp-debt {
    opacity: 1;
    transform: none;
  }
}
