/* Тёмная тема в духе клиента Dota 2: графит, красное свечение, золото в заголовках. */
:root {
  --radius: 4px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --head-font: "Trajan Pro", "Cinzel", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --body-font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Смысловые цвета, одинаковые во всех темах */
  --danger: #e2522f;
  --green: #6fae3d;
  --blue: #5d8fb8;
  /* Производные от палитры темы */
  --accent: rgb(var(--accent-rgb));
  --accent-hot: rgb(var(--hot-rgb));
  --gold: rgb(var(--gold-rgb));
}

/* =====================================================================
   Темы. Классика (по умолчанию) — графит, красный, золото.
   Остальные — по выпускам: палитра взята с эмали Эгиды своего года и темы
   The International. --fx-mode — режим частиц (effects.js), --hero-img —
   Эгида в шапке главной, --motif — фоновый узор.
   ===================================================================== */
:root, [data-theme="dire"] {
  --bg: #0b0d11; --bg-rgb: 11, 13, 17; --bg-top: #0e1116;
  --panel: #161a21; --panel-rgb: 22, 26, 33; --panel-2: #1d222b; --panel-2-rgb: 29, 34, 43;
  --header-rgb: 20, 23, 30; --input-bg: #0d1015; --media-bg: #0a0b0e; --footer-bg: #090a0d;
  --text: #d8d3c8; --lead: #bdb6a8; --muted: #868c97; --heading: #efe6d2; --price: #f3e3bd;
  --gold-rgb: 212, 178, 106; --gold-dim: #8f7440; --link-hover: #f0d18a;
  --accent-rgb: 194, 59, 34; --hot-rgb: 226, 82, 47;
  --btn-top: #d9472a; --btn-bottom: #a52c17; --btn-edge-light: #e8633f; --btn-edge-dark: #8a2210;
  --btn-text: #fff; --btn-text-shadow: 0 1px 1px rgba(0, 0, 0, .5);
  --shine: #ffd98a; --shine-hot: #fff6dc;
  --glare-rgb: 255, 228, 170; --glow-rgb: 255, 190, 110; --spot-rgb: 255, 210, 140;
  --ember-1: 255, 120, 60; --ember-2: 255, 175, 80; --ember-3: 255, 222, 150;
  --fx-mode: rise;
  --hero-img: url("/static/img/years/2020.webp");
  --motif: none;
}

/* 2015 · TI5 · Античная латунь */
[data-theme="y2015"] {
  --bg: #100c08; --bg-rgb: 16, 12, 8; --bg-top: #16100a;
  --panel: #1c150e; --panel-rgb: 28, 21, 14; --panel-2: #251b12; --panel-2-rgb: 37, 27, 18;
  --header-rgb: 26, 19, 12; --input-bg: #120d08; --media-bg: #0c0906; --footer-bg: #0a0705;
  --text: #e2d6c3; --lead: #c4b398; --muted: #93856f; --heading: #f5e3bf; --price: #f7dfa6;
  --gold-rgb: 222, 178, 96; --gold-dim: #8d6a2e; --link-hover: #ffd98a;
  --accent-rgb: 168, 104, 40; --hot-rgb: 232, 160, 72;
  --btn-top: #c98a3e; --btn-bottom: #8a5520; --btn-edge-light: #e6aa5c; --btn-edge-dark: #5f3a14;
  --btn-text: #fff; --btn-text-shadow: 0 1px 1px rgba(0, 0, 0, .5);
  --shine: #ffe2a0; --shine-hot: #fff4d8;
  --glare-rgb: 255, 230, 180; --glow-rgb: 255, 190, 110; --spot-rgb: 255, 200, 130;
  --ember-1: 255, 170, 70; --ember-2: 255, 200, 110; --ember-3: 255, 230, 170;
  --fx-mode: rise;
  --hero-img: url("/static/img/years/2015.webp");
  --motif: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(232, 160, 72, .10), transparent 70%);
}

/* 2016 · TI6 · Рубин и сталь */
[data-theme="y2016"] {
  --bg: #0e0b0d; --bg-rgb: 14, 11, 13; --bg-top: #150d10;
  --panel: #1b1518; --panel-rgb: 27, 21, 24; --panel-2: #241b1f; --panel-2-rgb: 36, 27, 31;
  --header-rgb: 24, 18, 21; --input-bg: #110c0e; --media-bg: #0b0809; --footer-bg: #090607;
  --text: #ddd6d8; --lead: #bfb2b6; --muted: #8e8489; --heading: #f0e9ea; --price: #f3dfe2;
  --gold-rgb: 200, 200, 208; --gold-dim: #77777f; --link-hover: #ffffff;
  --accent-rgb: 150, 20, 36; --hot-rgb: 214, 40, 60;
  --btn-top: #c4243a; --btn-bottom: #7d0f1e; --btn-edge-light: #e2505f; --btn-edge-dark: #5a0a15;
  --btn-text: #fff; --btn-text-shadow: 0 1px 1px rgba(0, 0, 0, .5);
  --shine: #ffd0d6; --shine-hot: #ffffff;
  --glare-rgb: 255, 220, 225; --glow-rgb: 255, 120, 140; --spot-rgb: 255, 140, 160;
  --ember-1: 230, 40, 60; --ember-2: 255, 110, 120; --ember-3: 240, 230, 235;
  --fx-mode: rise;
  --hero-img: url("/static/img/years/2016.webp");
  --motif: none;
}

/* 2017 · TI7 · Аква и золото */
[data-theme="y2017"] {
  --bg: #061015; --bg-rgb: 6, 16, 21; --bg-top: #08161d;
  --panel: #0e1c24; --panel-rgb: 14, 28, 36; --panel-2: #13252f; --panel-2-rgb: 19, 37, 47;
  --header-rgb: 12, 24, 31; --input-bg: #08131a; --media-bg: #050d12; --footer-bg: #040a0e;
  --text: #d3e1e6; --lead: #a9c0c8; --muted: #7a919a; --heading: #f2e6c4; --price: #f5e1a8;
  --gold-rgb: 214, 178, 92; --gold-dim: #8a6f33; --link-hover: #ffdc8a;
  --accent-rgb: 26, 128, 170; --hot-rgb: 64, 190, 230;
  --btn-top: #2a9bc9; --btn-bottom: #146489; --btn-edge-light: #5cc2e8; --btn-edge-dark: #0e4a66;
  --btn-text: #fff; --btn-text-shadow: 0 1px 1px rgba(0, 0, 0, .45);
  --shine: #bff0ff; --shine-hot: #ffffff;
  --glare-rgb: 200, 240, 255; --glow-rgb: 120, 220, 255; --spot-rgb: 120, 210, 240;
  --ember-1: 80, 200, 240; --ember-2: 150, 230, 255; --ember-3: 240, 215, 140;
  --fx-mode: rise;
  --hero-img: url("/static/img/years/2017.webp");
  --motif: radial-gradient(ellipse 70% 45% at 85% 10%, rgba(64, 190, 230, .10), transparent 70%);
}

/* 2018 · TI8 · Изумруд Ванкувера */
[data-theme="y2018"] {
  --bg: #06110f; --bg-rgb: 6, 17, 15; --bg-top: #081a16;
  --panel: #0d201c; --panel-rgb: 13, 32, 28; --panel-2: #122a25; --panel-2-rgb: 18, 42, 37;
  --header-rgb: 11, 27, 23; --input-bg: #081511; --media-bg: #050e0c; --footer-bg: #040b09;
  --text: #d2e3de; --lead: #a7c2ba; --muted: #789189; --heading: #eef0e0; --price: #e9e6c0;
  --gold-rgb: 200, 196, 170; --gold-dim: #7d7a62; --link-hover: #f2efd0;
  --accent-rgb: 16, 128, 104; --hot-rgb: 40, 200, 160;
  --btn-top: #1fa784; --btn-bottom: #0d6a53; --btn-edge-light: #4dd0ad; --btn-edge-dark: #08503e;
  --btn-text: #fff; --btn-text-shadow: 0 1px 1px rgba(0, 0, 0, .45);
  --shine: #c8ffe9; --shine-hot: #ffffff;
  --glare-rgb: 210, 255, 240; --glow-rgb: 110, 240, 200; --spot-rgb: 120, 240, 200;
  --ember-1: 60, 220, 170; --ember-2: 160, 240, 210; --ember-3: 230, 240, 200;
  --fx-mode: rise;
  --hero-img: url("/static/img/years/2018.webp");
  --motif: radial-gradient(ellipse 90% 40% at 50% 100%, rgba(40, 200, 160, .08), transparent 70%);
}

/* 2019 · TI9 · Королевский пурпур */
[data-theme="y2019"] {
  --bg: #0d0a14; --bg-rgb: 13, 10, 20; --bg-top: #130e1e;
  --panel: #191226; --panel-rgb: 25, 18, 38; --panel-2: #21182f; --panel-2-rgb: 33, 24, 47;
  --header-rgb: 23, 17, 34; --input-bg: #100c18; --media-bg: #0a0710; --footer-bg: #08060d;
  --text: #ddd5e8; --lead: #bcb0cf; --muted: #8b82a1; --heading: #f6e2c6; --price: #f5d9a8;
  --gold-rgb: 214, 140, 80; --gold-dim: #8a5a30; --link-hover: #ffc28a;
  --accent-rgb: 96, 64, 190; --hot-rgb: 150, 120, 255;
  --btn-top: #7c5ce0; --btn-bottom: #4a2fa0; --btn-edge-light: #a189f5; --btn-edge-dark: #36207a;
  --btn-text: #fff; --btn-text-shadow: 0 1px 1px rgba(0, 0, 0, .45);
  --shine: #ffd9b0; --shine-hot: #fff3e6;
  --glare-rgb: 235, 220, 255; --glow-rgb: 190, 160, 255; --spot-rgb: 170, 140, 255;
  --ember-1: 160, 130, 255; --ember-2: 220, 170, 255; --ember-3: 255, 190, 130;
  --fx-mode: glitter;
  --hero-img: url("/static/img/years/2019.webp");
  --motif: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(150, 120, 255, .12), transparent 70%);
}

/* 2020 · Battle Pass 2020 · Трофей чемпионов */
[data-theme="y2020"] {
  --bg: #0e0c0a; --bg-rgb: 14, 12, 10; --bg-top: #15110d;
  --panel: #1b1713; --panel-rgb: 27, 23, 19; --panel-2: #241f19; --panel-2-rgb: 36, 31, 25;
  --header-rgb: 25, 21, 17; --input-bg: #110e0b; --media-bg: #0b0907; --footer-bg: #090705;
  --text: #e0d9cf; --lead: #c2b8a8; --muted: #8f8678; --heading: #f2e8d6; --price: #f3e0b6;
  --gold-rgb: 214, 178, 106; --gold-dim: #8f7440; --link-hover: #f0d18a;
  --accent-rgb: 120, 92, 64; --hot-rgb: 200, 160, 100;
  --btn-top: #b8925a; --btn-bottom: #7a5a32; --btn-edge-light: #d6b47c; --btn-edge-dark: #553e22;
  --btn-text: #fff; --btn-text-shadow: 0 1px 1px rgba(0, 0, 0, .5);
  --shine: #ffe7b0; --shine-hot: #fff8e8;
  --glare-rgb: 255, 240, 210; --glow-rgb: 230, 200, 150; --spot-rgb: 230, 200, 150;
  --ember-1: 230, 200, 140; --ember-2: 255, 230, 180; --ember-3: 210, 210, 220;
  --fx-mode: rise;
  --hero-img: url("/static/img/years/2020.webp");
  --motif: none;
}

/* 2022 · TI11 · Лава Сингапура */
[data-theme="y2022"] {
  --bg: #0c0807; --bg-rgb: 12, 8, 7; --bg-top: #140a08;
  --panel: #1a1210; --panel-rgb: 26, 18, 16; --panel-2: #231815; --panel-2-rgb: 35, 24, 21;
  --header-rgb: 24, 15, 13; --input-bg: #100a09; --media-bg: #0a0605; --footer-bg: #080504;
  --text: #e3d6d2; --lead: #c6b1aa; --muted: #94817b; --heading: #f5e6e0; --price: #ffd2bf;
  --gold-rgb: 200, 196, 196; --gold-dim: #7c7474; --link-hover: #ffffff;
  --accent-rgb: 200, 40, 20; --hot-rgb: 255, 90, 30;
  --btn-top: #e8401e; --btn-bottom: #9c1c0c; --btn-edge-light: #ff7448; --btn-edge-dark: #6e1208;
  --btn-text: #fff; --btn-text-shadow: 0 1px 1px rgba(0, 0, 0, .5);
  --shine: #ffc49a; --shine-hot: #fff0e0;
  --glare-rgb: 255, 210, 180; --glow-rgb: 255, 120, 60; --spot-rgb: 255, 110, 50;
  --ember-1: 255, 80, 20; --ember-2: 255, 150, 40; --ember-3: 255, 220, 120;
  --fx-mode: lava;
  --hero-img: url("/static/img/years/2022.webp");
  --motif: radial-gradient(ellipse 120% 45% at 50% 115%, rgba(255, 70, 20, .22), transparent 65%);
}

/* 2023 · TI12 · Витраж Сиэтла */
[data-theme="y2023"] {
  --bg: #060b14; --bg-rgb: 6, 11, 20; --bg-top: #08111f;
  --panel: #0e1828; --panel-rgb: 14, 24, 40; --panel-2: #132033; --panel-2-rgb: 19, 32, 51;
  --header-rgb: 12, 21, 35; --input-bg: #08101c; --media-bg: #050a12; --footer-bg: #04080e;
  --text: #d4dfec; --lead: #a9bbd0; --muted: #7b8ca2; --heading: #eaf2fb; --price: #dff0ff;
  --gold-rgb: 190, 200, 214; --gold-dim: #6e7888; --link-hover: #ffffff;
  --accent-rgb: 20, 120, 200; --hot-rgb: 40, 180, 255;
  --btn-top: #2a9de8; --btn-bottom: #145fa0; --btn-edge-light: #62c0ff; --btn-edge-dark: #0f477a;
  --btn-text: #fff; --btn-text-shadow: 0 1px 1px rgba(0, 0, 0, .45);
  --shine: #bfeaff; --shine-hot: #ffffff;
  --glare-rgb: 200, 235, 255; --glow-rgb: 90, 200, 255; --spot-rgb: 80, 180, 255;
  --ember-1: 40, 170, 255; --ember-2: 120, 210, 255; --ember-3: 200, 240, 255;
  --fx-mode: shards;
  --hero-img: url("/static/img/years/2023.webp");
  /* свинцовая решётка витража */
  --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cg fill='none' stroke='%2328b4ff' stroke-opacity='.09' stroke-width='2'%3E%3Cpath d='M0 40 L70 0 L130 55 L220 20 M0 140 L60 95 L130 55 L170 130 L220 110 M60 95 L40 220 M130 55 L170 130 L120 220 M170 130 L220 200 M70 0 L60 95'/%3E%3C/g%3E%3C/svg%3E");
}

/* 2024 · TI13 · Карнавал Копенгагена */
[data-theme="y2024"] {
  --bg: #07100a; --bg-rgb: 7, 16, 10; --bg-top: #0a170e;
  --panel: #101e14; --panel-rgb: 16, 30, 20; --panel-2: #16271b; --panel-2-rgb: 22, 39, 27;
  --header-rgb: 13, 26, 17; --input-bg: #09130c; --media-bg: #060d08; --footer-bg: #050a06;
  --text: #dbe3d6; --lead: #b6c4ad; --muted: #85947d; --heading: #f6e6c2; --price: #f6dda2;
  --gold-rgb: 222, 184, 96; --gold-dim: #8e7032; --link-hover: #ffd98a;
  --accent-rgb: 30, 140, 50; --hot-rgb: 80, 200, 90;
  --btn-top: #a32438; --btn-bottom: #661425; --btn-edge-light: #c94a5c; --btn-edge-dark: #4a0d1a;
  --btn-text: #fff; --btn-text-shadow: 0 1px 1px rgba(0, 0, 0, .5);
  --shine: #ffe7a0; --shine-hot: #fff8e0;
  --glare-rgb: 255, 240, 200; --glow-rgb: 255, 210, 120; --spot-rgb: 140, 230, 140;
  --ember-1: 70, 200, 90; --ember-2: 230, 190, 90; --ember-3: 190, 40, 70;
  --fx-mode: confetti;
  --hero-img: url("/static/img/years/2024.webp");
  --motif: radial-gradient(ellipse 60% 40% at 15% 0%, rgba(80, 200, 90, .10), transparent 70%),
           radial-gradient(ellipse 60% 40% at 85% 0%, rgba(190, 40, 70, .10), transparent 70%);
}

/* 2025 · TI14 · Космос Гамбурга */
[data-theme="y2025"] {
  --bg: #08060f; --bg-rgb: 8, 6, 15; --bg-top: #0d0918;
  --panel: #140f22; --panel-rgb: 20, 15, 34; --panel-2: #1b142c; --panel-2-rgb: 27, 20, 44;
  --header-rgb: 18, 13, 30; --input-bg: #0c0915; --media-bg: #07050d; --footer-bg: #05040a;
  --text: #dcd6ea; --lead: #b5aecb; --muted: #8580a0; --heading: #ece8f8; --price: #e6dcff;
  --gold-rgb: 196, 196, 214; --gold-dim: #6f6f88; --link-hover: #ffffff;
  --accent-rgb: 120, 40, 200; --hot-rgb: 190, 90, 255;
  --btn-top: #9a3fe6; --btn-bottom: #5a1ea6; --btn-edge-light: #c07cff; --btn-edge-dark: #42157c;
  --btn-text: #fff; --btn-text-shadow: 0 1px 1px rgba(0, 0, 0, .45);
  --shine: #e6d0ff; --shine-hot: #ffffff;
  --glare-rgb: 235, 220, 255; --glow-rgb: 200, 140, 255; --spot-rgb: 180, 120, 255;
  --ember-1: 255, 255, 255; --ember-2: 210, 180, 255; --ember-3: 160, 200, 255;
  --fx-mode: stars;
  --hero-img: url("/static/img/years/2025.webp");
  /* туманности */
  --motif: radial-gradient(ellipse 50% 35% at 18% 25%, rgba(150, 60, 255, .16), transparent 70%),
           radial-gradient(ellipse 45% 35% at 82% 65%, rgba(60, 110, 255, .13), transparent 70%),
           radial-gradient(ellipse 35% 25% at 55% 95%, rgba(255, 80, 200, .08), transparent 70%);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: 15px/1.55 var(--body-font);
  color: var(--text);
  background:
    radial-gradient(1200px 520px at 50% -140px, rgba(var(--accent-rgb), 0.28), transparent 70%),
    radial-gradient(900px 600px at 100% 20%, rgba(var(--gold-rgb), 0.05), transparent 60%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 40%);
  background-attachment: fixed;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--link-hover); }
img { max-width: 100%; display: block; }
code { background: rgba(255,255,255,.07); padding: 1px 5px; border-radius: 3px; font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.main { flex: 1; padding-top: 28px; padding-bottom: 60px; }

h1, h2, h3 { font-family: var(--head-font); font-weight: 600; color: var(--heading); letter-spacing: .04em; line-height: 1.2; }
h1 { font-size: clamp(26px, 4vw, 40px); margin: 0 0 12px; text-transform: uppercase; }
.page-title { font-size: clamp(22px, 3vw, 30px); margin-bottom: 20px; }
.eyebrow { margin: 0 0 6px; font-size: 12px; letter-spacing: .25em; text-transform: uppercase; color: var(--accent-hot); font-weight: 600; }
.lead { font-size: 17px; color: var(--lead); max-width: 620px; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, rgba(var(--header-rgb), .97), rgba(var(--bg-rgb), .95));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(var(--accent-rgb), .35), 0 8px 24px rgba(0,0,0,.4);
  backdrop-filter: blur(6px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--heading); }
.logo img { filter: drop-shadow(0 0 8px rgba(var(--hot-rgb), .45)); }
.logo-text { font-family: var(--head-font); font-size: 20px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.logo-text span { color: var(--gold); margin-left: 4px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; color: var(--text); font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
  border-radius: var(--radius); transition: background .15s, color .15s;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,.05); }
.link-btn { background: none; border: 0; font: inherit; cursor: pointer; }
.cart-count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; letter-spacing: 0;
  background: var(--accent); color: #fff; box-shadow: 0 0 10px rgba(var(--hot-rgb), .55);
}
.cart-count.is-empty { background: var(--panel-2); box-shadow: none; color: var(--muted); }

/* ---------- Подвал ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--footer-bg); font-size: 13px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 20px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--radius); border: 1px solid transparent;
  font: 600 13px/1.2 var(--body-font); letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer; transition: filter .15s, background .15s, border-color .15s, color .15s; white-space: nowrap;
}
.btn-primary {
  color: var(--btn-text);
  background: linear-gradient(180deg, var(--btn-top) 0%, var(--btn-bottom) 100%);
  border-color: var(--btn-edge-light) var(--btn-edge-dark) var(--btn-edge-dark);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 0 16px rgba(var(--accent-rgb), .35);
  text-shadow: var(--btn-text-shadow);
}
.btn-primary:hover { filter: brightness(1.15); color: var(--btn-text); }
.btn-ghost { color: var(--text); background: rgba(255,255,255,.03); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--gold-dim); color: var(--gold); }
.btn-danger { color: #f09a86; background: transparent; border-color: rgba(194, 59, 34, .5); }
.btn-danger:hover { background: rgba(194, 59, 34, .15); color: #fff; }
.btn-disabled { color: #6b707a; background: var(--panel); border-color: var(--line); cursor: default; }
.btn-lg { padding: 13px 26px; font-size: 14px; }
.btn-sm { padding: 6px 10px; font-size: 11px; }
.btn-block { width: 100%; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Сообщения ---------- */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; }
.flash-ok { background: rgba(111, 174, 61, .1); border-color: rgba(111, 174, 61, .4); color: #b8dd99; }
.flash-error { background: rgba(194, 59, 34, .12); border-color: rgba(194, 59, 34, .5); color: #f2a593; }
.flash-warn { background: rgba(var(--gold-rgb), .08); border-color: rgba(var(--gold-rgb), .35); color: #e3cd98; }

/* ---------- Главная ---------- */
.hero {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px;
  padding: 28px 32px; margin-bottom: 24px;
  background: linear-gradient(110deg, rgba(var(--panel-2-rgb), .9), rgba(var(--panel-rgb), .6));
  border: 1px solid var(--line); border-radius: var(--radius);
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--gold), var(--accent), transparent);
  opacity: .7;
}

/* ---------- Фильтры ---------- */
.filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 24px;
  padding: 16px 20px; margin-bottom: 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.filters .field { margin-bottom: 0; }
.field > span, .field-label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.field em { text-transform: none; letter-spacing: 0; font-style: normal; font-weight: 400; }

input[type=text], input[type=number], input[type=password], select, textarea {
  width: 100%; padding: 10px 12px; font: 15px/1.4 var(--body-font); color: var(--text);
  background: var(--input-bg); border: 1px solid var(--line-strong); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
select { min-width: 150px; cursor: pointer; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold-dim); box-shadow: 0 0 0 3px rgba(var(--gold-rgb), .15);
}
.has-error input, .has-error textarea, .has-error select { border-color: var(--danger); }
.field-error { color: #f2876d; font-size: 13px; }

.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; flex-wrap: wrap; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: block; padding: 9px 14px; font-size: 13px; color: var(--muted); background: var(--input-bg);
  border-right: 1px solid var(--line); transition: background .15s, color .15s;
}
.segmented label:last-child span { border-right: 0; }
.segmented input:checked + span { color: #fff; background: linear-gradient(180deg, rgba(var(--accent-rgb), .38), rgba(var(--accent-rgb), .16)); box-shadow: inset 0 -2px 0 var(--accent-hot); }
.segmented input:focus-visible + span { outline: 2px solid var(--gold-dim); outline-offset: -2px; }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 9px 0; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.reset-link { padding: 9px 0; font-size: 13px; }
.results-count { margin: 0 0 12px; font-size: 13px; }

/* ---------- Карточки ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: border-color .25s, box-shadow .25s;
}
.card:hover { border-color: rgba(var(--gold-rgb), .35); box-shadow: var(--shadow), 0 0 22px rgba(var(--accent-rgb), .18); }
.card-media { position: relative; aspect-ratio: 1 / 1; background: var(--media-bg); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.year-badge {
  position: absolute; top: 10px; left: 10px; padding: 3px 10px;
  font: 700 14px var(--head-font); letter-spacing: .08em; color: var(--gold);
  background: rgba(8, 9, 12, .82); border: 1px solid rgba(var(--gold-rgb), .4); border-radius: 2px;
}
.sold-stamp {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-12deg);
  padding: 6px 18px; font: 700 20px var(--head-font); letter-spacing: .2em; text-transform: uppercase;
  color: #f0866b; border: 3px solid #c23b22; background: rgba(10, 6, 5, .7);
}
.card.is-sold .card-media img, .item-page.is-sold .item-photo img, .is-sold .thumb { filter: grayscale(.85) brightness(.6); }
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px; flex: 1; }
.card-title { margin: 0; font-size: 16px; letter-spacing: .02em; }
.card-title a { color: var(--heading); }
.card-title a:hover { color: var(--gold); }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block; padding: 3px 9px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  border-radius: 2px; border: 1px solid var(--line-strong); color: var(--muted); background: rgba(255,255,255,.03);
}
.tag-new { color: var(--gold); border-color: rgba(var(--gold-rgb), .45); background: rgba(var(--gold-rgb), .08); }
.tag-used { color: #9cbcd8; border-color: rgba(93, 143, 184, .45); background: rgba(93, 143, 184, .08); }
.tag-available { color: #a5d57d; border-color: rgba(111, 174, 61, .5); background: rgba(111, 174, 61, .1); }
.tag-sold { color: #ef8c74; border-color: rgba(194, 59, 34, .5); background: rgba(194, 59, 34, .1); }
.tag-btn { cursor: pointer; font-family: inherit; }
.tag-btn:hover { filter: brightness(1.3); }

.price { font: 700 18px var(--head-font); color: var(--price); white-space: nowrap; letter-spacing: .02em; }
.price-lg { font-size: 26px; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .btn { margin-top: 8px; }

/* ---------- Страница Эгиды ---------- */
.back-link { display: inline-block; margin-bottom: 16px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.item-page { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.item-photo { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--media-bg); }
.item-photo img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.panel { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.item-info h1 { font-size: clamp(22px, 3vw, 30px); text-transform: none; }
.specs { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 18px 0; }
.specs dt { color: var(--muted); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.specs dd { margin: 0; word-break: break-word; }
.description { white-space: pre-line; color: var(--lead); border-top: 1px solid var(--line); padding-top: 16px; }
.item-buy { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ---------- Корзина и заказ ---------- */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.cart-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cart-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding: 12px 14px; }
.cart-row img { width: 76px; height: 76px; object-fit: cover; border-radius: 3px; }
.cart-row.is-sold img { filter: grayscale(1) brightness(.5); }
.cart-row-title { display: block; color: var(--heading); font-weight: 600; margin-bottom: 6px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent;
  color: var(--muted); cursor: pointer; font-size: 14px;
}
.icon-btn:hover { color: #fff; border-color: var(--danger); background: rgba(var(--hot-rgb), .2); }
.summary { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 12px; }
.summary-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.summary-list { list-style: none; margin: 0; padding: 0; }
.summary-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.summary-list .price { font-size: 15px; }
.form-section { font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 6px 0 14px; }
.form-section:not(:first-of-type) { margin-top: 26px; }
.checkout-form .btn-block { margin-top: 8px; }

.delivery-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.option-card {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; cursor: pointer;
  background: var(--input-bg); border: 1px solid var(--line-strong); border-radius: var(--radius); transition: border-color .15s, background .15s;
}
.option-card:hover { border-color: var(--gold-dim); }
.option-card:has(input:checked) { border-color: var(--accent-hot); background: linear-gradient(90deg, rgba(var(--accent-rgb), .14), var(--input-bg)); }
.option-card input { margin-top: 3px; accent-color: var(--accent); width: 17px; height: 17px; flex: none; }
.option-body { display: flex; flex-direction: column; gap: 2px; }
.option-body strong { color: var(--heading); }
.option-body small { color: var(--muted); }
.delivery-options.has-error .option-card { border-color: rgba(226, 82, 47, .6); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.done { max-width: 640px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.done img { filter: drop-shadow(0 0 24px rgba(var(--hot-rgb), .45)); }
.done .specs, .done .summary-list, .done .summary-row { width: 100%; text-align: left; }
.error-code { font: 700 72px var(--head-font); color: var(--accent-hot); margin: 0; text-shadow: 0 0 30px rgba(var(--hot-rgb), .5); }

/* ---------- Админка ---------- */
.login-box { max-width: 380px; margin: 40px auto; display: flex; flex-direction: column; align-items: stretch; text-align: center; }
.login-box img { margin: 0 auto 8px; }
.login-box h1 { font-size: 22px; }
.login-box .field { text-align: left; }
.admin-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.admin-head .page-title { margin: 0; }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.table-wrap { padding: 0; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; padding: 12px 14px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line-strong); }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr:hover td { background: rgba(255,255,255,.02); }
.admin-table td a { color: var(--heading); font-weight: 600; }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 3px; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.row-actions form { margin: 0; }

.form-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.photo-preview { border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--media-bg); overflow: hidden; }
.photo-preview img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
input[type=file] { color: var(--muted); font-size: 13px; }
input[type=file]::file-selector-button {
  margin-right: 10px; padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--panel-2); color: var(--text); cursor: pointer; font: 600 12px var(--body-font); letter-spacing: .08em; text-transform: uppercase;
}
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; padding-top: 18px; border-top: 1px solid var(--line); }

.order { margin-bottom: 16px; }
.order-cancelled { opacity: .6; }
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.order-head h2 { margin: 0; font-size: 18px; }
.order-body { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.order-body .specs { margin-top: 6px; }
.order-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.inline-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.inline-form select { width: auto; padding: 6px 10px; font-size: 13px; }
.order-status-new { color: #fff; background: var(--accent); border-color: var(--accent-hot); }
.order-status-confirmed { color: var(--gold); border-color: rgba(var(--gold-rgb), .5); }
.order-status-completed { color: #a5d57d; border-color: rgba(111, 174, 61, .5); }

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .cart-layout, .item-page, .form-grid, .order-body { grid-template-columns: 1fr; }
  .summary { position: static; }
}
@media (max-width: 640px) {
  .container { padding: 0 14px; }
  .main { padding-top: 18px; }
  .header-inner { height: 56px; }
  .logo-text { font-size: 16px; }
  .logo img { width: 28px; height: 28px; }
  .nav-link { padding: 8px 8px; letter-spacing: .06em; font-size: 12px; }
  .hero { grid-template-columns: 1fr; padding: 20px; }
  .filters { padding: 14px; gap: 12px; }
  .filters .field, .filters select { width: 100%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .card-body { padding: 12px; }
  .card-title { font-size: 14px; }
  .card-foot { flex-direction: column; align-items: stretch; }
  .card-foot .btn, .card-foot form .btn { width: 100%; }
  .price { font-size: 16px; }
  .cart-row { grid-template-columns: 60px minmax(0, 1fr) auto; }
  .cart-row img { width: 60px; height: 60px; }
  .cart-row .price { grid-column: 2; grid-row: 2; }
  .cart-row form { grid-column: 3; grid-row: 1 / span 2; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .panel { padding: 16px; }

  /* Таблица админки превращается в карточки */
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr { padding: 12px 14px; border-bottom: 1px solid var(--line-strong); }
  .admin-table td { border: 0; padding: 4px 0; }
  .admin-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 12px; }
  .admin-table td:first-child { float: right; width: auto; }
  .row-actions { justify-content: flex-start; padding-top: 8px !important; }
}
@media (max-width: 360px) {
  .logo-text { display: none; }
}

/* =====================================================================
   Эффекты (static/js/effects.js). Класс .fx ставится на <html>, только если
   скрипт работает и пользователь не просил уменьшить движение.
   ===================================================================== */

.main, .site-footer { position: relative; z-index: 1; }

/* Искры на фоне */
.embers {
  position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none;
  z-index: 15; /* над витриной, но под шапкой */
  mix-blend-mode: screen; opacity: .85;
}

/* Подсветка за курсором */
.cursor-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0; transition: opacity .5s;
  background:
    radial-gradient(520px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--hot-rgb), .11), transparent 62%),
    radial-gradient(160px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--spot-rgb), .06), transparent 70%);
}
.has-cursor .cursor-glow { opacity: 1; }

/* Полоска прогресса прокрутки */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 40; pointer-events: none;
  transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hot), var(--gold));
  box-shadow: 0 0 10px rgba(var(--hot-rgb), .7);
}

/* Шапка при прокрутке */
.site-header { transition: background .3s, box-shadow .3s; }
.site-header.is-scrolled {
  background: rgba(var(--bg-rgb), .92);
  box-shadow: 0 1px 0 rgba(var(--hot-rgb), .6), 0 10px 30px rgba(0, 0, 0, .6);
}
.logo img { transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.logo:hover img { transform: rotate(-12deg) scale(1.12); }

/* Подчёркивание пунктов меню */
.nav-link { position: relative; }
.nav-link::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-hot), transparent);
  transform: scaleX(0); transition: transform .3s;
}
.nav-link:hover::after { transform: scaleX(1); }
.cart-count:not(.is-empty) { animation: pop .6s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes pop { 0% { transform: scale(.3); } 100% { transform: scale(1); } }

/* ---------- Герой ---------- */
.hero { min-height: 260px; }
.hero-text { position: relative; z-index: 1; transform: translate3d(0, var(--sy, 0px), 0); }
.shimmer {
  background: linear-gradient(100deg, var(--heading) 0%, var(--heading) 38%, var(--shine) 46%, var(--shine-hot) 50%, var(--shine) 54%, var(--heading) 62%, var(--heading) 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 7s ease-in-out infinite;
}
@keyframes shimmer { 0%, 15% { background-position: 100% 0; } 60%, 100% { background-position: 0 0; } }

.hero-art {
  position: relative; width: 230px; height: 230px; display: grid; place-items: center;
  perspective: 700px;
  transform: translate3d(0, var(--sy, 0px), 0);
}
.hero-art > *, .hero-art::before { grid-area: 1 / 1; }
.hero-aegis {
  width: 150px; height: auto; position: relative; z-index: 2;
  transform: rotateX(var(--hrx, 0deg)) rotateY(var(--hry, 0deg));
  transition: transform .25s ease-out;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .6)) drop-shadow(0 0 26px rgba(var(--hot-rgb), .45));
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%, 100% { translate: 0 -6px; } 50% { translate: 0 8px; } }
.hero-ring {
  width: 230px; height: 230px; border-radius: 50%; opacity: .7;
  background: repeating-conic-gradient(from 0deg, rgba(var(--gold-rgb), .6) 0deg 2deg, transparent 2deg 12deg);
  -webkit-mask: radial-gradient(circle, transparent 104px, #000 105px, #000 112px, transparent 113px);
          mask: radial-gradient(circle, transparent 104px, #000 105px, #000 112px, transparent 113px);
  animation: spin 40s linear infinite;
}
.hero-ring-inner {
  opacity: 1;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(var(--hot-rgb), .9) 60deg, transparent 120deg,
                             transparent 180deg, rgba(var(--gold-rgb), .8) 240deg, transparent 300deg);
  -webkit-mask: radial-gradient(circle, transparent 92px, #000 93px, #000 95px, transparent 96px);
          mask: radial-gradient(circle, transparent 92px, #000 93px, #000 95px, transparent 96px);
  animation: spin 9s linear infinite reverse;
}
.hero-art::before {
  content: ""; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--hot-rgb), .35), rgba(var(--hot-rgb), .08) 55%, transparent 70%);
  animation: pulse 4s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: .6; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.06); } }

/* ---------- Карточки: 3D-наклон, блик, глубина ---------- */
.card { position: relative; }
.fx .card {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .6s cubic-bezier(.2, .8, .2, 1), border-color .25s, box-shadow .25s;
}
.fx .card.is-tilting {
  box-shadow: 0 24px 40px rgba(0, 0, 0, .55), 0 0 30px rgba(var(--hot-rgb), .25);
  transition: transform .08s linear, border-color .25s, box-shadow .25s;
}
.fx .card .card-media img {
  transform: scale(1.1) translate(calc(var(--px, 0) * -9px), calc(var(--py, 0) * -9px));
  transition: transform .6s cubic-bezier(.2, .8, .2, 1), filter .3s;
}
.fx .card.is-tilting .card-media img { transition: transform .08s linear, filter .3s; }
.fx .card .year-badge { transform: translate(calc(var(--px, 0) * 6px), calc(var(--py, 0) * 6px)); transition: transform .3s; }
.card::after, .item-photo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(var(--glare-rgb), .22), transparent 55%);
  opacity: 0; transition: opacity .35s; mix-blend-mode: screen;
}
.card.is-tilting::after, .item-photo.is-tilting::after { opacity: 1; }
/* Светящаяся рамка, бегущая за курсором */
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 2;
  background: radial-gradient(220px circle at var(--gx, 50%) var(--gy, 50%), rgba(var(--glow-rgb), .9), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .35s;
}
.card.is-tilting::before { opacity: 1; }

.fx .item-photo {
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .7s cubic-bezier(.2, .8, .2, 1);
}
.fx .item-photo.is-tilting { transition: transform .1s linear; }
.fx .item-photo img { transform: scale(1.06) translate(calc(var(--px, 0) * -10px), calc(var(--py, 0) * -10px)); transition: transform .5s; }

/* ---------- Кнопки: магнит и проблеск ---------- */
.btn-primary {
  position: relative; overflow: hidden;
  transform: translate(var(--bx, 0px), var(--by, 0px));
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), filter .15s;
}
.btn-primary::before {
  content: ""; position: absolute; top: 0; bottom: 0; width: 45%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-20deg); transition: left .6s ease;
}
.btn-primary:hover::before { left: 120%; }
.btn-primary:active { scale: .97; }

/* ---------- Появление при прокрутке (свойство translate не мешает transform наклона) ---------- */
.fx .reveal { opacity: 0; translate: 0 34px; }
.fx .reveal.is-visible { opacity: 1; translate: 0 0; }
.fx .reveal, .fx .card.reveal, .fx .card.reveal.is-tilting {
  transition-property: opacity, translate, transform, border-color, box-shadow;
  transition-timing-function: ease, cubic-bezier(.2, .8, .2, 1), cubic-bezier(.2, .8, .2, 1), ease, ease;
}
.fx .reveal { transition-duration: .7s, .8s, .6s, .25s, .25s; }
.fx .card.reveal.is-tilting { transition-duration: .7s, .8s, .08s, .25s, .25s; }

/* Сообщения выезжают сверху */
.flash { animation: flash-in .5s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes flash-in { from { opacity: 0; translate: 0 -12px; } to { opacity: 1; translate: 0 0; } }

.option-card { transition: border-color .2s, background .2s, transform .2s; }
.option-card:hover { transform: translateX(3px); }

.owner-link { color: var(--muted); font-size: 12px; }
.owner-link:hover { color: var(--gold); }

/* ---------- Подложка под заглушку Эгиды: свечение в цвет темы ---------- */
.card-media, .item-photo, .photo-preview,
img[src*="aegis-placeholder"] {
  background:
    radial-gradient(circle at 50% 46%, rgba(var(--hot-rgb), .55), rgba(var(--accent-rgb), .28) 45%, rgba(var(--accent-rgb), .06) 68%, transparent 82%),
    var(--media-bg);
}
img[src*="aegis-placeholder"] { padding: 4%; }
.card-media img[src*="aegis-placeholder"], .item-photo img[src*="aegis-placeholder"],
.photo-preview img[src*="aegis-placeholder"] { background: none; padding: 8%; object-fit: contain; }
.done img { background: none; padding: 0; }

/* ---------- Переключатель темы ---------- */
.header-right { display: flex; align-items: center; gap: 6px; }
.theme-picker { position: relative; }
.theme-toggle {
  width: 34px; height: 34px; border-radius: 50%; padding: 0; cursor: pointer;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line-strong);
  transition: border-color .2s, transform .3s;
}
.theme-toggle:hover { border-color: var(--gold); transform: rotate(45deg); }
.theme-dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-hot) 0 50%, var(--gold) 50% 100%);
  box-shadow: 0 0 10px rgba(var(--hot-rgb), .6);
}
.theme-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 50;
  width: 360px; max-width: calc(100vw - 24px); max-height: 75vh; overflow-y: auto;
  padding: 10px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  animation: menu-in .2s cubic-bezier(.2, .8, .2, 1);
}
@keyframes menu-in { from { opacity: 0; translate: 0 -6px; } to { opacity: 1; translate: 0 0; } }
.theme-menu-title { margin: 4px 6px 8px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.theme-menu-note { margin: -2px 6px 10px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.theme-grid button {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; min-width: 0;
  background: rgba(255, 255, 255, .02); border: 1px solid transparent; border-radius: 6px;
  cursor: pointer; color: var(--text); text-align: left; font: 13px var(--body-font);
  transition: background .2s, border-color .2s;
}
.theme-grid button:hover { background: rgba(var(--tile-rgb, var(--hot-rgb)), .12); border-color: rgba(var(--tile-rgb, var(--hot-rgb)), .4); }
.theme-grid button[aria-checked="true"] { background: rgba(var(--tile-rgb, var(--hot-rgb)), .18); border-color: rgba(var(--tile-rgb, var(--hot-rgb)), .9); }
.theme-thumb {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--tile-rgb, 226, 82, 47), .45), transparent 70%);
}
.theme-thumb img { width: 36px; height: auto; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.theme-thumb-classic {
  width: 26px; height: 26px; margin: 7px;
  background: linear-gradient(135deg, #e2522f 0 50%, #d4b26a 50%); box-shadow: 0 0 10px rgba(226, 82, 47, .5);
}
.theme-label { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.theme-label b { font-family: var(--head-font); color: var(--heading); font-size: 14px; }
.theme-label small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Фоновый узор темы (витраж, туманности, лава) ---------- */
.bg-motif { position: fixed; inset: 0; pointer-events: none; z-index: 0; background: var(--motif); }

/* ---------- Эгида в шапке главной — картинка из темы ---------- */
div.hero-aegis { width: 176px; aspect-ratio: 1000 / 885; background: var(--hero-img) center / contain no-repeat; }
.hero-theme { margin: 12px 0 0; }
.theme-name { color: var(--gold); font-weight: 600; }

/* ---------- Лента «Эгиды по годам» ---------- */
.years-section { margin: 4px 0 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 20px; text-transform: uppercase; letter-spacing: .08em; }
.section-head p { margin: 0; }
.years-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 14px;
  overflow-x: auto; overflow-y: hidden; padding: 10px 6px 18px; scroll-snap-type: x proximity;
  scrollbar-width: thin; scrollbar-color: rgba(var(--gold-rgb), .4) transparent;
}
.year-tile {
  position: relative; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px;
  padding: 14px 10px 12px; border-radius: 8px; color: var(--text);
  background:
    radial-gradient(circle at 50% 32%, rgba(var(--tile-rgb), .32), rgba(var(--tile-rgb), .06) 55%, transparent 75%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid rgba(var(--tile-rgb), .25);
  transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .5s cubic-bezier(.2, .8, .2, 1), border-color .25s, box-shadow .25s;
}
.year-tile:hover { color: var(--text); border-color: rgba(var(--tile-rgb), .75); box-shadow: 0 14px 30px rgba(0, 0, 0, .5), 0 0 26px rgba(var(--tile-rgb), .3); }
.year-tile.is-tilting { transition: transform .08s linear, border-color .25s, box-shadow .25s; }
.year-tile-img { width: 124px; height: 110px; display: grid; place-items: center; }
.year-tile-img img {
  max-width: 100%; max-height: 100%; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .6));
  transform: translate(calc(var(--px, 0) * -7px), calc(var(--py, 0) * -7px));
  transition: transform .4s cubic-bezier(.2, .8, .2, 1), scale .4s cubic-bezier(.2, .8, .2, 1);
}
.year-tile:hover .year-tile-img img { scale: 1.08; }
.year-tile-year { margin-top: 6px; font: 700 22px var(--head-font); color: var(--heading); letter-spacing: .06em; }
.year-tile-theme { font-size: 12px; font-weight: 600; color: rgb(var(--tile-rgb)); filter: brightness(1.3); }
.year-tile-meta { font-size: 11px; color: var(--muted); }
.year-tile-count { margin-top: 6px; padding: 2px 8px; font-size: 11px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 10px; }
.year-tile-count.is-available { color: #a5d57d; border-color: rgba(111, 174, 61, .5); background: rgba(111, 174, 61, .1); }

/* ---------- Карточки: обложка-образец и подписи ---------- */
.card-media.is-sample {
  background:
    radial-gradient(circle at 50% 48%, rgba(var(--glow-item), .45), rgba(var(--glow-item), .1) 50%, transparent 75%),
    var(--media-bg);
}
.card-media.is-sample img, .item-photo.is-sample img {
  object-fit: contain; padding: 9%; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .6));
}
.sample-badge {
  position: absolute; left: 10px; bottom: 10px; z-index: 1; padding: 3px 8px;
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  background: rgba(var(--bg-rgb), .82); border: 1px dashed var(--line-strong); border-radius: 3px;
}
.photo-count {
  position: absolute; right: 10px; top: 10px; padding: 2px 8px; font-size: 12px;
  background: rgba(var(--bg-rgb), .82); border-radius: 10px;
}
.card-theme {
  font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: rgb(var(--glow-item)); filter: brightness(1.25);
}
.card-theme:hover { color: rgb(var(--glow-item)); filter: brightness(1.6); }
.thumb.is-sample, .cart-row img.is-sample {
  object-fit: contain; padding: 6%;
  background: radial-gradient(circle, rgba(var(--hot-rgb), .35), var(--media-bg) 72%);
}

/* ---------- Галерея объявления ---------- */
.gallery { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.gallery-main { transition: opacity .16s; }
.gallery-main.is-switching { opacity: 0; }
.gallery-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.gallery-thumb {
  position: relative; width: 76px; height: 76px; padding: 0; overflow: hidden; cursor: pointer;
  background: var(--media-bg); border: 2px solid transparent; border-radius: 4px; opacity: .7;
  transition: opacity .2s, border-color .2s, transform .2s;
}
.gallery-thumb:hover { opacity: 1; transform: translateY(-2px); }
.gallery-thumb.is-active { opacity: 1; border-color: var(--accent-hot); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.is-sample img { object-fit: contain; padding: 8%; background: radial-gradient(circle, rgba(var(--hot-rgb), .35), transparent 70%); }
.gallery-thumb small {
  position: absolute; left: 0; right: 0; bottom: 0; font-size: 9px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text); background: rgba(0, 0, 0, .6);
}
.gallery-note { margin: 0; }

.year-card {
  display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 10px 14px;
  color: var(--text); border-radius: 6px;
  background: linear-gradient(90deg, rgba(var(--tile-rgb), .14), transparent);
  border: 1px solid rgba(var(--tile-rgb), .35);
  transition: border-color .2s, transform .2s;
}
.year-card:hover { color: var(--text); border-color: rgba(var(--tile-rgb), .8); transform: translateX(3px); }
.year-card img { width: 58px; flex: none; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.year-card > span { display: flex; flex-direction: column; min-width: 0; }
.year-card small { color: var(--muted); }
.year-card .year-card-arrow { margin-left: auto; color: var(--gold); font-size: 20px; }

/* ---------- Страница выпуска ---------- */
.year-hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 24px 32px; align-items: center;
  padding: 24px 32px; margin-bottom: 18px; border-radius: var(--radius);
  background: linear-gradient(110deg, rgba(var(--panel-2-rgb), .9), rgba(var(--panel-rgb), .55));
  border: 1px solid var(--line);
}
.year-hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 2px; opacity: .7;
  background: linear-gradient(90deg, transparent, var(--accent), var(--gold), var(--accent), transparent);
}
.year-hero-art { scale: 1.55; margin: 70px auto; }
img.year-hero-img { width: 186px; }
.year-hero-text h1 { font-size: clamp(26px, 4vw, 42px); }
.year-hero-text .specs { margin-bottom: 0; }
.year-nav { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 26px; }
.year-nav-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px; color: var(--text); border-radius: 6px;
  border: 1px solid rgba(var(--tile-rgb), .35);
  background: linear-gradient(90deg, rgba(var(--tile-rgb), .12), transparent);
  transition: border-color .2s, transform .2s;
}
.year-nav-link.is-next { margin-left: auto; text-align: right; background: linear-gradient(270deg, rgba(var(--tile-rgb), .12), transparent); }
.year-nav-link:hover { color: var(--text); border-color: rgba(var(--tile-rgb), .8); }
.year-nav-link img { width: 46px; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .5)); }
.year-nav-link span { display: flex; flex-direction: column; font: 600 15px var(--head-font); }
.year-nav-link small { font: 12px var(--body-font); color: var(--muted); }
.done-aegis { filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .6)) drop-shadow(0 0 24px rgba(var(--hot-rgb), .45)); }

/* ---------- Админка: фото объявления ---------- */
.photo-manager { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 12px; }
.photo-tile { position: relative; overflow: hidden; background: var(--media-bg); border: 1px solid var(--line-strong); border-radius: 4px; }
.photo-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: opacity .2s; }
.photo-tile label { display: flex; align-items: center; gap: 6px; padding: 5px 8px; font-size: 12px; cursor: pointer; }
.photo-tile .photo-remove { color: #f09a86; }
.photo-tile:has(.photo-remove input:checked) img { opacity: .25; filter: grayscale(1); }
.photo-tile:has(.photo-cover input:checked) { border-color: var(--gold); }
.photo-drop { padding: 14px; background: rgba(255, 255, 255, .02); border: 1px dashed var(--line-strong); border-radius: 6px; }
.photo-drop p { margin: 8px 0 4px; }
.photo-new { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.photo-new img { width: 64px; height: 64px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line-strong); }
.photo-preview { position: relative; }
.photo-preview-sample { margin-bottom: 10px; }
.photo-preview-sample img { object-fit: contain; padding: 10%; }

@media (max-width: 900px) {
  .year-hero { grid-template-columns: 1fr; text-align: left; }
  .year-hero-art { scale: 1.3; margin: 40px auto; }
}
@media (max-width: 640px) {
  div.hero-aegis { width: 110px; }
  .years-strip { grid-auto-columns: 140px; gap: 10px; }
  .year-tile-img { width: 100px; height: 88px; }
  .year-hero { padding: 18px; }
  .year-nav-link small { display: none; }
  img.year-hero-img { width: 124px; }
  .year-hero-art { scale: 1.45; margin: 44px auto; }
  .theme-grid { grid-template-columns: 1fr; }
}

/* Плавная смена темы там, где нет View Transitions */
.theme-fading, .theme-fading *, .theme-fading *::before, .theme-fading *::after {
  transition: background-color .45s ease, border-color .45s ease, color .45s ease, box-shadow .45s ease !important;
}
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .5s; }

@media (max-width: 480px) {
  .nav-catalog { display: none; }
}

@media (max-width: 640px) {
  .hero { min-height: 0; }
  .hero-art { display: grid; width: 150px; height: 150px; margin: 0 auto; order: -1; }
  .hero-ring { width: 150px; height: 150px;
    -webkit-mask: radial-gradient(circle, transparent 66px, #000 67px, #000 72px, transparent 73px);
            mask: radial-gradient(circle, transparent 66px, #000 67px, #000 72px, transparent 73px); }
  .hero-ring-inner {
    -webkit-mask: radial-gradient(circle, transparent 58px, #000 59px, #000 61px, transparent 62px);
            mask: radial-gradient(circle, transparent 58px, #000 59px, #000 61px, transparent 62px); }
  .hero-art::before { width: 130px; height: 130px; }
  .hero-aegis { width: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
