/* Super Penalty Hero — flagship device-fit and accessibility pass (2026-09-10) */

/* Keep the comic HUD and modal content clear of notches, rounded corners and
   mobile browser chrome without changing the 540×960 game-world geometry. */
.hud {
  padding-top: max(7px, env(safe-area-inset-top));
  padding-right: max(9px, env(safe-area-inset-right));
  padding-left: max(9px, env(safe-area-inset-left));
}

.screen {
  padding:
    max(14px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
}

/* Primary controls remain comfortably tappable even when the comic skin
   visually compresses them. */
.hud-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
}

.btn,
.auth-link,
.fb-btn,
.nn-nudge-signup,
.nn-nudge-later {
  min-height: 44px;
  touch-action: manipulation;
}

/* How-to, pause and result states must stay reachable on short phones and
   tablets in landscape rather than clipping below the browser viewport. */
.panel {
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.screen.active {
  overflow: hidden;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid #efc64a;
  outline-offset: 3px;
}

/* The identity pass intentionally hid all account state on phones. Preserve
   the uncluttered controls hint, but keep NNPlays sign-in/sign-out reachable. */
@media (max-width: 560px) {
  #screen-start .auth-row {
    display: flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    color: #f3e8c7;
  }

  #screen-start .auth-status {
    color: #f3e8c7;
    font-size: 10px;
  }

  #screen-start .auth-link {
    color: #fff1c9;
    background: rgba(25, 29, 38, .72);
    border: 2px solid #efc64a;
    padding: 7px 10px;
  }

  #screen-start .controls-hint {
    display: none;
  }

  #screen-start .panel {
    padding-bottom: max(5%, env(safe-area-inset-bottom));
  }
}

/* Narrow-phone HUD compaction keeps all three 44px controls and the score
   readable without shrinking interaction targets. */
@media (max-width: 380px) {
  .hud {
    padding-right: max(5px, env(safe-area-inset-right));
    padding-left: max(5px, env(safe-area-inset-left));
  }

  .hud-row,
  .hud-group {
    gap: 3px;
  }

  .hud-row {
    padding-left: 3px;
    padding-right: 3px;
  }

  .hud-value {
    font-size: 17px !important;
  }

  .hud-label {
    font-size: 6px !important;
  }

  .lives {
    font-size: 11px;
  }

  .phase-hint {
    max-width: calc(100% - 10px);
    font-size: 9px !important;
  }
}

@media (max-height: 700px) {
  .screen {
    align-items: flex-start;
  }

  .panel {
    margin: auto;
  }

  #screen-how .panel,
  #screen-pause .panel,
  #screen-gameover .panel {
    padding-top: 14px;
    padding-bottom: 14px;
  }
}

@media (orientation: landscape) and (pointer: coarse) and (max-height: 600px) {
  #frame {
    height: 100dvh;
    max-height: 100dvh;
  }

  .screen {
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .panel {
    max-height: calc(100dvh - 16px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hud,
  .hud-btn,
  .btn,
  .phase-hint,
  .result-banner,
  .flash {
    transition: none !important;
    animation: none !important;
  }
}
