/* GYES.RU - тема «gyes-steel», мобильная. Та же разметка, что у десктопа; таблицы перестроены в блоки/flex/grid. */
:root { --ink: #111; --dark: #2F3337; --plate: #4E5257; --steel: #A8ACB0; --panel: #B4B8BC; --light: #D9DCDF; --muted: #3E4246; --yellow: #FFC000; --red: #B00000; --blue: #1D3E8A; --sky: #B9C2CB; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Verdana, Tahoma, "Segoe UI", Arial, sans-serif; font-size: 15px; line-height: 1.4; color: var(--ink); background: #8F9499 url(images/bg.gif); }
a { color: var(--blue); font-weight: bold; }
h1 { font-size: 20px; line-height: 1.25; margin: 4px 0 12px; }
small { font-size: 12px; }
table, tbody, tr, td, th { display: block; width: 100% !important; }
img { max-width: 100%; height: auto; border: 0; }
form { margin: 0; }

.m-header { background: var(--steel) url(images/page_bg.gif); padding: 10px 12px; border-top: 4px solid var(--plate); }
.m-logo { display: block; line-height: 0; }
.m-logo img { width: 281px; max-width: 100%; }
.m-slogan { color: var(--muted); font-size: 12px; margin-top: 4px; }
.m-banner { margin-top: 10px; overflow: hidden; max-width: 100%; }
.m-banner img, .m-banner iframe, .m-banner object, .m-banner embed { max-width: 100%; height: auto; }
.m-banner:empty { display: none; }

/* алфавит: подпись сверху, сетка крупных плиток */
.m-letters { background: var(--sky); padding: 10px 12px 12px; border-top: 1px solid #7B8085; border-bottom: 1px solid #7B8085; }
.m-letters td.abc-label { padding: 0 0 8px 14px; background: url(images/arrow.gif) no-repeat 2px 5px; }
.m-letters td.abc-label b { font-size: 16px; }
.m-letters td.abc-label small { display: block; color: #3A4757; }
.m-letters td.abc-label br { display: none; }
.m-letters td.abc-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 3px; margin-bottom: 4px; }
.abc-l { display: flex; align-items: center; justify-content: center; min-height: 40px; border: 1px solid var(--dark); background: #F4F5F6; color: var(--ink); text-decoration: none; font-weight: bold; font-size: 16px; }
.abc-l:active { background: var(--plate); color: var(--yellow); }
.abc-empty { color: #8F99A3; background: #C8CFD6; border-color: #97A1AB; font-weight: normal; }
.abc-cur { background: linear-gradient(#FFE07A, #FFC000 50%, #E0A000); border-color: #6B4A00; }

.m-search { display: flex; gap: 6px; padding: 10px 12px; background: var(--steel) url(images/page_bg.gif); }
.m-search input { flex: 1; min-width: 0; height: 44px; padding: 0 10px; font-size: 16px; border: 1px solid var(--dark); background: #fff; border-radius: 0; }
.m-search button { height: 44px; padding: 0 16px; font-size: 15px; font-weight: bold; color: var(--ink); background: linear-gradient(#FFE07A, #FFC000 50%, #E0A000); border: 1px solid #6B4A00; }

.m-nav { display: flex; gap: 1px; overflow-x: auto; padding: 0 12px; background: var(--steel) url(images/page_bg.gif); border-bottom: 3px solid var(--plate); scrollbar-width: none; }
.m-nav a { flex: none; padding: 11px 13px; color: var(--ink); background: linear-gradient(#DCDFE2, #B3B7BB); border: 1px solid #6E7378; border-bottom: 0; text-decoration: none; font-size: 14px; }

.m-content { padding: 12px; background: var(--steel) url(images/page_bg.gif); }
.m-footer { padding: 14px 12px 20px; font-size: 13px; color: var(--muted); background: var(--steel); border-top: 1px dashed #6E7378; display: flex; flex-direction: column; gap: 10px; }
.m-footer a { display: block; padding: 12px; text-align: center; color: #fff; text-decoration: none; background: #5B8A2A; border: 1px solid #2E4A12; }

/* главная: одна колонка, новые игры -> свежие -> остальное */
/* только строка раскладки главной, не строки вложенных списков (иначе «Что есть на портале», «Жанры»,
   «Популярные игры» вставали столбиком по центру: число под названием) - 25.09.2026 */
table.cols > tbody > tr { display: flex; flex-direction: column; }
td.col-main { display: flex; flex-direction: column; }
td.col-main table.box-latest-games { order: 1; }
td.col-main table.box-latest-materials { order: 2; }
td.col-main table.box-intro { order: 3; }

table.box { margin-bottom: 12px; border: 1px solid #5F6469; background: var(--panel); }
td.box-head { background: var(--plate) url(images/box_head.gif) no-repeat right top; background-size: auto 100%; color: #fff; padding: 10px 70px 10px 10px; font-weight: bold; font-size: 14px; }
td.box-head .box-more { margin-right: -60px; }
.box-more { float: right; }
.box-more a { color: var(--yellow); }
td.box-body { padding: 8px 10px; border-top: 1px solid var(--dark); }

table.cover-grid tbody { display: block; }
table.cover-grid tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
table.cover-grid tr + tr { margin-top: 8px; }
td.cover-cell { padding: 0; text-align: center; }
td.cover-cell img.cover { width: 100%; max-width: 160px; border: 1px solid var(--dark); }
td.cover-none { display: none; }
.cover-meta { color: var(--muted); }

table.game-list th { display: none; }
table.game-list tr, table.mat-list tr { padding: 10px 8px; border-bottom: 1px solid var(--steel); }
tr.row1 { background: var(--panel); }
tr.row2 { background: #ADB1B5; }
td.gl-title a { font-size: 16px; }
td.gl-mats { margin-top: 6px; }
a.gl-mat { display: inline-block; padding: 4px 0 4px 20px; background-repeat: no-repeat; background-position: 0 center; font-weight: normal; }
td.gl-date, td.ml-date { color: var(--muted); margin-top: 4px; }
td.ml-title { padding-left: 24px; background-repeat: no-repeat; background-position: 0 3px; }
.ml-type, .ml-ver, .ml-file { color: var(--muted); }
a.ml-game { color: var(--ink); }
a.ml-link { color: var(--red); }

table.type-list tr, table.genre-list tr, table.top-list tr { display: flex; justify-content: space-between; align-items: center; min-height: 44px; border-bottom: 1px dotted #8F9499; }
table.type-list td, table.genre-list td, table.top-list td { width: auto !important; }
td.type-name { padding-left: 24px; background-repeat: no-repeat; background-position: 0 center; }
td.type-count, td.genre-count { font-weight: bold; color: var(--muted); }
td.top-num { width: 28px !important; flex: none; color: var(--red); font-weight: bold; }
td.top-title { flex: 1; }

tr.type-news td.ml-title, tr.type-news td.type-name, a.type-news, span.type-news { background-image: url(images/t_news.gif); }
tr.type-walkthrough td.ml-title, tr.type-walkthrough td.type-name, a.type-walkthrough, span.type-walkthrough { background-image: url(images/t_walkthrough.gif); }
tr.type-trainers td.ml-title, tr.type-trainers td.type-name, a.type-trainers, span.type-trainers { background-image: url(images/t_trainers.gif); }
tr.type-saves td.ml-title, tr.type-saves td.type-name, a.type-saves, span.type-saves { background-image: url(images/t_saves.gif); }
tr.type-cheats td.ml-title, tr.type-cheats td.type-name, a.type-cheats, span.type-cheats { background-image: url(images/t_cheats.gif); }
tr.type-faq td.ml-title, tr.type-faq td.type-name, a.type-faq, span.type-faq { background-image: url(images/t_faq.gif); }
tr.type-maps td.ml-title, tr.type-maps td.type-name, a.type-maps, span.type-maps { background-image: url(images/t_maps.gif); }
tr.type-mods td.ml-title, tr.type-mods td.type-name, a.type-mods, span.type-mods { background-image: url(images/t_mods.gif); }
tr.type-programs td.ml-title, tr.type-programs td.type-name, a.type-programs, span.type-programs { background-image: url(images/t_programs.gif); }
tr.type-patches td.ml-title, tr.type-patches td.type-name, a.type-patches, span.type-patches { background-image: url(images/t_patches.gif); }
tr.type-nocd td.ml-title, tr.type-nocd td.type-name, a.type-nocd, span.type-nocd { background-image: url(images/t_nocd.gif); }

table.box-game-type td.ml-title, table.box-mat-others td.ml-title { background-image: url(images/arrow.gif); background-position: 2px 6px; padding-left: 14px; }

/* меню разделов игры: горизонтальная прокрутка закладок */
table.type-menu { margin: 0 0 12px; border-bottom: 3px solid var(--plate); overflow: hidden; }
table.type-menu td { display: flex; gap: 1px; overflow-x: auto; padding: 0; scrollbar-width: none; }
.tm-sep { display: none; }
.tm-item { flex: none; display: flex; align-items: center; min-height: 42px; padding: 0 12px 0 28px; border: 1px solid #6E7378; border-bottom: 0; background-color: #C3C7CB; background-repeat: no-repeat; background-position: 7px center; color: var(--ink); text-decoration: none; white-space: nowrap; }
.tm-item small { color: var(--muted); font-weight: normal; margin-left: 3px; }
.tm-empty { color: #8F9499; background-color: #B4B8BC; font-weight: normal; }
.tm-cur { background-color: var(--plate); color: var(--yellow); border-color: var(--dark); }
.tm-cur small { color: var(--light); }

table.game-card { background: var(--panel); border: 1px solid #5F6469; padding: 10px; margin-bottom: 12px; }
td.gc-cover { text-align: center; margin-bottom: 10px; }
table.game-info tr, table.mat-info tr { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px dotted #8F9499; }
td.gi-name, td.mi-name { width: 110px !important; flex: none; color: var(--muted); }
td.gi-value, td.mi-value { width: auto !important; font-weight: bold; }
.gc-desc { line-height: 1.55; margin-top: 10px; overflow-wrap: anywhere; }
table.mat-info { margin-bottom: 12px; }

table.download-box { background: var(--plate); border: 1px solid var(--dark); padding: 10px; margin: 12px 0; color: var(--light); }
td.dl-button a { display: block; }
td.dl-button img { width: 100%; height: 48px; }
td.dl-info { margin-top: 8px; text-align: center; }
td.dl-info a { color: var(--yellow); }
.mat-body { line-height: 1.6; margin: 12px 0; padding: 12px; background: var(--light); border: 1px solid #8F9499; overflow-wrap: anywhere; }
table.bb-code td { background: #1B1D20; padding: 10px; }
table.bb-code pre { margin: 0; white-space: pre-wrap; color: var(--yellow); font-family: "Courier New", monospace; font-size: 14px; }
table.bb-quote td { background: #C9CDD1; border-left: 3px solid #6E7378; padding: 8px 10px; font-style: italic; }

.crumbs { font-size: 13px; margin: 0 0 8px; }
.crumbs-sep { color: #6E7378; }
.crumbs-here { color: var(--muted); font-weight: bold; }
.h1-count { color: var(--muted); font-size: 14px; font-weight: normal; }
.h1-sub { color: var(--red); }
p.empty { padding: 14px; color: var(--muted); background: #C9CDD1; border: 1px dashed #6E7378; }
small.empty { color: #6E7378; font-style: italic; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-weight: bold; }
.pager a, .pager-cur { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #6E7378; background: #C9CDD1; text-decoration: none; }
.pager-cur { background: var(--plate); color: var(--yellow); }
.search-form { display: flex; gap: 6px; margin-bottom: 12px; }
.search-input { flex: 1; min-width: 0; height: 44px; font-size: 16px; padding: 0 10px; border: 1px solid var(--dark); }
input.button { min-height: 44px; padding: 0 16px; font-size: 15px; font-weight: bold; background: linear-gradient(#FFE07A, #FFC000 50%, #E0A000); border: 1px solid #6B4A00; color: var(--ink); }

/* ---------- читы: код строкой, описание под ним; клавиши - клавишами ---------- */
.cheats p.ch-text { margin: 0 0 10px; line-height: 1.55; }
.cheats p.ch-head { margin: 16px 0 8px; padding: 7px 10px; background: var(--plate); border-left: 4px solid var(--yellow); color: #fff; font-weight: bold; font-size: 15px; }
.cheats p.ch-head b.ch-in { color: #fff; }
.ch-list { margin: 0 0 12px; border: 1px solid #8F9499; background: #DDE0E3; }
.ch-row { padding: 7px 10px; }
.ch-row + .ch-row { border-top: 1px solid #C2C6CA; }
.ch-alt { background: #D3D7DA; }
.ch-code { display: block; color: #1B1D20; font-family: "Courier New", monospace; font-size: 15px; font-weight: bold; overflow-wrap: anywhere; }
.ch-word { font-family: inherit; font-size: 14px; }
.ch-desc { display: block; margin-top: 1px; color: #33383C; font-size: 14px; line-height: 1.4; }
.ch-key { display: inline-block; min-width: 14px; padding: 1px 5px; border: 1px solid #6E7378; border-bottom-width: 2px; border-radius: 3px; background: #F4F5F6; color: var(--ink); font-size: 12px; font-weight: bold; text-align: center; }
b.ch-in { font-family: "Courier New", monospace; color: #1B1D20; }
.ch-grid { margin: 0 0 12px; padding: 8px 10px; border: 1px solid #8F9499; background: #DDE0E3; overflow-x: auto; }
.ch-grid pre { margin: 0; color: #1B1D20; font-family: "Courier New", monospace; font-size: 13px; }
small.ml-count { display: inline-block; padding: 1px 7px; background: var(--sky); border: 1px solid #8F99A3; color: #2B3A4E; font-weight: bold; font-size: 12px; }
p.ch-more { margin: 10px 0 0; padding: 10px; background: var(--sky); border: 1px solid #8F99A3; }
.alias-list td.al-name { padding: 8px 10px; border-bottom: 1px solid #C2C6CA; }
.alias-list tr.row2 td { background: #CFD3D7; }
.al-arrow { color: #6E7378; }
.ml-hit { display: block; margin-top: 3px; color: #33383C; font-size: 13px; line-height: 1.35; }
.ml-hit b { background: var(--yellow); color: #1B1D20; }
tr.type-none td, .type-empty { color: #6E7378; }
p.ch-top { margin: 12px 0 0; text-align: right; }
p.ch-top a { display: inline-block; padding: 9px 14px; background: var(--sky); border: 1px solid #8F9499; text-decoration: none; }

/* Длинная подпись («Другие названия:») не влезала в 110px и наезжала на значение:
   у ячейки стоит HTML-атрибут nowrap, поэтому разрешаем перенос и даём чуть больше места. */
td.gi-name, td.mi-name { width: 124px !important; white-space: normal; }

/* Нижнее место баннера (админка old-web.com, «gyes.ru, телефон — низ»). */
.m-banner-bottom { padding: 0 12px 12px; background: var(--steel) url(images/page_bg.gif); overflow: hidden; }
.m-banner-bottom:empty { display: none; }
.m-banner-bottom img, .m-banner-bottom iframe { max-width: 100%; height: auto; }

/* скриншоты игры */
table.shots td.shot { padding: 4px; }
table.shots img { border: 1px solid #8a94a3; }

/* таблицы в текстах [table]: прокрутка вбок */
.bb-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px 0; }
.bb-table { border-collapse: collapse; }
.bb-table td { border: 1px solid #b9c0ca; padding: 5px 8px; font-size: 14px; white-space: nowrap; }
.bb-table tr.r2 td { background: #D3D8DE; }
.bb-table-wrap table.bb-table { display: table; width: auto; }
.bb-table-wrap table.bb-table tr { display: table-row; }
.bb-table-wrap table.bb-table td { display: table-cell; width: auto; }
.bb-table-wrap table.bb-table td { white-space: normal; min-width: 48px; }
.bb-table-wrap table.bb-table { width: auto !important; }
.bb-table-wrap table.bb-table tbody { display: table-row-group; width: auto !important; }
.bb-table-wrap table.bb-table tr { width: auto !important; }
.bb-table-wrap table.bb-table td { width: auto !important; }
.bb-table-wrap table.bb-table td { word-break: normal; overflow-wrap: normal; }
.bb-table-wrap table.bb-table td:first-child { white-space: nowrap; }

/* 02.10.2026: дата добавления — справа в строке названия, а не отдельной строкой по центру */
table.game-list tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: baseline; }
table.game-list td.gl-title { grid-column: 1; grid-row: 1; }
table.game-list td.gl-date { grid-column: 2; grid-row: 1; margin-top: 0; text-align: right; white-space: nowrap; width: auto !important; }
table.game-list td.gl-mats { grid-column: 1 / span 2; grid-row: 2; }
/* 02.10.2026: список материалов — дата справа в строке названия (как в списке игр) */
table.mat-list tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: baseline; }
table.mat-list td.ml-title { grid-column: 1; }
table.mat-list td.ml-date { grid-column: 2; margin-top: 0; text-align: right; white-space: nowrap; width: auto !important; }
/* 02.10.2026: блок баннерной сети фиксированной ширины (472px) не помещался в экран — ужимаем по ширине */
.m-banner table { width: 100% !important; max-width: 100%; table-layout: fixed; }
.m-banner td { width: auto !important; }
.m-banner img { max-width: 100% !important; height: auto !important; }
/* 02.10.2026: приветствие — числа по разделам двумя колонками */
table.intro-types, table.intro-types tbody { display: block; width: 100%; }
table.intro-types tr { display: contents; }
table.intro-types tbody { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 6px 0 10px; }
table.intro-types td { display: block; width: auto !important; padding: 4px 0; }
table.intro-types span.intro-ic { padding-left: 22px; background-repeat: no-repeat; background-position: 0 center; }
table.intro-types a { color: var(--ink); text-decoration: none; }
table.intro-types td.intro-empty { display: none; }
.m-nav a.nav-cur { background: #4E5257; color: #FFC000; }
.intro-stat br.intro-br { display: none; }
.m-letters td.abc-label img.abc-arrow { display: none; }
/* 02.10.2026: пагинация одной строкой */
.pager { flex-wrap: nowrap; }
.pager-off { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #A3A8AD; color: #8F9499; }
.pager-of { margin-left: auto; font-weight: normal; color: var(--muted); white-space: nowrap; }
/* 04.10.2026: разделы — сеткой 3×3, все видны сразу (была полоса с прокруткой, последний пункт обрезался) */
.m-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; overflow: visible; padding: 8px 12px 10px; }
.m-nav a { padding: 11px 4px; text-align: center; white-space: nowrap; border-bottom: 1px solid #6E7378; }
/* алфавит: на телефоне только буквы, на которые есть игры; столбцов столько, чтобы ряды были полными (считает letters_html) */
.m-letters .abc-empty { display: none; }
/* лента материалов: игра — своей строкой, под ней материал; тип показывает значок, «[Прохождение]» не дублируем */
.mat-list .ml-type, .mat-list .ml-sep { display: none; }
.mat-list .ml-game { display: block; }
.mat-list td.ml-date small { white-space: nowrap; }

/* 04.10.2026: скриншоты — на телефоне по одной картинке в строку, под ней название */
.m-shots a.m-shot, a.m-shot { display: block; margin: 0 0 10px; }
a.m-shot img { display: block; width: 100%; height: auto; border: 1px solid #8a94a3; box-sizing: border-box; }
.msh-item { margin: 0 0 18px; }
.msh-item a.m-shot { margin: 0 0 6px; }
a.msh-title { display: block; font-weight: bold; font-size: 16px; }
.msh-count { display: block; color: #666; font-size: 13px; margin-top: 2px; }
table.shot-nav { width: 100%; margin: 8px 0; }
table.shot-nav td { padding: 10px 4px; font-size: 15px; white-space: nowrap; }
.sn-off { color: #999; }
img.shot-big { display: block; width: 100%; height: auto; }
.shot-meta { text-align: center; color: #666; font-size: 12px; margin: 4px 0; }
table.shot-nav, table.shot-nav tbody { display: block; width: 100%; }
table.shot-nav tr { display: flex; align-items: center; }
table.shot-nav td { display: block !important; width: auto !important; flex: 1 1 0; padding: 0 !important; text-align: center !important; }
table.shot-nav td.sn-pos { flex: 0 0 auto; padding: 0 8px !important; color: #333; }
table.shot-nav td a, table.shot-nav td .sn-off { display: block; padding: 11px 4px; border-radius: 4px; background: #d5dade; text-decoration: none; font-weight: bold; }
table.shot-nav td .sn-off { background: #c4c9ce; }
/* 04.10.2026: разделы игры в списке - с отступами, не слипаются */
td.gl-mats div.gl-mi { display: inline-block; margin: 0 14px 4px 0; }
