/* AnarchyRofl: личный кабинет, рейтинги и публичный профиль. Подключается после style.css. */

:root {
  --gold: #f5c542; --silver: #c9d1d9; --bronze: #d08a4e;
  --info: #7fb4ff;
  --sk-a: #1f2328; --sk-b: #2a2f36;
}

body.cab, body.pub { background: var(--bg); }

/* ---------- Каркас кабинета ---------- */
.cab-shell {
  width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 16px 56px; flex: 1 0 auto;
  display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 24px; align-items: start;
}
.cab-shell.solo { grid-template-columns: minmax(0, 1fr); max-width: 980px; }
.cab-main { min-width: 0; outline: none; }
.cab-side { position: sticky; top: 12px; display: grid; gap: 14px; }

.who {
  background: var(--panel); border: 2px solid var(--line); padding: 14px; display: grid; gap: 10px; justify-items: start;
}
.who .who-top { display: flex; align-items: center; gap: 12px; min-width: 0; width: 100%; }
.who .who-name { font: 700 1.05rem/1.2 var(--mono); overflow-wrap: anywhere; }
.who .who-sub { color: var(--muted); font-size: .85rem; }

.avatar { position: relative; flex: none; width: 56px; height: 56px; background: var(--panel-2); border: 2px solid var(--line); image-rendering: pixelated; display: grid; place-items: center; overflow: hidden; }
.avatar img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.avatar .letter { font: 700 1.6rem/1 var(--mono); color: var(--accent); }
.avatar.lg { width: 96px; height: 96px; }
.avatar.lg .letter { font-size: 2.8rem; }
.avatar.sm { width: 36px; height: 36px; border-width: 1px; }
.avatar.sm .letter { font-size: 1.1rem; }

.cab-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cab-nav li { margin: 0; }
.cab-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 44px; color: var(--muted);
  text-decoration: none; border: 2px solid transparent; border-left: 4px solid transparent; background: transparent;
}
.cab-nav a:hover { color: var(--text); background: var(--panel); }
.cab-nav a[aria-current="page"] { color: var(--text); background: var(--panel); border-color: var(--line); border-left-color: var(--red); font-weight: 700; }
.cab-nav svg { flex: none; }
.cab-nav .sep { margin: 8px 0 2px; padding: 0 12px; font: 600 .72rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #7d7a72; }

.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 16px; height: 16px; }
.ico.lg { width: 32px; height: 32px; }

.cab-bottom { display: none; }

.cab-head { margin: 0 0 18px; }
.cab-head h1 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); line-height: 1.15; margin: 0 0 6px; }
.cab-head .sec-lead { margin: 0; max-width: 64ch; }

.demo-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 16px; padding: 10px 14px;
  background: rgba(127, 180, 255, .1); border: 2px dashed var(--info); color: var(--text);
}
.demo-banner strong { color: var(--info); font: 700 .8rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.demo-banner a { color: var(--info); }

/* ---------- Блоки ---------- */
.box { background: var(--panel); border: 2px solid var(--line); padding: 16px 18px; min-width: 0; }
.box > h2, .box > .box-head h2 { font-size: 1.1rem; margin: 0; display: flex; align-items: center; gap: 8px; }
.box > h2 { margin-bottom: 12px; }
.box .box-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; }
.box h3 { margin: 14px 0 6px; font-size: 1rem; }
.box p:last-child { margin-bottom: 0; }
.stack { display: grid; gap: 16px; }
.cols-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }
.small { font-size: .88rem; }
.mono { font-family: var(--mono); }

.tile { background: var(--panel); border: 2px solid var(--line); padding: 14px 16px; display: grid; gap: 4px; min-width: 0; position: relative; }
.tile .t-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 600 .75rem/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.tile .t-value { font: 700 clamp(1.4rem, 3.4vw, 1.8rem)/1.1 var(--mono); overflow-wrap: anywhere; }
.tile .t-sub { color: var(--muted); font-size: .85rem; }
.tile.ruby .t-label svg { color: #ff6b81; }
.tile.coin .t-label svg { color: var(--gold); }
.tile.time .t-label svg { color: var(--info); }
.tile.pvp .t-label svg { color: var(--red-text); }
.tile.ac .t-label svg { color: #b58cff; }

.badge.grp {
  color: var(--gc, var(--text)); border-color: var(--gc, var(--line)); background: var(--gc-bg, transparent);
  font-size: .8rem; padding: 5px 9px;
}
.badge.on { color: var(--good); border-color: #3c5e41; }
.badge.off { color: var(--muted); }
.badge.warn { color: var(--accent); border-color: #6b5320; }
.dot { display: inline-block; width: 9px; height: 9px; background: var(--muted); margin-right: 6px; vertical-align: 1px; }
.dot.on { background: var(--good); box-shadow: 0 0 0 3px rgba(143, 214, 148, .18); }

/* ---------- Полоски ---------- */
.pbar { display: block; height: 14px; background: var(--bg); border: 2px solid var(--line); overflow: hidden; position: relative; }
.pbar > i { display: block; height: 100%; width: 0; background: var(--red); transition: width .5s ease; }
.pbar.gold > i { background: var(--accent); }
.pbar.green > i { background: #5fbf6a; }
.pbar.blue > i { background: #4f8fe0; }
.pbar.purple > i { background: #9a6fe0; }
.bar-cap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; color: var(--muted); font-size: .85rem; margin-top: 6px; }
.bar-cap strong { color: var(--text); }
.meter { margin: 0 0 14px; }
.meter:last-child { margin-bottom: 0; }
.meter .m-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; align-items: baseline; }
.meter .m-top span:first-child { font-weight: 600; }

/* ---------- Раса, шапка профиля ---------- */
.hero-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; background: var(--panel); border: 2px solid var(--line); padding: 18px;
  background-image: linear-gradient(120deg, rgba(201, 43, 48, .14), transparent 55%); }
.hero-card h2 { margin: 0 0 4px; font: 700 clamp(1.3rem, 4vw, 1.8rem)/1.15 var(--mono); overflow-wrap: anywhere; }
.hero-card .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: .92rem; }
.race-line { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.race-line img { width: 56px; height: 56px; flex: none; }
.race-line h3 { margin: 0; font-size: 1.25rem; }
.race-line p { margin: 0; color: var(--muted); }

.fresh { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--muted); font-size: .9rem; margin: 0 0 14px; }
.fresh .btn-mini { margin-left: auto; }
.btn-mini {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; font: 600 .88rem/1.2 var(--sans); color: var(--accent);
  background: transparent; border: 2px solid var(--line); cursor: pointer; border-radius: 2px;
}
.btn-mini:hover { border-color: var(--accent); background: rgba(224, 169, 60, .1); color: #f3c466; }
.btn-mini[disabled] { opacity: .55; cursor: default; }
.btn-mini.danger { color: var(--red-text); }
.btn-mini.danger:hover { border-color: var(--red); background: rgba(201, 43, 48, .12); color: #ffb0ab; }
.btn.small-btn { min-height: 40px; padding: 8px 14px; }

.hint { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-left: 4px solid var(--info); background: rgba(127, 180, 255, .08); margin: 0 0 14px; color: var(--text); font-size: .93rem; }
.hint.warn { border-left-color: var(--accent); background: rgba(224, 169, 60, .09); }
.hint.bad { border-left-color: var(--bad); background: rgba(240, 138, 122, .09); }
.hint.good { border-left-color: var(--good); background: rgba(143, 214, 148, .08); }
.hint svg { margin-top: 2px; }
.hint p { margin: 0; }

.list-plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list-plain li { margin: 0; display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.list-plain li svg { color: var(--accent); }

/* ---------- Операции ---------- */
.ops { list-style: none; margin: 0; padding: 0; }
.ops li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); margin: 0; }
.ops li:first-child { border-top: 0; padding-top: 0; }
.ops .o-title { font-weight: 600; overflow-wrap: anywhere; }
.ops .o-sub { color: var(--muted); font-size: .85rem; }
.ops .o-delta { font: 700 1rem/1.3 var(--mono); text-align: right; white-space: nowrap; }
.ops .o-bal { color: var(--muted); font-size: .85rem; text-align: right; white-space: nowrap; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.chip {
  min-height: 36px; padding: 6px 12px; font: 600 .88rem/1.2 var(--sans); color: var(--muted); background: var(--bg); border: 2px solid var(--line);
  cursor: pointer; border-radius: 2px;
}
.chip:hover { color: var(--text); border-color: #4a515b; }
.chip[aria-pressed="true"], .chip[aria-selected="true"] { color: var(--text); border-color: var(--red); background: rgba(201, 43, 48, .16); }
.chip .cnt { color: var(--muted); font-weight: 400; margin-left: 4px; }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; color: var(--muted); font-size: .9rem; }

/* ---------- Таблицы кабинета ---------- */
table.data.cab { min-width: 0; }
table.data.cab td.pos { color: var(--plus, var(--good)); }
@media (max-width: 640px) {
  table.data.resp { min-width: 0; }
  table.data.resp thead { position: absolute; left: -9999px; }
  table.data.resp tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; padding: 10px 12px; border-top: 1px solid var(--line); }
  table.data.resp td, table.data.resp th { border: 0; padding: 2px 0; text-align: left !important; }
  table.data.resp td::before { content: attr(data-label); display: block; color: var(--muted); font-size: .72rem; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; }
  table.data.resp td.wide { grid-column: 1 / -1; }
}

/* ---------- График ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid-l { stroke: #2d3239; stroke-width: 1; }
.chart .axis-t { fill: #a9a69d; font: 11px var(--mono); }
.chart .line { fill: none; stroke: #ff6b81; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: rgba(255, 107, 129, .14); stroke: none; }
.chart .pt { fill: #111215; stroke: #ff6b81; stroke-width: 2; }

/* ---------- Формы ---------- */
.field { display: grid; gap: 6px; margin: 0 0 14px; }
.field label, .field .lbl { font-weight: 600; font-size: .92rem; }
.field .help { color: var(--muted); font-size: .85rem; }
.input {
  width: 100%; min-height: 46px; padding: 10px 12px; background: var(--bg); color: var(--text); font: 600 1rem/1.2 var(--mono);
  border: 2px solid var(--line); border-radius: 2px;
}
.input::placeholder { color: #6f6d66; font-weight: 400; }
.input:hover { border-color: #4a515b; }
.input:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.input.code { letter-spacing: .5em; text-align: center; font-size: 1.4rem; }
.form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.form-row .input { flex: 1 1 200px; width: auto; }
.form-row .btn { flex: 0 0 auto; }
.msg { min-height: 1.5em; margin: 8px 0 0; font-size: .93rem; }
.msg.ok { color: var(--good); }
.msg.err { color: var(--bad); }
.msg.wait { color: var(--muted); }

.switch { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; flex: none; width: 54px; height: 30px; background: var(--bg); border: 2px solid var(--line); transition: background .2s, border-color .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: var(--muted); transition: transform .2s, background .2s; }
.switch input:checked + .track { background: rgba(95, 191, 106, .22); border-color: #3c5e41; }
.switch input:checked + .track::after { transform: translateX(24px); background: var(--good); }
.switch input:focus-visible + .track { outline: 3px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .5; }
.switch .sw-text strong { display: block; }
.switch .sw-text span { color: var(--muted); font-size: .9rem; }

.linkbox { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.linkbox code { flex: 1 1 220px; white-space: normal; overflow-wrap: anywhere; padding: 8px 10px; background: var(--bg); }

/* ---------- Сессии ---------- */
.sessions { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.sessions li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); margin: 0; }
.sessions .s-main { min-width: 0; }
.sessions .s-title { font-weight: 700; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sessions .s-sub { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }

/* ---------- Слава ---------- */
.steps5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 10px 0 8px; }
.steps5 .stp { height: 14px; background: var(--bg); border: 2px solid var(--line); position: relative; overflow: hidden; }
.steps5 .stp > i { display: block; height: 100%; width: 0; background: var(--red); }
.steps5 .stp.done > i { width: 100%; }
.levels { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.levels li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 2px 12px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); margin: 0; }
.levels li.cur { border-color: var(--red); background: rgba(201, 43, 48, .1); }
.levels .lv { grid-row: span 2; width: 34px; height: 34px; display: grid; place-items: center; background: var(--panel-2); font: 700 1rem/1 var(--mono); color: var(--accent); }
.levels li.cur .lv { background: var(--red); color: #fff; }
.levels .lv-name { font-weight: 700; }
.levels .lv-name .th { color: var(--muted); font-weight: 400; font-size: .85rem; margin-left: 6px; }
.levels .lv-eff { color: var(--muted); font-size: .88rem; }

/* ---------- Питомцы ---------- */
.pets { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); }
.pet { background: var(--bg); border: 2px solid var(--line); padding: 12px; display: grid; gap: 6px; justify-items: start; }
.pet.active { border-color: var(--accent); }
.pet .p-name { font-weight: 700; overflow-wrap: anywhere; }
.rank { display: inline-block; min-width: 2.4em; text-align: center; padding: 3px 7px; font: 700 .8rem/1 var(--mono); border: 1px solid; }
.rank.r-c, .rank.r-b { color: #b9c0c8; border-color: #5a626c; }
.rank.r-a { color: #8fd694; border-color: #3c5e41; }
.rank.r-s { color: #f5c542; border-color: #7d6420; }
.rank.r-ss { color: #ff9f4a; border-color: #8a5420; }
.rank.r-sss { color: #ff6b6b; border-color: #8a2e2e; }
.rank.r-z { color: #c79bff; border-color: #5f3d8f; }

/* ---------- Состояния ---------- */
.state { text-align: center; padding: 36px 18px; background: var(--panel); border: 2px dashed var(--line); }
.state .ico { width: 44px; height: 44px; color: var(--accent); margin-bottom: 8px; }
.state h2 { margin: 0 0 8px; font-size: 1.3rem; }
.state p { color: var(--muted); max-width: 52ch; margin: 0 auto 12px; }
.state .btn-row { justify-content: center; }
.empty { color: var(--muted); padding: 10px 0; }

.sk { background: linear-gradient(90deg, var(--sk-a), var(--sk-b), var(--sk-a)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border: 2px solid var(--line); }
.sk.h-tile { height: 92px; } .sk.h-hero { height: 140px; } .sk.h-box { height: 190px; } .sk.h-line { height: 18px; margin: 8px 0; border-width: 1px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60; max-width: min(92vw, 420px);
  padding: 10px 16px; background: #0c0d0f; color: var(--text); border: 2px solid var(--accent); box-shadow: 4px 4px 0 rgba(0, 0, 0, .55); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Вход ---------- */
.login-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.login-steps { counter-reset: st; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.login-steps > li { counter-increment: st; position: relative; padding: 0 0 0 52px; margin: 0; min-height: 40px; }
.login-steps > li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 38px; height: 38px; display: grid; place-items: center; background: var(--red); color: #fff; font: 700 1.1rem/1 var(--mono); box-shadow: 3px 3px 0 rgba(0, 0, 0, .55); }
.login-steps h3 { margin: 0 0 2px; font-size: 1.05rem; }
.login-steps p { margin: 0 0 6px; color: var(--muted); }
.ip-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.privacy-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 10px 14px; border-left: 4px solid var(--good); background: rgba(143, 214, 148, .07); font-size: .92rem; }
.privacy-note svg { color: var(--good); margin-top: 2px; }
.privacy-note p { margin: 0; }

/* ---------- Рейтинги и публичный профиль ---------- */
.pub-wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 24px 16px 56px; flex: 1 0 auto; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; margin: 0 0 18px; }
.pod { background: var(--panel); border: 2px solid var(--line); padding: 14px 10px; text-align: center; display: grid; gap: 6px; justify-items: center; min-width: 0; text-decoration: none; color: var(--text); }
a.pod:hover { border-color: var(--accent); color: var(--text); }
.pod .medal { font: 700 1.4rem/1 var(--mono); }
.pod .p-name { font: 700 1rem/1.2 var(--mono); overflow-wrap: anywhere; }
.pod .p-val { color: var(--muted); font-size: .9rem; }
.pod.p1 { border-color: var(--gold); padding-top: 26px; padding-bottom: 22px; background-image: linear-gradient(180deg, rgba(245, 197, 66, .13), transparent 70%); }
.pod.p1 .medal { color: var(--gold); font-size: 1.8rem; }
.pod.p2 { border-color: #6c7480; padding-top: 18px; } .pod.p2 .medal { color: var(--silver); }
.pod.p3 { border-color: #7a5230; } .pod.p3 .medal { color: var(--bronze); }
.pod.p0 { visibility: hidden; }
.pod:nth-child(1) { order: 2; } .pod:nth-child(2) { order: 1; } .pod:nth-child(3) { order: 3; }
.search-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.search-row .input { flex: 1 1 240px; width: auto; font-weight: 400; }
td a.nick { color: var(--text); font-weight: 600; text-decoration: none; border-bottom: 1px dotted var(--muted); overflow-wrap: anywhere; }
td a.nick:hover { color: var(--accent); border-bottom-color: var(--accent); }
.online-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.online-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; background: var(--bg); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; max-width: 100%; }
.online-chip span.n { overflow-wrap: anywhere; }
.online-chip small { color: var(--muted); font-weight: 400; }
.srv-stats { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 12px; color: var(--muted); }
.srv-stats strong { color: var(--text); font-family: var(--mono); }

/* ---------- Подсказки по нижней панели и телефонам ---------- */
@media (max-width: 900px) {
  .cab-shell { grid-template-columns: minmax(0, 1fr); padding-top: 16px; gap: 14px; }
  .cab-side { position: static; }
  .cab-side .cab-nav { display: none; }
  .who { grid-template-columns: auto minmax(0, 1fr); justify-items: stretch; align-items: center; }
  .who .who-top { grid-column: 1 / -1; }
  body.cab { padding-bottom: 74px; }
  .cab-bottom {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
    background: var(--bg-2); border-top: 2px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .cab-bottom a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px; padding: 6px 2px;
    color: var(--muted); text-decoration: none; font-size: .72rem; line-height: 1.1; border-top: 3px solid transparent; text-align: center;
  }
  .cab-bottom a[aria-current="page"] { color: var(--text); border-top-color: var(--red); background: var(--panel); }
  .cab-bottom a:focus-visible { outline-offset: -4px; }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-grid { grid-template-columns: minmax(0, 1fr); }
  .toast { bottom: 84px; }
}
@media (max-width: 640px) {
  .cols-2, .cols-3 { grid-template-columns: minmax(0, 1fr); }
  .hero-card { grid-template-columns: minmax(0, 1fr); justify-items: start; padding: 14px; }
  .box { padding: 14px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px; }
  .podium { gap: 6px; }
  .pod { padding: 10px 4px; }
  .pod .p-name { font-size: .85rem; }
  .form-row .btn { width: 100%; }
  .input.code { letter-spacing: .35em; }
  .fresh .btn-mini { margin-left: 0; }
}
@media (max-width: 360px) {
  .tiles { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .sk { animation: none; }
  .pbar > i, .switch .track, .switch .track::after, .toast { transition: none; }
}
@media print { .cab-side, .cab-bottom, .toast { display: none; } }

/* ---------- Таблица рейтинга на телефоне: компактная строка вместо карточки ---------- */
@media (max-width: 640px) {
  table.data.board tr { grid-template-columns: 2.6rem minmax(0, 1fr) auto; align-items: baseline; padding: 8px 12px; }
  table.data.board td::before { display: none; }
  table.data.board td.wide { grid-column: auto; }
  table.data.board td:nth-child(1) { color: var(--muted); font-family: var(--mono); }
  table.data.board td:nth-child(3) { font-family: var(--mono); font-weight: 700; }
  table.data.board td:nth-child(4) { grid-column: 2 / -1; color: var(--muted); font-size: .85rem; padding-top: 0; }
  table.data.board td:nth-child(4):empty { display: none; }
}
