/* ==========================================================================
   PAPA SQUID: MEME MAYHEM — RESPONSIVE ADJUSTMENTS
   Mobile breakpoints, touch displays, and safe areas
   ========================================================================== */

@media (max-width: 991.98px) {
  .section-title {
    font-size: 1.8rem;
  }

  .level-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .daily-reward-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #screen-game {
    height: calc(100vh - 120px);
    height: calc(100dvh - 120px);
    min-height: min(420px, calc(100dvh - 120px));
  }

  .character-preview-box {
    height: min(45vw, 400px) !important;
  }
}

@media (max-width: 767.98px) {
  .game-navbar {
    padding: 0.5rem 0.75rem;
  }

  .game-navbar > .container-fluid {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .brand-title {
    font-size: 1.1rem;
  }

  .brand-tagline {
    display: none;
  }

  .section-title {
    font-size: 1.5rem;
    line-height: 1.15;
    flex-wrap: wrap;
  }

  .section-subtitle {
    font-size: 0.95rem;
  }

  #screen-modes > .d-flex,
  #screen-inventory > .d-flex {
    flex-direction: column;
    align-items: flex-start !important;
  }

  .screen {
    padding-top: 1rem;
    padding-bottom: 2rem;
  }

  #screen-game {
    height: calc(100vh - 126px);
    height: calc(100dvh - 126px);
    min-height: min(420px, calc(100dvh - 126px));
  }

  .level-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
  }

  .daily-reward-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .character-preview-box {
    height: clamp(240px, 68vw, 340px) !important;
  }

  .game-hud-top {
    top: 10px;
    left: 10px;
    right: 10px;
    gap: 0.4rem;
  }

  .hud-pill {
    padding: 0.3rem 0.65rem;
    border-width: 2px;
    font-size: 0.9rem;
    gap: 0.35rem;
  }

  .hud-timer,
  .hud-coins {
    font-size: 0.95rem;
  }

  .hud-progress-wrap {
    min-width: 0;
    margin: 0;
  }

  .traffic-pill {
    max-width: calc(100vw - 32px);
    padding: 0.45rem 1rem;
    font-size: 1rem;
    white-space: normal;
  }

  .red-green-indicator-box,
  .glass-bridge-hud,
  .rush-hud-status {
    top: 68px;
  }

  .game-hud-bottom {
    bottom: 12px;
    left: 12px;
    right: 12px;
  }

  .virtual-joystick-base {
    width: 100px;
    height: 100px;
    display: block !important;
  }

  .virtual-joystick-thumb {
    width: 44px;
    height: 44px;
  }

  .desktop-controls-hint {
    display: none !important;
  }

  .action-buttons-wrap {
    display: flex;
    gap: 0.5rem;
  }

  .btn-action-touch {
    width: 58px;
    height: 58px;
    font-size: 0.9rem;
  }

  .game-modal-overlay {
    padding: 0.75rem;
    align-items: center;
  }

  .game-modal-content {
    padding: 1.5rem;
    max-height: calc(100dvh - 1.5rem);
    border-width: 3px;
    border-radius: 22px;
  }

  #toast-container {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .squid-toast {
    max-width: 100%;
    padding: 0.75rem 1rem;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 480px) {
  .game-navbar > .container-fluid {
    padding-right: 0;
    padding-left: 0;
  }

  .brand-logo-wrap {
    gap: 0.45rem;
  }

  .brand-icon-badge {
    width: 32px;
    height: 32px;
    border-width: 2px;
    border-radius: 11px;
    font-size: 1.2rem;
  }

  .brand-title {
    font-size: 0.88rem;
  }

  .currency-badge {
    gap: 0.2rem;
    padding: 0.16rem 0.3rem;
    border-width: 1px;
    font-size: 0.72rem;
  }

  .game-navbar .nav-player-pill {
    padding: 0.15rem;
    border-width: 1px;
  }

  .game-navbar .nav-avatar-mini {
    width: 28px;
    height: 28px;
  }

  .game-navbar .container-fluid > .d-flex {
    gap: 0.3rem !important;
  }

  .game-navbar .btn[data-screen="settings"] {
    padding: 0.15rem !important;
  }

  .nav-tabs-squid {
    gap: 0.15rem;
  }

  .nav-tabs-squid .nav-link {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
  }

  .level-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .daily-reward-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-card {
    border-radius: 18px;
    padding: 1rem;
  }

  #screen-home .btn-squid-lg {
    width: 100%;
  }

  .game-hud-top {
    left: 7px;
    right: 7px;
  }

  .game-hud-top .hud-pill {
    padding: 0.25rem 0.45rem;
    font-size: 0.8rem;
  }

  .game-hud-top .btn-squid {
    padding: 0.3rem !important;
  }

  .game-hud-top .btn-squid i {
    font-size: 1rem !important;
  }

  .game-hud-bottom {
    left: 8px;
    right: 8px;
  }

  .virtual-joystick-base {
    width: 88px;
    height: 88px;
  }

  .btn-action-touch {
    width: 52px;
    height: 52px;
  }

  .game-modal-content {
    padding: 1.5rem;
  }
}

@media (hover: none) and (pointer: coarse) {
  .virtual-joystick-base {
    display: block !important;
  }

  .desktop-controls-hint {
    display: none !important;
  }

  .action-buttons-wrap {
    display: flex;
  }
}
