/* mobile.css: touch and small screen fixes loaded on every page (night 3).
   Scope: coarse pointers (phones, tablets) and widths up to 820px. Keeps desktop untouched. */

@media (hover: none) and (pointer: coarse) {
  /* iOS Safari zooms the page when a focused field is under 16px */
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: 16px !important; }
  input[type=range] { min-height: 40px; }

  /* tap targets: 40px minimum hit area without changing the visual weight too much */
  .QB-chip, .Ex-pick, .Ex-star, .Ex-copy, .TW-btn.sm, .Tr-buy, .STab, .QB-set, .SeamFooter-btn,
  #qs-btn, #ex-watch, #ex-bell, .AppShell-menu, .Cm-sel, .Tk-bell, .PA-btn, .CP-order-type button, .CP-tab,
  .Net-mine button, .Mine-pick button, .SBar-ic, .SLang button, .SBar-links a, .SeamFooter-links a {
    min-height: 40px;
  }
  .SBar-ic, .SLang button, .SBar-links a, .SeamFooter-links a, .Ex-copy, .Ex-star, .Ex-pick {
    display: inline-flex; align-items: center; justify-content: center;
  }
  .Ex-copy, .Ex-star, .Ex-pick, .SBar-ic { min-width: 40px; }
  .SLang button, .SBar-links a, .SeamFooter-links a { padding-left: 10px; padding-right: 10px; }
  .QB-chip { padding-top: 8px; padding-bottom: 8px; }
  /* inline links inside table rows (addresses, Token, Flap) get vertical breathing room */
  td a, .Row a, .Ex-row a, .Tr-row a { padding-top: 6px; padding-bottom: 6px; display: inline-block; }
}

@media (max-width: 820px) {
  html, body { overflow-x: hidden; }
  /* tables scroll inside their own box instead of pushing the page wide */
  .CP-table, .Table-wrap, .An-table, .Tm-table, .Lb-table, table { max-width: 100%; }
  .Table-wrap, .An-table, .Tm-table, .Lb-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* charts must not trap vertical scrolling */
  canvas, .CC-stage, #coin-chart { touch-action: pan-y; }
  /* fixed and sticky bars: leave room under them */
  body { padding-bottom: calc(env(safe-area-inset-bottom, 0px)); }
  /* modals and pop ups fit the phone */
  .QB-pop, .PA-pop, .SC-modal, .SeamConnect-modal, .Modal, .Sheet { max-width: calc(100vw - 16px); max-height: calc(100vh - 24px); overflow: auto; }
  .SC-modal { width: min(100vw - 16px, 560px); }
  /* long numbers, addresses and symbols wrap or clip inside their cell instead of overflowing */
  .CP-head h1, .Stat-v, .Hero-v, .An-kpi b, .Tm-kpi b { overflow-wrap: anywhere; }
  /* empty states */
  .Empty, .CP-empty, .Ex-empty, .Tk-empty, .Pf-empty, .Rg-empty { padding: 28px 16px; text-align: center; }
}

/* round 2: remaining short targets measured on the live site */
@media (hover: none) and (pointer: coarse) {
  .CP-star, .SC-tab, .SC-tool, .CP-gl, .CP-ca, .CP-flap, .An-icon, #btn-max-stake, #copy-seam-ca, .TW-btn, .L-brand,
  .Ex-mines button, .Ex-filter button, .Mines button, button[data-mine] { min-height: 40px; }
  .CP-gl, .CP-flap, .CP-ca, .SC-tab, .SC-tool { display: inline-flex; align-items: center; }
  .SBar-r a, .SBar-l a, .SBar a, .SBar-p { min-height: 40px; display: inline-flex; align-items: center; padding-left: 8px; padding-right: 8px; }
  /* inline links in list rows: addresses, times, coin links */
  a.w, a.t, a.c, .Ex-row a, .Tr-row a, .Cm-row a, .Tk-row a { padding-top: 10px; padding-bottom: 10px; display: inline-block; }
  #f-launcher { font-size: 16px !important; }
}
