/* =========================================================================
   ОПГ · Ночной сад — все стили сайта (site.css)
   Подключение (private/page-shell.php): bootstrap.min.css → site.css → стили страницы (portrait.css).
   Файл собран из прежних app.css, bootstrap-bridge.css и apple.css: повторы одних и тех же
   селекторов слиты, перекрытые объявления убраны. Порядок частей важен — каждая следующая
   опирается на предыдущую:
     A. Основа и компоненты        B. Тема «Ночной сад»        C. Связка с Bootstrap
     D. Материалы и отклик          E. Плавные переходы
   ========================================================================= */

/* =========================================================================
   ЧАСТЬ A. Основа и компоненты: токены, база, каркас, компоненты, страницы, диалоги, адаптив
   ========================================================================= */

/* Шрифты (SIL OFL 1.1): Triodion — заголовки (колдовской манускрипт), Alice — текст, Bad Script — рукописные подписи */
@font-face { font-family: "Triodion"; src: url("brand/fonts/Triodion-cyrillic.woff2") format("woff2"); font-display: swap; unicode-range: U+301, U+400-45F, U+490-491, U+4B0-4B1, U+2116; }
@font-face { font-family: "Triodion"; src: url("brand/fonts/Triodion-latin.woff2") format("woff2"); font-display: swap; unicode-range: U+0-FF, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+304, U+308, U+329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Alice"; src: url("brand/fonts/Alice-cyrillic.woff2") format("woff2"); font-display: swap; unicode-range: U+301, U+400-45F, U+490-491, U+4B0-4B1, U+2116; }
@font-face { font-family: "Alice"; src: url("brand/fonts/Alice-latin.woff2") format("woff2"); font-display: swap; unicode-range: U+0-FF, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+304, U+308, U+329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bad Script"; src: url("brand/fonts/BadScript-cyrillic.woff2") format("woff2"); font-display: swap; unicode-range: U+301, U+400-45F, U+490-491, U+4B0-4B1, U+2116; }
@font-face { font-family: "Bad Script"; src: url("brand/fonts/BadScript-latin.woff2") format("woff2"); font-display: swap; unicode-range: U+0-FF, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+304, U+308, U+329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- 1. Токены ---------- */
:root {
  color-scheme: dark;
  --accent-ink: #1d1229;
  --gold: #e8c77d;
  --success: #86d6a8;
  --success-bg: rgba(134, 214, 168, .12);
  --warning: #f0c47e;
  --warning-bg: rgba(240, 196, 126, .12);
  --danger: #f29bb0;
  --danger-bg: rgba(242, 155, 176, .12);
  --teal: #8ee8de;
  --r-green: #a7d49a;
  --r-blue: #94bbee;
  --r-purple: #c6a0e5;
  --r-gold: #e2c17e;
  --r-red: #ee93aa;
  --font-ui: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font: "Alice", Georgia, "Times New Roman", serif;
  --font-display: "Triodion", "Alice", Georgia, serif;
  --font-script: "Bad Script", "Alice", cursive;
  --radius-s: 8px;
  --radius: 12px;
  --radius-l: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-l: 0 24px 60px rgba(0, 0, 0, .5);
  --sidebar: 248px;
  --topbar: 64px;
  --gutter: clamp(16px, 3vw, 36px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --bg: #07050c;
  --bg-2: rgba(14, 9, 22, .92);
  --surface: rgba(19, 12, 30, .86);
  --surface-2: rgba(27, 17, 42, .9);
  --surface-3: rgba(44, 28, 68, .9);
  --line: rgba(150, 110, 210, .28);
  --line-strong: rgba(196, 160, 245, .55);
  --text: #f4eefc;
  --text-2: #d8cce9;
  --muted: #b2a3c8;
  --faint: #8a7ba2;
  --accent: #d9b9ff;
  --accent-strong: #a465f2;
  --accent-soft: rgba(164, 101, 242, .16);
  --glow: rgba(170, 100, 255, .45);
  --orn: url("brand/ornaments/corner-tl.svg") left top / var(--cs, 20px) no-repeat, url("brand/ornaments/corner-tr.svg") right top / var(--cs, 20px) no-repeat, url("brand/ornaments/corner-bl.svg") left bottom / var(--cs, 20px) no-repeat, url("brand/ornaments/corner-br.svg") right bottom / var(--cs, 20px) no-repeat;
  --gem: url("brand/ornaments/gem.svg") center top -1px / 64px 14px no-repeat, url("brand/ornaments/gem.svg") center bottom -1px / 64px 14px no-repeat;
  --panel: linear-gradient(180deg, rgba(30, 18, 46, .9), rgba(14, 9, 22, .92));
  --frame-shadow: inset 0 0 0 1px rgba(10, 5, 18, .9), inset 0 0 0 2px rgba(190, 150, 245, .28), inset 0 0 26px rgba(130, 60, 210, .22), 0 0 18px rgba(140, 70, 230, .18), 0 8px 26px rgba(0, 0, 0, .45);
  --metal: linear-gradient(180deg, #ffffff 0%, #f1e6ff 38%, #c4a6ec 62%, #8d6bc2 78%, #efe2ff 100%);
  --spring: cubic-bezier(.22, 1, .36, 1);
  --spring-soft: cubic-bezier(.32, .72, 0, 1);
  --press-scale: .97;
  --glass-thin: rgba(16, 10, 26, .52);
  --glass: rgba(12, 7, 20, .62);
  --glass-thick: rgba(10, 6, 17, .74);
  --glass-edge: rgba(235, 215, 255, .16);
  --glass-blur: blur(22px) saturate(170%);
  --glass-blur-thick: blur(34px) saturate(180%);
}

/* ---------- 2. База ---------- */
*, *::before, *::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar) + 16px);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 {
  line-height: 1.2;
  margin: 0 0 .5em;
  font-weight: 600;
}
h1, h2 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: .01em;
}
h2 {
  font-size: 28px;
}
h3 {
  font-size: 17px;
  line-height: 1.25;
}
p {
  margin: 0 0 .8em;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
a:hover {
  color: #e3cffd;
}
img {
  max-width: 100%;
}
small {
  font-size: 12px;
}
b, strong {
  font-weight: 650;
}
button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
  border-radius: 0;
}
button:disabled {
  cursor: default;
  opacity: .55;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
::selection {
  background: rgba(166, 120, 232, .45);
}
input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover {
  border-color: var(--line-strong);
}
input:focus, select:focus, textarea:focus {
  outline: none;
}
input::placeholder {
  color: var(--faint);
  font-family: var(--font-script);
  font-style: normal;
  font-size: 1.08em;
}
select {
  appearance: none;
  padding-right: 36px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d9b9ff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center / 18px no-repeat, var(--orn), rgba(10, 6, 17, .9);
  --cs: 14px;
  border: 1px solid rgba(170, 125, 235, .35);
}
/* Раскрывающийся список у <select>: браузер рисует его сам и может взять светлый фон —
   цвета задаём явно, чтобы пункты всегда были читаемы */
select option, select optgroup {
  background-color: #170e24;
  color: var(--text);
}
select option:checked {
  background-color: #4e2391;
  color: #fff;
}
select option:disabled {
  color: var(--faint);
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  accent-color: var(--accent-strong);
  flex: 0 0 18px;
}
input[type="color"] {
  padding: 3px;
  width: 44px;
}
input[type="search"]::-webkit-search-cancel-button {
  filter: invert(.7);
}
svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 14px;
  border-radius: 8px;
}
.skip-link:focus {
  left: 8px;
}

/* ---------- Кнопки ---------- */
.primary,
.secondary,
.how,
.danger-ghost,
.logout,
#clearCatalog,
#resetTournamentFilters,
#resetTournamentSelection,
#resetGuildSelection,
[data-own-collection] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px;
  border-radius: var(--radius-s);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  transition: background .15s, border-color .15s, color .15s, transform .1s, box-shadow .15s;
}
.secondary:hover:not(:disabled),
.how:hover:not(:disabled),
#clearCatalog:hover,
#resetTournamentFilters:hover,
#resetTournamentSelection:hover,
#resetGuildSelection:hover,
[data-own-collection]:hover {
  color: var(--text);
}
.danger-ghost, .archive-delete, #accountsList .remove-member {
  color: var(--danger);
  border: 1px solid rgba(242, 155, 176, .35);
}
.danger-ghost:hover, .archive-delete:hover, #accountsList .remove-member:hover {
  background: var(--danger-bg);
  color: #ffc6d3;
}
.logout {
  font-weight: 500;
  --cs: 18px;
  min-height: 40px;
}
.logout:hover {
  color: var(--text);
  background: var(--surface-2);
}
.logout svg {
  width: 18px;
  height: 18px;
}

/* ---------- 3. Каркас ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 14px 18px;
  overflow-y: auto;
  backdrop-filter: var(--glass-blur-thick);
  -webkit-backdrop-filter: var(--glass-blur-thick);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  padding: 4px 8px;
  position: relative;
}
.brand:hover {
  color: var(--text);
}
.brand-text b {
  display: block;
  font: 30px/1 var(--font-display);
}
.brand-text small {
  display: block;
  line-height: 1.35;
  text-transform: uppercase;
}
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  isolation: isolate;
}
.side-nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  font-weight: 500;
  text-align: left;
  position: relative;
  font-family: var(--font);
}
.side-nav button.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 12px var(--glow);
  display: none;
}
.sidebar-motto {
  margin: auto 8px 0;
  padding-top: 16px;
  font: 15px/1.35 var(--font-display);
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 2px #000;
}
.main-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 var(--gutter);
  transition: border-color .2s, box-shadow .2s;
  height: auto;
  min-height: var(--topbar);
  background: var(--glass) !important;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 0 !important;
}
body.scrolled .topbar {
  border-bottom-color: var(--line);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}
.brand-compact {
  display: none;
  padding: 0;
}
.brand-compact .brand-moon {
  width: 34px;
  height: 34px;
  font-size: 19px;
}
.brand-compact b {
  font: 24px/1 var(--font-display);
  letter-spacing: .12em;
}
.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-width: 0;
  border-radius: 999px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}
.sync-pill::before {
  content: "";
  vertical-align: middle;
  margin-right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  flex: none;
}
.sync-pill.has-error::before {
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
}
.profile {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  width: 44px;
  height: 44px;
}
.profile .name {
  font-weight: 600;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font);
  font-size: 15px;
}
main {
  width: 100%;
  max-width: 1760px;
  margin: 0 auto;
  padding: 18px var(--gutter) 64px;
  flex: 1;
}
.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
}

/* Панель инструментов страницы: помощь и настройки отображения */
.nyx-help-tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font);
}
.nyx-help-tools button:hover {
  color: var(--text);
  background: var(--surface);
}
.nyx-help-tools [data-help-page]::before {
  content: "?";
  display: grid;
  place-items: center;
  border-radius: 50%;
  height: 32px;
}
.nickname-preference {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

/* ---------- Шапка страницы ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 38%);
  align-items: center;
  margin-bottom: 24px;
  border-radius: var(--radius-l);
  overflow: hidden;
  isolation: isolate;
  min-height: 300px;
  --hero-img: url("brand/heroes/tournament.webp");
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(1px 1px at 20% 30%, #fff8 50%, transparent 51%), radial-gradient(1px 1px at 46% 72%, #fff6 50%, transparent 51%), radial-gradient(1.5px 1.5px at 62% 18%, #e8d8ff99 50%, transparent 51%), radial-gradient(1px 1px at 8% 80%, #fff5 50%, transparent 51%), radial-gradient(1px 1px at 35% 12%, #fff5 50%, transparent 51%);
  opacity: .7;
}
.hero-text {
  position: relative;
  z-index: 1;
  max-width: 620px;
}
.hero p {
  margin: 0;
  max-width: 520px;
  line-height: 1.35;
}
.hero-art {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: none;
}
body[data-detail] .hero {
  display: none;
}

/* Статистика */
.overview {
  display: grid;
  grid-template-columns: 1fr 1fr 1.6fr;
  gap: 14px;
  margin-bottom: 28px;
}
.stat strong {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 6px 0 2px;
  font: 36px/1.1 var(--font-display);
}
.stat p {
  margin: 0;
}
.my-status strong {
  margin: 6px 0 4px;
}

/* Заголовок блока со списком */
.section-top p {
  margin: 0;
}
#listTools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  justify-content: center;
}
#listTools .how#how {
  order: 3;
}
#tournamentCopy {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
#tournamentCopy:not([hidden]) {
  display: flex;
}
.muted-note {
  color: var(--muted);
  font-size: 13px;
}

/* Переключатель вида */
.view-toggle button {
  font-weight: 500;
  font-family: var(--font);
}
.view-toggle button:hover {
  color: var(--text);
}

/* Фильтры */
.filters, .catalog-filters, .tournament-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.filters:has( > .search:only-child) {
  padding: 0;
  background: none;
  border: 0;
}
.search {
  position: relative;
  flex: 1 1 280px;
  min-width: 0;
  display: block;
}
.search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
}
.search input {
  padding-left: 40px;
}
.catalog-filters {
  margin-bottom: 18px;
}
.catalog-filters select {
  flex: 0 1 230px;
  width: auto;
  min-width: 180px;
}
.catalog-filters p, #catalogCount {
  flex-basis: 100%;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}
#tournamentMultiFilters, #guildMemberFilters {
  display: flex;
  flex: 2 1 420px;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
  min-width: 0;
}
.tournament-member-search, .status-member-search {
  display: block;
  flex: 1 1 200px;
  min-width: 0;
  font-size: 0;
}
.tournament-member-search input, .status-member-search input {
  font-size: 14px;
}
.checkbox-filter, .tournament-multi {
  position: relative;
  flex: 1 1 180px;
  min-width: 0;
  max-width: 100%;
}
.checkbox-filter > summary, .tournament-multi > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 34px 10px 14px;
  border-radius: var(--radius-s);
  cursor: pointer;
  list-style: none;
  font-size: 13.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}
.checkbox-filter > summary::-webkit-details-marker,
.tournament-multi > summary::-webkit-details-marker {
  display: none;
}
.checkbox-filter > summary::after, .tournament-multi > summary::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -5px;
  border-right: 1.7px solid var(--muted);
  border-bottom: 1.7px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .15s;
  border-color: var(--accent);
}
.checkbox-filter[open] > summary::after, .tournament-multi[open] > summary::after {
  transform: rotate(-135deg);
  margin-top: -1px;
}
.checkbox-filter[open], .tournament-multi[open] {
  z-index: 40;
}
.checkbox-options, .tournament-multi-options {
  position: fixed;
  z-index: 60;
  max-height: 300px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-l);
  background: var(--orn), #150d22;
  --cs: 16px;
}
.checkbox-filter:not([open]) > .checkbox-options,
.tournament-multi:not([open]) > .tournament-multi-options {
  display: none;
}
.checkbox-options label, .tournament-multi-options label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.checkbox-options label:hover, .tournament-multi-options label:hover {
  background: var(--surface-3);
}
.checkbox-options label:has(input:checked),
.tournament-multi-options label:has(input:checked) {
  color: var(--accent);
}
.guild-member-search {
  position: sticky;
  top: -6px;
  z-index: 1;
  padding: 6px 4px 8px;
  background: #150d22;
}
.guild-member-search label {
  display: block;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}
.guild-member-search-empty, [data-member-search-empty] {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

/* Сетка карточек */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.picture {
  position: relative;
  height: 176px;
  display: grid;
  place-items: center;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--rarity) 22%, transparent), transparent 85%);
}
.picture > a {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}
.picture img {
  width: 82%;
  height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .45));
  transition: transform .25s var(--ease);
}
.card:hover .picture img {
  transform: scale(1.04);
}
img.is-missing {
  visibility: hidden;
}
.no-image {
  color: var(--faint);
  font-size: 42px;
  opacity: .5;
}
.points {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(6px);
}
.rarity {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  color: var(--rarity);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
}
.rarity::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.card h3 {
  margin: 0 0 6px;
  line-height: 1.3;
}
.card h3 a {
  color: inherit;
  text-decoration: none;
}
.card h3 a:hover {
  color: var(--accent);
}
.way {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  margin: 0 0 4px;
}
.card-body > .way + .need, .card-body > .way + .way + .need {
  margin-top: auto;
}
.card-body .need {
  margin-top: 12px;
}
.card-body > .need:last-child {
  margin-top: auto;
}
.need small {
  color: var(--muted);
  font-size: 11.5px;
}
.need > section + section {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 10px;
}
.event-flower-label {
  display: inline-block;
  align-self: flex-start;
  margin: 0 0 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 11.5px;
  line-height: 1.4;
}
.chip.bonus-one {
  background: rgba(142, 232, 222, .12);
  color: var(--teal);
  border-color: rgba(142, 232, 222, .45);
  font-weight: 600;
}
.chip.bonus-two {
  background: rgba(232, 199, 125, .12);
  color: var(--gold);
  border-color: rgba(232, 199, 125, .5);
  font-weight: 600;
}
.chip.single-in-category {
  outline: 2px solid #d5acff;
  outline-offset: 1px;
}
.empty, #empty {
  display: none;
  padding: 44px 20px;
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}
.bottom-note {
  margin-top: 22px;
  color: var(--faint);
  font-size: 12.5px;
  line-height: 1.6;
}

/* Компактный вид (без картинок) */
.grid.compact {
  grid-template-columns: 1fr;
  gap: 8px;
}
.compact .card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
}
.compact .card:hover {
  transform: none;
}
.compact .picture {
  height: auto;
  background: none;
  place-items: start;
}
.compact .picture img, .compact .picture > a, .compact .no-image {
  display: none;
}
.compact .points {
  position: static;
  display: inline-block;
}
.compact .card-body {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.3fr);
  column-gap: 24px;
  padding: 0;
  align-items: center;
}
.compact .rarity, .compact .card h3, .compact .way, .compact .event-flower-label {
  grid-column: 1;
}
.compact .card h3 {
  margin: 0;
}
.compact .need {
  grid-column: 2;
  grid-row: 1 / 5;
  margin: 0;
  padding: 0;
  border: 0;
}
.compact .catalog-card:not(:has(.points)) {
  grid-template-columns: 1fr;
}
.compact .catalog-card:not(:has(.points)) .picture {
  display: none;
}
.compact .server-flower-toggle {
  grid-column: 1 / -1;
}

/* Каталог: переключатель наличия, ссылки */
.server-flower-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 34px;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-s);
  background: transparent;
  border: 1px dashed rgba(242, 155, 176, .4);
  color: var(--danger);
  font-size: 12px;
  text-align: left;
}
.server-flower-toggle[aria-pressed="true"] {
  border-color: rgba(134, 214, 168, .35);
  color: var(--success);
}
.server-flower-toggle:hover {
  filter: brightness(1.15);
}
.obtaining-guide {
  margin: 0 0 22px;
}
.obtaining-guide-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  color: var(--text);
  text-decoration: none;
  justify-content: center;
  text-align: center;
  min-height: 64px;
}
.obtaining-guide-link:hover {
  color: var(--text);
  border-color: var(--accent);
  background: linear-gradient(90deg, rgba(166, 120, 232, .24), rgba(166, 120, 232, .06));
}
.obtaining-guide-link > span:nth-child(2) {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.obtaining-guide-link small {
  color: var(--muted);
  font-size: 12.5px;
}
.obtaining-guide-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* Карточка цветка/вазы */
.item-detail {
  margin-bottom: 30px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.back-link:hover {
  color: var(--accent);
}
.detail-top {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 1.3fr;
  gap: 36px;
  margin: 16px 0 30px;
  padding: 28px;
  border-radius: var(--radius-l);
}
.detail-top h1 {
  font-size: clamp(30px, 3.4vw, 42px);
  margin: 8px 0 18px;
}
.detail-art {
  display: grid;
  place-items: center;
  min-height: 300px;
  border-radius: var(--radius);
  background: radial-gradient(closest-side, rgba(166, 120, 232, .25), transparent 80%);
}
.detail-art img {
  /* Не увеличиваем небольшие игровые оригиналы. */
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .5));
}
.detail-top dl {
  margin: 0;
}
.fact {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.fact dt {
  color: var(--muted);
  font-size: 13px;
}
.fact dd {
  margin: 0;
}
.composition {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin: 16px 0 28px;
}
.composition section {
  padding: 18px;
  border-radius: var(--radius);
}
.composition h3 {
  color: var(--accent);
}
.flower-link {
  display: block;
  margin: 6px 0;
  padding: 9px 12px;
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13.5px;
}
.flower-link:hover {
  color: var(--text);
  background: #33294a;
}
.flower-event-info, .flower-points-editor, .panel {
  padding: 22px;
  margin: 0 0 24px;
  border-radius: var(--radius);
}
.flower-event-info h3 {
  color: var(--accent);
  margin-top: 6px;
}
.flower-event-info p {
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.flower-event-info .event-note {
  color: var(--faint);
  font-size: 12px;
}
.flower-points-editor {
  margin: 18px 0 0;
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.flower-points-editor label {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 13px;
}
.flower-points-editor input {
  width: 130px;
}
.flower-points-editor p {
  flex-basis: 100%;
  margin: 0;
}

/* Участники на странице «Отметка о турнире» */
#cards.status-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.participant-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.member-medallion {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4a3566, #2a1f3a);
  border: 1px solid var(--line-strong);
  color: #ecdcff;
  font: 16px var(--font-display);
}
.participant-card > .way {
  margin: 0;
}
.participant-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin: 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.participant-status.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.participant-status.finished {
  background: var(--success-bg);
  color: var(--success);
}
.participant-card.is-finished {
  background: linear-gradient(180deg, #151a1b, var(--surface));
}
.participant-card > .primary {
  margin-top: auto;
}
.participant-card .primary:not(.done) {
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  --cs: 14px;
}
.participant-card .primary:not(.done):hover {
  background: #33294a;
}
.tournament-preferences {
  display: grid;
  gap: 10px;
  margin: 4px 0 6px;
}
.tournament-choice {
  display: grid;
  gap: 4px;
}
.tournament-choice-heading {
  color: var(--muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.tournament-choice p {
  margin: 0;
  font-size: 13.5px;
}
.tournament-choice small {
  color: var(--faint);
  font-size: 11.5px;
}
.tournament-choice details {
  border-radius: var(--radius-s);
  box-sizing: border-box;
}
.tournament-choice summary {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13.5px;
  list-style: none;
  position: relative;
  padding-right: 30px;
}
.tournament-choice summary::-webkit-details-marker {
  display: none;
}
.tournament-choice summary::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -4px;
  border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg);
}
.tournament-choice details[open] summary::after {
  transform: rotate(-135deg);
  margin-top: -1px;
}
.tournament-choice-options button {
  padding: 8px 10px;
  border-radius: 6px;
  text-align: left;
  font-size: 13px;
  color: var(--text-2);
}
.tournament-choice-options button:hover {
  background: var(--surface-3);
  color: var(--text);
}
.tournament-choice-options button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}
.tournament-filters {
  padding: 12px;
  border-radius: var(--radius);
  align-items: flex-end;
}
.tournament-filters > .way {
  flex-basis: 100%;
  margin: 0;
}

/* Цветы гильдии */
.collection-toolbar, .collection-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
}
.collection-controls .collection-status-filter {
  flex: 0 1 280px;
}
.member-directory {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.member-choice:hover {
  background: var(--surface-2);
  transform: translateY(-1px);
}
.member-choice span {
  color: var(--muted);
  font-size: 12.5px;
}
.multi-member-collection {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
#guildTable h3 {
  font: 26px var(--font-display);
  margin: 0 0 4px;
}
.collection-flowers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}
.collection-flower {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px 10px;
  padding: 12px 14px;
  border-radius: var(--radius-s);
}
.collection-flowers.with-pictures .collection-flower {
  grid-template-columns: 56px 1fr auto;
}
.collection-flower img, .collection-no-image {
  grid-row: span 2;
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: grid;
  place-items: center;
  color: var(--faint);
}
.collection-flower-name a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.collection-flower-name a:hover {
  color: var(--accent);
}
.collection-points {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.collection-flower .collection-status {
  grid-column: 1 / -1;
}
.collection-flowers.with-pictures .collection-flower .collection-status {
  grid-column: 2 / -1;
}
span.collection-status {
  font-size: 12.5px;
  color: var(--muted);
}
span.collection-status.ready {
  color: var(--success);
}
span.collection-status.breeding {
  color: var(--warning);
}
select.collection-status {
  min-height: 36px;
  padding: 6px 32px 6px 10px;
  font-size: 13px;
}
.collection-source {
  margin-top: 18px;
  color: var(--faint);
  font-size: 12.5px;
}
.guild-table-scroll {
  max-height: 72vh;
  overflow: auto;
  border-radius: var(--radius);
}
#guildTable table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
  font-size: 13px;
}
#guildTable caption {
  padding: 12px;
  text-align: left;
  color: var(--muted);
  background: var(--surface);
}
#guildTable th, #guildTable td {
  min-width: 96px;
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: var(--bg-2);
}
#guildTable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-3);
  font-weight: 600;
}
#guildTable tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 200px;
  max-width: 260px;
  text-align: left;
  background: var(--surface);
  font-weight: 500;
}
#guildTable thead th:first-child {
  left: 0;
  z-index: 3;
}
#guildTable td.ready {
  color: var(--success);
  background: #13201a;
  font-weight: 700;
}
#guildTable td.breeding {
  color: var(--warning);
  background: #221c12;
}

/* Объявления */
.announcement-text {
  margin: 12px 0 20px;
  min-height: 110px;
  border-radius: var(--radius);
  line-height: 1.7;
  overflow-wrap: anywhere;
  font-size: 17px;
  padding: 30px 34px;
}
.announcement-text h2, .announcement-text h3 {
  font-family: var(--font-display);
  font-weight: 400;
}
.announcement-text p {
  margin: 0 0 1em;
}
.announcement-text ul, .announcement-text ol {
  padding-left: 24px;
}
.announcement-text blockquote {
  margin: 0 0 1em;
  padding-left: 16px;
  border-left: 3px solid var(--accent);
  color: var(--text-2);
}
#announcements > .primary, .popup-create {
  margin: 0 10px 10px 0;
}
.announcement-archive {
  margin-top: 18px;
  padding: 6px 18px;
  border-radius: var(--radius);
}
.announcement-archive > summary, .announcement-archive-item > summary {
  padding: 12px 0;
  cursor: pointer;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.announcement-archive-item {
  border-top: 1px solid var(--line);
}
.announcement-archive-item > summary {
  font-weight: 500;
  color: var(--text-2);
}
.announcement-archive-item .announcement-text {
  margin: 4px 0 12px;
  min-height: 0;
  background: var(--bg-2);
}
.archive-delete {
  display: inline-flex;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: var(--radius-s);
  margin-bottom: 12px;
}
.archive-result, .popup-history-error, .notice-skip-error, #popupNoticeError {
  color: var(--danger);
}
.popup-history-status {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
}
.editor-toolbar {
  position: sticky;
  top: calc(var(--topbar) + 8px);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(30, 24, 41, .95);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.editor-toolbar select {
  flex: 0 1 150px;
  width: auto;
  min-width: 120px;
  min-height: 38px;
}
.editor-toolbar button, #announcementLink {
  min-width: 38px;
  min-height: 38px;
  padding: 6px 10px;
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 13px;
}
.editor-toolbar button:hover {
  background: #33294a;
  color: var(--text);
}
.editor-color {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.editor-color input {
  width: 40px;
  min-height: 38px;
}
.announcement-editor {
  min-height: 280px;
  outline: none;
}
.announcement-editor:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.editor-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.popup-editor-help {
  padding: 16px 18px;
  border-radius: var(--radius);
}
.popup-editor-help h3 {
  margin-top: 0;
}

/* Участники и доступы */
.admin-page {
  margin-top: 8px;
}
.admin-page h2 {
  font-size: 26px;
}
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}
.form-row > input, .form-row > select {
  flex: 1 1 200px;
  width: auto;
}
.form-row > button {
  flex: none;
}
.result-line {
  min-height: 1.4em;
  margin: 10px 0 0;
  color: var(--accent);
}
.admin-members {
  margin: 0 0 8px;
  padding: 22px;
  border-radius: var(--radius);
}
.admin-members .way {
  margin-bottom: 8px;
}
.admin-members h3 {
  font-size: 18px;
}
.download-link {
  margin: 4px 0 8px;
}
.access-visit-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0 12px;
  color: var(--muted);
  font-size: 13px;
}
.access-visit-filter select {
  width: auto;
  min-width: 200px;
}
#accountsList {
  display: grid;
  gap: 8px;
}
.account-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
}
.account-row > div {
  flex: 1 1 260px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.account-row > select {
  width: 150px;
  flex: none;
}
.account-row strong {
  font-size: 15px;
}
.account-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}
.account-row select {
  min-height: 38px;
}
.account-row button {
  min-height: 38px;
  padding: 7px 12px;
  font-size: 13px;
}
.account-row-readonly {
  grid-template-columns: 1fr;
}
.account-password {
  color: var(--text);
  background: var(--bg-2);
  padding: 1px 6px;
  border-radius: 4px;
  user-select: all;
}

/* Уведомления (тосты) */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  display: grid;
  gap: 8px;
  width: min(480px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}
.toast, #serverFlowerNotice {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-l);
  font-size: 14px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  animation: none;
  touch-action: pan-y;
  will-change: transform, opacity;
}
.toast-error {
  border-color: rgba(242, 155, 176, .5);
}
.toast-error::before {
  content: "!";
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--danger);
  color: #2a0f17;
  font-weight: 800;
  font-size: 13px;
}
.toast-success::before {
  content: "✓";
  color: var(--success);
  font-weight: 800;
}
.toast.leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s, transform .35s var(--spring);
}
.toast-close {
  margin-left: auto;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
}
#serverFlowerNotice {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 200;
  width: max-content;
  max-width: min(520px, 90vw);
  margin: 0;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.scroll-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 25;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: var(--text);
  background: var(--glass-thin) !important;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge) !important;
}
.scroll-top:hover {
  background: #3a2f52;
}

/* ---------- 6. Диалоги ---------- */
dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 26px;
  border-radius: var(--radius-l);
  color: var(--text);
  line-height: 1.65;
}
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
dialog h2 {
  font-size: 28px;
  margin-bottom: 14px;
}
dialog p {
  color: var(--text-2);
}
.dialog-actions, dialog > .primary {
  margin-top: 10px;
}
#announcementNotice button, #popupNotice > button {
  margin: 8px 8px 0 0;
}
#announcementNotice .announcement-later, .skip-all-notices {
  background: var(--surface-3);
  color: var(--text-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
#announcementNotice .announcement-later:hover, .skip-all-notices:hover {
  background: #33294a;
  color: var(--text);
}
#popupNotice {
  width: min(720px, calc(100vw - 32px));
}
#popupNotice .announcement-text {
  max-height: 55vh;
  overflow-y: auto;
  min-height: 0;
}
.form-dialog label {
  display: block;
  margin: 6px 0;
  color: var(--muted);
  font-size: 13px;
}
.form-dialog .primary, .form-dialog .how {
  margin-top: 10px;
}

/* Обучение и помощь */
.nyx-help-dialog {
  position: fixed;
  inset: auto 24px 24px auto;
  margin: 0;
  width: min(460px, calc(100vw - 32px));
  max-height: 70dvh;
  overflow: auto;
  z-index: 1000;
}
.nyx-help-dialog::backdrop {
  background: rgba(6, 4, 10, .4);
  backdrop-filter: none;
}
.nyx-help-dialog > small {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: .04em;
}
.nyx-help-dialog h2 {
  font-size: 26px;
  margin: 6px 0 10px;
}
.nyx-help-dialog h3 {
  font-size: 16px;
  margin: 14px 0 4px;
}
.nyx-help-dialog .help-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.nyx-help-dialog .help-actions button, .nyx-help-dialog > .help-actions button {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--radius-s);
  font-weight: 600;
}
.nyx-help-dialog .help-actions .help-secondary {
  background: var(--surface-3);
  color: var(--text-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.nyx-help-dialog summary {
  padding: 10px 0;
  cursor: pointer;
  font-weight: 600;
  border-top: 1px solid var(--line);
}
.nyx-help-dialog .help-error {
  color: var(--danger);
}
.nyx-help-highlight {
  outline: 3px solid var(--gold) !important;
  outline-offset: 5px !important;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(6, 4, 10, .0), 0 0 30px rgba(232, 199, 125, .35) !important;
}
.nyx-help-context {
  outline: 2px solid var(--accent) !important;
  outline-offset: 5px !important;
}

/* ---------- Мобильная навигация ---------- */
.mobile-nav {
  display: none;
}

/* ---------- 7. Адаптив ---------- */
@media (max-width: 1180px) {
  .overview {
    grid-template-columns: 1fr 1fr;
  }
  .my-status {
    grid-column: 1 / -1;
  }
}
@media (max-width: 991.98px) {
  :root {
    --topbar: 58px;
  }
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .sync-pill {
    order: 3;
    left: 0;
    right: 0;
    top: 100%;
    border-radius: 0;
    position: static;
    text-align: left;
    display: block;
  }
  .footer {
    display: none;
  }
  .mobile-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.15;
    font-family: var(--font);
    border-radius: 18px !important;
    padding: 7px 2px 6px !important;
    gap: 4px !important;
    font-size: 10.5px !important;
    flex: 1 1 0 !important;
    min-width: min-content !important;
    padding-left: 2px !important;
    padding-right: 2px !important;
  }
  .mobile-nav button span {
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: normal;
    text-align: center;
    overflow: visible;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }
  .scroll-top {
    right: 14px;
    width: 42px;
    height: 42px;
    bottom: calc(92px + env(safe-area-inset-bottom)) !important;
  }
  .nyx-help-dialog {
    inset: auto 12px calc(84px + env(safe-area-inset-bottom)) 12px;
    width: auto;
    max-height: 55dvh;
    padding: 18px;
  }
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
    display: grid !important;
    grid-template-columns: auto 1fr auto auto;
    grid-template-areas: "brand . portrait profile" "sync sync sync sync";
    align-items: center;
    row-gap: 6px;
    padding: calc(8px + env(safe-area-inset-top)) 14px 8px !important;
  }
  .brand-compact {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .brand-compact .brand-moon {
    font-size: 40px;
  }
  main {
    padding-top: 16px;
    padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important;
  }
  .mobile-nav button + button::before {
    content: "";
    position: absolute;
    left: 0;
    top: 18%;
    bottom: 18%;
    width: 1px;
    background: linear-gradient(transparent, rgba(190, 150, 245, .45), transparent);
  }
  .mobile-nav button.active::before, .mobile-nav button.active + button::before {
    display: none;
  }
}
@media (max-width: 640px) {
  .overview {
    gap: 10px;
    margin-bottom: 22px;
    grid-template-columns: 1fr 1fr;
  }
  h2 {
    font-size: 24px;
  }
  .checkbox-filter, .tournament-multi {
    flex-basis: calc(50% - 5px);
  }
  .catalog-filters select {
    flex: 1 1 100%;
  }
  #catalogWay, .status-member-search {
    flex-basis: 100%;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  #cards.status-grid, .member-directory, .collection-flowers {
    grid-template-columns: 1fr;
  }
  .picture {
    height: 132px;
  }
  .picture img {
    height: 112px;
  }
  .way {
    font-size: 11.5px;
  }
  .points {
    top: 8px;
    right: 8px;
    font-size: 10.5px;
    padding: 2px 7px;
  }
  .compact .card {
    grid-template-columns: 70px minmax(0, 1fr);
    padding: 11px 12px;
    gap: 10px;
  }
  .compact .card-body {
    display: block;
  }
  .compact .need {
    margin-top: 8px;
  }
  .detail-top {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 18px;
  }
  .detail-art {
    min-height: 200px;
  }
  .detail-art img {
    height: auto;
    max-height: 220px;
  }
  .account-row > div {
    flex-basis: 100%;
  }
  .account-row > select, .account-row > button {
    flex: 1 1 calc(50% - 5px);
  }
  .editor-toolbar {
    position: static;
  }
  .nickname-preference {
    margin-left: 0;
    font-size: 12.5px;
  }
  .nyx-help-tools [data-help-page]::after {
    content: "Эта страница";
    font-size: 12px;
    margin-left: 6px;
    display: none;
  }
  #listTools > * {
    flex: 1 1 auto;
  }
  .view-toggle {
    width: 100%;
  }
  .profile .name {
    display: none;
  }
  .hero p {
    max-width: 70%;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  button.is-pressed,
  .card.is-pressed,
  .nav-link.is-pressed,
  summary.is-pressed,
  .logout.is-pressed,
  button:active,
  .primary:active:not(:disabled) {
    transform: none !important;
  }
  .card:hover {
    transform: none !important;
  }
  .nav-indicator {
    transition: none !important;
  }
  .placeholder-glow .placeholder {
    animation: none;
  }
}

/* ---------- 5. Отдельные страницы: вход и каталог событий ---------- */
.login-page {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px 16px;
  background: linear-gradient(90deg, rgba(8, 6, 14, .25), rgba(8, 6, 14, .82) 38%, rgba(8, 6, 14, .82) 62%, rgba(8, 6, 14, .25)), url("brand/login-cartoon-garden.webp") center / cover no-repeat fixed, var(--bg);
}
.login-card {
  width: min(420px, 100%);
  padding: 34px 30px 28px;
  border-radius: 22px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-align: left;
}
.login-card h1 {
  margin: 0;
}
.login-card .login-sub {
  margin: 4px 0 4px;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-2);
}
.login-card .opg-slogan {
  margin: 14px 0 22px;
  color: var(--accent);
  font: 18px/1.35 var(--font-display);
}
.login-card label {
  display: block;
  margin: 14px 0 6px;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
}
.login-card .password-field {
  position: relative;
}
.login-card .password-field input {
  padding-right: 48px;
}
.toggle-password {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: var(--muted);
}
.toggle-password:hover {
  color: var(--text);
}
.login-card button[type="submit"] {
  width: 100%;
  margin-top: 22px;
  min-height: 48px;
  font-size: 15px;
}
.login-error {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 16px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  background: var(--danger-bg);
  color: #ffc6d3;
  font-size: 13.5px;
}
.login-wrap {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
.login-page .page-tools {
  justify-content: center;
  margin: 0;
  display: block;
  margin-top: 18px;
}
.events-page main {
  max-width: 1100px;
}
.events-header {
  padding: 26px var(--gutter) 0;
  max-width: 1100px;
  margin: 0 auto;
}
.events-header .crumbs {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.events-header .crumbs a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.events-header .crumbs a:hover {
  color: var(--accent);
}
.events-tools {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 0;
  background: linear-gradient(var(--bg) 80%, transparent);
}
.events-tools .search {
  flex: 1 1 260px;
}
.events-tools select {
  flex: 0 1 220px;
  width: auto;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.event-card {
  margin-bottom: 14px;
  padding: 22px;
  border-radius: var(--radius);
}
.event-card h2 {
  font-size: 26px;
  margin: 8px 0 6px;
}
.event-card h3 {
  color: var(--accent);
  font-size: 15px;
  margin: 16px 0 6px;
}
.event-card ul {
  padding-left: 20px;
  margin: 0;
  color: var(--text-2);
}
.event-card details {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.event-card summary {
  cursor: pointer;
  font-weight: 600;
}
.badge {
  display: inline-block;
  margin: 0 6px 4px 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 12px;
  --bs-badge-font-size: 11.5px;
  --bs-badge-font-weight: 600;
  --bs-badge-padding-x: 9px;
  --bs-badge-padding-y: 3px;
  --bs-badge-border-radius: 999px;
  --bs-badge-color: inherit;
}
.badge.incomplete {
  background: var(--warning-bg);
  color: var(--warning);
}
.chip.listed {
  background: var(--success-bg);
  color: var(--success);
  border-color: rgba(134, 214, 168, .35);
  text-decoration: none;
}
.chip.unlisted {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(242, 155, 176, .35);
  text-decoration: none;
}
.muted {
  color: var(--muted);
}
#count {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 13.5px;
}

/* =========================================================================
   ЧАСТЬ B. Тема «Ночной сад»: орнаментальные рамки, серебряно-лиловые заголовки,
   иллюстрированный фон, разделы страниц и дополнения
   ========================================================================= */
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  font-size: 15.5px;
  background: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(7, 5, 12, .55), rgba(7, 5, 12, .9) 70%), linear-gradient(rgba(7, 5, 12, .55), rgba(7, 5, 12, .55)), url("brand/login-cartoon-garden.webp") center top / cover no-repeat fixed, var(--bg);
  font-family: var(--font);
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}
small,
.chip,
.points,
.sync-pill,
input,
select,
textarea,
.checkbox-options,
.tournament-multi-options,
#guildTable,
.account-password,
.stat-unit,
.participant-status,
.popup-history-status,
.badge {
  font-family: var(--font-ui);
}

/* Металлический заголовок */
.hero h1,
.section-top h2,
.detail-top h1,
.brand-text b,
.login-card h1,
.admin-page h2,
dialog h2,
.event-card h2 {
  background: var(--metal);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(180, 120, 255, .45)) drop-shadow(0 2px 1px rgba(0, 0, 0, .6));
  text-shadow: none;
}

/* Универсальная орнаментальная рамка */
.stat,
.filters,
.tournament-filters,
.card,
.member-choice,
.collection-flower,
.panel,
.admin-members,
.announcement-text,
.announcement-archive,
.obtaining-guide-link,
.account-row,
.composition section,
.flower-event-info,
.flower-points-editor,
.detail-top,
.event-card,
.sync-bar,
.view-toggle,
.nyx-help-tools button,
.logout,
dialog,
.login-card,
.empty,
#empty,
.guild-table-scroll,
.popup-editor-help {
  background: var(--orn), var(--panel);
  border: 1px solid rgba(200, 165, 250, .45);
  box-shadow: var(--frame-shadow);
}
.stat,
.panel,
.announcement-text,
.detail-top,
.event-card,
dialog,
.login-card,
.flower-event-info,
.admin-members {
  --cs: 42px;
}
.card, .filters, .member-choice, .account-row, .obtaining-guide-link {
  --cs: 30px;
}
.nyx-help-tools button, .view-toggle, .sync-bar {
  --cs: 26px;
}
.panel, .announcement-text, .detail-top, .admin-members, .obtaining-guide-link, .filters {
  background: var(--gem), var(--orn), var(--panel);
}

/* Поля ввода и выпадающие списки — тоже в рамке */
input,
textarea,
.checkbox-filter > summary,
.tournament-multi > summary,
.tournament-choice details {
  background: var(--orn), rgba(10, 6, 17, .9);
  --cs: 14px;
  border: 1px solid rgba(170, 125, 235, .35);
  box-shadow: inset 0 0 14px rgba(110, 50, 190, .18);
}
input:focus,
select:focus,
textarea:focus,
.checkbox-filter[open] > summary,
.tournament-multi[open] > summary {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 18px rgba(164, 101, 242, .35), inset 0 0 14px rgba(110, 50, 190, .25);
}
.checkbox-options, .tournament-multi-options {
  border-color: var(--line-strong);
}

/* Кнопки */
.primary {
  background: var(--orn), linear-gradient(180deg, #8a4be0, #5a2a9e 60%, #44207a);
  --cs: 16px;
  color: #f7eeff;
  border: 1px solid rgba(220, 190, 255, .55);
  box-shadow: 0 0 18px rgba(150, 80, 240, .45), inset 0 1px 0 rgba(255, 255, 255, .25);
  font-family: var(--font);
}
.primary:hover:not(:disabled) {
  background: var(--orn), linear-gradient(180deg, #9a5cf0, #6631b0 60%, #4f2590);
  color: #fff;
}
.primary.done {
  box-shadow: inset 0 0 0 1px rgba(134, 214, 168, .35);
  border-color: rgba(134, 214, 168, .45);
  background: var(--orn), linear-gradient(180deg, #2a3d33, #17241d);
  color: var(--success);
}
.secondary,
.how,
#clearCatalog,
#resetTournamentFilters,
#resetTournamentSelection,
#resetGuildSelection,
[data-own-collection] {
  background: var(--orn), linear-gradient(180deg, rgba(40, 24, 62, .9), rgba(18, 11, 29, .9));
  --cs: 14px;
  border: 1px solid rgba(180, 135, 240, .4);
  color: var(--text);
  font-family: var(--font);
  font-weight: 500;
  box-shadow: inset 0 0 12px rgba(120, 60, 200, .2);
}
.secondary:hover:not(:disabled),
.how:hover:not(:disabled),
#clearCatalog:hover,
#resetTournamentFilters:hover,
#resetTournamentSelection:hover,
#resetGuildSelection:hover,
[data-own-collection]:hover {
  background: var(--orn), linear-gradient(180deg, rgba(64, 38, 98, .95), rgba(28, 17, 44, .95));
  border-color: var(--line-strong);
}
#resetTournamentFilters::before,
#resetTournamentSelection::before,
#resetGuildSelection::before,
#clearCatalog::before {
  content: "↻";
  font-size: 17px;
  color: var(--accent);
}
.danger-ghost, .archive-delete, #accountsList .remove-member {
  background: var(--orn), rgba(40, 14, 26, .7);
  --cs: 14px;
}

/* ---------- Боковое меню (ПК) ---------- */
.sidebar {
  background: linear-gradient(90deg, rgba(10, 6, 16, .95), rgba(12, 7, 20, .88)), url("brand/peony.webp") left 4px bottom 10px / auto 300px no-repeat;
  background-blend-mode: normal;
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 30px rgba(0, 0, 0, .4);
}
.sidebar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 240px;
  pointer-events: none;
  background: url("brand/peony-r.webp") right 4px bottom 10px / auto 300px no-repeat;
  opacity: .55;
}
.brand {
  padding-top: 18px;
}
.brand::before {
  content: "";
  position: absolute;
  left: 64px;
  top: -6px;
  width: 34px;
  height: 22px;
  background: url("brand/ornaments/crown.svg") center / contain no-repeat;
  filter: drop-shadow(0 0 6px var(--glow));
}
.brand-compact::before {
  left: 46px;
  top: -4px;
  width: 26px;
  height: 17px;
}
.brand-moon {
  display: grid;
  place-items: center;
  width: auto;
  height: auto;
  line-height: 1;
  text-shadow: 0 0 14px rgba(190, 130, 255, .9), 0 0 2px #fff;
  background: none;
  box-shadow: none;
  border-radius: 0;
  font-size: 48px;
  color: #e6d2ff;
}
.brand-text small {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
}
.side-nav button {
  min-height: 50px;
  padding: 10px 14px;
  font-size: 15px;
  color: var(--text-2);
  border: 1px solid rgba(150, 110, 210, .2);
  background: rgba(16, 10, 26, .7);
  border-radius: 10px;
}
.side-nav button svg {
  color: var(--accent);
  width: 22px;
  height: 22px;
}
.side-nav button:hover {
  background: var(--orn), rgba(36, 22, 56, .85);
  --cs: 14px;
  border-color: var(--line-strong);
  color: var(--text);
}
.side-nav button.active {
  --cs: 16px;
  background: var(--orn), linear-gradient(180deg, rgba(120, 60, 200, .55), rgba(60, 28, 104, .7));
  border-color: rgba(220, 190, 255, .7);
  color: #fff;
  box-shadow: 0 0 22px rgba(160, 90, 255, .5), inset 0 0 16px rgba(200, 150, 255, .25);
}
.side-nav button.active svg {
  color: #fff;
  filter: drop-shadow(0 0 6px #c79bff);
}
.sidebar-motto {
  color: var(--accent);
  border-top: 0;
  font-size: 19px;
}

/* ---------- Верхняя панель ---------- */
.topbar {
  padding-top: 10px;
  padding-bottom: 10px;
  box-shadow: none !important;
}
.sync-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
  max-width: 760px;
  padding: 8px 18px 8px 10px;
  border-radius: 12px;
}
.sync-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font: 700 15px var(--font-ui);
  box-shadow: 0 0 10px var(--glow);
}
.sync-pill {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 13.5px;
}
.sync-pill::before {
  display: none;
}
.sync-pill.has-error {
  color: var(--warning);
}
.avatar {
  background: radial-gradient(circle at 40% 35%, #3a2160, #140b22);
  border: 1.5px solid rgba(220, 190, 255, .7);
  box-shadow: 0 0 0 4px rgba(20, 12, 32, .9), 0 0 0 5px rgba(180, 130, 240, .45), 0 0 18px var(--glow);
  font: 600 20px var(--font);
  color: #f1e2ff;
}
.logout {
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
}

/* ---------- Шапка страницы (герой) ---------- */
.hero {
  padding: 40px clamp(22px, 4vw, 52px) 44px;
  --cs: 34px;
  border: 1px solid var(--line-strong);
  box-shadow: 0 0 40px rgba(130, 60, 220, .25), inset 0 0 40px rgba(0, 0, 0, .5);
}
.hero::after {
  display: none;
}
.eyebrow {
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.hero h1 {
  margin: 14px 0 6px;
  background-size: 100% 1.08em;
}
.section-top h2 {
  background-size: 100% 1.12em;
  margin: 0;
}
.detail-top h1, .admin-page h2, dialog h2, .event-card h2, .login-card h1 {
  background-size: 100% 1.2em;
  line-height: 1.2;
}
.flourish {
  display: block;
  width: min(320px, 80%);
  height: 26px;
  margin: 4px 0 14px;
  background: url("brand/ornaments/flourish.svg") left center / contain no-repeat;
  filter: drop-shadow(0 0 6px var(--glow));
}
.hero p {
  color: var(--text-2);
}

/* ---------- Кнопки помощи ---------- */
.page-tools {
  flex-wrap: wrap;
  display: grid;
  align-items: center;
  gap: 14px;
  grid-template-columns: 1fr auto;
  margin-bottom: 18px;
}
.nyx-help-tools {
  flex-wrap: wrap;
  display: grid;
  gap: 14px;
  max-width: 760px;
  grid-template-columns: 1fr 1fr;
}
.nyx-help-tools button {
  min-height: 60px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 16px;
  color: var(--text);
  --cs: 20px;
}
.nyx-help-tools button:hover {
  border-color: var(--line-strong);
  box-shadow: var(--frame-shadow), 0 0 18px rgba(150, 80, 240, .35);
}
.nyx-help-tools [data-help-page]::before {
  width: 32px;
  font: 600 18px var(--font);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  box-shadow: 0 0 10px var(--glow);
}
.nyx-help-tools [data-help-all]::before {
  content: "";
  width: 32px;
  height: 32px;
  flex: none;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M12 6c-2-1.5-5-2-8-1.5v13c3-.5 6 0 8 1.5 2-1.5 5-2 8-1.5v-13C17 4 14 4.5 12 6zM12 6v13'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M12 6c-2-1.5-5-2-8-1.5v13c3-.5 6 0 8 1.5 2-1.5 5-2 8-1.5v-13C17 4 14 4.5 12 6zM12 6v13'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 0 4px var(--glow));
}
.nickname-preference {
  font-family: var(--font);
  color: var(--text-2);
}

/* ---------- Заголовок раздела с короной и цветами ---------- */
.section-top {
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  display: block;
  text-align: center;
  padding: 34px 120px 14px;
  margin-bottom: 18px;
  background: url("brand/peony.webp") left 6% center / auto 112% no-repeat, url("brand/peony-r.webp") right 6% center / auto 112% no-repeat;
}
.section-top::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 52px;
  height: 32px;
  transform: translateX(-50%);
  background: url("brand/ornaments/crown.svg") center / contain no-repeat;
  filter: drop-shadow(0 0 8px var(--glow));
}
.section-top h2::after {
  content: "";
  display: block;
  width: min(440px, 100%);
  height: 14px;
  margin: 6px auto 0;
  background: url("brand/ornaments/divider.svg") center / 100% 100% no-repeat;
  filter: drop-shadow(0 0 5px var(--glow));
}
body:not([data-page="tournament"]) .section-top h2 {
  display: block;
}
.section-top p {
  margin-top: 12px;
  color: var(--text-2);
}
.section-top > div {
  max-width: 760px;
  margin: 0 auto;
  min-width: 0;
}

/* ---------- Статистика ---------- */
.stat {
  position: relative;
  padding: 22px 24px;
  border-radius: 14px;
}
.stat::before {
  content: "";
  display: block;
  width: 26px;
  height: 26px;
  margin-bottom: 8px;
  background: var(--accent);
  filter: drop-shadow(0 0 6px var(--glow));
}
.stat-crown::before {
  -webkit-mask: url("brand/ornaments/crown.svg") center / contain no-repeat;
  mask: url("brand/ornaments/crown.svg") center / contain no-repeat;
  background: #e6d0ff;
  width: 34px;
}
.stat-flower::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3Cpath d='M12 9.5C10 7 10 4 12 3c2 1 2 4 0 6.5zM14.5 12c2.5-2 5.5-2 6.5 0-1 2-4 2-6.5 0zM12 14.5c2 2.5 2 5.5 0 6.5-2-1-2-4 0-6.5zM9.5 12C7 14 4 14 3 12c1-2 4-2 6.5 0z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3Cpath d='M12 9.5C10 7 10 4 12 3c2 1 2 4 0 6.5zM14.5 12c2.5-2 5.5-2 6.5 0-1 2-4 2-6.5 0zM12 14.5c2 2.5 2 5.5 0 6.5-2-1-2-4 0-6.5zM9.5 12C7 14 4 14 3 12c1-2 4-2 6.5 0z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.my-status::before {
  display: none;
}
.stat small {
  font-family: var(--font);
  font-size: 15px;
  color: var(--text-2);
}
.stat strong {
  font-size: 44px;
  color: #fff;
}
.stat-unit {
  font: 500 18px var(--font);
  color: var(--accent);
}
.stat p {
  color: var(--muted);
}
.stat-crown, .stat-flower {
  background: var(--orn), url("brand/peony-r.webp") right 8px center / auto 88% no-repeat, var(--panel);
}
.my-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: var(--orn), url("brand/peony-r.webp") right 8px center / auto 88% no-repeat, var(--panel);
}
.status-emblem {
  flex: none;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 1.5px solid rgba(220, 190, 255, .65);
  box-shadow: 0 0 0 5px rgba(20, 12, 32, .9), 0 0 0 6px rgba(180, 130, 240, .4), 0 0 20px var(--glow);
  background: radial-gradient(circle, #2c1848, #120a1e);
  display: grid;
  place-items: center;
}
.status-emblem::before {
  content: "☾";
  font-size: 36px;
  color: #e6d2ff;
  text-shadow: 0 0 12px rgba(190, 130, 255, .9);
}
.my-status > div {
  flex: 1;
}
.my-status small {
  font-size: 20px;
  color: #fff;
}
.my-status strong {
  color: var(--accent);
  font: 500 17px var(--font);
}
#finish {
  min-width: 240px;
  min-height: 48px;
  font-size: 16px;
}
#finish::before {
  content: "🏆";
  filter: grayscale(1) brightness(2) drop-shadow(0 0 3px #fff);
  font-size: 15px;
}

/* ---------- Переключатель вида, фильтры ---------- */
.view-toggle {
  display: inline-flex;
  gap: 2px;
  border-radius: 12px;
  padding: 4px;
  position: relative;
  isolation: isolate;
}
.view-toggle button {
  min-height: 44px;
  padding: 8px 22px;
  font-size: 15px;
  color: var(--text-2);
  border-radius: 9px;
}
.view-toggle button[aria-pressed="true"] {
  background: var(--orn), linear-gradient(180deg, #8a4be0, #4e2391);
  --cs: 14px;
  color: #fff;
  box-shadow: 0 0 16px rgba(150, 80, 240, .5), inset 0 0 0 1px rgba(230, 200, 255, .5);
}
.filters {
  border-radius: 14px;
  padding: 14px;
  --cs: 20px;
}
.search svg {
  color: var(--accent);
}

/* ---------- Карточки ---------- */
.card {
  --rarity: #9a90ad;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-radius: 14px;
  --bs-card-bg: transparent;
  --bs-card-border-color: rgba(200, 165, 250, .45);
  --bs-card-border-radius: 14px;
  --bs-card-inner-border-radius: 13px;
  --bs-card-spacer-y: 0;
  --bs-card-spacer-x: 0;
  --bs-card-color: inherit;
  word-wrap: normal;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--frame-shadow), 0 0 26px rgba(150, 80, 240, .3);
  border-color: var(--line-strong);
}
.picture {
  background: radial-gradient(closest-side, color-mix(in srgb, var(--rarity) 30%, transparent), transparent 85%);
}
.points {
  font-family: var(--font-ui);
  background: rgba(20, 10, 34, .85);
  border-color: rgba(200, 160, 250, .55);
}
.chip {
  background: rgba(60, 36, 92, .6);
  border-color: rgba(170, 125, 235, .25);
  color: #eadcff;
}
.need {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(170, 125, 235, .25);
}
.member-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  min-height: 76px;
  text-align: left;
  border-radius: 12px;
  --cs: 18px;
}
.member-choice:hover {
  border-color: var(--line-strong);
}
.member-medallion {
  font-family: var(--font);
  border-color: rgba(220, 190, 255, .6);
  box-shadow: 0 0 10px var(--glow);
}
.participant-card .primary:not(.done) {
  background: var(--orn), linear-gradient(180deg, rgba(64, 36, 100, .95), rgba(30, 18, 48, .95));
}

/* ---------- Объявления ---------- */
.announcement-text {
  --cs: 32px;
  background: var(--orn), url("brand/peony-r.webp") right 10px center / auto 90% no-repeat, var(--panel);
}
.announcement-text h2,
.announcement-text h3,
.announcement-text b,
.announcement-text strong {
  color: var(--accent);
}
.announcement-meta {
  color: var(--accent);
  font-size: 14px;
}
.obtaining-guide-link {
  border-radius: 14px;
  --cs: 22px;
}
.obtaining-guide-link b {
  font-size: 17px;
  font-weight: 500;
}

/* ---------- Диалоги ---------- */
dialog {
  background: var(--orn), linear-gradient(180deg, #1d1130, #0f0919);
  --cs: 30px;
  border-color: var(--line-strong);
  box-shadow: 0 0 40px rgba(130, 60, 220, .35), var(--shadow-l);
}
.nyx-help-dialog .help-actions button, .nyx-help-dialog > .help-actions button {
  background: linear-gradient(180deg, #8a4be0, #4e2391);
  color: #fff;
  border: 1px solid rgba(220, 190, 255, .5);
}
.toast, #serverFlowerNotice {
  background: var(--orn), #1c112c;
  --cs: 16px;
}

/* ---------- Мобильная версия по референсам ---------- */
@media (max-width: 991.98px) {
  .brand-compact .brand-text b {
    font-size: 30px;
  }
  .brand-compact .brand-text small {
    font-size: 10px;
    letter-spacing: .28em;
  }
  .sync-bar {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }
  .sync-pill {
    background: none;
    border: 0;
    font-size: 12.5px;
    padding: 0;
  }
  .mobile-nav {
    position: fixed;
    z-index: 40;
    display: flex;
    justify-content: space-around;
    gap: 0;
    --cs: 22px;
    left: 10px !important;
    right: 10px !important;
    bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    padding: 6px !important;
    border-radius: 24px;
    background: var(--glass-thick) !important;
    backdrop-filter: var(--glass-blur-thick);
    -webkit-backdrop-filter: var(--glass-blur-thick);
    border: 1px solid var(--glass-edge) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .1) !important;
    isolation: isolate;
    column-gap: 2px !important;
  }
  .mobile-nav button {
    color: var(--text-2);
    position: relative;
  }
  .mobile-nav svg {
    color: var(--accent);
    width: 22px !important;
    height: 22px !important;
  }
  .mobile-nav button.active {
    color: #fff;
    background: var(--orn), linear-gradient(180deg, rgba(130, 70, 210, .6), rgba(60, 28, 104, .75));
    --cs: 14px;
    box-shadow: 0 0 18px rgba(160, 90, 255, .55), inset 0 0 0 1px rgba(220, 190, 255, .6);
  }
  .mobile-nav button.active svg {
    color: #fff;
    filter: drop-shadow(0 0 6px #c79bff);
  }
}
@media (max-width: 640px) {
  .logout span {
    display: inline;
  }
  .avatar {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .hero {
    grid-template-columns: 1fr;
    margin-bottom: 18px;
    min-height: 340px;
    padding: 26px 20px 30px;
  }
  .eyebrow {
    font-size: 11.5px;
  }
  .hero::after {
    width: 150px;
    height: 130px;
  }
  .page-tools {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .nyx-help-tools {
    flex-wrap: nowrap;
    min-width: 0;
    gap: 10px;
    grid-template-columns: 1fr 1fr;
  }
  .nyx-help-tools button {
    min-height: 58px;
    font-size: 14px;
    padding: 8px 10px;
    gap: 8px;
    white-space: normal;
    text-align: left;
  }
  .nyx-help-tools [data-help-page] {
    font-size: 14px;
    gap: 8px;
    padding: 8px 10px;
  }
  .nyx-help-tools [data-help-page]::before, .nyx-help-tools [data-help-all]::before {
    width: 28px;
    height: 28px;
  }
  .section-top {
    flex-direction: column;
    align-items: stretch;
    padding: 30px 46px 10px;
    background-size: auto 100%, auto 100%;
    background-position: left -6px center, right -6px center;
  }
  .stat strong {
    font-size: 34px;
  }
  .my-status {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .status-emblem {
    width: 60px;
    height: 60px;
  }
  .my-status small {
    font-size: 18px;
  }
  .my-status strong {
    font: 500 16px/1.3 var(--font);
  }
  #finish {
    flex-basis: 100%;
    min-width: 0;
  }
  .view-toggle button {
    flex: 1;
    padding: 8px 10px;
    font-size: 14px;
  }
}

/* Вход */
.login-page .nyx-help-tools {
  justify-content: center;
  margin-top: 16px;
  grid-template-columns: 1fr;
  gap: 8px;
}
.login-page .nyx-help-tools button {
  min-height: 46px;
  font-size: 14.5px;
  justify-content: flex-start;
}
.login-page .nyx-help-tools [data-help-page]::after {
  display: none;
}
.login-page .nyx-help-tools [data-help-page] {
  font-size: 14.5px;
  gap: 12px;
}
.login-card .brand-moon {
  width: 56px;
  height: 56px;
  margin: 0 0 4px;
  display: inline-block;
  font-size: 54px;
}
.login-card h1 {
  font-size: 56px;
  background-size: 100% 1.1em;
}

/* ---------- 9. Ведьмины шрифты ---------- */
.hero h1,
.section-top h2,
.detail-top h1,
.brand-text b,
.login-card h1,
.admin-page h2,
dialog h2,
.event-card h2,
.stat strong,
.composition h3,
.flower-event-info h2,
#guildTable h3,
.announcement-text h2 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: .02em;
}
.hero h1 {
  font-size: clamp(42px, 5.4vw, 70px);
}
.section-top h2 {
  font-size: clamp(36px, 4vw, 52px);
}
.brand-text b {
  line-height: 1;
  font-size: 40px;
}
.hero p,
.sidebar-motto,
.login-card .opg-slogan,
.section-top p,
.announcement-meta,
.stat p,
.my-status strong {
  font-family: var(--font-script);
  font-style: normal;
}
.hero p {
  font-size: 22px;
}
.section-top p {
  font-size: 20px;
}
.login-card .opg-slogan {
  font-size: 23px;
}
.my-status strong {
  font-size: 21px;
}
.stat p {
  font-size: 17px;
}
.eyebrow, .brand-text small, .login-card .login-sub {
  font-family: var(--font-display);
  letter-spacing: .26em;
}
.card h3, .member-choice strong, .participant-card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: .01em;
}

/* ---------- 10. Фон шапки для каждого раздела ---------- */
body[data-page="status"] .hero {
  --hero-img: url("brand/heroes/status.webp");
}
body[data-page="guild"] .hero {
  --hero-img: url("brand/heroes/guild.webp");
}
body[data-page="flowers"] .hero {
  --hero-img: url("brand/heroes/flowers.webp");
}
body[data-page="vases"] .hero {
  --hero-img: url("brand/heroes/vases.webp");
}
body[data-page="announcements"] .hero {
  --hero-img: url("brand/heroes/announcements.webp");
}
body[data-page="access"] .hero {
  --hero-img: url("brand/heroes/access.webp");
}
.hero, body[data-page] .hero {
  background: var(--orn), linear-gradient(90deg, rgba(9, 5, 14, .92) 0%, rgba(9, 5, 14, .55) 40%, rgba(9, 5, 14, 0) 62%), var(--hero-img) var(--hero-pos, center 62%) / var(--hero-size, cover) no-repeat, #09050e;
}
body[data-page="tournament"] .hero {
  --hero-pos: right center;
}
body[data-page="announcements"] .hero {
  --hero-pos: center 78%;
}
body[data-page="vases"] .hero {
  --hero-pos: center 70%;
}
body[data-page="status"] .hero,
body[data-page="guild"] .hero,
body[data-page="access"] .hero {
  --hero-pos: center 58%;
}
@media (max-width: 640px) {
  .hero, body[data-page] .hero {
    background: var(--orn), linear-gradient(90deg, rgba(9, 5, 14, .94) 0%, rgba(9, 5, 14, .7) 55%, rgba(9, 5, 14, .25) 100%), var(--hero-img) 72% center / cover no-repeat, #09050e;
  }
}

/* ---------- 11. ПК: картинка шапки целиком, масштаб от ширины экрана ---------- */
@media (min-width: 641px) {
  .hero, body[data-page] .hero {
    aspect-ratio: 2.6 / 1;
    min-height: auto;
    padding: clamp(22px, 2.6vw, 44px) clamp(22px, 3vw, 52px);
    background: var(--orn), /* картинка 3:2 занимает правые ~58% шапки целиком; затемнён только узкий край для плавного перехода */ linear-gradient(90deg, #09050e 0%, #09050e 41%, rgba(9, 5, 14, .6) 43.5%, rgba(9, 5, 14, 0) 48%), var(--hero-img) right center / auto 100% no-repeat, #09050e;
  }
  .hero {
    container-type: inline-size;
  }
  .hero-text {
    max-width: 40%;
  }
  .hero h1 {
    font-size: clamp(24px, 4.6cqi, 84px);
    margin: .3em 0 .1em;
  }
  .hero p {
    font-size: clamp(13px, 1.75cqi, 28px);
    line-height: 1.35;
  }
  .hero .eyebrow {
    font-size: clamp(9px, .85cqi, 15px);
    letter-spacing: .22em;
  }
  .flourish {
    width: 100%;
    max-width: 22cqi;
    height: 1.9cqi;
    min-height: 16px;
    margin: 2px 0 8px;
  }
}

/* ---------- 12. «Отметка о турнире»: выбор ответа на всю ширину, список поверх карточки ---------- */
.participant-card {
  padding: 18px;
  gap: 10px;
  overflow: visible;
}
.participant-card:has(details[open]) {
  z-index: 30;
}
.tournament-preferences, .tournament-choice {
  width: 100%;
}
.tournament-choice details {
  position: relative;
  display: block;
  width: 100%;
}
.tournament-choice details[open] {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-color: var(--accent-strong);
}
.tournament-choice-options {
  display: grid;
  gap: 4px;
  position: absolute;
  left: -1px;
  right: -1px;
  top: 100%;
  z-index: 40;
  padding: 6px;
  background: #170e24;
  border: 1px solid var(--accent-strong);
  border-top: 0;
  border-radius: 0 0 var(--radius-s) var(--radius-s);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .55), 0 0 18px rgba(150, 80, 240, .25);
}
.tournament-choice-options button {
  width: 100%;
  white-space: normal;
  line-height: 1.35;
}

/* Вид «Без картинок» (запоминается с других страниц) не меняет раскладку карточек участников */
#cards.status-grid.compact {
  gap: 16px;
}
.compact .participant-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 18px;
}
.account-role-label {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Ссылка «Мой образ» в меню (страница portrait.php) ---------- */
.side-nav a.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(232, 199, 125, .28);
  background: rgba(16, 10, 26, .7);
  color: var(--text-2);
  text-decoration: none;
  font-family: var(--font);
  font-size: 15px;
  transition: background .15s, color .15s, border-color .15s;
}
.side-nav a.nav-link:hover {
  background: var(--orn), rgba(36, 22, 56, .85);
  --cs: 14px;
  border-color: rgba(232, 199, 125, .6);
  color: var(--text);
}
.side-nav a.nav-link svg {
  color: var(--gold);
  width: 22px;
  height: 22px;
}
.portrait-top {
  display: none;
}
@media (max-width: 991.98px) {
  .portrait-top {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    min-height: 40px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(232, 199, 125, .45);
    background: rgba(16, 10, 26, .7);
    color: var(--gold);
    text-decoration: none;
    font-family: var(--font);
    font-size: 13px;
  }
  .portrait-top svg {
    width: 18px;
    height: 18px;
  }
  .topbar .brand-compact {
    grid-area: brand;
  }
  .topbar .portrait-top {
    grid-area: portrait;
    min-height: 36px;
    padding: 5px 11px;
    font-size: 12.5px;
  }
  .topbar .profile {
    grid-area: profile;
    margin-left: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .topbar .brand-compact .brand-moon {
    font-size: 32px;
  }
  .topbar .brand-compact .brand-text b {
    font-size: 25px;
  }
  .topbar .logout {
    min-height: 36px;
    padding: 6px 9px;
  }
  .topbar .logout span {
    display: none;
  }
  .topbar .sync-bar {
    grid-area: sync;
    padding: 5px 12px 5px 6px;
    gap: 8px;
    min-height: 0;
    max-height: 64px;
    overflow: hidden;
    transition: max-height .4s var(--spring), opacity .25s, padding .4s var(--spring), margin .4s var(--spring);
  }
  .topbar .sync-icon {
    width: 22px;
    height: 22px;
    font-size: 12px;
  }
  .topbar .sync-pill {
    font-size: 12px;
    line-height: 1.35;
  }
  body.scrolled-down .topbar .sync-bar {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: -6px;
    border-width: 0;
  }
  .mobile-nav button::before {
    display: none !important;
  }
  .toasts, #serverFlowerNotice {
    bottom: calc(96px + env(safe-area-inset-bottom)) !important;
  }
}
@media (max-width: 350px) {
  .portrait-top span {
    display: none;
  }
  .portrait-top {
    padding: 6px 10px;
  }
  .mobile-nav {
    column-gap: 0 !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
  }
}

/* ---------- Фото профиля: чиби-аватарка из теста «Твой образ в саду» ---------- */
.avatar.has-photo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: transparent;
  font-size: 0;
  text-decoration: none;
}
.avatar.has-photo:hover {
  box-shadow: 0 0 0 4px rgba(20, 12, 32, .9), 0 0 0 5px rgba(232, 199, 125, .7), 0 0 18px var(--glow);
}
.member-medallion.has-photo {
  width: 40px;
  height: 40px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1.5px solid rgba(232, 199, 125, .75);
}

/* Настройки копирования названий цветов (09.11.26) */
#tournamentCopy .copy-options {
  flex: 0 0 240px;
  width: 240px;
  max-width: 100%;
}
#tournamentCopy .copy-options > summary {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#tournamentCopy .copy-options input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  margin: 0;
  accent-color: var(--accent-strong);
  flex: 0 0 18px;
}

/* ---------- Нижнее меню: подписи не наезжают друг на друга (12.11.2026) ----------
   У админа 7 пунктов. Раньше все кнопки были строго одинаковой ширины,
   и длинное слово «Объявления» вылезало на соседний пункт «Доступы».
   Теперь кнопка не уже своего самого длинного слова, остальное место делится поровну. */
@media (max-width: 400px) {
  .mobile-nav button {
    font-size: 10px !important;
  }
}

/* ---------- «Доступы»: поиск, прежний ник, копирование входа (12.11.2026) ---------- */
.access-visit-filter .access-search {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 260px;
  color: var(--muted);
  font-size: 13px;
}
.access-visit-filter .access-search input {
  width: 100%;
}
.access-search-count {
  flex-basis: 100%;
  margin: 0;
}
.access-search-count:empty {
  display: none;
}
.account-row .account-previous {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}
.link-button {
  display: inline;
  min-height: 0;
  padding: 0;
  margin-left: 6px;
  background: none;
  border: 0;
  color: var(--danger);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-button:hover {
  color: #ffc6d3;
}
.link-button:disabled {
  opacity: .5;
  cursor: default;
}
.account-row .account-copy {
  display: inline-flex;
  margin-top: 8px;
  min-height: 34px;
  padding: 5px 12px;
  font-size: 13px;
}
.account-row .account-copy.is-copied {
  color: var(--success);
  border-color: rgba(134, 214, 168, .45);
}

/* ---------- Контент игры: подменю, наряды, лавка фей (19.11.2026) ---------- */
/* Боковое меню: «Контент игры» раскрывает вложенные пункты */
.side-nav .nav-chevron {
  margin-left: auto;
  width: 18px !important;
  height: 18px !important;
  transition: transform .25s var(--spring, ease);
}
.side-nav .nav-group-toggle[aria-expanded="true"] .nav-chevron {
  transform: rotate(180deg);
}
.side-nav .sub-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: -2px 0 2px 18px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
.side-nav .sub-nav[hidden] {
  display: none;
}
.side-nav .sub-nav button {
  min-height: 40px;
  padding: 7px 12px;
  font-size: 14px;
}
.side-nav .sub-nav button svg {
  width: 18px;
  height: 18px;
}
.side-nav .sub-nav button.active,
.side-nav.has-indicator .sub-nav button.active {
  background: linear-gradient(180deg, rgba(120, 60, 200, .4), rgba(60, 28, 104, .55)) !important;
  border-color: rgba(220, 190, 255, .55) !important;
  box-shadow: inset 0 0 12px rgba(200, 150, 255, .2) !important;
  color: #fff;
}

/* Телефон: вкладки раздела вверху страницы */
.content-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 14px;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(16, 10, 26, .75);
}
.content-tabs[hidden] {
  display: none;
}
.content-tabs button {
  flex: 1 0 auto;
  min-height: 40px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font: 14px var(--font);
  white-space: nowrap;
}
.content-tabs button.active {
  background: linear-gradient(180deg, rgba(120, 60, 200, .6), rgba(60, 28, 104, .75));
  color: #fff;
  box-shadow: 0 0 14px rgba(160, 90, 255, .4);
}

/* Наряды */
.outfit-card .picture img {
  object-fit: contain;
  object-position: center bottom;
}
.outfit-detail .detail-art img {
  height: auto;
  max-height: 520px;
  width: auto;
  max-width: 92%;
}
.outfit-note {
  margin-top: -14px;
}

/* Лавка фей */
.fairy-page {
  display: grid;
  gap: 26px;
}
.fairy-page[hidden] {
  display: none;
}
.fairy-page h2 {
  margin: 0 0 6px;
}
.fairy-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fairy-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(16, 10, 26, .7);
  color: var(--text-2);
  font: 15px var(--font);
}
.fairy-tabs button span {
  min-width: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  line-height: 20px;
}
.fairy-tabs button[aria-selected="true"] {
  border-color: rgba(220, 190, 255, .7);
  background: linear-gradient(180deg, rgba(120, 60, 200, .55), rgba(60, 28, 104, .7));
  color: #fff;
}
.fairy-shops {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.fairy-shop-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(16, 10, 26, .7);
}
.fairy-shop-card.selected {
  border-color: rgba(232, 199, 125, .7);
  box-shadow: 0 0 18px rgba(232, 199, 125, .18);
}
.fairy-shop-pick {
  display: grid;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  font: inherit;
}
.fairy-shop-pick b {
  font: 18px var(--font-display);
  color: var(--gold);
}
.fairy-shop-pick small, .fairy-status-edit {
  color: var(--muted);
  font-size: 13px;
}
.fairy-status-edit {
  display: grid;
  gap: 4px;
}
.fairy-dates-flag {
  color: var(--gold) !important;
}
.fairy-dates-open {
  justify-self: start;
  min-height: 36px;
  padding: 4px 12px;
  font-size: 13px;
}
.fairy-dates-form {
  display: grid;
  gap: 8px;
}
.fairy-dates-form label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 13px;
}
.fairy-dates-form .form-control {
  min-height: 38px;
  color-scheme: dark;
}
.fairy-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.fairy-cal-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.fairy-cal-toggles .btn {
  min-height: 38px;
  padding: 5px 14px;
  font-size: 14px;
}
.fairy-cal-add {
  border-style: dashed;
  opacity: 1;
}
.fairy-calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.fairy-calendar-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 150px;
  padding: 10px;
  border: 1px solid rgba(150, 110, 210, .2);
  border-radius: 12px;
  background: rgba(16, 10, 26, .6);
  opacity: .72;
}
.fairy-calendar-cell.in-shop {
  opacity: 1;
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(70, 38, 110, .55), rgba(20, 12, 32, .7));
}
.fairy-calendar-cell.is-now {
  box-shadow: 0 0 0 2px rgba(232, 199, 125, .6), 0 0 18px rgba(232, 199, 125, .2);
}
.fairy-calendar-cell small {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.fairy-calendar-cell > a {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
}
.fairy-calendar-cell b {
  font-size: 14px;
  font-weight: 500;
}
.fairy-cal-img {
  width: 76px;
  height: 76px;
  object-fit: contain;
}
.fairy-cal-empty {
  margin: auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.fairy-source {
  margin-top: auto;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}
.fairy-source.source-manual {
  color: var(--gold);
}
.fairy-source.source-players {
  color: #9fd3b5;
}
.fairy-cal-form {
  display: grid;
  gap: 6px;
}
.fairy-cal-form .form-select {
  min-height: 36px;
  padding-block: 4px;
  font-size: 13px;
}
.fairy-cal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fairy-cal-actions .btn {
  min-height: 34px;
  padding: 4px 10px;
  font-size: 13px;
}
.fairy-goods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.fairy-good {
  --rarity: #9a90ad;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 12px 10px;
  border: 1px solid rgba(150, 110, 210, .25);
  border-radius: 14px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--rarity) 25%, transparent), transparent 90%), rgba(16, 10, 26, .6);
  color: var(--text);
  text-align: center;
  text-decoration: none;
}
.fairy-good:hover {
  border-color: var(--line-strong);
}
.fairy-good img, .fairy-good .no-image {
  width: 100px;
  height: 100px;
  object-fit: contain;
}
.fairy-good small {
  color: var(--muted);
  font-size: 12px;
}
.fairy-months {
  display: grid;
  gap: 18px;
}
.fairy-month {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l, 18px);
  background: var(--panel);
}
.fairy-month h3 {
  margin: 16px 0 4px;
  font-size: 19px;
}
.fairy-month-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.fairy-month-flower {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
}
.fairy-month-flower span {
  display: grid;
  gap: 2px;
}
.fairy-month-flower b {
  font: 24px var(--font-display);
  color: var(--accent);
}
.fairy-month-flower small {
  color: var(--muted);
  font-size: 13px;
}
.fairy-month-img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .45));
}
.fairy-month-icon {
  display: grid;
  justify-items: center;
  margin: 0;
}
.fairy-month-icon img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(150, 220, 255, .35));
}
.fairy-month-icon figcaption {
  color: var(--muted);
  font-size: 12px;
}
.fairy-pairs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.fairy-pair {
  --rarity: #9a90ad;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  padding: 12px 10px;
  border: 1px solid rgba(150, 110, 210, .22);
  border-radius: 14px;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rarity) 22%, transparent), transparent 70%), rgba(14, 9, 22, .7);
  text-align: center;
}
.fairy-pair > b {
  font-size: 14px;
  font-weight: 500;
}
.fairy-pair-fairy {
  width: 120px;
  height: 120px;
  object-fit: contain;
}
.fairy-pair-flower {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding-top: 8px;
  border-top: 1px solid rgba(150, 110, 210, .2);
  color: var(--text);
  font-size: 13px;
  text-align: left;
  text-decoration: none;
}
.fairy-pair-flower span {
  display: grid;
}
.fairy-pair-flower small {
  color: var(--muted);
  font-size: 11px;
}
.fairy-pair-img {
  flex: none;
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.fairy-pair.secret {
  border-style: dashed;
}
.fairy-month.is-now {
  border-color: rgba(232, 199, 125, .7);
  box-shadow: 0 0 0 1px rgba(232, 199, 125, .35), 0 0 22px rgba(232, 199, 125, .18);
}
.fairy-now {
  display: inline-block;
  margin-right: 4px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(232, 199, 125, .18);
  color: var(--gold);
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.fairy-catch {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}
.fairy-catch > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 0 4px;
  cursor: pointer;
  list-style: none;
  font: 19px var(--font-display);
  color: var(--text);
}
.fairy-catch > summary::-webkit-details-marker {
  display: none;
}
.fairy-catch > summary::after {
  content: "";
  width: 9px;
  height: 9px;
  margin-left: auto;
  border-right: 1.7px solid var(--muted);
  border-bottom: 1.7px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .25s var(--spring, ease);
}
.fairy-catch[open] > summary::after {
  transform: rotate(225deg);
}
.fairy-catch > summary small {
  color: var(--muted);
  font: 13px var(--font);
}
.fairy-price {
  margin-top: 4px;
  font: 18px var(--font-display);
  color: var(--gold);
}
.fairy-price small {
  color: var(--muted);
  font: 12px var(--font);
}
.fairy-rules {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(16, 10, 26, .6);
}
.fairy-rules summary {
  cursor: pointer;
  color: var(--accent);
}
.fairy-rules ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--text-2);
}
body[data-page="outfits"] .hero {
  --hero-img: url("brand/heroes/outfits.webp");
  --hero-pos: center 40%;
}
body[data-page="fairies"] .hero {
  --hero-img: url("brand/heroes/fairies.webp");
  --hero-pos: center 55%;
}
@media (max-width: 640px) {
  .fairy-calendar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .fairy-pairs, .fairy-goods-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .fairy-pair-fairy {
    width: 96px;
    height: 96px;
  }
  .fairy-month {
    padding: 14px;
  }
  .fairy-month-img {
    width: 84px;
    height: 84px;
  }
  .fairy-month-icon img {
    width: 92px;
    height: 92px;
  }
}

/* =========================================================================
   ЧАСТЬ C. Связка с Bootstrap 5: переменные --bs-*, поправки к reboot,
   компоненты Bootstrap в оформлении сада, каркас на сетке Bootstrap
   ========================================================================= */

/* ---------- 1. Переменные ---------- */
:root, [data-bs-theme="dark"] {
  --bs-body-font-family: var(--font);
  --bs-body-font-size: 15px;
  --bs-body-line-height: 1.55;
  --bs-body-color: var(--text);
  --bs-body-color-rgb: 241, 236, 248;
  --bs-body-bg: var(--bg);
  --bs-body-bg-rgb: 7, 5, 12;
  --bs-emphasis-color: #fff;
  --bs-secondary-color: var(--muted);
  --bs-secondary-bg: var(--surface-2);
  --bs-tertiary-color: var(--faint);
  --bs-tertiary-bg: var(--surface);
  --bs-heading-color: inherit;
  --bs-link-color: var(--accent);
  --bs-link-color-rgb: 217, 185, 255;
  --bs-link-hover-color: #e3cffd;
  --bs-link-hover-color-rgb: 227, 207, 253;
  --bs-border-color: var(--line);
  --bs-border-color-translucent: rgba(200, 165, 250, .25);
  --bs-border-radius: var(--radius-s);
  --bs-border-radius-sm: 6px;
  --bs-border-radius-lg: var(--radius);
  --bs-border-radius-xl: var(--radius-l);
  --bs-primary: #a465f2;
  --bs-primary-rgb: 164, 101, 242;
  --bs-secondary: #46385e;
  --bs-secondary-rgb: 70, 56, 94;
  --bs-success: #86d6a8;
  --bs-success-rgb: 134, 214, 168;
  --bs-danger: #f29bb0;
  --bs-danger-rgb: 242, 155, 176;
  --bs-warning: #f0c47e;
  --bs-warning-rgb: 240, 196, 126;
  --bs-info: #8ee8de;
  --bs-info-rgb: 142, 232, 222;
  --bs-focus-ring-color: rgba(164, 101, 242, .35);
  --bs-highlight-bg: rgba(232, 199, 125, .3);
  --bs-highlight-color: inherit;
  --bs-gutter-x: 1.5rem;
}

/* ---------- 2. Поправки к reboot ---------- */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
}
h4 {
  font-size: 15px;
}
summary {
  display: block;
}
label {
  display: inline;
}
mark {
  padding: 0 .15em;
  border-radius: 3px;
  background: var(--bs-highlight-bg);
  color: inherit;
}
[type="search"] {
  outline-offset: 3px;
}
img, svg {
  vertical-align: initial;
}
hr {
  border-color: var(--line);
  opacity: 1;
}
.container-fluid {
  --bs-gutter-x: 0;
}

/* Кнопки: Bootstrap даёт поведение и состояния, «Ночной сад» — вид (app.css рисует рамки и орнамент) */
.btn {
  --bs-btn-font-family: var(--font);
  --bs-btn-font-size: 14px;
  --bs-btn-font-weight: 600;
  --bs-btn-line-height: 1.3;
  --bs-btn-padding-x: 16px;
  --bs-btn-padding-y: 9px;
  --bs-btn-border-radius: var(--radius-s);
  --bs-btn-focus-box-shadow: 0 0 0 3px var(--accent-soft);
  --bs-btn-disabled-opacity: .55;
  white-space: normal;
}
.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: #5a2a9e;
  --bs-btn-border-color: rgba(220, 190, 255, .55);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #6b34b8;
  --bs-btn-hover-border-color: rgba(230, 205, 255, .8);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #4e2391;
  --bs-btn-active-border-color: rgba(220, 190, 255, .7);
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: #44207a;
  --bs-btn-disabled-border-color: rgba(220, 190, 255, .35);
}
.btn-outline-secondary {
  --bs-btn-color: var(--text-2);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: rgba(200, 165, 250, .45);
  --bs-btn-hover-color: var(--text);
  --bs-btn-hover-bg: rgba(36, 22, 56, .85);
  --bs-btn-hover-border-color: var(--line-strong);
  --bs-btn-active-color: var(--text);
  --bs-btn-active-bg: rgba(46, 28, 72, .9);
  --bs-btn-active-border-color: var(--line-strong);
  --bs-btn-disabled-color: var(--muted);
  --bs-btn-disabled-bg: transparent;
  --bs-btn-disabled-border-color: var(--line);
}
.btn-outline-danger {
  --bs-btn-color: var(--danger);
  --bs-btn-border-color: rgba(242, 155, 176, .35);
  --bs-btn-hover-color: #ffc6d3;
  --bs-btn-hover-bg: var(--danger-bg);
  --bs-btn-hover-border-color: rgba(242, 155, 176, .55);
  --bs-btn-active-color: #ffc6d3;
  --bs-btn-active-bg: rgba(242, 155, 176, .2);
  --bs-btn-active-border-color: rgba(242, 155, 176, .55);
}
.btn-link {
  --bs-btn-color: var(--accent);
  --bs-btn-hover-color: #e3cffd;
  --bs-btn-active-color: #e3cffd;
  --bs-btn-font-weight: 500;
}

/* Bootstrap отключает клики у неактивных кнопок — подсказки (title) должны оставаться */
.btn:disabled, .btn.disabled {
  pointer-events: auto;
}

/* Поля ввода и списки: вид как у остальных полей сайта */
.form-control, .form-select {
  min-height: 44px;
  padding: 10px 14px;
  font-family: var(--font-ui);
  font-size: inherit;
  line-height: 1.4;
  color: var(--text);
  border: 1px solid rgba(170, 125, 235, .35);
  border-radius: var(--radius-s);
  box-shadow: inset 0 0 14px rgba(110, 50, 190, .18);
  --cs: 14px;
}
.form-control {
  background: var(--orn), rgba(10, 6, 17, .9);
}
.form-select {
  padding-right: 38px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d9b9ff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center / 18px no-repeat, var(--orn), rgba(10, 6, 17, .9);
}
.form-control:hover, .form-select:hover {
  border-color: var(--line-strong);
}
.form-control:focus, .form-select:focus {
  color: var(--text);
  background-color: transparent;
  border-color: var(--accent-strong);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 18px rgba(164, 101, 242, .35), inset 0 0 14px rgba(110, 50, 190, .25);
}
.form-control::placeholder {
  color: var(--faint);
}
.form-control[type="color"] {
  width: 44px;
  padding: 3px;
}

/* Чекбоксы */
.form-check-input {
  --bs-form-check-bg: rgba(10, 6, 17, .9);
  width: 18px;
  height: 18px;
  min-height: 0;
  margin-top: 0;
  padding: 0;
  flex: 0 0 18px;
  border: 1px solid rgba(200, 165, 250, .55);
  box-shadow: none;
  background-color: var(--bs-form-check-bg);
}
.form-check-input:checked {
  background-color: var(--accent-strong);
  border-color: var(--accent-strong);
}
.form-check-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Карточки цветов — компонент Bootstrap .card в оформлении сада */
.card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 2px 16px 16px;
  color: inherit;
}

/* Уведомления: у Bootstrap .toast скрыт без .show — наши тосты видны всегда */
.toasts .toast, .toast {
  --bs-toast-max-width: none;
  --bs-toast-bg: transparent;
  --bs-toast-border-color: var(--line-strong);
  --bs-toast-color: var(--text);
  width: auto;
  max-width: none;
  font-size: 14px;
}
.toast:not(.show) {
  display: flex;
}

/* Ссылка «Мой образ» в меню — не навигация Bootstrap */
.side-nav .nav-link {
  --bs-nav-link-padding-x: 14px;
  --bs-nav-link-padding-y: 10px;
  --bs-nav-link-color: var(--text-2);
  --bs-nav-link-hover-color: var(--text);
}

/* Колонки Bootstrap внутри «Готовности гильдии» — на всю высоту строки */
.overview.row {
  display: flex;
  gap: 0;
  margin-bottom: 26px;
}
.overview.row > [class*="col"] > .stat {
  height: 100%;
}
.overview.row > .col-12 > .my-status {
  grid-column: auto;
}

/* Оболочка: боковая панель + основная колонка на flex-сетке Bootstrap */
.app.container-fluid {
  display: block;
  padding: 0;
}
.app > .row {
  min-height: 100vh;
}
.sidebar.col-auto {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
}
.main-col.col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.side-nav.nav {
  flex-wrap: nowrap;
  gap: 8px;
}
.topbar.sticky-top {
  z-index: 30;
}
.footer.d-lg-flex {
  justify-content: space-between;
  gap: 16px;
}

/* =========================================================================
   ЧАСТЬ D. Материалы и отклик (Apple design): типографика, нажатия, стекло,
   скользящий индикатор, диалоги и нижние листы, доступность
   ========================================================================= */

/* ---------- 2. Типографика: трекинг и интерлиньяж зависят от кегля ---------- */
.hero h1, .detail-top h1, .login-card h1 {
  line-height: 1.04;
  letter-spacing: -.012em;
}
.section-top h2, dialog h2, .admin-page h2 {
  line-height: 1.1;
  letter-spacing: -.005em;
}
small, .way, .chip, .points, .sync-pill, .stat small, .mobile-nav button span {
  letter-spacing: .012em;
}
.stat strong {
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
#activeCount, #flowerCount, .points, .collection-points {
  font-variant-numeric: tabular-nums;
}

/* Текст поверх стекла — чуть плотнее, чтобы не «тонул» в размытии */
.topbar .sync-pill, .mobile-nav button {
  font-weight: 500;
}

/* ---------- 3. Отклик: мгновенно на нажатие, а не на отпускание ---------- */
button,
.nav-link,
.portrait-top,
.back-link,
.obtaining-guide-link,
.member-choice,
.flower-link,
summary,
.card,
.avatar.has-photo {
  touch-action: manipulation;
}
button,
.nav-link,
.portrait-top,
.obtaining-guide-link,
.member-choice,
summary,
.scroll-top,
.logout {
  transition: transform .32s var(--spring), background-color .15s, border-color .15s, color .15s, box-shadow .2s, opacity .2s;
}

/* .is-pressed ставит apple-motion.js на pointerdown; :active — запасной вариант без JS */
button:not(:disabled).is-pressed,
button:not(:disabled):active,
.nav-link.is-pressed,
.portrait-top.is-pressed,
.obtaining-guide-link.is-pressed,
.member-choice.is-pressed,
summary.is-pressed,
.logout.is-pressed {
  transform: scale(var(--press-scale));
  transition: transform .08s ease-out, background-color .08s, border-color .08s, color .08s;
}
.primary:active:not(:disabled) {
  transform: scale(var(--press-scale));
}

/* Карточки: лёгкий подъём при наведении (только там, где есть мышь) и «вдавливание» при нажатии */
.card, .participant-card, .collection-flower, .event-card {
  transition: transform .45s var(--spring), box-shadow .3s, border-color .2s;
}
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-3px);
  }
}
.card.is-pressed {
  transform: scale(.985);
  transition-duration: .1s;
}

/* Вместо жёсткой линии под шапкой — мягкий край, и только когда под ней есть контент */
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 18px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 5, 13, .55), transparent);
  opacity: 0;
  transition: opacity .3s;
}
body.scrolled .topbar::after {
  opacity: 1;
}

/* Кнопка «Наверх» — маленькая лёгкая стеклянная фишка */
.scroll-top {
  box-shadow: 0 8px 22px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .12) !important;
  transition: transform .4s var(--spring), opacity .25s;
}
.scroll-top[hidden] {
  display: grid !important;
  opacity: 0;
  transform: scale(.6);
  pointer-events: none;
  visibility: hidden;
  transition: transform .3s var(--spring), opacity .2s, visibility 0s .3s;
}

/* ---------- 5. Скользящий индикатор активного раздела ---------- */
.nav-indicator {
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  pointer-events: none;
  will-change: transform, width, height;
  --cs: 16px;
  background: var(--orn), linear-gradient(180deg, rgba(120, 60, 200, .55), rgba(60, 28, 104, .7));
  border: 1px solid rgba(220, 190, 255, .7);
  border-radius: 10px;
  box-shadow: 0 0 22px rgba(160, 90, 255, .5), inset 0 0 16px rgba(200, 150, 255, .25);
  opacity: 0;
}
.has-indicator .nav-indicator {
  opacity: 1;
}

/* Активная кнопка больше не рисует свой фон — его рисует индикатор, который «переезжает» */
.side-nav.has-indicator button.active,
.mobile-nav.has-indicator button.active,
.view-toggle.has-indicator button[aria-pressed="true"] {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.side-nav.has-indicator button.active:hover {
  background: transparent !important;
}
.view-toggle .nav-indicator {
  border-radius: 9px;
  --cs: 12px;
}
.side-nav button, .mobile-nav button, .view-toggle button {
  transition: transform .32s var(--spring), color .2s;
}

/* ---------- Телефон и планшет ---------- */
@media (max-width: 991.98px) {
  .topbar .avatar {
    width: 34px;
    height: 34px;
    font-size: 15px;
    box-shadow: 0 0 0 3px rgba(20, 12, 32, .9), 0 0 0 4px rgba(180, 130, 240, .45);
  }
  .mobile-nav .nav-indicator {
    border-radius: 18px;
    --cs: 12px;
  }
  body.opg-app {
    overscroll-behavior-y: contain;
  }
}
@media (max-width: 380px) {
  .topbar .portrait-top span {
    display: none;
  }
}

/* ---------- 6. Диалоги: появляются из кнопки, которая их открыла ---------- */
dialog[open] {
  animation: none !important;
}

/* вход ведёт пружина в apple-motion.js */
dialog::backdrop {
  background: rgba(6, 4, 10, .55);
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  animation: scrim-in .3s ease-out;
}
@keyframes scrim-in { from { opacity: 0; } }
.dialog-ghost-scrim {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(6, 4, 10, .55);
  pointer-events: none;
}
dialog.dialog-ghost {
  position: fixed;
  margin: 0;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
}

/* Нижний лист на телефоне: тянется пальцем, закрывается броском вниз */
.sheet-grabber {
  display: none;
}
@media (max-width: 640px) {
  dialog.as-sheet {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    inset: auto 0 0 0;
    max-height: calc(100dvh - 40px - env(safe-area-inset-top));
    padding: 30px 20px calc(20px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
    overscroll-behavior: contain;
  }
  dialog.as-sheet .sheet-grabber {
    display: block;
    position: sticky;
    top: -22px;
    z-index: 2;
    width: 100%;
    height: 22px;
    margin: -22px 0 0;
    cursor: grab;
    touch-action: none;
  }
  dialog.as-sheet .sheet-grabber::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 8px;
    width: 38px;
    height: 5px;
    margin-left: -19px;
    border-radius: 3px;
    background: rgba(230, 210, 255, .35);
  }
  dialog.as-sheet .dialog-actions, dialog.as-sheet .pq-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
  }
  dialog.as-sheet .dialog-actions > *, dialog.as-sheet .pq-actions > * {
    width: 100%;
    margin: 0 !important;
  }
}

/* ---------- 8. Доступность ---------- */
@media (prefers-reduced-transparency: reduce) {
  .topbar, .mobile-nav, .scroll-top, .toast, #serverFlowerNotice, .sidebar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .topbar {
    background: #0c0814 !important;
  }
  .mobile-nav {
    background: #120b1d !important;
  }
  .scroll-top {
    background: #1e1530 !important;
  }
  dialog::backdrop {
    backdrop-filter: none;
    background: rgba(6, 4, 10, .82);
  }
}
@media (prefers-contrast: more) {
  :root {
    --glass-edge: rgba(235, 215, 255, .6);
  }
  .topbar {
    background: rgba(8, 5, 13, .96) !important;
    border-bottom: 1px solid rgba(220, 190, 255, .6) !important;
  }
  .mobile-nav {
    background: rgba(8, 5, 13, .97) !important;
  }
  .nav-indicator {
    border-color: #fff;
  }
}

/* ---------- Нижнее меню: подписи не наезжают друг на друга (12.11.2026) ----------
   У админа 7 пунктов. Раньше все кнопки были строго одинаковой ширины,
   и длинное слово «Объявления» вылезало на соседний пункт «Доступы».
   Теперь кнопка не уже своего самого длинного слова, остальное место делится поровну. */
@media (max-width: 350px) {
  .mobile-nav button {
    font-size: 9px !important;
    padding-left: 1px !important;
    padding-right: 1px !important;
  }
}

/* =========================================================================
   ЧАСТЬ E. Плавные переходы (motion-extras.js): заготовки, проявление картинок,
   перелёт картинки, вспышки и подсветки, «потянуть для обновления», тест «Мой образ»
   ========================================================================= */
#cards, #variantsGrid, #galleryGrid {
  position: relative;
}
.flip-ghost {
  will-change: transform, opacity;
}

/* Заготовки на время загрузки */
.card.skeleton {
  pointer-events: none;
  min-height: 300px;
}
.card.skeleton .picture {
  display: grid;
  place-items: center;
}
.skeleton .placeholder, .stat .placeholder {
  background-color: rgba(200, 165, 250, .5);
  border-radius: 6px;
}
.skeleton .sk-pic {
  width: 62%;
  height: 120px;
  border-radius: 50%;
  opacity: .35;
}
.skeleton .sk-line {
  display: block;
  height: 10px;
  margin: 10px 0 0;
}
.skeleton .sk-title {
  display: block;
  height: 18px;
  margin: 10px 0 0;
}
.skeleton .sk-chip {
  display: block;
  height: 22px;
  margin: 18px 0 0;
  border-radius: 999px;
}
.stat .sk-num {
  display: inline-block;
  width: 3.2em;
  height: .8em;
  vertical-align: middle;
}
.compact .card.skeleton {
  min-height: 0;
}
.compact .card.skeleton .picture {
  display: none;
}

/* Картинки проявляются из лёгкого размытия */
img.img-soft {
  opacity: 0;
  filter: blur(10px);
  transform: scale(1.03);
  transition: opacity .45s ease-out, filter .6s ease-out, transform .7s var(--spring);
}
img.img-soft.is-loaded {
  opacity: 1;
  filter: none;
  transform: none;
}

/* Перелёт картинки цветка */
.shared-flyer {
  position: fixed;
  z-index: 1060;
  object-fit: contain;
  pointer-events: none;
  will-change: left, top, width, height;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .45));
}

/* Числа */
.is-counting {
  text-shadow: 0 0 14px rgba(200, 150, 255, .55);
}

/* «Я завершил турнир»: вспышка и галочка */
.fx-done-burst {
  position: relative;
  animation: fx-pop .6s var(--spring);
}
.fx-done-burst::after {
  content: "✓";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: var(--success);
  color: #10241a;
  font: 700 26px/1 var(--font-ui);
  box-shadow: 0 0 0 0 rgba(134, 214, 168, .6);
  animation: fx-check 1.1s var(--spring) forwards;
  pointer-events: none;
}
@keyframes fx-pop { 0% { transform: scale(.94); } 45% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes fx-check {
  0% { opacity: 0; transform: scale(.3); box-shadow: 0 0 0 0 rgba(134, 214, 168, .6); }
  30% { opacity: 1; transform: scale(1.1); }
  60% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 18px rgba(134, 214, 168, 0); }
  100% { opacity: 0; transform: scale(.9); }
}
.participant-status.fx-done-burst::after {
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  font-size: 15px;
}

/* Сохранённая ячейка */
.fx-saved {
  animation: fx-saved 1.6s ease-out;
}
@keyframes fx-saved { 0%, 30% { background-color: rgba(232, 199, 125, .32); box-shadow: inset 0 0 0 1px rgba(232, 199, 125, .7); } 100% { background-color: transparent; box-shadow: inset 0 0 0 1px transparent; } }

/* Неверный пароль */
.form-control.is-invalid-soft {
  border-color: rgba(242, 155, 176, .75);
  box-shadow: 0 0 0 3px rgba(242, 155, 176, .18), inset 0 0 14px rgba(190, 60, 110, .2);
}

/* Ведение пальцем по вкладкам */
.mobile-nav button.is-scrub {
  color: #fff;
  transform: scale(1.08) translateY(-2px);
}

/* Потянуть вниз — обновить */
.ptr {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top) + 64px);
  z-index: 1040;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--glass-thick);
  border: 1px solid var(--glass-edge);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .4);
  pointer-events: none;
  opacity: 0;
  color: #e6d2ff;
  font-size: 22px;
}
.ptr.is-armed {
  box-shadow: 0 8px 22px rgba(0, 0, 0, .4), 0 0 18px rgba(170, 100, 255, .6);
}
.ptr.is-busy .ptr-moon {
  animation: ptr-spin .9s linear infinite;
}
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* Тест «Мой образ»: обратная сторона карты во время переворота */
.pq-result-art.is-flipping {
  transform-style: preserve-3d;
  will-change: transform;
}
.pq-result-art.is-back > * {
  visibility: hidden;
}
.pq-result-art.is-back {
  background: var(--orn), radial-gradient(circle at 50% 45%, #3a1f63, #120a1e 70%);
  --cs: 34px;
  border-radius: 18px;
}
.pq-progress span {
  transition: width .5s var(--spring);
}
@media (prefers-reduced-motion: reduce) {
  img.img-soft {
    transition: opacity .2s;
    filter: none;
    transform: none;
  }
  .fx-done-burst, .fx-done-burst::after, .fx-saved {
    animation-duration: .01s;
  }
}

/* Калькулятор лавки фей */
.fairy-calc {
  display: grid;
  gap: 14px;
}
.fairy-calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.fairy-calc h3 {
  margin: 14px 0 8px;
  font-size: 16px;
}
.fairy-calc-have {
  display: grid;
  gap: 6px;
  font-weight: 600;
}
.fairy-calc-bought {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.fairy-calc-items {
  display: grid;
  gap: 8px;
}
.fairy-calc-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(150, 110, 210, .2);
  border-radius: 12px;
  background: rgba(16, 10, 26, .6);
  cursor: pointer;
}
.fairy-calc-item.on {
  border-color: var(--gold);
}
.fairy-calc-item span {
  display: grid;
}
.fairy-calc-item small {
  color: var(--muted);
}
.fairy-calc-sum {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.fairy-calc-sum > div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(16, 10, 26, .6);
}
.fairy-calc-sum small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.fairy-calc-sum b {
  font: 20px var(--font-display);
  color: var(--gold);
}
.fairy-calc-sum b.ok, .fairy-calc-done {
  color: var(--success);
}
.fairy-calc-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
.fairy-calc-table th, .fairy-calc-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 400;
}
.fairy-calc-table thead th {
  color: var(--muted);
  font-size: 12px;
}
.fairy-calc-table tbody th i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 50%;
}
.fairy-calc-table small {
  color: var(--muted);
}
.fairy-bonus {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(16, 10, 26, .6);
}
.fairy-bonus-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.fairy-bonus-chip {
  --rarity: #9a90ad;
  padding: 4px 10px;
  border: 1px solid var(--rarity);
  border-radius: 999px;
  background: color-mix(in srgb, var(--rarity) 18%, transparent);
  color: inherit;
  font-size: 13px;
}
.fairy-bonus-edit {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.fairy-bonus-edit label {
  display: grid;
  gap: 4px;
  font-size: 13px;
}
@media (max-width: 760px) {
  .fairy-calc-grid {
    grid-template-columns: 1fr;
  }
}

.fairy-calc-opts {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.fairy-calc-opts label {
  display: flex;
  gap: 8px;
  align-items: center;
}
.fairy-calc-color {
  flex-wrap: wrap;
}
.fairy-calc-color select {
  max-width: 180px;
}
.fairy-verdicts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.fairy-verdict {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.fairy-verdict small {
  color: var(--muted);
}
.fairy-verdict b {
  font: 22px var(--font-display);
}
.fairy-verdict.yes {
  border-color: var(--success);
  background: var(--success-bg);
}
.fairy-verdict.yes b {
  color: var(--success);
}
.fairy-verdict.no {
  border-color: var(--danger);
  background: var(--danger-bg);
}
.fairy-verdict.no b {
  color: var(--danger);
}
.fairy-verdict span {
  font-size: 13px;
}
.fairy-calc-table td.yes {
  color: var(--success);
}
.fairy-calc-table td.no {
  color: var(--danger);
}
.fairy-calc-table th small {
  display: block;
}

.fairy-have {
  font-weight: 600;
}
.fairy-have.yes, .fairy-pair.can {
  color: var(--success);
}
.fairy-have.no {
  color: var(--danger);
}
.fairy-pair.cannot {
  opacity: .8;
}
.fairy-calc-month {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  background: rgba(16, 10, 26, .6);
}
.fairy-calc-month summary {
  cursor: pointer;
}
.fairy-calc-month summary small {
  color: var(--muted);
}
.fairy-calc-fairies {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.fairy-calc-fairy {
  --rarity: #9a90ad;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--rarity);
  border-radius: 10px;
  font-size: 13px;
}
.fairy-calc-fairy span {
  display: grid;
}
.fairy-calc-fairy small {
  color: var(--muted);
}
.fairy-calc-fairy.off {
  opacity: .5;
}
.fairy-calc-table td.off {
  color: var(--muted);
}
.fairy-plan {
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(16, 10, 26, .6);
}
.fairy-plan ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.fairy-calc-fold > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(16, 10, 26, .6);
  cursor: pointer;
  list-style: none;
}
.fairy-calc-fold > summary::-webkit-details-marker {
  display: none;
}
.fairy-calc-fold > summary h2 {
  margin: 0;
}
.fairy-calc-fold > summary small {
  display: block;
  color: var(--muted);
}
.fairy-calc-fold[open] > summary {
  margin-bottom: 14px;
}
.fairy-calc-fold > summary::after {
  content: "▾";
  color: var(--gold);
}
.fairy-calc-fold[open] > summary::after {
  content: "▴";
}
