:root {
  --ink: #1f2933;
  --ink-hover: #364452;
  --paper: #f3f4f6;
  --surface: #ffffff;
  --muted: #5f6b76;
  --line: #d3d8de;
  --tint: #eceff2;
  --link: #1f4e8c;
  --ok: #2f6f4e;
  --warn: #8a5a00;
  --bad: #9c2f2f;
  --body: "Golos Text", "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--body); }
body { min-height: 100vh; display: flex; flex-direction: column; }
body > .wrap { width: 100%; }
body > main.wrap { flex: 1 0 auto; }
body > header, body > footer { flex-shrink: 0; }
a { color: var(--link); }
h1, h2, h3 { font-weight: 600; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
h2 { font-size: 1.4rem; margin-top: 1.6em; }
h3 { font-size: 1.1rem; }
small, .muted { color: var(--muted); }
code { background: var(--tint); padding: 1px 5px; border-radius: 3px; font-size: .92em; word-break: break-all; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 56px; }

/* шапка */
.top { background: var(--ink); color: #fff; }
.top .wrap { display: flex; align-items: center; gap: 10px 24px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: #fff; text-decoration: none; }
.brand .logo { width: 44px; height: 44px; object-fit: contain; flex: none; }
.brand .logo-td { border-radius: 6px; }
.brand-name { line-height: 1.15; }
.brand-name i { font-style: normal; font-weight: 400; color: #aeb8c2; padding: 0 .1em; }
.who { margin-left: auto; }
.top nav { order: 3; flex: 1 0 100%; display: flex; flex-wrap: nowrap; gap: 8px 22px; align-items: center; overflow-x: auto; white-space: nowrap;
  border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 8px; scrollbar-width: thin; }
.top nav a, .top .who a { color: #dfe4e9; text-decoration: none; }
.top nav a:hover, .top .who a:hover { color: #fff; text-decoration: underline; }
.who { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.who img { width: 28px; height: 28px; border-radius: 50%; }
.who form { margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--link); font: inherit; cursor: pointer; text-decoration: underline; }
.top .linkbtn { color: #dfe4e9; text-decoration: none; }
.top .linkbtn:hover { color: #fff; text-decoration: underline; }

/* кнопки: основная тёмная, вторая светлая с тёмной рамкой */
.btn { display: inline-block; background: var(--ink); color: #fff; border: 1px solid var(--ink); border-radius: 4px;
  padding: 8px 16px; font: 600 .95rem/1.4 var(--body); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.btn.alt { background: #fff; color: var(--ink); }
.btn.alt:hover { background: var(--tint); }
.btn.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: #f7ecec; }
.btn.small { padding: 3px 10px; font-size: .88rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
/* на тёмном фоне кнопки меняются местами */
.hero .btn { background: #fff; color: var(--ink); border-color: #fff; }
.hero .btn:hover { background: var(--tint); }
/* вход через Steam: спокойная тёмная кнопка, без белой заливки */
.top .btn.steam { background: transparent; color: #fff; border-color: #6b7885; }
.top .btn.steam:hover { background: rgba(255, 255, 255, .08); border-color: #aeb8c2; }
.hero .btn.alt, .hero .btn.light-outline { background: transparent; color: #fff; border-color: #fff; }
.hero .btn.alt:hover, .hero .btn.light-outline:hover { background: rgba(255, 255, 255, .12); }

/* сообщения */
.messages { margin: 14px auto 0; }
.msg { padding: 10px 14px; border: 1px solid var(--line); border-left: 4px solid var(--ink); background: var(--surface); margin-bottom: 8px; }
.msg.success { border-left-color: var(--ok); }
.msg.error { border-left-color: var(--bad); }
.msg.warning { border-left-color: var(--warn); }
.msg ul { margin: 0; padding-left: 18px; }

/* главная: ближайший старт */
.hero { background: var(--ink) center / cover no-repeat; color: #fff; }
.hero .shade { background: rgba(31, 41, 51, .86); }
.hero .wrap { padding-top: 44px; padding-bottom: 44px; }
.hero a.ev { color: #dfe4e9; }
.hero h1 { margin-bottom: .2em; }
.hero .when { color: #dfe4e9; margin-bottom: 18px; }
.hero-empty { padding: 36px 0; }
.hero .actions { flex-wrap: nowrap; overflow-x: auto; }
.hero .actions .btn { white-space: nowrap; }
.countdown { font-size: clamp(2rem, 7vw, 3.2rem); font-weight: 700; margin: 12px 0 18px; font-variant-numeric: tabular-nums; }

/* список событий */
.board { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.board .row { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 12px 16px;
  border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.board .row:last-child { border-bottom: 0; }
.board .row:hover { background: var(--paper); }
.board .title { font-weight: 600; font-size: 1.1rem; }
.board .meta { color: var(--muted); font-size: .92rem; }
.board .row.daterow { grid-template-columns: 56px 1fr auto; }
.date { display: flex; flex-direction: column; align-items: center; justify-self: center; line-height: 1; }
.date strong { font-size: 1.7rem; }
.date small { font-size: .85rem; }
.slot { display: flex; align-items: center; gap: 8px; text-align: right; font-size: .95rem; line-height: 1.25; }
.slot.big { font-size: 1.05rem; text-align: left; }
.flag { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.flag-open { background: var(--ok); }
.flag-few { background: var(--warn); }
.flag-full { background: var(--bad); }

/* номер машины и цвет класса */
.plate { display: inline-block; min-width: 3em; text-align: center; background: #fff; color: var(--ink); border: 1px solid var(--ink);
  border-left: 6px solid var(--cls, var(--ink)); border-radius: 3px; padding: 0 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chip { display: inline-block; border: 1px solid var(--line); border-left: 6px solid var(--cls, var(--ink)); border-radius: 3px;
  background: #fff; padding: 1px 10px; margin: 0 6px 6px 0; font-weight: 600; }
.teamtag { display: inline-block; border: 1px solid var(--line); border-left: 6px solid var(--team, var(--ink)); border-radius: 3px;
  background: #fff; color: var(--ink); padding: 0 7px; font-weight: 600; font-size: .88em; text-decoration: none; }

/* вкладки */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 20px 0 24px; }
.tabs a { padding: 8px 16px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.subtabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.subtabs a { padding: 3px 12px; border: 1px solid var(--ink); border-radius: 4px; color: var(--ink); text-decoration: none; font-weight: 600; background: #fff; }
.subtabs a[aria-current="page"] { background: var(--ink); color: #fff; }

.event-head { display: grid; gap: 8px; }
.cover { width: 100%; max-height: 320px; object-fit: cover; display: block; margin-bottom: 16px; border-radius: 4px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 16px 18px; margin: 0 0 20px; }
.panel.notice { border-left: 4px solid var(--ink); }
.panel.notice h3 { margin-bottom: .3em; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 24px; margin: 0; }
.facts dt { color: var(--muted); font-size: .88rem; }
.facts dd { margin: 0; font-weight: 600; }

/* таблицы */
.scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; margin-bottom: 20px; }
table { border-collapse: collapse; width: 100%; min-width: 560px; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { background: var(--tint); font-weight: 600; font-size: .9rem; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.me td { background: var(--tint); }
tr.past td, tr.excluded td { color: var(--muted); }
.thumb { width: 72px; height: 44px; object-fit: cover; vertical-align: middle; margin-right: 10px; background: var(--tint); border-radius: 3px; }
.livery-cell { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.livery-cell .thumb { flex: none; margin-right: 0; width: 64px; height: 38px; background: transparent; mix-blend-mode: multiply; }
.car-cell { display: flex; align-items: center; gap: 10px; }
.brandlogo { width: 28px; height: 28px; object-fit: contain; flex: none; }
.status-pending, .status-reserve { color: var(--warn); font-weight: 600; }
.status-rejected, .status-upheld { color: var(--bad); font-weight: 600; }

/* выбор ливреи */
.livery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 8px; }
.livery { position: relative; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; overflow: hidden; }
.livery input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.livery img, .livery .noimg { width: 100%; height: 110px; object-fit: cover; display: block; background: var(--tint); }
.livery .body { padding: 8px 10px; display: flex; gap: 10px; align-items: center; }
.livery:has(input:checked) { border-color: var(--ink); outline: 2px solid var(--ink); }
.livery:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.livery.taken { opacity: .5; cursor: not-allowed; }
.livery.taken input { cursor: not-allowed; }
.livery .tag { position: absolute; top: 6px; right: 6px; background: var(--ink); color: #fff; padding: 0 8px; font-size: .82rem; font-weight: 600; border-radius: 3px; }

/* цифры и администрация */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 8px; }
.stat { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 12px 16px; text-decoration: none; color: inherit; }
a.stat:hover { background: var(--paper); }
.stat strong { display: block; font-size: 1.9rem; line-height: 1.15; }
.stat span { color: var(--muted); font-size: .92rem; }
.badge { display: inline-block; min-width: 1.5em; padding: 0 6px; margin-left: 6px; background: #fff; color: var(--ink);
  border-radius: 10px; font-size: .8rem; font-weight: 700; text-align: center; }
.top .badge { background: #fff; color: var(--ink); }
.pilot-head, .team-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.team-head { border-left: 6px solid var(--team, var(--ink)); padding-left: 16px; }
.team-head img.logo { width: 84px; height: 84px; object-fit: cover; border-radius: 4px; }
.avatar { width: 72px; height: 72px; border-radius: 50%; }
.notif { padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-top: 0; }
.notif:first-of-type { border-top: 1px solid var(--line); }
.notif.new { border-left: 4px solid var(--ink); font-weight: 600; }

/* формы */
form p { margin: 0 0 16px; }
label { font-weight: 600; display: block; margin-bottom: 4px; }
input:not([type]), input[type=text], input[type=search], input[type=url], input[type=number], input[type=password], input[type=file], select, textarea {
  width: 100%; max-width: 640px; padding: 8px 10px; border: 1px solid #9aa4ae; border-radius: 4px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: 1px solid var(--ink); }
input[type=color] { width: 56px; height: 36px; padding: 2px; border: 1px solid #9aa4ae; border-radius: 4px; background: #fff; }
input.mini[type=number] { width: 4.5em; padding: 3px 6px; }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; vertical-align: middle; margin-right: 6px; accent-color: var(--ink); }
.checkrow label, label:has(> input[type=checkbox]) { display: inline; font-weight: 400; }
.helptext { display: block; color: var(--muted); font-size: .9rem; font-weight: 400; margin-top: 2px; }
.errorlist { list-style: none; padding: 0; margin: 0 0 4px; color: var(--bad); font-weight: 600; }
.actions { display: flex; gap: 10px 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
form.inline { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0; }
form.inline p { margin: 0; }
.inline { display: inline; }
.empty { padding: 24px 18px; background: var(--surface); border: 1px dashed #9aa4ae; border-radius: 4px; color: var(--muted); }
.pre { white-space: pre-line; }

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .board .row, .board .row.daterow { grid-template-columns: 1fr; }
  .board .row.daterow { grid-template-columns: 48px 1fr; }
  .board .row.daterow .slot { grid-column: 2; }
  .slot { text-align: left; }
  .top .wrap { gap: 8px 16px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* расписание */
.schedule { margin-bottom: 8px; }
.sch-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.sch-head h2 { margin: 0; min-width: 11ch; text-align: center; }
.sch-nav { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--surface); color: var(--ink); text-decoration: none; font-size: 1.2rem; }
.sch-nav:hover { background: var(--tint); }
.sch-today { font-size: .92rem; }
.sch-legend { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; margin-bottom: 10px; }
.sch-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sch-legend img { width: 22px; height: 22px; object-fit: contain; border-radius: 3px; }
.sch-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.sch-wd { text-align: center; font-weight: 600; font-size: .88rem; color: var(--muted); padding: 4px 0; }
.sch-wd .short { display: none; }
.sch-day { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; min-height: 112px; padding: 4px; display: flex; flex-direction: column; gap: 4px; }
.sch-day.other { background: transparent; border-style: dashed; opacity: .55; }
.sch-day.today { outline: 2px solid var(--ink); outline-offset: -2px; }
.sch-day .num { font-size: 1.05rem; font-weight: 600; line-height: 1; padding: 2px 3px; }
.sch-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px; min-height: 72px;
  padding: 6px 4px; border-radius: 4px; text-decoration: none; background: var(--bg); color: var(--fg); transition: background .15s, color .15s, transform .15s; overflow: hidden; }
.sch-item img { width: 34px; height: 34px; object-fit: contain; border-radius: 4px; }
.sch-item .t { font-weight: 700; font-size: .84rem; line-height: 1.15; overflow-wrap: anywhere; }
.sch-item .s { font-size: .74rem; line-height: 1.15; opacity: .9; overflow-wrap: anywhere; }
.sch-item:hover, .sch-item:focus-visible { background: var(--hbg); color: var(--hfg); transform: scale(1.02); outline-color: var(--hfg); }
.sch-modal { position: fixed; inset: 0; background: rgba(15, 20, 26, .6); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.sch-modal[hidden] { display: none; }
.sch-card { position: relative; background: var(--surface); border-radius: 6px; padding: 22px 24px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }
.sch-card h3 { margin-right: 30px; }
.sch-close { position: absolute; top: 8px; right: 12px; background: none; border: 0; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--muted); }
.sch-close:hover { color: var(--ink); }
@media (max-width: 720px) {
  .sch-wd .full { display: none; }
  .sch-wd .short { display: inline; }
  .sch-day { min-height: 74px; padding: 2px; }
  .sch-item { min-height: 52px; padding: 3px 2px; }
  .sch-item img { width: 24px; height: 24px; }
  .sch-item .s { display: none; }
  .sch-item .t { font-size: .68rem; }
  .brand-name { font-size: 1rem; }
}
.org-ico { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; border-radius: 3px; margin-right: 4px; }
@media (max-width: 640px) { .hero .actions { flex-wrap: wrap; overflow-x: visible; } }

/* лента месяцев */
.sch-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.sch-track::-webkit-scrollbar { display: none; }
.sch-month { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.sch-mtitle { display: none; }
.sch-legend .hint { margin-left: auto; }
.sch-today { background: none; border: 0; padding: 0; color: var(--link); font: inherit; cursor: pointer; text-decoration: underline; }
.sch-nav { cursor: pointer; font: inherit; font-size: 1.2rem; }
.sch-nav[disabled] { opacity: .35; cursor: not-allowed; }
.sch-track:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
@media (max-width: 640px) { .sch-legend .hint { margin-left: 0; flex-basis: 100%; } }
@media (prefers-reduced-motion: reduce) { .sch-track { scroll-behavior: auto; } }

/* ---------- профиль пилота ---------- */
.pcard { --pc: #1f2933; --glowc: #9fb4c7; background: var(--pc); color: #fff; border-radius: 8px; padding: 22px 24px; margin-bottom: 18px;
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,.035) 0 14px, transparent 14px 28px); }
.pcard.theme-td { --pc: #1d3f66; --glowc: #5aa2e8; }
.pcard.theme-rwr { --pc: #7a3608; --glowc: #ffa24d; }
.pcard.theme-gold { --pc: #3f3210; --glowc: #f2c14e; }
.pcard.theme-carbon { --pc: #121417; --glowc: #c9d1d9; }
.pc-top { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.pc-ava { width: 104px; height: 104px; border-radius: 50%; overflow: hidden; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700; border: 3px solid rgba(255,255,255,.65); flex: none; }
.pc-ava img { width: 100%; height: 100%; object-fit: cover; }
.pcard.glow .pc-ava { box-shadow: 0 0 0 3px var(--pc), 0 0 18px 2px var(--glowc); border-color: var(--glowc); }
.pc-name { flex: 1 1 240px; min-width: 0; }
.pc-name h1 { margin: 0 0 4px; color: #fff; }
.pc-name p { margin: 0; color: rgba(255,255,255,.8); }
.pc-name a { color: #fff; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chips .chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(255,255,255,.5); border-radius: 999px; padding: 4px 12px; color: #fff !important;
  background: rgba(255,255,255,.1); font: inherit; font-size: .88rem; cursor: pointer; text-decoration: none; }
.chips .chip:hover { background: rgba(255,255,255,.22); text-decoration: none; }
.chips .chip.dc { border-color: #8ea1ff; }
.chips .chip.tg { border-color: #6cc4f2; }
.pc-show { display: flex; gap: 12px; flex-wrap: wrap; }

/* шкалы: рейтинг и SR */
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px 24px; }
.gauge .g-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.gauge .g-head span { text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; opacity: .8; }
.gauge .g-head strong { font-size: 1.6rem; line-height: 1; }
.gauge .g-head em { font-style: normal; opacity: .85; font-size: .9rem; }
.g-bar { position: relative; height: 14px; border-radius: 7px; background: rgba(127,127,127,.28); }
.g-fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--p); border-radius: 7px; background: #4d8fd6; animation: g-grow 1.1s cubic-bezier(.2,.8,.2,1) both; }
.gauge.sr .g-fill { background: #3fae7a; }
.g-mark { position: absolute; top: 50%; left: var(--p); width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; background: #fff; border: 4px solid #1f2933;
  animation: g-move 1.1s cubic-bezier(.2,.8,.2,1) both; }
.g-tick { position: absolute; top: 3px; bottom: 3px; width: 2px; background: rgba(255,255,255,.55); }
@keyframes g-grow { from { width: 0; } }
@keyframes g-move { from { left: 0; } }
.pcard .g-bar { background: rgba(255,255,255,.2); }
.plist .gauges { min-width: 300px; gap: 8px 18px; }
.plist .gauge .g-head strong { font-size: 1.1rem; }
.plist .g-bar { height: 10px; }
.plist .g-mark { width: 14px; height: 14px; margin: -7px 0 0 -7px; border-width: 3px; }
.plist .g-tick { background: rgba(0,0,0,.2); }
.plink { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.mini-ava { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; background: var(--tint); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; flex: none; }
.mini-ava img { width: 100%; height: 100%; object-fit: cover; }
.tabs-inline a[aria-current] { font-weight: 700; color: var(--ink); text-decoration: none; }

/* достижения */
.ach { --glowc: #9fb4c7; display: inline-flex; flex-direction: column; align-items: center; gap: 4px; width: 96px; text-align: center; font-size: .78rem; line-height: 1.15; }
.ach img { width: 72px; height: 72px; transition: transform .2s, filter .2s; }
.ach.off img { filter: grayscale(1) opacity(.35); }
.ach.off span { color: var(--muted); }
.ach:hover img { transform: scale(1.08); }
.ach-grid { display: flex; flex-wrap: wrap; gap: 14px 8px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.ach-grid.theme-td { --glowc: #5aa2e8; } .ach-grid.theme-rwr { --glowc: #ffa24d; } .ach-grid.theme-gold { --glowc: #f2c14e; } .ach-grid.theme-carbon { --glowc: #8d99a6; } .ach-grid.theme-steel { --glowc: #9fb4c7; }
.glow .ach.on img { filter: drop-shadow(0 0 7px var(--glowc)) drop-shadow(0 0 14px var(--glowc)); animation: ach-pulse 3.2s ease-in-out infinite; }
.pcard.glow .ach { --glowc: inherit; }
.pcard .ach { color: #fff; width: 88px; } .pcard .ach img { width: 66px; height: 66px; }
.pcard.glow .ach.on img { filter: drop-shadow(0 0 8px var(--glowc)) drop-shadow(0 0 16px var(--glowc)); }
@keyframes ach-pulse { 50% { filter: drop-shadow(0 0 4px var(--glowc)) drop-shadow(0 0 8px var(--glowc)); } }
@media (prefers-reduced-motion: reduce) { .glow .ach.on img, .g-fill, .g-mark { animation: none; } }
.ach-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.ach-row { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; }
.ach-row.on { border-color: #b8892b; }
.ach-pick { cursor: pointer; position: relative; }
.ach-pick input { position: absolute; top: 4px; left: 4px; }
.ach-pick:has(input:checked) .ach { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }

/* форма карточки */
.card-form { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.cf-ava { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; background: var(--tint); display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; flex: none; }
.cf-ava img { width: 100%; height: 100%; object-fit: cover; }
.cf-fields { flex: 1 1 320px; }
.inl { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; }
.themes { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.theme-opt { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 6px; color: #fff; cursor: pointer; border: 2px solid transparent; }
.theme-opt.theme-steel { background: #1f2933; } .theme-opt.theme-td { background: #1d3f66; } .theme-opt.theme-rwr { background: #7a3608; }
.theme-opt.theme-gold { background: #3f3210; } .theme-opt.theme-carbon { background: #121417; }
.theme-opt:has(input:checked) { border-color: #fff; outline: 2px solid var(--ink); }
@media (max-width: 640px) { .pcard { padding: 16px; } .pc-ava { width: 84px; height: 84px; } }

/* команды */
.tcard { --team: #2b6cde; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; background: #1f2933; color: #fff; border-radius: 8px; padding: 20px 24px; margin-bottom: 16px;
  border-left: 8px solid var(--team); background-image: repeating-linear-gradient(115deg, rgba(255,255,255,.035) 0 14px, transparent 14px 28px); }
.tc-logo { width: 104px; height: 104px; border-radius: 14px; background: rgba(255,255,255,.12); overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 800; flex: none; border: 3px solid var(--team); }
.tc-logo img { width: 100%; height: 100%; object-fit: cover; }
.tc-main { flex: 1 1 260px; min-width: 0; }
.tc-main h1 { color: #fff; margin: 0 0 4px; }
.tc-motto { margin: 0 0 6px; font-style: italic; color: rgba(255,255,255,.88); }
.tc-sub { margin: 0; color: rgba(255,255,255,.78); }
.tc-sub a { color: #fff; }
.rolebadge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .8rem; background: var(--tint); border: 1px solid var(--line); margin-right: 4px; }
.rolebadge.cap { background: #1f2933; color: #fff; border-color: #1f2933; }
.rolebadge.mgr { background: #2b5d8f; color: #fff; border-color: #2b5d8f; }
.mini-ava.team { border-radius: 8px; background: var(--team); color: #fff; font-size: .7rem; }
.post.pinned { border-left: 4px solid var(--ink); }
.tboard tr.top1 td { background: #fbf3dc; } .tboard tr.top2 td { background: #eef0f2; } .tboard tr.top3 td { background: #f6e9df; }

/* предквалификация в расписании */
.sch-item.pq { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.22) 0 6px, transparent 6px 12px); }
.pqtag { font-style: normal; font-size: .68rem; font-weight: 800; padding: 1px 5px; border-radius: 3px; border: 1px solid currentColor; }
.sch-legend .pqleg { display: inline-block; width: 22px; height: 14px; border-radius: 3px; background: #6b7885 repeating-linear-gradient(135deg, rgba(255,255,255,.35) 0 4px, transparent 4px 8px); }
.pcard .teamtag { color: #1f2933; }
.mini-ava { color: var(--ink); text-decoration: none; }

/* окна регистрации: регламент и выбор машины */
body.rf-lock { overflow: hidden; }
.rf-back { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(12, 16, 22, 0); transition: background .3s ease; }
.rf-back[hidden] { display: none; }
.rf-back.on { background: rgba(12, 16, 22, .6); }
.rf-card { position: relative; background: var(--surface); border-radius: 14px; width: 100%; max-height: min(88vh, 860px); display: flex; flex-direction: column;
  padding: 22px 24px; box-shadow: 0 18px 48px rgba(0, 0, 0, .35); opacity: 0; transform: translateY(12px) scale(.98); transition: opacity .28s ease, transform .28s ease; }
.rf-back.on .rf-card { opacity: 1; transform: none; }
.rf-small { max-width: 520px; }
.rf-wide { max-width: 940px; }
.rf-card h2 { margin: 0 34px 4px 0; }
.rf-step { margin: 0 0 4px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.rf-sub { margin: 0 0 12px; }
.rf-close { position: absolute; top: 10px; right: 14px; background: none; border: 0; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--muted); }
.rf-close:hover { color: var(--ink); }
.rf-scroll { overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #fff; max-height: 46vh; min-height: 120px; }
.rf-scroll:focus-visible { outline: 2px solid var(--ink); }
.rf-rules p { margin: 0 0 .8em; }
.rf-end { text-align: center; margin: 14px 0 0; font-size: .85rem; }
.rf-progress { height: 4px; background: var(--line); border-radius: 2px; margin: 10px 0 6px; overflow: hidden; }
.rf-progress i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .15s; }
.rf-hint { margin: 0 0 12px; font-size: .88rem; }
.rf-confirm { width: 100%; white-space: normal; line-height: 1.3; }
.rf-confirm[disabled] { opacity: .45; cursor: not-allowed; }
.rf-body { overflow-y: auto; flex: 1; margin: 0 -8px; padding: 4px 8px 10px; }
.rf-class { margin: 14px 0 8px; font-size: 1rem; }
.rf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.rf-foot { display: flex; gap: 12px 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 8px; }
.rf-pick { margin: 0; }
.rcard { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 16px; cursor: pointer; overflow: hidden;
  transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease; }
.rcard input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.rimg { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; background: #fff; padding: 8px; }
.rimg img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.rnum { font-size: 3rem; font-weight: 800; color: var(--cls, var(--ink)); opacity: .85; }
.rmeta { display: flex; gap: 10px; align-items: center; padding: 10px 14px 14px; }
.rcard:hover:not(.taken), .rcard:has(input:focus-visible) { border-color: #2b6cde; box-shadow: 0 0 0 3px #2b6cde; transform: translateY(-1px); }
.rcard:has(input:checked) { border-color: #2b6cde; box-shadow: 0 0 0 3px #2b6cde, 0 6px 18px rgba(43, 108, 222, .25); }
.rcheck { position: absolute; top: 10px; left: 10px; width: 26px; height: 26px; border-radius: 50%; background: #2b6cde; color: #fff; display: none; align-items: center; justify-content: center; font-weight: 700; }
.rcard:has(input:checked) .rcheck { display: flex; }
.rtag { position: absolute; top: 10px; right: 10px; background: var(--ink); color: #fff; padding: 1px 10px; font-size: .8rem; font-weight: 600; border-radius: 999px; }
.rtag.soft { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.rcard.taken { opacity: .5; cursor: not-allowed; }
.rcard.taken input { cursor: not-allowed; }
.rf-card .msg { margin: 0 0 10px; }
@media (max-width: 640px) { .rf-card { padding: 16px; } .rf-grid { grid-template-columns: 1fr; } .rf-scroll { max-height: 40vh; } }
@media (prefers-reduced-motion: reduce) { .rf-back, .rf-card { transition: none; } }
.rf-class .chip { color: var(--ink) !important; background: #fff; border: 2px solid var(--cls, var(--ink)); cursor: default; }

/* Худ штрафов в окне регистрации и страница модов */
.rf-hud-actions { margin: 6px 0 0; }
.rf-hud-actions .btn { flex: 1 1 200px; text-align: center; }
.mod-card { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 18px 20px; margin-bottom: 16px; }
.mod-card h2 { margin: 0 0 4px; }
.mod-card .mod-meta { margin: 0 0 10px; }
.mod-guide { margin: 8px 0 0; padding-left: 22px; }
.mod-guide li { margin: 0 0 6px; }

/* Значки игр в расписании */
.sch-item { position: relative; }
.sch-item img.gm { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 4px; }
.sch-games { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sch-games span { display: inline-flex; align-items: center; gap: 5px; }
.sch-games img { width: 20px; height: 20px; }
.sch-gameimg { width: 22px; height: 22px; vertical-align: middle; border-radius: 4px; }
@media (max-width: 640px) { .sch-item img.gm { width: 16px; height: 16px; top: 2px; right: 2px; } }

/* Подвал сайта: тёмный прямоугольник внизу */
.site-footer { background: #151a20; color: #b9c1c9; font-size: .92rem; padding: 40px 0 22px; margin-top: 24px; }
.site-footer a { color: #e4e8ec; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer h3 { color: #fff; font-size: 1rem; margin: 0 0 12px; letter-spacing: .02em; }
.sf-grid { display: grid; grid-template-columns: 1.2fr 1.2fr 1.1fr 1.1fr; gap: 32px; }
.sf-col ul { list-style: none; margin: 0; padding: 0; }
.sf-col li { margin: 0 0 10px; display: flex; flex-direction: column; gap: 1px; }
.sf-col li span { color: #7f8993; font-size: .8rem; }
.sf-brand { display: inline-flex; gap: 10px; margin-bottom: 12px; }
.sf-brand img { height: 44px; width: auto; object-fit: contain; }
.sf-name { color: #fff; font-weight: 600; margin: 0 0 8px; }
.sf-text { margin: 0 0 14px; line-height: 1.5; }
.sf-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.sf-btn { display: inline-block; background: #e4e8ec; color: #151a20 !important; padding: 9px 14px; border-radius: 4px; font-weight: 600; font-size: .9rem; }
.sf-btn:hover { background: #fff; text-decoration: none !important; }
.sf-btn.alt { background: transparent; color: #e4e8ec !important; border: 1px solid #4a5560; }
.sf-btn.alt:hover { background: #232a32; }
.sf-bottom { margin-top: 28px; padding-top: 16px; border-top: 1px solid #2a323b; display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; color: #7f8993; font-size: .82rem; }
@media (max-width: 900px) { .sf-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .sf-grid { grid-template-columns: 1fr; gap: 24px; } .site-footer { padding-top: 28px; } }

/* Юридическая страница */
.legal { max-width: 820px; }
.legal nav.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 14px 18px; margin: 0 0 24px; }
.legal nav.toc a { display: block; padding: 3px 0; }
.legal h2 { margin-top: 2em; padding-top: .4em; scroll-margin-top: 16px; }
.legal h3 { margin-top: 1.4em; font-size: 1.05rem; }
.legal p, .legal li { line-height: 1.6; }
.legal ol.cl { padding-left: 1.2em; }
.legal .op { background: var(--tint); border-radius: 6px; padding: 12px 16px; }

/* Окно принятия оферты */
body.terms-open { overflow: hidden; }
.terms-back { position: fixed; inset: 0; z-index: 100; background: rgba(8, 11, 15, .88); display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.terms-card { background: var(--surface); border-radius: 8px; max-width: 520px; width: 100%; padding: 26px 26px 22px; max-height: 96vh; overflow-y: auto; }
.terms-card h2 { margin: 8px 0 8px; }
.terms-logo { width: 56px; height: 56px; border-radius: 8px; display: block; }
.terms-docs { margin: 0 0 14px; padding-left: 20px; }
.terms-docs li { margin: 0 0 6px; }
.terms-check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; cursor: pointer; }
.terms-check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.terms-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.terms-actions .btn { flex: 1 1 160px; text-align: center; }
.terms-actions .btn:disabled { opacity: .5; cursor: not-allowed; }
.terms-declined { margin: 14px 0 0; color: var(--bad); font-size: .92rem; }

/* Страницы ошибок */
.errpage { text-align: center; padding: 40px 0 20px; }
.errcode { font-size: 4.5rem; font-weight: 700; line-height: 1; margin: 0 0 8px; color: var(--muted); letter-spacing: .04em; }
.errpage .actions { justify-content: center; margin-top: 18px; }
