/* Ajuste aislado de altura para Meteorito Run. No modifica la lógica del juego. */

@media (min-width: 1261px) {
  html,
  body {
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
  }

  body {
    display: grid;
    grid-template-rows: 70px minmax(0, 1fr);
  }

  .game-header {
    width: min(calc(100% - 32px), 1480px);
    height: 70px;
    min-height: 70px;
  }

  .brand__logo {
    width: 44px;
    height: 44px;
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  .game-shell {
    width: min(calc(100% - 32px), 1480px);
    height: calc(100dvh - 70px);
    min-height: 0;
    margin-top: 0;
    padding: 14px 0 18px;
    align-items: stretch;
    overflow: hidden;
  }

  .game-copy {
    align-self: center;
    min-height: 0;
  }

  .game-frame {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: 38px minmax(0, 1fr) 38px;
  }

  .frame-top,
  .frame-bottom {
    min-height: 38px;
    height: 38px;
  }

  .canvas-wrap {
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
  }

  .game-footer {
    display: none;
  }

  .overlay {
    min-height: 0;
    overflow: hidden !important;
  }

  .overlay-card {
    max-height: calc(100% - 28px);
  }

  .overlay-card--gameover {
    width: min(88%, 490px);
    padding: clamp(20px, 2.4vh, 28px);
  }

  .overlay-card--gameover h2 {
    margin: clamp(10px, 1.8vh, 18px) 0;
    font-size: clamp(1.55rem, 3.2vh, 2.3rem);
  }

  .overlay-card--gameover p {
    font-size: clamp(.78rem, 1.8vh, .9rem);
    line-height: 1.45;
  }

  .overlay-card--gameover .result-grid {
    margin: clamp(14px, 2.2vh, 24px) 0 4px;
  }

  .overlay-card--gameover .result-grid div {
    padding: clamp(11px, 1.8vh, 16px) 8px;
  }

  .overlay-card--gameover .button {
    min-height: 46px;
    margin-top: clamp(14px, 2vh, 22px);
  }
}

@media (min-width: 1261px) and (max-height: 860px) {
  body {
    grid-template-rows: 58px minmax(0, 1fr);
  }

  .game-header {
    height: 58px;
    min-height: 58px;
  }

  .brand__logo {
    width: 38px;
    height: 38px;
  }

  .brand strong {
    font-size: .6rem;
  }

  .brand small {
    font-size: .34rem;
  }

  .game-shell {
    height: calc(100dvh - 58px);
    padding: 8px 0 12px;
    gap: clamp(34px, 4vw, 64px);
  }

  .eyebrow {
    padding: 7px 10px;
    font-size: .38rem;
  }

  .game-copy h1 {
    margin: 20px 0 14px;
    font-size: clamp(1.65rem, 2.7vw, 2.85rem);
    line-height: 1.27;
  }

  .game-copy > p {
    font-size: .88rem;
    line-height: 1.55;
  }

  .mini-stats {
    margin-top: 22px;
    gap: 10px;
  }

  .mini-stats div {
    min-height: 72px;
    padding: 13px 15px;
  }

  .game-frame {
    grid-template-rows: 34px minmax(0, 1fr) 34px;
  }

  .frame-top,
  .frame-bottom {
    min-height: 34px;
    height: 34px;
    font-size: .32rem;
  }

  .overlay-card--start,
  .overlay-card--gameover,
  .overlay-card--compact {
    max-height: calc(100% - 18px);
  }
}

@media (min-width: 1261px) and (max-height: 720px) {
  body {
    grid-template-rows: 52px minmax(0, 1fr);
  }

  .game-header {
    height: 52px;
    min-height: 52px;
  }

  .game-shell {
    height: calc(100dvh - 52px);
    padding: 6px 0 8px;
  }

  .game-copy h1 {
    margin: 14px 0 10px;
    font-size: clamp(1.45rem, 2.4vw, 2.45rem);
  }

  .game-copy > p {
    font-size: .8rem;
    line-height: 1.45;
  }

  .mini-stats {
    margin-top: 16px;
  }

  .mini-stats div {
    min-height: 62px;
    padding: 10px 13px;
  }

  .overlay-card--gameover {
    padding: 16px 20px;
  }

  .overlay-card--gameover h2 {
    margin: 8px 0;
    font-size: 1.45rem;
  }

  .overlay-card--gameover .result-grid {
    margin: 11px 0 3px;
  }

  .overlay-card--gameover .result-grid div {
    padding: 9px 6px;
  }

  .overlay-card--gameover .button {
    min-height: 40px;
    margin-top: 11px;
  }
}

/* Tablet y mobile conservan desplazamiento natural y su layout actual. */
@media (max-width: 1260px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
  }
}
