/* CodeGuard Arena — стили, перенесённые из утверждённых макетов.
   Все цвета собраны в переменных ниже: меняйте их здесь, а не в шаблонах. */

:root {
  --bg: #18181D;          /* фон страницы */
  --bg-2: #1C1C21;        /* поля ввода, полосы */
  --surface: #212127;     /* карточки */
  --surface-2: #27272E;   /* карточка при наведении */
  --surface-3: #2B2B32;   /* выделенная строка */
  --line: #2F2F36;        /* тонкие разделители */
  --line-2: #33333B;      /* рамки карточек */
  --line-3: #42424A;      /* рамки кнопок */
  --line-4: #52525B;
  --text: #E6E6E8;
  --text-strong: #F5F5F6;
  --text-2: #C4C4CA;
  --text-3: #A6A6AD;
  --muted: #8A8A92;
  --faint: #55555D;
  --accent: #FF8A3D;      /* оранжевый акцент */
  --accent-soft: #FFB27A;
  --red: #F0484A;
  --insane: #F2777A;
  --ok: #8FC7A8;
  --warn: #E0A86A;
  --font: Inter, system-ui, sans-serif;
  --display: Montserrat, Inter, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  background-image: linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 56px 56px;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; padding-bottom: 96px; }
a { color: var(--text); }
a:hover { color: #fff; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--insane); }

/* --- Шапка ------------------------------------------------------------- */
.header { position: sticky; top: 0; z-index: 20; background: rgba(24,24,29,.86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.header .wrap { display: flex; align-items: center; gap: 32px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 44px; height: 28px; overflow: hidden; position: relative; display: block; flex: none; }
.brand-mark img { position: absolute; width: 140px; max-width: none; left: -48px; top: -15px; mix-blend-mode: lighten; }
.brand-name { font: 800 18px var(--display); color: #F2F2F3; }
.arena-tag { display: inline-block; padding: 4px 7px 4px 9px; border-radius: 2px; background: rgba(255,138,61,.08); border: 1px solid rgba(255,138,61,.5); color: var(--accent-soft); font: 700 11px/1 var(--mono); letter-spacing: .22em; position: relative; }
.arena-tag::after { content: attr(data-t); position: absolute; inset: 0; padding: inherit; background: #2E2E35; color: #fff; clip-path: inset(0 0 100% 0); animation: glitch 7s steps(1) infinite; }
@keyframes glitch { 0%,90%,100% { clip-path: inset(0 0 100% 0); transform: none } 91% { clip-path: inset(15% 0 55% 0); transform: translateX(-3px) } 93% { clip-path: inset(62% 0 8% 0); transform: translateX(3px) } 95% { clip-path: inset(35% 0 35% 0); transform: translateX(-1px) } }
.nav { display: flex; gap: 24px; flex: 1; }
.nav a { color: #B8B8BE; text-decoration: none; font: 500 14px var(--font); padding: 12px 4px; }
.nav a:hover, .nav a.active { color: #fff; }
.nav-right { display: flex; gap: 14px; align-items: center; }
.score-pill { font: 600 13px var(--mono); color: var(--text); text-decoration: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-3); display: inline-flex; align-items: center; justify-content: center; font: 600 12px var(--font); color: var(--text); text-decoration: none; flex: none; }
.avatar.lg { width: 104px; height: 104px; font: 800 32px var(--display); }
.avatar.md { width: 44px; height: 44px; font-size: 14px; }
.avatar.sm { width: 32px; height: 32px; font-size: 11px; }
.avatar-img { object-fit: cover; padding: 0; background: var(--surface-2); }
.avatar-link { display: inline-flex; text-decoration: none; border-radius: 50%; }
.avatar-link:hover .avatar { border-color: var(--accent); }
.avatar.me { background: #F2F2F3; color: #18181D; border-color: #F2F2F3; }
.header .menu-toggle { display: none; }
.mobile-nav { display: none; }

/* --- Кнопки и поля ----------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 20px; border-radius: 4px; font: 600 14px/1 var(--font); text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: background .2s, border-color .2s, transform .2s; background: none; color: var(--text); white-space: nowrap; }
.btn-p { background: #F2F2F3; color: #18181D; }
.btn-p:hover { background: #fff; color: #18181D; transform: translateY(-1px); }
.btn-g { border-color: var(--line-3); }
.btn-g:hover { border-color: #6B6B73; color: #fff; }
.btn-w { border-color: #4A3B28; color: var(--warn); }
.btn-d { border-color: #4A2628; color: var(--insane); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn-icon { width: 44px; padding: 0; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .field-label { font: 500 13px var(--font); color: var(--text-2); }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=url], .field input[type=number], .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 0 14px; background: var(--bg-2); border: 1px solid #3C3C44; border-radius: 4px; color: #F2F2F3; font: 400 15px var(--font); outline: none; transition: border-color .15s;
}
.field textarea { padding: 14px; min-height: 120px; resize: vertical; font: 400 14px/1.6 var(--mono); }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
::placeholder { color: #7A7A82; }
/* Поле пароля с кнопкой-«глазом» */
.pw-wrap { position: relative; display: flex; flex: 1; min-width: 0; }
.pw-wrap > input { width: 100%; padding-right: 52px !important; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 4px; background: none; color: #8A8A92; cursor: pointer; transition: color .15s, background .15s; }
.pw-toggle:hover { color: var(--accent); background: rgba(255,255,255,.04); }
.pw-toggle[aria-pressed="true"] { color: var(--accent); }
.help { font-size: 12px; color: var(--muted); line-height: 1.5; }
.errorlist { list-style: none; margin: 0; padding: 0; color: var(--insane); font-size: 13px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: #B8B8BE; line-height: 1.5; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: #E6E6E8; flex: none; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; font: 500 13px var(--font); text-decoration: none; color: #D0D0D4; border: 1px solid var(--line-3); }
.chip:hover { border-color: #6B6B73; color: #fff; }
.chip.on { background: #F2F2F3; color: #18181D; border-color: #F2F2F3; }

/* --- Типографика ------------------------------------------------------- */
.lbl { font: 500 12px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #9A9AA2; }
/* Заголовок раздела внутри карточки: крупный, с оранжевым номером */
.sec-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; font: 800 24px/1.25 var(--display); letter-spacing: -.01em; color: #F5F5F6; }
.sec-h .num { font: 700 14px var(--mono); color: var(--accent); letter-spacing: .06em; padding: 4px 8px; border: 1px solid rgba(255,138,61,.45); border-radius: 4px; background: rgba(255,138,61,.08); }
.sec-h.sec-ok .num { color: var(--ok); border-color: #35574A; background: rgba(143,199,168,.08); }
.sec-h.sec-bad .num { color: var(--insane); border-color: #4A2628; background: rgba(242,119,122,.08); }
.card > .sec-h:only-child { margin-bottom: 0; }
@media (max-width: 760px) { .sec-h { font-size: 20px; } }
.lbl::before { content: '//'; margin-right: 8px; color: var(--faint); }
.lbl.plain::before { content: none; }
.h1 { margin: 0; font: 800 44px/1.1 var(--display); letter-spacing: -.02em; color: var(--text-strong); }
.h2 { margin: 0; font: 800 36px/1.15 var(--display); letter-spacing: -.02em; color: #F2F2F3; }
.h3 { margin: 0; font: 700 20px var(--display); color: #F2F2F3; }
.big-num { font: 700 30px var(--display); color: #F2F2F3; }
.page-head { padding-top: 48px; padding-bottom: 28px; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.page-head .lbl { margin-bottom: 12px; }
.sub { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.title-row { display: flex; align-items: center; gap: 16px; }
.back-btn { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-3); border-radius: 4px; color: var(--text-2); background: rgba(255,255,255,.02); transition: border-color .2s, color .2s, transform .2s; }
.back-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateX(-2px); }
.crumbs { display: flex; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 24px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); text-decoration: none; }

/* --- Карточки ---------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; position: relative; transition: border-color .25s, transform .25s, background .25s; }
.card::before, .card::after { content: ''; position: absolute; width: 12px; height: 12px; border: 0 solid #4A4A52; pointer-events: none; transition: border-color .25s, width .25s, height .25s; }
.card::before { top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px; }
.card::after { bottom: -1px; right: -1px; border-bottom-width: 1px; border-right-width: 1px; }
a.card { text-decoration: none; display: flex; flex-direction: column; }
a.card:hover { border-color: var(--line-4); background: var(--surface-2); transform: translateY(-2px); }
a.card:hover::before, a.card:hover::after { border-color: var(--accent); width: 18px; height: 18px; }
.pad { padding: 28px; } .pad-sm { padding: 22px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.mt-16 { margin-top: 16px; } .mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; }

.grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.two { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 16px; }
.layout { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.layout > .main { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.layout > .side { flex: 1 1 280px; display: flex; flex-direction: column; gap: 20px; }

/* Карточка задания */
.task { padding: 22px; min-height: 228px; }
.task .t-title { margin-top: 18px; font: 700 18px/1.3 var(--display); color: #F2F2F3; }
.task .t-desc { margin-top: 8px; font-size: 14px; line-height: 1.55; color: var(--text-3); }
.task .t-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pips { display: inline-flex; gap: 3px; }
.pips span { width: 14px; height: 4px; border-radius: 2px; background: #3C3C44; }
.pips.l1 span:nth-child(-n+1), .pips.l2 span:nth-child(-n+2), .pips.l3 span:nth-child(-n+3) { background: #E6E6E8; }
.pips.l4 span { background: #E5484D; }
.diff { display: inline-flex; align-items: center; gap: 10px; font: 500 12px var(--font); color: #B8B8BE; }
.diff.insane { color: var(--insane); }
/* Решённое задание — зелёная подсветка */
.card.task.is-solved { border-color: #35574A; background: linear-gradient(180deg, rgba(143,199,168,.10), rgba(143,199,168,.02) 55%, transparent), var(--surface); }
.card.task.is-solved::before, .card.task.is-solved::after { border-color: var(--ok); }
.card.task.is-solved:hover { border-color: #4E7A62; }
.card.task.is-solved:hover::before, .card.task.is-solved:hover::after { border-color: var(--ok); }
.card.task.is-solved .t-foot { border-top-color: #2E4A3B; }
/* Оценка звёздами */
.stars { color: #3C3C44; letter-spacing: 2px; font-size: 16px; }
.stars .on { color: var(--accent); }
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { font-size: 26px; line-height: 1; color: #3C3C44; cursor: pointer; transition: color .15s; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: var(--accent); }
.star-input input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.solved-mark { display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--font); color: var(--ok); }

/* Категории */
.cat { gap: 22px; padding: 20px; min-height: 150px; }
.cat-tag { width: 44px; height: 44px; border: 1px solid var(--line-3); border-radius: 4px; display: flex; align-items: center; justify-content: center; font: 600 11px var(--mono); color: var(--text); letter-spacing: .06em; }

/* KPI */
.kpi .big-num { margin-top: 14px; }
.kpi .note { margin-top: 6px; font-size: 13px; color: var(--muted); }

/* Таблицы */
.table-box { overflow-x: auto; overflow-y: hidden; }
/* У прокручиваемых карточек уголки внутри, иначе они вызывают лишние полосы прокрутки */
.table-box::before { top: 0; left: 0; }
.table-box::after { bottom: 0; right: 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 14px 12px; }
.tbl td { padding: 14px; border-top: 1px solid var(--line); color: #D0D0D4; vertical-align: middle; }
.tbl .num { text-align: right; font-family: var(--mono); }
.tbl tr.me td { background: var(--surface-3); }
.badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 4px; font: 500 12px var(--font); border: 1px solid; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-published { color: var(--ok); border-color: #2E4A3B; }
.st-pending { color: var(--text-2); border-color: var(--line-4); }
.st-changes { color: var(--warn); border-color: #4A3B28; }
.st-rejected { color: var(--insane); border-color: #4A2628; }
.st-draft { color: var(--muted); border-color: #3C3C44; }

/* Полоски прогресса и графики */
.bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: #D0D0D4; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 170px; }
.chart > span { flex: 1; background: var(--line-4); border-radius: 3px 3px 0 0; min-height: 2px; }
.chart > span.last { background: #F2F2F3; }

/* Полоса «Подтвердите почту» */
.verify-bar { background: rgba(255,138,61,.08); border-bottom: 1px solid rgba(255,138,61,.35); color: var(--text-2); font-size: 14px; }
.verify-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.verify-bar b { color: var(--accent-soft); }

/* Сообщения */
.messages { list-style: none; margin: 24px auto 0; padding: 0 32px; max-width: 1280px; display: flex; flex-direction: column; gap: 8px; }
.msg { padding: 14px 18px; border-radius: 4px; border: 1px solid var(--line-3); background: var(--surface); font-size: 14px; }
.msg.success { border-color: #3C5A49; background: #18211C; color: #CFE5D8; }
.msg.error { border-color: #5A2E30; background: #241819; color: #F3C6C7; }
.note-box { padding: 20px 24px; border-radius: 6px; border: 1px solid #4A3B28; background: #221C16; }
.note-box.bad-box { border-color: #4A2628; background: #241819; }

/* --- Главная ----------------------------------------------------------- */
.hero { background: #1A1A1F; border-bottom: 1px solid var(--line); position: relative; overflow: hidden;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.02) 0 1px, transparent 1px 3px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 48px; align-items: center; padding-top: 88px; padding-bottom: 88px; }
.hero h1 { margin: 0; font: 800 64px/1.04 var(--display); letter-spacing: -.025em; color: var(--text-strong); }
.hero .lead { margin: 28px 0 0; max-width: 520px; font-size: 18px; line-height: 1.6; color: var(--text-3); }
.prompt { margin-bottom: 28px; font: 500 13px var(--mono); color: var(--muted); }
.prompt b { color: var(--accent); font-weight: 500; }
.caret { display: inline-block; width: 8px; height: 16px; background: #E6E6E8; vertical-align: -3px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0 } }
.hero-stats { display: flex; gap: 40px; margin-top: 56px; flex-wrap: wrap; }
.hero-art { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 420px; padding: 32px 0; }
.hero-art img { width: 112%; max-width: 640px; display: block; margin-bottom: -52px; mix-blend-mode: lighten; }
.hud { position: absolute; width: 22px; height: 22px; border: 0 solid #4A4A52; }
.hud.tl { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.hud.tr { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.hud.bl { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.hud.br { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }
.hud-text { position: absolute; font: 500 10px var(--mono); letter-spacing: .14em; color: var(--faint); }
.streak { position: absolute; height: 1px; background: linear-gradient(90deg, transparent, #8A8A92, transparent); opacity: .5; }
.arena-word { display: flex; align-items: center; gap: 18px; }
.arena-word .rule { width: 64px; height: 2px; background: linear-gradient(90deg, transparent, var(--accent)); }
.arena-word .rule.r { background: linear-gradient(90deg, var(--accent), transparent); }
.arena-xl { font: 800 44px/1 var(--display); letter-spacing: .55em; padding-left: .55em;
  background: linear-gradient(180deg, #FFFFFF 0%, #C9C9CF 55%, #8E8E96 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.season { margin-top: 18px; font: 500 11px var(--mono); letter-spacing: .22em; color: #878790; }
.season b { color: var(--accent); font-weight: 500; }
.section { padding-top: 112px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.section-head .lbl { margin-bottom: 14px; }

/* Терминал */
.term { background: #121216; border: 1px solid #3A3A42; border-radius: 6px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 0 16px; height: 40px; border-bottom: 1px solid var(--line); background: #1A1A1F; }
.term-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-4); }
.term-dot.r { background: var(--red); } .term-dot.o { background: var(--accent); }
.term-body { padding: 20px 22px; font: 500 14px/1.9 var(--mono); color: #C9C9CF; overflow-x: auto; white-space: pre; margin: 0; }
.term-body span.l { display: block; opacity: 0; animation: tl .2s ease forwards; }
@keyframes tl { from { opacity: 0; transform: translateX(-4px) } to { opacity: 1; transform: none } }
.t-p { color: var(--accent); } .t-ok { color: var(--accent-soft); } .t-bad { color: var(--red); } .t-dim { color: #7A7A83; }

/* --- Каталог ----------------------------------------------------------- */
.filters { flex: 1 1 240px; max-width: 260px; display: flex; flex-direction: column; gap: 28px; }
.cat-list { display: flex; flex-direction: column; gap: 2px; }
.cat-list a { display: flex; justify-content: space-between; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 4px; color: #B8B8BE; text-decoration: none; font: 500 14px var(--font); }
.cat-list a:hover { background: var(--surface-2); }
.cat-list a.on { background: var(--surface-3); color: #fff; }
.cat-list .n { font: 400 12px var(--mono); color: var(--muted); }
.search { position: relative; flex: 0 1 420px; min-width: 240px; }
.search svg { position: absolute; left: 15px; top: 15px; }
.search input { padding-left: 44px; }
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 36px; }
.empty { padding: 56px 24px; text-align: center; }

/* --- Задание ----------------------------------------------------------- */
.prose { color: var(--text-2); font-size: 16px; line-height: 1.7; }
.prose > :first-child { margin-top: 0; } .prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 16px; }
.prose a { color: var(--accent-soft); text-decoration: underline; text-decoration-color: rgba(255,138,61,.4); text-underline-offset: 3px; }
.prose a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.prose strong { color: var(--text-strong); }
.prose code { font: 500 .88em var(--mono); background: #18181C; border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 6px; color: var(--text); }
.prose pre { margin: 0 0 16px; padding: 16px 18px; background: #121216; border: 1px solid #3A3A42; border-left: 2px solid var(--accent); border-radius: 4px; overflow-x: auto; }
.prose pre code { background: none; border: 0; padding: 0; font-size: 14px; line-height: 1.7; color: #D4D4D8; white-space: pre; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose ul li::marker { color: var(--accent); }
.prose ol li::marker { color: var(--muted); font-family: var(--mono); font-size: .9em; }
.prose blockquote { margin: 0 0 16px; padding: 4px 0 4px 16px; border-left: 2px solid var(--line-4); color: var(--text-3); }
.prose h3, .prose h4 { margin: 24px 0 10px; font: 700 18px var(--display); color: #F2F2F3; }
.prose h4 { font-size: 16px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 14px; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 8px 12px; border: 1px solid var(--line-2); text-align: left; }
.prose th { background: var(--surface-2); font: 600 12px var(--mono); letter-spacing: .06em; color: var(--text-2); }
.prose figure.shot { margin: 8px 0 20px; }
.prose figure.shot img { display: block; max-width: 100%; height: auto; border: 1px solid #3A3A42; border-radius: 4px; background: #121216; }
.prose figure.shot figcaption { margin-top: 8px; font: 500 12px var(--mono); color: var(--muted); }
.shots-rest { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.shot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.shot-item { border: 1px solid var(--line-2); border-radius: 4px; padding: 8px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.shot-item img { width: 100%; height: 90px; object-fit: cover; border-radius: 2px; }
.md-toolbar { display: flex; gap: 4px; }
.md-toolbar button { min-height: 32px; padding: 0 12px; border-radius: 4px; border: 1px solid transparent; background: none; color: #B8B8BE; font: 600 13px var(--font); cursor: pointer; }
.md-toolbar button.on { background: var(--surface-3); border-color: var(--line-3); color: #fff; }
.md-preview { min-height: 220px; padding: 16px 18px; border: 1px solid #3C3C44; border-radius: 4px; background: var(--bg-2); }
.md-help { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; font-size: 13px; color: var(--muted); }
.md-help code { font: 500 12px var(--mono); color: var(--text-2); }
.file-row { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 4px; text-decoration: none; }
.file-row:hover { border-color: var(--line-4); }
details.hint { border: 1px solid var(--line-2); border-radius: 4px; }
details.hint summary { list-style: none; cursor: pointer; min-height: 52px; padding: 0 16px; display: flex; align-items: center; gap: 14px; font: 500 14px var(--font); }
details.hint summary::-webkit-details-marker { display: none; }
details.hint summary .act::after { content: 'Показать'; color: #B8B8BE; font-size: 13px; }
details.hint[open] summary .act::after { content: 'Скрыть'; }
details.hint .hint-body { padding: 0 16px 16px 48px; color: var(--text-2); font-size: 15px; line-height: 1.6; }
.flag-row { display: flex; gap: 10px; }
.flag-row input { flex: 1; min-width: 0; min-height: 52px; padding: 0 16px; background: var(--bg); border: 1px solid var(--line-3); border-radius: 4px; color: #F2F2F3; font: 500 15px var(--mono); outline: none; }
.flag-row input:focus { border-color: var(--accent); }
.flag-row .btn { min-height: 52px; min-width: 150px; }
.solved-box { border-color: #3C5A49; background: #18211C; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 12px 16px; font-size: 14px; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; font-family: var(--mono); color: var(--text); }
.list-row { display: flex; justify-content: space-between; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }

/* --- Вход / регистрация ------------------------------------------------ */
.auth { display: flex; flex-wrap: wrap; min-height: 100vh; }
.auth-brand { flex: 1 1 520px; background: #1A1A1F; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; padding: 48px; position: relative; overflow: hidden; gap: 32px; }
.auth-brand .art { display: flex; flex-direction: column; align-items: center; position: relative; }
.auth-brand .art img { width: 100%; max-width: 560px; margin-bottom: -40px; mix-blend-mode: lighten; }
.auth-brand .arena-xl { font-size: 30px; letter-spacing: .5em; padding-left: .5em; }
.auth-log { display: flex; flex-direction: column; gap: 2px; font: 500 13px/1.9 var(--mono); color: var(--muted); }
.auth-form { flex: 1 1 480px; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-form .box { width: 100%; max-width: 420px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; margin-bottom: 36px; }
.tabs a { flex: 1; min-height: 44px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font: 600 14px var(--font); color: #B8B8BE; text-decoration: none; }
.tabs a.on { background: #F2F2F3; color: #18181D; }

/* --- Рейтинг ----------------------------------------------------------- */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; }
.seg a { min-height: 40px; padding: 0 16px; border-radius: 4px; display: flex; align-items: center; font: 600 13px var(--font); color: #B8B8BE; text-decoration: none; }
.seg a.on { background: #F2F2F3; color: #18181D; }
.seg a { gap: 8px; }
.seg-n { font: 500 11px var(--mono); color: var(--muted); }
.seg a.on .seg-n { color: #55555D; }
.seg a.seg-ok { color: var(--ok); }
.seg a.seg-ok.on { background: var(--ok); color: #12211A; }
.seg a.seg-ok.on .seg-n { color: #2E4A3B; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; align-items: end; }
.podium .card { padding: 28px; gap: 18px; }
.podium .place { font: 800 40px var(--display); }

/* --- Служебные панели ------------------------------------------------- */
.staff { display: flex; flex-wrap: wrap; min-height: calc(100vh - 69px); }
.staff-nav { flex: 1 1 220px; max-width: 240px; border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; background: var(--bg-2); }
.staff-nav a { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 0 12px; border-radius: 4px; text-decoration: none; font: 500 14px var(--font); color: #B8B8BE; }
.staff-nav a:hover { background: var(--surface-2); color: #fff; }
.staff-nav a.on { background: var(--surface-3); color: #fff; }
.count { font: 600 11px var(--mono); background: #F2F2F3; color: #18181D; border-radius: 999px; padding: 2px 8px; }
.staff-main { flex: 999 1 640px; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.queue { flex: 1 1 300px; max-width: 360px; display: flex; flex-direction: column; gap: 8px; }
.queue a { display: block; padding: 16px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-2); text-decoration: none; }
.queue a.on { background: var(--surface-2); border-color: var(--line-4); }
.code-box { padding: 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; font: 400 14px/1.7 var(--mono); color: var(--text-2); white-space: pre-wrap; word-break: break-word; }

/* --- Подвал ------------------------------------------------------------ */
.footer { border-top: 1px solid var(--line); }
.footer .wrap { display: flex; gap: 40px; flex-wrap: wrap; justify-content: space-between; padding-top: 40px; padding-bottom: 40px; }

/* --- Адаптивность ------------------------------------------------------ */
@media (max-width: 1024px) {
  .grid-5 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .two, .hero .wrap { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 860px) {
  .staff-nav { max-width: none; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; }
  .staff-nav a { white-space: nowrap; }
  .staff-main { padding: 20px 16px; }
  .queue { max-width: none; }
  .auth-brand { padding: 28px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-brand .hide-sm { display: none; }
}
@media (max-width: 760px) {
  .wrap, .messages { padding: 0 16px; }
  .nav, .nav-right { display: none; }
  .header .menu-toggle { display: inline-flex; margin-left: auto; }
  .mobile-nav.open { display: flex; flex-direction: column; padding: 8px 16px 16px; border-top: 1px solid var(--line); }
  .mobile-nav a { padding: 12px 0; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
  .grid-5 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3, .grid-4, .podium { grid-template-columns: minmax(0,1fr) !important; }
  .hero h1 { font-size: 40px; }
  .hide-sm { display: none !important; }
  .filters { max-width: none; }
  .cat-list { flex-direction: row; overflow-x: auto; }
  .cat-list a { white-space: nowrap; border: 1px solid var(--line-2); }
  .cat-list .n { display: none; }
  .flag-row { flex-direction: column; }
  .h1 { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } .term-body span.l { opacity: 1; } }
