/* CY_BORG — мобильная адаптация: крупные цели нажатия, поля 16px (без зума iOS), безопасные зоны, диалоги и стол на весь экран */
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
.steps ul { -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.steps ul::-webkit-scrollbar { display: none; }

@media (pointer: coarse), (max-width: 720px) {
  .btn, .steps a, .tabs button, .chars .open { min-height: 44px; }
  .btn.sm, .btn.xs { min-height: 44px; min-width: 44px; padding-top: 10px; padding-bottom: 10px; }
  input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { font-size: 16px !important; min-height: 44px; }
  .roles input { width: 24px; height: 24px; }
}

@media (max-width: 720px) {
  .dock { padding-bottom: calc(8px + env(safe-area-inset-bottom)); padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .footer { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
  .toast, .tray { bottom: calc(86px + env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); }
  .log-panel { max-width: 100vw; }

  /* диалоги: почти на весь экран, прокрутка внутри */
  #acct-dlg, #camp-dlg { width: calc(100vw - 16px); max-width: none; max-height: calc(100dvh - 16px); margin: auto; box-shadow: 4px 4px 0 var(--p); }
  #acct-body, #camp-body { padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); }
  #acct-body h2, #camp-body h2 { font-size: 30px; }
  #acct-body .row, #camp-body .row { display: flex; flex-wrap: wrap; gap: 8px; }
  #acct-body .row .btn, #camp-body .row .btn { flex: 1 1 140px; justify-content: center; }
  .slots li { flex-wrap: wrap; }
  .chars { max-height: 36dvh; }
  .chars li { flex-wrap: wrap; }
  .chars .btn { margin: 0 8px 8px; }
  .codebox b { letter-spacing: .06em; }

  /* виртуальный стол */
  #table-dlg { height: 100dvh; max-height: 100dvh; }
  .tv-h { padding: 8px 12px; gap: 8px; }
  .tv-h h2 { font-size: 24px; }
  .tv-st { font-size: 11px; }
  .tv-table { margin: 10px; }
  .tv-surface { min-height: 140px; }
  .tv-center b { font-size: clamp(52px, 22vw, 90px); }
  .tv-side { padding: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .tv-dice { gap: 6px; }
  .tv-dice .btn { min-width: 52px; min-height: 44px; flex: 1 0 52px; }
  .tv-log { max-height: 30dvh; min-height: 120px; }
  .tv-sheet { max-height: 50dvh; }
  #tv-say input { min-width: 0; }
}

@media (max-width: 400px) {
  .seat { padding: 6px 8px; }
  .sec-h h2 { font-size: clamp(30px, 11vw, 44px); }
}

@media (max-height: 480px) and (orientation: landscape) {
  #acct-dlg, #camp-dlg { max-height: calc(100dvh - 8px); }
  .hero { min-height: 0; }
}
@media print { .tv-side, .tv-h { display: none; } }
