:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #12151b;
  color: #f3f0e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: #12151b;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(2, 4, 9, 0.22), rgba(2, 4, 9, 0.05) 45%, rgba(2, 4, 9, 0.3)),
    url("../assets/american-flag-background.png") center / cover no-repeat;
  filter: saturate(1.08) contrast(1.05);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.22), transparent 28%),
    linear-gradient(180deg, rgba(6, 10, 20, 0.08), rgba(6, 10, 20, 0.58));
  pointer-events: none;
}

.eagle-sky {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.eagle {
  position: absolute;
  left: -42vw;
  width: clamp(260px, 27vw, 520px);
  height: auto;
  opacity: 0.78;
  transform-origin: center;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.3));
  animation: eagle-flight 20s linear infinite;
}

.eagle-one {
  top: 8%;
  animation-duration: 20s;
}

.eagle-two {
  top: 34%;
  transform: scale(0.72);
  animation-delay: -5s;
  animation-duration: 26s;
  opacity: 0.58;
}

.eagle-three {
  top: 62%;
  transform: scale(0.86) scaleX(-1);
  animation-delay: -11s;
  animation-duration: 23s;
  opacity: 0.64;
}

.eagle-four {
  top: 20%;
  transform: scale(0.56);
  animation-delay: -15s;
  animation-duration: 31s;
  opacity: 0.5;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.shell {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(680px, 1fr) 340px;
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
}

.game-wrap {
  display: grid;
  place-items: center;
  min-width: 0;
}

#game {
  width: min(100%, 1180px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #171b21;
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.34);
}

#game canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 21, 27, 0.86);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1;
}

h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0;
  color: #aeb8bb;
}

.subhead {
  margin-top: 8px;
  color: #c9d0ca;
  line-height: 1.45;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-grid div {
  min-width: 0;
  padding: 10px;
  background: #202631;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-grid span,
.tower-button small {
  display: block;
  color: #aeb8bb;
  font-size: 12px;
}

.stat-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.control-group {
  display: grid;
  gap: 8px;
}

.tower-button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 12px;
  text-align: left;
  background: #202631;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tower-button.active {
  border-color: #f0be5f;
  background: #2b2b28;
}

.tower-button span {
  font-weight: 800;
}

.selected-info {
  min-height: 70px;
  padding: 12px;
  line-height: 1.45;
  color: #dce3df;
  background: #202631;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.primary-button,
.secondary-button {
  min-height: 44px;
  padding: 10px 12px;
  font-weight: 800;
}

.primary-button {
  background: #e6ad4b;
  color: #16130d;
}

.secondary-button {
  background: #2f3944;
}

.message {
  min-height: 48px;
  color: #cbd6d2;
  line-height: 1.45;
}

@keyframes eagle-flight {
  0% {
    translate: 0 0;
  }

  35% {
    translate: 46vw -48px;
  }

  68% {
    translate: 92vw 36px;
  }

  100% {
    translate: 148vw -18px;
  }
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    order: -1;
  }
}
