/* ????????: ???????, ????, ???????, ?????, ?????????, ????????? ?????. */
/* iOS Safari: у полей даты и времени своя минимальная ширина — без этого они вылезают за край листа */
@supports (-webkit-touch-callout: none) {
  input[type="date"], input[type="time"], input[type="datetime-local"] {
     -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; display: block;
  }

  input::-webkit-date-and-time-value {
     text-align: left; min-height: 1.5em;
  }
}

/* достижения на профиле */
.ach-grid {
   display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
}

.ach {
   display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3); background: var(--ink-800);
    border: 1px solid var(--steel-dim); border-radius: var(--radius);
}

.ach--master:not(.is-locked) {
   border-color: var(--wine-bright);
}

.ach__icon {
   flex: none; display: grid; place-items: center; width: 46px; height: 46px; font-size: 1.6rem; border-radius: 50%;
    background: radial-gradient(circle, rgba(231, 200, 115, .25), rgba(231, 200, 115, .05)); box-shadow: 0 0 0 1px rgba(231, 200, 115, .45);
}

.ach__body {
   display: grid; gap: 2px; min-width: 0;
}

.ach__body b {
   font-family: var(--font-heading); color: var(--bone-50); letter-spacing: .03em;
}

.ach__body small {
   color: var(--text-muted); font-size: .8rem;
}

.ach__date {
   color: var(--rose-light) !important;
}

a.char-stat {
   text-decoration: none; color: inherit;
}

/* тип персонажа: West Marches или кампании и независимые игры — с лимитом живых героев */
.kind-pick {
   display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin: 0; padding: 0; border: 0;
}

.kind-pick legend {
   width: 100%; padding: 0; margin-bottom: 4px;
}

.kind-pick .is-full span {
   opacity: .6;
}

.char-limits .is-full {
   color: var(--wine-bright); font-weight: 700;
}

.cw-kind {
   display: grid; gap: var(--space-2); margin-bottom: var(--space-4);
}

.kind-form__row {
   display: flex; gap: var(--space-2);
}

.kind-form__row select {
   flex: 1;
}

/* на костяном листе текст — тёмный */
/* ---------- 9. Герой главной: фирменный баннер ---------- */
.hero {
    display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
    align-items: center; gap: clamp(var(--space-4), 4vw, var(--space-7)); padding: var(--space-3) 0 var(--space-6);
}

.hero h1 {
   margin: 0 0 var(--space-3); font-size: clamp(2rem, 4.2vw, 3.25rem); line-height: 1.06; text-wrap: balance;
}

.hero__banner {
    display: block; width: 100%; height: auto;
    border-radius: var(--radius); box-shadow: 0 0 0 1px var(--navy), var(--shadow);
}

.hero__lead {
   max-width: 38ch; margin: 0 0 var(--space-4); color: var(--text-muted);
}

.first-game {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: var(--space-4); margin-block: var(--space-6); scroll-margin-top: var(--space-5);
}

.first-game > div {
   flex: 1 1 28rem;
}

.first-game :is(h2, p) {
   margin: 0;
}

.first-game h2 {
   margin-bottom: var(--space-2);
}

@media (max-width: 700px) {
  .hero {
     grid-template-columns: minmax(0, 1fr); padding-bottom: var(--space-3);
  }

  .hero__art {
     max-width: 32rem;
  }
}

.game-card {
   display: flex; flex-direction: column; gap: var(--space-3); color: var(--text); text-decoration: none; height: 100%;
}

.game-card:hover {
   color: var(--text);
}

.game-card__head {
   display: flex; gap: var(--space-4); align-items: flex-start;
}

.game-card__title {
   margin: 0; font-size: var(--fs-lg); color: var(--bone-50);
}

.game-card__meta {
   display: flex; flex-wrap: wrap; gap: var(--space-2);
}

.game-card__heading {
   min-width: 0; overflow-wrap: anywhere;
}

.game-card__facts {
   list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; font-size: var(--fs-sm);
}

.game-card__facts li:first-child {
   color: var(--text-muted);
}

.game-card__footer {
   margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--frame-line); font-size: var(--fs-sm);
}

.pip {
   width: 10px; height: 11px; clip-path: var(--hex); background: var(--ink-600);
}

.pip--taken {
   background: var(--rose-light);
}

/* ---------- 12. Профиль ---------- */
.profile-head {
   display: flex; flex-wrap: wrap; gap: var(--space-5); align-items: center;
}

.profile-head h1 {
   margin: 0;
}

.char-sheet {
   display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
}

.char-stat {
   text-align: center; padding: var(--space-3); border-radius: var(--radius); background: var(--ink-900); box-shadow: inset 0 0 0 1px var(--frame-line);
}

.char-stat__value {
   font: 700 var(--fs-xl)/1.1 var(--font-heading); color: var(--steel-bright);
}

.char-stat__label {
   font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted);
}

/* ---------- 13. Зал Совета (админка) ---------- */
.council {
   display: grid; gap: var(--space-6); grid-template-columns: 220px minmax(0, 1fr); align-items: start;
}

.council__nav {
   position: sticky; top: 92px; display: flex; flex-direction: column; gap: 2px;
}

.council__nav a {
   display: flex; justify-content: space-between; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-family: var(--font-heading); font-weight: 700; letter-spacing: .03em;
}

.council__nav a:hover {
   background: rgba(164, 191, 195, .08); color: var(--steel-bright);
}

.council__nav a.is-active {
   background: linear-gradient(90deg, rgba(143, 65, 72, .45), transparent); color: var(--bone-50); box-shadow: inset 3px 0 0 var(--wine-bright);
}

.council__title {
   font-family: var(--font-heading); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--rose-light); font-size: .9rem; padding: 0 var(--space-3) var(--space-3); margin: 0;
}

@media (max-width: 860px) {
  .council {
     grid-template-columns: 1fr;
  }

  .council__nav {
     position: static; flex-direction: row; flex-wrap: wrap;
  }

  .council__title {
     width: 100%;
  }
}

/* ---------- 14. Страницы ошибок ---------- */
.error-page {
   text-align: center; padding-block: var(--space-7);
}

.error-page__icon {
   width: 120px; margin: 0 auto var(--space-4); border-radius: 22%; box-shadow: var(--shadow);
}

.error-page__code {
   font-family: var(--font-heading); font-weight: 700; font-size: clamp(4rem, 14vw, 7rem); line-height: 1; color: var(--rose-light);
}

/* ---------- 15. Стайлгайд ---------- */
.swatches {
   display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr));
}

.swatch {
   border-radius: var(--radius); overflow: hidden; box-shadow: 0 0 0 1px var(--ink-600); font-size: var(--fs-xs);
}

.swatch__color {
   height: 64px;
}

.swatch__label {
   padding: var(--space-2); background: var(--ink-800);
}

.swatch__label code {
   color: var(--text-muted);
}

.profile-tabs {
   margin-bottom: 0;
}

.char-card {
   display: flex; gap: var(--space-4); align-items: center; text-decoration: none; color: var(--text);
}

.char-card:hover {
   color: var(--text);
}

.char-card__level {
    flex: none; display: grid; place-items: center; width: 54px; height: 60px; clip-path: var(--hex);
    background: transparent; font: 700 1.4rem/1 var(--font-heading); color: var(--bone-50); position: relative;
}

.char-card__level::before {
   content: ""; position: absolute; inset: 0; clip-path: var(--hex); background: linear-gradient(160deg, var(--wine-bright), var(--wine-deep));
}

.char-card__level span {
   position: relative;
}

.char-card__body {
   display: grid; gap: 2px; min-width: 0;
}

.char-card__name {
   font: 700 var(--fs-lg)/1.2 var(--font-heading); color: var(--bone-50); overflow: hidden; text-overflow: ellipsis;
}

.char-card__level img {
   position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; clip-path: var(--hex); z-index: 1;
}

.char-card__level.has-portrait span {
    position: absolute; z-index: 2; right: -2px; bottom: 4px; min-width: 22px; height: 22px; display: grid; place-items: center;
    font-size: .8rem; border-radius: 99px; background: var(--wine); box-shadow: 0 0 0 2px var(--ink-800);
}

.char-card__level.has-portrait {
   clip-path: none; background: none;
}

.char-card__level.has-portrait::before {
   clip-path: var(--hex); background: var(--steel-bright); inset: 0;
}

.campaign-card {
   display: flex; flex-direction: column; gap: var(--space-2); text-decoration: none; color: var(--text);
}

.campaign-card:hover {
   color: var(--text);
}

.campaign-card__desc {
   margin: 0;
}

.campaign-card__next {
   margin: 0; color: var(--text-muted);
}

.campaign-card__next time {
   color: var(--text);
}

.progression-pick {
   display: inline-flex; border: 1px solid var(--ink-600); border-radius: 99px; padding: 0; margin: 0; overflow: hidden;
}

.progression-pick label {
   display: inline-flex; align-items: center; gap: 6px; padding: .45em .9em; font-size: var(--fs-sm); cursor: pointer; color: var(--text-muted);
}

.progression-pick label + label {
   border-left: 1px solid var(--ink-600);
}

.progression-pick input {
   position: absolute; opacity: 0; pointer-events: none;
}

.progression-pick label:has(input:checked) {
   color: var(--bone-50); background: var(--wine);
}

.progression-pick label:has(input:focus-visible) {
   outline: 2px solid var(--steel-bright); outline-offset: -2px;
}

/* ---------- Профиль: аватар и Telegram ---------- */
.profile-form {
   max-width: 720px; margin-inline: auto;
}

.profile-form__as {
   margin-bottom: var(--space-4); color: var(--bone-ink);
}

.profile-form .page-head p {
   color: var(--bone-ink-soft);
}

.tg-row {
   display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
}

.tg-row__icon {
   display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; color: #fff; background: #2a9bd8;
}

.tg-row__text {
   flex: 1; min-width: 200px; display: grid; gap: 2px;
}

.tg-row form {
   margin: 0;
}

.tg-ok {
   color: var(--emerald); font-weight: 700;
}

.tg-missing {
   color: var(--ember);
}

.tg-signup__who {
   display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); color: var(--bone-ink-soft);
}

.tg-signup__who .tg-row__icon {
   width: 30px; height: 30px;
}

.tg-signup__who .tg-row__icon svg {
   width: 16px; height: 16px;
}

/* ---------- Анонсы: картинка, проверка Советом, отчёты ---------- */
.game-card--cover {
   padding-top: 0; overflow: hidden;
}

.game-card__cover {
   display: block; width: calc(100% + 2 * var(--space-5)); max-width: none; margin: 0 calc(-1 * var(--space-5)); aspect-ratio: 16 / 7; object-fit: cover; border-bottom: 1px solid var(--frame-line);
}

.game-cover {
   display: block; width: 100%; max-width: 820px; height: auto; max-height: 80vh; object-fit: contain; border-radius: var(--radius); border: 1px solid var(--frame-line); box-shadow: var(--shadow);
}

.review-banner {
   display: grid; gap: var(--space-2); justify-items: start; margin-bottom: var(--space-5); padding: var(--space-4) var(--space-5); border-radius: var(--radius); border-left: 4px solid var(--steel); background: rgba(164, 191, 195, .1);
}

.review-banner p {
   margin: 0; color: var(--text-muted);
}

.review-banner--returned {
   border-color: var(--ember); background: rgba(214, 160, 106, .12);
}

.review-banner--returned p {
   color: var(--text); white-space: pre-line;
}

.report {
   display: grid; gap: var(--space-3);
}

.report__head {
   display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); flex-wrap: wrap;
}

.report__head p {
   margin: 2px 0 0;
}

.report__title {
   margin: 0; font-size: 1.35rem;
}

.report__title a {
   color: var(--bone-50); text-decoration: none;
}

.report__title a:hover {
   color: var(--rose-light);
}

.report__party {
   margin: 0; color: var(--text-muted);
}

.report__party small {
   color: var(--emerald);
}

.report__absent {
   text-decoration: line-through; opacity: .6;
}

.report__body {
   padding-top: var(--space-3); border-top: 1px solid var(--frame-line);
}

.review-list {
   display: grid; gap: var(--space-3);
}

.review-item {
   display: flex; align-items: center; gap: var(--space-4); color: var(--text); text-decoration: none;
}

.review-item:hover {
   color: var(--text);
}

.review-item__cover {
   flex: none; width: 120px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm);
}

.review-item__cover--none {
   display: grid; place-items: center; font-size: .75rem; color: var(--ember); border: 1px dashed var(--ember);
}

.review-item__body {
   flex: 1; min-width: 0; display: grid; gap: 2px;
}

.review-item__body b {
   font: 700 1.1rem var(--font-heading); color: var(--bone-50);
}

.review-item__body small {
   font-size: .8rem; color: var(--text-muted);
}

.review-grid {
   display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 420px) minmax(0, 1fr); align-items: start;
}

.review-grid__h {
   margin: 0 0 var(--space-3); font-size: 1.15rem;
}

.review-problems {
   margin: 0 0 var(--space-3); padding-left: 1.2em; color: var(--ember);
}

.review-facts {
   display: grid; gap: 6px; margin: 0 0 var(--space-3);
}

.review-facts div {
   display: grid; grid-template-columns: 90px 1fr; gap: var(--space-2);
}

.review-facts dt {
   color: var(--text-muted);
}

.review-facts dd {
   margin: 0;
}

.review-desc summary {
   cursor: pointer; color: var(--steel); font-size: var(--fs-sm);
}

.review-form {
   display: grid; gap: var(--space-3);
}

.review-hint {
   margin: 0 0 var(--space-3);
}

.review-save {
   display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); max-width: 420px; margin-top: var(--space-3);
}

.review-save.is-over [data-review-count] {
   color: var(--ember);
}

@media (max-width: 900px) {
  .review-grid {
     grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .review-item {
     flex-wrap: wrap;
  }

  .review-item__cover {
     width: 100%;
  }
}

.game-quote {
   margin: var(--space-4) 0 0; padding: var(--space-3) var(--space-4); border-left: 3px solid var(--wine); font-style: italic; color: var(--bone-ink-soft); background: rgba(143, 65, 72, .06);
}

/* ---------- Абонемент ---------- */
.balance-card {
   display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--space-2) var(--space-5); border-left: 4px solid var(--emerald);
}

.balance-card--low {
   border-left-color: var(--ember);
}

.balance-card--blocked {
   border-left-color: var(--wine-bright);
}

.balance-card__value {
   grid-row: span 2; font: 700 3.4rem/1 var(--font-heading); color: var(--bone-50); min-width: 1.4em; text-align: center;
}

.balance-card--blocked .balance-card__value {
   color: var(--rose-light);
}

.balance-card__text {
   display: grid; gap: 2px;
}

.balance-card__text b {
   font: 700 1.2rem var(--font-heading); color: var(--bone-50);
}

.balance-card__text span {
   color: var(--text-muted);
}

.balance-history__title {
   margin: 0 0 var(--space-3); font-size: 1.2rem;
}

.delta--plus {
   color: var(--emerald); font-weight: 700;
}

.delta--minus {
   color: var(--rose-light); font-weight: 700;
}

.balance-forms {
   display: grid; gap: var(--space-2); margin-top: var(--space-4);
}

.balance-forms input[name="comment"] {
   flex: 1; min-width: 180px;
}

@media (max-width: 560px) {
  .balance-card {
     grid-template-columns: 1fr; text-align: center;
  }

  .balance-card__value {
     grid-row: auto;
  }
}

/* ---------- Персонажи клуба: звания, ранги, каталог, кладбище ---------- */
.honor {
   display: inline-flex; align-items: center; padding: .15em .7em; font: 600 .78rem/1.5 var(--font-body); color: var(--bone-50); background: rgba(143, 65, 72, .35); border: 1px solid rgba(167, 102, 106, .6); border-radius: 1em; max-width: 100%; text-wrap: balance; overflow-wrap: anywhere;
}

.honor--rank {
   color: var(--navy); background: var(--steel); border-color: var(--steel);
}

.honor--add {
   cursor: pointer; color: var(--steel-bright); background: none; border-style: dashed; border-color: var(--steel-dim); font-family: var(--font-body);
}

.honor--add:hover {
   color: var(--bone-50); border-color: var(--steel);
}

.honors-line {
   display: flex; flex-wrap: wrap; gap: 6px; margin: 0; min-width: 0;
}

.new-char {
   display: grid; gap: var(--space-3); margin: var(--space-4) 0 0; justify-items: start;
}

.new-char textarea {
   resize: vertical; min-height: 64px;
}

.char-card--fallen {
   filter: grayscale(.7); opacity: .85;
}

.char-card__fallen {
   color: var(--rose-light);
}

.catalog-search {
   flex: 1; min-width: 260px;
}

.catalog {
   display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr));
}

.catalog-card {
   display: flex; gap: var(--space-4); align-items: flex-start;
}

.catalog-card__face {
   position: relative; flex: none; width: 84px; height: 92px; display: grid; place-items: center; clip-path: var(--hex); background: transparent; text-decoration: none; font: 700 1.6rem var(--font-heading); color: var(--bone-50);
}

.catalog-card__face::before {
   content: ""; position: absolute; inset: 0; clip-path: var(--hex); background: linear-gradient(160deg, var(--wine-bright), var(--wine-deep));
}

.catalog-card__face span {
   position: relative;
}

.catalog-card__face img {
   position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; clip-path: var(--hex); z-index: 1;
}

.catalog-card__face.has-portrait span {
   display: none;
}

.catalog-card__body {
   flex: 1; min-width: 0; display: grid; gap: 6px;
}

.catalog-card__name {
   margin: 0; font-size: 1.35rem; line-height: 1.2;
}

.catalog-card__name a {
   color: var(--bone-50); text-decoration: none;
}

.catalog-card__name a:hover {
   color: var(--rose-light);
}

.catalog-card__meta {
   margin: 0; font-size: var(--fs-sm); color: var(--text-muted);
}

.catalog-card__desc {
   margin: 2px 0; font-style: italic; line-height: 1.45; color: var(--text); white-space: pre-line;
}

.catalog-card__foot {
   display: flex; flex-wrap: wrap; gap: 4px var(--space-3); margin: 4px 0 0; font-size: .8rem; color: var(--text-faint);
}

.catalog-card__mod {
   margin: 0;
}

.graves {
   display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); align-items: start;
}

.grave {
    display: grid; justify-items: center; gap: 8px; text-align: center; padding: var(--space-6) var(--space-5) var(--space-5);
    background: linear-gradient(180deg, #4a5560, #2c353f 70%); color: #e4e7e2;
    border: 1px solid #5d6a75; border-radius: 140px 140px 14px 14px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .08), 0 18px 30px rgba(0, 0, 0, .35);
}

.grave__face {
   position: relative; width: 76px; height: 84px; display: grid; place-items: center; clip-path: var(--hex); background: #77838c; text-decoration: none; font-size: 1.8rem; color: #2c353f;
}

.grave__face img {
   position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; clip-path: var(--hex); filter: grayscale(1) contrast(.95);
}

.grave__name {
   margin: 4px 0 0; font-size: 1.45rem; line-height: 1.15;
}

.grave__name a {
   color: #f2f1ea; text-decoration: none;
}

.grave__meta, .grave__dates {
   margin: 0; font-size: .82rem; color: #b9c2c7;
}

.grave__dates {
   letter-spacing: .06em;
}

.grave__epitaph {
   margin: 6px 0; font-style: italic; line-height: 1.45; color: #eceee8; white-space: pre-line;
}

.grave__foot {
   margin: 0; font-size: .78rem; line-height: 1.5; color: #aeb7bd;
}

.grave__foot a {
   color: #d3e2e3;
}

.grave .honors-line {
   justify-content: center;
}

.grave .honor {
   background: rgba(0, 0, 0, .25); border-color: #77838c;
}

.grave .honor--rank {
   color: #2c353f; background: #c9d2d6; border-color: #c9d2d6;
}

.contact-btn {
   gap: 8px;
}

.contact-btn svg {
   width: 18px; height: 18px;
}

.contact-master {
   font-size: .85em;
}

.paid-list {
   display: grid; gap: 6px; margin-bottom: var(--space-4);
}

.materials {
   list-style: none; margin: 0; padding: 0; display: grid;
}

.material {
   display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) 0; border-top: 1px solid var(--frame-line);
}

.material:first-child {
   border-top: 0;
}

.material__icon {
   flex: none; display: grid; place-items: center; width: 52px; height: 52px; font: 700 .72rem var(--font-body); letter-spacing: .04em; color: var(--bone-50); background: linear-gradient(160deg, var(--wine-bright), var(--wine-deep)); border-radius: var(--radius-sm);
}

.material__body {
   flex: 1; min-width: 0; display: grid; gap: 2px;
}

.material__body b a {
   color: var(--bone-50); text-decoration: none;
}

.material__body b a:hover {
   color: var(--rose-light);
}

.material__body p {
   margin: 2px 0; font-size: var(--fs-sm); color: var(--text); white-space: pre-line;
}

.material__body small {
   font-size: .78rem; color: var(--text-faint);
}

.material__actions {
   display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3);
}

.material form {
   margin: 0;
}

.materials--compact .material__actions {
   flex-basis: 100%; padding-left: 52px;
}

.materials--compact .material:has(.material__actions) {
   flex-wrap: wrap;
}

@media (max-width: 760px) {
  .material:has(.material__actions) {
     flex-wrap: wrap;
  }

  .material__actions {
     flex-basis: 100%; padding-left: 0;
  }

  .materials--compact .material__actions {
     padding-left: 0;
  }
}

.materials--compact .material {
   padding: var(--space-2) 0;
}

.materials--compact .material__icon {
   width: 40px; height: 40px; font-size: .62rem;
}

/* «Мои персонажи»: лимиты и как начать нового героя */
.char-limits {
   display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0;
}

.limit-pill {
   display: inline-flex; gap: .45em; align-items: baseline; padding: .15em .75em; font-size: var(--fs-xs); color: var(--text-muted); border: 1px solid var(--steel-dim); border-radius: 99px;
}

.limit-pill b {
   color: var(--steel-bright);
}

.limit-pill.is-full {
   border-color: var(--wine-bright);
}

.limit-pill.is-full b {
   color: var(--wine-bright);
}

.char-start {
   display: grid; gap: var(--space-3); grid-template-columns: repeat(4, minmax(0, 1fr));
}

.char-tile {
   display: grid; gap: 4px; align-content: start; padding: var(--space-4); text-align: left; text-decoration: none; color: var(--text-muted);
    font: inherit; cursor: pointer; background: var(--surface, var(--ink-800)); border: 1px solid var(--hair, var(--steel-dim)); border-radius: var(--radius);
    transition: transform .15s, border-color .15s, box-shadow .15s;
}

.char-tile:hover {
   transform: translateY(-2px); border-color: var(--steel); color: var(--text-muted); box-shadow: var(--shadow);
}

.char-tile[aria-expanded="true"] {
   border-color: var(--steel-bright); box-shadow: 0 0 0 1px var(--steel-bright) inset;
}

.char-tile b {
   margin-top: var(--space-2); font: 700 1.1rem/1.2 var(--font-heading); color: var(--bone-50);
}

.char-tile small {
   font-size: var(--fs-xs); line-height: 1.4;
}

.char-tile__icon {
   display: grid; place-items: center; width: 44px; height: 44px; font-size: 1.2rem; color: var(--navy);
    background: linear-gradient(160deg, var(--steel-bright), var(--steel)); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}

.char-tile--main {
   background: radial-gradient(130% 130% at 0% 0%, rgba(167, 102, 106, .45), transparent 65%), var(--surface, var(--ink-800));
    border-color: rgba(167, 102, 106, .6);
}

.char-tile--main .char-tile__icon {
   color: var(--bone-50); background: linear-gradient(160deg, var(--wine-bright), var(--wine-deep));
}

.char-tile--main:hover {
   border-color: var(--wine-bright);
}

.char-panel h2 {
   margin: 0; font-size: var(--fs-lg);
}

.char-panel .new-char {
   margin-top: var(--space-3);
}

@media (max-width: 1100px) {
  .char-start {
     grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .char-start {
     grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.new-char__row {
   display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); width: 100%;
}

.new-char__row .df {
   display: grid; gap: 4px; min-width: 0;
}

.new-char__row .df > span {
   font: 700 .66rem/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted);
}

@media (max-width: 420px) {
  .char-tile {
     padding: var(--space-3);
  }
}

/* сообщения об ошибках в Зале Совета */
.bug {
   display: grid; gap: var(--space-3);
}

.bug.is-resolved {
   opacity: .72;
}

.bug__head {
   display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap;
}

.bug__who, .bug__state {
   display: flex; align-items: center; gap: var(--space-2) var(--space-3); flex-wrap: wrap;
}

.bug__state {
   margin-left: auto;
}

.bug__status {
   margin: 0;
}

.bug__text {
   margin: 0; white-space: pre-wrap;
}

.bug__meta {
   margin: 0; font-size: var(--fs-xs); color: var(--text-muted); word-break: break-all;
}

.bug__reply {
   padding: var(--space-2) var(--space-3); border-left: 3px solid var(--emerald); background: rgba(127, 174, 143, .1); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.bug__reply p {
   margin: 4px 0 0;
}

.bug__shot img {
   max-width: min(100%, 420px); max-height: 320px; border-radius: var(--radius-sm); border: 1px solid var(--frame-line);
}

.bug__thread {
   border-top: 1px solid var(--hair); padding-top: var(--space-3); display: grid; gap: var(--space-2);
}

.bug__thread[hidden], .bug__replies[hidden] {
   display: none;
}

.bug__thread-title {
   margin: 0; font-family: var(--font-heading); font-size: 1rem; letter-spacing: .03em; color: var(--steel-bright);
}

.bug__comments {
   list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2);
}

.bug__comment {
   display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--hair); border-radius: var(--radius-sm); background: rgba(164, 191, 195, .04);
}

.bug__comment--support {
   border-color: rgba(127, 174, 143, .35); background: rgba(127, 174, 143, .07);
}

.bug__comment-main {
   display: grid; gap: 6px; min-width: 0;
}

.bug__comment-head {
   display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2);
}

.bug__comment-text {
   margin: 0; white-space: pre-wrap;
}

.bug__reply-toggle summary {
   width: max-content; cursor: pointer; font-size: var(--fs-xs); color: var(--steel-bright);
}

.bug__reply-form {
   display: grid; gap: var(--space-2); margin-top: var(--space-2);
}

.bug__replies {
   list-style: none; margin: var(--space-2) 0 0; padding: 0 0 0 var(--space-4); border-left: 2px solid var(--hair); display: grid; gap: var(--space-2);
}

.bug__replies .bug__comment {
   padding: var(--space-2) var(--space-3); background: rgba(0, 0, 0, .12);
}

.bug__composer {
   display: grid; gap: var(--space-2);
}

.bug__composer-label {
   font-family: var(--font-heading); font-weight: 700; font-size: .95rem; letter-spacing: .03em; color: var(--steel-bright);
}

.bug__composer textarea {
   min-height: 72px;
}

.bug__composer-actions {
   display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap;
}

.bug__checks {
   display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
}

.bug__composer-status {
   margin: 0; font-size: var(--fs-xs); color: var(--emerald);
}

.bug__composer-status.is-error {
   color: var(--rose-light);
}

.session-form__all {
   max-width: 340px;
}

.xp-cell {
   display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}

.session-form__pay {
   margin: var(--space-3) 0;
}

.session-form__pay > summary {
   cursor: pointer; font-weight: 600;
}

.reports-block {
   margin-bottom: var(--space-6);
}

.reports-block h2 {
   display: flex; align-items: center; gap: var(--space-2);
}

.session-list {
   display: grid; gap: var(--space-2); margin: var(--space-3) 0 0; padding: 0; list-style: none;
}

.session-list__row {
   display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); padding: var(--space-3) var(--space-4);
}

.session-list__row small {
   display: block;
}

.session-list__excerpt {
   margin: 6px 0 0; font-size: var(--fs-sm); color: var(--text-muted);
}

/* ---------- Тайный вход в автомат «КРИТ!»: посередине между логотипом и меню ---------- */
.secret-slot-wrap {
   flex: 1 1 auto; display: flex; justify-content: center; align-items: center; min-width: 36px;
}

.secret-slot {
   display: grid; place-items: center; width: 40px; height: 40px; opacity: 0; transition: opacity .5s ease;
}

.secret-slot svg {
   width: 28px; height: 28px; filter: drop-shadow(0 0 6px rgba(231, 200, 115, .55));
}

.secret-slot:hover, .secret-slot:focus-visible {
   opacity: 1;
}

.secret-slot:hover svg {
   animation: secret-wiggle .7s ease-in-out;
}

.secret-slot:focus-visible {
   outline: none;
}

.secret-slot:focus-visible svg {
   outline: 2px solid var(--steel); outline-offset: 3px; border-radius: 6px;
}

@media (hover: none) {
  .secret-slot svg {
     width: 24px; height: 24px;
  }
}

/* на телефоне наведения нет — автомат невидим, но место для тапа остаётся */
.secret-slot:active {
   opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .secret-slot:hover svg {
     animation: none;
  }
}

/* ---------- Партия на странице игры: карточки в основной колонке ---------- */
.party__head {
   display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-3);
}

.party__head h2 {
   margin: 0;
}

.party__seats {
   display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); color: var(--text-muted);
}

/* страница игры на телефоне: описание → запись → «Написать Мастеру» → партия → остальное */
@media (max-width: 900px) {
  .game-layout {
     display: flex; flex-direction: column; align-items: stretch; gap: var(--space-4);
  }

  .game-layout > .stack {
     display: contents;
  }

  .game-layout > .stack > * {
     order: 5;
  }

  .game-layout .game-cover {
     order: 1;
  }

  .game-layout .game-join {
     order: 2;
  }

  .game-layout .contact-btn {
     order: 3;
  }

  .game-layout .party {
     order: 4;
  }

  .game-layout > * > * {
     margin-top: 0;
  }
}

/* Mini App: заставка входа */
.tg-app {
   text-align: center;
}

.tg-app__logo {
   margin: 0 auto var(--space-3); border-radius: 22%; box-shadow: var(--shadow);
}

/* ---------- Покупка пакета переводом ---------- */
.buy__form {
   display: grid; gap: var(--space-3);
}

.buy__packages {
   display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: var(--space-2);
}

.buy__pkg {
   position: relative; display: grid; justify-items: center; gap: 2px; padding: var(--space-3) var(--space-2); text-align: center; border: 1px solid var(--ink-600); border-radius: var(--radius-sm); background: rgba(11, 15, 28, .4); cursor: pointer; transition: border-color .12s, background .12s;
}

.buy__pkg input {
   position: absolute; opacity: 0; pointer-events: none;
}

.buy__pkg b {
   font: 700 1.8rem/1 var(--font-heading); color: var(--bone-50);
}

.buy__pkg span {
   font-size: var(--fs-xs); color: var(--text-muted);
}

.buy__pkg em {
   margin-top: 4px; font-style: normal; font-weight: 700; color: var(--steel-bright);
}

.buy__pkg:hover {
   border-color: var(--steel-dim);
}

.buy__pkg:has(input:checked) {
   border-color: var(--wine-bright); background: rgba(143, 65, 72, .3); box-shadow: inset 0 0 0 1px var(--wine-bright);
}

.buy__pkg:has(input:focus-visible) {
   outline: 2px solid var(--steel); outline-offset: 2px;
}

.buy__details {
   display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); padding: var(--space-3); border: 1px dashed var(--steel-dim); border-radius: var(--radius-sm);
}

.buy__details dl {
   display: grid; grid-template-columns: auto 1fr; gap: 4px var(--space-3); margin: 0;
}

.buy__details dt {
   color: var(--text-muted); font-size: var(--fs-sm);
}

.buy__details dd {
   margin: 0;
}

.buy__qr {
   border-radius: var(--radius-sm); background: #fff; padding: 6px;
}

.buy__requests {
   list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--fs-sm);
}

.buy__requests span {
   color: var(--text-muted);
}

.buy__status--approved {
   color: var(--emerald);
}

.buy__status--rejected {
   color: var(--rose-light);
}

.pay-list {
   display: grid; gap: var(--space-2);
}

.pay-item {
   display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4);
}

.pay-item__who {
   display: flex; align-items: center; gap: var(--space-2); flex: 1 1 220px;
}

.pay-item__sum {
   display: grid; text-align: right;
}

.pay-item__sum b {
   font: 700 1.3rem var(--font-heading); color: var(--steel-bright);
}

.pay-item__sum small {
   color: var(--text-muted);
}

.pay-item__actions {
   display: flex; flex-wrap: wrap; gap: var(--space-2); flex: 1 1 100%;
}

.pay-prices {
   grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.pay-qr {
   display: block; margin-bottom: 6px; background: #fff; border-radius: var(--radius-sm);
}

/* опрос партии */
.poll__list {
   list-style: none; margin: 0 0 var(--space-3); padding: 0; display: grid; gap: var(--space-2);
}

.poll__row {
   display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--space-3); align-items: center; padding: var(--space-2) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-sm);
}

.poll__row.is-mine {
   border-color: var(--wine-bright); background: rgba(143, 65, 72, .18);
}

.poll__opt {
   padding: 0; font: inherit; font-weight: 700; color: var(--bone-50); text-align: left; background: none; border: 0; cursor: pointer;
}

button.poll__opt:hover {
   color: var(--rose-light);
}

.poll__count {
   font: 700 1.2rem var(--font-heading); color: var(--steel-bright);
}

.poll__who {
   grid-column: 1 / -1;
}

/* форма игры и мероприятия: «Своё время» */
.custom-time {
   display: grid; gap: var(--space-2);
}

[data-custom-fields][hidden] {
   display: none;
}

/* кнопка выбора черты вместо выпадающего списка */
.feat-pick__open {
   display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* подпись над значением — единая */
.label {
    font: 600 .7rem/1.2 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint);
}

.pip {
   clip-path: none; border-radius: 50%; width: 9px; height: 9px;
}

/* --- главная --- */
.hero__banner {
   box-shadow: none; border: 1px solid var(--hair);
}

/* --- игры --- */
.game-card__title {
   font: 700 1.2rem/1.2 var(--font-heading); letter-spacing: .02em;
}

/* фокус с клавиатуры — одинаковый у всех элементов */
:is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
   outline: 2px solid var(--wine-bright); outline-offset: 2px;
}

/* выпадающие списки: своя стрелка, одинаковые везде */
select:not([multiple]):not([size]) {
    -webkit-appearance: none; appearance: none; padding-right: 2.1em !important; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238d9ca6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important; background-position: right .75em center !important; background-size: 11px 8px !important;
}

select option {
   color: var(--bone-ink); background: var(--bone-50);
}

/* окна: затемнение с лёгким размытием, круглая кнопка закрытия */
dialog::backdrop {
   background: rgba(5, 8, 16, .7); backdrop-filter: blur(2px);
}

/* Зал Совета на телефоне: колонка не растягивается по широкой таблице, разделы — одной прокручиваемой лентой */
@media (max-width: 860px) {
  .council {
     grid-template-columns: minmax(0, 1fr);
  }

  .council > * {
     min-width: 0;
  }

  .council__nav {
     flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 4px; padding-bottom: 2px;
  }

  .council__nav::-webkit-scrollbar {
     display: none;
  }

  .council__nav a {
     flex: none; white-space: nowrap;
  }

  .council__title {
     flex: none; width: auto; padding: 0 var(--space-2) 0 0; align-self: center;
  }
}

/* выбор файла: кнопка в общем стиле вместо системной */
input[type="file"] {
   font: inherit; font-size: var(--fs-sm); color: var(--text-muted);
}

input[type="file"]::file-selector-button {
    margin-right: .75em; padding: .45em 1em; font: 700 .92rem/1.2 var(--font-heading); letter-spacing: .04em; cursor: pointer;
    color: var(--text); background: var(--soft); border: 1px solid var(--hair-strong); border-radius: var(--radius-sm); transition: border-color .12s, background .12s;
}

input[type="file"]::file-selector-button:hover {
   border-color: var(--steel-dim); background: rgba(236, 233, 221, .1);
}

/* роли — одной строкой с ровным отступом, в узкой ячейке не разъезжаются */
.role-badges {
   display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 4px; vertical-align: middle;
}

.role-badges:empty {
   display: none;
}

/* --- правка справочника суперпользователем («✎ Изменить» под описанием) --- */
.ref-edit {
   position: relative;
}

.ref-edit__open {
    display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 2px 8px; font: 600 .75rem/1.4 var(--font-ui); color: var(--text-muted);
    background: none; border: 1px dashed var(--hair-strong); border-radius: 999px; cursor: pointer; opacity: .75; transition: opacity .12s, color .12s, border-color .12s;
}

.ref-edit__open:hover, .ref-edit__open:focus-visible {
   opacity: 1; color: var(--wine-bright); border-color: var(--wine-bright);
}

.ref-edit__form {
   display: grid; gap: 6px; margin: 4px 0;
}

.ref-edit__area {
   width: 100%; min-height: 6em; padding: 8px 10px; font: inherit; font-size: .92rem; line-height: 1.45; resize: vertical; color: inherit; background: var(--tile, rgba(255, 255, 255, .04)); border: 1px solid var(--hair-strong); border-radius: 8px;
}

.ref-edit__hint {
   margin: 0; font-size: .75rem; color: var(--text-faint);
}

.ref-edit__row {
   display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}

.ref-edit__status {
   font-size: .8rem; color: var(--text-muted);
}

.crop {
   display: grid; gap: 12px; padding: 16px;
}

.crop__title {
   margin: 0; font-size: 1.15rem;
}

.crop__hint {
   margin: 0; font-size: var(--fs-sm); color: var(--text-muted);
}

.crop__view {
   position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: #000; touch-action: none; cursor: grab; user-select: none; outline: none;
}

.crop__view:active {
   cursor: grabbing;
}

.crop__view:focus-visible {
   box-shadow: 0 0 0 2px var(--wine-bright);
}

.crop__view img {
   position: absolute; top: 0; left: 0; max-width: none; height: auto; transform-origin: 0 0; pointer-events: none;
}

.crop__frame {
   position: absolute; inset: 0; border-radius: 12px; box-shadow: inset 0 0 0 2px rgba(236, 233, 221, .85); pointer-events: none;
}

.crop__frame::after {
   content: ""; position: absolute; inset: 0; background:
    linear-gradient(rgba(236, 233, 221, .18), rgba(236, 233, 221, .18)) 33.33% 0 / 1px 100% no-repeat,
    linear-gradient(rgba(236, 233, 221, .18), rgba(236, 233, 221, .18)) 66.66% 0 / 1px 100% no-repeat,
    linear-gradient(rgba(236, 233, 221, .18), rgba(236, 233, 221, .18)) 0 33.33% / 100% 1px no-repeat,
    linear-gradient(rgba(236, 233, 221, .18), rgba(236, 233, 221, .18)) 0 66.66% / 100% 1px no-repeat;
}

.crop__zoom {
   display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; color: var(--text-muted); font-weight: 700;
}

.crop__zoom input {
   width: 100%; accent-color: var(--wine-bright);
}

.crop__row {
   display: flex; justify-content: flex-end; gap: 8px;
}

/* Предзапись в форме анонса: Мастер отмечает игроков из зарегистрированных */
.prebook {
   display: grid; gap: var(--space-2);
}

.prebook__list {
   display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 4px var(--space-3);
    max-height: 260px; overflow-y: auto; margin-top: var(--space-2); padding: var(--space-2) var(--space-3); border: 1px solid var(--steel-dim); border-radius: var(--radius-sm);
}

.prebook__item {
   min-width: 0;
}

.prebook__item span {
   overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.prebook__item[hidden] {
   display: none;
}

.hb-pop__item {
   margin-top: 10px;
}

.hb-pop__item > b {
   display: block; margin-bottom: 2px; color: var(--bone-50);
}

.hb-new {
   display: flex; flex-wrap: wrap; gap: 6px;
}

/* теги участника на профиле — отдельной строкой под ролями */
.profile-tags {
   display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: var(--space-2);
}

/* «Участвовал(а) в» на профиле: игра, дата, Мастер и персонаж */
.played {
   list-style: none; margin: 0 0 var(--space-3); padding: 0; display: grid; gap: 4px;
}

.played li {
   display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-3); padding: 8px 12px;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(11, 15, 28, .45);
}

.played li[hidden] {
   display: none;
}

.played a {
   text-decoration: none;
}

.played small {
   grid-column: 1; font-size: .75rem; color: var(--text-muted);
}

.played__hero {
   grid-row: 1 / span 2; grid-column: 2; align-self: center; display: grid; justify-items: end; font-size: var(--fs-sm); font-weight: 700; color: var(--rose-light);
}

.played__hero small {
   font-weight: 400;
}

@media (max-width: 560px) {
  .played li {
     grid-template-columns: 1fr;
  }

  .played__hero {
     grid-row: auto; grid-column: 1; justify-items: start;
  }
}

.session-list__actions {
   gap: 6px; flex-wrap: wrap; justify-content: flex-end;
}

.session-list__actions form {
   margin: 0;
}

/* предзапись: игроки прошлой сессии кампании — первыми и с пометкой */
.prebook__item.is-last span {
   font-weight: 700;
}

.prebook__last {
   margin-left: auto; font-size: .7rem; font-weight: 700; color: var(--emerald);
}

/* ---------- 20. Единый вид полей по всему сайту ----------
   База для любого поля без своего оформления (:where — нулевая специфичность: стили компонентов главнее).
   Тёмное поле на тёмных страницах, светлое — на «пергаменте»; фокус — винная рамка с мягким кольцом. */
:where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="submit"], [type="button"], [type="reset"], [type="hidden"], [type="color"], [type="image"]), select, textarea) {
    box-sizing: border-box; max-width: 100%; padding: .45em .65em; font: inherit; color: var(--text);
    background-color: rgba(11, 15, 28, .45); border: 1px solid var(--hair-strong); border-radius: var(--radius-sm);
    transition: border-color .12s, box-shadow .12s, background-color .12s;
}

:where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]):hover:not(:disabled, :focus), select:hover:not(:disabled, :focus), textarea:hover:not(:disabled, :focus)) {
   border-color: var(--steel-dim);
}

:where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]):focus, select:focus, textarea:focus) {
   outline: none; border-color: var(--wine-bright); box-shadow: 0 0 0 3px rgba(143, 65, 72, .22);
}

:where(input:disabled, select:disabled, textarea:disabled) {
   opacity: .55;
}

::placeholder {
   color: var(--text-faint); opacity: 1;
}

/* стрелки числовых полей — только при наведении и в фокусе, иначе ряды чисел шумят */
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button {
   opacity: 0; transition: opacity .12s;
}

input[type="number"]:is(:hover, :focus)::-webkit-inner-spin-button {
   opacity: .6;
}

input[type="number"] {
   -moz-appearance: textfield;
}

input[type="number"]:is(:hover, :focus) {
   -moz-appearance: auto;
}

/* иконка календаря и часов в полях даты — в цвет текста */
input:is([type="date"], [type="time"], [type="datetime-local"])::-webkit-calendar-picker-indicator {
   opacity: .6; cursor: pointer;
}

input:is([type="date"], [type="time"], [type="datetime-local"])::-webkit-calendar-picker-indicator:hover {
   opacity: 1;
}

/* раскрытый список: тёмный на тёмных страницах, светлый на «пергаменте» */
select option, select optgroup {
   color: var(--text); background: var(--ink-800);
}

/* ползунок — в цвет акцента */
input[type="range"] {
   accent-color: var(--wine-bright);
}

/* мелкие ячейки таблиц (уровни хоумбрю и подобные) — компактнее, но тем же полем */
.hb-cell input {
   min-height: 32px; padding: 4px 2px;
}

/* ---------- 21. Проход по страницам: отступы и мелочи (ноябрь 2026) ---------- */
/* значки плиток «Мои персонажи» — скруглённые квадраты, как значки главной (шестигранник — только у к20) */
.char-tile__icon {
   clip-path: none; border-radius: 12px;
}

.char-tile:hover {
   box-shadow: none;
}

/* Карточка предмета — страница хоумбрю-предмета и предпросмотр в кузнице */
.item-card {
   position: relative; padding: var(--space-5); border: 2px solid color-mix(in srgb, var(--rar) 70%, transparent); border-radius: var(--radius); background:
    radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--rar) 14%, transparent), transparent 60%), var(--surface);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .3) inset, 0 10px 30px -18px var(--rar);
}

.item-card__name {
   margin: 6px 0 4px; font-family: var(--font-display); font-size: 1.8rem; line-height: 1.15;
}

.item-card__line {
   margin: 0 0 var(--space-3); color: var(--text-muted); font-style: italic;
}

.item-card__bonus {
   margin: var(--space-3) 0; padding: 8px 12px; border-left: 3px solid var(--rar); border-radius: 0 8px 8px 0; background: rgba(0, 0, 0, .18);
}

.item-card__prop {
   margin: var(--space-3) 0 0;
}

.item-card__prop b {
   color: var(--rar);
}

.item-card__curse {
   margin-top: var(--space-4); padding: 10px 12px; border: 1px dashed var(--wine); border-radius: 8px; background: rgba(143, 65, 72, .12);
}

.item-card__meta {
   display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--hair); color: var(--text-muted); font-size: .9rem;
}

@media (max-width: 600px) {
  .item-card {
     padding: var(--space-4);
  }

  .item-card__name {
     font-size: 1.45rem;
  }
}

/* ---------- 23. Дизайн-проход (ноябрь 2026, 2) ---------- */
/* подвал карточки игры: имя Мастера в одну строку с аватаром, места не переносятся */
.game-card__master {
   flex-wrap: nowrap; min-width: 0;
}

.game-card__master-name {
   overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.game-card__seats {
   flex: none; flex-wrap: nowrap; white-space: nowrap;
}

/* Мастера клуба: имя и системы рядом с аватаром, цифры — плитками «подпись над значением» */
.master-card {
   display: flex; flex-direction: column; gap: var(--space-4); color: inherit; text-decoration: none;
}

.master-card:hover {
   color: inherit;
}

.master-card__head {
   display: flex; align-items: center; gap: var(--space-4); min-width: 0;
}

.master-card__who {
   min-width: 0;
}

.master-card__name {
   margin: 0 0 var(--space-1); line-height: 1.15;
}

.master-card__stats {
   display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin: auto 0 0;
}

.master-card__stats > div {
   padding: 8px 12px; border: 1px solid var(--hair); border-radius: 10px; background: var(--surface-2);
}

.master-card__stats dt {
   font: 600 .7rem/1.2 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint);
}

.master-card__stats dd {
   margin: 2px 0 0; font: 700 1.35rem/1.1 var(--font-heading); color: var(--bone-50);
}

.profile-tabs {
   margin-bottom: var(--space-5);
}

@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]), select, textarea {
     font-size: max(16px, 1em);
  }
}

/* ---------- Бухгалтерия (Зал Совета → Оплаты) ---------- */
.acc-month {
   display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2);
}

.acc-month__title {
   margin: 0 var(--space-2);
}

.acc-month__csv {
   margin-left: auto;
}

.acc-kpis {
   display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3);
}

.acc-kpi {
   display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--hair); border-radius: 10px; background: var(--surface);
}

.acc-kpi span {
   font: 600 .85rem/1.3 var(--font-ui); color: var(--text-muted);
}

.acc-kpi b {
   font: 700 1.45rem/1.15 var(--font-heading); color: var(--bone-50); font-variant-numeric: lining-nums tabular-nums;
}

.acc-kpi small {
   color: var(--text-muted);
}

.acc-kpi--total {
   border-color: color-mix(in srgb, var(--wine-bright) 60%, transparent); background: color-mix(in srgb, var(--wine) 18%, var(--surface));
}

.acc-games {
   display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-2); margin: 0 0 var(--space-3);
}

.acc-games > div {
   padding: 8px 12px; border: 1px solid var(--hair); border-radius: 10px; background: var(--surface-2);
}

.acc-games dt {
   font: 600 .7rem/1.2 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint);
}

.acc-games dd {
   margin: 2px 0 0; font: 700 1.3rem/1.1 var(--font-heading); color: var(--bone-50); font-variant-numeric: lining-nums tabular-nums;
}

.acc-year tr.is-current td {
   background: var(--soft);
}

.acc-year tfoot th, .acc-year tfoot td {
   border-top: 1px solid var(--hair-strong);
}

/* ---------- Касса и сверка по игрокам ---------- */
.acc-head {
   display: grid; gap: var(--space-3); margin-bottom: var(--space-5); padding-bottom: var(--space-4); border-bottom: 1px solid var(--frame-line);
}

.acc-tabs {
   margin: 0; justify-self: start; max-width: 100%;
}

.acc-tools {
   display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
}

.acc-add {
   display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3);
}

.acc-add__more {
   display: inline-flex; border: 1px solid var(--hair-strong); border-radius: 8px; overflow: hidden;
}

.acc-add__more a {
   display: inline-flex; align-items: center; min-height: 32px; padding: 0 .85em; color: var(--text); font: 600 .85rem/1 var(--font-ui); text-decoration: none; background: var(--soft);
}

.acc-add__more a + a {
   border-left: 1px solid var(--hair-strong);
}

.acc-add__more a:hover {
   background: rgba(236, 233, 221, .1);
}

.acc-add__more a:focus-visible, .acc-search input:focus-visible {
   outline: 2px solid var(--steel-bright); outline-offset: 2px;
}

.acc-search {
   position: relative; display: flex; align-items: center; margin-left: auto; flex: 1 1 220px; max-width: 320px;
}

.acc-search__icon {
   position: absolute; left: 11px; color: var(--text-faint); pointer-events: none;
}

.acc-search input {
   width: 100%; min-height: 34px; padding: 0 12px 0 34px; color: var(--text); font: 400 .95rem/1 var(--font-body); background: var(--surface-2); border: 1px solid var(--hair-strong); border-radius: 8px;
}

.acc-search input::placeholder {
   color: var(--text-faint);
}

@media (max-width: 640px) {
  .acc-search {
     margin-left: 0; max-width: none; flex-basis: 100%;
  }
}

.search-summary {
   color: var(--text-muted);
}

.search-help {
   margin: 0; padding-left: 1.2em; display: grid; gap: 6px;
}

.acc-kpi--debt {
   border-color: color-mix(in srgb, var(--ember) 45%, transparent);
}

.acc-kpi--debt b {
   color: var(--ember);
}

.h-sub {
   margin: var(--space-4) 0 var(--space-2); font: 600 .95rem/1.3 var(--font-ui); color: var(--text-muted);
}

.is-in {
   color: var(--emerald);
}

.is-out {
   color: var(--rose-light);
}

.ledger-sum.is-in, .ledger-sum.is-out, .reconcile-total {
   font-weight: 600;
}

.ledger-filter {
   display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-4) 0;
}

.ledger-cats {
   display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-2); margin: 0;
}

.ledger-cats > div {
   padding: 8px 12px; border-left: 3px solid var(--hair-strong); background: var(--surface-2); border-radius: 0 8px 8px 0;
}

.ledger-cats > .is-in {
   border-left-color: var(--emerald);
}

.ledger-cats > .is-out {
   border-left-color: var(--rose-light);
}

.ledger-cats dt {
   font-size: .85rem; color: var(--text-muted);
}

.ledger-cats dt a {
   color: inherit;
}

.ledger-cats dd {
   margin: 2px 0 0; font: 700 1.1rem/1.2 var(--font-heading); color: var(--bone-50); font-variant-numeric: lining-nums tabular-nums;
}

.ledger-dir {
   display: flex; flex-wrap: wrap; gap: var(--space-3); margin: 0 0 var(--space-3); padding: 0; border: 0;
}

.ledger-dir legend {
   width: 100%; margin-bottom: 4px; padding: 0;
}

.ledger-actions {
   display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center;
}

.reconcile-how summary {
   cursor: pointer; font-weight: 600;
}

.reconcile-how ul {
   margin: var(--space-2) 0 0; padding-left: 1.2em; display: grid; gap: 4px;
}

.reconcile-events .ev--opening td, .reconcile-events .ev--paid td, .reconcile-events .ev--site td, .reconcile-events .ev--single td {
   background: color-mix(in srgb, var(--emerald) 7%, transparent);
}

.reconcile-events .ev--master td {
   background: color-mix(in srgb, var(--steel) 9%, transparent);
}

.reconcile-events .ev__ok {
   color: var(--emerald);
}

/* ---------- Выбор игровой системы (system-picker.js) — одинаковый во всех формах ---------- */
.sys-picker {
   position: relative;
}

.sys-picker__list {
   position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none;
    max-height: 300px; overflow-y: auto; border: 1px solid var(--hair-strong); border-radius: 10px; background: var(--surface);
}

.sys-picker__list[hidden] {
   display: none;
}

.sys-picker__item {
   display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; padding: 7px 10px; border-radius: 7px; cursor: pointer; color: var(--text);
}

.sys-picker__item:hover, .sys-picker__item.is-active {
   background: var(--soft);
}

.sys-picker__item.is-active {
   box-shadow: inset 2px 0 0 var(--wine-bright);
}

.sys-picker__name {
   font-weight: 600;
}

.sys-picker__alias {
   color: var(--text-faint);
}

.sys-picker__sheet {
   margin-left: auto; padding: 0 8px; border: 1px solid color-mix(in srgb, var(--emerald) 60%, transparent); border-radius: 99px; color: var(--emerald); font-size: .75rem;
}

.sys-picker__new {
   padding: 7px 10px; color: var(--text-muted); font-size: .9rem; font-style: italic;
}

/* Зал Совета → Игровые системы */
.sys-list {
   display: grid; gap: var(--space-2);
}

.sys-row {
   padding: 0;
}

.sys-row__head {
   display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px var(--space-4); cursor: pointer; list-style: none;
}

.sys-row__head::-webkit-details-marker {
   display: none;
}

.sys-row__name {
   font: 700 1.1rem/1.2 var(--font-heading); color: var(--bone-50);
}

.sys-row__uses {
   margin-left: auto;
}

.sys-row.is-new {
   border-color: color-mix(in srgb, var(--ember, #c9884a) 60%, transparent);
}

.sys-row__form, .sys-row__merge {
   display: grid; gap: var(--space-3); padding: 0 var(--space-4) var(--space-4);
}

.sys-row__merge {
   display: flex; flex-wrap: wrap; gap: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--hair);
}

.sys-row__merge select {
   flex: 1 1 200px; min-width: 0;
}

.sys-row__checks {
   gap: var(--space-4); flex-wrap: wrap;
}

.section-tabs a {
   display: flex; align-items: center; min-height: 44px;
}

.board-filter {
    display: grid; gap: var(--space-2); margin-bottom: var(--space-5);
    padding: var(--space-3); border: 1px solid var(--hair); border-radius: var(--radius);
    background: var(--surface-2);
}

.board-search {
   display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2); max-width: 46rem;
}

.board-filter__options {
   display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3);
}

.board-filter__reset {
   display: inline-flex; align-items: center; min-height: 44px;
}

.board-filter__reset {
   justify-self: start;
}

.master-card__name {
   font-size: var(--fs-lg); overflow-wrap: anywhere;
}

.master-card__bio {
   margin: 0; overflow-wrap: anywhere;
}

/* липкая плашка «Записаться» внизу экрана — только на телефоне; блок записи в колонке справа уезжает вниз */
.join-bar {
   display: none;
}

@media (max-width: 860px) {
  .join-bar {
        position: fixed; z-index: 40; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom));
        display: flex; align-items: center; gap: var(--space-3); padding: 8px 8px 8px 14px;
        border: 1px solid var(--hair-strong); border-radius: 14px; background: color-mix(in srgb, var(--surface) 94%, transparent);
        backdrop-filter: blur(6px); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); transition: transform .2s, opacity .2s;

  }

  .join-bar.is-hidden {
     transform: translateY(calc(100% + 16px)); opacity: 0; pointer-events: none;
  }

  .join-bar__info {
     display: flex; flex-direction: column; min-width: 0; line-height: 1.2;
  }

  .join-bar__info small {
     color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
}

@media (prefers-reduced-motion: reduce) {
  .join-bar {
     transition: none;
  }
}

/* абонемент: цена одной игры и выгода пакета под ценой */
.buy__pkg .buy__per {
   font-size: .78rem; line-height: 1.25; color: var(--text-muted);
}

.buy__pkg .buy__per b {
   font: 700 .78rem/1 var(--font-ui); color: var(--emerald);
}

/* главная участника: пульт вместо баннера */
.dash {
   margin: var(--space-5) 0 var(--space-4);
}

.dash__head {
   display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4);
}

.dash__head h2 {
   margin: 0;
}

.dash__title {
   display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); min-width: 0;
}

.dash__guide {
   padding: .25em .7em .3em; border: 1px solid var(--hair-strong); border-radius: 999px; color: var(--steel); text-decoration: none; font: 600 .85rem/1.2 var(--font-ui); white-space: nowrap; transition: color .12s, border-color .12s, background .12s;
}

.dash__guide:hover {
   color: var(--steel-bright); border-color: var(--steel-dim); background: rgba(164, 191, 195, .08);
}

.dash__grid {
   display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: var(--space-4); align-items: start;
}

.dash__games h3 {
   margin: 0 0 var(--space-3);
}

.dash__sub {
   margin-top: var(--space-4) !important;
}

.dash__side {
   display: grid; gap: var(--space-3);
}

.dash-list {
   display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); margin: 0; padding: 0; list-style: none;
}

.dash-row {
   display: flex; align-items: center; gap: var(--space-3); padding: 8px 10px; color: inherit; text-decoration: none;
    border: 1px solid var(--hair); border-radius: 10px; background: var(--surface-2); transition: border-color .12s;
}

.dash-row:hover {
   color: inherit; border-color: var(--hair-strong);
}

.dash-row__date {
   display: grid; justify-items: center; flex: none; width: 44px; padding: 2px 0; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted);
}

.dash-row__date b {
   font: 700 1.35rem/1.05 var(--font-heading); color: var(--bone-50); font-variant-numeric: lining-nums;
}

.dash-row__main {
   display: flex; flex-direction: column; min-width: 0; flex: 1;
}

.dash-row__main b {
   overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.dash-row__main small {
   color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.dash-tile {
   display: grid; gap: 2px; padding: 12px 16px; color: inherit; text-decoration: none;
}

.dash-tile:hover {
   color: inherit;
}

.dash-tile__label {
   font: 600 .7rem/1.2 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint);
}

.dash-tile__value {
   font: 700 1.8rem/1.1 var(--font-heading); color: var(--bone-50); font-variant-numeric: lining-nums tabular-nums;
}

.dash-tile small {
   color: var(--text-muted);
}

.dash-tile--warn {
   border-color: color-mix(in srgb, var(--ember, #c9884a) 60%, transparent);
}

@media (max-width: 760px) {
  .dash__grid {
     grid-template-columns: minmax(0, 1fr);
  }

  /* 1fr растягивался по длинному названию — дашборд вылезал за экран */
  .dash__side {
     grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

/* «Мои персонажи»: когда герои есть, плитки создания — компактной строкой под ними */
.char-start__title {
   margin: var(--space-3) 0 0; font-size: 1.15rem;
}

.char-start--compact .char-tile {
   grid-template-columns: auto 1fr; align-items: center; column-gap: var(--space-3); padding: 10px 12px;
}

.char-start--compact .char-tile__icon {
   grid-row: span 2; width: 36px; height: 36px; font-size: 1rem;
}

.char-start--compact .char-tile b {
   margin: 0; font-size: 1rem;
}

.char-start--compact .char-tile small {
   display: none;
}

@media (max-width: 600px) {
  .char-start--compact {
     grid-template-columns: 1fr 1fr;
  }
}

/* регистрация: путь через email свёрнут — главный путь Telegram */
.reg-alt {
   margin-top: var(--space-4);
}

.reg-alt > summary {
   cursor: pointer; text-align: center; color: var(--bone-ink-soft, var(--text-muted)); font-size: .95rem; list-style: none; padding: 8px; border-radius: 8px;
}

.reg-alt > summary::-webkit-details-marker {
   display: none;
}

.reg-alt > summary:hover {
   text-decoration: underline;
}

.reg-alt[open] > summary {
   margin-bottom: var(--space-3);
}

/* форма анонса: «Повторить прошлый анонс» и кнопка отправки, которая всегда под рукой */
.repeat-pick {
   margin-top: var(--space-4); padding: 10px 14px; border: 1px solid var(--bone-400); border-radius: 10px; background: rgba(143, 65, 72, .05);
}

.repeat-pick > summary {
   cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-height: 28px;
}

.repeat-pick > summary::-webkit-details-marker {
   display: none;
}

.repeat-pick__list {
   display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-2); margin-top: var(--space-3);
}

.repeat-pick__item {
   display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border: 1px solid var(--bone-400); border-radius: 8px; color: var(--bone-ink); text-decoration: none; background: var(--bone-50);
}

.repeat-pick__item:hover {
   border-color: var(--wine); color: var(--bone-ink);
}

.repeat-pick__item.is-current {
   border-color: var(--wine); box-shadow: inset 0 0 0 1px var(--wine);
}

.repeat-pick__item b {
   overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.repeat-pick__item small {
   color: var(--bone-ink-soft);
}

/* Mini App внутри Telegram: нижнее меню разделов, без подвала; плашку записи заменяет большая кнопка Telegram */
.tg-tabbar {
   display: none;
}

.in-tg .tg-tabbar {
    position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); border-top: 1px solid var(--hair-strong);
    background: color-mix(in srgb, var(--ink-900) 96%, transparent); backdrop-filter: blur(6px);
}

.in-tg .tg-tabbar a {
   display: grid; justify-items: center; gap: 1px; padding: 6px 2px; min-height: 48px; border-radius: 10px;
    font: 600 .7rem/1.2 var(--font-ui); color: var(--text-muted); text-decoration: none;
}

.in-tg .tg-tabbar a span {
   font-size: 1.15rem; line-height: 1.2;
}

.in-tg .tg-tabbar a[aria-current="page"] {
   color: var(--bone-50); background: rgba(143, 65, 72, .35);
}

.in-tg body {
   padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

.in-tg .join-bar {
   display: none;
}

.in-tg .dice-fab {
   bottom: calc(76px + env(safe-area-inset-bottom));
}

/* доступность: винный как ЦВЕТ ТЕКСТА — светлый оттенок (5.4:1); тёмный --wine-bright остаётся для рамок */
.char-limits .is-full, .limit-pill.is-full b {
   color: var(--rose-light);
}

/* Лимиты героев — плитки «число + подпись», как на пульте главной */
.char-limits {
   display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--space-2);
}

.limit-tile {
   display: flex; align-items: baseline; gap: 10px; padding: 10px 14px; border: 1px solid var(--hair); border-radius: 10px; background: var(--surface-2);
}

.limit-tile b {
   flex: none; font: 700 1.5rem/1 var(--font-heading); color: var(--bone-50); font-variant-numeric: tabular-nums;
}

.limit-tile b small {
   font-size: .95rem; color: var(--text-muted);
}

.limit-tile span {
   font-size: var(--fs-sm); line-height: 1.3; color: var(--text-muted);
}

.limit-tile.is-full {
   border-color: rgba(167, 102, 106, .55);
}

.limit-tile.is-full b {
   color: var(--rose-light);
}

/* Нижняя панель Mini App: тонкие иконки бренда вместо эмодзи, активный раздел — винная «капсула» под иконкой */
.in-tg .tg-tabbar a {
   gap: 3px; padding: 5px 2px 4px; background: none;
}

.in-tg .tg-tabbar a[aria-current="page"] {
   background: none; color: var(--bone-50);
}

.tab-ico {
   display: grid; place-items: center; width: 46px; height: 28px; border-radius: 99px; transition: background .15s;
}

.tab-ico svg {
   width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

.in-tg .tg-tabbar a[aria-current="page"] .tab-ico {
   background: rgba(143, 65, 72, .55); color: var(--bone-50);
}

.in-tg .tg-tabbar a:not([aria-current]) .tab-ico {
   color: var(--steel);
}

/* иконки плиток «Новый персонаж» — той же тонкой линией, что и нижняя панель */
.char-tile__icon svg {
   width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}

.char-start--compact .char-tile__icon svg {
   width: 18px; height: 18px;
}

/* лимиты: на телефоне две плитки рядом — число сверху, подпись под ним */
@media (max-width: 600px) {
  .char-limits {
     grid-template-columns: 1fr 1fr;
  }

  .limit-tile {
     display: grid; gap: 4px; align-content: start; padding: 10px 12px;
  }

  .limit-tile span {
     font-size: .8rem;
  }
}

.char-limits {
   align-items: stretch;
}

/* «Мои персонажи»: создание по шагам — система, затем (для D&D) тип игр */
.char-new {
   display: grid; gap: var(--space-3);
}

.char-new__step {
   display: grid; gap: var(--space-3); justify-items: start;
}

.char-new__step[hidden] {
   display: none;
}

.char-new__n {
   margin: 0; font: 700 .68rem/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--rose-light);
}

.char-new h2 {
   margin: -4px 0 0;
}

.sys-pick {
   display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); width: 100%;
}

.sys-card {
   display: grid; gap: 6px; align-content: start; padding: var(--space-4); text-decoration: none; color: var(--text-muted);
    border: 1px solid var(--hair, var(--ink-600)); border-radius: 12px; background: var(--surface-2, rgba(11, 15, 28, .45));
    transition: border-color .12s, transform .12s, background .12s;
}

.sys-card:hover, .sys-card:focus-visible {
   color: var(--text-muted); border-color: var(--wine-bright); background: rgba(143, 65, 72, .14); transform: translateY(-2px);
}

.sys-card > b {
   font: 700 1.35rem/1.15 var(--font-heading); color: var(--bone-50);
}

.sys-card > span {
   font-size: var(--fs-sm); line-height: 1.45;
}

.sys-card > em {
   margin-top: 4px; font-style: normal; font-size: var(--fs-sm); font-weight: 700; color: var(--steel-bright, var(--steel));
}

.sys-card__icon {
   display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 4px; border-radius: 12px; color: var(--bone-50);
    background: linear-gradient(160deg, var(--wine-bright), var(--wine-deep));
}

.sys-card__icon svg {
   width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}

.sys-card__count {
   font-size: var(--fs-xs); color: var(--text-faint);
}

.sys-card__count b {
   font: 700 1.5rem/1 var(--font-heading); color: var(--bone-50); font-variant-numeric: tabular-nums;
}

.sys-card.is-full {
   border-style: dashed;
}

.sys-card.is-full > em, .sys-card.is-full .sys-card__count b {
   color: var(--rose-light);
}

@media (max-width: 640px) {
  .sys-pick {
     grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sys-card:hover, .sys-card:focus-visible {
     transform: none;
  }
}

/* Новая операция кассы */
.ledger-kinds {
   flex-wrap: wrap; margin: 0 0 var(--space-3);
}

.ledger-form [hidden] {
   display: none;
}

.debt-rules {
   display: grid; gap: var(--space-2); margin-top: var(--space-4); justify-items: start;
}

/* Шапки вкладок «Игр» одной высоты — вкладки не сдвигаются */
.games-page .page-head {
   min-height: 89px;
}

@media (max-width: 900px) {
  .games-page .page-head {
     min-height: 114px;
  }
}

@media (max-width: 720px) {
  .games-page .page-head {
     min-height: 141px;
  }
}

@media (max-width: 600px) {
  .games-page .page-head {
     min-height: 146px;
  }
}

/* единое скругление кнопок: как у .btn */
.ref-edit__open {
   border-radius: var(--radius-sm);
}

/* Совет: навигация держится под шапкой и не обрезается при прокрутке */
@media (max-width: 860px) {
  .council__nav {
        position: sticky;
        top: 69px;
        z-index: 40;
        margin-inline: calc(var(--space-4) * -1);
        padding: 6px var(--space-4) 8px;
        background: var(--ink-950);
        border-bottom: 1px solid var(--frame-line);

  }
}
