/* Tornulio 9.1 | mobile-first hotfix (2026-11-02)
   Scope: iPhone/Safari first load, login/registration and authenticated mobile shell.
   No viewport zoom restrictions; preserve native pinch-to-zoom and accessibility. */
@media (max-width: 1024px) {
  /* iOS/iPadOS focus protection for legacy login fields; Safari auto-zooms under 16px. */
  body.tn-auth-active .tn-auth-field input { font-size: 16px !important; }
}
@media (max-width: 780px) {
  html { scrollbar-gutter: auto; }
  body, #app, #app .tn-shell, #app .tn-shell-main, #app .tn-shell-nav { min-width: 0; }
  #app .tn-shell-main { max-width: 100%; }
  #app .tn-shell-nav { position: relative; top: auto; max-height: none; }
  #app :is(.panel,.tourney-card,.tn90-section-top,.tn90-panel,.tn90-hero,.tn90-task) { min-width: 0; max-width: 100%; }
  #app :is(.tablewrap,.nav,.tn90-tabs,.tn90-inner-tabs) { max-width: 100%; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  #app :is(input,select,textarea) { min-width: 0; max-width: 100%; }
  #app .formgrid > * { min-width: 0; }
}
@media (max-width: 600px) {
  /* Input font size must win over the older v851.css rule with !important.
     iOS Safari zooms in when focusing text inputs smaller than 16 CSS px. */
  body.tn-auth-active .tn-auth-field input,
  body.tn-auth-active .tn-auth-register-grid input,
  body.tn-auth-active .tn-auth-password input,
  body.tn-auth-active .tn-auth-form input { font-size: 16px !important; }

  /* Prioritise the login form on a phone: compact welcome strip, no desktop hero. */
  body.tn-auth-active #app.wrap.app { width: 100%; margin: 0 !important; padding: 0 !important; }
  body.tn-auth-active .tn-auth-screen { min-height: 100svh; border-radius: 0; }
  body.tn-auth-active .tn-auth-hero { min-height: 0; padding: 16px 20px 15px; gap: 6px; }
  body.tn-auth-active .tn-auth-brand img { width: 38px; height: 38px; }
  body.tn-auth-active .tn-auth-hero h2 { font-size: clamp(23px, 6vw, 31px); line-height: 1.12; margin: 6px 0; letter-spacing: -.035em; }
  body.tn-auth-active .tn-auth-kicker { font-size: 9px; letter-spacing: .07em; }
  body.tn-auth-active .tn-auth-hero-main > p { font-size: 12px; line-height: 1.45; }
  body.tn-auth-active .tn-auth-benefits { display: none; }
  body.tn-auth-active .tn-auth-panel { min-height: 0; padding: 17px 20px 20px; gap: 8px; }
  body.tn-auth-active .tn-auth-panel-top { display: none; }
  body.tn-auth-active .tn-auth-panel-body { margin: 0; padding: 0; }
  body.tn-auth-active .tn-auth-eyebrow { margin-bottom: 7px; font-size: 10px; }
  body.tn-auth-active .tn-auth-panel h1 { font-size: clamp(23px, 6.6vw, 30px); margin-bottom: 4px; }
  body.tn-auth-active .tn-auth-sub { margin: 0 0 12px; font-size: 13px; }
  body.tn-auth-active .tn-auth-tabs { margin-bottom: 13px; }
  body.tn-auth-active .tn-auth-tab { min-height: 44px; }
  body.tn-auth-active .tn-auth-form { gap: 11px; }
  body.tn-auth-active .tn-auth-field { gap: 5px !important; }
  body.tn-auth-active .tn-auth-field input { height: 48px !important; }
  body.tn-auth-active .tn-auth-submit.btn.primary { min-height: 48px !important; font-size: 15px !important; }
  body.tn-auth-active .tn-auth-registration-status { margin-top: 10px; }
  body.tn-auth-active .tn-auth-qr-info { margin-top: 13px; }
  body.tn-auth-active .tn-auth-panel-footer { padding-top: 8px; }

  /* Authenticated smartphone layout: the menu and the actions must fit. */
  #app .tn-nav-foot, #app .tn-nav-version { display: none; }
  #app .tn-shell-nav { margin-bottom: 12px; }
  #app .tn90-hero-actions { display: grid; grid-template-columns: minmax(0,1fr); gap: 9px; }
  #app .tn90-hero-actions .btn { display: flex; width: 100%; min-height: 44px; white-space: normal; }
  #app .tn90-section-tools { min-width: 0; }
  #app .tn90-task .btn { min-height: 44px; }
  #app .tn90-tabs button, #app .tn90-inner-tabs button, #app .nav button { min-height: 44px; }
  #app .tablewrap { width: 100%; overflow-x: auto; }
  #app .tablewrap table { width: max-content; min-width: 100%; }
  #app :is(.tn90-panel,.tn90-club-facts,.tn902-help-topic) { overflow-wrap: anywhere; }
}
@media (max-width: 360px) {
  body.tn-auth-active .tn-auth-hero { padding-inline: 14px; }
  body.tn-auth-active .tn-auth-panel { padding-inline: 14px; }
  body.tn-auth-active .tn-auth-hero h2 { font-size: 23px; }
}
