* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(87, 57, 24, 0.45), transparent 34%),
    #15120f;
  color: #f4e7c5;
  font-family: monospace;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
}

#gameWrapper {
  width: 100%;
  max-width: 1780px;
  padding: 0 16px 16px;
  text-align: center;
}

#canvasShell {
  position: relative;
  width: 100%;
  max-width: 1728px;
  aspect-ratio: 7 / 4;
  margin: 0 auto;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(rgba(36, 30, 22, 0.2), rgba(36, 30, 22, 0.2)),
    #2a241c;
  border: 5px solid #6b4b29;
  box-shadow:
    0 0 0 4px #1a130d,
    0 12px 30px rgba(0, 0, 0, 0.6);
  image-rendering: pixelated;
  cursor: crosshair;
  display: block;
}

.menuOverlay {
  position: absolute;
  inset: 5px;
  display: none;
  justify-content: center;
  align-items: center;
  background:
    linear-gradient(rgba(14, 10, 7, 0.72), rgba(14, 10, 7, 0.84));
  padding: 20px;
}

.menuOverlay.visible {
  display: flex;
}

.menuCard {
  width: min(640px, 92%);
  padding: 30px;
  background:
    linear-gradient(rgba(43, 33, 24, 0.95), rgba(28, 22, 16, 0.95)),
    url("assets/ui/panel_tile.png");
  background-size: 48px 48px;
  border: 4px solid #d79a38;
  box-shadow:
    0 0 0 5px #1a130d,
    0 12px 0 #120d09,
    0 20px 40px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.titleCard {
  background:
    linear-gradient(135deg, rgba(57, 42, 25, 0.96), rgba(31, 24, 18, 0.96)),
    #2a2118;
}

.popupCard {
  max-width: 540px;
}

.smallLabel {
  color: #f6d65c;
  letter-spacing: 3px;
  font-size: 13px;
  margin-bottom: 8px;
}

.menuCard h2 {
  margin: 0;
  font-size: 48px;
  color: #f4d27a;
  text-shadow:
    3px 3px 0 #6b3b1e,
    5px 5px 0 #000;
}

.menuCard p {
  max-width: 500px;
  margin: 16px auto 22px;
  line-height: 1.5;
  color: #d8c7a5;
}

button {
  font-family: monospace;
  font-weight: bold;
  cursor: pointer;
  border: 0;
  transition: transform 0.08s ease, filter 0.08s ease;
}

button:hover {
  filter: brightness(1.09);
}

button:active {
  transform: translateY(3px);
}

.menuActions,
.buttonRow,
.editorActions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.primaryButton,
.secondaryButton {
  padding: 14px 20px;
  font-size: 18px;
  color: #1d1208;
  border: 3px solid #120d09;
  box-shadow: 0 6px 0 #120d09;
}

.primaryButton {
  color: #1d1208;
  background: center / 100% 100% no-repeat url("assets/ui/button_primary.png");
}

.secondaryButton {
  color: #1d1208;
  background: center / 100% 100% no-repeat url("assets/ui/button_secondary.png");
}

.dangerButton {
  color: #1d1208;
  background: center / 100% 100% no-repeat url("assets/ui/button_danger.png");
}

.smallButton {
  padding: 10px 14px;
  font-size: 14px;
  box-shadow: 0 4px 0 #120d09;
}


.buttonRow {
  margin-top: 18px;
}

.menuHint {
  margin-top: 18px;
  color: #cfc1a2;
  font-size: 13px;
}

.statsBox {
  margin: 18px auto 8px;
  padding: 16px;
  width: min(380px, 100%);
  background: #17120e;
  border: 3px solid #6b4b29;
  color: #f4e7c5;
  text-align: left;
  line-height: 1.8;
}

.statLine {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px dashed rgba(244, 210, 122, 0.25);
}

.statLine:last-child {
  border-bottom: none;
}

.editorPanel {
  display: none;
  width: 100%;
  max-width: 1728px;
  margin: 16px auto 0;
  padding: 16px;
  background:
    linear-gradient(rgba(33, 25, 18, 0.95), rgba(24, 18, 13, 0.95)),
    url("assets/ui/panel_tile.png");
  background-size: 48px 48px;
  border: 4px solid #6b4b29;
  box-shadow:
    0 0 0 4px #120d09,
    0 8px 0 #120d09;
  text-align: left;
}

.editorPanel.visible {
  display: block;
}

.editorHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.editorHeader h3 {
  margin: 0;
  font-size: 24px;
  color: #f4d27a;
  letter-spacing: 2px;
}

.editorHeader p {
  margin: 5px 0 0;
  color: #cfc1a2;
}


.mapSizeControls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 12px;
  padding: 10px;
  background: rgba(18, 13, 9, 0.55);
  border: 2px solid #6b4b29;
}

.mapSizeLabel {
  color: #f4d27a;
  font-weight: bold;
  margin-right: 4px;
}

.mapSizeButton {
  padding: 9px 12px;
  color: #f4e7c5;
  background: #3b3124;
  border: 2px solid #120d09;
  box-shadow: 0 3px 0 #120d09;
}

.mapSizeButton.active {
  background: #f4b042;
  color: #1d1208;
  outline: 3px solid #f6d65c;
}

.toolGrid {
  display: grid;
  grid-template-columns: repeat(8, minmax(90px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.toolButton {
  padding: 10px 8px;
  background:
    linear-gradient(rgba(68, 57, 41, 0.96), rgba(48, 40, 29, 0.96)),
    url("assets/ui/panel_tile.png");
  background-size: 48px 48px;
  color: #f4e7c5;
  border: 2px solid #120d09;
  box-shadow: 0 4px 0 #120d09;
}

.toolButton.active {
  background: #f4b042;
  color: #1d1208;
  outline: 3px solid #f6d65c;
}

.dangerTool {
  background: #7b2f24;
}

.editorActions {
  justify-content: flex-start;
  margin-bottom: 12px;
}

#levelDataOutput {
  display: block;
  width: 100%;
  min-height: 125px;
  resize: vertical;
  padding: 12px;
  background: #120d09;
  color: #f4e7c5;
  border: 3px solid #6b4b29;
  font-family: monospace;
  font-size: 13px;
  line-height: 1.45;
}

.editorStatus {
  margin-top: 10px;
  color: #f6d65c;
  font-size: 14px;
}


@media (max-width: 850px) {
  
.mapSizeControls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 12px;
  padding: 10px;
  background: rgba(18, 13, 9, 0.55);
  border: 2px solid #6b4b29;
}

.mapSizeLabel {
  color: #f4d27a;
  font-weight: bold;
  margin-right: 4px;
}

.mapSizeButton {
  padding: 9px 12px;
  color: #f4e7c5;
  background: #3b3124;
  border: 2px solid #120d09;
  box-shadow: 0 3px 0 #120d09;
}

.mapSizeButton.active {
  background: #f4b042;
  color: #1d1208;
  outline: 3px solid #f6d65c;
}

.toolGrid {
    grid-template-columns: repeat(4, minmax(90px, 1fr));
  }
}

@media (max-width: 700px) {
  #topBar h1 {
    font-size: 32px;
  }

  .menuCard h2 {
    font-size: 34px;
  }

  .menuCard {
    padding: 22px;
  }

  .primaryButton,
  .secondaryButton {
    font-size: 15px;
    padding: 12px 14px;
  }

  .smallButton {
    font-size: 13px;
    padding: 9px 10px;
  }

  
.mapSizeControls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 12px;
  padding: 10px;
  background: rgba(18, 13, 9, 0.55);
  border: 2px solid #6b4b29;
}

.mapSizeLabel {
  color: #f4d27a;
  font-weight: bold;
  margin-right: 4px;
}

.mapSizeButton {
  padding: 9px 12px;
  color: #f4e7c5;
  background: #3b3124;
  border: 2px solid #120d09;
  box-shadow: 0 3px 0 #120d09;
}

.mapSizeButton.active {
  background: #f4b042;
  color: #1d1208;
  outline: 3px solid #f6d65c;
}

.toolGrid {
    grid-template-columns: repeat(2, minmax(90px, 1fr));
  }
}


.gameOverCard {
  border-color: #d66547;
}

.gameOverCard h2 {
  color: #ff8a6a;
  text-shadow:
    3px 3px 0 #6b2218,
    5px 5px 0 #000;
}

.levelSelectCard {
  max-width: 760px;
}

.levelList {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 20px 0 8px;
}

.levelButton {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
  text-align: left;
  padding: 14px;
  min-height: 108px;
  color: #f4e7c5;
  border: 3px solid #120d09;
  box-shadow: 0 5px 0 #120d09;
  background:
    linear-gradient(135deg, rgba(76, 57, 35, 0.95), rgba(37, 28, 20, 0.95)),
    url("assets/ui/panel_tile.png");
  background-size: 48px 48px;
}

.levelButton:hover {
  outline: 3px solid #f6d65c;
}

.levelNumber {
  color: #f6d65c;
  font-size: 13px;
  letter-spacing: 2px;
}

.levelName {
  color: #f4d27a;
  font-size: 20px;
  text-shadow: 2px 2px 0 #000;
}

.levelMeta {
  color: #cfc1a2;
  font-size: 12px;
  line-height: 1.35;
}

/* Step 13: Upgrade Shop */
.shopCard {
  max-width: 760px;
}

.coinBalance {
  display: inline-block;
  margin: 4px auto 14px;
  padding: 8px 14px;
  color: #f6d65c;
  background: #17120e;
  border: 3px solid #6b4b29;
  box-shadow: 0 4px 0 #120d09;
  font-weight: bold;
  font-size: 18px;
}

.shopGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
  margin: 14px 0 8px;
}

.shopItem {
  padding: 14px;
  text-align: left;
  color: #f4e7c5;
  border: 3px solid #120d09;
  box-shadow: 0 5px 0 #120d09;
  background:
    linear-gradient(135deg, rgba(76, 57, 35, 0.95), rgba(37, 28, 20, 0.95)),
    url("assets/ui/panel_tile.png");
  background-size: 48px 48px;
}

.shopItem.maxed {
  border-color: #6b4b29;
  filter: saturate(0.9);
}

.shopItemTop {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.shopIconSlot {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  image-rendering: pixelated;
}

.shopItemName {
  color: #f4d27a;
  font-size: 18px;
  font-weight: bold;
  text-shadow: 2px 2px 0 #000;
}

.shopItemLevel {
  color: #cfc1a2;
  font-size: 12px;
}

.shopItem p {
  margin: 8px 0 12px;
  color: #d8c7a5;
  font-size: 13px;
  line-height: 1.35;
}

.upgradePips {
  display: flex;
  gap: 5px;
  margin-bottom: 12px;
}

.upgradePip {
  width: 22px;
  height: 10px;
  background: #17120e;
  border: 2px solid #6b4b29;
}

.upgradePip.filled {
  background: #f4b042;
  border-color: #f6d65c;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

button:disabled:active {
  transform: none;
}

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

.shopCard {
  max-height: calc(100vh - 70px);
  overflow-y: auto;
}

/* Step 16A: Campaign Level Unlocks */
.levelButton.locked {
  opacity: 0.58;
  filter: grayscale(0.75);
  cursor: not-allowed;
}

.levelButton.locked:hover {
  outline: none;
}

.levelButton.completed {
  border-color: #7bbf3a;
}

.levelStatus {
  display: inline-block;
  margin-top: auto;
  padding: 4px 8px;
  color: #1d1208;
  background: #f4b042;
  border: 2px solid #120d09;
  box-shadow: 0 3px 0 #120d09;
  font-size: 12px;
  font-weight: bold;
}

.levelButton.locked .levelStatus {
  background: #8a8171;
  color: #211912;
}

.levelButton.completed .levelStatus {
  background: #7bbf3a;
}

.levelBest {
  color: #cfc1a2;
  font-size: 12px;
}

.unlockNotice strong {
  color: #7bbf3a;
}

/* Step 17A: 60-Level Campaign Framework */
.levelSelectCard {
  max-width: min(1080px, 94vw);
  max-height: calc(100vh - 70px);
  overflow-y: auto;
}

.levelList {
  display: block;
  margin: 18px 0 8px;
}

.campaignZoneSection {
  margin: 0 0 20px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(40, 30, 22, 0.86), rgba(23, 18, 14, 0.92)),
    url("assets/ui/panel_tile.png");
  background-size: 48px 48px;
  border: 3px solid #6b4b29;
  box-shadow: 0 5px 0 #120d09;
}

.campaignZoneHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px dashed rgba(244, 210, 122, 0.28);
  text-align: left;
}

.campaignZoneTitle {
  display: block;
  color: #f4d27a;
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 #000;
}

.campaignZoneSubtitle {
  display: block;
  margin-top: 4px;
  color: #cfc1a2;
  font-size: 12px;
}

.campaignLevelGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 10px;
}

.compactLevelButton {
  min-height: 128px;
  padding: 11px;
}

.compactLevelButton .levelName {
  font-size: 15px;
  line-height: 1.15;
}

.compactLevelButton .levelMeta,
.compactLevelButton .levelBest {
  font-size: 11px;
}

.compactLevelButton .levelStatus {
  font-size: 11px;
  padding: 3px 6px;
}

@media (max-width: 700px) {
  .campaignLevelGrid {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  }

  .campaignZoneTitle {
    font-size: 15px;
  }
}

/* Step 21A: Shop tabs + weapons */
.shopTabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 12px;
  flex-wrap: wrap;
}

.shopTabButton {
  padding: 10px 18px;
  color: #f4e7c5;
  background: #3b3124;
  border: 3px solid #120d09;
  box-shadow: 0 4px 0 #120d09;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
}

.shopTabButton.active {
  background: #f4b042;
  color: #1d1208;
  border-color: #f6d65c;
}

.shopItem.equipped {
  border-color: #54a8f5;
  box-shadow: 0 5px 0 #0b2440;
}

.shopItem.lockedWeapon {
  filter: saturate(0.75) brightness(0.9);
}

.weaponStatLine {
  color: #cfc1a2;
  font-size: 12px;
  margin: 3px 0;
}

/* Step 22: weapon shop previews */
.weaponShopHeader {
  grid-column: 1 / -1;
  padding: 12px 14px;
  text-align: left;
  color: #f4e7c5;
  border: 3px solid #120d09;
  background: rgba(23, 18, 14, 0.88);
  box-shadow: 0 4px 0 #120d09;
}

.weaponShopHeader strong {
  display: block;
  color: #f4d27a;
  font-size: 18px;
  margin-bottom: 4px;
}

.weaponShopHeader span {
  color: #cfc1a2;
  font-size: 13px;
}

.weaponShopItem {
  position: relative;
  overflow: hidden;
}

.weaponShopItem.equipped::after {
  content: "ACTIVE";
  position: absolute;
  top: 8px;
  right: -28px;
  transform: rotate(35deg);
  width: 105px;
  padding: 4px 0;
  text-align: center;
  color: #0b2440;
  background: #54a8f5;
  border: 2px solid #f4e7c5;
  font-size: 10px;
  font-weight: bold;
}

.weaponPreviewBox {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
  padding: 10px;
  background: rgba(13, 10, 8, 0.5);
  border: 2px solid #6b4b29;
}

.weaponPreviewArt {
  position: relative;
  height: 76px;
  background: repeating-linear-gradient(45deg, rgba(246,214,92,0.08) 0 6px, rgba(0,0,0,0.08) 6px 12px), #17120e;
  border: 2px solid #120d09;
  overflow: hidden;
}

.weaponPreviewTurret,
.weaponPreviewProjectile {
  position: absolute;
  display: block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  image-rendering: pixelated;
}

.weaponPreviewTurret {
  width: 50px;
  height: 50px;
  left: 8px;
  top: 13px;
}

.weaponPreviewProjectile {
  width: 34px;
  height: 42px;
  right: 4px;
  top: 17px;
  transform: rotate(90deg);
  filter: drop-shadow(0 0 4px rgba(246, 214, 92, 0.45));
}

.weaponPreviewBeam {
  position: absolute;
  left: 50px;
  top: 35px;
  width: 42px;
  height: 6px;
  background: linear-gradient(90deg, rgba(125,242,255,0.95), rgba(255,255,255,0.85), rgba(125,242,255,0));
  box-shadow: 0 0 10px rgba(125, 242, 255, 0.7);
}

.weaponPreviewInfo {
  min-width: 0;
}

.weaponRoleTag,
.weaponSpecialTag {
  display: inline-block;
  margin: 0 4px 6px 0;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: bold;
  border: 2px solid #120d09;
  box-shadow: 0 2px 0 #120d09;
}

.weaponRoleTag {
  color: #1d1208;
  background: #f4b042;
}

.weaponSpecialTag {
  color: #f4e7c5;
  background: #3b3124;
}

.weaponPreviewStat {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 7px;
  align-items: center;
  margin: 4px 0;
  color: #cfc1a2;
  font-size: 11px;
}

.weaponPreviewBar {
  height: 8px;
  background: #17120e;
  border: 1px solid #6b4b29;
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.6);
}

.weaponPreviewBar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #54a8f5, #f6d65c);
}

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

  .weaponPreviewArt {
    height: 68px;
  }
}


/* Step 22B: shop testing polish */
.weaponShopHeaderPolished {
  display: grid;
  gap: 4px;
}

.polishedWeaponCard {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.weaponCardHeader {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
}

.weaponStateBadge {
  align-self: start;
  min-width: 76px;
  padding: 4px 6px;
  text-align: center;
  font-size: 9px;
  line-height: 1.15;
  font-weight: bold;
  border: 2px solid #120d09;
  box-shadow: 0 2px 0 #120d09;
}

.weaponStateBadge.stateActive {
  color: #0b2440;
  background: #54a8f5;
  border-color: #f4e7c5;
}

.weaponStateBadge.stateOwned {
  color: #102815;
  background: #90e66f;
}

.weaponStateBadge.stateReady {
  color: #1d1208;
  background: #f4b042;
}

.weaponStateBadge.statePoor {
  color: #f4e7c5;
  background: #8a4a28;
}

.weaponStateBadge.stateLocked {
  color: #cfc1a2;
  background: #2a2118;
}

.polishedWeaponCard .shopItemTop {
  margin-bottom: 0;
}

.polishedWeaponCard .shopItemName {
  font-size: 17px;
}

.polishedWeaponCard .shopItemLevel {
  max-width: 250px;
}

.polishedWeaponCard .weaponPreviewBox {
  grid-template-columns: 84px 1fr;
  gap: 9px;
  margin: 4px 0;
  padding: 8px;
}

.polishedWeaponCard .weaponPreviewArt {
  height: 64px;
}

.polishedWeaponCard .weaponPreviewTurret {
  width: 44px;
  height: 44px;
  left: 8px;
  top: 10px;
}

.polishedWeaponCard .weaponPreviewProjectile {
  width: 28px;
  height: 36px;
  right: 5px;
  top: 14px;
}

.polishedWeaponCard .weaponPreviewBeam {
  left: 46px;
  top: 30px;
  width: 36px;
  height: 5px;
}

.polishedWeaponCard .weaponRoleTag,
.polishedWeaponCard .weaponSpecialTag {
  margin-bottom: 5px;
  padding: 2px 6px;
}

.polishedWeaponCard .weaponPreviewStat {
  grid-template-columns: 48px 1fr;
  margin: 3px 0;
}

.weaponDescription {
  min-height: 36px;
  margin: 0;
}

.weaponQuickStats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.weaponQuickStats span {
  padding: 4px 6px;
  color: #d8c7a5;
  background: rgba(13, 10, 8, 0.48);
  border: 1px solid #6b4b29;
  font-size: 11px;
}

.weaponQuickStats strong {
  color: #f6d65c;
}

.weaponCostHint {
  color: #f4b042;
  font-size: 12px;
  font-weight: bold;
}

.weaponActionButton {
  width: 100%;
}

.weaponShopItem.equipped::after {
  display: none;
}

@media (min-width: 1000px) {
  .shopCard {
    max-width: 980px;
  }

  .shopGrid {
    grid-template-columns: repeat(2, minmax(320px, 1fr));
  }
}

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

  .weaponStateBadge {
    justify-self: start;
  }

  .polishedWeaponCard .weaponPreviewBox {
    grid-template-columns: 1fr;
  }
}


/* Step 23 audio settings */
.audioCard {
  max-width: 620px;
}

.audioSettingsGrid {
  display: grid;
  gap: 14px;
  margin: 18px 0;
  text-align: left;
}

.audioControl {
  display: grid;
  grid-template-columns: 130px 1fr 54px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.26);
  border: 2px solid rgba(215, 154, 56, 0.35);
}

.audioControl input[type="range"] {
  width: 100%;
  accent-color: #d79a38;
}

.audioToggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 2px solid rgba(207, 193, 162, 0.22);
}

.audioToggle input {
  transform: scale(1.2);
}


/* Step 25 runtime error overlay */
#runtimeErrorOverlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.72);
  padding: 20px;
}

#runtimeErrorOverlay.visible {
  display: flex;
}

.runtimeErrorCard {
  width: min(720px, 92vw);
  max-height: 80vh;
  overflow: auto;
  padding: 22px;
  border: 3px solid #f4b042;
  background: #241b14;
  box-shadow: 0 18px 45px rgba(0,0,0,0.5);
  color: #f4e7c5;
}

.runtimeErrorCard pre {
  white-space: pre-wrap;
  word-break: break-word;
  padding: 12px;
  background: #100c08;
  border: 1px solid #5c4330;
  color: #ffb09a;
  font-size: 12px;
  line-height: 1.35;
}

/* Step 26: Title screen / presentation polish */
.crtScanlines {
  position: absolute;
  inset: 5px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.15;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 230, 160, 0.08) 0,
    rgba(255, 230, 160, 0.08) 1px,
    rgba(0, 0, 0, 0.05) 1px,
    rgba(0, 0, 0, 0.05) 4px
  );
  mix-blend-mode: overlay;
}

.menuOverlay {
  z-index: 2;
}

.presentationTitleCard {
  width: min(850px, 94%);
  max-height: calc(100% - 16px);
  overflow-y: auto;
  padding: 24px 30px 22px;
  position: relative;
  background:
    radial-gradient(circle at 50% 16%, rgba(215, 154, 56, 0.2), transparent 40%),
    linear-gradient(135deg, rgba(60, 44, 26, 0.98), rgba(27, 21, 16, 0.99)),
    url("assets/ui/panel_tile.png");
  background-size: auto, auto, 48px 48px;
}

.presentationTitleCard::before,
.presentationTitleCard::after {
  content: "";
  position: absolute;
  top: 20px;
  height: 4px;
  width: 72px;
  background: #d79a38;
  box-shadow: 0 6px 0 #6b4b29;
}

.presentationTitleCard::before { left: 24px; }
.presentationTitleCard::after { right: 24px; }

.titleBadgeRow {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.campaignBadge {
  padding: 5px 10px;
  border: 2px solid #6b4b29;
  background: rgba(16, 12, 8, 0.5);
  color: #cfc1a2;
  letter-spacing: 2px;
  font-size: 11px;
  font-weight: bold;
}

.campaignBadge.accent {
  color: #f6d65c;
  border-color: #d79a38;
}

.titleLogo {
  font-size: clamp(44px, 7vw, 66px) !important;
  letter-spacing: 7px;
  margin-top: 2px !important;
}

.titleSubhead {
  margin: 7px 0 2px;
  color: #f6d65c;
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 3px;
}

.titleDescription {
  margin: 10px auto 16px !important;
  max-width: 640px !important;
  font-size: 13px;
}

.campaignDashboard {
  display: grid;
  grid-template-columns: minmax(250px, 1.35fr) minmax(190px, 0.9fr);
  gap: 12px;
  margin: 10px auto 18px;
  max-width: 690px;
  text-align: left;
}

.campaignProgressPanel,
.loadoutPanel {
  padding: 11px 13px;
  border: 2px solid #6b4b29;
  background: rgba(13, 10, 8, 0.5);
  box-shadow: inset 0 0 0 1px rgba(244, 176, 66, 0.08);
}

.dashboardLabel,
.loadoutStat span {
  display: block;
  color: #cfc1a2;
  font-size: 10px;
  letter-spacing: 2px;
  margin-bottom: 5px;
}

.dashboardValue {
  color: #f4d27a;
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 7px;
}

.dashboardNote {
  color: #f6d65c;
  font-size: 11px;
  letter-spacing: 1px;
  margin-top: 7px;
}

.progressTrack {
  height: 12px;
  padding: 2px;
  background: #120d09;
  border: 2px solid #6b4b29;
}

.progressTrack span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d66547, #f4b042, #f6d65c);
  transition: width 0.25s ease;
}

.loadoutPanel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.loadoutStat + .loadoutStat {
  border-top: 1px dashed rgba(244, 210, 122, 0.22);
  padding-top: 9px;
}

.loadoutStat strong {
  display: block;
  color: #f4d27a;
  font-size: 16px;
  line-height: 1.2;
}

.mainMenuActions {
  display: grid;
  grid-template-columns: repeat(3, minmax(148px, 1fr));
  max-width: 690px;
  margin: 0 auto;
  gap: 10px;
}

.mainMenuActions .heroButton {
  grid-column: span 3;
  font-size: 20px;
  letter-spacing: 1px;
}

.presentationHint {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed rgba(244, 210, 122, 0.25);
}

.helpCard {
  width: min(670px, 94%);
  max-height: calc(100% - 16px);
  overflow-y: auto;
}

.helpGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.helpTile {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px;
  text-align: left;
  border: 2px solid #6b4b29;
  background: rgba(16, 12, 8, 0.5);
}

.helpTile strong {
  color: #f6d65c;
  font-size: 13px;
  letter-spacing: 2px;
}

.helpTile span {
  color: #f4e7c5;
  font-size: 15px;
}

.fieldManualTips {
  display: grid;
  gap: 8px;
  padding: 14px;
  text-align: left;
  border: 2px solid rgba(215, 154, 56, 0.55);
  background: rgba(18, 13, 9, 0.58);
  color: #d8c7a5;
  font-size: 13px;
  line-height: 1.45;
}

.fieldManualTips b {
  color: #f4d27a;
  margin-right: 7px;
}

@media (max-width: 760px) {
  .presentationTitleCard {
    padding: 20px 16px 18px;
  }

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

  .mainMenuActions {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .mainMenuActions .heroButton {
    grid-column: span 2;
  }

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


/* Step 26B: Start-of-level mission and boss introduction banners */
.missionIntroOverlay {
  position: absolute;
  inset: 5px;
  z-index: 4;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(21, 16, 11, 0.52), rgba(10, 8, 6, 0.88));
}

.missionIntroOverlay.visible {
  display: flex;
  pointer-events: auto;
}

.missionIntroCard {
  width: min(660px, 94%);
  padding: 22px 28px 20px;
  text-align: center;
  border: 3px solid #d79a38;
  box-shadow: 0 0 0 5px #17110c, 0 12px 0 #100c08, 0 22px 46px rgba(0, 0, 0, 0.7);
  background:
    radial-gradient(circle at 50% 0, rgba(246, 214, 92, 0.11), transparent 42%),
    linear-gradient(135deg, rgba(54, 39, 24, 0.98), rgba(24, 18, 13, 0.99)),
    url("assets/ui/panel_tile.png");
  background-size: auto, auto, 48px 48px;
  animation: missionCardDrop 0.24s steps(4, end) both;
}

.missionIntroCard.bossIntro {
  border-color: #d66547;
  box-shadow: 0 0 0 5px #1b100d, 0 12px 0 #100907, 0 0 38px rgba(214, 101, 71, 0.27);
  background:
    radial-gradient(circle at 50% 0, rgba(214, 101, 71, 0.18), transparent 48%),
    linear-gradient(135deg, rgba(62, 30, 22, 0.99), rgba(23, 14, 12, 0.99)),
    url("assets/ui/panel_tile.png");
}

.missionIntroAlert {
  display: inline-block;
  padding: 5px 14px;
  margin-bottom: 12px;
  border: 2px solid #6b4b29;
  color: #f6d65c;
  background: rgba(16, 12, 8, 0.68);
  letter-spacing: 3px;
  font-size: 12px;
  font-weight: bold;
}

.bossIntro .missionIntroAlert {
  color: #ffb09a;
  border-color: #d66547;
  animation: bossAlertPulse 0.7s steps(2, end) infinite;
}

.missionIntroZone {
  color: #cfc1a2;
  letter-spacing: 3px;
  font-size: 12px;
  margin: 2px 0 10px;
}

.missionIntroTitle {
  margin: 0 0 9px;
  color: #f4d27a;
  font-size: clamp(27px, 4vw, 40px);
  letter-spacing: 3px;
  line-height: 1.15;
  text-shadow: 3px 3px 0 #4d2e19, 5px 5px 0 #0e0b08;
}

.bossIntro .missionIntroTitle {
  color: #ffb09a;
  text-shadow: 3px 3px 0 #5a241d, 5px 5px 0 #0e0908;
}

.missionIntroIntel {
  color: #f6d65c;
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 2px;
  margin-bottom: 13px;
}

.missionIntroThreats {
  min-height: 24px;
  margin: 0 auto 14px;
  color: #d8c7a5;
  font-size: 13px;
  line-height: 1.45;
  max-width: 560px;
}

.missionIntroThreats strong {
  color: #f4d27a;
}

.missionIntroProgress {
  width: min(390px, 84%);
  height: 8px;
  margin: 0 auto 17px;
  border: 2px solid #6b4b29;
  padding: 1px;
  background: #120d09;
}

.missionIntroProgress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #d66547, #f4b042, #f6d65c);
  transform-origin: left center;
  animation: deploymentTimer var(--mission-intro-duration, 2300ms) linear forwards;
}

.bossIntro .missionIntroProgress span {
  background: linear-gradient(90deg, #d66547, #ffb09a, #f6d65c);
}

.missionIntroButton {
  min-width: 180px;
  margin: 0 auto 10px;
}

.missionIntroHint {
  color: #9f9278;
  font-size: 11px;
  letter-spacing: 1px;
}

@keyframes missionCardDrop {
  from { opacity: 0; transform: translateY(-18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes deploymentTimer {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes bossAlertPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.62; }
}

@media (max-width: 680px) {
  .missionIntroCard { padding: 18px 15px 16px; }
  .missionIntroZone { letter-spacing: 2px; }
}

/* Step 28: Settings + save-management polish */
.settingsCard {
  width: min(1080px, 96%);
  max-height: min(92vh, 900px);
  overflow-y: auto;
  text-align: center;
}

.settingsColumns {
  display: grid;
  grid-template-columns: minmax(290px, 0.9fr) minmax(330px, 1.1fr);
  gap: 16px;
  margin: 18px 0;
  text-align: left;
}

.settingsPanel {
  padding: 14px;
  border: 2px solid rgba(215, 154, 56, 0.34);
  background: rgba(0, 0, 0, 0.22);
}

.settingsPanel h3 {
  margin: 0 0 12px;
  color: #f4d27a;
  font-size: 17px;
  letter-spacing: 1px;
}

.settingsPanel .audioSettingsGrid {
  margin: 0 0 12px;
  gap: 9px;
}

.settingsPanel .audioControl {
  grid-template-columns: 96px 1fr 46px;
  gap: 8px;
  padding: 9px;
  font-size: 13px;
}

.settingsPanel .audioToggle {
  padding: 10px;
  font-size: 13px;
}

.settingsButtonStack {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.settingsButtonStack button {
  flex: 1 1 126px;
  min-width: 0;
  font-size: 12px;
}

.gameplayToggle {
  margin-bottom: 9px;
}

.settingsNote {
  margin: 11px 0 16px;
  padding: 9px;
  color: #cfbf9e;
  font-size: 12px;
  border-left: 3px solid #d79a38;
  background: rgba(0, 0, 0, 0.19);
}

.settingsNote strong {
  color: #f6d65c;
}

.saveHeading {
  margin-top: 15px !important;
}

.saveSummary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}

.saveStat {
  padding: 7px;
  background: rgba(16, 12, 8, 0.48);
  border: 1px solid rgba(215, 154, 56, 0.32);
}

.saveStat span {
  display: block;
  color: #bcae8d;
  font-size: 10px;
  margin-bottom: 3px;
}

.saveStat strong {
  color: #f6d65c;
  font-size: 13px;
}

.saveCodeInput {
  box-sizing: border-box;
  width: 100%;
  height: 72px;
  resize: vertical;
  margin: 4px 0 10px;
  padding: 8px;
  color: #f4e7c5;
  background: #15100c;
  border: 2px solid rgba(215, 154, 56, 0.44);
  font: 11px/1.35 monospace;
}

.saveCodeInput:focus {
  outline: 2px solid #f4b042;
}

.saveButtons .dangerButton {
  color: #24130c;
}

.compactHint {
  min-height: 17px;
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.4;
}

.settingsBackRow {
  justify-content: center;
}

.settingsBackRow button {
  min-width: 210px;
}

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

.saveStatusError {
  color: #ffae96 !important;
}

/* Step 30: Single weapon carousel shop UI */
.shopGrid.weaponCarouselGrid {
  display: block;
  margin: 14px 0 8px;
}

.weaponCarouselHeader {
  margin-bottom: 14px;
}

.weaponCarousel {
  display: grid;
  grid-template-columns: 62px minmax(280px, 1fr) 62px;
  gap: 14px;
  align-items: center;
  max-width: 720px;
  margin: 0 auto;
}

.weaponCarouselCenter {
  min-width: 0;
}

.weaponCarouselCount {
  margin: 0 0 8px;
  color: #f6d65c;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.12em;
}

.weaponCarouselDots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.weaponCarouselDot {
  width: 13px;
  height: 13px;
  padding: 0;
  border: 2px solid #6b4b29;
  background: #17120e;
  box-shadow: 0 2px 0 #120d09;
  cursor: pointer;
}

.weaponCarouselDot.owned {
  border-color: #54a8f5;
}

.weaponCarouselDot.active {
  background: #f4b042;
  border-color: #f6d65c;
  transform: translateY(-1px);
}

.weaponCarouselArrow {
  width: 58px;
  height: 88px;
  padding: 0;
  color: #f6d65c;
  font-size: 50px;
  line-height: 1;
  font-family: inherit;
  background:
    linear-gradient(rgba(55, 44, 30, 0.96), rgba(27, 21, 15, 0.96)),
    url("assets/ui/panel_tile.png");
  background-size: 48px 48px;
  border: 3px solid #6b4b29;
  box-shadow: 0 5px 0 #120d09;
  cursor: pointer;
}

.weaponCarouselArrow:hover {
  border-color: #f4b042;
  color: #fff0a8;
}

.weaponCarouselArrow:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #120d09;
}

.weaponCarouselSlot .carouselWeaponCard {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px;
}

.carouselWeaponCard .weaponPreviewBox {
  grid-template-columns: 120px 1fr;
  gap: 14px;
  padding: 12px;
  margin: 10px 0;
}

.carouselWeaponCard .weaponPreviewArt {
  height: 96px;
}

.carouselWeaponCard .weaponPreviewTurret {
  width: 66px;
  height: 66px;
  left: 10px;
  top: 15px;
}

.carouselWeaponCard .weaponPreviewProjectile {
  width: 38px;
  height: 50px;
  right: 7px;
  top: 22px;
}

.carouselWeaponCard .weaponPreviewBeam {
  left: 62px;
  top: 45px;
  width: 56px;
  height: 6px;
}

.carouselWeaponCard .weaponDescription {
  min-height: unset;
  margin: 2px 0 8px;
}

.carouselWeaponCard .weaponActionButton {
  margin-top: 5px;
}

@media (max-width: 720px) {
  .weaponCarousel {
    grid-template-columns: 46px minmax(210px, 1fr) 46px;
    gap: 7px;
  }

  .weaponCarouselArrow {
    width: 44px;
    height: 70px;
    font-size: 38px;
  }

  .weaponCarouselSlot .carouselWeaponCard {
    padding: 12px;
  }

  .carouselWeaponCard .weaponPreviewBox {
    grid-template-columns: 1fr;
  }
}


/* Step 31: current in-game music track credit */
.musicTrackCard {
  margin: 12px 0 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid rgba(244, 176, 66, 0.45);
  background: rgba(20, 15, 11, 0.44);
  color: #e7d6af;
}

.musicTrackLabel {
  color: #f4b042;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
}

.musicTrackCard strong {
  color: #f4d082;
  font-size: 0.92rem;
}

.musicTrackCard small {
  color: #c6b48c;
  font-size: 0.72rem;
}

/* Step 31E: simplified settings + music credits */
.singleSettingsPanel {
  max-width: 680px;
  margin: 18px auto;
  text-align: left;
}

.compactSettingsActions {
  justify-content: center;
  margin-top: 14px;
}

.compactSettingsActions button {
  flex: 0 1 240px;
}

.musicCreditsCard {
  width: min(620px, 94%);
  text-align: center;
}

.musicCreditList {
  display: grid;
  gap: 12px;
  margin: 18px 0;
  text-align: left;
}

.musicCreditItem {
  padding: 14px;
  border: 2px solid rgba(215, 154, 56, 0.42);
  background: rgba(0, 0, 0, 0.25);
}

.musicCreditItem span {
  display: block;
  color: #f6d65c;
  font-size: 11px;
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.musicCreditItem strong {
  display: block;
  color: #f4e7c5;
  font-size: 18px;
  margin-bottom: 4px;
}

.musicCreditItem small {
  display: block;
  color: #cfc1a2;
  font-size: 12px;
}


/* Step 32: Level Creator unlocks after completing the final campaign mission. */
.creatorLockedButton {
  font-size: 13px;
  letter-spacing: 0.3px;
  opacity: 0.68;
  filter: grayscale(0.6);
}

.creatorUnlockedNotice strong {
  color: #7bbf3a;
  text-shadow: 0 0 8px rgba(123, 191, 58, 0.35);
}


/* Step 34: compact centered stat upgrade UI */
#upgradeShopMenu {
  padding: clamp(8px, 1.5vw, 18px);
}

#upgradeShopMenu .shopCard {
  width: min(850px, calc(100% - 20px));
  max-width: 850px;
  max-height: min(calc(100vh - 46px), calc(100% - 20px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 18px 22px 16px;
}

#upgradeShopMenu .shopCard h2 {
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1;
}

#upgradeShopMenu .shopCard > p {
  margin: 8px auto 10px;
  font-size: 12px;
  line-height: 1.35;
}

#upgradeShopMenu .smallLabel {
  margin-bottom: 4px;
}

#upgradeShopMenu .coinBalance {
  margin: 2px auto 8px;
  padding: 6px 12px;
  font-size: 16px;
}

#upgradeShopMenu .shopTabs {
  margin: 2px 0 8px;
}

#upgradeShopMenu .shopTabButton {
  padding: 8px 18px;
}

#upgradeShopMenu .buttonRow {
  flex: 0 0 auto;
  margin-top: 10px;
}

#upgradeShopMenu .menuHint {
  flex: 0 0 auto;
  margin-top: 9px;
  font-size: 12px;
  min-height: 15px;
}

.shopGrid.upgradeCompactGrid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(270px, 1fr));
  align-content: start;
  gap: 10px;
  margin: 4px 0 2px;
  padding: 3px 4px 7px;
  scrollbar-width: thin;
  scrollbar-color: #d79a38 #17120e;
}

.upgradeShopSummary {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
  color: #cfc1a2;
  background: rgba(23, 18, 14, 0.8);
  border: 2px solid #6b4b29;
  font-size: 11px;
}

.upgradeShopSummary strong {
  color: #f4d27a;
  font-size: 13px;
  letter-spacing: 1px;
}

.compactUpgradeCard {
  padding: 10px 11px;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.compactUpgradeHeader {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}

.compactUpgradeCard .shopItemTop {
  margin-bottom: 0;
  gap: 8px;
}

.compactUpgradeCard .shopIconSlot {
  width: 29px;
  height: 29px;
  flex-basis: 29px;
}

.compactUpgradeCard .shopItemName {
  font-size: 16px;
}

.compactUpgradeCard .shopItemLevel {
  font-size: 11px;
}

.upgradeState {
  padding: 3px 6px;
  border: 2px solid #120d09;
  font-size: 9px;
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
}

.upgradeState.ready {
  color: #1d1208;
  background: #f4b042;
}

.upgradeState.poor {
  color: #f4e7c5;
  background: #7b4130;
}

.upgradeState.maxed {
  color: #102815;
  background: #90e66f;
}

.compactUpgradeDescription {
  flex: 1 1 auto;
  margin: 1px 0 4px !important;
  min-height: 29px;
  font-size: 11px !important;
  line-height: 1.25 !important;
}

.compactUpgradeFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.compactUpgradeFooter .upgradePips {
  margin: 0;
  gap: 4px;
}

.compactUpgradeFooter .upgradePip {
  width: 16px;
  height: 8px;
}

.compactUpgradeFooter .smallButton {
  padding: 7px 10px;
  font-size: 12px;
}

#upgradeShopMenu .weaponsView #shopItems {
  overflow-y: auto;
  min-height: 0;
}

@media (max-width: 680px), (max-height: 650px) {
  #upgradeShopMenu .shopCard {
    padding: 12px 12px 10px;
  }

  #upgradeShopMenu .shopCard > p {
    display: none;
  }

  .shopGrid.upgradeCompactGrid {
    grid-template-columns: 1fr;
  }

  .upgradeShopSummary span {
    display: none;
  }
}


/* Step 34B: live tank preview in the shop */
.shopTankPreview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-height: 103px;
  padding: 8px 11px;
  background: linear-gradient(135deg, rgba(18, 14, 10, 0.96), rgba(42, 31, 20, 0.92));
  border: 2px solid #6b4b29;
  box-shadow: inset 0 0 0 1px rgba(244, 176, 66, 0.12);
}

.shopTankPreviewStage {
  position: relative;
  width: 118px;
  height: 86px;
  overflow: hidden;
  background: #17120e;
  border: 2px solid #120d09;
  image-rendering: pixelated;
}

.shopTankGrid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(246, 214, 92, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246, 214, 92, 0.06) 1px, transparent 1px);
  background-size: 18px 18px;
}

.shopTankShadow {
  position: absolute;
  width: 62px;
  height: 14px;
  left: 28px;
  bottom: 11px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.58);
}

.shopTankBody,
.shopTankTurret {
  position: absolute;
  width: 72px;
  height: 72px;
  left: 23px;
  top: 5px;
  display: block;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  image-rendering: pixelated;
}

.shopTankTrackGlow {
  position: absolute;
  z-index: 1;
  width: 7px;
  height: 35px;
  top: 28px;
  opacity: 0.32;
  background: repeating-linear-gradient(to bottom, #f6d65c 0 4px, transparent 4px 9px);
  animation: shopTrackMotion var(--tread-cycle) linear infinite;
}

.shopTankTrackGlow.left { left: 39px; }
.shopTankTrackGlow.right { right: 39px; }

.shopTankBody { z-index: 2; }
.shopTankTurret { z-index: 4; }

.shopArmorPlate {
  display: none;
  position: absolute;
  z-index: 3;
  width: 5px;
  height: 26px;
  top: 30px;
  border: 1px solid #f4d27a;
  background: #8a6841;
}

.shopArmorPlate.left { left: 42px; }
.shopArmorPlate.right { right: 42px; }
.shopTankPreviewStage[class*="armorLevel-"]:not(.armorLevel-0) .shopArmorPlate { display: block; }
.shopTankPreviewStage.armorLevel-3 .shopArmorPlate,
.shopTankPreviewStage.armorLevel-4 .shopArmorPlate,
.shopTankPreviewStage.armorLevel-5 .shopArmorPlate {
  background: #f4b042;
  box-shadow: 0 0 4px rgba(246, 214, 92, 0.36);
}

.shopTankPreviewDetails {
  min-width: 0;
  text-align: left;
}

.shopTankPreviewEyebrow {
  margin-bottom: 3px;
  color: #d79a38;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 0.16em;
}

.shopTankPreviewDetails > strong {
  display: block;
  margin-bottom: 7px;
  color: #f4d27a;
  font-size: 16px;
}

.shopTankStatChips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}

.shopTankStatChips span {
  padding: 3px 6px;
  color: #cfc1a2;
  font-size: 10px;
  border: 1px solid #6b4b29;
  background: rgba(13, 10, 8, 0.58);
}

.shopTankStatChips b {
  color: #f6d65c;
}

.shopTankTierRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #90e66f;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 0.08em;
}

@keyframes shopTrackMotion {
  from { background-position-y: 0; }
  to { background-position-y: 18px; }
}

/* Replace the isolated turret art with a mounted player-tank preview. */
.mountedWeaponPreview .weaponMountShadow {
  position: absolute;
  left: 27px;
  top: 68px;
  width: 64px;
  height: 13px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.52);
}

.mountedWeaponPreview .weaponPreviewBody,
.mountedWeaponPreview .weaponPreviewTurret {
  position: absolute;
  display: block;
  width: 74px;
  height: 74px;
  left: 20px;
  top: 8px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  image-rendering: pixelated;
}

.mountedWeaponPreview .weaponPreviewBody { z-index: 1; }
.mountedWeaponPreview .weaponPreviewTurret { z-index: 3; }

.mountedWeaponPreview .weaponMountPlate {
  display: none;
  position: absolute;
  z-index: 2;
  width: 5px;
  height: 26px;
  top: 32px;
  border: 1px solid #f4d27a;
  background: #8a6841;
}

.mountedWeaponPreview .weaponMountPlate.left { left: 39px; }
.mountedWeaponPreview .weaponMountPlate.right { left: 70px; }
.mountedWeaponPreview:not(.armorLevel-0) .weaponMountPlate { display: block; }

.mountedWeaponPreview .weaponPreviewProjectile {
  right: 5px;
  top: 27px;
}

.mountedWeaponPreview .weaponPreviewBeam {
  left: 68px;
  top: 43px;
  width: 50px;
}

@media (max-width: 680px), (max-height: 650px) {
  .shopTankPreview {
    grid-template-columns: 104px 1fr;
    min-height: 80px;
    padding: 6px 8px;
  }
  .shopTankPreviewStage {
    width: 96px;
    height: 72px;
  }
  .shopTankBody,
  .shopTankTurret {
    width: 60px;
    height: 60px;
    left: 18px;
    top: 4px;
  }
  .shopTankShadow { width: 52px; left: 22px; bottom: 8px; }
  .shopTankTrackGlow.left { left: 30px; }
  .shopTankTrackGlow.right { right: 30px; }
  .shopArmorPlate.left { left: 34px; }
  .shopArmorPlate.right { right: 34px; }
  .shopTankStatChips span { font-size: 9px; }
}

/* Step 40 - Main menu battlefield silhouette backdrop */
.battlefieldMenu {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(10, 7, 5, 0.45) 0%, rgba(17, 12, 8, 0.56) 44%, rgba(10, 7, 5, 0.80) 100%),
    linear-gradient(180deg, rgba(39, 24, 12, 0.72) 0%, rgba(53, 29, 13, 0.46) 45%, rgba(12, 8, 5, 0.88) 100%);
}

.menuSceneBackdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 58%, rgba(231, 135, 34, 0.20), transparent 28%),
    radial-gradient(circle at 50% 72%, rgba(255, 196, 89, 0.11), transparent 36%),
    linear-gradient(180deg, #110b07 0%, #20120b 20%, #3a1d0f 56%, #22140c 72%, #120c08 100%);
}

.menuSceneBackdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.30;
  background:
    repeating-linear-gradient(to right, rgba(245, 182, 90, 0.12) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(to bottom, rgba(245, 182, 90, 0.10) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.18) 0 2px, transparent 2px 6px);
}

.menuSceneBackdrop::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34%;
  background:
    linear-gradient(180deg, rgba(18, 11, 8, 0) 0%, rgba(18, 11, 8, 0.32) 30%, rgba(8, 6, 5, 0.84) 100%);
}

.battlefieldMenu .menuCard {
  position: relative;
  z-index: 2;
}

.menuGridBackdrop,
.menuHorizonGlow,
.menuSmokeColumn,
.menuWatchtower,
.menuRuins,
.menuSceneTank,
.menuForegroundWreck,
.menuHedgehog,
.menuBarrelStack,
.menuGroundDebris {
  position: absolute;
}

.menuHorizonGlow {
  left: 8%;
  right: 8%;
  bottom: 18%;
  height: 28%;
  background:
    radial-gradient(ellipse at center, rgba(253, 169, 63, 0.42) 0%, rgba(228, 118, 22, 0.20) 42%, rgba(0, 0, 0, 0) 70%);
  opacity: 0.95;
}

.menuSmokeColumn {
  bottom: 24%;
  width: 94px;
  height: 47%;
  opacity: 0.44;
  filter: blur(1.5px);
  background:
    radial-gradient(circle at 50% 88%, rgba(20, 14, 10, 0.92) 0 18%, transparent 19%),
    radial-gradient(circle at 56% 72%, rgba(22, 16, 11, 0.85) 0 15%, transparent 16%),
    radial-gradient(circle at 42% 56%, rgba(24, 18, 12, 0.78) 0 13%, transparent 14%),
    radial-gradient(circle at 55% 40%, rgba(24, 18, 12, 0.72) 0 14%, transparent 15%),
    radial-gradient(circle at 44% 24%, rgba(20, 16, 12, 0.66) 0 16%, transparent 17%);
}

.smokeLeft {
  left: 10.5%;
}

.smokeRight {
  right: 10.5%;
}

.menuWatchtower {
  left: 5.2%;
  bottom: 21.5%;
  width: 42px;
  height: 162px;
  opacity: 0.68;
  background:
    linear-gradient(to right, transparent 0 13%, rgba(11, 9, 7, 0.96) 13% 20%, transparent 20% 24%, rgba(11, 9, 7, 0.96) 24% 30%, transparent 30% 70%, rgba(11, 9, 7, 0.96) 70% 76%, transparent 76% 80%, rgba(11, 9, 7, 0.96) 80% 87%, transparent 87%),
    linear-gradient(to bottom, transparent 0 16%, rgba(11, 9, 7, 0.95) 16% 18%, transparent 18% 45%, rgba(11, 9, 7, 0.95) 45% 47%, transparent 47% 72%, rgba(11, 9, 7, 0.95) 72% 74%, transparent 74%),
    linear-gradient(135deg, transparent 0 46%, rgba(11, 9, 7, 0.95) 46% 50%, transparent 50% 54%, rgba(11, 9, 7, 0.95) 54% 58%, transparent 58%),
    linear-gradient(45deg, transparent 0 46%, rgba(11, 9, 7, 0.95) 46% 50%, transparent 50% 54%, rgba(11, 9, 7, 0.95) 54% 58%, transparent 58%);
}

.menuWatchtower::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 12px;
  width: 62px;
  height: 26px;
  background: rgba(11, 9, 7, 0.96);
  clip-path: polygon(14% 100%, 14% 34%, 50% 0%, 86% 34%, 86% 100%);
}

.menuWatchtower::after {
  content: "";
  position: absolute;
  left: 26px;
  top: -6px;
  width: 24px;
  height: 22px;
  background:
    linear-gradient(to right, rgba(11, 9, 7, 0.96) 0 2px, transparent 2px 100%),
    linear-gradient(to bottom, rgba(11, 9, 7, 0.96) 0 2px, transparent 2px 100%),
    linear-gradient(0deg, rgba(11, 9, 7, 0.96) 0 60%, transparent 60% 100%);
}

.menuRuins {
  bottom: 22%;
  width: 190px;
  height: 152px;
  opacity: 0.55;
  background: rgba(10, 8, 6, 0.90);
}

.menuRuins::before,
.menuRuins::after {
  content: "";
  position: absolute;
  bottom: 0;
  background: inherit;
}

.ruinsLeft {
  left: 14.5%;
  clip-path: polygon(0 100%, 0 42%, 10% 42%, 10% 26%, 20% 26%, 20% 48%, 31% 48%, 31% 18%, 43% 18%, 43% 35%, 54% 35%, 54% 57%, 69% 57%, 69% 30%, 82% 30%, 82% 52%, 100% 52%, 100% 100%);
}

.ruinsRight {
  right: 5.5%;
  width: 170px;
  height: 185px;
  clip-path: polygon(0 100%, 0 58%, 14% 58%, 14% 29%, 32% 29%, 32% 8%, 47% 8%, 47% 36%, 62% 36%, 62% 18%, 79% 18%, 79% 49%, 100% 49%, 100% 100%);
}

.menuSceneTank {
  image-rendering: pixelated;
  opacity: 0.78;
  filter: brightness(0) saturate(0) sepia(0.20) contrast(1.15) drop-shadow(0 0 8px rgba(0, 0, 0, 0.35));
}

.tankLeft {
  left: 5.2%;
  bottom: 17.2%;
  width: 140px;
  height: 140px;
}

.tankRight {
  right: 11.2%;
  bottom: 16.2%;
  width: 124px;
  height: 124px;
}

.menuForegroundWreck {
  bottom: -1%;
  width: 240px;
  height: 120px;
  opacity: 0.72;
  background: rgba(8, 6, 5, 0.95);
}

.menuForegroundWreck::before,
.menuForegroundWreck::after {
  content: "";
  position: absolute;
  background: rgba(8, 6, 5, 0.95);
}

.wreckLeft {
  left: -2%;
  clip-path: polygon(0 100%, 6% 55%, 20% 28%, 46% 18%, 72% 25%, 100% 56%, 100% 100%);
}

.wreckLeft::before {
  left: 24%;
  top: 42%;
  width: 86px;
  height: 10px;
  transform: rotate(-28deg);
}

.wreckLeft::after {
  left: 43%;
  top: 18%;
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.wreckRight {
  right: -3.5%;
  width: 250px;
  clip-path: polygon(0 100%, 0 54%, 18% 30%, 44% 16%, 73% 25%, 100% 62%, 100% 100%);
}

.wreckRight::before {
  right: 30%;
  top: 54%;
  width: 94px;
  height: 11px;
  transform: rotate(-21deg);
}

.wreckRight::after {
  right: 17%;
  top: 22%;
  width: 62px;
  height: 62px;
  border-radius: 50%;
}

.menuHedgehog {
  bottom: 10%;
  width: 70px;
  height: 70px;
  opacity: 0.80;
}

.menuHedgehog span {
  position: absolute;
  left: 50%;
  top: 0;
  width: 10px;
  height: 100%;
  transform-origin: center;
  background: linear-gradient(180deg, rgba(12, 9, 7, 0.98), rgba(30, 20, 14, 0.96));
  margin-left: -5px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.menuHedgehog span:first-child {
  transform: rotate(48deg);
}

.menuHedgehog span:last-child {
  transform: rotate(-48deg);
}

.hedgehogLeft {
  left: 6.2%;
}

.hedgehogRight {
  right: 10.2%;
}

.menuBarrelStack {
  right: 3.8%;
  bottom: 8.8%;
  width: 72px;
  height: 86px;
  opacity: 0.78;
}

.menuBarrelStack span {
  position: absolute;
  bottom: 0;
  width: 24px;
  height: 48px;
  border: 2px solid rgba(11, 8, 6, 0.94);
  border-top-width: 4px;
  border-bottom-width: 4px;
  background:
    linear-gradient(180deg, rgba(26, 18, 12, 0.98), rgba(10, 8, 6, 0.98));
}

.menuBarrelStack span:nth-child(1) { left: 0; }
.menuBarrelStack span:nth-child(2) { left: 19px; bottom: 12px; }
.menuBarrelStack span:nth-child(3) { left: 38px; }

.menuGroundDebris {
  left: 0;
  right: 0;
  bottom: 0;
  height: 21%;
  opacity: 0.50;
  background:
    radial-gradient(circle at 8% 72%, rgba(16, 12, 9, 0.95) 0 20px, transparent 21px),
    radial-gradient(circle at 18% 84%, rgba(16, 12, 9, 0.95) 0 10px, transparent 11px),
    radial-gradient(circle at 31% 68%, rgba(16, 12, 9, 0.95) 0 16px, transparent 17px),
    radial-gradient(circle at 48% 88%, rgba(16, 12, 9, 0.95) 0 8px, transparent 9px),
    radial-gradient(circle at 58% 76%, rgba(16, 12, 9, 0.95) 0 18px, transparent 19px),
    radial-gradient(circle at 71% 82%, rgba(16, 12, 9, 0.95) 0 12px, transparent 13px),
    radial-gradient(circle at 86% 70%, rgba(16, 12, 9, 0.95) 0 16px, transparent 17px),
    radial-gradient(circle at 93% 88%, rgba(16, 12, 9, 0.95) 0 12px, transparent 13px),
    linear-gradient(180deg, rgba(24, 16, 11, 0) 0%, rgba(24, 16, 11, 0.4) 42%, rgba(9, 7, 5, 0.9) 100%);
}

@media (max-width: 1100px) {
  .menuRuins,
  .menuWatchtower,
  .menuBarrelStack {
    opacity: 0.45;
  }

  .tankLeft {
    left: 3%;
    width: 110px;
    height: 110px;
  }

  .tankRight {
    right: 6%;
    width: 100px;
    height: 100px;
  }
}

@media (max-width: 860px) {
  .menuSceneBackdrop {
    opacity: 0.85;
  }

  .menuSceneTank,
  .menuForegroundWreck,
  .menuHedgehog,
  .menuWatchtower,
  .menuRuins,
  .menuBarrelStack {
    display: none;
  }
}

/* Step 41A - launch cover page layout */
.coverOverlay {
  position: absolute;
  inset: 5px;
  z-index: 20;
  display: none;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: clamp(20px, 4vw, 54px);
  background: #120b07;
}

.coverOverlay.visible {
  display: flex;
}

.coverSceneBackdrop {
  z-index: 0;
}

.coverSceneBackdrop::after {
  height: 39%;
  background:
    linear-gradient(180deg, rgba(18, 11, 8, 0) 0%, rgba(18, 11, 8, 0.28) 24%, rgba(8, 6, 5, 0.90) 100%),
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.54));
}

.coverContent {
  position: relative;
  z-index: 2;
  width: min(760px, 91%);
  padding: clamp(34px, 6vh, 56px) clamp(24px, 5vw, 54px) clamp(28px, 4vh, 44px);
  text-align: center;
  background:
    radial-gradient(ellipse at center, rgba(24, 17, 12, 0.66) 0%, rgba(18, 12, 8, 0.46) 54%, rgba(18, 12, 8, 0.06) 76%, transparent 100%);
}

.coverTopLabel {
  color: #f6d65c;
  letter-spacing: clamp(4px, 0.55vw, 8px);
  font-size: clamp(11px, 1vw, 14px);
  font-weight: bold;
  margin-bottom: 16px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.75);
}

.coverRule {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 0 auto 12px;
}

.coverRule span {
  display: block;
  width: clamp(62px, 11vw, 110px);
  height: 3px;
  background: #d89a37;
  box-shadow: 0 3px 0 rgba(42, 26, 12, 0.88);
}

.coverRule i {
  display: block;
  width: 9px;
  height: 9px;
  background: #f4d27a;
  transform: rotate(45deg);
  box-shadow: 2px 2px 0 #6b3b1e;
}

.coverLogo {
  margin: 0;
  font-size: clamp(65px, 9vw, 108px);
  line-height: 0.98;
  letter-spacing: clamp(4px, 0.8vw, 10px);
  color: #f4d27a;
  text-shadow:
    3px 3px 0 #b26d27,
    6px 6px 0 #5a3017,
    9px 9px 0 #080604,
    0 0 22px rgba(243, 182, 68, 0.14);
}

.coverSubtitle {
  margin-top: clamp(14px, 2vh, 22px);
  color: #f6d65c;
  font-size: clamp(14px, 1.45vw, 21px);
  font-weight: bold;
  letter-spacing: clamp(3px, 0.45vw, 7px);
  text-shadow: 0 2px 0 #100a06;
}

.coverDescription {
  margin: clamp(16px, 2.5vh, 26px) auto 10px;
  max-width: 550px;
  color: #d8c7a5;
  font-size: clamp(12px, 1.1vw, 16px);
  line-height: 1.7;
  letter-spacing: 1px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.82);
}

.coverTankBadge {
  position: relative;
  width: 92px;
  height: 78px;
  margin: 10px auto 14px;
  border-bottom: 2px solid rgba(215, 154, 56, 0.50);
}

.coverTankBadge::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 15px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.78), transparent 68%);
}

.coverTankBody,
.coverTankTurret {
  position: absolute;
  top: 0;
  left: 14px;
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.38));
}

.coverTankTurret {
  transform: rotate(-90deg);
}

.coverStartButton {
  min-width: min(385px, 86vw);
  padding: 16px 38px;
  font-size: clamp(20px, 2.2vw, 27px);
  letter-spacing: 3px;
  margin-top: 0;
  text-shadow: 0 1px rgba(255, 242, 198, 0.25);
}

.coverPrompt {
  margin-top: 18px;
  color: #dec584;
  letter-spacing: clamp(2px, 0.34vw, 4px);
  font-size: clamp(10px, 1.02vw, 13px);
  font-weight: bold;
}

.coverModeStrip {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: clamp(-66px, -7vh, -50px);
  width: min(720px, 94vw);
  color: rgba(244, 210, 122, 0.70);
  font-size: clamp(9px, 1vw, 12px);
  letter-spacing: clamp(1px, 0.3vw, 3px);
  padding: 10px 12px;
  border-top: 1px solid rgba(215, 154, 56, 0.28);
  border-bottom: 1px solid rgba(215, 154, 56, 0.28);
  background: rgba(14, 10, 7, 0.22);
}

@media (max-height: 760px) {
  .coverContent {
    padding-top: 26px;
    padding-bottom: 20px;
  }
  .coverDescription {
    margin: 12px auto 6px;
  }
  .coverTankBadge {
    height: 64px;
    margin: 4px auto 9px;
    transform: scale(0.82);
    transform-origin: center bottom;
  }
  .coverModeStrip {
    bottom: -43px;
  }
}

@media (max-width: 680px) {
  .coverModeStrip {
    display: none;
  }
  .coverContent {
    width: 100%;
  }
  .coverLogo {
    letter-spacing: 3px;
  }
}


/* Step 41B - cover page transition polish */
.coverTransitionFlash,
.coverTransitionShade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.coverTransitionFlash {
  z-index: 5;
  background:
    radial-gradient(ellipse at center, rgba(250, 198, 100, 0.36) 0%, rgba(226, 141, 45, 0.14) 34%, transparent 68%);
  mix-blend-mode: screen;
}

.coverTransitionShade {
  z-index: 6;
  background: #120b07;
}

.coverOverlay.visible {
  animation: coverArrival 620ms ease-out both;
}

.coverOverlay.visible .coverContent {
  animation: coverContentArrival 720ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.coverOverlay.visible .coverLogo {
  animation: coverTitleGlow 3.1s ease-in-out 620ms infinite;
}

.coverOverlay.visible .coverPrompt {
  animation: coverPromptPulse 1.5s steps(2, end) 700ms infinite;
}

.coverOverlay.visible .coverStartButton {
  animation: coverButtonBreathe 2.25s ease-in-out 760ms infinite;
}

.coverOverlay.transitioningOut {
  pointer-events: none;
  display: flex;
  animation: coverExit 760ms cubic-bezier(0.42, 0, 0.24, 1) forwards;
}

.coverOverlay.transitioningOut .coverLogo,
.coverOverlay.transitioningOut .coverPrompt,
.coverOverlay.transitioningOut .coverStartButton {
  animation-play-state: paused;
}

.coverOverlay.transitioningOut .coverContent {
  animation: coverContentExit 690ms cubic-bezier(0.42, 0, 0.2, 1) forwards;
}

.coverOverlay.transitioningOut .coverSceneBackdrop {
  animation: coverBackdropExit 760ms ease forwards;
}

.coverOverlay.transitioningOut .coverTransitionFlash {
  animation: coverFlashSweep 620ms ease-out forwards;
}

.coverOverlay.transitioningOut .coverTransitionShade {
  animation: coverShadePass 760ms ease-in-out forwards;
}

#mainMenu.revealingFromCover .presentationTitleCard {
  animation: menuPanelReveal 760ms cubic-bezier(0.18, 0.88, 0.22, 1) both;
}

#mainMenu.revealingFromCover .menuSceneBackdrop {
  animation: menuSceneReveal 760ms ease-out both;
}

@keyframes coverArrival {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes coverContentArrival {
  from { opacity: 0; transform: translateY(13px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes coverTitleGlow {
  0%, 100% {
    filter: brightness(1);
    text-shadow: 3px 3px 0 #b26d27, 6px 6px 0 #5a3017, 9px 9px 0 #080604, 0 0 18px rgba(243, 182, 68, 0.12);
  }
  50% {
    filter: brightness(1.06);
    text-shadow: 3px 3px 0 #b26d27, 6px 6px 0 #5a3017, 9px 9px 0 #080604, 0 0 34px rgba(243, 182, 68, 0.28);
  }
}

@keyframes coverPromptPulse {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.54; }
}

@keyframes coverButtonBreathe {
  0%, 100% { filter: brightness(1); transform: translateY(0); }
  50% { filter: brightness(1.075); transform: translateY(-1px); }
}

@keyframes coverExit {
  0% { opacity: 1; }
  52% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes coverContentExit {
  0% { opacity: 1; transform: scale(1); }
  32% { opacity: 1; transform: scale(1.018); }
  100% { opacity: 0; transform: scale(1.035) translateY(-8px); }
}

@keyframes coverBackdropExit {
  0% { filter: brightness(1); transform: scale(1); }
  46% { filter: brightness(1.15); }
  100% { filter: brightness(0.74); transform: scale(1.016); }
}

@keyframes coverFlashSweep {
  0% { opacity: 0; }
  26% { opacity: 1; }
  62% { opacity: 0.45; }
  100% { opacity: 0; }
}

@keyframes coverShadePass {
  0%, 46% { opacity: 0; }
  61% { opacity: 0.32; }
  100% { opacity: 0; }
}

@keyframes menuPanelReveal {
  0%, 40% { opacity: 0; transform: translateY(10px) scale(0.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes menuSceneReveal {
  0% { opacity: 0.38; filter: brightness(0.8); }
  100% { opacity: 1; filter: brightness(1); }
}

@media (prefers-reduced-motion: reduce) {
  .coverOverlay.visible,
  .coverOverlay.visible .coverContent,
  .coverOverlay.visible .coverLogo,
  .coverOverlay.visible .coverPrompt,
  .coverOverlay.visible .coverStartButton,
  .coverOverlay.transitioningOut,
  .coverOverlay.transitioningOut .coverContent,
  .coverOverlay.transitioningOut .coverSceneBackdrop,
  .coverOverlay.transitioningOut .coverTransitionFlash,
  .coverOverlay.transitioningOut .coverTransitionShade,
  #mainMenu.revealingFromCover .presentationTitleCard,
  #mainMenu.revealingFromCover .menuSceneBackdrop {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Step 41C - ambient menu / cover motion */
.menuBackdropDrift,
.menuDistantFlash,
.menuSmokeWisp {
  position: absolute;
  pointer-events: none;
}

.coverSceneBackdrop,
.battlefieldMenu .menuSceneBackdrop {
  animation: backdropPan 18s ease-in-out infinite alternate;
  will-change: transform;
}

.menuSceneBackdrop::before {
  animation: gridDrift 22s linear infinite;
}

.menuBackdropDrift {
  inset: -2% -2% 10% -2%;
  opacity: 0.10;
  mix-blend-mode: screen;
  background:
    radial-gradient(circle at 18% 58%, rgba(255, 166, 62, 0.14) 0 10%, transparent 26%),
    radial-gradient(circle at 72% 44%, rgba(255, 139, 54, 0.11) 0 9%, transparent 24%),
    radial-gradient(circle at 52% 68%, rgba(255, 199, 109, 0.08) 0 7%, transparent 20%);
  animation: battlefieldHeatShimmer 10.5s ease-in-out infinite alternate;
}

.menuDistantFlash {
  bottom: 22%;
  width: 220px;
  height: 140px;
  opacity: 0;
  mix-blend-mode: screen;
  background: radial-gradient(circle at center, rgba(255, 181, 78, 0.88) 0 6%, rgba(255, 140, 44, 0.42) 14%, rgba(255, 120, 36, 0.18) 26%, transparent 52%);
  filter: blur(0.5px);
}

.menuDistantFlash::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  margin-top: -3px;
  background: rgba(255, 214, 145, 0.95);
  box-shadow: 0 0 8px rgba(255, 180, 66, 0.9);
}

.menuDistantFlash.flashLeft {
  left: 13.5%;
  animation: distantFlashPulse 12.5s linear infinite;
}

.menuDistantFlash.flashRight {
  right: 15.5%;
  bottom: 24%;
  transform: scale(0.85);
  animation: distantFlashPulse 17s linear 3.9s infinite;
}

.menuSmokeWisp {
  bottom: 30%;
  width: 180px;
  height: 120px;
  opacity: 0.13;
  background:
    radial-gradient(circle at 26% 58%, rgba(52, 39, 29, 0.72) 0 12%, transparent 13%),
    radial-gradient(circle at 47% 48%, rgba(56, 42, 32, 0.76) 0 15%, transparent 16%),
    radial-gradient(circle at 68% 36%, rgba(60, 45, 34, 0.74) 0 18%, transparent 19%),
    radial-gradient(circle at 38% 30%, rgba(54, 42, 31, 0.70) 0 11%, transparent 12%),
    radial-gradient(circle at 58% 66%, rgba(48, 36, 28, 0.66) 0 10%, transparent 11%);
  filter: blur(5px);
}

.menuSmokeWisp.wispOne {
  left: 17%;
  animation: smokeWispDrift 19s ease-in-out infinite;
}

.menuSmokeWisp.wispTwo {
  right: 14%;
  bottom: 34%;
  transform: scale(1.08);
  animation: smokeWispDrift 22s ease-in-out 4s infinite reverse;
}

.menuSmokeColumn.smokeLeft {
  animation: smokeColumnDriftLeft 13s ease-in-out infinite;
}

.menuSmokeColumn.smokeRight {
  animation: smokeColumnDriftRight 15s ease-in-out infinite;
}

.menuHorizonGlow {
  animation: horizonPulse 9s ease-in-out infinite;
}

.menuSceneTank.tankLeft {
  animation: farTankBobLeft 16s ease-in-out infinite;
}

.menuSceneTank.tankRight {
  animation: farTankBobRight 14s ease-in-out infinite;
}

.menuRuins.ruinsLeft {
  animation: layerParallaxNear 20s ease-in-out infinite alternate;
}

.menuRuins.ruinsRight,
.menuWatchtower {
  animation: layerParallaxFar 24s ease-in-out infinite alternate;
}

.menuForegroundWreck.wreckLeft {
  animation: foregroundParallaxLeft 26s ease-in-out infinite alternate;
}

.menuForegroundWreck.wreckRight,
.menuBarrelStack,
.menuHedgehog.hedgehogRight {
  animation: foregroundParallaxRight 23s ease-in-out infinite alternate;
}

.menuHedgehog.hedgehogLeft {
  animation: foregroundParallaxLeft 21s ease-in-out infinite alternate;
}

@keyframes backdropPan {
  0% { transform: translate3d(calc(-6px + var(--menu-pointer-x, 0px)), calc(0px + var(--menu-pointer-y, 0px)), 0) scale(1.015); }
  50% { transform: translate3d(var(--menu-pointer-x, 0px), calc(-4px + var(--menu-pointer-y, 0px)), 0) scale(1.02); }
  100% { transform: translate3d(calc(6px + var(--menu-pointer-x, 0px)), calc(2px + var(--menu-pointer-y, 0px)), 0) scale(1.015); }
}

@keyframes gridDrift {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-12px, 8px, 0); }
}

@keyframes battlefieldHeatShimmer {
  0% { transform: translate3d(calc(-8px + var(--menu-pointer-x, 0px)), var(--menu-pointer-y, 0px), 0) scale(1); opacity: 0.08; }
  50% { opacity: 0.12; }
  100% { transform: translate3d(calc(10px + var(--menu-pointer-x, 0px)), calc(-5px + var(--menu-pointer-y, 0px)), 0) scale(1.04); opacity: 0.10; }
}

@keyframes distantFlashPulse {
  0%, 88%, 100% { opacity: 0; transform: scale(0.88); }
  89% { opacity: 0.05; }
  90% { opacity: 0.42; }
  90.8% { opacity: 0.12; }
  91.3% { opacity: 0.55; }
  92.6% { opacity: 0.08; transform: scale(1.04); }
  100% { opacity: 0; transform: scale(1.12); }
}

@keyframes smokeWispDrift {
  0% { transform: translate3d(0, 0, 0) scale(0.95); opacity: 0.08; }
  35% { opacity: 0.16; }
  70% { opacity: 0.10; }
  100% { transform: translate3d(46px, -24px, 0) scale(1.18); opacity: 0.03; }
}

@keyframes smokeColumnDriftLeft {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.42; }
  50% { transform: translate3d(8px, -10px, 0) scale(1.03); opacity: 0.50; }
  100% { transform: translate3d(-4px, -18px, 0) scale(1.07); opacity: 0.36; }
}

@keyframes smokeColumnDriftRight {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.40; }
  45% { transform: translate3d(-7px, -8px, 0) scale(1.04); opacity: 0.48; }
  100% { transform: translate3d(6px, -16px, 0) scale(1.08); opacity: 0.34; }
}

@keyframes horizonPulse {
  0%, 100% { opacity: 0.84; transform: scaleX(0.98); }
  50% { opacity: 1; transform: scaleX(1.03); }
}

@keyframes farTankBobLeft {
  0%, 100% { transform: translate3d(var(--menu-pointer-x, 0px), var(--menu-pointer-y, 0px), 0); }
  50% { transform: translate3d(calc(8px + var(--menu-pointer-x, 0px)), calc(-2px + var(--menu-pointer-y, 0px)), 0); }
}

@keyframes farTankBobRight {
  0%, 100% { transform: translate3d(var(--menu-pointer-x, 0px), var(--menu-pointer-y, 0px), 0); }
  50% { transform: translate3d(calc(-7px + var(--menu-pointer-x, 0px)), calc(-2px + var(--menu-pointer-y, 0px)), 0); }
}

@keyframes layerParallaxNear {
  0% { transform: translate3d(calc(-3px + var(--menu-pointer-x, 0px)), var(--menu-pointer-y, 0px), 0); }
  100% { transform: translate3d(calc(5px + var(--menu-pointer-x, 0px)), calc(-2px + var(--menu-pointer-y, 0px)), 0); }
}

@keyframes layerParallaxFar {
  0% { transform: translate3d(calc(2px + var(--menu-pointer-x, 0px)), var(--menu-pointer-y, 0px), 0); }
  100% { transform: translate3d(calc(-4px + var(--menu-pointer-x, 0px)), calc(-1px + var(--menu-pointer-y, 0px)), 0); }
}

@keyframes foregroundParallaxLeft {
  0% { transform: translate3d(calc(-4px + var(--menu-pointer-near-x, 0px)), var(--menu-pointer-near-y, 0px), 0); }
  100% { transform: translate3d(calc(4px + var(--menu-pointer-near-x, 0px)), var(--menu-pointer-near-y, 0px), 0); }
}

@keyframes foregroundParallaxRight {
  0% { transform: translate3d(calc(4px + var(--menu-pointer-near-x, 0px)), var(--menu-pointer-near-y, 0px), 0); }
  100% { transform: translate3d(calc(-4px + var(--menu-pointer-near-x, 0px)), var(--menu-pointer-near-y, 0px), 0); }
}

@media (prefers-reduced-motion: reduce) {
  .coverSceneBackdrop,
  .battlefieldMenu .menuSceneBackdrop,
  .menuSceneBackdrop::before,
  .menuBackdropDrift,
  .menuDistantFlash,
  .menuSmokeWisp,
  .menuSmokeColumn,
  .menuHorizonGlow,
  .menuSceneTank,
  .menuRuins,
  .menuWatchtower,
  .menuForegroundWreck,
  .menuHedgehog,
  .menuBarrelStack {
    animation: none !important;
    transform: none !important;
  }
}


/* Step 42 - interaction highlight polish */
.coverOverlay,
.battlefieldMenu {
  --menu-pointer-x: 0px;
  --menu-pointer-y: 0px;
  --menu-pointer-near-x: 0px;
  --menu-pointer-near-y: 0px;
}

.coverOverlay .coverStartButton:hover,
.battlefieldMenu .primaryButton:hover,
.battlefieldMenu .secondaryButton:hover {
  filter: brightness(1.1);
  box-shadow:
    0 6px 0 #120d09,
    0 0 14px rgba(246, 214, 92, 0.20);
}

.coverOverlay .coverStartButton:focus-visible,
.battlefieldMenu button:focus-visible {
  outline: 3px solid #f6d65c;
  outline-offset: 3px;
}


/* Publication pass - complete music attribution links */
.musicCreditItem a {
  display: inline-block;
  margin-top: 8px;
  color: #f6d65c;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
  text-decoration: none;
  border-bottom: 1px dashed rgba(246, 214, 92, 0.55);
}

.musicCreditItem a:hover,
.musicCreditItem a:focus-visible {
  color: #fff0a4;
  border-bottom-color: #fff0a4;
}
