/* game.css — Bloon Assembly freifick arcade styling */

.bloons-main {
  max-width: 1240px;
  margin: 28px auto 0;
  padding: 0 16px;
  translate: 0;
}

.development-notice {
  font-size: 15px;
  background: var(--mustard);
  margin: 18px 0;
}
.development-notice a {
  font-weight: 700;
}

/* ---------- main game card ---------- */
.game {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 18px 24px 16px 22px;
  box-shadow: 7px 9px 0 var(--shadow);
  padding: 0;
  overflow: clip;
  margin: 28px 0;
}

/* ---------- hud ---------- */
.hud {
  display: flex;
  gap: 28px;
  padding: 14px 22px;
  align-items: center;
  background: #e3e7f8;
  border-bottom: 3px solid var(--ink);
  flex-wrap: wrap;
}
.hud > div {
  display: flex;
  flex-direction: column;
}
.hud .label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--ink);
  opacity: .75;
}
.hud strong {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.hud small {
  font-size: 14px;
  color: var(--ink);
  opacity: .6;
  font-weight: 700;
}
#cash { color: #0f8538; }
#lives { color: #c8143c; }
#round { color: var(--ink); }
#pops { color: #2f3ab2; }
.phase {
  margin-left: auto;
  font: 700 13px ui-monospace, monospace;
  letter-spacing: 1px;
  color: var(--slime-dark);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 8px 4px 10px 5px;
  padding: 5px 12px;
  box-shadow: 2px 2px 0 var(--shadow);
}

/* ---------- play layout ---------- */
.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
}

.field-wrap {
  position: relative;
  align-self: start;
  min-width: 0;
  background: #5fae3a;
  border-right: 3px solid var(--ink);
}
#field {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  height: auto;
  cursor: crosshair;
  touch-action: none;
}
.field-caption {
  background: #eef2ff;
  border-top: 3px solid var(--ink);
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font: 700 11px ui-monospace, monospace;
  letter-spacing: .5px;
}
.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #117743;
  margin-right: 6px;
  vertical-align: middle;
  animation: blink 1.2s steps(2, start) infinite;
}

/* ---------- shop ---------- */
.shop {
  padding: 16px 14px;
  background: #f2f5ff;
}
.shop-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.shop-title h2 {
  font-size: 18px;
  margin: 0;
  filter: url(#wobble);
}
.shop-title > span {
  font: 700 12px ui-monospace, monospace;
  color: var(--slime-dark);
}
.shop-hint {
  font-size: 13px;
  color: var(--ink);
  opacity: .75;
  margin: 2px 0 12px;
}
.tower-card {
  width: 100%;
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 8px;
  text-align: left;
  border: 2px solid var(--ink);
  border-radius: 10px 4px 12px 5px;
  background: #fff;
  box-shadow: 2px 2px 0 var(--shadow);
  margin-bottom: 7px;
  padding: 8px 10px;
  cursor: pointer;
  transition: translate .05s, box-shadow .05s, background .1s;
}
.tower-card:hover:not(:disabled) {
  background: #f1ffe6;
  rotate: -0.6deg;
}
.tower-card[aria-pressed="true"] {
  border-color: var(--ink);
  background: #fff58a;
  box-shadow: 1px 1px 0 var(--shadow);
  translate: 1px 1px;
}
.tower-card.unaffordable {
  opacity: .5;
}
.tower-card b {
  font-size: 14px;
  display: block;
  line-height: 1.2;
}
.tower-card small {
  font-size: 11px;
  display: block;
  opacity: .7;
}
.tower-card strong {
  font-size: 13px;
  color: #0f8538;
}
.tower-card kbd {
  position: absolute;
  top: 3px;
  left: 4px;
  font-size: 8px;
  padding: 0 4px;
}
.tower-icon {
  height: 34px;
  width: 34px;
  display: grid;
  place-items: center;
  font-size: 20px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: 1px 1px 0 var(--shadow);
}
.dart { color: #fff; background: #b87333; }
.tack { color: #fff; background: #c8405a; }
.bomb { color: #fff; background: #4a5468; }
.ice { color: #16152a; background: #a2e8f5; }
.super { color: #fff; background: #5865f2; }
.ninja { color: #fff; background: #6b4e71; }

/* ---------- inspect / upgrades ---------- */
.inspect {
  border-top: 2px dashed var(--ink);
  margin-top: 14px;
  padding-top: 12px;
}
.inspect .eyebrow {
  font-size: 11px;
  font-family: ui-monospace, monospace;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--slime-dark);
  margin: 0 0 4px;
}
.inspect h3 {
  font-size: 16px;
  margin: 0 0 6px;
}
.inspect p:not(.eyebrow) {
  font-size: 13px;
  opacity: .8;
  margin: 0 0 10px;
}
#upgrade-paths {
  width: 100%;
}
#upgrade-paths button {
  width: 100%;
  text-align: left;
  border: 2px solid var(--ink);
  border-radius: 8px 4px 10px 5px;
  background: #fff;
  box-shadow: 2px 2px 0 var(--shadow);
  padding: 7px 10px;
  margin-top: 6px;
  cursor: pointer;
  transition: translate .05s, box-shadow .05s;
}
#upgrade-paths button:hover:not(:disabled) {
  background: #f1ffe6;
  rotate: -0.5deg;
}
#upgrade-paths button:disabled {
  opacity: .45;
  cursor: default;
}
#upgrade-paths b {
  color: #0f8538;
  font-size: 13px;
  display: block;
}
#upgrade-paths span {
  font-size: 11px;
  opacity: .75;
  line-height: 1.35;
  display: block;
}
#upgrade-paths small {
  font: 700 9px ui-monospace, monospace;
  color: var(--slime-dark);
  letter-spacing: 1px;
  display: block;
}
#sell {
  width: 100%;
  background: #ffe3e3;
  color: #c8143c;
  border: 2px solid var(--ink);
  border-radius: 8px 4px 10px 5px;
  box-shadow: 2px 2px 0 var(--shadow);
  font-size: 13px;
  padding: 7px 10px;
  margin-top: 8px;
  font-weight: 700;
  cursor: pointer;
}
#sell:hover:not(:disabled) {
  background: #ffd0d0;
}
#cancel {
  width: 100%;
  margin-top: 8px;
  font-size: 13px;
}
button.quiet {
  background: transparent !important;
  border: 2px dashed var(--ink) !important;
  box-shadow: none !important;
  opacity: .8;
}
button.quiet:hover {
  opacity: 1;
  background: rgba(255, 255, 255, .5) !important;
}

#targeting-wrap {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  margin-top: 8px;
  font-weight: 700;
}
#targeting-wrap select {
  font: inherit;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #fff;
  padding: 3px 8px;
}
#targeting-wrap[hidden], #tower-actions[hidden], #cancel[hidden] {
  display: none;
}

/* ---------- sandbox controls ---------- */
.sandbox-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: #f7f9ff;
  border-top: 3px solid var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.sandbox-controls[hidden] {
  display: none;
}
.sandbox-controls label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sandbox-controls select, .sandbox-controls input[type="number"] {
  font: inherit;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #fff;
  padding: 3px 8px;
}
.sandbox-controls input[type="checkbox"] {
  accent-color: var(--accent);
}
.sandbox-controls button {
  padding: 4px 10px;
  font-size: 13px;
}
#spawn-count { width: 60px; }

/* ---------- toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 3px solid var(--ink);
  background: #e3e7f8;
  padding: 12px 20px;
}
.toolbar select {
  font: inherit;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #fff;
  padding: 4px 8px;
}
.mode-label {
  font-size: 13px;
  font-weight: 700;
}
.toolbar .primary {
  background: var(--slime);
  border-width: 3px;
  box-shadow: 4px 4px 0 var(--shadow);
  font-size: 18px;
  padding: 8px 20px;
}
.toolbar .primary:hover:not(:disabled) {
  background: #d3bddf;
}
#best {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  opacity: .75;
}

/* ---------- message status bar ---------- */
.message {
  margin: 0;
  padding: 8px 22px 14px;
  min-height: 38px;
  font-size: 14px;
  font-weight: 700;
  background: #e3e7f8;
  color: var(--ink);
}

/* ---------- overlay ---------- */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(22, 21, 42, .75);
  display: grid;
  place-items: center;
  z-index: 20;
}
.overlay[hidden] {
  display: none;
}
.overlay-card {
  padding: 24px 32px;
  background: #fdf0d0;
  border: 4px solid var(--ink);
  border-radius: 18px 8px 22px 10px;
  box-shadow: 8px 10px 0 var(--shadow);
  text-align: center;
  max-width: 440px;
}
.overlay-card .eyebrow {
  font: 700 12px ui-monospace, monospace;
  color: var(--slime-dark);
  letter-spacing: 2px;
  margin: 0 0 6px;
}
.overlay-card h2 {
  font: 400 clamp(28px, 6vw, 42px)/1.1 "Rubik Wet Paint", "Comic Neue", cursive;
  margin: 0 0 10px;
  color: var(--ink);
}
.overlay-card p:not(.eyebrow) {
  font-size: 15px;
  margin: 0 0 16px;
  font-weight: 700;
}

/* ---------- below sections ---------- */
.below {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 30px 0 10px;
}
.below .card {
  margin: 0;
}
.section-number {
  font: 700 11px ui-monospace, monospace;
  letter-spacing: 1.5px;
  color: var(--slime-dark);
}
.below h2 {
  font-size: 24px;
  margin: 6px 0 10px;
}
.below p {
  font-size: 15px;
  margin: 0 0 10px;
}
.key-help {
  font-size: 13px !important;
  opacity: .8;
}

/* ---------- responsive rules ---------- */
@media (max-width: 1000px) {
  .play-layout {
    grid-template-columns: minmax(0, 1fr) 250px;
  }
  .hud {
    gap: 18px;
  }
  .below {
    gap: 16px;
  }
}

@media (max-width: 760px) {
  .play-layout {
    display: flex;
    flex-direction: column;
  }
  .field-wrap {
    border-right: 0;
    border-bottom: 3px solid var(--ink);
  }
  .shop {
    border-top: 0;
  }
  .shop-title, .shop-hint {
    display: none;
  }
  #tower-shop {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
  }
  .tower-card {
    flex: 0 0 140px;
    grid-template-columns: 30px 1fr;
    gap: 6px;
    margin: 0;
  }
  .tower-card strong {
    grid-column: 2;
  }
  .tower-card small {
    display: none;
  }
  #tower-actions {
    display: block;
  }
  #upgrade-paths {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .toolbar {
    padding: 10px 14px;
    gap: 8px;
  }
  .hud {
    padding: 10px 14px;
    gap: 16px;
  }
  .hud strong {
    font-size: 18px;
  }
  .phase {
    display: none;
  }
  .below {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (max-width: 400px) {
  #upgrade-paths {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
