html:has(.profile-themed) {
  --bg: var(--profile-bg, #0b0b0d); --bg-deep: var(--profile-bg-deep, #08080a);
  --panel: var(--profile-panel, #171719); --panel-raised: var(--profile-panel-raised, #202023); --panel-soft: var(--profile-panel-soft, #29292d);
  --line: var(--profile-line, #343438); --line-bright: var(--profile-line-bright, #515156);
  --muted: #b9b8bf; --dim: #94939b;
}
html:has(.profile-themed) body { isolation: isolate; background: var(--bg); }
html:has(.profile-themed) .site-header { background: var(--bg); }
html:has(.profile-cover) .profile-screen-title { position: relative; z-index: 1; }
html:has(.profile-theme-live) :is(body,.site-header,.content-section,.metric-grid article,.data-table,.profile-cover-controls button) { transition: background-color 1.4s ease, border-color 1.4s ease; }
html:has(.profile-themed) .achievement-art { background: var(--bg-deep); }
html:has(.profile-themed) .weapon-card { background: var(--panel); padding-inline: 20px; }
html:has(.profile-themed) .weapon-card:nth-child(even) { background: var(--bg-deep); }
html:has(.profile-themed) .weapon-identity { min-width: 0; }
html:has(.profile-themed) .weapon-identity code { overflow-wrap: anywhere; }
html:has(.profile-themed) .achievement-copy h3 { overflow-wrap: anywhere; }
html:has(.profile-themed) .achievement-controls .segment-row { gap: 6px; }
html:has(.profile-themed) .achievement-controls .segment-row button { border: 1px solid var(--line); }
html:has(.profile-themed) .achievement-controls .segment-row button[aria-pressed=true] { border-bottom-color: var(--accent); }
html:has(.profile-themed) .data-table tbody tr:nth-child(even) { background: var(--bg-deep); }
.profile-atmosphere { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.profile-atmosphere::after { content: ''; position: absolute; inset: 0; backdrop-filter: blur(72px); mask-image: radial-gradient(ellipse var(--ambient-radius-x) var(--ambient-radius-y) at var(--ambient-center-x) var(--ambient-center-y),transparent 55%,#000 100%); }
.profile-atmosphere canvas { position: absolute; max-width: none; filter: blur(64px); mask-image: linear-gradient(to right,transparent,#000 calc(var(--ambient-spread)*.8),#000 calc(100% - var(--ambient-spread)*.8),transparent),linear-gradient(to bottom,transparent,#000 calc(var(--ambient-spread)*.8),#000 calc(100% - var(--ambient-spread)*.8),transparent); mask-composite: intersect; }
.profile-atmosphere .profile-ambient-near { filter: blur(18px); mask-image: linear-gradient(to right,transparent calc(var(--ambient-spread) - 160px),#000 calc(var(--ambient-spread) - 24px),#000 calc(100% - var(--ambient-spread) + 24px),transparent calc(100% - var(--ambient-spread) + 160px)),linear-gradient(to bottom,transparent calc(var(--ambient-spread) - 160px),#000 calc(var(--ambient-spread) - 24px),#000 calc(100% - var(--ambient-spread) + 24px),transparent calc(100% - var(--ambient-spread) + 160px)); }

.profile-cover { position: relative; isolation: isolate; overflow: visible; --cover-bleed-y: 0px; --cover-outset: clamp(12px,calc(50vw - 656px),40px); width: calc(100% + var(--cover-outset)*2); min-width: 0; margin: 0 calc(var(--cover-outset)*-1); padding: 28px var(--cover-outset); background: transparent; --muted: #c2cbd1; }
.profile-cover-art,.profile-cover-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.profile-cover-card { display: contents; }
.profile-mobile-filters { display: contents; }
.profile-mobile-filters>summary { display: none; }
.profile-cover-art { inset: calc(var(--cover-bleed-y)*-1) 0; --fade-x: 88px; --fade-y: 72px; mask-image: linear-gradient(to right,transparent,rgba(0,0,0,0.0430) calc(var(--fade-x)*0.125),rgba(0,0,0,0.1562) calc(var(--fade-x)*0.25),rgba(0,0,0,0.3164) calc(var(--fade-x)*0.375),rgba(0,0,0,0.5000) calc(var(--fade-x)*0.5),rgba(0,0,0,0.6836) calc(var(--fade-x)*0.625),rgba(0,0,0,0.8438) calc(var(--fade-x)*0.75),rgba(0,0,0,0.9570) calc(var(--fade-x)*0.875),#000 var(--fade-x),#000 calc(100% - var(--fade-x)),rgba(0,0,0,0.9570) calc(100% - var(--fade-x)*0.875),rgba(0,0,0,0.8438) calc(100% - var(--fade-x)*0.75),rgba(0,0,0,0.6836) calc(100% - var(--fade-x)*0.625),rgba(0,0,0,0.5000) calc(100% - var(--fade-x)*0.5),rgba(0,0,0,0.3164) calc(100% - var(--fade-x)*0.375),rgba(0,0,0,0.1562) calc(100% - var(--fade-x)*0.25),rgba(0,0,0,0.0430) calc(100% - var(--fade-x)*0.125),transparent),linear-gradient(to bottom,transparent,rgba(0,0,0,0.0430) calc(var(--fade-y)*0.125),rgba(0,0,0,0.1562) calc(var(--fade-y)*0.25),rgba(0,0,0,0.3164) calc(var(--fade-y)*0.375),rgba(0,0,0,0.5000) calc(var(--fade-y)*0.5),rgba(0,0,0,0.6836) calc(var(--fade-y)*0.625),rgba(0,0,0,0.8438) calc(var(--fade-y)*0.75),rgba(0,0,0,0.9570) calc(var(--fade-y)*0.875),#000 var(--fade-y),#000 calc(100% - var(--fade-y)),rgba(0,0,0,0.9570) calc(100% - var(--fade-y)*0.875),rgba(0,0,0,0.8438) calc(100% - var(--fade-y)*0.75),rgba(0,0,0,0.6836) calc(100% - var(--fade-y)*0.625),rgba(0,0,0,0.5000) calc(100% - var(--fade-y)*0.5),rgba(0,0,0,0.3164) calc(100% - var(--fade-y)*0.375),rgba(0,0,0,0.1562) calc(100% - var(--fade-y)*0.25),rgba(0,0,0,0.0430) calc(100% - var(--fade-y)*0.125),transparent); mask-composite: intersect; }
.profile-cover-art img,.profile-cover-art video { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-cover-shade { z-index: 1; background: linear-gradient(to right,rgba(5,9,13,.76),rgba(5,9,13,.54)); }
.profile-cover .player-hero { background: rgba(5,9,13,.18); }
.profile-cover .player-nav { background: transparent; }
.profile-cover .game-filter select { background: transparent; }
.profile-cover .game-filter select option { background: var(--bg-deep); color: var(--text); }
.profile-cover .game-profile-grid { gap: 0; }
.profile-cover .game-profile-grid>article { background: transparent; }
.profile-cover .game-side-panel { border-left: 1px solid var(--line-bright); }
.profile-cover .game-panel-title { background: rgba(5,9,13,.2); }
.profile-cover .gallery-cell { background: rgba(5,9,13,.2); border-color: var(--line-bright); }
.profile-cover>.content-section { padding: 24px; }
.profile-cover :is(.metric-grid article,.stat-strip,.achievement-card,.weapon-card,.target-calculator) { background: rgba(5,9,13,.35); }
.profile-cover-controls { display: flex; flex-wrap: wrap; justify-content: end; align-items: center; gap: 8px; margin: 0 0 12px; }
.profile-cover-controls button { background: var(--bg-deep); border-color: var(--line-bright); font-size: 12px; }
.profile-cover-controls [data-cover-sound] { border-color: var(--accent); color: var(--accent); }
.profile-cover-controls>span { color: var(--muted); font-size: 12px; margin-right: 4px; }
.profile-owner-actions { display: flex; justify-content: end; margin: 0 0 12px; }
.profile-background-edit { margin: 0; font-size: 13px; }
.profile-cover-controls .profile-background-edit { margin-right: auto; }
.background-overlay { z-index: 1200; padding: 24px; }
.background-dialog.auth-modal { width: min(1120px,100%); max-width: 1120px; max-height: calc(100dvh - 48px); overflow-y: auto; padding: 32px; }
.background-dialog h2 { font-size: 36px; margin: 8px 0 16px; }
.background-intro { color: var(--muted); max-width: 650px; }
.background-editor { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(250px,1fr); gap: 28px; padding: 16px 0 28px; border-bottom: 1px solid var(--line); }
.background-preview { aspect-ratio: 16 / 9; background: var(--bg-deep); overflow: hidden; border: 1px solid var(--line); }
.background-preview img,.background-preview video { display: block; width: 100%; height: 100%; object-fit: cover; }
.background-placeholder { display: flex; height: 100%; justify-content: center; flex-direction: column; padding: 28px; gap: 18px; }
.background-placeholder>span { font-family: var(--display); font-size: clamp(24px,4vw,40px); line-height: 1.1; }
.background-placeholder small { color: var(--muted); max-width: 260px; }
.background-note { color: var(--muted); font-size: 12px; margin: 10px 0; }
.background-settings { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.background-settings label,.background-crop label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.background-settings select { color: var(--text); }
.background-type { display: grid; grid-template-columns: 1fr 1fr; }
.background-type [aria-pressed=true] { color: var(--accent); border-color: var(--accent); background: var(--bg-deep); }
.background-primary { display: inline-flex; justify-content: center; align-items: center; padding: 12px 18px; min-height: 44px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 500; font-size: 14px; }
.background-primary:hover { background: var(--accent-bright); color: var(--accent-ink); }
.background-file { position: relative; padding: 14px; border: 1px solid var(--line-bright); overflow-wrap: anywhere; cursor: pointer; }
.background-file:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.background-file::after { content: 'Выбрать или заменить файл'; color: var(--accent); margin-top: 8px; }
.background-file input { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; opacity: 0; overflow: hidden; }
[data-bg-trim] { display: grid; gap: 10px; }
[data-bg-trim] button { justify-self: start; }
.background-crop,.background-trim { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.background-crop input { padding: 0; accent-color: var(--accent); }
.background-status { color: var(--accent); font-size: 13px; margin: 0; overflow-wrap: anywhere; }
.background-settings progress { width: 100%; height: 4px; accent-color: var(--accent); }
.background-gallery-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 24px 0 16px; }
.background-gallery-heading h3 { margin: 0; }
.background-gallery-heading small { color: var(--muted); font-size: 14px; margin-left: 8px; }
.background-gallery { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.background-gallery>.background-note { grid-column: 1 / -1; }
.background-item { border: 1px solid var(--line); min-width: 0; }
.background-item.is-selected { border-color: var(--accent); }
.background-thumbnail { display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; position: relative; border: 0; overflow: hidden; }
.background-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.background-thumbnail>span { position: absolute; right: 6px; bottom: 6px; font-size: 11px; padding: 3px 6px; background: var(--bg-deep); }
.background-item-caption { display: flex; justify-content: space-between; align-items: center; padding: 4px 12px; gap: 8px; font-size: 12px; }
.background-item-caption button { border: 0; padding: 8px 0; color: var(--muted); font-size: 12px; }
.background-account-entry { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.background-account-entry p { margin: 0; max-width: 600px; color: var(--muted); }
.background-account-entry button { flex: 0 0 auto; }
.profile-background-edit,.background-promo-action { background: var(--panel); background: color-mix(in srgb,var(--panel) 72%,transparent); color: var(--text); border: 1px solid var(--line-bright); }
.profile-background-edit:hover,.background-promo-action:hover { background: var(--panel-raised); color: var(--text); border-color: var(--muted); }
.background-promo { position: fixed; right: 20px; bottom: 20px; z-index: 150; width: min(310px,calc(100% - 24px)); background: var(--panel); background: color-mix(in srgb,var(--panel) 95%,transparent); color: var(--text); border: 1px solid var(--line-bright); padding: 16px; transition: background-color 1.4s ease,border-color 1.4s ease; }
.background-promo h2 { font-size: 22px; padding-right: 24px; margin: 0 0 8px; line-height: 1.15; }
.background-promo p { font-size: 12px; line-height: 1.5; color: var(--muted); margin: 0 0 12px; }
.background-promo-close { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; min-height: 32px; border: 0; background: transparent; color: var(--muted); font-size: 20px; padding: 0; }
.background-promo-links { display: flex; }
.background-promo-action { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 14px; font-size: 12px; text-decoration: none; }
.site-telegram-watermark { position: fixed; left: max(12px,env(safe-area-inset-left)); bottom: max(8px,env(safe-area-inset-bottom)); z-index: 40; color: var(--muted,#b9b8bf); opacity: .3; font: 11px/1.4 sans-serif; letter-spacing: .02em; pointer-events: none; user-select: none; }
body:has(.auth-overlay,.training-fullscreen) :is(.background-promo,.site-telegram-watermark) { display: none; }
@media(max-width:900px) {
  .profile-cover-art { --fade-x: 48px; --fade-y: 56px; }
  .profile-cover { --cover-bleed-y: 0px; width: calc(100% + 16px); margin-inline: -8px; padding: 24px 8px; }
  .profile-cover .game-side-panel { border-left: 0; border-top: 1px solid var(--line-bright); }
}
@media(max-width:700px) {
  .profile-atmosphere canvas { filter: blur(40px); }
  .profile-atmosphere .profile-ambient-near { filter: blur(14px); }
  .profile-cover-art { --fade-x: 48px; --fade-y: 56px; }
  .profile-cover { --cover-bleed-y: 0px; width: calc(100% + 16px); margin-inline: -8px; padding: 24px 8px; }
  .profile-screen-title { flex-wrap: wrap; }
  .profile-screen-title>span { white-space: normal; max-width: 100%; }
  .profile-cover .game-side-panel { border-left: 0; border-top: 1px solid var(--line-bright); }
  .profile-cover>.content-section { padding: 16px; }
  .profile-cover-controls { gap: 8px; justify-content: end; }
  .profile-cover-controls>span { flex-basis: 100%; text-align: right; }
  .profile-cover-controls button { min-height: 40px; padding: 8px 12px; }
  .background-overlay { padding: 8px; }
  .background-dialog.auth-modal { padding: 24px 16px; max-height: calc(100dvh - 16px); }
  .background-editor { grid-template-columns: 1fr; gap: 20px; }
  .background-gallery { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .background-item-caption { flex-wrap: wrap; padding: 6px 10px; }
  .background-gallery-heading { align-items: start; }
  .background-gallery-heading h3 { font-size: 23px; }
  .background-account-entry { flex-direction: column; align-items: start; }
  .background-promo { right: 12px; bottom: max(24px,env(safe-area-inset-bottom)); padding: 14px; }
}
@media(max-width:700px) {
  .profile-cover { width: 100%; margin: 0; padding: 0; }
  .profile-cover-card { display: block; position: relative; isolation: isolate; overflow: hidden; }
  .profile-cover-card .profile-cover-art { inset: 0; --fade-x: 28px; --fade-y: 40px; }
  .profile-cover-card .player-hero { grid-template-columns: 1fr; min-height: 0; margin: 0; background: rgba(5,9,13,.12); }
  .profile-cover-card .profile-identity { padding: 10px 12px; }
  .profile-cover-card .userbar { height: 104px; }
  .profile-cover-card .nickname-history { margin-top: 6px; font-size: 11px; }
  .profile-cover-card .game-panel-title { padding-block: 10px; }
  .profile-cover-card .game-main-metrics { padding: 12px 16px 8px; }
  .profile-cover-card .game-main-metrics strong { font-size: clamp(34px,9vw,42px); margin-top: 4px; }
  .profile-cover-card .game-secondary-metrics>div { padding-block: 4px; }
  .profile-cover-card .game-ranked-block { padding-block: 10px; }
  .profile-cover-card .hero-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .profile-cover-card .hero-facts>div:last-child { display: none; }
  .profile-cover-card .profile-cover-shade { background: linear-gradient(to bottom,rgba(5,9,13,.35),rgba(5,9,13,.72)); }
  .player-nav { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); overflow: visible; margin-top: 0; padding-inline: 8px; background: transparent; }
  .player-nav a { grid-column: span 2; justify-content: center; min-width: 0; padding: 10px 4px; font-size: 12px; }
  .player-nav a:nth-last-child(-n+2) { grid-column: span 3; }
  .profile-cover .game-profile-section { padding-top: 0; }
  .profile-cover .game-profile-toolbar { margin: 0; padding: 16px; background: transparent; }
  .profile-cover .game-profile-grid { gap: 24px; }
  .profile-cover .game-profile-grid>article { background: transparent; }
  .profile-mobile-facts { margin-top: 16px; background: var(--panel); }
  .profile-mobile-facts .hero-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .profile-mobile-facts .hero-facts>div:last-child { display: none; }
  .profile-cover>.game-side-panel { margin-top: 24px; background: var(--panel); }
  .profile-cover .game-side-panel { border: 0; }
  .profile-cover .game-filter select { background: var(--bg-deep); }
  .profile-cover .gallery-cell { background: var(--bg-deep); }
  .profile-gallery { grid-template-columns: 1fr; gap: 12px; padding: 16px; align-items: stretch; }
  .profile-gallery-icons { grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: auto; height: auto; gap: 12px; }
  .profile-gallery-stripes { grid-template-columns: 1fr; grid-template-rows: auto; gap: 12px; }
  .profile-gallery .gallery-cell { height: auto; aspect-ratio: 1; padding: 12px; }
  .profile-gallery-stripes .gallery-cell { aspect-ratio: 4; padding: 4px; }
  .profile-gallery .gallery-cell img { min-width: 0; min-height: 0; }
  .profile-gallery .gallery-cell.is-empty::after { content: "Не выбрано"; color: var(--dim); font-size: 11px; }
  .profile-cover .achievement-totals>div { padding: 18px 12px; }
  html:has(.profile-cover) .profile-screen-title { margin-bottom: 12px; gap: 12px; }
  html:has(.profile-cover) .profile-screen-title .eyebrow { display: none; }
  html:has(.profile-cover) .profile-screen-title h1 { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .profile-mobile-filters { display: block; margin: 12px 0; border: 1px solid var(--line); background: var(--panel); }
  .profile-mobile-filters>summary { display: list-item; padding: 12px; min-height: 44px; font-size: 13px; color: var(--text); cursor: pointer; }
  .profile-mobile-filters[open]>summary { border-bottom: 1px solid var(--line); }
  .profile-cover .game-filter select { font-size: 16px; min-height: 44px; }
  .profile-cover-controls>span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .profile-cover-controls { margin-bottom: 10px; }
  .profile-cover-controls button { min-height: 44px; }
  .profile-mobile-facts .hero-facts>div { padding: 14px 16px; }
  .profile-mobile-facts .hero-facts dd { font-size: 24px; }

}
@media(prefers-reduced-motion:reduce) { .background-promo *, .profile-cover * { transition: none; } }
