/* OrbitDoku v17.27 · tablero visible y controles accesibles en una pantalla.
   Solo presentación: sin cambios en reglas, pistas, música o guardados. */
@media (max-width:600px) and (orientation:portrait) {
  html,body { overflow:hidden!important; overscroll-behavior:none; }
  .app.orbit-fitted {
    height:var(--orbit-visible-height,100svh)!important;
    max-height:var(--orbit-visible-height,100svh)!important;
    min-height:0!important;
    overflow:hidden!important;
    display:flex;
    flex-direction:column;
  }
  .app.orbit-fitted > header { flex:0 0 auto; }
  .app.orbit-fitted > .panel { flex:0 0 auto; min-height:0; }
  .app.orbit-fitted .board-shell {
    width:var(--orbit-board-size)!important;
    height:var(--orbit-board-size)!important;
    aspect-ratio:1/1!important;
    max-width:100%!important;
    min-width:0!important;
    flex:0 0 auto!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
  .app.orbit-fitted .board-shell > .grid,
  .app.orbit-fitted .board-shell #grid {
    width:100%!important;
    height:100%!important;
    aspect-ratio:1/1!important;
  }
  /* La parte inferior nunca se desplaza debajo del borde del teléfono. */
  .app.orbit-fitted .buttons { flex:0 0 auto; }
  .app.orbit-fitted .buttons .button { min-height:42px; }
  .app.orbit-fitted .msg { max-height:38px; overflow:hidden; }
  /* Pistas: el tablero permanece en su sitio y los dos botones siguen accesibles. */
  .app.orbit-fitted .hint-panel:not([hidden]) {
    max-height:min(54svh,345px)!important;
    max-height:min(54dvh,345px)!important;
    overflow-y:auto!important;
    overscroll-behavior:contain;
    padding-bottom:8px;
  }
  .app.orbit-fitted .hint-panel .hint-actions {
    position:sticky;
    bottom:-8px;
    z-index:8;
    flex:0 0 auto;
    padding:7px 0 7px;
    background:#36285d;
    border-radius:10px;
  }
  /* Las tarjetas de fin de nivel permanecen centradas dentro de la altura visible. */
  .victory-nav:not([hidden]), .defeat-screen:not([hidden]) {
    max-height:var(--orbit-visible-height,100svh);
  }
}
@media (max-width:600px) and (orientation:portrait) and (max-height:700px) {
  .app.orbit-fitted header { padding-bottom:2px; }
  .app.orbit-fitted .panel { padding-bottom:5px; }
  .app.orbit-fitted .planet-progress-block { margin-bottom:4px; }
  .app.orbit-fitted .orbit-planet-progress { padding-top:3px; padding-bottom:3px; }
  .app.orbit-fitted .rules-mini { margin-bottom:3px; }
  .app.orbit-fitted .rules-mini-item { min-height:36px; }
  .app.orbit-fitted .rules-mini-item svg { width:27px;height:27px;flex-basis:27px; }
  .app.orbit-fitted .board-swipe-help { margin-top:3px; }
  .app.orbit-fitted .msg { margin:3px 2px 0; line-height:1.2; min-height:16px; max-height:30px; }
  .app.orbit-fitted .buttons { margin-top:4px; }
  .app.orbit-fitted .buttons .button { min-height:42px; padding:7px 5px; }
  .victory-nav:not([hidden]) .victory-card { max-height:calc(var(--orbit-visible-height,100svh) - 28px); overflow-y:auto; }
}
@media (max-width:600px) and (orientation:portrait) and (max-height:590px) {
  .app.orbit-fitted header { padding-bottom:0; }
  .app.orbit-fitted .panel { padding:3px 3px 4px; }
  .app.orbit-fitted .meta { margin-bottom:2px; }
  .app.orbit-fitted .planet-progress-label { margin-bottom:2px; }
  .app.orbit-fitted .planet-progress-block { margin-bottom:2px; }
  .app.orbit-fitted .rules-mini { margin-bottom:2px; gap:3px; }
  .app.orbit-fitted .rules-mini-item { min-height:29px;padding:1px 2px;gap:3px; }
  .app.orbit-fitted .rules-mini-item svg { width:24px;height:24px;flex-basis:24px; }
  .app.orbit-fitted .rules-mini-item strong { font-size:9px; }
  .app.orbit-fitted .rules-mini-item small { display:none; }
  .app.orbit-fitted .board-swipe-help { display:none!important; }
  .app.orbit-fitted .msg { margin:2px 2px 0; min-height:15px;max-height:27px;font-size:10px; }
  .app.orbit-fitted .buttons { margin-top:3px; }
  .app.orbit-fitted .buttons .button { min-height:42px; }
  .victory-nav:not([hidden]) .victory-card { padding:12px 14px;gap:4px; }
  .victory-nav:not([hidden]) .victory-card .victory-star { font-size:38px; }
  .victory-nav:not([hidden]) .victory-card h2 { font-size:23px; }
  .victory-nav:not([hidden]) .victory-card p { font-size:12px;line-height:1.35;margin:2px; }
  .victory-nav:not([hidden]) .victory-card .victory-links a { min-height:44px;font-size:12px; }
}
@media (max-width:600px) and (orientation:portrait) and (max-height:530px) {
  .app.orbit-fitted .rules-mini-item strong { display:none; }
  .app.orbit-fitted .rules-mini-item { min-height:25px; }
  .app.orbit-fitted .rules-mini-item svg { width:23px;height:23px;flex-basis:23px; }
  .app.orbit-fitted .hero-planet { width:27px;height:27px;flex-basis:27px; }
  .app.orbit-fitted h1 { font-size:23px; }
  .app.orbit-fitted .orbit-planet-progress-slot { max-width:23px; }
}

/* v17.40 · Juego equilibrado verticalmente solo cuando sobra altura real.
   No modifica el tablero, el progreso ni los botones. */
@media (max-width:600px) and (orientation:portrait){
  .app.orbit-fitted.orbit-balanced{
    justify-content:center!important;
  }
}

/* v17.40 · Recordatorio de gestos completo, legible y sin frases largas. */
@media (max-width:600px) and (orientation:portrait){
  .app.orbit-fitted .board-swipe-help{
    margin:4px 2px 0!important;
    font-size:clamp(10px,2.6vw,11px)!important;
    line-height:1.2!important;
    min-height:13px;
    white-space:normal;
    text-wrap:balance;
  }
}
