/* HLstatsX CE mobile layout layer.
   Scope: responsive display only. No stats/query/game logic changes. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { max-width: 100%; overflow-x: hidden; }
img, object, embed, iframe, canvas, svg { max-width: 100%; height: auto; }
input, select, textarea, button { max-width: 100%; }
.block, .content, .subblock { max-width: 100%; }
.data-table { max-width: 100%; }
.subblock { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.hlx-game-card-list,
.hlx-mobile-card-list,
.hlx-award-card-list,
.hlx-rank-card-list,
.hlx-ribbon-card-list { display: none; }

.headerblock { min-height: 50px; height: auto !important; overflow: visible; }
.headerblock .title img { max-width: 260px; height: auto; }
ul#header_gameslist { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; margin: 0; padding: 0; }
ul#header_gameslist li { float: none; padding: 0; margin: 0; list-style: none; }
ul#header_gameslist img { max-width: 32px; max-height: 32px; }
.headertabs ul { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; }
.headertabs li { display: block; margin: 0; }
.headertabs img { max-width: 92px; height: auto; }
.location { height: auto !important; min-height: 22px; overflow: hidden; }
.location ul { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.location li { display: inline-flex; margin: 0; }
.location form { margin: 0; }

nav { width: 100%; padding: 0 8px; }
.fancyNav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 0; margin: 0 auto 12px; overflow: visible; }
.fancyNav li { float: none; margin: 0; }
.fancyNav li:after { display: none; }
.fancyNav li a { display: block; min-height: 36px; padding: 9px 14px; line-height: 18px; }

.subsection_tabs, #tabs_submenu { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 0; margin: 0 auto 12px; list-style: none; }
.subsection_tabs li, #tabs_submenu li { display: block; margin: 0; }
.subsection_tabs a, #tabs_submenu a { display: block; min-height: 38px; padding: 9px 12px; text-align: center; }

@media (max-width: 700px) {
  body { margin: 6px !important; font-size: 14px !important; }
  .fSmall { font-size: 11px !important; }
  .fHeading { font-size: 13px !important; }
  .fTitle { font-size: 17px !important; }

  .block { width: 100% !important; margin: 0 auto !important; }
  .subblock { width: 100% !important; margin: 0 auto 12px !important; padding: 0 2px; overflow-x: visible; }
  .content { width: 100% !important; }

  .headerblock { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px; padding: 8px 4px 10px; text-align: center; }
  .headerblock .title { width: 100%; text-align: center; }
  .headerblock .title img { max-width: 230px; }
  .header_gameslist { position: static !important; float: none !important; top: auto !important; right: auto !important; width: 100%; max-width: 100%; margin: 0 auto; }
  ul#header_gameslist { justify-content: center; gap: 8px; }
  ul#header_gameslist img { max-width: 34px; max-height: 34px; }
  .headertabs { position: static !important; width: 100%; }
  .headertabs ul { justify-content: center; gap: 6px; }
  .headertabs img { max-width: 84px; }

  .location { padding: 6px; }
  .location ul.fNormal { float: none !important; width: 100%; justify-content: center; text-align: center; }
  .location .fNormal[style*="float:right"], .location div.fNormal { float: none !important; width: 100%; text-align: center; margin-top: 6px; }

  nav { padding: 0; }
  .fancyNav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; width: 100%; }
  .fancyNav li { width: 100%; }
  .fancyNav li a { width: 100%; padding: 10px 4px; min-height: 42px; white-space: normal; text-align: center; }

  .subsection_tabs, #tabs_submenu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; width: 100%; }
  .subsection_tabs a, #tabs_submenu a { min-height: 42px; padding: 10px 6px; }

  form { max-width: 100%; }
  input.textbox, input[type="text"], select { min-height: 34px; font-size: 14px; }
  input.submit, input.smallsubmit, input[type="submit"] { min-height: 34px; padding: 5px 10px; font-size: 13px; }

  .mobile-games-table,
  .hlx-responsive-table,
  .award-grid-table,
  .rank-grid-table,
  .ribbon-grid-table { display: none !important; }

  .hlx-game-card-list,
  .hlx-mobile-card-list,
  .hlx-award-card-list,
  .hlx-rank-card-list,
  .hlx-ribbon-card-list { display: block; width: 100%; }

  .hlx-game-card,
  .hlx-mobile-card,
  .hlx-award-card,
  .hlx-rank-card,
  .hlx-ribbon-card { display: block; width: 100%; margin: 0 0 10px; padding: 10px; border: 1px solid; }

  .hlx-game-card-main { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: bold; }
  .hlx-game-card-main img { width: 36px; height: 36px; object-fit: contain; }
  .hlx-game-card-stats,
  .hlx-mobile-card-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hlx-game-card-stats div,
  .hlx-mobile-card-field { min-width: 0; }
  .hlx-game-card-stats span,
  .hlx-mobile-card-field span { display: block; font-size: 11px; opacity: .8; margin-bottom: 3px; }
  .hlx-game-card-stats strong,
  .hlx-mobile-card-field strong { display: block; overflow-wrap: anywhere; }
  .hlx-game-card-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
  .hlx-game-card-actions a { display: block; text-align: center; padding: 8px; border: 1px solid; }

  .hlx-mobile-card-title { font-weight: bold; margin-bottom: 8px; }
  .hlx-mobile-card img.tableicon { max-width: 40px; max-height: 40px; }
  meter { min-width: 100%; }

  .hlx-award-card-list,
  .hlx-rank-card-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hlx-award-card,
  .hlx-rank-card { margin: 0; text-align: center; min-height: 120px; }
  .hlx-award-title,
  .hlx-rank-title,
  .hlx-ribbon-title { font-weight: bold; margin-bottom: 8px; }
  .hlx-award-image img,
  .hlx-rank-image img { max-width: 76px; max-height: 76px; }
  .hlx-award-winner,
  .hlx-award-count,
  .hlx-rank-range,
  .hlx-rank-achieved,
  .hlx-ribbon-achieved { font-size: 11px; margin-top: 5px; }

  .hlx-ribbon-group { margin: 0 0 12px; }
  .hlx-ribbon-group-title { font-weight: bold; margin: 0 0 6px; padding: 8px; border: 1px solid; }
  .hlx-ribbon-row { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
  .hlx-ribbon-card { flex: 0 0 46%; width: 46%; margin: 0; text-align: center; }
  .hlx-ribbon-image img { max-width: 96px; max-height: 96px; }

  #footer img { max-width: 220px; }
}

@media (max-width: 420px) {
  .fancyNav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .headerblock .title img { max-width: 210px; }
  .hlx-game-card-stats,
  .hlx-mobile-card-fields { grid-template-columns: 1fr; }
}
