/* mobile-fix.css v5 — shared mobile optimizations for 4thmovelogic.com */
@media (max-width: 600px) {
  /* Compact HUD — single row, no wrapping */
  .hud {
    padding: 6px 8px !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    overflow: hidden !important;
  }
  .hud .left, .hud .hud-left {
    gap: 5px !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
  }

  /* Hide ALL non-essential controls — JS marks with .mob-auto-hide */
  .hud .mob-auto-hide {
    display: none !important;
  }

  /* Hide the stats row (.right) and title badge (.mid) on mobile.
     Bank is shown inline by JS. Full stats accessible in gear drawer. */
  .hud .right,
  .hud .hud-right,
  .hud .mid {
    display: none !important;
  }

  /* Bug 7+9: EXIT button — 44px touch target */
  .btn.exit, .exit-btn, .exit {
    min-height: 44px !important;
    min-width: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.75rem !important;
    padding: 6px 12px !important;
  }

  /* Bug 7: HELP button — 44px touch target */
  .btn.help, .help-btn {
    min-height: 44px !important;
    min-width: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.75rem !important;
    padding: 6px 12px !important;
  }

  /* Hub icon shrink */
  .hub-icon {
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
  }
  .hub-icon svg {
    width: 14px !important;
    height: 14px !important;
  }

  /* === INLINE BANK — always visible in HUD bar === */
  .mob-bank-inline {
    display: inline-flex !important;
    align-items: center;
    margin-left: auto;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 800;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: #00e676;
    background: rgba(0, 230, 118, 0.08);
    border: 1px solid rgba(0, 230, 118, 0.2);
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.5px;
    line-height: 1;
  }

  /* Bug 8: Gear toggle — 44px touch target (was 34px) */
  .mob-gear-auto {
    display: inline-flex !important;
    width: 44px; height: 44px;
    align-items: center; justify-content: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 1rem;
    color: rgba(255,255,255,0.6);
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s;
  }
  .mob-gear-auto.active {
    background: rgba(255,255,255,0.16);
    color: #ffd700;
  }

  /* Settings drawer — slides under HUD when gear tapped */
  .mob-drawer-auto {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    align-items: center;
  }
  .mob-drawer-auto.open { display: flex; }
  .mob-drawer-auto .btn,
  .mob-drawer-auto button,
  .mob-drawer-auto select {
    font-size: 0.75rem !important;
    padding: 6px 12px !important;
    height: auto !important;
    border-radius: 6px;
  }
  .mob-drawer-auto select { max-width: 180px; }

  /* Inline stats row inside drawer */
  .mob-stats-row {
    display: flex;
    gap: 12px;
    width: 100%;
    padding: 6px 0 2px;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 2px;
  }
  .mob-stat {
    text-align: center;
    flex: 1;
    min-width: 0;
  }
  .mob-stat-label {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.45);
    white-space: nowrap;
  }
  .mob-stat-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mob-stat-value.money { color: #00e676; }
  .mob-stat-value.count { color: #ffd700; }

  /* Bug 10: BJ Hub nav buttons — 44px touch target */
  .hub-nav .btn, .hub-nav a, .hub-bar .btn, .hub-bar a,
  .nav-bar .btn, .nav-bar a {
    min-height: 44px !important;
    padding: 8px 12px !important;
    font-size: 0.78rem !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  /* Bug 11: BG difficulty tabs — 44px touch target */
  .difficulty-tabs button, .difficulty-tabs a,
  .diff-tabs button, .diff-tabs a,
  .tab-bar button, .tab-bar a {
    min-height: 44px !important;
    padding: 8px 14px !important;
    font-size: 0.8rem !important;
  }

  /* Bug 14: Footer links — 44px touch target */
  .site-footer a, footer a, .footer a {
    min-height: 44px !important;
    padding: 12px 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    font-size: 0.85rem !important;
  }

  /* Bug 17+18+19: Stats labels minimum size */
  .stat-label, .label, .stat-lbl {
    font-size: 10px !important;
    min-font-size: 10px;
  }
  .stat-val, .stat-value, .value {
    font-size: 0.9rem !important;
  }

  /* Bug 22: Chip buttons — 48px touch target */
  .chip, .chip-btn, .chip-button {
    min-width: 48px !important;
    min-height: 48px !important;
  }
}

/* Bug 21: Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Hide gear + drawer + inline bank on desktop */
.mob-gear-auto { display: none; }
.mob-drawer-auto { display: none; }
.mob-bank-inline { display: none; }
