/* CS27 Stage 20 — mobile-friendly guardrails for Yandex/mobile crawlers.
   Scope: phones only. Does not alter desktop or GameCMS JS/auth logic. */
@media (max-width: 767px) {
  html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  body[data-template="cs27Reg"],
  body {
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  /* Prevent legacy fixed-width GameCMS descendants from widening the page. */
  body[data-template="cs27Reg"] main,
  body[data-template="cs27Reg"] header,
  body[data-template="cs27Reg"] footer,
  body[data-template="cs27Reg"] section,
  body[data-template="cs27Reg"] .container,
  body[data-template="cs27Reg"] .container-fluid,
  body[data-template="cs27Reg"] .row,
  body[data-template="cs27Reg"] [class*="col-"],
  body[data-template="cs27Reg"] .content,
  body[data-template="cs27Reg"] .content_block,
  body[data-template="cs27Reg"] .block,
  body[data-template="cs27Reg"] .modal-content {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  body[data-template="cs27Reg"] img,
  body[data-template="cs27Reg"] video,
  body[data-template="cs27Reg"] canvas,
  body[data-template="cs27Reg"] svg {
    max-width: 100%;
  }
  body[data-template="cs27Reg"] img,
  body[data-template="cs27Reg"] video { height: auto; }

  /* Long IDs, links and nicknames must wrap instead of increasing viewport width. */
  body[data-template="cs27Reg"] p,
  body[data-template="cs27Reg"] a,
  body[data-template="cs27Reg"] td,
  body[data-template="cs27Reg"] th,
  body[data-template="cs27Reg"] .heading,
  body[data-template="cs27Reg"] .second_heading {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  /* Keep forms readable on phones and stop iOS input zoom. */
  body[data-template="cs27Reg"] input,
  body[data-template="cs27Reg"] select,
  body[data-template="cs27Reg"] textarea {
    max-width: 100%;
    box-sizing: border-box;
    font-size: 16px;
  }

  /* Legacy tables may scroll inside their own region, never the whole page. */
  body[data-template="cs27Reg"] .table-responsive,
  body[data-template="cs27Reg"] .responsive-table,
  body[data-template="cs27Reg"] .table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Common interactive controls: usable tap area without forcing visual height. */
  body[data-template="cs27Reg"] button,
  body[data-template="cs27Reg"] input[type="button"],
  body[data-template="cs27Reg"] input[type="submit"],
  body[data-template="cs27Reg"] .btn,
  body[data-template="cs27Reg"] a.btn {
    min-height: 36px;
  }
}
