/* Поверх оригинальных стилей 2017 года: шрифт из инлайнового <style> старого сайта и всё новое. */
/* Пропорциональная версия Monocraft (tools/make_font.py): по размеру и плотности как шрифт VimeTop 2017.
   15px здесь соответствуют 13px старого шрифта. */
@font-face {
  font-family: "VimeStats Pixel";
  src: url("../fonts/VimeStatsPixel.ttf");
}

.mc { font-family: "VimeStats Pixel", monospace; font-size: 15px; }
.mc-title { font-family: "VimeStats Pixel", monospace; font-size: 15px; color: #4caf50; }
/* Кнопки в колонке профиля — тем же шрифтом, что и текст вокруг */
.btn.mc-btn { font-family: "VimeStats Pixel", monospace; font-size: 15px; }
.mc-title .k { color: #000; }
.pixel { image-rendering: pixelated; }
.head { width: 25px; height: 25px; margin-right: 4px; vertical-align: middle; }

.loading { padding: 60px 0; text-align: center; }
.loader { display: inline-flex; gap: 6px; }
.loader i { width: 12px; height: 12px; background: #4caf50; animation: loader 0.9s steps(3) infinite; }
.loader i:nth-child(2) { animation-delay: 0.15s; }
.loader i:nth-child(3) { animation-delay: 0.3s; }
@keyframes loader { 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .loader i { animation: none; } }
.mode-icon { width: 20px; height: 20px; vertical-align: -4px; margin-left: 6px; }
/* В заголовках крупнее: при 20 px у блоков (TNT, кирпичи) не разобрать рисунок */
.panel-heading .mode-icon, .panel-title .mode-icon, .mc-title .mode-icon { width: 32px; height: 32px; vertical-align: -10px; }
.notice { padding: 40px 15px; text-align: center; color: #777; }
.notice.error { color: #f34141; }

.widget-tile .desc { color: #333; }
.widget-tile .value { font-size: 24px; }
.data-info { text-align: center; padding: 18px 0; }

.search-switch { cursor: pointer; text-align: center; }
.search-switch .on { font-weight: bold; }
.search-box { max-width: 560px; margin: 24px auto; }

.online-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.online-row .name { flex: 0 0 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-row .bar { flex: 1; height: 8px; background: #eee; border-radius: 2px; overflow: hidden; }
.online-row .bar i { display: block; height: 100%; background: #4caf50; }
.online-row .num { flex: 0 0 56px; text-align: right; }

.table-wrap { overflow-x: auto; }
.table-wrap table { width: 100%; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable .dir { color: #4caf50; }
.table-tools { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.table-tools select, .table-tools input { border: 0; border-bottom: 1px solid #d2d2d2; background: transparent; padding: 4px; outline: 0; }
.table-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.table-foot .pagination { margin: 0; }

.pills { margin-bottom: 14px; }
.pills a { display: inline-block; margin: 0 4px 6px 0; padding: 3px 10px; border: 1px solid #ddd; border-radius: 3px; }
.pills a.on { background: #4caf50; border-color: #4caf50; color: #fff; }

.tab-container .nav-tabs { font-family: "VimeStats Pixel", monospace; font-size: 15px; }
.body-skin { height: 320px; }
.profile-facts { font-size: 15px; line-height: 1.6; }
.stat-card { min-height: 190px; text-align: center; font-size: 13px; }
.stat-grid { display: flex; flex-wrap: wrap; }
.stat-grid > div { display: flex; }
.stat-grid .panel { width: 100%; }
/* Ниже md у col-md-6 нет ширины, и во flex-ряду карточка сжималась по тексту */
@media (max-width: 991px) { .stat-grid > div { width: 100%; } }
.guild-avatar { width: 96px; height: 96px; object-fit: cover; }

.notifications-menu { position: relative; }
.notifications-menu.open > #staff-list { display: block; }
#staff-list { max-height: 360px; overflow: auto; padding: 8px 0; min-width: 240px; right: 0; left: auto; list-style: none; }
#staff-list li { padding: 3px 12px; white-space: nowrap; }

.main-footer a { color: #4caf50; }

/* Уровень страницы: на узких экранах ничего не вылезает за край */
@media (max-width: 767px) {
  .content { padding-left: 8px; padding-right: 8px; }
  .online-row .name { flex-basis: 110px; }
  /* Фиксированная панель темы перекрывает логотип: выносим его поверх неё */
  .main-header .logo { position: fixed; top: 0; left: 44px; width: auto; z-index: 1031; padding: 0 8px; background: transparent !important; }
  .main-sidebar { padding-top: 50px; }
  /* Логотип и панель вне потока: высоту шапки задаём сами, иначе контент уезжает под панель */
  .main-header { height: 50px; }
}

.site-logo { vertical-align: middle; margin-top: -4px; }
/* Надпись логотипа пиксельным шрифтом: 27px — ровно 3 экранных пикселя на пиксель шрифта,
   тень сдвинута на один пиксель шрифта, как у надписей в Minecraft. Поля шапки уже, иначе не влезает в 220px. */
.main-header .logo { padding: 0 10px; white-space: nowrap; }
.wordmark { font-family: "VimeStats Pixel", monospace; font-size: 27px; color: #fff; text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.28); vertical-align: middle; margin-left: 6px; font-weight: normal; }
.wordmark span { color: #ffeb3b; }

.stat-extra { margin-top: 8px; padding-top: 8px; border-top: 1px solid #eee; }
.limit-note { background: #fff3e0; color: #8a4b00; padding: 8px 16px; text-align: center; }
.limit-note[hidden] { display: none; }
.tab-container .nav-tabs > li > a { padding-left: 6px; padding-right: 6px; min-width: 0; }

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.chart .grid { stroke: #eceff1; stroke-width: 1; }
.chart .tick { fill: #78909c; font-size: 12px; }
.chart .line { fill: none; stroke: #2e7d32; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cross { stroke: #b0bec5; stroke-width: 1; }
.chart .dot { fill: #2e7d32; stroke: #fff; stroke-width: 2; }
.chart .hit { fill: transparent; }
.chart [hidden] { display: none; }
.chart-tip { position: absolute; padding: 4px 8px; background: #1f2d33; color: #fff; border-radius: 3px; font-size: 12px; white-space: nowrap; pointer-events: none; }
.chart-note { color: #777; font-size: 13px; }
.chart-pick { display: block; font-weight: normal; margin-bottom: 12px; }
.chart-pick select { max-width: 100%; margin-left: 6px; }
.chart-table { margin-top: 12px; }
.chart-table summary { cursor: pointer; color: #4caf50; margin-bottom: 8px; }

.ub-preview { overflow-x: auto; }
.ub-preview img { max-width: 100%; height: auto; image-rendering: pixelated; }
.ub-code { display: block; font-weight: normal; margin-bottom: 8px; }
.ub-code input { display: block; width: 100%; padding: 4px 6px; border: 1px solid #ddd; font-family: monospace; font-size: 12px; }

.stat-card { overflow-wrap: anywhere; }
@media (max-width: 767px) {
  .chart .tick { font-size: 22px; }
}

.game-card { cursor: pointer; }
.game-card:focus-visible { outline: 2px solid #4caf50; outline-offset: 2px; }
.card-hint { float: right; font-size: 14px; color: #cfd8dc; margin-top: 6px; }
.game-card:hover .card-hint, .game-card[aria-expanded="true"] .card-hint { color: #ffb300; }
.stat-places { margin-top: 10px; padding-top: 10px; border-top: 1px solid #eee; cursor: default; }
.stat-places[hidden] { display: none; }
.stat-places .loading { padding: 12px 0; }
.places-table { width: 100%; font-size: 13px; }
.places-table th { font-weight: 600; color: #607d8b; padding: 2px 4px; text-align: center; }
.places-table th:first-child, .places-table td:first-child { text-align: left; }
.places-table td { padding: 2px 4px; text-align: center; }
.places-table td:not(:first-child), .places-table th:not(:first-child) { white-space: nowrap; }

/* Сравнение игроков */
.compare-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; max-width: 720px; }
.compare-form input { flex: 1 1 200px; }
.compare-form .vs { flex: 0 0 auto; }
.compare-head { width: 64px; height: 64px; margin-bottom: 8px; }
.compare-player .mc-title { line-height: 1.7; overflow-wrap: anywhere; }
.compare-score { color: #2e7d32; }
.compare-table { margin-bottom: 0; font-size: 13px; table-layout: fixed; }
.compare-table th:first-child { width: 44%; font-weight: normal; color: #607d8b; }
.compare-table thead th { font-family: "VimeStats Pixel", monospace; font-size: 15px; font-weight: normal; color: #000; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-table td { overflow-wrap: anywhere; }
.compare-table td.better { font-weight: bold; color: #2e7d32; }
.compare-table .mark { font-size: 10px; }

/* Гильдия: кто сейчас в игре */
.online-members { margin-bottom: 0; }
.online-members .where { color: #2e7d32; }
.compare-table thead .head { width: 20px; height: 20px; }
@media (max-width: 767px) {
  .compare-form input { flex-basis: 100%; }
  .compare-form .vs { flex-basis: 100%; text-align: center; }
  .compare-form .btn { width: 100%; }
  .compare-table th:first-child { width: 34%; }
  .compare-table thead th { font-size: 13.5px; }
  .compare-player .panel-body { padding: 12px 6px; }
}
/* Ники пиксельным шрифтом широкие: чуть уже поля ячеек, чтобы таблица участников гильдии влезала без прокрутки */
.table-wrap .dataTable > thead > tr > th, .table-wrap .dataTable > tbody > tr > td { padding-left: 6px; padding-right: 6px; }

/* Матчи */
.match-row { cursor: pointer; }
.match-row .mode-icon { margin: 0 4px 0 0; }
.match-row .ago { color: #90a4ae; white-space: nowrap; text-align: right; }
.match-open { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; max-width: 420px; margin-bottom: 16px; }
.match-open input { flex: 1 1 180px; }
.match-winner { font-size: 15px; line-height: 1.8; overflow-wrap: anywhere; }
.match-cup, .team-card .fa-trophy { color: #ffb300; }
.team-card { width: 100%; margin-bottom: 15px; padding: 10px 12px; border-left: 4px solid; background: #fafafa; }
.team-card.won { background: #fff8e1; }
.team-card .mc-title { margin-bottom: 6px; }
.team-extra { color: #607d8b; font-size: 13px; }
.team-members { margin-top: 6px; line-height: 1.9; }
.team-name { font-weight: 600; }
.match-count { font-family: inherit; font-size: 13px; color: #90a4ae; margin-left: 6px; }
.match-events { margin-bottom: 0; }
.match-events td.t { width: 56px; color: #90a4ae; font-variant-numeric: tabular-nums; white-space: nowrap; }
.match-events .fa { width: 16px; text-align: center; }
.ev-kill { color: #e53935; }
.ev-bed { color: #8e24aa; }
.ev-muted { color: #b0bec5; }
.ev-note { color: #90a4ae; font-size: 12px; margin-left: 4px; white-space: nowrap; }
.match-players td:first-child { white-space: nowrap; }
.mojang-note { margin-top: 4px; font-size: 11px; color: #90a4ae; }

/* Поиск в шапке */
.nav-search { position: relative; }
.main-header .navbar .nav > li.nav-search > .nav-search-toggle { display: none; }
#nav-search-form { position: relative; margin: 9px 8px 0 0; }
#nav-search-form > .fa { position: absolute; left: 10px; top: 9px; font-size: 14px; color: rgba(255, 255, 255, 0.85); pointer-events: none; }
#nav-search-form:focus-within > .fa { color: #90a4ae; }
#nav-query { width: 260px; height: 32px; padding: 0 10px 0 32px; border: 0; border-radius: 3px; background: rgba(0, 0, 0, 0.14); color: #fff; outline: 0; transition: background 0.15s; }
#nav-query::placeholder { color: rgba(255, 255, 255, 0.8); }
#nav-query:focus { background: #fff; color: #263238; }
#nav-query:focus::placeholder { color: #90a4ae; }
#nav-query::-webkit-search-cancel-button { filter: grayscale(1); }
.nav-results { position: absolute; top: 38px; right: 0; width: 340px; max-height: 70vh; overflow-y: auto; padding: 6px 0; background: #fff; border-radius: 3px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2); z-index: 1040; }
.nav-results[hidden] { display: none; }
.nav-group { padding: 6px 12px 2px; font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; color: #90a4ae; }
#nav-results .nav-item { display: flex; align-items: center; padding: 5px 12px; color: #000; white-space: nowrap; overflow: hidden; }
#nav-results .nav-item:hover, #nav-results .nav-item.on { background: #e8f5e9; }
.nav-item .head { flex: none; }
/* Подпись — один блок: во flex-строке пробел между рангом и ником иначе пропадает */
.nav-item .label-text { overflow: hidden; text-overflow: ellipsis; }
.nav-item .meta { margin-left: auto; padding-left: 12px; font-size: 13px; color: #90a4ae; }
.nav-note { padding: 8px 12px; font-size: 13px; color: #607d8b; }
.nav-note.error { color: #f34141; }
.nav-note .loading { padding: 4px 0; }
@media (max-width: 991px) { #nav-query { width: 200px; } }
/* На телефоне места под поле нет: в шапке значок, поле выезжает полосой под ней */
@media (max-width: 767px) {
  .main-header .navbar .nav > li.nav-search > .nav-search-toggle { display: block; }
  #nav-search-form { display: none; }
  .nav-search.open #nav-search-form { display: block; position: fixed; top: 50px; left: 0; right: 0; margin: 0; padding: 8px; background: #4caf50; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); z-index: 1035; }
  .nav-search.open #nav-search-form > .fa { left: 18px; top: 17px; }
  #nav-query { width: 100%; font-size: 16px; } /* 16px: iOS не приближает страницу при фокусе */
  .nav-results { left: 8px; right: 8px; top: 46px; width: auto; }
}

/* График онлайна на главной */
#online-chart { scroll-margin-top: 60px; } /* шапка фиксированная: при прокрутке к графику не прячем заголовок под ней */
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 0 16px; }
.chart-head .pills { margin-bottom: 8px; }
.chart-head .pills a { color: #333; }
.chart-head .pills a.on { color: #fff; }
.chart-head .chart-pick { margin-bottom: 8px; }
.online-chart { min-height: 120px; }
.chart .point { fill: #2e7d32; }
a.online-row { color: inherit; padding: 2px 4px; margin: 0 -4px 4px; border-radius: 3px; }
a.online-row:hover, a.online-row:focus-visible { background: #f1f8e9; color: inherit; }
/* В fit-графике единица SVG = пиксель экрана. !important — против «svg text { font-size: 14px !important }» из CSS 2017 года */
.chart.fit .tick { font-size: 12px !important; }

/* Скин: вид сзади поверх вида спереди */
.skin-flip { position: relative; display: inline-block; cursor: pointer; outline: 0; }
.skin-flip .back { position: absolute; left: 0; top: 0; visibility: hidden; }
.skin-flip.flipped .back { visibility: visible; }
.skin-flip.flipped .front { visibility: hidden; }
@media (hover: hover) {
  .skin-flip:hover .back { visibility: visible; }
  .skin-flip:hover .front { visibility: hidden; }
}
.skin-flip:focus-visible { outline: 2px solid #4caf50; outline-offset: 4px; }
.skin-flip.no-back { cursor: default; }
.skin-hint { margin-top: 6px; font-size: 12px; color: #90a4ae; }
@media (hover: hover) { .skin-hint { display: none; } }
.skin-flip.no-back + .skin-hint { display: none; }

/* Подсказка «сколько времени назад» у даты: сразу при наведении, на телефоне — по нажатию */
.ago-tip { position: relative; cursor: help; border-bottom: 1px dotted #a5d6a7; outline: 0; }
.ago-tip::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  padding: 4px 8px; border-radius: 3px; background: #1f2d33; color: #fff; font: 12px/1.4 "Lato", sans-serif; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity 0.1s; z-index: 5; }
.ago-tip[data-tip]:hover::after, .ago-tip[data-tip]:focus::after { opacity: 1; }

/* О сайте */
.status-grid { display: grid; gap: 10px; }
.status-card { padding: 10px 12px; border-left: 4px solid #b0bec5; background: #fafafa; }
.status-card.ok { border-color: #43a047; }
.status-card.warn { border-color: #fb8c00; }
.status-card.bad { border-color: #e53935; background: #fff5f5; }
.status-title { font-size: 12px; letter-spacing: 0.5px; text-transform: uppercase; color: #78909c; }
.status-state { margin: 2px 0 4px; font-size: 16px; font-weight: 600; color: #263238; }
.status-card.ok .fa { color: #2e7d32; }
.status-card.warn .fa { color: #e65100; }
.status-card.bad .fa { color: #c62828; }
.status-card.wait .fa { color: #78909c; }
.status-details { font-size: 13px; color: #546e7a; overflow-wrap: anywhere; }
.status-updated, .status-version { margin: 10px 0 0; font-size: 12px; color: #90a4ae; }
.change-day + .change-day { margin-top: 18px; }
.change-day h4 { margin: 0 0 8px; }
.change-day ul { margin: 0; padding: 0; list-style: none; }
.change-day li { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; border-bottom: 1px solid #f1f1f1; line-height: 1.5; }
.change-day li:last-child { border-bottom: 0; }
.change-tag { flex: none; min-width: 82px; padding: 0 6px; border-radius: 3px; font-size: 11px; font-weight: 600; text-align: center; vertical-align: 1px; }
.change-tag.add { background: #e8f5e9; color: #2e7d32; }
.change-tag.change { background: #e3f2fd; color: #1565c0; }
.change-tag.fix { background: #fff3e0; color: #e65100; }
.footer-sep { color: #b0bec5; margin: 0 4px; }

/* График «Весь сервер»: несколько линий, легенда-кнопки */
.chart .mline { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.chart .mdot { stroke: #fff; stroke-width: 2; }
.chart-tip.multi { padding: 6px 10px; min-width: 190px; }
.chart-tip .tip-time { margin-bottom: 4px; color: #b0bec5; }
.chart-tip .tip-row { display: flex; align-items: center; gap: 6px; line-height: 1.6; }
.chart-tip .tip-row b { margin-left: auto; padding-left: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.swatch { flex: none; display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: var(--c); vertical-align: middle; }
.swatch.dash { background: repeating-linear-gradient(90deg, var(--c) 0 4px, transparent 4px 7px); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 10px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid #e0e0e0; border-radius: 3px; background: #fff; color: #37474f; font-size: 13px; line-height: 1.4; cursor: pointer; }
.legend-item:hover { background: #f5f5f5; }
.legend-item:focus-visible { outline: 2px solid #4caf50; outline-offset: 1px; }
.legend-item.off { color: #b0bec5; text-decoration: line-through; }
.legend-item.off .swatch { opacity: 0.3; }
.online-chart .chart-legend + .chart-note { margin: 6px 0 0; }
.online-chart #oc-rows, #oc-rows .table-wrap { overflow-x: auto; }
.chart-tip.multi { z-index: 3; }
