/* Toda la ventana es una escena de videojuego; arena lógica fija, presentación adaptable. */
:root {
  color-scheme: dark;
  --bg: #050910;
  --text: #eef6e8;
  --muted: #8fa4b5;
  --blue: #4e99ff;
  --pink: #ff639f;
  --mint: #c7ff73;
  --red: #ff5268;
  --mono: "Consolas", "Courier New", monospace;
}
* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
}
button {
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:disabled {
  cursor: default;
  opacity: 0.35;
}
button:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 5px;
}
[hidden] {
  display: none !important;
}
.game-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(ellipse at center, #193142, #050910 74%);
}
#game {
  position: absolute;
  inset: 0;
}
#game canvas {
  display: block;
}
.screen-grain {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  opacity: 0.1;
  background: repeating-linear-gradient(transparent 0 2px, #04101d 3px 4px);
}
.vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  box-shadow: inset 0 0 150px 45px #02060a99;
}
.screen {
  position: absolute;
  inset: 0;
  z-index: 5;
}
.system-controls {
  position: absolute;
  right: 32px;
  top: 28px;
  display: flex;
  gap: 8px;
  z-index: 10;
}
.icon-button {
  width: 34px;
  height: 34px;
  color: #c3d7e3;
  border: 1px solid #89b1ca33;
  border-radius: 2px;
  background: #0b1a25aa;
  display: grid;
  place-items: center;
  font: 20px var(--mono);
  transition:
    color 0.15s,
    border-color 0.15s;
}
.icon-button:hover {
  color: var(--mint);
  border-color: var(--mint);
}
.eyebrow {
  font: 10px var(--mono);
  letter-spacing: 2px;
  color: #a4bacb;
  display: flex;
  align-items: center;
  gap: 9px;
}
.live-dot {
  width: 5px;
  height: 5px;
  background: var(--mint);
  box-shadow: 0 0 10px var(--mint);
}
.boot-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: radial-gradient(ellipse at 50% 40%, #1e354455, transparent 60%), #050910;
}
.boot-emblem {
  display: flex;
  align-items: center;
  height: 100px;
  margin-bottom: 28px;
}
.boot-emblem > span {
  width: 25px;
  height: 25px;
  background: var(--blue);
  transform: rotate(-12deg);
  box-shadow: 0 0 40px #468bff66;
}
.boot-emblem > span:last-child {
  background: var(--pink);
  transform: rotate(12deg);
  box-shadow: 0 0 40px #ff639f66;
}
.boot-emblem i {
  height: 2px;
  width: 90px;
  background: var(--mint);
  box-shadow: 0 0 16px var(--mint);
  animation: energy-pulse 1.8s infinite;
}
.boot-title {
  font-weight: 950;
  font-size: clamp(30px, 5vw, 60px);
  letter-spacing: -2px;
  margin: 12px 0 30px;
}
.boot-title span {
  color: var(--mint);
  padding: 0 8px;
  font-weight: 400;
}
.boot-screen > .eyebrow {
  font-size: 8px;
  letter-spacing: 3px;
}
.boot-loader {
  width: 230px;
  height: 2px;
  background: #203341;
  overflow: hidden;
}
.boot-loader i {
  display: block;
  width: 40%;
  height: 100%;
  background: var(--mint);
  animation: loading-scan 1.3s ease-in-out infinite;
}
.boot-status {
  color: #7e9db1;
  font: 9px var(--mono);
  letter-spacing: 2px;
  margin-top: 17px;
}
.enter-button {
  margin-top: 12px;
  background: none;
  border: 1px solid #526d7b;
  color: var(--mint);
  padding: 14px 28px;
  font: 11px var(--mono);
  letter-spacing: 3px;
  animation: energy-pulse 2s infinite;
}
.enter-button span {
  margin-left: 30px;
}
.enter-button:hover {
  background: #c7ff7310;
}
.boot-footer {
  position: absolute;
  bottom: 35px;
  color: #547180;
  font: 8px var(--mono);
  letter-spacing: 3px;
}
.menu-screen {
  display: flex;
  flex-direction: column;
  padding: 38px clamp(30px, 7vw, 120px) 30px;
  background:
    radial-gradient(ellipse at 73% 46%, #162e4999, transparent 55%),
    linear-gradient(105deg, #060c16, #090f19);
}
.menu-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.horizon-grid {
  position: absolute;
  width: 180%;
  height: 85%;
  left: -40%;
  bottom: -44%;
  transform: perspective(440px) rotateX(58deg);
  background:
    linear-gradient(#3b607650 1px, transparent 1px),
    linear-gradient(90deg, #3b607650 1px, transparent 1px);
  background-size: 70px 70px;
  mask-image: linear-gradient(transparent, #000);
  animation: floor-drift 14s linear infinite;
}
.light-column {
  position: absolute;
  top: -15%;
  width: 20%;
  height: 125%;
  filter: blur(60px);
  opacity: 0.15;
  transform: rotate(20deg);
}
.light-blue {
  background: var(--blue);
  left: 49%;
}
.light-pink {
  background: var(--pink);
  left: 84%;
  width: 10%;
}
.dust {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, #b3d6ed80 1px, transparent 2px),
    radial-gradient(circle, #c7ff7370 1px, transparent 2px);
  background-size:
    211px 187px,
    347px 293px;
  background-position:
    12px 43px,
    89px 117px;
  opacity: 0.35;
  animation: dust-drift 25s linear infinite;
}
.menu-topline {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-right: 120px;
}
.build-label {
  font: 9px var(--mono);
  letter-spacing: 2px;
  color: #5e7d91;
}
.menu-content {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: 48% 52%;
  align-items: center;
  min-height: 0;
  max-width: 1400px;
  width: 100%;
  margin: auto;
}
.menu-copy {
  position: relative;
  z-index: 2;
  padding: 20px 0;
}
.overline {
  font: 10px var(--mono);
  letter-spacing: 4px;
  color: var(--mint);
  margin: 0 0 23px;
  animation: title-entry 0.6s both;
}
.game-title {
  font-family: "Arial Black", "Segoe UI", sans-serif;
  font-weight: 950;
  font-size: clamp(70px, 9.5vw, 145px);
  letter-spacing: -0.075em;
  line-height: 0.84;
  margin: 0;
  filter: drop-shadow(0 10px 30px #0005);
  animation: title-entry 0.8s 0.05s both;
}
.game-title > span {
  display: block;
}
.game-title i {
  color: var(--mint);
  font-style: normal;
  text-shadow: 0 0 35px #c7ff7330;
}
.tagline {
  font-size: clamp(14px, 1.6vw, 22px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.3px;
  color: #9eb6c8;
  margin: 23px 0 30px;
  animation: title-entry 0.8s 0.15s both;
}
.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 355px;
  animation: title-entry 0.8s 0.25s both;
}
.menu-action {
  position: relative;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 18px;
  min-height: 46px;
  padding: 11px 18px;
  background: transparent;
  border: 1px solid transparent;
  color: #92aabf;
  font: 11px var(--mono);
  letter-spacing: 2px;
  transition:
    background 0.15s,
    color 0.15s,
    transform 0.15s;
}
.menu-action-index {
  font-size: 8px;
  opacity: 0.45;
}
.menu-action i {
  font-size: 19px;
  font-style: normal;
  margin-left: auto;
  opacity: 0;
}
.menu-action.selected,
.menu-action:hover,
.menu-action:focus-visible {
  background: linear-gradient(90deg, #c7ff73, #a7e35c);
  color: #15200c;
  border-color: #d3ff95;
  transform: translateX(5px);
  outline: none;
  box-shadow: 0 0 25px #c7ff7310;
}
.menu-action.selected i,
.menu-action:hover i {
  opacity: 1;
}
.menu-action.selected::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  border: 4px solid transparent;
  border-left-color: var(--mint);
  transform: translateY(-50%);
}
.menu-footer {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #65869d;
  font: 8px var(--mono);
  letter-spacing: 2px;
  gap: 20px;
}
.menu-footer i {
  font-style: normal;
  color: var(--mint);
  padding: 0 9px;
}
.keyboard-note {
  display: flex;
  align-items: center;
  gap: 7px;
}
kbd {
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 22px;
  padding: 0 5px;
  border: 1px solid #456174;
  border-bottom-width: 2px;
  border-radius: 2px;
  font: 10px var(--mono);
  color: #aac2d3;
  background: #10202e;
}
/* Composición del menú: arte raster original y vínculo animado. */
.hero-art {
  position: relative;
  height: min(70vh, 600px);
  width: 100%;
  animation: scene-entry 1.2s 0.1s both;
}
.hero-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid #44668055;
  border-radius: 50%;
  width: 90%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
}
.orbit-outer::before {
  content: "";
  position: absolute;
  inset: -14px;
  border: 1px dashed #6d8a9a30;
  border-radius: 50%;
  animation: orbit-spin 100s linear infinite;
}
.orbit-inner {
  width: 62%;
  border-color: #7895a522;
}
.hero-link {
  position: absolute;
  width: 59%;
  height: 8px;
  left: 50%;
  top: 49%;
  transform: translate(-50%, -50%) rotate(-31deg);
  background: #c7ff730e;
  box-shadow: 0 0 35px #c7ff7355;
}
.hero-link > span {
  position: absolute;
  inset: 3px 0;
  background: #e3ffd3;
  box-shadow: 0 0 8px 2px var(--mint);
  animation: energy-pulse 2.4s infinite;
}
.hero-link i {
  position: absolute;
  width: 8px;
  height: 5px;
  top: 2px;
  left: 0;
  background: white;
  box-shadow: 0 0 17px white;
  animation: signal-travel 2s linear infinite;
}
.hero-unit {
  --unit: var(--blue);
  --unit-dark: #193c85;
  --unit-light: #9bceff;
  position: absolute;
  width: 116px;
  height: 142px;
  top: calc(50% + 17px);
  left: calc(50% - 205px);
  transform: rotate(-10deg);
  animation: hover-blue 5s ease-in-out infinite;
}
.hero-pink {
  --unit: var(--pink);
  --unit-dark: #863457;
  --unit-light: #ffd0e1;
  top: calc(50% - 151px);
  left: calc(50% + 80px);
  transform: rotate(10deg);
  animation: hover-pink 5s ease-in-out infinite;
}
.unit-body {
  position: absolute;
  inset: 20px 0 0;
  background: linear-gradient(
    140deg,
    var(--unit-light) -60%,
    var(--unit) 45%,
    var(--unit-dark) 140%
  );
  border: 2px solid var(--unit-light);
  border-radius: 14px 14px 9px 9px;
  box-shadow:
    -8px 11px 0 var(--unit-dark),
    0 0 90px #468bff44,
    inset 0 3px 4px #fff5;
}
.hero-pink .unit-body {
  box-shadow:
    8px 11px 0 var(--unit-dark),
    0 0 90px #ff639f33,
    inset 0 3px 4px #fff5;
}
.unit-top {
  position: absolute;
  width: 75px;
  height: 24px;
  left: 20px;
  top: 12px;
  border-radius: 8px;
  background: var(--unit-dark);
  border: 1px solid var(--unit-light);
}
.unit-antenna {
  position: absolute;
  width: 2px;
  height: 25px;
  left: 59px;
  top: -11px;
  background: var(--unit-light);
}
.unit-antenna::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--mint);
  top: -4px;
  left: -3px;
  border-radius: 50%;
  box-shadow: 0 0 14px var(--mint);
}
.unit-visor {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 22px;
  height: 40px;
  background: #092033;
  border: 2px solid var(--unit-dark);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 17px;
  box-shadow: inset 0 3px 12px #000a;
}
.unit-visor i {
  width: 7px;
  height: 13px;
  background: #c7f4ff;
  box-shadow: 0 0 10px #b4f5ff;
  border-radius: 2px;
  animation: eye-blink 7s infinite;
}
.hero-pink .unit-visor i {
  background: #ffd9ec;
  box-shadow: 0 0 10px #ff8ec6;
  animation-delay: 2s;
}
.unit-bolt {
  position: absolute;
  right: 15px;
  bottom: 9px;
  font: 27px var(--mono);
  color: var(--unit-light);
}
.unit-vent {
  position: absolute;
  left: 15px;
  bottom: 16px;
  height: 15px;
  width: 25px;
  background: repeating-linear-gradient(transparent 0 2px, var(--unit-dark) 2px 4px);
}
.unit-shadow {
  position: absolute;
  width: 135px;
  height: 24px;
  top: 177px;
  left: -12px;
  background: #02070d88;
  border-radius: 50%;
  filter: blur(8px);
}
.unit-caption {
  position: absolute;
  left: -3px;
  top: 207px;
  width: 150px;
  font: 11px var(--mono);
  color: #7eaad4;
  letter-spacing: 2px;
}
.hero-pink .unit-caption {
  color: #d992b3;
}
.unit-caption b {
  color: var(--unit-light);
  font-size: 18px;
  padding-left: 8px;
}
.unit-caption small {
  display: block;
  font-size: 7px;
  margin-top: 8px;
}
.hero-readout {
  position: absolute;
  top: 73%;
  left: 55%;
  color: #7894a6;
  display: flex;
  align-items: center;
  gap: 12px;
}
.hero-readout > span {
  font-size: 40px;
  color: var(--mint);
  opacity: 0.65;
}
.hero-readout p {
  font: 8px/1.7 var(--mono);
  letter-spacing: 2px;
}
.art-cross {
  position: absolute;
  font: 25px var(--mono);
  color: #64879e;
}
.cross-a {
  top: 21%;
  left: 7%;
}
.cross-b {
  bottom: 13%;
  right: 5%;
}
.deploy-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #07101de8;
  animation: scene-entry 0.4s both;
}
.deploy-screen h2 {
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 400;
  letter-spacing: -1px;
  margin: 20px 0 0;
}
.deploy-count {
  font: 150px/1.3 var(--mono);
  color: var(--mint);
  text-shadow: 0 0 65px #c7ff7344;
}
.deploy-crosshair {
  position: absolute;
  width: 360px;
  height: 360px;
  border: 1px dashed #5e8da344;
  border-radius: 50%;
  animation: orbit-spin 20s linear infinite;
  pointer-events: none;
}
.pilot-ready {
  display: flex;
  gap: 35px;
  align-items: center;
  font: 11px var(--mono);
  letter-spacing: 1px;
}
.pilot-ready span {
  display: flex;
  align-items: center;
  gap: 9px;
}
.pilot-ready b {
  font: 25px var(--mono);
  color: var(--mint);
}
.blue-square,
.pink-square {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--blue);
  box-shadow: 0 0 8px #468bff55;
}
.pink-square {
  background: var(--pink);
  box-shadow: 0 0 8px #ff639f55;
}
.deploy-tip {
  font: 11px var(--mono);
  color: #708ea4;
  margin-top: 40px;
}
.hud {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.mission-hud {
  position: absolute;
  left: 30px;
  top: 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mission-hud .eyebrow {
  font-size: 8px;
  color: #6688a1;
}
.mission-hud strong {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
}
.mission-hud > span:last-child {
  font: 10px var(--mono);
  color: var(--mint);
}
.link-hud {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: min(31vw, 320px);
  color: var(--mint);
}
.link-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 9px var(--mono);
  letter-spacing: 1px;
  gap: 8px;
}
.tension-track {
  height: 4px;
  background: #63819733;
  margin: 10px 0 8px;
  position: relative;
}
.tension-track > i {
  display: block;
  height: 100%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  width: 0;
}
.tension-track > b {
  position: absolute;
  right: 0;
  top: -2px;
  width: 1px;
  height: 8px;
  background: #b2c4c9;
}
.link-instruction {
  display: block;
  font: 8px var(--mono);
  color: #799ab0;
  letter-spacing: 0.4px;
}
.link-hud[data-link="strained"],
.link-hud[data-link="stunned"] {
  color: var(--red);
}
.link-hud[data-link="disconnected"] {
  color: #ffce85;
}
.session-hud {
  position: absolute;
  right: 30px;
  top: 76px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.session-hud > span {
  font: 10px var(--mono);
  color: #7f9caf;
}
.session-hud button {
  pointer-events: auto;
  width: 29px;
  height: 29px;
  font-size: 17px;
}
.break-alert {
  position: absolute;
  left: 50%;
  top: 34%;
  transform: translateX(-50%);
  text-align: center;
  color: var(--red);
  padding: 15px 24px;
  background: #071321b0;
  border-top: 1px solid #ff526855;
  min-width: 250px;
  animation: scene-entry 0.2s both;
}
.break-alert > span {
  font: 11px var(--mono);
  letter-spacing: 4px;
}
.break-alert strong {
  display: block;
  font: 54px/1.4 var(--mono);
}
.break-alert p {
  font: 10px var(--mono);
  color: #cca9ab;
  margin: 0;
}
.break-alert.reconnect {
  color: #ffce85;
}
.break-alert.reconnect strong {
  font-size: 30px;
  margin: 12px 0;
}
.game-bottom {
  position: absolute;
  bottom: 24px;
  left: 30px;
  right: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font: 9px var(--mono);
  color: #8ba9bc;
}
.game-bottom > span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.game-bottom > span:nth-child(2) {
  color: #a8c68b;
  text-align: center;
  font-size: 10px;
}
.game-bottom kbd {
  font-size: 9px;
  height: 20px;
}
.rearm-button {
  position: absolute;
  right: 30px;
  bottom: 61px;
  pointer-events: auto;
  border: 0;
  background: #08142399;
  color: #668da7;
  padding: 5px;
  font: 8px var(--mono);
  letter-spacing: 1px;
}
.rearm-button:hover {
  color: var(--mint);
}
.rearm-button kbd {
  margin-right: 6px;
}
.modal-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #040c16ba;
  backdrop-filter: blur(12px);
  padding: 25px;
  animation: scene-entry 0.22s both;
}
.modal-card {
  position: relative;
  width: min(100%, 530px);
  background: linear-gradient(130deg, #142739f0, #0d1927f5);
  border: 1px solid #7497b044;
  border-top: 2px solid #c7ff7377;
  padding: 35px;
  box-shadow: 0 30px 120px #000a;
  max-height: 90vh;
  overflow: auto;
  animation: panel-entry 0.3s both;
}
.modal-card::before {
  content: "";
  position: absolute;
  top: 7px;
  right: 7px;
  width: 4px;
  height: 4px;
  background: var(--mint);
}
.modal-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.close-button {
  width: 28px;
  height: 28px;
  color: #9fbbc9;
  border: 1px solid #425c70;
  background: transparent;
  font-size: 22px;
}
.close-button:hover {
  color: var(--mint);
  border-color: var(--mint);
}
h2 {
  font-size: 33px;
  line-height: 1.12;
  letter-spacing: -1.2px;
  margin: 24px 0 14px;
}
.modal-description {
  color: #a0b8ca;
  font-size: 13px;
  line-height: 1.7;
  margin: 0 0 22px;
}
.button {
  min-height: 45px;
  padding: 12px 19px;
  border: 1px solid #405b70;
  background: #183043;
  color: #c6d8e1;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  transition: background 0.15s;
}
.button-primary {
  background: var(--mint);
  color: #1a260d;
  border-color: var(--mint);
}
.button-primary:hover {
  background: #daff9f;
}
.button-secondary:hover:not(:disabled) {
  background: #24445b;
}
.text-button {
  border: 0;
  background: transparent;
  color: #90adbf;
  font-size: 12px;
  padding: 7px;
}
.text-button:hover {
  color: var(--mint);
}
.step-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 23px;
}
.step-dot {
  width: 24px;
  height: 3px;
  background: #38536a;
}
.step-dot.active {
  background: var(--mint);
}
#step-number {
  margin-left: auto;
  font: 10px var(--mono);
  color: #779aad;
}
.tutorial-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  min-height: 160px;
}
.control-card {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 15px;
  border: 1px solid #4e99ff44;
  background: #4e99ff0a;
  padding: 16px;
}
.pink-control {
  border-color: #ff639f44;
  background: #ff639f0a;
}
.control-card strong {
  font: 9px var(--mono);
  color: #9dbeec;
  letter-spacing: 1px;
}
.pink-control strong {
  color: #dd9ebe;
}
.mini-player {
  width: 23px;
  height: 23px;
  background: var(--blue);
  border: 1px solid #b0d8ff;
  box-shadow: 0 0 22px #4e99ff55;
}
.pink-control .mini-player {
  background: var(--pink);
  border-color: #ffdae8;
}
.key-layout {
  text-align: center;
}
.key-layout > kbd {
  margin-bottom: 5px;
}
.key-layout div {
  display: flex;
  gap: 5px;
}
.key-layout kbd {
  width: 28px;
  height: 27px;
}
.modal-navigation {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 25px;
}
.tutorial-diagram {
  height: 160px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 25px;
}
.diagram-player {
  width: 33px;
  height: 33px;
  z-index: 2;
}
.diagram-blue {
  background: var(--blue);
}
.diagram-pink {
  background: var(--pink);
}
.diagram-beam {
  width: 200px;
  height: 2px;
  background: var(--mint);
  box-shadow: 0 0 16px var(--mint);
}
.diagram-target {
  position: absolute;
  top: 47px;
  color: #ff8473;
  font: 37px var(--mono);
  animation: target-cut 3s infinite;
}
.tutorial-diagram p {
  position: absolute;
  bottom: 6px;
  font: 9px var(--mono);
  letter-spacing: 2px;
  color: #9aafc0;
}
.tutorial-tension {
  height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 17px;
}
.tutorial-tension > span {
  font: 25px var(--mono);
  color: var(--red);
}
.demo-tension {
  height: 5px;
  background: #ff526822;
}
.demo-tension i {
  display: block;
  height: 100%;
  background: var(--red);
  animation: tension-demo 3s infinite;
}
.tutorial-tension strong {
  font: 10px var(--mono);
  color: #e5b8ad;
}
.tutorial-tension p {
  font: 11px var(--mono);
  color: #90adbf;
  margin: 0;
}
.tutorial-tips {
  height: 160px;
  display: flex;
  justify-content: center;
  flex-direction: column;
  gap: 13px;
}
.tutorial-tips p {
  display: flex;
  align-items: center;
  gap: 17px;
  font-size: 13px;
  margin: 0;
  color: #b8cfdd;
}
.tutorial-tips kbd {
  min-width: 45px;
  height: 28px;
}
.pause-card {
  width: min(100%, 350px);
  text-align: center;
}
.pause-card .eyebrow {
  justify-content: center;
  font-size: 8px;
}
.pause-symbol {
  font: 64px var(--mono);
  color: var(--mint);
  display: block;
  margin-top: 22px;
}
.pause-card h2 {
  font-size: 44px;
  margin-top: 6px;
}
.vertical-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pause-footnote {
  font: 8px var(--mono);
  letter-spacing: 2px;
  color: #5c8198;
  display: block;
  margin-top: 22px;
}
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 20px 0;
  background: none;
  border: 0;
  border-top: 1px solid #48627855;
  text-align: left;
  color: #d0e3ed;
  gap: 20px;
  font-size: 13px;
}
.setting-row small {
  display: block;
  color: #728fa5;
  margin-top: 7px;
  font-size: 10px;
}
.setting-row strong {
  color: var(--mint);
  font: 10px var(--mono);
  white-space: nowrap;
}
.setting-row:hover > span {
  color: var(--mint);
}
.settings-card > .button {
  width: 100%;
  margin-top: 12px;
}
.roadmap {
  list-style: none;
  padding: 0;
  margin: 0 0 23px;
}
.roadmap li {
  display: flex;
  align-items: center;
  gap: 17px;
  border-top: 1px solid #314d63;
  padding: 11px 0;
}
.roadmap li > span {
  font: 11px var(--mono);
  color: #64879f;
}
.roadmap strong {
  font-weight: 500;
  font-size: 13px;
  color: #aac4d5;
}
.roadmap small {
  display: block;
  margin-top: 4px;
  color: #728fa5;
  font-size: 10px;
}
.roadmap b {
  margin-left: auto;
  font: 8px var(--mono);
  color: var(--mint);
}
.roadmap .current strong,
.roadmap .current > span {
  color: var(--mint);
}
.about-card > .button {
  width: 100%;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.noscript-note {
  position: absolute;
  z-index: 50;
  inset: 0;
  background: #050910;
  display: grid;
  place-items: center;
  color: var(--mint);
}
.game-viewport:fullscreen {
  width: 100vw;
  height: 100dvh;
}
@keyframes loading-scan {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(350%);
  }
}
@keyframes energy-pulse {
  50% {
    opacity: 0.55;
  }
}
@keyframes floor-drift {
  to {
    background-position: 0 70px;
  }
}
@keyframes dust-drift {
  to {
    background-position:
      12px -144px,
      89px -176px;
  }
}
@keyframes title-entry {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes scene-entry {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes panel-entry {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes orbit-spin {
  to {
    rotate: 360deg;
  }
}
@keyframes signal-travel {
  to {
    left: 100%;
  }
}
@keyframes hover-blue {
  50% {
    transform: translateY(-10px) rotate(-8deg);
  }
}
@keyframes hover-pink {
  50% {
    transform: translateY(10px) rotate(12deg);
  }
}
@keyframes eye-blink {
  48%,
  52% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(0.1);
  }
}
@keyframes target-cut {
  0%,
  50% {
    opacity: 1;
    transform: scale(1);
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}
@keyframes tension-demo {
  0% {
    width: 40%;
  }
  60%,
  100% {
    width: 100%;
  }
}
@media (max-height: 700px) and (min-width: 761px) {
  .menu-screen {
    padding-top: 25px;
    padding-bottom: 20px;
  }
  .game-title {
    font-size: min(9vw, 107px);
  }
  .overline {
    margin-bottom: 15px;
  }
  .tagline {
    margin: 17px 0 18px;
    font-size: 16px;
  }
  .menu-action {
    min-height: 38px;
    padding: 8px 16px;
    font-size: 10px;
  }
  .menu-buttons {
    gap: 3px;
  }
  .modal-card {
    padding: 25px;
  }
  .pause-symbol {
    font-size: 43px;
    margin-top: 12px;
  }
  .pause-card h2 {
    margin: 5px 0 12px;
    font-size: 34px;
  }
  .vertical-buttons {
    gap: 6px;
  }
}
@media (max-width: 1000px) {
  .hero-unit {
    scale: 0.8;
  }
  .hero-blue {
    left: calc(50% - 165px);
  }
  .hero-pink {
    left: calc(50% + 30px);
    top: calc(50% - 115px);
  }
  .hero-readout {
    left: 47%;
  }
  .menu-footer-motto,
  .build-label {
    display: none;
  }
  .menu-topline .eyebrow {
    font-size: 8px;
  }
  .system-controls {
    right: 22px;
    top: 22px;
  }
  .menu-screen {
    padding: 28px 6vw 25px;
  }
  .menu-action {
    font-size: 10px;
    letter-spacing: 1px;
  }
  .mission-hud {
    left: 20px;
  }
  .mission-hud strong {
    font-size: 10px;
  }
  .link-hud {
    width: 29vw;
  }
  .link-heading {
    font-size: 8px;
  }
  .link-instruction {
    font-size: 7px;
  }
  .game-bottom {
    left: 20px;
    right: 20px;
  }
}
@media (max-width: 760px) {
  .menu-content {
    grid-template-columns: 1fr;
  }
  .menu-copy {
    padding: 20px 0;
    max-width: 80%;
  }
  .hero-art {
    position: absolute;
    right: -5%;
    top: 23%;
    width: 57%;
    height: 50%;
    opacity: 0.35;
    z-index: 0;
  }
  .hero-unit {
    scale: 0.55;
  }
  .hero-blue {
    left: calc(50% - 135px);
    top: calc(50% - 8px);
  }
  .hero-pink {
    left: calc(50% + 5px);
    top: calc(50% - 113px);
  }
  .unit-caption,
  .hero-readout,
  .art-cross {
    display: none;
  }
  .game-title {
    font-size: clamp(65px, 16vw, 105px);
  }
  .tagline {
    font-size: 14px;
    margin: 22px 0;
  }
  .overline {
    font-size: 8px;
    letter-spacing: 2px;
  }
  .menu-buttons {
    max-width: 290px;
  }
  .menu-action {
    min-height: 43px;
  }
  .menu-footer {
    font-size: 7px;
    letter-spacing: 0.8px;
  }
  .keyboard-note {
    display: none;
  }
  .mission-hud {
    top: 75px;
    left: 14px;
  }
  .link-hud {
    top: 22px;
    left: 14px;
    transform: none;
    width: 48%;
  }
  .system-controls {
    right: 14px;
    top: 18px;
    gap: 5px;
  }
  .icon-button {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }
  .session-hud {
    right: 14px;
    top: 70px;
  }
  .game-bottom {
    left: 12px;
    right: 12px;
    bottom: 14px;
    font-size: 7px;
  }
  .game-bottom > span:nth-child(2) {
    font-size: 8px;
    max-width: 40%;
  }
  .game-bottom kbd {
    display: none;
  }
  .rearm-button {
    right: 14px;
    bottom: 48px;
    font-size: 7px;
  }
  .modal-screen {
    padding: 16px;
  }
  .modal-card {
    padding: 24px;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 1.3px;
  }
  h2 {
    font-size: 27px;
  }
  .modal-description {
    font-size: 12px;
  }
  .tutorial-controls {
    gap: 9px;
  }
  .control-card {
    padding: 12px 8px;
  }
  .control-card strong {
    font-size: 8px;
    letter-spacing: 0.5px;
  }
  .modal-navigation .button {
    padding: 11px 14px;
    font-size: 11px;
    gap: 8px;
  }
  .boot-footer {
    font-size: 6px;
    letter-spacing: 1.5px;
  }
  .deploy-count {
    font-size: 110px;
  }
  .pilot-ready {
    gap: 15px;
    font-size: 9px;
  }
  .deploy-tip {
    font-size: 9px;
  }
  .deploy-crosshair {
    width: 270px;
    height: 270px;
  }
}
@media (max-height: 500px) {
  .menu-screen {
    padding: 19px 6vw 14px;
  }
  .menu-content {
    grid-template-columns: 1fr 1fr;
  }
  .menu-copy {
    padding: 8px 0;
  }
  .game-title {
    font-size: 65px;
  }
  .overline {
    margin: 0 0 12px;
    font-size: 7px;
  }
  .tagline {
    font-size: 12px;
    margin: 12px 0;
  }
  .menu-action {
    min-height: 29px;
    padding: 5px 10px;
    font-size: 8px;
    letter-spacing: 1px;
  }
  .menu-buttons {
    gap: 2px;
    max-width: 260px;
  }
  .menu-action-index {
    font-size: 7px;
  }
  .hero-art {
    height: 250px;
    top: auto;
    right: auto;
    position: relative;
    width: 100%;
    opacity: 1;
  }
  .hero-unit {
    scale: 0.55;
  }
  .hero-readout {
    display: none;
  }
  .hero-blue {
    left: calc(50% - 135px);
    top: calc(50% - 20px);
  }
  .hero-pink {
    left: calc(50% + 15px);
    top: calc(50% - 105px);
  }
  .unit-caption {
    display: none;
  }
  .menu-footer {
    font-size: 6px;
  }
  .system-controls {
    top: 13px;
  }
  .modal-card {
    padding: 18px;
    max-height: 94vh;
  }
  h2 {
    font-size: 24px;
    margin: 15px 0 10px;
  }
  .modal-description {
    font-size: 11px;
    margin-bottom: 12px;
  }
  .step-indicator {
    margin-top: 12px;
  }
  .tutorial-controls,
  .tutorial-diagram,
  .tutorial-tension,
  .tutorial-tips {
    min-height: 110px;
    height: 110px;
  }
  .control-card {
    gap: 6px;
    padding: 9px;
  }
  .mini-player {
    width: 16px;
    height: 16px;
  }
  .key-layout kbd {
    width: 22px;
    height: 21px;
    font-size: 9px;
  }
  .modal-navigation {
    margin-top: 15px;
  }
  .modal-navigation .button {
    min-height: 35px;
    padding: 8px 13px;
  }
  .diagram-target {
    top: 21px;
  }
  .tutorial-tension {
    gap: 9px;
  }
  .tutorial-tension > span {
    font-size: 20px;
  }
  .tutorial-tension strong {
    font-size: 8px;
  }
  .pause-symbol {
    font-size: 30px;
    margin-top: 8px;
  }
  .pause-card h2 {
    font-size: 28px;
    margin-top: 3px;
  }
  .vertical-buttons {
    gap: 5px;
  }
  .vertical-buttons .button {
    min-height: 33px;
    padding: 8px 12px;
  }
  .vertical-buttons .text-button {
    padding: 3px;
    font-size: 10px;
  }
  .pause-footnote {
    margin-top: 10px;
    font-size: 7px;
  }
  .roadmap li {
    padding: 6px 0;
  }
  .roadmap strong {
    font-size: 11px;
  }
  .roadmap small {
    font-size: 9px;
  }
  .setting-row {
    padding: 12px 0;
  }
  .boot-emblem {
    height: 45px;
    margin-bottom: 15px;
  }
  .boot-title {
    margin-bottom: 18px;
  }
  .deploy-count {
    font-size: 85px;
  }
  .deploy-tip {
    margin-top: 25px;
  }
}
body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  animation: none !important;
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  body:not(.full-motion) *,
  body:not(.full-motion) *::before,
  body:not(.full-motion) *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Legibilidad del HUD y composición para ventanas de poca altura. */
.screen-grain {
  opacity: 0.055;
}
body[data-screen="playing"] canvas:focus-visible {
  outline: none;
}
.menu-action {
  font-size: 12px;
}
.link-heading {
  font-size: 11px;
}
.link-instruction {
  font-size: 10px;
}
.mission-hud strong {
  font-size: 13px;
}
.mission-hud > span:last-child {
  font-size: 11px;
}
.game-bottom > span:nth-child(2) {
  font-size: 12px;
}
@media (max-width: 1000px) {
  .menu-action {
    font-size: 10px;
  }
  .link-heading {
    font-size: 9px;
  }
  .link-instruction {
    font-size: 8px;
  }
}
@media (max-width: 760px) {
  .link-heading {
    font-size: 8px;
  }
  .link-instruction {
    font-size: 7px;
  }
  .mission-hud strong {
    font-size: 10px;
  }
  .game-bottom > span:nth-child(2) {
    font-size: 8px;
  }
}
@media (max-height: 500px) {
  .menu-copy {
    padding: 0;
  }
  .game-title {
    font-size: 58px;
  }
  .overline {
    margin-bottom: 9px;
  }
  .tagline {
    font-size: 11px;
    margin: 9px 0;
  }
  .menu-action {
    min-height: 25px;
    padding: 3px 10px;
    font-size: 8px;
  }
}
@media (max-height: 350px) {
  .game-title {
    font-size: 48px;
  }
  .menu-topline,
  .menu-footer {
    display: none;
  }
  .menu-action {
    min-height: 22px;
  }
}

/* Fase 3: supervivencia, energía de ambos pilotos y resultados. */
.score-hud {
  position: absolute;
  left: 30px;
  top: 116px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 130px;
}
.score-hud > span {
  font: 8px var(--mono);
  letter-spacing: 2px;
  color: #6d91a9;
}
.score-hud strong {
  font: 30px/1.15 var(--mono);
  letter-spacing: -1px;
  color: #e4f8d1;
  text-shadow: 0 0 25px #c7ff7322;
}
.score-hud small {
  font: 8px var(--mono);
  color: var(--mint);
  letter-spacing: 0.8px;
  max-width: 165px;
}
.vitals {
  position: absolute;
  inset: auto 30px 68px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  pointer-events: none;
}
.vital-card {
  width: 165px;
  color: var(--blue);
  padding: 10px 12px;
  background: #081523b3;
  border-left: 2px solid currentColor;
}
.flux-vital {
  color: var(--pink);
  border-left: 0;
  border-right: 2px solid currentColor;
}
.vital-card > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.vital-card strong {
  font: 10px var(--mono);
  letter-spacing: 2px;
}
.vital-card span {
  font: 9px var(--mono);
  color: #99b0c2;
}
.health-track {
  background: #70839733;
  height: 5px;
}
.health-track i {
  display: block;
  background: currentColor;
  width: 100%;
  height: 100%;
  box-shadow: 0 0 10px currentColor;
  transition: width 0.15s;
}
.vital-card.critical {
  color: var(--red);
}
.vital-card.immune {
  border-color: #efffdc;
}
.wave-banner {
  position: absolute;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 13px 25px;
  border-top: 1px solid #ff8c7355;
  background: linear-gradient(90deg, #08132200, #081322b0, #08132200);
  min-width: 280px;
}
.wave-banner strong {
  font: 20px var(--mono);
  letter-spacing: 5px;
  color: #ffad93;
}
.wave-banner span {
  font: 8px var(--mono);
  color: #9facbc;
  letter-spacing: 1px;
}
.wave-banner.rest {
  border-color: #c7ff7355;
}
.wave-banner.rest strong {
  color: var(--mint);
  font-size: 15px;
  letter-spacing: 3px;
}
.gameover-screen {
  background: radial-gradient(ellipse at center, #36233977, #050a14ed);
}
.result-card {
  width: min(100%, 560px);
  text-align: center;
  border-top-color: #ff639f88;
  padding: 30px 38px;
}
.result-card > .eyebrow {
  justify-content: center;
  font-size: 8px;
}
.result-emblem {
  display: block;
  font: 65px/1 var(--mono);
  color: var(--pink);
  margin: 15px 0 5px;
  text-shadow: 0 0 45px #ff639f44;
}
.result-card h2 {
  font-size: 35px;
  margin: 10px 0 12px;
}
.result-reason {
  color: #af8099;
  font: 9px var(--mono);
  letter-spacing: 2px;
  margin-bottom: 24px;
}
.result-score-label {
  display: block;
  color: #90a8bb;
  font: 8px var(--mono);
  letter-spacing: 3px;
}
.result-score {
  display: block;
  font: 60px/1.4 var(--mono);
  color: var(--mint);
  letter-spacing: -3px;
}
.result-record {
  display: block;
  color: #93b96b;
  font: 8px var(--mono);
  letter-spacing: 1.5px;
  margin-bottom: 23px;
}
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-block: 1px solid #3f536a66;
  padding: 19px 0;
  gap: 10px;
}
.result-stats div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.result-stats strong {
  font: 22px var(--mono);
  color: #c6d8e6;
}
.result-stats span {
  font: 7px var(--mono);
  color: #6d91ab;
  letter-spacing: 0.7px;
}
.result-tip {
  font-size: 12px;
  line-height: 1.6;
  color: #8ca8be;
  margin: 22px 0;
}
.result-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.result-actions .button {
  justify-content: center;
  font: 11px var(--mono);
  letter-spacing: 1px;
}
.menu-buttons {
  gap: 4px;
}
.menu-action {
  min-height: 42px;
}
@media (max-width: 1000px) {
  .score-hud {
    left: 20px;
    top: 108px;
  }
  .vitals {
    left: 20px;
    right: 20px;
    bottom: 70px;
  }
  .vital-card {
    width: 145px;
  }
}
@media (max-width: 760px) {
  .score-hud {
    left: 14px;
    top: 126px;
  }
  .score-hud strong {
    font-size: 22px;
  }
  .score-hud > span {
    font-size: 7px;
  }
  .score-hud small {
    font-size: 6px;
    max-width: 110px;
  }
  .vitals {
    left: 12px;
    right: 12px;
    bottom: 49px;
  }
  .vital-card {
    width: 120px;
    padding: 8px;
  }
  .vital-card strong {
    font-size: 8px;
  }
  .vital-card span {
    font-size: 7px;
  }
  .wave-banner {
    top: 185px;
    min-width: 0;
    width: 62%;
    padding: 10px;
  }
  .wave-banner strong {
    font-size: 16px;
    letter-spacing: 2px;
  }
  .wave-banner span {
    font-size: 7px;
    line-height: 1.5;
  }
  .result-card {
    padding: 24px;
  }
  .result-card h2 {
    font-size: 28px;
  }
  .result-score {
    font-size: 50px;
  }
  .result-stats strong {
    font-size: 18px;
  }
  .result-stats span {
    font-size: 6px;
  }
}
@media (max-height: 500px) {
  .menu-action {
    min-height: 22px;
    padding: 2px 10px;
    font-size: 8px;
  }
  .menu-buttons {
    gap: 2px;
  }
  .score-hud {
    top: 100px;
  }
  .score-hud strong {
    font-size: 23px;
  }
  .vitals {
    bottom: 42px;
  }
  .vital-card {
    padding: 6px 9px;
    width: 125px;
  }
  .vital-card > div:first-child {
    margin-bottom: 5px;
  }
  .wave-banner {
    top: 94px;
    width: auto;
    min-width: 260px;
    padding: 8px 15px;
  }
  .wave-banner strong {
    font-size: 13px;
  }
  .result-card {
    padding: 18px 24px;
  }
  .result-emblem {
    display: none;
  }
  .result-card h2 {
    font-size: 25px;
    margin: 10px 0;
  }
  .result-reason {
    margin-bottom: 12px;
    font-size: 7px;
  }
  .result-score {
    font-size: 40px;
    line-height: 1.2;
  }
  .result-record {
    margin: 8px 0 12px;
  }
  .result-stats {
    padding: 10px 0;
  }
  .result-stats strong {
    font-size: 17px;
  }
  .result-tip {
    margin: 11px 0;
    font-size: 10px;
  }
  .result-actions .button {
    min-height: 32px;
    padding: 8px 12px;
    font-size: 9px;
  }
  .result-card .pause-footnote {
    margin-top: 12px;
  }
}

/* Fase 4: buffer nativo, arena libre de interferencias y HUD legible. */
#game {
  inset: 110px 24px 144px;
}
body[data-screen="playing"] .screen-grain,
body[data-screen="paused"] .screen-grain {
  display: none;
}
body[data-screen="playing"] .vignette,
body[data-screen="paused"] .vignette {
  box-shadow: inset 0 0 60px 8px #02060a55;
}
.hud-topbar {
  position: absolute;
  top: 14px;
  left: 24px;
  right: 164px;
  min-height: 80px;
  display: grid;
  grid-template-columns: 130px 150px minmax(240px, 1fr) 120px;
  gap: 20px;
  align-items: center;
  padding: 14px 20px;
  background: #081321ec;
  border: 1px solid #4d6b7e66;
  border-bottom: 2px solid #70879d44;
  border-radius: 6px;
}
.hud-topbar .mission-hud,
.hud-topbar .score-hud,
.hud-topbar .link-hud,
.hud-topbar .session-hud {
  position: static;
  inset: auto;
  transform: none;
  min-width: 0;
  width: auto;
}
.hud-topbar .mission-hud {
  gap: 6px;
}
.hud-topbar .mission-hud .eyebrow {
  font-size: 10px;
  letter-spacing: 1px;
}
.hud-topbar .mission-hud strong {
  font-size: 17px;
  letter-spacing: 1px;
}
.hud-topbar .mission-hud > span:last-child {
  font-size: 13px;
}
.hud-topbar .score-hud {
  gap: 3px;
}
.hud-topbar .score-hud > span {
  font-size: 10px;
}
.hud-topbar .score-hud strong {
  font-size: 29px;
}
.hud-topbar .score-hud small {
  font-size: 9px;
  max-width: none;
}
.hud-topbar .link-hud {
  max-width: 440px;
  justify-self: center;
  width: 100%;
}
.hud-topbar .link-heading {
  font-size: 13px;
  letter-spacing: 0.6px;
}
.hud-topbar .tension-track {
  height: 8px;
  margin: 10px 0 8px;
}
.hud-topbar .tension-track > b {
  height: 12px;
}
.hud-topbar .link-instruction {
  font-size: 11px;
  color: #b0c5d3;
  letter-spacing: 0;
}
.hud-topbar .session-hud {
  justify-content: flex-end;
  gap: 12px;
}
.hud-topbar .session-hud > span {
  font-size: 16px;
  color: #b4cbd8;
}
.hud-topbar .session-hud button {
  width: 36px;
  height: 36px;
  font-size: 21px;
}
.system-controls {
  top: 32px;
  right: 24px;
}
.system-controls .icon-button {
  width: 34px;
  height: 34px;
}
.vital-console {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 38px;
  width: min(760px, calc(100% - 40px));
  padding: 12px 18px 16px;
  background: #071220f5;
  border: 1px solid #4d6b7e77;
  border-radius: 7px;
  box-shadow: 0 8px 30px #0005;
}
.connection-info {
  display: block;
  text-align: center;
  color: #a2b7c8;
  font: 11px var(--mono);
  letter-spacing: 1.8px;
  margin-bottom: 12px;
}
.vitals {
  position: static;
  inset: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}
.vital-card {
  width: auto;
  padding: 0 0 0 12px;
  background: none;
  border-left: 4px solid currentColor;
}
.flux-vital {
  border-left: 0;
  border-right: 4px solid currentColor;
  padding: 0 12px 0 0;
}
.vital-card > div:first-child {
  margin-bottom: 9px;
}
.vital-card strong {
  font: bold 17px var(--mono);
  letter-spacing: 2px;
}
.vital-card span {
  font: bold 17px var(--mono);
  color: #f0f7fb;
}
.health-track {
  height: 12px;
  background: #4e637655;
  border-radius: 2px;
  overflow: hidden;
}
.health-track i {
  box-shadow: none;
}
.vital-card.critical span {
  color: #ff889b;
}
body[data-connection="host"] .ion-vital strong::after,
body[data-connection="guest"] .flux-vital strong::after {
  content: " / TÚ";
  font-size: 11px;
  letter-spacing: 1px;
  color: #def2c7;
}
.game-bottom {
  bottom: 10px;
  left: 24px;
  right: 24px;
  font-size: 11px;
}
.game-bottom > span:nth-child(2) {
  font-size: 12px;
  color: #cee7b1;
}
.rearm-button {
  bottom: 158px;
  right: 30px;
  font-size: 10px;
}
.wave-banner {
  top: 130px;
}
.wave-banner strong {
  font-size: 20px;
}
.wave-banner span {
  font-size: 10px;
}
.break-alert {
  top: 35%;
}
.lobby-card {
  width: min(100%, 600px);
}
.room-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.room-controls > .button {
  min-height: 48px;
}
.room-divider {
  text-align: center;
  color: #728fa3;
  font: 9px var(--mono);
  letter-spacing: 1.5px;
  margin: 5px 0;
}
.room-controls label,
.room-label {
  color: #9ab3c5;
  font: 10px var(--mono);
  letter-spacing: 1.5px;
}
.room-join {
  display: flex;
  gap: 10px;
}
.room-join input,
.room-copy-fallback {
  min-width: 0;
  flex: 1;
  background: #071322;
  border: 1px solid #4e6d86;
  border-radius: 3px;
  color: #e4f0f8;
  font: 20px var(--mono);
  letter-spacing: 3px;
  padding: 12px;
  text-transform: uppercase;
  width: 100%;
}
input:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}
.room-join .button {
  white-space: nowrap;
}
.room-details > .room-label {
  display: block;
  text-align: center;
}
.room-code-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 16px 0 22px;
}
.room-code-row strong {
  font: 32px var(--mono);
  letter-spacing: 5px;
  color: var(--mint);
}
.room-code-row .button {
  padding: 10px 13px;
  min-height: 38px;
  font-size: 10px;
}
.lobby-pilots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 18px 0;
}
.lobby-pilots > b {
  color: var(--mint);
  font: 32px var(--mono);
}
.lobby-seat {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 11px;
  width: 42%;
  padding: 18px 8px;
  background: #112232;
  border: 1px solid #4b607766;
}
.lobby-seat > .blue-square,
.lobby-seat > .pink-square {
  width: 24px;
  height: 24px;
}
.lobby-seat strong {
  font: 16px var(--mono);
  letter-spacing: 3px;
}
.lobby-seat span {
  font: 9px var(--mono);
  color: #89a4b9;
}
.lobby-seat.connected {
  border-color: #c7ff7377;
}
#room-start {
  width: 100%;
  justify-content: center;
}
.lobby-status {
  font: 12px/1.6 var(--mono);
  color: #afc999;
  margin: 20px 0 12px;
  min-height: 38px;
}
.lobby-status.error {
  color: #ff9bac;
}
.guest-wait {
  color: #c4d8e5;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}
.lobby-card > .text-button {
  display: block;
  margin: auto;
}
.disconnect-card > .button {
  width: 100%;
}
.menu-action {
  min-height: 38px;
}
@media (max-width: 1100px) {
  #game {
    inset: 134px 16px 144px;
  }
  .hud-topbar {
    left: 16px;
    right: 154px;
    grid-template-columns: 110px minmax(200px, 1fr) 110px;
    grid-template-rows: auto auto;
    gap: 7px 14px;
    padding: 13px 15px;
  }
  .hud-topbar .mission-hud {
    grid-column: 1;
    grid-row: 1;
  }
  .hud-topbar .score-hud {
    grid-column: 1;
    grid-row: 2;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .hud-topbar .score-hud > span {
    font-size: 8px;
    letter-spacing: 0.4px;
  }
  .hud-topbar .score-hud strong {
    font-size: 20px;
  }
  .hud-topbar .score-hud small {
    display: none;
  }
  .hud-topbar .link-hud {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
  .hud-topbar .session-hud {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
  .hud-topbar .mission-hud strong {
    font-size: 15px;
  }
  .hud-topbar .mission-hud .eyebrow {
    font-size: 9px;
  }
  .hud-topbar .link-heading {
    font-size: 11px;
  }
  .hud-topbar .link-instruction {
    font-size: 10px;
  }
  .wave-banner {
    top: 151px;
  }
}
@media (max-width: 760px) {
  #game {
    inset: 150px 12px 145px;
  }
  .hud-topbar {
    top: 12px;
    left: 12px;
    right: 126px;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px;
  }
  .hud-topbar .mission-hud {
    grid-column: 1;
    grid-row: 1;
  }
  .hud-topbar .score-hud {
    grid-column: 2;
    grid-row: 1;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
  }
  .hud-topbar .link-hud {
    grid-column: 1 / span 2;
    grid-row: 2;
  }
  .hud-topbar .session-hud {
    position: absolute;
    top: 56px;
    right: -112px;
    gap: 6px;
  }
  .hud-topbar .session-hud > span {
    font-size: 13px;
  }
  .hud-topbar .session-hud button {
    width: 30px;
    height: 30px;
  }
  .hud-topbar .link-heading {
    font-size: 10px;
    gap: 4px;
    letter-spacing: 0;
  }
  .hud-topbar .link-instruction {
    font-size: 9px;
    line-height: 1.4;
  }
  .hud-topbar .mission-hud strong {
    font-size: 13px;
  }
  .hud-topbar .mission-hud > span:last-child {
    font-size: 11px;
  }
  .system-controls {
    top: 16px;
    right: 12px;
    gap: 5px;
  }
  .system-controls .icon-button {
    width: 28px;
    height: 28px;
  }
  .vital-console {
    bottom: 46px;
    width: calc(100% - 24px);
    padding: 12px;
  }
  .connection-info {
    font-size: 9px;
    letter-spacing: 0.8px;
  }
  .vitals {
    gap: 15px;
  }
  .vital-card strong,
  .vital-card span {
    font-size: 14px;
    letter-spacing: 0.5px;
  }
  .vital-card {
    padding-left: 9px;
  }
  .flux-vital {
    padding-left: 0;
    padding-right: 9px;
  }
  .health-track {
    height: 11px;
  }
  .game-bottom {
    left: 12px;
    right: 12px;
    bottom: 12px;
    font-size: 9px;
  }
  .game-bottom > span:nth-child(2) {
    font-size: 10px;
    max-width: 48%;
    line-height: 1.4;
  }
  .wave-banner {
    top: 165px;
    width: 65%;
  }
  .wave-banner strong {
    font-size: 16px;
  }
  .wave-banner span {
    font-size: 8px;
  }
  .room-join {
    flex-direction: column;
  }
  .room-code-row {
    gap: 10px;
  }
  .room-code-row strong {
    font-size: 25px;
    letter-spacing: 3px;
  }
  .lobby-seat span {
    font-size: 8px;
    text-align: center;
  }
}
@media (max-height: 500px) {
  #game {
    inset: 96px 12px 98px;
  }
  .hud-topbar {
    top: 8px;
    padding: 8px 12px;
    gap: 5px 12px;
    min-height: 0;
  }
  .hud-topbar .mission-hud strong {
    font-size: 12px;
  }
  .hud-topbar .mission-hud .eyebrow {
    font-size: 8px;
  }
  .hud-topbar .mission-hud > span:last-child {
    font-size: 10px;
  }
  .hud-topbar .score-hud strong {
    font-size: 19px;
  }
  .hud-topbar .link-heading {
    font-size: 10px;
  }
  .hud-topbar .tension-track {
    height: 6px;
    margin: 7px 0;
  }
  .hud-topbar .link-instruction {
    font-size: 9px;
  }
  .system-controls {
    top: 22px;
  }
  .vital-console {
    bottom: 28px;
    padding: 8px 14px;
    width: min(650px, calc(100% - 32px));
  }
  .connection-info {
    font-size: 8px;
    margin-bottom: 8px;
  }
  .vital-card strong,
  .vital-card span {
    font-size: 13px;
  }
  .vital-card > div:first-child {
    margin-bottom: 6px;
  }
  .health-track {
    height: 9px;
  }
  .game-bottom {
    bottom: 5px;
    font-size: 9px;
  }
  .game-bottom > span:nth-child(2) {
    font-size: 10px;
  }
  .wave-banner {
    top: 101px;
    padding: 7px 15px;
  }
  .wave-banner strong {
    font-size: 12px;
  }
  .wave-banner span {
    font-size: 8px;
  }
  .rearm-button {
    bottom: 106px;
    font-size: 8px;
  }
  .menu-action {
    min-height: 19px;
    padding: 1px 10px;
    font-size: 8px;
  }
  .menu-copy .game-title {
    font-size: 52px;
  }
  .menu-copy .tagline {
    margin: 7px 0;
    font-size: 10px;
  }
  .room-controls {
    gap: 8px;
  }
  .room-controls > .button {
    min-height: 36px;
  }
  .lobby-status {
    font-size: 10px;
    min-height: 0;
    margin: 13px 0 8px;
  }
  .room-code-row {
    margin: 10px 0;
  }
  .lobby-pilots {
    margin: 12px 0;
  }
  .lobby-seat {
    padding: 12px 8px;
    gap: 8px;
  }
}

/* Fase 5: arte original, más superficie de juego y ventanas con profundidad. */
#game {
  inset: 92px 20px 112px;
}
#game canvas {
  border: 1px solid #6d93ab55;
  border-radius: 10px;
  box-shadow:
    0 18px 80px #0008,
    0 0 25px #4e99ff0d;
}
.hud-topbar {
  top: 12px;
  min-height: 66px;
  padding: 10px 18px;
  border-radius: 12px;
  gap: 18px;
}
.hud-topbar .mission-hud .eyebrow {
  display: none;
}
.hud-topbar .link-instruction:empty {
  display: none;
}
.hud-topbar .tension-track {
  margin: 8px 0 3px;
}
.hud-topbar .score-hud small {
  color: #bdd7a6;
}
.hud-topbar .score-hud small:empty {
  display: none;
}
.system-controls {
  top: 28px;
}
.vital-console {
  bottom: 30px;
  padding: 11px 18px 12px;
  border-radius: 12px;
  width: min(740px, calc(100% - 40px));
}
.connection-info {
  margin-bottom: 7px;
  font-size: 10px;
  letter-spacing: 1px;
}
.vital-card > div:first-child {
  margin-bottom: 7px;
}
.health-track {
  border-radius: 6px;
}
.health-track i {
  transition: width 0.22s ease-out;
}
.game-bottom {
  bottom: 6px;
  opacity: 0.85;
}
.wave-banner {
  top: 110px;
  border-radius: 8px;
  backdrop-filter: blur(12px);
}
.boot-loader i {
  animation: none;
  transition: width 0.25s ease;
  width: 0;
}
.menu-atmosphere {
  background-position: center;
  background-size: cover;
}
.menu-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #030a13f7 10%, #061322c7 48%, #060e1975),
    linear-gradient(0deg, #030a13ee, transparent 55%, #030a1399);
}
.menu-atmosphere .horizon-grid {
  opacity: 0.18;
}
.menu-atmosphere .dust {
  z-index: 1;
}
.hero-unit > :not(.pilot-portrait):not(.unit-caption) {
  display: none;
}
.hero-unit {
  width: 205px;
  height: 268px;
  filter: drop-shadow(0 18px 12px #0007);
}
.hero-blue {
  left: calc(50% - 260px);
  top: calc(50% - 80px);
}
.hero-pink {
  left: calc(50% + 40px);
  top: calc(50% - 245px);
}
.pilot-portrait {
  width: 100%;
  height: 100%;
  overflow: hidden;
  filter: drop-shadow(0 0 15px #4e99ff22);
}
.hero-pink .pilot-portrait {
  filter: drop-shadow(0 0 15px #ff639f22);
}
.unit-caption {
  top: 290px;
  left: 30px;
}
.unit-caption small {
  display: none;
}
.hero-link {
  top: 48%;
  width: 62%;
  transform: translate(-50%, -50%) rotate(-29deg);
}
.hero-readout {
  bottom: 8%;
}
.tutorial-pilot {
  width: 50px;
  height: 64px;
  display: block;
  margin: 0 auto 12px;
}
.modal-screen {
  background: radial-gradient(ellipse at 50% 40%, #13263a85, #020810db);
  backdrop-filter: blur(16px) saturate(0.6);
  animation: veil-in 0.22s ease-out both;
}
.modal-card {
  border-radius: 18px;
  border: 1px solid #6d93ab55;
  border-top: 1px solid #c7ff7380;
  background:
    radial-gradient(ellipse at 0 0, #24466055, transparent 55%),
    linear-gradient(135deg, #101f30f8, #091422fc);
  box-shadow:
    0 25px 100px #000a,
    0 0 60px #4e99ff0d;
  animation: panel-arrive 0.36s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.modal-card::before {
  width: 60px;
  height: 2px;
  top: -1px;
  left: 35px;
  right: auto;
  background: var(--mint);
  box-shadow: 0 0 14px #c7ff7380;
}
.button {
  border-radius: 8px;
  transition:
    transform 0.15s,
    background 0.15s,
    box-shadow 0.15s;
}
.button:hover {
  transform: translateY(-2px);
}
.button:active {
  transform: translateY(1px) scale(0.99);
}
.button-primary:hover {
  box-shadow: 0 4px 22px #c7ff7322;
}
.icon-button,
.close-button {
  border-radius: 8px;
}
.setting-row {
  border-radius: 10px;
}
.modal-description {
  line-height: 1.6;
}
.game-credits {
  margin: 24px 0;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #7898ac22;
  background: #030b1466;
}
.game-credits > span {
  font: 11px var(--mono);
  color: var(--mint);
  letter-spacing: 2px;
}
.game-credits p {
  font-size: 15px;
  margin: 12px 0;
  color: #bfd3e0;
}
.game-credits small {
  font-size: 11px;
  color: #849faf;
  line-height: 1.7;
}
body[data-screen="deploy"] #game {
  filter: blur(3px);
}
body[data-screen="playing"] #game {
  animation: arena-reveal 0.45s ease-out;
}
@keyframes veil-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes panel-arrive {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes arena-reveal {
  from {
    opacity: 0.55;
    filter: brightness(1.8);
  }
  to {
    opacity: 1;
    filter: brightness(1);
  }
}
@media (max-width: 1100px) and (min-height: 501px) {
  #game {
    inset: 122px 16px 114px;
  }
  .hud-topbar {
    min-height: 94px;
  }
  .hero-unit {
    width: 155px;
    height: 200px;
  }
  .hero-blue {
    left: calc(50% - 195px);
    top: calc(50% - 30px);
  }
  .hero-pink {
    left: calc(50% + 20px);
    top: calc(50% - 165px);
  }
  .unit-caption {
    top: 218px;
    left: 10px;
  }
}
@media (max-width: 760px) and (min-height: 501px) {
  #game {
    inset: 138px 10px 112px;
  }
  .hud-topbar {
    padding: 12px;
    top: 10px;
    min-height: 112px;
  }
  .system-controls {
    top: 14px;
  }
  .vital-console {
    padding: 10px 12px;
    bottom: 31px;
  }
  .connection-info {
    margin-bottom: 8px;
  }
  .hero-unit {
    width: 130px;
    height: 170px;
  }
  .hero-blue {
    left: calc(50% - 142px);
    top: calc(50% - 50px);
  }
  .hero-pink {
    left: calc(50% + 12px);
    top: calc(50% - 155px);
  }
  .unit-caption {
    top: 178px;
  }
  .wave-banner {
    top: 149px;
  }
}
@media (max-height: 500px) {
  #game {
    inset: 90px 12px 92px;
  }
  .hud-topbar {
    min-height: 64px;
    padding: 9px 12px;
    top: 10px;
  }
  .vital-console {
    bottom: 26px;
    padding: 8px 12px;
  }
  .connection-info {
    margin-bottom: 5px;
  }
  .hero-unit {
    width: 115px;
    height: 150px;
  }
  .hero-blue {
    left: calc(50% - 140px);
    top: calc(50% - 25px);
  }
  .hero-pink {
    left: calc(50% + 10px);
    top: calc(50% - 135px);
  }
  .unit-caption {
    top: 157px;
  }
  .wave-banner {
    top: 100px;
  }
  .modal-card {
    padding: 22px;
  }
}
.reduced-motion .modal-screen,
.reduced-motion .modal-card,
.reduced-motion #game {
  animation: none !important;
}
.reduced-motion .button,
.reduced-motion .health-track i {
  transition: none;
}
.reduced-motion .button:hover,
.reduced-motion .button:active {
  transform: none;
}

/* Expedición: decisiones breves, colección y señales de peligro. */
.upgrade-card {
  width: min(900px, 100%);
}
.upgrade-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 25px 0;
}
.upgrade-option {
  position: relative;
  min-height: 225px;
  padding: 23px 18px;
  text-align: left;
  color: #e9f3fa;
  background: linear-gradient(145deg, #1d364c, #0a1726);
  border: 1px solid #54748988;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition:
    transform 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}
.upgrade-option:hover,
.upgrade-option:focus-visible {
  transform: translateY(-4px);
  border-color: var(--mint);
  box-shadow: 0 8px 28px #c7ff7316;
}
.upgrade-glyph {
  color: var(--mint);
  font-size: 35px;
  line-height: 1;
}
.upgrade-option strong {
  font-size: 18px;
}
.upgrade-option small {
  color: #b5cad9;
  font-size: 13px;
  line-height: 1.6;
}
.upgrade-option kbd {
  position: absolute;
  right: 14px;
  top: 16px;
}
.upgrade-votes {
  display: flex;
  gap: 7px;
  margin-top: auto;
}
.upgrade-votes i {
  font: 10px var(--mono);
  font-style: normal;
  color: #668295;
  border: 1px solid #40617566;
  border-radius: 5px;
  padding: 5px 7px;
}
.upgrade-votes .vote-ion.active {
  color: #98cbff;
  border-color: #4e99ff;
  background: #4e99ff22;
}
.upgrade-votes .vote-flux.active {
  color: #ffaccf;
  border-color: #ff639f;
  background: #ff639f22;
}
.workshop-card {
  width: min(850px, 100%);
}
.workshop-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 28px;
  margin: 22px 0 15px;
}
.workshop-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 16px;
  background: radial-gradient(ellipse at center, #27485f66, #050e1944);
  padding: 16px;
}
.pilot-selector,
.custom-tabs {
  display: flex;
  gap: 6px;
}
.pilot-selector button,
.custom-tabs button {
  background: #102539;
  color: #acc3d3;
  border: 1px solid #55758955;
  border-radius: 7px;
  padding: 9px 13px;
  font: 12px var(--mono);
}
.pilot-selector button[aria-pressed="true"],
.custom-tabs button[aria-pressed="true"] {
  color: var(--mint);
  border-color: #c7ff7377;
  background: #c7ff7311;
}
.workshop-avatar {
  width: 185px;
  height: 250px;
  position: relative;
  margin: 20px 0 8px;
}
.workshop-avatar svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 18px 10px #0008);
  animation: pilot-float 4s ease-in-out infinite;
}
.workshop-beam {
  position: absolute;
  left: -20px;
  right: -20px;
  bottom: 0;
  height: 2px;
  background: #c7ff73;
  box-shadow: 0 0 20px currentColor;
  opacity: 0.7;
}
.preview-accessory {
  position: absolute;
  left: 50%;
  top: 8px;
  display: none;
}
.workshop-avatar[data-accessory="ring"] .preview-accessory {
  display: block;
  width: 80px;
  height: 18px;
  border: 2px solid #c7ff73;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 20px #c7ff7333;
}
.workshop-avatar[data-accessory="satellite"] .preview-accessory {
  display: block;
  top: 55%;
  left: 95%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #bdefff;
  box-shadow: 0 0 15px #80dfff;
}
.workshop-avatar[data-accessory="crown"] .preview-accessory {
  display: block;
  top: -5px;
  transform: translateX(-50%);
  width: 80px;
  height: 34px;
  background: #ffdb82;
  clip-path: polygon(0 0, 25% 35%, 50% 0, 75% 35%, 100% 0, 87% 100%, 13% 100%);
}
.workshop-display > strong {
  color: #dfedfa;
  font: 18px var(--mono);
  letter-spacing: 3px;
}
.workshop-summary {
  font: 10px var(--mono);
  color: #93adbf;
  margin-top: 13px;
  text-align: center;
  line-height: 1.8;
}
.cosmetic-list {
  display: grid;
  gap: 8px;
  margin-top: 15px;
}
.cosmetic-item {
  border: 1px solid #577a9255;
  background: #081726;
  border-radius: 10px;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 12px;
  padding: 12px;
  color: #dfeef7;
  width: 100%;
}
.cosmetic-item > i {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px #ffffff33;
  flex-shrink: 0;
}
.cosmetic-item > span {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cosmetic-item strong {
  font-size: 14px;
}
.cosmetic-item small {
  font-size: 11px;
  color: #96b0c2;
  line-height: 1.4;
}
.cosmetic-item > b {
  margin-left: auto;
  color: var(--mint);
}
.cosmetic-item[aria-pressed="true"] {
  border-color: #c7ff7388;
  background: #c7ff730c;
}
.cosmetic-item:disabled {
  opacity: 0.52;
  cursor: default;
}
.cosmetic-item:enabled:hover {
  border-color: #c7ff73;
}
.workshop-note {
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: #99b3c4;
  margin: 16px 0;
}
.encounter-console {
  position: absolute;
  top: 108px;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 32px));
  display: grid;
  gap: 8px;
}
.boss-status,
.rescue-status,
.event-status {
  padding: 11px 15px;
  border-radius: 9px;
  backdrop-filter: blur(10px);
  background: #091522e8;
  border: 1px solid #aabfcb55;
  box-shadow: 0 6px 22px #0005;
}
.boss-status strong,
.rescue-status strong {
  font: 11px var(--mono);
  letter-spacing: 1px;
  display: block;
  margin-bottom: 8px;
}
.boss-status {
  border-color: #ff789488;
  color: #ffb0bf;
}
.boss-status .health-track i {
  background: #ff728e;
  box-shadow: 0 0 14px #ff728e88;
}
.rescue-status {
  border-color: #ffcf8599;
  color: #ffe0b2;
}
.rescue-status .health-track i {
  background: #ffdb82;
}
.rescue-status small {
  display: block;
  margin-top: 7px;
  color: #bbcad4;
  font-size: 11px;
}
.event-status {
  font: 11px var(--mono);
  letter-spacing: 0.4px;
  text-align: center;
  color: #ffcfb0;
}
.unlock-toast {
  position: absolute;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 15px;
  max-width: 80%;
  border: 1px solid #c7ff7366;
  border-radius: 9px;
  background: #0b1e21eb;
  color: #d7ff9b;
  font: 11px var(--mono);
  text-align: center;
}
body[data-screen="playing"] .wave-banner {
  top: 208px;
  pointer-events: none;
}
@keyframes pilot-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}
@media (min-width: 761px) and (min-height: 501px) {
  .menu-buttons {
    gap: 5px;
  }
  .menu-action {
    padding-top: 11px;
    padding-bottom: 11px;
  }
}
@media (max-width: 760px) {
  .workshop-layout {
    gap: 14px;
    grid-template-columns: 1fr;
  }
  .workshop-display {
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }
  .workshop-avatar {
    grid-row: 1/4;
    grid-column: 1;
    width: 105px;
    height: 140px;
    margin: 12px auto;
  }
  .pilot-selector,
  .workshop-display > strong,
  .workshop-summary {
    grid-column: 2;
    justify-content: center;
  }
  .workshop-summary {
    font-size: 9px;
    margin: 0;
  }
  .workshop-avatar[data-accessory="crown"] .preview-accessory {
    width: 47px;
    height: 20px;
  }
  .workshop-avatar[data-accessory="ring"] .preview-accessory {
    width: 50px;
    height: 13px;
  }
  .upgrade-options {
    gap: 9px;
    grid-template-columns: 1fr;
    margin: 15px 0;
  }
  .upgrade-option {
    min-height: 0;
    padding: 15px 15px 15px 58px;
    gap: 8px;
  }
  .upgrade-glyph {
    position: absolute;
    left: 15px;
    top: 18px;
    font-size: 28px;
  }
  .upgrade-option strong {
    font-size: 16px;
  }
  .upgrade-option small {
    font-size: 12px;
    padding-right: 12px;
  }
  .upgrade-option kbd {
    top: 12px;
    right: 10px;
  }
  .encounter-console {
    top: 150px;
  }
  body[data-screen="playing"] .wave-banner {
    top: 290px;
  }
  .menu-action {
    padding-top: 8px;
    padding-bottom: 8px;
  }
}
@media (max-height: 500px) {
  .workshop-layout {
    grid-template-columns: 0.7fr 1.3fr;
    gap: 16px;
    margin: 14px 0;
  }
  .workshop-avatar {
    width: 105px;
    height: 136px;
    margin: 12px 0 3px;
  }
  .workshop-card h2,
  .upgrade-card h2 {
    font-size: 26px;
    margin: 12px 0;
  }
  .cosmetic-item {
    padding: 8px 10px;
  }
  .upgrade-option {
    min-height: 180px;
    padding: 16px 12px;
    gap: 10px;
  }
  .upgrade-option strong {
    font-size: 15px;
  }
  .upgrade-option small {
    font-size: 11px;
  }
  .workshop-note {
    margin: 10px 0;
    font-size: 11px;
  }
  .encounter-console {
    top: 100px;
    width: 350px;
  }
  .unlock-toast {
    bottom: 100px;
  }
  .menu-action {
    padding-top: 5px;
    padding-bottom: 5px;
    min-height: 25px;
  }
  body[data-screen="playing"] .wave-banner {
    top: 190px;
  }
}
.reduced-motion .workshop-avatar svg {
  animation: none;
}
.reduced-motion .upgrade-option {
  transition: none;
}
.reduced-motion .upgrade-option:hover {
  transform: none;
}

.workshop-card > .button {
  width: 100%;
}
@media (max-height: 500px) {
  .menu-copy {
    padding: 0;
  }
  .menu-copy .game-title {
    font-size: 48px;
  }
  .menu-copy .overline {
    margin-bottom: 8px;
  }
  .menu-copy .tagline {
    font-size: 10px;
    line-height: 1.4;
    margin: 8px 0;
  }
  .menu-copy .menu-buttons .menu-action {
    height: 24px;
    min-height: 24px;
    max-height: 24px;
    padding: 3px 10px;
    font-size: 9px;
    line-height: 12px;
  }
}

.run-build { font: 11px var(--mono); line-height: 1.8; color: #c7ff73; margin: 14px 0 18px; padding: 10px; border: 1px solid #c7ff7333; border-radius: 8px; background: #c7ff7308; }

/* Dúos: menú de lanzamiento compacto y clasificación legible. */
.menu-copy {padding:0;}
.menu-copy .game-title {font-size:clamp(44px,min(7vw,12vh),92px);}
.menu-copy .overline {margin:0 0 14px;font-size:9px;}
.menu-copy .tagline {font-size:16px;line-height:1.4;margin:14px 0 18px;}
.menu-copy .menu-buttons {gap:5px;max-width:360px;}
.menu-copy .menu-buttons .menu-action {height:clamp(34px,6vh,42px);min-height:0;max-height:none;padding:8px 14px;font-size:11px;line-height:16px;}
.ranking-card {width:min(760px,100%);}
.ranking-toolbar {display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:20px;}
.ranking-status,.ranking-empty {font-size:12px;color:#a7bfd0;line-height:1.6;}
.ranking-status {margin:14px 0;}
.ranking-list {list-style:none;margin:0;padding:0;display:grid;gap:8px;max-height:42vh;overflow:auto;scrollbar-width:thin;}
.ranking-row {display:grid;grid-template-columns:30px minmax(0,1fr) auto;gap:14px;align-items:center;padding:14px;border:1px solid #52758b44;border-radius:10px;background:#06142188;}
.ranking-position {font:bold 18px var(--mono);color:#94adbf;}
.ranking-row:first-child .ranking-position {color:#ffdb82;}.ranking-row:nth-child(2) .ranking-position {color:#dcecff;}.ranking-row:nth-child(3) .ranking-position {color:#eea878;}
.ranking-team,.ranking-details {display:flex;flex-direction:column;gap:5px;min-width:0;}
.ranking-team strong {color:#e4f1f9;font-size:16px;overflow-wrap:anywhere;}
.ranking-team small {color:#8faabd;font-size:11px;overflow-wrap:anywhere;}
.ranking-details {text-align:right;}.ranking-details strong {color:var(--mint);font:19px var(--mono);}.ranking-details small {font:9px var(--mono);color:#a7becd;}
.own-result {border-color:#c7ff7388;background:#c7ff730a;}
.ranking-empty {text-align:center;padding:32px 18px;border:1px dashed #60809655;border-radius:12px;}
.ranking-footer {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:20px;}.ranking-footer small {font-size:10px;color:#819bad;}
.result-league-status {color:#c7ff73;font:11px var(--mono);line-height:1.5;margin:16px 0 4px;}
.identity-card {width:min(570px,100%);}
.identity-card form {display:grid;gap:12px;margin-top:23px;}
.identity-card label {display:block;font:10px var(--mono);letter-spacing:1px;color:#bdd1df;margin-bottom:8px;}
.identity-card input {width:100%;background:#071321;border:1px solid #688aa466;border-radius:9px;padding:13px;color:#eef6ff;font-size:16px;outline:none;}
.identity-card input:focus {border-color:var(--mint);box-shadow:0 0 0 3px #c7ff7311;}
.identity-card input[readonly] {color:#829bae;background:#0a1722;}
.identity-pilots {display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:5px;}
.identity-note,.identity-error {font-size:12px;line-height:1.6;margin:4px 0;color:#9fb8ca;}.identity-error {color:#ff96af;}.identity-error:empty {display:none;}
.identity-card .button {width:100%;}.lobby-duo {display:block;color:#c7ff73;font:12px var(--mono);margin:0 0 12px;}
.pilot-ready span b {font:inherit;color:inherit;}.game-bottom b {font:inherit;}
@media (max-width:760px) and (min-height:501px) {
 .menu-copy .game-title {font-size:clamp(52px,13vw,78px);}
 .menu-copy .tagline {font-size:13px;margin:12px 0 16px;}
 .menu-copy .menu-buttons {gap:4px;}
 .menu-copy .menu-buttons .menu-action {height:40px;font-size:10px;}
 .ranking-card {padding:22px 18px;}
 .ranking-row {gap:8px;padding:12px 9px;grid-template-columns:23px minmax(0,1fr) auto;}
 .ranking-details small {font-size:8px;max-width:95px;line-height:1.6;}
 .ranking-team strong {font-size:14px;}
 .ranking-footer {flex-direction:column;align-items:flex-start;}
 .ranking-toolbar .custom-tabs button {padding:9px;font-size:10px;}
 .identity-pilots {gap:10px;}
}
@media (max-height:500px) {
 .menu-copy .game-title {font-size:clamp(34px,10vh,48px);}
 .menu-copy .overline {margin-bottom:8px;font-size:7px;}
 .menu-copy .tagline {font-size:10px;margin:6px 0 9px;}
 .menu-copy .menu-buttons {gap:2px;}
 .menu-copy .menu-buttons .menu-action {height:clamp(21px,6vh,25px);padding:3px 10px;font-size:9px;line-height:12px;}
 .ranking-list {max-height:40vh;}
 .identity-card form {gap:9px;margin-top:14px;}.identity-card input {padding:9px;}
}
@media (max-height:600px) and (min-height:501px) and (min-width:761px) {
 .menu-copy .game-title {font-size:68px;}
 .menu-copy .overline {margin-bottom:10px;}
 .menu-copy .tagline {font-size:13px;margin:10px 0 13px;}
 .menu-copy .menu-buttons .menu-action {height:34px;}
}

.vital-card strong { max-width:52%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; letter-spacing:.7px; }
.unit-caption b { display:inline-block; max-width:145px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; vertical-align:middle; }
.lobby-seat strong { max-width:100%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.game-bottom b { display:inline-block; max-width:100px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; vertical-align:middle; }

/* Universos visuales: la información de juego mantiene sus colores de identidad y peligro. */
.theme-selector {display:flex;align-items:center;gap:12px;}
.theme-caption {font:9px var(--mono);letter-spacing:1.7px;color:#9caeb8;}
.theme-switch {display:flex;gap:3px;padding:4px;border:1px solid #859ba54a;border-radius:30px;background:#050d18b3;}
.theme-switch button {display:flex;align-items:center;justify-content:center;gap:6px;min-height:32px;padding:6px 15px;border:0;border-radius:24px;color:#a9bac5;background:transparent;font-size:12px;transition:background .2s,color .2s,box-shadow .2s;}
.theme-switch button[aria-pressed="true"] {background:#c7ff73;color:#101a16;box-shadow:0 2px 12px #c7ff7320;}
.theme-switch button:hover:not([aria-pressed="true"]) {color:#fff;background:#ffffff0a;}
.theme-switch button:focus-visible {outline-offset:2px;}
.theme-switch button > span {font-size:16px;line-height:1;}
.setting-theme {display:flex;align-items:center;justify-content:space-between;gap:14px;padding:16px 0;border-bottom:1px solid #ffffff12;}
.setting-theme > span {font-size:15px;}
.setting-theme small {display:block;margin-top:5px;color:#90a6b5;font-size:11px;}
body[data-theme="andes"] {--bg:#101723;--mint:#f2cc83;--text:#fff3de;--muted:#b4ae9f;}
body[data-theme="andes"] .game-viewport {background:radial-gradient(ellipse at center,#354043,#101723 74%);}
body[data-theme="andes"] .theme-switch button[aria-pressed="true"] {background:#f2cc83;box-shadow:0 2px 16px #f2cc8328;}
body[data-theme="andes"] .menu-atmosphere::after {background:linear-gradient(90deg,#0d1522f7 6%,#1b222dcc 48%,#14233477),linear-gradient(0deg,#111a28f0,transparent 55%,#151a2790);}
body[data-theme="andes"] .menu-atmosphere .light-column {opacity:.3;}
body[data-theme="andes"] .hero-orbit {border-color:#e6c28330;}
body[data-theme="andes"] .hero-readout > span {color:#f2cc83;}
body[data-theme="andes"] .game-title i {text-shadow:0 0 35px #e7b36255;}
body[data-theme="andes"] .menu-action.selected,body[data-theme="andes"] .menu-action:hover,body[data-theme="andes"] .menu-action:focus-visible {color:#ffe0a4;border-color:#d3b47880;background:linear-gradient(90deg,#c49a3d25,transparent);}
body[data-theme="andes"] .menu-footer {border-top-color:#d5b57733;}
body[data-theme="andes"] .modal-screen {background:radial-gradient(ellipse at 50% 40%,#3e3c3280,#080f1de3);}
body[data-theme="andes"] .modal-card {border-color:#d2b07955;border-top-color:#e8c58890;background:radial-gradient(ellipse at 0 0,#67523238,transparent 55%),linear-gradient(135deg,#202c36f8,#101c2afc);}
body[data-theme="andes"] .modal-card::before {box-shadow:0 0 14px #f2cc8355;}
body[data-theme="andes"] #game canvas {border-color:#c3a47166;box-shadow:0 18px 80px #0008,0 0 30px #bd9b4c0c;}
body[data-theme="andes"] .workshop-display {background:radial-gradient(ellipse at center,#82653925,transparent 72%);}
@media (max-width:1000px) {
 .theme-caption {display:none;}
 .theme-selector {gap:0;}
 .theme-switch button {padding:6px 11px;}
}
@media (max-width:760px) {
 .menu-topline {padding-right:0;align-items:flex-start;flex-direction:column;gap:13px;}
 .menu-topline .theme-selector {margin:0;}
 .menu-topline .theme-switch button {min-height:30px;padding:5px 16px;font-size:11px;}
 .setting-theme {flex-wrap:wrap;gap:12px;}
}
@media (max-height:500px) {
 .menu-topline {flex-direction:row;align-items:center;gap:10px;padding-right:110px;}
 .menu-topline .eyebrow {font-size:7px;letter-spacing:1px;}
 .menu-topline .theme-switch {padding:3px;}
 .menu-topline .theme-switch button {min-height:24px;padding:3px 10px;font-size:10px;}
 .setting-theme {padding:12px 0;}
}
@media (prefers-reduced-motion:reduce) {.theme-switch button {transition:none;}}
.reduced-motion .theme-switch button {transition:none;}
