/* Best-servers.ru / maincs: MOBILE ONLY, viewport < 768px.
   Desktop styles are inherited unchanged from the original maincs files.
   Based on the deployed season_top15 and sortition v6 palettes. */
@media screen and (max-width: 767.98px) {
:root {
  --bsui-ink: #4b4238;
  --bsui-muted: #776c5c;
  --bsui-heading: #51483f;
  --bsui-surface: #faf6ef;
  --bsui-alt: #f1e8db;
  --bsui-line: #e2d7c7;
  --bsui-border: #cdbb9f;
  --bsui-green: #30382e;
  --bsui-green-hover: #444c3b;
}
body { min-width: 0; font-family: Tahoma, Arial, sans-serif; }
body > .inner { width: calc(100% - 24px); max-width: 1060px; }
body > header { width: 100%; max-width: 1137px; }
body > header .inner { width: calc(100% - 24px); max-width: 1060px; }
.content { background: #fffdf9; border-radius: 5px; box-shadow: 0 10px 35px #191e2230; }
.content > .side_top {
  height: auto; min-height: 54px; overflow: visible;
  background: var(--bsui-green); border-bottom: 3px solid #c9943e;
  position: relative; z-index: 110;
}
.content > .side_top > nav { margin: 0; }
.content > .side_top > nav > #nav {
  display: flex; flex-wrap: wrap; margin: 0; padding: 0 12px; list-style: none;
}
.content > .side_top #nav > li { float: none; height: auto; background: none; position: relative; }
.content > .side_top #nav > li > a {
  display: flex; align-items: center; gap: 5px; min-height: 51px; height: auto;
  padding: 10px 9px; margin: 0; font: 12px/1.5 Tahoma, Arial, sans-serif;
  color: #f7f2e5; text-transform: none; text-decoration: none;
}
.content > .side_top #nav > li > a:hover,
.content > .side_top #nav > li > a.open { background: #444c3b; color: #efcf96; }
.content > .side_top #nav > li > ul {
  background: #30382e; border: 1px solid #69715b; padding: 5px;
  border-radius: 3px; box-shadow: 0 8px 20px #0003; min-width: 190px;
}
.content > .side_top #nav > li:hover > ul,
.content > .side_top #nav > li:focus-within > ul { display: block; }
.content > .side_top #nav > li > ul > li > a {
  height: auto; min-height: 38px; padding: 9px 12px; line-height: 1.5;
  white-space: normal; text-shadow: none; color: #f7f2e5; font-size: 12px;
}
.content > .side_top #nav > li > ul > li > a:hover { background: #444c3b; color: #efcf96; }
.side_content { padding: 0 12px; }
.side_content > .left_block { width: calc(100% - 250px); margin-top: 16px; }
.side_content > .right_block { width: 230px; margin-top: 16px; }
.side_content > .left_blockuser { width: 100%; }
/* The ranking page deliberately uses the whole content column. */
body.season-top15-page .side_content > .left_block { width: 100%; float: none; }
body.season-top15-page .content > .side_top { overflow: visible; }
body.season-top15-page .content > .side_top > nav { min-width: 0; }
.user_profile_info { width: calc(100% - 260px); table-layout: fixed; }
.user_profile_info tbody tr .w30 { width: 36%; }
.user_profile_info tbody tr .w70 { width: 64%; }
.user_profile_info td { overflow-wrap: anywhere; }
.r_block, .l_block, .user_profile {
  border: 1px solid var(--bsui-border); border-radius: 4px;
  margin-bottom: 16px; background: var(--bsui-surface);
}
.r_block > .r_block_head, .l_block > .l_block_head {
  background: var(--bsui-heading); color: #faf6ee; height: auto; min-height: 43px;
  line-height: 1.5; margin: 0; padding: 12px 14px; border-radius: 3px 3px 0 0;
  font-size: 13px; font-weight: 700; text-transform: none; z-index: auto;
}
.r_block > .r_block_head a, .l_block > .l_block_head a { color: #faf6ee !important; white-space: normal; }
.l_block > .l_block_head img { margin: 0 0 0 8px; }
.r_block > .r_block_c, .l_block > .l_block_c {
  background: var(--bsui-surface); color: var(--bsui-ink); border-radius: 0 0 3px 3px;
  padding: 14px; font-size: 13px; line-height: 1.65;
}
.l_block > .l_block_c { padding: 10px; }
.r_block_c > .block, .l_block_c > .block, .l_block_c .online_user {
  background-image: none; border-bottom: 1px solid var(--bsui-line);
}
.r_block_c a:not(.btn):not(.btn2), .l_block_c a:not(.btn):not(.btn2) { white-space: normal; overflow-wrap: anywhere; }
.block_menu { width: 100%; }
.block_menu > ul > li > a {
  background: transparent; min-height: 37px; height: auto; line-height: 1.5;
  padding: 10px 12px; border-bottom: 1px solid var(--bsui-line);
  color: var(--bsui-ink); font-size: 12px; text-transform: none; white-space: normal;
}
.block_menu > ul > li:last-child > a { border-bottom: 0; }
.block_menu > ul > li > a:hover { background: #eadecc; color: #594524; }
.user_profile > .user_top {
  min-height: 40px; height: auto; padding: 8px 10px; line-height: 24px;
  background: var(--bsui-alt); border-bottom: 1px solid var(--bsui-border);
}
.user_profile .username { font-size: 12px; font-weight: 700; color: #514728; }
.user_profile .balance { margin-top: 0; padding: 2px 7px; border-radius: 3px; background: #536f43; font-size: 11px; }
.user_profile .user_profile_info2 { display: flex; align-items: flex-start; gap: 12px; padding: 14px 10px; margin: 0; }
.user_profile .user_profile_info2 .avatar {
  display: block; flex: 0 0 72px; width: 72px; height: 72px; margin: 0; float: none;
  border: 2px solid #bca16b; border-radius: 0; object-fit: cover;
  background: #f1e8db; padding: 2px; box-sizing: border-box;
}
.user_profile .user_profile_info2 .user_rows { min-width: 0; flex: 1; overflow: visible; }
.user_profile .user_profile_info2 .user_rows .user_row a {
  display: block; padding: 3px 0; color: #4b3d2e; font-size: 12px; line-height: 1.5;
  text-transform: none; white-space: normal; overflow-wrap: anywhere;
}
.user_profile .user_profile_info2 .user_rows .user_row a:hover { color: #855615; text-decoration: underline; }
#mini_profile_avatar { aspect-ratio: 1; object-fit: cover; border-radius: 0; border: 1px solid var(--bsui-border); }
.r_block_c .form-control, .l_block_c .form-control {
  background: #fffdf9; color: #4b4238; border-color: var(--bsui-border);
  border-radius: 3px; box-shadow: none; font-size: 13px;
}
.r_block_c .form-control:focus, .l_block_c .form-control:focus {
  border-color: #7d8d61; box-shadow: 0 0 0 2px #c8d5b2; outline: none;
}
.r_block_c .form-control:disabled, .l_block_c .form-control:disabled,
.r_block_c .form-control[readonly], .l_block_c .form-control[readonly] { background: #eae5dc; color: #776c5c; }
.r_block_c :is(.btn-primary, .btn-success), .l_block_c :is(.btn-primary, .btn-success) {
  background: var(--bsui-green); border-color: var(--bsui-green); color: #fff;
  border-radius: 3px; text-shadow: none;
}
.r_block_c :is(.btn-primary, .btn-success):hover, .l_block_c :is(.btn-primary, .btn-success):hover {
  background: var(--bsui-green-hover); border-color: var(--bsui-green-hover); color: #fff;
}
.r_block_c .btn-default, .l_block_c .btn-default { background: #f1e8db; border-color: var(--bsui-border); color: #4b4238 !important; }
.r_block_c .btn-default:hover, .l_block_c .btn-default:hover { background: #eadecc; border-color: #bca16b; color: #4b4238; }
.r_block_c :is(.btn-primary,.btn-success):is(:disabled,.disabled),
.l_block_c :is(.btn-primary,.btn-success):is(:disabled,.disabled) {
  background: #e0e2d8; border-color: #c4cabc; color: #5e6654 !important; opacity: 1;
}
/* Only legacy card tables; new modules keep their own ranking/prize styles. */
.r_block_c > .table, .r_block_c > .table-responsive > .table { font-size: 13px; color: var(--bsui-ink); }
.r_block_c > .table > thead > tr > :is(th,td),
.r_block_c > .table-responsive > .table > thead > tr > :is(th,td) {
  background: var(--bsui-heading); color: #faf6ee; border-color: #80725f; padding: 12px 10px;
}
.r_block_c > .table > tbody > tr:not(.success,.danger,.warning,.info,.active) > :is(td,th):not(.success,.danger,.warning,.info,.active),
.r_block_c > .table-responsive > .table > tbody > tr:not(.success,.danger,.warning,.info,.active) > :is(td,th):not(.success,.danger,.warning,.info,.active) {
  background: var(--bsui-surface); border-color: var(--bsui-line); padding: 11px 10px;
}
.r_block_c > .table > tbody > tr:nth-child(even):not(.success,.danger,.warning,.info,.active) > :is(td,th):not(.success,.danger,.warning,.info,.active),
.r_block_c > .table-responsive > .table > tbody > tr:nth-child(even):not(.success,.danger,.warning,.info,.active) > :is(td,th):not(.success,.danger,.warning,.info,.active) { background: var(--bsui-alt); }
.r_block_c > .table-responsive { overflow-x: auto; }
.content :is(a,button,input,select,textarea,summary):focus-visible {
  outline: 2px solid #ad781d; outline-offset: 3px;
}
.h_profile a { border-radius: 3px; background: #30382e; }
.h_profile a:hover { background: #444c3b; }
#slides, #slidesimg { max-width: 100%; border-color: var(--bsui-border); }
@media (max-width: 900px) {
  .side_content > .left_block, .side_content > .right_block { float: none; width: 100%; }
  .right_block { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 16px; align-items: start; }
  .right_block > * { min-width: 0; }
  .content > .side_top #nav > li > a { padding: 11px 10px; }
  .user_profile_info { width: calc(100% - 260px); }
  .w50_1, .w50_2 { width: 100%; float: none; }
  .h_profile { margin-right: 20px; }
}
@media (max-width: 600px) {
  body > .inner, body > header .inner { width: calc(100% - 16px); }
  .side_content { padding: 0 10px; }
  .right_block { display: block; }
  .content > .side_top > nav > #nav { padding: 4px; }
  .content > .side_top #nav > li > a { min-height: 42px; padding: 10px 8px; }
  .content > .side_top #nav > li > ul { min-width: 180px; max-width: calc(100vw - 40px); }
  .content > .side_top #nav > li:nth-last-child(-n+3) > ul { right: 0; }
  .logo { width: 100%; max-width: 463px; background-size: auto 87px; background-position: center; }
  .logo_p { margin: 16px auto 0; max-width: 100%; background-position: center; }
  .h_menu { margin-bottom: 28px; min-height: 41px; height: auto; overflow: hidden; }
  .h_feedback { margin-left: 14px; }
  .h_profile { margin: 7px 12px 7px 6px; max-width: calc(100% - 84px); display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
  .h_profile a { padding: 0 8px; font-size: 11px; }
  .profile_user { float: none; width: 100%; }
  .user_profile_info { width: 100%; margin-left: 0; }
  #mini_profile_avatar { max-width: 230px; }
  .r_block > .r_block_c { padding: 12px; }
  footer .f_logo { display: none; }
  footer .f_text { left: 16px; width: calc(100% - 32px); }
}
/* Insert inside the mobile theme. Matches the live five-cell server rows
   and the preview's optional .table-responsive wrapper only. */
@media (max-width: 600px) {
  .r_block_c .table-responsive:has(> table.table > tbody#servers) {
    overflow: visible; border: 0;
  }
  .r_block_c table.table:has(> tbody#servers) {
    display: block; width: 100%; max-width: 100%; min-width: 0;
    margin: 0; border: 0;
  }
  .r_block_c table.table:has(> tbody#servers) > thead { display: none; }
  .r_block_c table.table > tbody#servers {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px;
    width: 100%; min-width: 0;
  }
  .r_block_c table.table > tbody#servers > tr.server_line {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%; min-width: 0; border: 1px solid var(--bsui-border);
    border-radius: 4px; overflow: hidden;
  }
  .r_block_c table.table > tbody#servers > tr.server_line > td {
    display: block; width: auto; min-width: 0; padding: 9px 10px;
    border: 0; text-align: left; white-space: normal;
    overflow-wrap: anywhere; word-break: normal; line-height: 1.5;
  }
  .r_block_c table.table > tbody#servers > tr.server_line > td:first-child { display: none; }
  .r_block_c table.table > tbody#servers > tr.server_line > td:nth-child(2),
  .r_block_c table.table > tbody#servers > tr.server_line > td:nth-child(5) { grid-column: 1 / -1; }
  .r_block_c table.table > tbody#servers > tr.server_line > td:nth-child(2) { font-weight: 700; }
  .r_block_c table.table > tbody#servers > tr.server_line > td::before {
    display: block; margin-bottom: 3px; color: var(--bsui-muted);
    font-size: 11px; font-weight: 400; line-height: 1.5;
  }
  .r_block_c table.table > tbody#servers > tr.server_line > td:nth-child(2)::before { content: "Название"; }
  .r_block_c table.table > tbody#servers > tr.server_line > td:nth-child(3)::before { content: "Игроков"; }
  .r_block_c table.table > tbody#servers > tr.server_line > td:nth-child(4)::before { content: "Карта"; }
  .r_block_c table.table > tbody#servers > tr.server_line > td:nth-child(5)::before { content: "IP"; }
  .r_block_c table.table > tbody#servers .online_line {
    width: 100%; min-width: 0; height: 21px; margin: 0;
  }
  .r_block_c table.table > tbody#servers .players_val { white-space: nowrap; }
  .r_block_c table.table > tbody#servers > tr.server_line > td:nth-child(5) > a {
    display: inline-block; max-width: 100%; white-space: normal;
    overflow-wrap: anywhere; word-break: normal; font-variant-numeric: tabular-nums;
  }
}

/* Mobile layout repair: header, navigation and usable form controls. */
body { background: #eee9e1; font-size: 14px; line-height: 1.5; }
body > header { width: 100%; background: #30382e; }
body > header .h_menu {
  background: none; height: auto; min-height: 44px; margin: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; overflow: visible;
}
body > header .h_feedback { margin: 0; float: none; flex: 0 0 44px; }
body > header .h_vk { height: 44px; width: 44px; background-position: center; }
body > header .h_profile {
  float: none; margin: 4px 0; max-width: calc(100% - 52px);
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px;
}
body > header .h_profile a {
  height: auto; min-height: 36px; padding: 6px 8px; margin: 0;
  font: 12px/24px Tahoma, Arial, sans-serif; white-space: normal;
}
body > header .logo {
  background: none; float: none; width: 100%; max-width: none; height: 80px;
  display: flex; align-items: center; justify-content: center;
}
body > header .logo_p {
  margin: 0; width: 290px; max-width: 100%; height: 63px;
  background-size: contain; background-position: center;
}
body > .inner { width: 100%; }
.content { border-radius: 0; box-shadow: none; }
.content > .side_top > nav > #nav {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 2px; padding: 8px; align-items: start;
}
.content > .side_top #nav > li { min-width: 0; }
.content > .side_top #nav > li > a {
  min-height: 44px; padding: 10px 12px; border-radius: 4px;
  font-size: 14px; line-height: 1.5; white-space: normal;
}
.content > .side_top #nav > li > ul {
  position: static; min-width: 0; width: 100%; max-width: 100%;
  box-sizing: border-box; margin: 2px 0; padding: 4px;
  box-shadow: none; border-color: #66715f;
}
.content > .side_top #nav > li > ul > li > a {
  padding: 10px 8px; min-height: 44px; font-size: 14px;
  white-space: normal; overflow-wrap: normal;
}
.side_content { padding: 0 12px; }
.r_block > .r_block_head, .l_block > .l_block_head { font-size: 15px; padding: 12px 14px; }
.r_block > .r_block_c, .l_block > .l_block_c { font-size: 14px; line-height: 1.5; padding: 14px; }
.r_block_c:has(> form#user_login) > br { display: none; }
form#user_login { width: 100%; max-width: none; margin: 0; }
form#user_login > p { margin: 0 0 12px; }
form#user_login > p:has(> .btn2) {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 0;
}
.r_block_c .form-control, .l_block_c .form-control {
  min-height: 44px; height: auto; padding: 10px 12px; font-size: 16px; line-height: 1.4;
}
.r_block_c .btn2, .l_block_c .btn2 {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; height: auto; padding: 10px 14px; margin: 0;
  font-size: 14px; line-height: 1.5; border-radius: 4px;
  background: var(--bsui-green); color: #fff; border: 1px solid var(--bsui-green);
}
.r_block_c .btn2.btn-cancel, .l_block_c .btn2.btn-cancel {
  background: #f1e8db; border-color: var(--bsui-border); color: #4b4238 !important;
}
form#user_login > p > input[type="submit"] { flex: 1; }
form#user_login > p > a.btn2:last-child {
  width: 100%; min-height: 36px; padding: 6px 8px; border: 0;
  background: transparent; color: #5b4c30 !important; text-decoration: underline;
}
form#user_login #result:empty { display: none; }
.user_profile .user_profile_info2 .user_rows .user_row a { font-size: 14px; min-height: 36px; padding: 7px 0; }
.block_menu > ul > li > a { font-size: 14px; min-height: 44px; }
.r_block_c table.table > tbody#servers > tr.server_line > td { font-size: 14px; }
.r_block_c table.table > tbody#servers > tr.server_line > td::before { font-size: 12px; }
@media (min-width: 480px) {
  .content > .side_top > nav > #nav { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

/* Forum categories: elements/forum.tpl has three cells (icon, text, latest).
   Restrict table conversion to rows with class .forum; topic/post tables keep
   their own markup. May be inserted inside the existing mobile media scope. */
@media screen and (max-width: 767.98px) {
  .r_block_c .table-responsive:has(> table.table > tbody > tr.forum) {
    overflow: visible; border: 0;
  }
  .r_block_c table.table:has(> tbody > tr.forum) {
    display: block; width: 100%; max-width: 100%; min-width: 0;
    border: 0; margin: 0;
  }
  .r_block_c table.table > tbody:has(> tr.forum) {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px;
    width: 100%; min-width: 0;
  }
  .r_block_c table.table > tbody > tr.forum {
    display: grid; grid-template-columns: 48px minmax(0, 1fr);
    align-items: start; column-gap: 12px; width: 100%; min-width: 0;
    padding: 12px; box-sizing: border-box;
    background: var(--bsui-surface, #faf6ef);
    border: 1px solid var(--bsui-border, #cdbb9f); border-radius: 4px;
  }
  .content .r_block_c table.table:has(> tbody > tr.forum) > tbody > tr.forum > td {
    display: block; width: auto; min-width: 0; padding: 0; border: 0;
    background: transparent; text-align: left; white-space: normal;
    overflow: visible; overflow-wrap: anywhere; word-break: normal;
    font-size: 14px; line-height: 1.5;
  }
  /* The original .lh-11 and all three .forum_info widths use !important. */
  .r_block_c table.table > tbody > tr.forum > td:nth-child(2) { line-height: 1.5 !important; }
  .r_block_c table.table > tbody > tr.forum > td.forum_img {
    width: 48px; min-width: 48px; max-width: 48px;
  }
  .r_block_c table.table > tbody > tr.forum > td.forum_img > img {
    display: block; width: 48px; height: 48px; min-width: 48px; max-width: 48px;
    object-fit: contain; margin: 0;
  }
  .content .r_block_c table.table:has(> tbody > tr.forum) > tbody > tr.forum > td.forum_info {
    grid-column: 1 / -1; width: auto !important; min-width: 0 !important; max-width: none !important;
    margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--bsui-line, #e2d7c7);
    white-space: normal; overflow: visible; text-overflow: clip;
  }
  .r_block_c #forum tr.forum h4,
  .r_block_c table.table > tbody > tr.forum h4 {
    margin: 0 0 4px; font-size: 15px; line-height: 1.4;
  }
  .r_block_c table.table > tbody > tr.forum small {
    display: block; font-size: 14px; line-height: 1.5;
    color: var(--bsui-muted, #776c5c); overflow-wrap: anywhere;
  }
  .r_block_c table.table > tbody > tr.forum p {
    margin: 0 0 4px; font-size: 14px; line-height: 1.5;
    overflow: visible; white-space: normal; text-overflow: clip; overflow-wrap: anywhere;
  }
  .r_block_c table.table > tbody > tr.forum p:last-child { margin-bottom: 0; }
  .r_block_c table.table > tbody > tr.forum a {
    white-space: normal; overflow-wrap: anywhere; word-break: normal;
  }
  .r_block_c #forum > .block { padding: 10px; }
  .r_block_c #forum .block_head { font-size: 14px; line-height: 1.5; }

  /* The home feed floats author/topic opposite date and truncates paragraphs.
     Stack those fields; the sidebar uses the same widget without .main_active. */
  .content :is(.main_active, #last_activity) .last_msg { padding: 10px; }
  .content :is(.main_active, #last_activity) .last_msg :is(.last_left, .last_right) {
    float: none; display: block; width: auto; max-width: 100%; min-width: 0; text-align: left;
  }
  .content :is(.main_active, #last_activity) .last_msg p {
    margin: 0 0 4px; font-size: 14px; line-height: 1.45;
    white-space: normal; text-overflow: clip; overflow: visible; overflow-wrap: anywhere;
  }
  .content :is(.main_active, #last_activity) .last_msg .last_right p { margin-bottom: 0; }
  .content :is(.main_active, #last_activity) .last_msg a { white-space: normal; overflow-wrap: anywhere; }
}

} /* End mobile-only scope. No rules outside this media query. */
