:root {
  --ink: #131b24;
  --ocean-dark: #091722;
  --teal: #1d8a8a;
  --teal-bright: #38d9c4;
  --amber: #f59e0b;
  --amber-bright: #fde047;
  --coral: #fb7185;
  --paper: #f8fafc;
  --glass: rgba(12, 24, 38, 0.84);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background: radial-gradient(circle at 50% 20%, #153447 0%, #07131d 75%);
  color: var(--paper);
  font-family: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, sans-serif;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.stage {
  position: relative;
  width: min(calc(100vw - 20px), calc((100dvh - 20px) * 16 / 9));
  aspect-ratio: 16 / 9;
  max-width: 1440px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  border: 3.5px solid var(--ink);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55), 0 0 0 2px rgba(125, 211, 252, 0.25);
  background: #0d2534;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.hidden {
  display: none !important;
}

/* --- HUD --- */
.hud {
  position: absolute;
  top: 8px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 7px;
  pointer-events: none;
  z-index: 15;
}

.hud-left,
.hud-center,
.hud-right {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.hud-center {
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
}

.hud-left {
  flex-direction: column;
  align-items: flex-start;
}

.pill {
  background: var(--glass);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 4px 9px;
  box-shadow: 0 3px 0 rgba(19, 27, 36, 0.72);
  backdrop-filter: blur(4px);
}

.score-pill {
  min-width: 174px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rank-badge {
  font-size: 17px;
  line-height: 1;
}

.score-value {
  font-size: clamp(13px, 1.5vw, 17px);
  font-weight: 900;
  color: var(--amber-bright);
  line-height: 1.05;
}

.score-value small {
  font-size: 10.5px;
  color: #cbd5e1;
  font-weight: 700;
}

.rank-title {
  font-size: 10px;
  color: #93c5fd;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.combo-badge {
  margin-left: auto;
  background: linear-gradient(135deg, #f97316, #ec4899);
  border: 1.8px solid var(--ink);
  color: #fff;
  font-weight: 900;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  animation: pulseCombo 0.8s ease-in-out infinite alternate;
}

@keyframes pulseCombo {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}

.bars-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.energy-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.bar-label {
  font-size: 10.5px;
}

.bar-track {
  flex: 1;
  height: 7px;
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #4ade80, #a3e635);
  transition: width 0.1s linear;
}

.lives-wrap {
  font-size: 11px;
  letter-spacing: 0.5px;
}

.stealth-pill {
  background: rgba(20, 83, 45, 0.88);
  color: #bbf7d0;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
}

.mission-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(10.5px, 1.15vw, 12.5px);
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
}

#hud-mission-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.mission-tag {
  background: #f59e0b;
  color: var(--ink);
  font-weight: 900;
  font-size: 10px;
  padding: 1.5px 6px;
  border-radius: 6px;
  border: 1.5px solid var(--ink);
  white-space: nowrap;
}

.mission-prog {
  background: rgba(56, 189, 248, 0.22);
  border: 1.5px solid #38bdf8;
  color: #e0f2fe;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 11px;
  white-space: nowrap;
}

.icon-btn {
  pointer-events: auto;
  background: var(--glass);
  color: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 4px 8px;
  font-weight: 800;
  font-size: clamp(10.5px, 1.1vw, 12px);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 3px 0 rgba(19, 27, 36, 0.75);
  transition: transform 0.1s ease, background 0.15s ease;
}

.icon-btn:hover {
  background: rgba(30, 58, 86, 0.95);
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: translateY(1px);
}

.icon-btn.active {
  background: #0f766e;
  color: #ccfbf1;
}

/* --- BOTTOM ACTION DOCK (DESKTOP) --- */
.action-dock {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
  z-index: 12;
}

.dock-stats {
  display: flex;
  gap: 10px;
  background: var(--glass);
  border: 2.2px solid var(--ink);
  border-radius: 12px;
  padding: 5px 12px;
  font-size: 12.5px;
  color: #e2e8f0;
  box-shadow: 0 3px 0 rgba(19, 27, 36, 0.72);
}

.dock-stats strong {
  color: var(--amber-bright);
}

.dock-buttons {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.act-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--glass);
  color: #f8fafc;
  border: 2.4px solid var(--ink);
  border-radius: 12px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(19, 27, 36, 0.78);
  transition: transform 0.1s ease, background 0.15s ease;
}

.act-btn:hover {
  background: rgba(30, 58, 86, 0.95);
  transform: translateY(-1px);
}

.act-btn:active {
  transform: translateY(1px);
}

.act-btn.highlight {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #ffffff;
  animation: pulseBtn 0.45s ease-in-out infinite alternate;
}

.act-btn.danger-highlight {
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #ffffff;
  animation: pulseBtn 0.35s ease-in-out infinite alternate;
}

@keyframes pulseBtn {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.07);
  }
}

kbd {
  display: inline-block;
  background: #f8fafc;
  color: var(--ink);
  border: 1.8px solid var(--ink);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 900;
  font-family: inherit;
  box-shadow: 0 2px 0 var(--ink);
}

/* --- TOUCH MODE VISIBILITY & CONTROLS --- */
.touch-controls {
  display: none;
  touch-action: none;
}

.touch-controls-guide {
  display: none !important;
}

body.touch-mode .action-dock,
body.touch-mode .desktop-only,
body.touch-mode .desktop-controls-guide {
  display: none !important;
}

body.touch-mode .touch-controls-guide {
  display: grid !important;
}

.t-pill {
  display: inline-block;
  background: rgba(56, 189, 248, 0.22);
  border: 1.8px solid #38bdf8;
  color: #e0f2fe;
  border-radius: 8px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

/* Floating Touch Controls (Landscape mobile / Tablet / Desktop touch preview) */
body.touch-mode .touch-controls {
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 16;
}

.touch-stats-strip {
  display: none;
}

.touch-deck {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.joy-zone {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 44%;
  height: 58%;
  pointer-events: auto;
  touch-action: none;
}

.joy-base {
  position: absolute;
  left: 88px;
  top: calc(100% - 88px);
  width: 116px;
  height: 116px;
  margin-left: -58px;
  margin-top: -58px;
  border-radius: 50%;
  background: rgba(12, 28, 44, 0.42);
  border: 3px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), inset 0 0 0 2px rgba(19, 27, 36, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease, border-color 0.15s ease;
  opacity: 0.72;
}

.joy-base.active {
  opacity: 1;
  border-color: #7dd3fc;
  background: rgba(14, 44, 68, 0.56);
}

.joy-knob {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e0f2fe, #38bdf8 65%, #0284c7);
  border: 2.8px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  will-change: transform;
}

.joy-hint {
  position: absolute;
  left: 20px;
  bottom: 10px;
  font-size: 11px;
  font-weight: 800;
  color: rgba(226, 232, 240, 0.72);
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
}

/* Ergonomic Arc Action Pad (Right Thumb) */
.touch-pad {
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  width: 214px;
  height: 196px;
  pointer-events: none;
}

.t-btn {
  position: absolute;
  pointer-events: auto;
  touch-action: none;
  border-radius: 50%;
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink), 0 8px 18px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: #ffffff;
  font-family: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.07s ease, filter 0.12s ease;
}

.t-btn.pressed {
  transform: scale(0.91) translateY(2px);
  box-shadow: 0 2px 0 var(--ink);
  filter: brightness(1.12);
}

.t-primary {
  right: 8px;
  bottom: 8px;
  width: 88px;
  height: 88px;
  background: linear-gradient(145deg, #f59e0b, #fbbf24);
  color: var(--ink);
}

.t-primary .t-icon {
  font-size: 27px;
  line-height: 1;
}

.t-primary .t-label {
  font-size: 11.5px;
  letter-spacing: 0.2px;
}

.t-primary.mode-spit {
  background: linear-gradient(145deg, #22c55e, #15803d);
  color: #ffffff;
  animation: pulseTouchBtn 0.42s ease-in-out infinite alternate;
}

.t-primary.mode-sweet {
  background: linear-gradient(145deg, #4ade80, #16a34a);
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.5), 0 4px 0 var(--ink);
}

.t-primary.mode-shake {
  background: linear-gradient(145deg, #f97316, #dc2626);
  color: #ffffff;
  animation: pulseTouchBtn 0.28s ease-in-out infinite alternate;
}

@keyframes pulseTouchBtn {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}

.t-sat {
  width: 60px;
  height: 60px;
  background: rgba(15, 35, 56, 0.88);
}

.t-sat .t-icon {
  font-size: 19px;
  line-height: 1;
}

.t-sat .t-label {
  font-size: 9.5px;
  color: #e2e8f0;
}

.t-slap {
  right: 108px;
  bottom: 12px;
  background: linear-gradient(145deg, #0284c7, #0369a1);
}

.t-dash {
  right: 102px;
  bottom: 84px;
  background: linear-gradient(145deg, #0d9488, #0f766e);
}

.t-taunt {
  right: 36px;
  bottom: 112px;
  background: linear-gradient(145deg, #db2777, #9d174d);
}

.t-spit {
  right: 158px;
  bottom: 56px;
  width: 50px;
  height: 50px;
  background: rgba(30, 58, 86, 0.88);
}

.t-spit .t-icon {
  font-size: 16px;
}

.t-spit .t-label {
  font-size: 8.5px;
}

/* --- OVERLAYS & MENUS --- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 18, 30, 0.56);
  backdrop-filter: blur(4px);
  z-index: 30;
  padding: 14px;
}

.menu-card {
  width: min(980px, 96%);
  max-height: 95%;
  display: grid;
  grid-template-columns: 300px 1fr;
  background: linear-gradient(155deg, rgba(16, 36, 56, 0.97), rgba(9, 22, 36, 0.98));
  border: 3.5px solid var(--ink);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.6), 0 6px 0 var(--ink);
}

.menu-art {
  position: relative;
  background: #0d1d2f;
  border-right: 3.5px solid var(--ink);
  overflow: hidden;
}

.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
}

.art-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #f59e0b;
  color: var(--ink);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.7px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 2.2px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
}

.corvina-chip {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(248, 250, 252, 0.95);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 6px 10px;
  font-weight: 900;
  font-size: 13px;
  box-shadow: 0 4px 0 var(--ink);
}

.corvina-chip img {
  width: 54px;
  height: 32px;
  object-fit: cover;
  border-radius: 8px;
  border: 1.5px solid var(--ink);
  background: #fff;
}

.menu-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.title-eyebrow {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.3px;
  color: var(--teal-bright);
  text-transform: uppercase;
}

.game-title {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 900;
  letter-spacing: 0.5px;
  line-height: 1.05;
  color: #ffffff;
  text-shadow: 0 3px 0 var(--ink);
}

.game-subtitle {
  font-size: 13.5px;
  line-height: 1.42;
  color: #cbd5e1;
}

.game-subtitle strong {
  color: var(--amber-bright);
}

.theme-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.picker-label {
  font-size: 12.5px;
  font-weight: 800;
  color: #93c5fd;
}

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

.theme-btn {
  background: rgba(15, 30, 48, 0.9);
  color: #e2e8f0;
  border: 2.2px solid var(--ink);
  border-radius: 10px;
  padding: 5px 11px;
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.1s ease, background 0.15s ease;
}

.theme-btn.active {
  background: linear-gradient(135deg, #0ea5e9, #14b8a6);
  color: #ffffff;
}

.cta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  border: 2.8px solid var(--ink);
  border-radius: 14px;
  padding: 10px 20px;
  font-size: 14.5px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.1s ease, filter 0.15s ease;
}

.primary-btn {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: var(--ink);
}

.secondary-btn {
  background: linear-gradient(135deg, #0d9488, #2dd4bf);
  color: var(--ink);
}

.ghost-btn {
  background: rgba(30, 41, 59, 0.92);
  color: #f8fafc;
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.primary-btn:active,
.secondary-btn:active,
.ghost-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink);
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  background: rgba(7, 17, 28, 0.65);
  border: 2px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  padding: 9px 11px;
}

.ctrl-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #e2e8f0;
}

.menu-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.8px;
  color: #94a3b8;
}

.menu-footer strong {
  color: var(--amber-bright);
}

/* --- PAUSE & SUMMARY MODALS --- */
.modal-card {
  width: min(520px, 94%);
  max-height: 92%;
  overflow-y: auto;
  background: linear-gradient(160deg, rgba(16, 36, 56, 0.97), rgba(9, 22, 36, 0.98));
  border: 3.5px solid var(--ink);
  border-radius: 22px;
  padding: 22px 24px;
  text-align: center;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.6), 0 6px 0 var(--ink);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-card h2 {
  font-size: 24px;
  font-weight: 900;
  color: #ffffff;
}

.modal-sub {
  font-size: 13.5px;
  color: #cbd5e1;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.summary-card {
  width: min(580px, 94%);
  text-align: left;
}

.summary-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.summary-fish {
  width: 92px;
  height: 64px;
  object-fit: cover;
  border-radius: 14px;
  border: 2.5px solid var(--ink);
  background: #ffffff;
  flex-shrink: 0;
}

.over-rank {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 800;
  color: var(--amber-bright);
}

.summary-scores {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.big-stat {
  background: rgba(7, 17, 28, 0.72);
  border: 2.2px solid var(--ink);
  border-radius: 14px;
  padding: 9px;
  text-align: center;
}

.big-stat span {
  display: block;
  font-size: 11px;
  color: #93c5fd;
  font-weight: 700;
}

.big-stat strong {
  font-size: 22px;
  color: var(--amber-bright);
  font-weight: 900;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 12px;
  background: rgba(7, 17, 28, 0.55);
  border: 2px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  padding: 11px 13px;
  font-size: 13px;
  color: #e2e8f0;
}

.summary-grid strong {
  color: #4ade80;
}

/* ==========================================================================
   RESPONSIVE TABLET & COMPACT DESKTOP
   ========================================================================== */
@media (max-width: 900px) {
  .menu-card {
    grid-template-columns: 200px 1fr;
  }
  .menu-body {
    padding: 12px 15px;
    gap: 7px;
  }
  .game-title {
    font-size: 21px;
  }
  .game-subtitle {
    font-size: 11.5px;
    line-height: 1.3;
  }
  .controls-grid {
    padding: 7px 9px;
    gap: 4px 8px;
  }
  .ctrl-item {
    font-size: 10.5px;
  }
  .primary-btn,
  .secondary-btn {
    padding: 8px 14px;
    font-size: 13px;
  }
  .score-pill {
    min-width: 138px;
  }
  .dock-stats {
    display: none;
  }
}

/* ==========================================================================
   MÓVIL HORIZONTAL (LANDSCAPE) — Pantalla completa + controles flotantes
   ========================================================================== */
@media (orientation: landscape) and (max-height: 560px) {
  body {
    padding: 0;
  }

  .stage {
    width: 100vw;
    width: 100dvw;
    height: 100dvh;
    aspect-ratio: auto;
    max-width: none;
  }

  .canvas-frame {
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .hud {
    top: max(5px, env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
  }

  .score-pill {
    min-width: 136px;
    padding: 3px 8px;
  }

  .joy-zone {
    width: 40%;
    height: 68%;
  }

  .joy-base {
    width: 98px;
    height: 98px;
    margin-left: -49px;
    margin-top: -49px;
    left: max(70px, calc(env(safe-area-inset-left) + 64px));
    top: calc(100% - 68px);
  }

  .joy-knob {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .joy-hint {
    display: none;
  }

  .touch-pad {
    width: 188px;
    height: 168px;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
  }

  .t-primary {
    width: 76px;
    height: 76px;
  }

  .t-primary .t-icon {
    font-size: 22px;
  }

  .t-primary .t-label {
    font-size: 10px;
  }

  .t-sat {
    width: 52px;
    height: 52px;
  }

  .t-sat .t-icon {
    font-size: 16px;
  }

  .t-sat .t-label {
    font-size: 8.5px;
  }

  .t-slap {
    right: 92px;
    bottom: 8px;
  }

  .t-dash {
    right: 88px;
    bottom: 70px;
  }

  .t-taunt {
    right: 28px;
    bottom: 94px;
  }

  .t-spit {
    right: 138px;
    bottom: 44px;
    width: 44px;
    height: 44px;
  }

  .menu-card {
    grid-template-columns: 185px 1fr;
    max-height: 94dvh;
  }

  .menu-body {
    padding: 10px 14px;
    gap: 6px;
  }

  .game-subtitle {
    display: none;
  }
}

/* ==========================================================================
   MÓVIL VERTICAL (PORTRAIT) — HUD arriba · Mar sin tapar · Gamepad debajo
   ========================================================================== */
@media (orientation: portrait) and (max-width: 780px) {
  body {
    padding: 0;
    align-items: stretch;
    justify-content: flex-start;
  }

  .stage {
    width: 100vw;
    width: 100dvw;
    height: 100dvh;
    aspect-ratio: auto;
    max-width: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    background: linear-gradient(180deg, #0b1c2c 0%, #07131d 100%);
  }

  /* HUD limpio ARRIBA del mar (cero obstrucción a los pescadores) */
  .hud {
    position: static;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px 6px;
    background: rgba(8, 19, 30, 0.94);
    border-bottom: 2.5px solid var(--ink);
    pointer-events: auto;
  }

  .hud-left {
    order: 1;
    flex: 1 1 auto;
  }

  .hud-right {
    order: 2;
    gap: 5px;
  }

  .hud-center {
    order: 3;
    flex: 1 0 100%;
  }

  .score-pill {
    width: 100%;
    min-width: 0;
    padding: 5px 9px;
  }

  .mission-pill {
    width: 100%;
    justify-content: space-between;
    font-size: 11.5px;
    padding: 5px 9px;
  }

  .icon-btn {
    padding: 6px 8px;
    font-size: 11.5px;
  }

  /* Lienzo del mar a todo el ancho, 100% libre de dedos */
  .canvas-frame {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 2px solid var(--ink);
    border-bottom: 3px solid var(--ink);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  }

  /* Gamepad táctil ergonómico DEBAJO del mar */
  body.touch-mode .touch-controls {
    position: relative;
    inset: auto;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    background: radial-gradient(circle at 50% 0%, #102b3f 0%, #081522 72%);
  }

  .touch-stats-strip {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #cbd5e1;
    background: rgba(6, 15, 24, 0.72);
    border-bottom: 2px solid rgba(125, 211, 252, 0.14);
  }

  .touch-stats-strip strong {
    color: var(--amber-bright);
  }

  .touch-deck {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: auto;
    padding: 8px 10px 12px;
  }

  .joy-zone {
    position: relative;
    left: auto;
    bottom: auto;
    width: 48%;
    height: 100%;
    min-height: 195px;
  }

  .joy-base {
    left: 50%;
    top: 46%;
    width: 124px;
    height: 124px;
    margin-left: -62px;
    margin-top: -62px;
    opacity: 0.92;
  }

  .joy-hint {
    left: 0;
    right: 0;
    top: calc(46% + 76px);
    bottom: auto;
    text-align: center;
    font-size: 11px;
  }

  .touch-pad {
    position: relative;
    right: auto;
    bottom: auto;
    width: 52%;
    max-width: 215px;
    height: 205px;
    flex-shrink: 0;
  }

  .t-primary {
    right: 6px;
    bottom: 12px;
    width: 86px;
    height: 86px;
  }

  .t-slap {
    right: 104px;
    bottom: 16px;
  }

  .t-dash {
    right: 98px;
    bottom: 88px;
  }

  .t-taunt {
    right: 32px;
    bottom: 114px;
  }

  .t-spit {
    right: 150px;
    bottom: 58px;
  }

  /* Overlays a pantalla completa en vertical con arte de portada arriba */
  .overlay {
    position: fixed;
    inset: 0;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  }

  .menu-card {
    width: 100%;
    max-width: 440px;
    max-height: 94dvh;
    grid-template-columns: 1fr;
    grid-template-rows: 175px 1fr;
  }

  .menu-art {
    display: block;
    border-right: none;
    border-bottom: 3px solid var(--ink);
  }

  .cover-img {
    object-position: center 26%;
  }

  .corvina-chip {
    bottom: 8px;
    padding: 4px 8px;
    font-size: 12px;
  }

  .menu-body {
    padding: 14px 16px;
    gap: 10px;
    justify-content: flex-start;
  }

  .game-title {
    font-size: 24px;
  }

  .game-subtitle {
    font-size: 12.5px;
    line-height: 1.38;
  }

  .cta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .primary-btn,
  .secondary-btn {
    padding: 11px 10px;
    font-size: 13.5px;
    text-align: center;
  }

  .controls-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .ctrl-item {
    font-size: 12px;
  }

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