* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #000;
  color: #e2e8f0;
  font-family: 'Orbitron', system-ui, -apple-system, sans-serif;
  touch-action: none;
  -ms-touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

#canvas-container {
  position: fixed; inset: 0;
  z-index: 0;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

canvas {
  display: block;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* iOS / mobile: avoid text selection & long-press menus on game HUD (modals re-enable below) */
body.rocket-mode {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body.rocket-mode .modal-backdrop.open .modal,
body.rocket-mode .modal-backdrop.open .modal input,
body.rocket-mode .modal-backdrop.open .modal textarea,
body.rocket-mode .modal-backdrop.open .modal a,
body.rocket-mode .info-card.open,
body.rocket-mode .info-card.open * {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

body.rocket-mode .worm-stats,
body.rocket-mode .rocket-pause-hud,
body.rocket-mode .planet-indicator,
body.rocket-mode .battleship-enemy-indicators,
body.rocket-mode .battleship-planet-indicator,
body.rocket-mode .battleship-music-toggle,
body.rocket-mode .battleship-nitro,
body.rocket-mode .battleship-focus-hp,
body.rocket-mode .rocket-crosshair,
body.rocket-mode .slot-counter-bar {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* ---------- UI overlay ---------- */
.ui-overlay {
  position: fixed; z-index: 50;
  pointer-events: none;
}

.ui-top {
  top: 0; left: 0; right: 0;
  display: flex; justify-content: center; align-items: center;
  padding: 1.5rem;
}

.brand {
  font-size: 1.6rem; font-weight: 800;
  letter-spacing: -.02em;
  color: #fff;
  text-shadow: 0 0 30px rgba(0,250,100,.5);
}
.ui-top a.brand {
  text-decoration: none;
  pointer-events: auto;
  cursor: pointer;
}
.ui-top a.brand:hover {
  color: #bbf7d0;
}
body.worms-page .ui-top a.brand,
body.battleship-page .ui-top a.brand,
body.galaxy-league-page .ui-top a.brand {
  color: inherit;
}
body.worms-page .ui-top a.brand:hover,
body.battleship-page .ui-top a.brand:hover,
body.galaxy-league-page .ui-top a.brand:hover {
  color: #bbf7d0;
}

.ui-bottom {
  bottom: 0; left: 0; right: 0;
  display: flex; justify-content: center;
  padding: 2rem;
}

.ui-bottom__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
  pointer-events: none;
}

.btn-play-games {
  pointer-events: auto;
  padding: 0.85rem 1.25rem;
  border: 2px solid #00fa64;
  border-radius: 12px;
  background: transparent;
  color: #00fa64;
  font-family: 'Orbitron', system-ui, sans-serif;
  font-size: clamp(0.72rem, 2.5vw, 1rem);
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 0 0 rgba(0, 250, 100, 0);
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s, color 0.2s;
}
.btn-play-games:hover {
  background: rgba(0, 250, 100, 0.12);
  box-shadow: 0 0 22px rgba(0, 250, 100, 0.28);
  transform: translateY(-1px);
  color: #4dff9a;
}
.btn-play-games:active {
  transform: translateY(0);
}

.btn-cta {
  pointer-events: auto;
  padding: .85rem 1.25rem;
  border: none; border-radius: 12px;
  background: linear-gradient(135deg, #00fa64, #00c853);
  color: #021a09; font-family: 'Orbitron', system-ui, sans-serif; font-size: clamp(0.72rem, 2.5vw, 1rem); font-weight: 700;
  line-height: 1.25;
  text-align: center;
  max-width: min(94vw, 36rem);
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(0,250,100,.35);
  transition: transform .15s, box-shadow .15s;
}
.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,250,100,.5);
}

/* ---------- Tooltip ---------- */
#tooltip {
  position: fixed; z-index: 20;
  background: rgba(2,26,9,.92);
  color: #f0fdf4;
  padding: .45rem .8rem;
  border-radius: 8px;
  font-size: .8rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  max-width: 240px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(0,250,100,.3);
}
#tooltip.visible { opacity: 1; }
#tooltip a { color: #4ade80; text-decoration: none; }
#tooltip a:hover { text-decoration: underline; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.modal-backdrop.open {
  opacity: 1; pointer-events: auto;
}

.modal {
  background: #0a1f10;
  border: 1px solid rgba(0,250,100,.12);
  border-radius: 16px;
  padding: 2rem;
  width: 90%; max-width: 440px;
  box-shadow: 0 8px 48px rgba(0,0,0,.5);
}

.modal.modal--purchase {
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
}

.modal h2 {
  font-size: 1.2rem; margin-bottom: 1.2rem; color: #f0fdf4; text-align: center;
}

.games-modal__lead {
  text-align: center;
  color: #a7f3d0;
  font-size: 0.88rem;
  margin: -0.5rem 0 1rem;
}
.games-modal__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.games-modal__list li {
  margin: 0;
}
.games-modal__list a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 250, 100, 0.35);
  background: rgba(2, 26, 12, 0.65);
  color: #86efac;
  font-family: 'Orbitron', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.games-modal__list a:hover {
  border-color: rgba(0, 250, 100, 0.55);
  background: rgba(0, 250, 100, 0.1);
  color: #bbf7d0;
}
.games-modal__actions {
  text-align: center;
  margin-top: 1.25rem;
}

.modal label {
  display: block; font-size: .82rem; color: #6ee7a0; margin-bottom: .25rem;
}

.modal input[type=text],
.modal input[type=email],
.modal input[type=url] {
  width: 100%; padding: .6rem .8rem;
  border: 1px solid #1a3a24; border-radius: 8px;
  background: #021a09; color: #f0fdf4;
  font-size: .9rem; margin-bottom: .8rem; outline: none;
}
.modal input:focus { border-color: #00fa64; }

.modal .file-drop {
  border: 2px dashed #1a3a24; border-radius: 10px;
  padding: 1.2rem; text-align: center; color: #4ade80;
  font-size: .85rem; margin-bottom: .8rem; cursor: pointer;
  transition: border-color .2s, color .2s;
}
.modal .file-drop:hover,
.modal .file-drop.dragover { border-color: #00fa64; color: #00fa64; }

.modal .file-drop input { display: none; }

.modal .tier-hint {
  font-size: .78rem;
  color: #6ee7a0;
  text-align: center;
  margin: 0 0 .65rem;
  line-height: 1.35;
}

.modal .tier-source-info {
  font-size: .72rem;
  color: #a7f3d0;
  text-align: center;
  margin: 0 0 .55rem;
  line-height: 1.4;
  grid-column: 1 / -1;
}
@media (min-width: 520px) {
  .tier-grid .tier-source-info { grid-column: 1 / -1; }
}

/* Tier cards: plain box + border (no pseudo-element frames). */
.tier-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .55rem;
  margin-bottom: .85rem;
}
@media (min-width: 520px) {
  .tier-grid { grid-template-columns: repeat(3, 1fr); }
}

.tier-option {
  display: flex;
  flex-direction: column;
  margin: 0;
  cursor: pointer;
  border-radius: 10px;
  min-height: 100%;
}
.tier-option input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tier-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  box-sizing: border-box;
  min-height: 5.75rem;
  border: 1px solid #1a3a24;
  border-radius: 10px;
  padding: .75rem .5rem;
  text-align: center;
  background: #021a09;
  transition: border-color .15s, box-shadow .15s;
}
.tier-option:hover .tier-card {
  border-color: #2a5a38;
}
.tier-option input:checked + .tier-card {
  border-color: #00fa64;
  box-shadow: 0 0 0 1px rgba(0, 250, 100, 0.35);
}

.tier-card .tier-name {
  display: block;
  width: 100%;
  font-size: .85rem;
  font-weight: 800;
  color: #f0fdf4;
  margin-bottom: .4rem;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.tier-card .tier-price {
  display: block;
  width: 100%;
  font-size: .95rem;
  font-weight: 800;
  color: #00fa64;
  margin-top: 0;
  line-height: 1.2;
}

.tier-load-err {
  text-align: center;
  font-size: .8rem;
  color: #fca5a5;
  margin: 0;
}

.modal .actions {
  display: flex; gap: .6rem; justify-content: flex-end;
}

.modal .btn { padding: .55rem 1.2rem; border: none; border-radius: 8px; font-size: .9rem; font-weight: 600; cursor: pointer; }
.modal .btn-cancel { background: #1a3a24; color: #6ee7a0; }
.modal .btn-test { background: #1a3a24; color: #fde68a; border: 1px solid #fde68a44; }
.modal .btn-test:hover { background: #2a4a34; }
.modal .btn-pay { background: linear-gradient(135deg, #00fa64, #00c853); color: #021a09; }
.modal .btn-pay:hover { background: linear-gradient(135deg, #00e85c, #00b048); }
.modal .btn-pay:disabled { opacity: .5; cursor: not-allowed; }

.modal .error-msg {
  background: #7f1d1d; color: #fca5a5;
  padding: .5rem .7rem; border-radius: 6px;
  font-size: .8rem; margin-bottom: .8rem; text-align: center;
}

/* ---------- Info button ---------- */
.btn-info {
  pointer-events: auto;
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #00fa64;
  background: rgba(0, 250, 100, 0.15);
  color: #00fa64;
  font-family: 'Orbitron', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  font-style: normal;
  line-height: 1;
  cursor: pointer;
  transition: background .2s, box-shadow .2s, transform .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-info:hover {
  background: rgba(0, 250, 100, 0.3);
  box-shadow: 0 0 16px rgba(0, 250, 100, 0.4);
  transform: scale(1.08);
}

/* ---------- Play / Pause button ---------- */
.btn-control {
  pointer-events: auto;
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #00fa64;
  background: rgba(0, 250, 100, 0.15);
  color: #00fa64;
  font-size: .85rem;
  line-height: 1;
  cursor: pointer;
  transition: background .2s, box-shadow .2s, transform .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-control:hover {
  background: rgba(0, 250, 100, 0.3);
  box-shadow: 0 0 16px rgba(0, 250, 100, 0.4);
  transform: scale(1.08);
}

/* ---------- Info card ---------- */
.info-card {
  position: fixed;
  top: 4.5rem;
  left: 1.5rem;
  z-index: 200;
  width: min(92vw, 420px);
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  background: rgba(10, 31, 16, 0.96);
  border: 1px solid rgba(0, 250, 100, 0.25);
  border-radius: 16px;
  padding: 1.8rem 1.6rem 1.4rem;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  font-family: 'Orbitron', system-ui, sans-serif;
  color: #d1fae5;

  opacity: 0;
  transform: translateY(-12px) scale(0.96);
  transform-origin: top left;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.info-card.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.info-card::-webkit-scrollbar { width: 6px; }
.info-card::-webkit-scrollbar-track { background: rgba(0, 250, 100, 0.05); border-radius: 3px; }
.info-card::-webkit-scrollbar-thumb { background: rgba(0, 250, 100, 0.3); border-radius: 3px; }
.info-card::-webkit-scrollbar-thumb:hover { background: rgba(0, 250, 100, 0.5); }
.info-card { scrollbar-color: rgba(0,250,100,0.3) rgba(0,250,100,0.05); scrollbar-width: thin; }

.info-card__close {
  position: absolute;
  top: .8rem;
  right: .9rem;
  background: none;
  border: none;
  color: #6ee7a0;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  transition: color .15s;
}
.info-card__close:hover { color: #00fa64; }

.info-card h2 {
  font-size: 1rem;
  font-weight: 800;
  color: #00fa64;
  margin: 0 0 .7rem;
  line-height: 1.3;
}

.info-card h3 {
  font-size: .82rem;
  font-weight: 700;
  color: #4ade80;
  margin: 1.1rem 0 .45rem;
  letter-spacing: .03em;
}

.info-card p {
  font-size: .75rem;
  line-height: 1.55;
  margin: 0 0 .5rem;
  color: #d1fae5;
}

.info-card ol,
.info-card ul {
  padding-left: 1.2rem;
  margin: 0 0 .5rem;
}

.info-card li {
  font-size: .75rem;
  line-height: 1.55;
  margin-bottom: .3rem;
  color: #d1fae5;
}

.info-card ol li::marker { color: #00fa64; font-weight: 700; }
.info-card ul li::marker { color: #4ade80; }

.info-card strong { color: #4ade80; }

.info-card .info-legal {
  margin-top: 1.2rem;
  padding-top: .8rem;
  border-top: 1px solid rgba(0,250,100,0.12);
  text-align: center;
}
.info-card .info-legal a {
  color: #6ee7a0;
  font-size: .7rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.info-card .info-legal a:hover { color: #00fa64; }

.info-card .info-note {
  font-size: .7rem;
  color: #a7f3d0;
  font-style: italic;
  margin-top: .35rem;
}
.info-card .info-highlight {
  font-size: .82rem;
  font-weight: 700;
  color: #00fa64;
  margin-top: .5rem;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  margin: .4rem 0 .2rem;
  font-size: .75rem;
}
.info-table th {
  text-align: left;
  font-weight: 700;
  color: #00fa64;
  padding: .35rem .5rem;
  border-bottom: 1px solid rgba(0, 250, 100, 0.2);
}
.info-table td {
  padding: .35rem .5rem;
  color: #d1fae5;
  border-bottom: 1px solid rgba(0, 250, 100, 0.08);
}

/* ---------- Pole price ---------- */
.pole-price-box {
  text-align: center;
  margin: 1rem 0;
  padding: .8rem;
  border: 1px solid rgba(0,250,100,0.2);
  border-radius: 10px;
  background: #021a09;
}
.pole-price-label {
  font-size: .78rem;
  color: #6ee7a0;
  margin: 0 0 .3rem;
}
.pole-price-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: #00fa64;
  margin: 0;
}

/* ---------- Slot counter (spots left) ---------- */
.slot-counter-bar {
  position: fixed;
  bottom: 1.2rem;
  right: 1.5rem;
  z-index: 50;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: .45rem;
  pointer-events: none;
}
.slot-counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  padding: .6rem .9rem;
  border: 1px solid rgba(0,250,100,0.25);
  border-radius: 12px;
  background: rgba(2, 26, 9, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  user-select: none;
}
.slot-counter__number {
  font-size: 1.3rem;
  font-weight: 800;
  color: #00fa64;
  line-height: 1;
}
.slot-counter__label {
  font-size: .55rem;
  font-weight: 600;
  color: #6ee7a0;
  text-transform: uppercase;
  letter-spacing: .06em;
}

@media (max-width: 600px) {
  .slot-counter-bar {
    bottom: .8rem;
    right: .8rem;
    gap: .3rem;
  }
  .slot-counter {
    padding: .3rem .55rem;
    border-radius: 8px;
    gap: .08rem;
  }
  .slot-counter__number { font-size: .75rem; }
  .slot-counter__label  { font-size: .4rem; }
}

/* Rocket mode: center screen reticle (pointer = nose / lasers) */
.rocket-crosshair {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(58px, 14vw);
  height: min(58px, 14vw);
  z-index: 44;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(0, 250, 100, 0.28));
}
.rocket-crosshair[hidden] {
  display: none !important;
}
.rocket-crosshair__svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- Rocket mode hint (minimal: WASD · arrows · space) — bottom area ---------- */
.rocket-hint {
  position: fixed;
  left: 50%;
  bottom: calc(min(0.65rem, 2vh) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 40;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.42rem;
}
.rocket-hint[hidden] {
  display: none !important;
}
/* Barra de vida del enemigo en autofocus (segmentos dinámicos, encima de WASD) */
.battleship-focus-hp {
  width: min(19rem, 90vw);
  padding: 0.28rem 0.4rem;
  border-radius: 10px;
  background: rgba(2, 14, 8, 0.78);
  border: 1px solid rgba(0, 250, 100, 0.22);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}
.battleship-focus-hp[hidden] {
  display: none !important;
}
.battleship-focus-hp__segments {
  display: flex;
  gap: 3px;
  align-items: stretch;
  justify-content: center;
  width: 100%;
}
.battleship-focus-hp__seg {
  flex: 1;
  min-width: 0;
  height: 9px;
  border-radius: 2px;
  background: rgba(12, 28, 18, 0.65);
  border: 1px solid rgba(0, 0, 0, 0.35);
  transition: background 0.12s ease, box-shadow 0.12s ease;
}
.rocket-hint__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem 1rem;
  padding: 0.4rem 0.75rem;
  border-radius: 10px;
  background: rgba(2, 18, 10, 0.72);
  border: 1px solid rgba(0, 250, 100, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
.rocket-hint__wasd {
  font-family: 'Orbitron', system-ui, sans-serif;
  font-size: clamp(0.65rem, 2.2vw, 0.78rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(180, 250, 200, 0.92);
  text-shadow: 0 0 10px rgba(0, 250, 100, 0.35);
}
.rocket-hint__arrows {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: rgba(110, 231, 160, 0.95);
  font-size: clamp(0.65rem, 2vw, 0.75rem);
}
.rocket-hint__spacebar {
  display: inline-block;
  width: 2.25rem;
  height: 0.45rem;
  border-radius: 3px;
  border: 1px solid rgba(0, 250, 100, 0.35);
  background: linear-gradient(180deg, rgba(0, 40, 22, 0.9) 0%, rgba(0, 25, 14, 0.95) 100%);
  box-shadow: inset 0 1px 0 rgba(0, 250, 100, 0.12);
}
.rocket-hint__shift {
  font-family: 'Orbitron', system-ui, sans-serif;
  font-size: clamp(0.75rem, 2.2vw, 0.88rem);
  font-weight: 800;
  color: rgba(0, 250, 100, 0.95);
  text-shadow: 0 0 12px rgba(0, 250, 100, 0.45);
  line-height: 1;
}
.rocket-hint__pause {
  margin-left: 0.35rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 250, 100, 0.28);
  background: rgba(2, 22, 10, 0.65);
  font-family: 'Orbitron', system-ui, sans-serif;
  font-size: clamp(0.58rem, 1.8vw, 0.72rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #86efac;
  text-shadow: 0 0 10px rgba(0, 250, 100, 0.35);
  white-space: nowrap;
}
@media (max-width: 520px) {
  .rocket-hint {
    bottom: calc(min(0.5rem, 1.8vh) + env(safe-area-inset-bottom, 0px));
    max-width: 94vw;
  }
  .rocket-hint__row {
    gap: 0.45rem 0.65rem;
    padding: 0.35rem 0.55rem;
  }
  .rocket-hint__wasd {
    letter-spacing: 0.12em;
  }
}
body.rocket-mode .ui-bottom {
  opacity: 0.35;
  transition: opacity .25s;
}
body.rocket-mode #btn-open-modal {
  display: none !important;
}
body.rocket-mode #canvas-container canvas {
  cursor: default !important;
}
/* Galaxy League: con pointer lock el SO oculta el puntero; sin lock, mira para orientar y clic para fijar de nuevo. */
body.galaxy-league-page.gl-active.gl-pointer-locked #canvas-container,
body.galaxy-league-page.gl-active.gl-pointer-locked #canvas-container canvas {
  cursor: none !important;
}
body.galaxy-league-page.gl-active:not(.gl-pointer-locked) #canvas-container canvas {
  cursor: crosshair !important;
}
body.rocket-mode .social-links {
  opacity: 0.45;
  transition: opacity .25s;
}
body.rocket-mode #btn-info,
body.rocket-mode #btn-pause {
  display: none !important;
}
#rocket-music-silence {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

/* Worm counters (rocket mode): left = entered planet (red), right = eliminated (green) */
.worm-stats {
  display: none;
  position: fixed;
  top: 1rem;
  z-index: 52;
  pointer-events: none;
  font-family: 'Orbitron', system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(1rem, 3.2vw, 1.4rem);
  line-height: 1;
  letter-spacing: 0.04em;
}
body.rocket-mode .worm-stats {
  display: block;
}
.worm-stats--planet {
  left: 1rem;
  color: #f87171;
  text-shadow: 0 0 16px rgba(248, 113, 113, 0.55);
}
.worm-stats--shot {
  right: 1rem;
  color: #00fa64;
  text-shadow: 0 0 16px rgba(0, 250, 100, 0.45);
}
.worm-stats__n {
  font-variant-numeric: tabular-nums;
}

/* Worms game page: counters in one row (red · green) */
body.worms-page .worm-stats--pair {
  display: none;
  position: fixed;
  right: 0.65rem;
  top: 0.85rem;
  left: auto;
  z-index: 52;
  flex-direction: row;
  align-items: baseline;
  gap: 0.4rem;
  font-family: 'Orbitron', system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(0.95rem, 2.8vw, 1.35rem);
  line-height: 1;
  letter-spacing: 0.04em;
  pointer-events: none;
}
body.worms-page.rocket-mode .worm-stats--pair {
  display: flex;
}
body.worms-page .worm-stats__seg.worm-stats--planet {
  position: static;
  left: auto;
  color: #f87171;
  text-shadow: 0 0 16px rgba(248, 113, 113, 0.55);
}
body.worms-page .worm-stats__seg.worm-stats--shot {
  position: static;
  right: auto;
  color: #00fa64;
  text-shadow: 0 0 16px rgba(0, 250, 100, 0.45);
}
body.worms-page .worm-stats__sep {
  color: rgba(110, 231, 160, 0.4);
  font-weight: 600;
  font-size: 0.75em;
  user-select: none;
}

/* Worms game page: TOP 10 panel — desktop: top-right, header + list always visible */
body.worms-page .worm-leaderboard {
  position: fixed;
  left: auto;
  right: 0.65rem;
  top: 3.35rem;
  transform: none;
  z-index: 51;
  width: min(12rem, 30vw);
  max-height: min(70vh, 420px);
  overflow: auto;
  padding: 0.55rem 0.7rem 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 250, 100, 0.28);
  background: rgba(2, 18, 10, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  font-family: 'Orbitron', system-ui, sans-serif;
}
body.worms-page .worm-leaderboard__head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.35rem;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #00fa64;
  text-shadow: 0 0 12px rgba(0, 250, 100, 0.4);
}
body.worms-page .worm-leaderboard__head .fa-trophy {
  font-size: 0.75rem;
  opacity: 0.95;
}
body.worms-page .worm-leaderboard__sub {
  margin: 0 0 0.5rem;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #86efac;
  opacity: 0.95;
}
body.worms-page .worm-leaderboard__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
body.worms-page .worm-leaderboard__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.28rem 0;
  font-size: 0.68rem;
  font-weight: 600;
  color: #d1fae5;
  border-bottom: 1px solid rgba(0, 250, 100, 0.12);
}
body.worms-page .worm-leaderboard__row:last-child {
  border-bottom: none;
}
body.worms-page .worm-leaderboard__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 58%;
  color: #ecfdf5;
}
body.worms-page .worm-leaderboard__time {
  font-variant-numeric: tabular-nums;
  color: #00fa64;
  flex-shrink: 0;
}
body.worms-page .worm-leaderboard__empty {
  margin: 0;
  font-size: 0.65rem;
  color: #6ee7a0;
  opacity: 0.85;
}

/* Worms page: mobile — TOP 10 toggle (top-right); list hidden until opened */
body.worms-page .worm-lb-toggle {
  display: none;
  pointer-events: auto;
  position: absolute;
  top: 1.5rem;
  right: 0.65rem;
  z-index: 52;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  min-height: 36px;
  border-radius: 10px;
  border: 2px solid rgba(0, 250, 100, 0.45);
  background: rgba(2, 26, 9, 0.92);
  color: #00fa64;
  font-family: 'Orbitron', system-ui, sans-serif;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
body.worms-page .worm-lb-toggle:hover {
  background: rgba(0, 250, 100, 0.14);
  box-shadow: 0 0 14px rgba(0, 250, 100, 0.35);
}
body.worms-page .worm-lb-toggle .fa-trophy {
  font-size: 0.72rem;
  opacity: 0.95;
}
@media (max-width: 768px) {
  body.worms-page .worm-lb-toggle {
    display: inline-flex;
  }
  body.worms-page .worm-leaderboard__head,
  body.worms-page .worm-leaderboard__sub {
    display: none;
  }
  body.worms-page .worm-leaderboard {
    left: auto;
    right: 0.65rem;
    top: 3.35rem;
    transform: none;
    width: min(17rem, calc(100vw - 1.3rem));
    max-height: min(52vh, 380px);
    padding: 0.55rem 0.65rem;
    z-index: 53;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }
  body.worms-page .worm-leaderboard.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  body.worms-page.rocket-mode .worm-stats--pair {
    top: 5.1rem;
    right: 0.65rem;
    left: auto;
  }
}
@media (max-width: 400px) {
  body.worms-page .worm-lb-toggle {
    right: 3.85rem;
    padding: 0.3rem 0.5rem;
    gap: 0.25rem;
  }
  body.worms-page .worm-lb-toggle .worm-lb-toggle__text {
    font-size: 0.52rem;
    letter-spacing: 0.06em;
  }
}

/* Galaxy League: own hull (top-left) */
body.galaxy-league-page .gl-player-hp {
  position: fixed;
  top: calc(0.55rem + env(safe-area-inset-top, 0px));
  left: calc(0.55rem + env(safe-area-inset-left, 0px));
  z-index: 52;
  font-family: 'Orbitron', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(0.75rem, 2.2vw, 0.95rem);
  letter-spacing: 0.06em;
  color: #4ade80;
  text-shadow:
    0 0 12px rgba(34, 197, 94, 0.65),
    0 0 18px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}
body.galaxy-league-page .gl-player-hp[hidden] {
  display: none !important;
}

/* Galaxy League: bottom HUD — score above controls (Battleship-style hint row) */
body.galaxy-league-page .galaxy-league-bottom-hud {
  position: fixed;
  left: 50%;
  bottom: calc(min(0.65rem, 2vh) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 52;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  max-width: min(100vw - 1.2rem, 28rem);
  pointer-events: none;
}
body.galaxy-league-page .galaxy-league-bottom-hud[hidden] {
  display: none !important;
}
body.galaxy-league-page .galaxy-league-bottom-hud .gl-rocket-hint {
  position: static;
  left: auto;
  bottom: auto;
  transform: none;
  max-width: 100%;
}
body.galaxy-league-page .galaxy-league-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'Orbitron', system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(1rem, 3.2vw, 1.45rem);
  line-height: 1;
  letter-spacing: 0.06em;
  text-shadow: 0 0 18px rgba(0, 0, 0, 0.75);
}
body.galaxy-league-page.gl-active.rocket-mode #gl-nitro.battleship-nitro {
  bottom: calc(9.35rem + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 520px) {
  body.galaxy-league-page.gl-active.rocket-mode #gl-nitro.battleship-nitro {
    bottom: calc(8.85rem + env(safe-area-inset-bottom, 0px));
  }
}
body.galaxy-league-page .galaxy-league-score__blue {
  color: #60a5fa;
  text-shadow: 0 0 14px rgba(96, 165, 250, 0.55);
}
body.galaxy-league-page .galaxy-league-score__red {
  color: #fb7185;
  text-shadow: 0 0 14px rgba(251, 113, 133, 0.55);
}
body.galaxy-league-page .galaxy-league-score__sep {
  color: rgba(226, 232, 240, 0.45);
  font-weight: 700;
  font-size: 0.85em;
  user-select: none;
}

body.galaxy-league-page .gl-team-pick__title {
  margin: 0.75rem 0 0.5rem;
  font-size: 0.72rem;
  color: #6ee7a0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}
body.galaxy-league-page .gl-team-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.15rem;
}
body.galaxy-league-page .gl-team-pick__block {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 3.35rem;
  padding: 0.65rem 0.5rem;
  border-radius: 12px;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  overflow: hidden;
}
body.galaxy-league-page .gl-team-pick__block:hover {
  transform: translateY(-1px);
}
body.galaxy-league-page .gl-team-pick__block--red {
  background: linear-gradient(145deg, #7f1d1d 0%, #b91c1c 40%, #991b1b 100%);
}
body.galaxy-league-page .gl-team-pick__block--blue {
  background: linear-gradient(145deg, #1e3a5f 0%, #1d4ed8 45%, #1e40af 100%);
}
body.galaxy-league-page .gl-team-pick__block-inner {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255, 255, 255, 0.35) 0%, transparent 65%);
  pointer-events: none;
}
body.galaxy-league-page .gl-team-pick__text {
  position: relative;
  z-index: 1;
  font-family: 'Orbitron', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f8fafc;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
body.galaxy-league-page .gl-team-pick__radio {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}
body.galaxy-league-page .gl-team-pick__block:has(.gl-team-pick__radio:checked) {
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.25),
    0 0 22px rgba(52, 211, 153, 0.45);
}
body.galaxy-league-page .gl-team-pick__block--red:has(.gl-team-pick__radio:checked) {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 0 1px rgba(254, 202, 202, 0.5),
    0 0 28px rgba(248, 113, 113, 0.55);
}
body.galaxy-league-page .gl-team-pick__block--blue:has(.gl-team-pick__radio:checked) {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 0 1px rgba(191, 219, 254, 0.45),
    0 0 28px rgba(96, 165, 250, 0.55);
}
body.galaxy-league-page .gl-team-pick__block:focus-within {
  outline: 2px solid rgba(52, 211, 153, 0.95);
  outline-offset: 3px;
  border-radius: 12px;
}

/* Galaxy League: TOP 10 panel (same layout as Worms) */
body.galaxy-league-page .worm-leaderboard.galaxy-league-lb {
  position: fixed;
  left: auto;
  right: 0.65rem;
  top: 3.35rem;
  transform: none;
  z-index: 51;
  width: min(12rem, 30vw);
  max-height: min(70vh, 420px);
  overflow: auto;
  padding: 0.55rem 0.7rem 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 250, 100, 0.28);
  background: rgba(2, 18, 10, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  font-family: 'Orbitron', system-ui, sans-serif;
}
body.galaxy-league-page .worm-leaderboard.galaxy-league-lb .worm-leaderboard__head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.35rem;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #00fa64;
  text-shadow: 0 0 12px rgba(0, 250, 100, 0.4);
}
body.galaxy-league-page .worm-leaderboard.galaxy-league-lb .worm-leaderboard__sub {
  margin: 0 0 0.5rem;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #86efac;
  opacity: 0.95;
}
body.galaxy-league-page .worm-leaderboard.galaxy-league-lb .worm-leaderboard__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
body.galaxy-league-page .worm-leaderboard.galaxy-league-lb .worm-leaderboard__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.28rem 0;
  font-size: 0.68rem;
  font-weight: 600;
  color: #d1fae5;
  border-bottom: 1px solid rgba(0, 250, 100, 0.12);
}
body.galaxy-league-page .worm-leaderboard.galaxy-league-lb .worm-leaderboard__row:last-child {
  border-bottom: none;
}
body.galaxy-league-page .worm-leaderboard.galaxy-league-lb .worm-leaderboard__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 58%;
  color: #ecfdf5;
}
body.galaxy-league-page .worm-leaderboard.galaxy-league-lb .worm-leaderboard__time {
  font-variant-numeric: tabular-nums;
  color: #00fa64;
  flex-shrink: 0;
}
body.galaxy-league-page .worm-leaderboard.galaxy-league-lb .worm-leaderboard__empty {
  margin: 0;
  font-size: 0.65rem;
  color: #6ee7a0;
  opacity: 0.85;
}
body.galaxy-league-page .worm-lb-toggle {
  display: none;
  pointer-events: auto;
  position: absolute;
  top: 1.5rem;
  right: 0.65rem;
  z-index: 52;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  min-height: 36px;
  border-radius: 10px;
  border: 2px solid rgba(0, 250, 100, 0.45);
  background: rgba(2, 26, 9, 0.92);
  color: #00fa64;
  font-family: 'Orbitron', system-ui, sans-serif;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
body.galaxy-league-page .worm-lb-toggle:hover {
  background: rgba(0, 250, 100, 0.14);
  box-shadow: 0 0 14px rgba(0, 250, 100, 0.35);
}
body.galaxy-league-page .worm-lb-toggle .fa-trophy {
  font-size: 0.72rem;
  opacity: 0.95;
}
@media (max-width: 768px) {
  body.galaxy-league-page .worm-lb-toggle {
    display: inline-flex;
  }
  body.galaxy-league-page .worm-leaderboard.galaxy-league-lb .worm-leaderboard__head,
  body.galaxy-league-page .worm-leaderboard.galaxy-league-lb .worm-leaderboard__sub {
    display: none;
  }
  body.galaxy-league-page .worm-leaderboard.galaxy-league-lb {
    left: auto;
    right: 0.65rem;
    top: 3.35rem;
    transform: none;
    width: min(17rem, calc(100vw - 1.3rem));
    max-height: min(52vh, 380px);
    padding: 0.55rem 0.65rem;
    z-index: 53;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }
  body.galaxy-league-page .worm-leaderboard.galaxy-league-lb.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}
@media (max-width: 400px) {
  body.galaxy-league-page .worm-lb-toggle {
    right: 3.85rem;
    padding: 0.3rem 0.5rem;
    gap: 0.25rem;
  }
  body.galaxy-league-page .worm-lb-toggle .worm-lb-toggle__text {
    font-size: 0.52rem;
    letter-spacing: 0.06em;
  }
}

.worm-name-modal.modal-backdrop {
  z-index: 130;
}
.worm-name-modal__box {
  max-width: 400px;
}
.worm-name-modal__box label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  color: #a7f3d0;
}
.worm-name-modal__box input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 1rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 250, 100, 0.35);
  background: rgba(0, 0, 0, 0.35);
  color: #ecfdf5;
  font-size: 1rem;
}
.worm-name-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Rocket mode: ESC pause — stacked above WASD, near bottom */
.rocket-pause-hud {
  display: none;
  position: fixed;
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(min(4.1rem, 11vh) + env(safe-area-inset-bottom, 0px));
  z-index: 53;
  pointer-events: none;
  font-family: 'Orbitron', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(0.72rem, 2vw, 0.9rem);
  letter-spacing: 0.12em;
  color: #86efac;
  text-shadow: 0 0 14px rgba(0, 250, 100, 0.45);
  white-space: nowrap;
}
body.rocket-mode .rocket-pause-hud:not([hidden]) {
  display: block;
}
@media (max-width: 520px) {
  .rocket-pause-hud {
    bottom: calc(min(3.65rem, 10vh) + env(safe-area-inset-bottom, 0px));
    font-size: clamp(0.65rem, 2.8vw, 0.82rem);
  }
}
.rocket-pause-hud__text {
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 250, 100, 0.28);
  background: rgba(2, 22, 10, 0.75);
}

/* Worm milestone reward (content from server; code never shipped in JS) */
.worm-100-modal.modal-backdrop {
  z-index: 120;
}
.worm-100-modal__box {
  max-width: 480px;
  background: linear-gradient(165deg, rgba(6, 42, 22, 0.98) 0%, rgba(2, 22, 10, 0.99) 100%);
  border: 1px solid rgba(0, 250, 100, 0.35);
  box-shadow:
    0 0 0 1px rgba(0, 250, 100, 0.08) inset,
    0 12px 48px rgba(0, 0, 0, 0.55),
    0 0 32px rgba(0, 250, 100, 0.12);
}
.worm-100-modal__title {
  font-family: 'Orbitron', system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ecfdf5;
  text-align: center;
  margin-bottom: 1rem;
  letter-spacing: 0.06em;
  text-shadow: 0 0 20px rgba(0, 250, 100, 0.35);
}
.worm-100-modal__lead,
.worm-100-modal__foot {
  font-size: 0.88rem;
  line-height: 1.55;
  color: #a7f3d0;
  text-align: center;
  margin: 0 0 1rem;
}
.worm-100-modal__foot {
  margin-top: 1rem;
  margin-bottom: 0;
  font-size: 0.82rem;
  color: #86efac;
}
.worm-100-modal__foot a {
  color: #4ade80;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}
.worm-100-modal__foot a:hover {
  color: #00fa64;
}
.worm-100-modal__code-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin: 0.25rem 0 0.5rem;
}
.worm-100-modal__code {
  flex: 1;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  font-family: ui-monospace, 'Cascadia Code', 'SF Mono', Menlo, monospace;
  font-size: clamp(0.95rem, 2.8vw, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #00fa64;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 250, 100, 0.45);
  border-radius: 10px;
  text-shadow: 0 0 12px rgba(0, 250, 100, 0.5);
  word-break: break-all;
}
.worm-100-modal__copy {
  flex-shrink: 0;
  width: 2.75rem;
  border: 1px solid rgba(0, 250, 100, 0.4);
  border-radius: 10px;
  background: rgba(0, 250, 100, 0.12);
  color: #00fa64;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.worm-100-modal__copy:hover {
  background: rgba(0, 250, 100, 0.22);
  border-color: rgba(0, 250, 100, 0.65);
}
.worm-100-modal__actions {
  margin-top: 1.25rem;
  text-align: center;
}

/* Worm game over (1000 eliminations) */
.worm-gameover-modal.modal-backdrop {
  z-index: 121;
}
.worm-gameover-modal__box {
  max-width: 420px;
  text-align: center;
  background: linear-gradient(165deg, rgba(42, 22, 6, 0.98) 0%, rgba(22, 10, 2, 0.99) 100%);
  border: 1px solid rgba(250, 180, 80, 0.35);
  box-shadow:
    0 0 0 1px rgba(250, 200, 100, 0.1) inset,
    0 12px 48px rgba(0, 0, 0, 0.55),
    0 0 28px rgba(250, 180, 80, 0.12);
}
.worm-gameover-modal__title {
  font-family: 'Orbitron', system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fef3c7;
  margin-bottom: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(250, 200, 100, 0.35);
}
.worm-gameover-modal__lead {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #fde68a;
  margin: 0 0 1.25rem;
}
.worm-gameover-modal__actions {
  margin-top: 0.5rem;
}

/* Off-screen planet hint (rocket mode) */
.planet-indicator {
  position: fixed;
  z-index: 48;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(0, 250, 100, 0.45));
  transform-origin: 22px 22px;
}
.planet-indicator[hidden] {
  display: none !important;
}

/* Battleship: hasta 5 flechas hacia enemigos fuera de pantalla (color por jugador) */
.battleship-enemy-indicators {
  position: fixed;
  inset: 0;
  z-index: 48;
  pointer-events: none;
}
.battleship-enemy-indicator {
  position: fixed;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  pointer-events: none;
  transform-origin: 22px 22px;
  opacity: 0.92;
}
.battleship-enemy-indicator[hidden] {
  display: none !important;
}

/* Battleship: planeta fuera de pantalla (icono verde, no flecha) */
.battleship-planet-indicator {
  position: fixed;
  z-index: 48;
  left: 0;
  top: 0;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  color: #00fa64;
  filter: drop-shadow(0 0 10px rgba(0, 250, 100, 0.55));
  transform: translate(-50%, -50%);
}
.battleship-planet-indicator[hidden] {
  display: none !important;
}

/* ---------- Test toolbar ---------- */
.test-toolbar {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 55;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.btn-test-tool {
  padding: .4rem .7rem;
  border: 1px solid rgba(0,250,100,0.3);
  border-radius: 8px;
  background: rgba(2, 26, 9, 0.8);
  color: #00fa64;
  font-family: 'Orbitron', system-ui, sans-serif;
  font-size: .65rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background .2s;
}
.btn-test-tool:hover { background: rgba(0, 250, 100, 0.15); }
.btn-test-tool:disabled { opacity: .4; cursor: wait; }
.btn-test-tool--danger { color: #f87171; border-color: rgba(248,113,113,0.3); }
.btn-test-tool--danger:hover { background: rgba(248,113,113,0.12); }
.test-status {
  font-size: .55rem;
  color: #6ee7a0;
  white-space: nowrap;
}

/* ---------- Social links ---------- */
.social-links {
  position: fixed;
  bottom: 1.2rem;
  left: 1.2rem;
  z-index: 30;
  display: flex;
  gap: .6rem;
}
.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1px solid rgba(0, 250, 100, 0.25);
  background: rgba(2, 10, 4, 0.7);
  color: #6ee7a0;
  font-size: 1.1rem;
  text-decoration: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: color .2s, border-color .2s, background .2s;
}
.social-links a:hover,
.social-links button:hover {
  color: #00fa64;
  border-color: #00fa64;
  background: rgba(0, 250, 100, 0.1);
}
.social-links button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1px solid rgba(0,250,100,.3);
  background: rgba(2,26,9,.85);
  color: #4ade80;
  font-size: 1.05rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: color .2s, border-color .2s, background .2s;
  padding: 0;
  outline: none;
  font-family: inherit;
}
.directory-scroll::-webkit-scrollbar { width: 6px; }
.directory-scroll::-webkit-scrollbar-track { background: rgba(0, 250, 100, 0.05); border-radius: 3px; }
.directory-scroll::-webkit-scrollbar-thumb { background: rgba(0, 250, 100, 0.3); border-radius: 3px; }
.directory-scroll::-webkit-scrollbar-thumb:hover { background: rgba(0, 250, 100, 0.5); }
.directory-scroll { scrollbar-color: rgba(0,250,100,0.3) rgba(0,250,100,0.05); scrollbar-width: thin; }
.directory-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  justify-content: center;
}
.directory-list li {
  display: inline;
}
.directory-list a {
  display: inline-block;
  padding: .35rem .7rem;
  border: 1px solid rgba(0,250,100,.25);
  border-radius: 6px;
  background: rgba(0,250,100,.06);
  color: #4ade80;
  text-decoration: none;
  font-size: .78rem;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.directory-list a:hover {
  background: rgba(0,250,100,.15);
  border-color: #00fa64;
  color: #00fa64;
}
@media (max-width: 600px) {
  .social-links { bottom: .8rem; left: .8rem; gap: .4rem; flex-direction: column; }
  .social-links a,
  .social-links button { width: 1.8rem; height: 1.8rem; font-size: .9rem; }
  .directory-list { gap: .35rem; }
}

/* ---------- Payment result ---------- */
.payment-banner {
  position: fixed; top: 1rem; left: 50%; transform: translateX(-50%);
  z-index: 50;
  padding: .7rem 1.5rem; border-radius: 10px;
  font-size: .9rem; font-weight: 600;
  animation: fadeSlide .4s ease;
}
.payment-banner.success { background: #052e16; color: #4ade80; border: 1px solid rgba(0,250,100,.2); }
.payment-banner.cancelled { background: #854d0e; color: #fde68a; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---------- Battleship (multiplayer) ---------- */
body.battleship-page .battleship-damage-flash {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(255, 55, 45, 0.52) 0%, rgba(120, 0, 0, 0.4) 48%, rgba(0, 0, 0, 0.28) 100%);
  opacity: 0;
  transition: opacity 0.14s ease-out;
}
body.battleship-page .battleship-ship-labels {
  position: fixed;
  inset: 0;
  z-index: 49;
  pointer-events: none;
  overflow: hidden;
}
body.battleship-page .battleship-death-killer:not([hidden]) {
  color: #00fa64;
  text-shadow: 0 0 14px rgba(0, 250, 100, 0.45);
  font-weight: 700;
  margin-bottom: 0.65rem;
}
body.battleship-page .battleship-ship-name {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -108%);
  font-family: 'Orbitron', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(0.62rem, 1.85vw, 0.88rem);
  letter-spacing: 0.06em;
  color: #00fa64;
  text-shadow:
    0 0 12px rgba(0, 250, 100, 0.55),
    0 0 3px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
  max-width: min(14rem, 52vw);
  overflow: hidden;
  text-overflow: ellipsis;
}
body.battleship-page .battleship-hud {
  position: fixed;
  z-index: 52;
  pointer-events: none;
  font-family: 'Orbitron', system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(0.95rem, 2.8vw, 1.35rem);
  line-height: 1;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
body.battleship-page .battleship-hud--time {
  top: 1rem;
  left: 1rem;
  color: #00fa64;
  text-shadow: 0 0 16px rgba(0, 250, 100, 0.45);
}
body.battleship-page .battleship-hud--hp {
  top: 1rem;
  right: 1rem;
  color: #00fa64;
  text-shadow: 0 0 16px rgba(0, 250, 100, 0.45);
}
body.battleship-page .battleship-music-toggle {
  display: none;
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 52;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(0, 250, 100, 0.35);
  background: rgba(2, 18, 10, 0.82);
  color: #00fa64;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  font-size: 1.15rem;
  line-height: 1;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
body.battleship-page .battleship-music-toggle:hover {
  border-color: rgba(0, 250, 100, 0.55);
  color: #4dff9a;
}
body.battleship-page .battleship-music-toggle:active {
  transform: scale(0.96);
}
body.battleship-page .battleship-music-toggle__icon--off {
  display: none;
}
body.battleship-page .battleship-music-toggle--muted .battleship-music-toggle__icon--on {
  display: none;
}
body.battleship-page .battleship-music-toggle--muted .battleship-music-toggle__icon--off {
  display: inline;
  color: rgba(148, 163, 184, 0.95);
}
body.battleship-page.rocket-mode .battleship-music-toggle {
  display: flex;
}
body.battleship-page .battleship-nitro {
  display: none;
  position: fixed;
  right: 1rem;
  bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 52;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  pointer-events: none;
  font-family: 'Orbitron', system-ui, sans-serif;
}
body.battleship-page.rocket-mode .battleship-nitro {
  display: flex;
}
body.battleship-page .battleship-nitro__label {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: rgba(134, 239, 172, 0.95);
  text-shadow: 0 0 10px rgba(0, 250, 100, 0.35);
}
body.battleship-page .battleship-nitro__blocks {
  display: flex;
  gap: 5px;
  align-items: stretch;
  width: min(11.5rem, 52vw);
}
body.battleship-page .battleship-nitro__block {
  flex: 1;
  min-width: 4px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid rgba(0, 250, 100, 0.38);
  background: rgba(0, 28, 14, 0.75);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.35);
}
body.battleship-page .battleship-nitro__fill {
  width: 100%;
  height: 100%;
  transform-origin: bottom center;
  transform: scaleY(1);
  background: linear-gradient(180deg, #5dff9e 0%, #00c853 55%, #007a33 100%);
  box-shadow: 0 0 12px rgba(0, 250, 100, 0.45);
}
@media (max-width: 520px) {
  body.battleship-page .battleship-nitro {
    bottom: calc(3.85rem + env(safe-area-inset-bottom, 0px));
    right: 0.65rem;
  }
  body.battleship-page .battleship-nitro__blocks {
    width: min(10rem, 58vw);
    gap: 4px;
  }
}
body.battleship-page.battleship-active:not(.rocket-mode) .battleship-hud,
body.battleship-page.battleship-active:not(.rocket-mode) .battleship-leaderboard {
  opacity: 0.35;
}
body.battleship-page .battleship-leaderboard {
  position: fixed;
  left: 0.65rem;
  top: 3.25rem;
  z-index: 51;
  width: min(13.5rem, 42vw);
  max-height: min(86vh, 640px);
  overflow: auto;
  padding: 0.55rem 0.7rem 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 250, 100, 0.28);
  background: rgba(2, 18, 10, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  font-family: 'Orbitron', system-ui, sans-serif;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 250, 100, 0.9) rgba(8, 34, 18, 0.85);
}
body.battleship-page .battleship-leaderboard::-webkit-scrollbar {
  width: 12px;
}
body.battleship-page .battleship-leaderboard::-webkit-scrollbar-track {
  background: rgba(8, 34, 18, 0.9);
  border-radius: 999px;
}
body.battleship-page .battleship-leaderboard::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 250, 100, 1), rgba(2, 180, 88, 0.95));
  border-radius: 999px;
  border: 2px solid rgba(8, 34, 18, 0.92);
}
body.battleship-page .battleship-leaderboard::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(110, 255, 165, 1), rgba(0, 212, 106, 0.98));
}
body.battleship-page .battleship-leaderboard__head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.35rem;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #00fa64;
  text-shadow: 0 0 12px rgba(0, 250, 100, 0.4);
}
body.battleship-page .battleship-leaderboard__sub {
  margin: 0 0 0.5rem;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #86efac;
  opacity: 0.95;
}
body.battleship-page .battleship-leaderboard__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
body.battleship-page .battleship-leaderboard__row {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.26rem 0;
  font-size: 0.66rem;
  font-weight: 600;
  color: #d1fae5;
  border-bottom: 1px solid rgba(0, 250, 100, 0.12);
}
body.battleship-page .battleship-leaderboard__row:last-child {
  border-bottom: none;
}
body.battleship-page .battleship-leaderboard__rank {
  color: rgba(110, 231, 160, 0.85);
  font-variant-numeric: tabular-nums;
}
body.battleship-page .battleship-leaderboard__name {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
body.battleship-page .battleship-leaderboard__name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
body.battleship-page .battleship-leaderboard__dot {
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 999px;
  background: #6ee7a0;
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 0 0.35rem rgba(0, 0, 0, 0.45);
  flex: 0 0 auto;
}
body.battleship-page .battleship-leaderboard__time {
  font-variant-numeric: tabular-nums;
  color: #00fa64;
  flex-shrink: 0;
}
body.battleship-page .battleship-leaderboard__empty {
  margin: 0;
  font-size: 0.65rem;
  color: #6ee7a0;
  opacity: 0.85;
}
@media (max-width: 768px) {
  body.battleship-page .battleship-leaderboard {
    width: min(17rem, calc(100vw - 1.3rem));
    max-height: min(62vh, 460px);
    top: 5rem;
  }
  body.battleship-page .battleship-hud--time {
    top: 0.75rem;
    left: 0.65rem;
    font-size: clamp(0.85rem, 3vw, 1.1rem);
  }
  body.battleship-page .battleship-hud--hp {
    top: 0.75rem;
    right: 0.65rem;
    font-size: clamp(0.85rem, 3vw, 1.1rem);
  }
}
