/* Orbit Defense — canvas 1280×720 en el stage 1920×1080 */

.defense-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 20px 40px 40px;
  height: calc(100% - var(--vu-hud-h, 100px));
  box-sizing: border-box;
}

.defense-stage {
  position: relative;
  width: 1280px;
  height: 720px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(123, 92, 255, 0.45);
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.14);
  background: #05060f;
}

#game {
  display: block;
  width: 1280px;
  height: 720px;
  touch-action: none;
  outline: none;
}

.play-hud {
  position: absolute;
  top: 16px;
  left: 20px;
  right: 20px;
  z-index: 4;
  display: grid;
  grid-template-columns: auto repeat(7, minmax(0, 1fr)); /* 129y: el puntaje en su columna auto */
  align-items: center;
  gap: 10px 12px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  font-size: var(--type-body);
  color: var(--text-muted);
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.35);
}

.play-hud[hidden] {
  display: none;
}

.play-hud strong {
  font-family: var(--font-display);
  color: var(--cyan);
  font-size: var(--type-meta);
}

/* 133a: son 8 datos; en PC los valores van un poco más chicos para que entren todos en una fila. */
.game-shell:not([data-layout="mobile"]) .play-hud strong {
  font-size: 22px;
}

.play-hud > * {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-shell[data-layout="mobile"] .play-hud {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#hud-emp.is-ready {
  color: #00f0ff;
}

#hud-emp.is-cool {
  color: #b06a9a;
}

.touch-actions {
  display: none;
}

.pickup-toast {
  position: absolute;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid #ffd166;
  background: rgba(12, 14, 28, 0.82);
  color: #ffd166;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-shadow: 0 0 12px rgba(255, 209, 102, 0.65);
  box-shadow: 0 0 22px rgba(255, 209, 102, 0.28);
  animation: pickup-pulse 0.9s ease-in-out infinite;
}

@keyframes pickup-pulse {
  0%,
  100% {
    box-shadow: 0 0 12px rgba(255, 209, 102, 0.25);
  }
  50% {
    box-shadow: 0 0 28px rgba(255, 209, 102, 0.55);
  }
}

.overlay-panel {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  place-content: center;
  text-align: center;
  padding: 48px;
  background: linear-gradient(180deg, rgba(5, 6, 15, 0.28), rgba(5, 6, 15, 0.84));
  pointer-events: none;
}

.overlay-panel.is-open {
  display: grid;
  pointer-events: auto;
  animation: panel-in 0.28s ease;
}

.overlay-panel h1,
.overlay-panel h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: var(--type-title);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 22px rgba(123, 92, 255, 0.55);
}

.overlay-panel p {
  margin: 0 auto 22px;
  max-width: 56ch;
  color: var(--text-muted);
  font-size: var(--type-body);
}

.final-score strong {
  font-family: var(--font-display);
  color: var(--cyan);
  font-size: 48px;
}

.save-note {
  min-height: 1.4em;
  color: var(--cyan) !important;
}

.overlay-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

kbd {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(0, 240, 255, 0.08);
  color: var(--cyan);
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.game-shell[data-layout="mobile"] .defense-wrap {
  height: auto;
  padding: 12px;
}

.game-shell[data-layout="mobile"] .defense-stage,
.game-shell[data-layout="mobile"] #game {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

.game-shell:is([data-layout="mobile"], [data-input="touch"]) .touch-actions {
  display: flex;
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 6;
  gap: 10px;
  pointer-events: none;
}

.game-shell:is([data-layout="mobile"], [data-input="touch"]) .touch-actions button {
  pointer-events: auto;
  min-width: 92px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 240, 255, 0.45);
  background: rgba(8, 10, 24, 0.82);
  color: #00f0ff;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-shell:is([data-layout="mobile"], [data-input="touch"]) #btn-emp {
  border-color: rgba(255, 209, 102, 0.55);
  color: #ffd166;
}

html.is-preview .touch-actions {
  display: none !important;
}

/* 117: botones en las bandas de 80 del modo juego */
.game-shell:is([data-layout="mobile"], [data-input="touch"])[data-play="on"] #touch-actions {
  right: 4px;
  left: auto;
  top: 8px;
  bottom: 8px;
  width: 72px;
  display: grid;
  grid-auto-rows: 1fr;
  gap: 8px;
}

.game-shell:is([data-layout="mobile"], [data-input="touch"])[data-play="on"] #touch-actions button {
  width: 72px;
  min-width: 0;
  min-height: 40px;
  padding: 6px 4px;
  border-radius: 12px;
  background: #0a0d1f;
  font-size: 14px;
  letter-spacing: 0.02em;
  white-space: normal;
  pointer-events: auto;
}
