:root {
  --bg: #0d1524;
  --bg-2: #111b2e;
  --card: #18233a;
  --line: #2a3b58;
  --text: #eef3fb;
  --muted: #8a9bb5;
  --brand: #f0c14b;
  --brand-hover: #f6d36e;
  --ink: #14100a;
  --sans: "Manrope", system-ui, sans-serif;
  --display: "Unbounded", var(--sans);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.container {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(13, 21, 36, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.header__in {
  display: grid;
  grid-template-columns: auto auto minmax(180px, 1fr) auto;
  grid-template-areas: "logo nav search actions";
  align-items: center;
  gap: 8px 16px;
  height: 76px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  grid-area: logo;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.logo__mark {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 2px;
  background: var(--brand);
  box-shadow: 0 0 12px rgba(240, 193, 75, 0.55);
}

.header__menu {
  display: contents;
}

.header__menu nav {
  display: flex;
  grid-area: nav;
  gap: 4px;
}

.header__menu nav a {
  position: relative;
  padding: 8px 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}

.header__menu nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.header__menu nav a:hover {
  color: var(--text);
}

.header__menu nav a:hover::after,
.header__menu nav a.is-on::after {
  transform: scaleX(1);
}

.header__menu nav a.is-on {
  color: var(--text);
}

.header__actions {
  display: flex;
  grid-area: actions;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.account {
  position: relative;
}

.header__user {
  display: flex;
  grid-area: actions;
  align-items: center;
  justify-self: end;
  gap: 4px;
}

.notes { position: relative; }

.notes__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
}

.notes__btn:hover,
.notes.is-open .notes__btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.notes__btn .account__badge {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
}

.notes__menu {
  min-width: 300px;
  max-width: min(360px, calc(100vw - 32px));
}

.notes__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 360px;
  overflow: auto;
}

.notes__list li {
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.notes__list li.is-unread {
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--brand);
}

.notes__empty {
  margin: 0;
  padding: 10px 12px 12px;
  color: var(--muted);
  font-size: 14px;
}

.account__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 10px 0 6px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.account__btn:hover { background: rgba(255, 255, 255, 0.05); }

.account.is-open .account__btn { background: rgba(255, 255, 255, 0.06); }

.account__ava {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
}

.account__chev { color: var(--muted); transition: transform 0.2s ease; }

.account.is-open .account__chev { transform: rotate(180deg); }

.account__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.account__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 220px;
  padding: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.account__who {
  margin: 0 0 6px;
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--line);
}

.account__who strong {
  display: block;
  font-size: 14px;
}

.account__who span {
  color: var(--muted);
  font-size: 13px;
}

.account__menu a,
.account__menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}

.account__menu a:hover,
.account__menu button:hover {
  background: var(--card);
}

.account__menu form {
  display: block;
  margin: 6px 0 0;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.account__menu form button { color: var(--muted); font-weight: 600; }

.header__search {
  grid-area: search;
  display: flex;
  align-items: center;
  height: 38px;
  max-width: 240px;
  width: 100%;
  padding: 0 4px 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
}

.header__search:focus-within {
  border-color: rgba(240, 193, 75, 0.45);
  background: rgba(255, 255, 255, 0.06);
}

.header__search input {
  flex: 1;
  min-width: 0;
  height: 38px;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.header__search input::placeholder { color: var(--muted); }

.header__search input[type="search"] {
  appearance: none;
  -webkit-appearance: none;
}

.header__search input[type="search"]::-webkit-search-decoration,
.header__search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.header__search button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.header__search button:hover,
.header__search:focus-within button {
  color: var(--brand);
}

.link {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--brand);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.btn-sm { height: 40px; padding: 0 14px; font-size: 14px; }

.btn-hero {
  height: 56px;
  padding: 0 28px;
  font-size: 17px;
  border-radius: 14px;
}

.btn:hover { background: var(--brand-hover); }

.btn-ghost,
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-outline { border-color: var(--brand); color: var(--brand); }
.btn-ghost:hover,
.btn-outline:hover { border-color: var(--text); color: var(--text); background: transparent; }

.burger {
  display: none;
  width: 40px;
  height: 40px;
  margin-left: auto;
  background: none;
  border: 0;
  position: relative;
}

.burger span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--text);
}

.burger span:nth-child(1) { top: 13px; }
.burger span:nth-child(2) { top: 19px; }
.burger span:nth-child(3) { top: 25px; }

.hero { padding: 32px 0 8px; }

.hero__panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: stretch;
  min-height: 380px;
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
}

.hero__text {
  padding: 40px 36px 40px 32px;
  border-left: 6px solid var(--brand);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.hero__kicker {
  margin: 0 0 12px;
  color: var(--brand);
  font-weight: 600;
}

h1 {
  margin: 0 0 16px;
  font-family: var(--display);
  font-size: clamp(32px, 4.4vw, 52px);
  font-weight: 700;
  line-height: 1.15;
}

h1 span { color: var(--brand); }

.hero__lead {
  margin: 0 0 28px;
  max-width: 36rem;
  color: var(--muted);
  font-size: 18px;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
}

.hero__cta p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.master-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.master-tile {
  display: grid;
  gap: 10px;
  padding: 0 0 14px;
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  min-width: 0;
  color: inherit;
}
.master-tile:hover .master-tile__name { color: var(--brand); }
.master-tile__photo {
  display: block;
  aspect-ratio: 1;
  background: #111 center / cover no-repeat;
}
.master-tile__name {
  margin: 0 14px;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.master-tile__rating {
  margin: 0 14px;
  color: var(--brand);
  font-size: 14px;
  font-weight: 700;
}
.master-tile__rating.is-empty {
  color: var(--muted);
  font-weight: 500;
}

.master-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
}
.master-card {
  display: none;
}

.hero__media {
  min-width: 0;
  min-height: 280px;
  background: #111;
}

.hero__art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.section { padding: 56px 0; }
.section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.section-head h2 { margin: 0; }
.section-head .btn { flex: 0 0 auto; }

.home-block {
  padding: 28px;
  background: var(--card);
  border-radius: 20px;
}
.home-block .section-head {
  margin-bottom: 20px;
}
.home-block .master-tile {
  background: var(--bg);
}

.cal-page h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 40px);
}
.cal-head {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 24px;
}
.cal-head > div:first-child {
  padding-left: 16px;
  border-left: 6px solid var(--brand);
}
.cal-head .muted { margin: 0; max-width: 36rem; }
.cal-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cal-nav strong {
  min-width: 10.5rem;
  text-align: center;
  font-family: var(--display);
  font-size: 18px;
}
.cal-stats {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.cal-stats li {
  padding: 16px 18px;
  background: var(--card);
  border-radius: 16px;
}
.cal-stats span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.cal-stats strong {
  display: block;
  font-size: 18px;
  line-height: 1.3;
}
.cal-stats p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.cal-wrap {
  overflow: auto;
  background: var(--card);
  border-radius: 20px;
}
.cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  min-width: 980px;
}
.cal__dow {
  padding: 12px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.cal-day {
  min-height: 148px;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}
.cal-day.is-today .cal-day__num {
  border-radius: 8px;
  background: var(--brand);
  color: var(--ink);
}
.cal-day.is-out { opacity: 0.38; }
.cal-event {
  display: block;
  margin: 0 0 6px;
  padding: 8px;
  border-radius: 10px;
  background: var(--bg-2);
}
.cal-event:last-child { margin-bottom: 0; }
.cal-event b {
  display: block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}
.cal-event span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.cal-event__desc {
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cal-event.is-open { box-shadow: inset 3px 0 0 var(--brand); }
.cal-event:hover { background: #1d2b47; }

.profile-page h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 40px);
}
.profile-head {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 40px;
}
.profile-head > div {
  padding-left: 16px;
  border-left: 6px solid var(--brand);
}
.profile-head .muted { margin: 0; max-width: 36rem; }
.profile-head > .btn { flex: 0 0 auto; }
.profile-id {
  display: flex;
  gap: 24px;
  align-items: center;
}
.profile-ava {
  width: 88px;
  height: 88px;
  flex: 0 0 auto;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 21, 36, 0.72);
  color: var(--brand);
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
}
.profile-page .profile-hero {
  min-height: 320px;
  padding: 40px;
  margin-bottom: 48px;
}
.profile-hero .profile-id {
  max-width: 46rem;
  padding-left: 0;
  border-left: 0;
}
.profile-hero .profile-id__bio { color: inherit; opacity: 0.86; }
.profile-hero .btn-ghost {
  background: rgba(13, 21, 36, 0.72);
  backdrop-filter: blur(8px);
}
.profile-id__bio {
  margin: 12px 0 0;
  max-width: 40rem;
  color: var(--muted);
}
.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 48px;
  align-items: start;
}
.profile-layout--settings {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}
.profile-main { display: grid; gap: 20px; }
.profile-panel {
  padding: 24px;
  background: var(--bg-2);
  border-radius: 20px;
}
.profile-panel h2 {
  font-size: 22px;
  margin: 0 0 20px;
}
.profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0 0 20px;
  padding-left: 16px;
  border-left: 6px solid var(--brand);
}
.profile-tabs button {
  padding: 0 0 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}
.profile-tabs button.is-on {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--brand);
}
.profile-tabs button:hover { color: var(--text); }
.profile-side h2 { font-size: 18px; }
.profile-panel > .muted:first-of-type { margin: 0; }
.profile-panel .muted + .game-feed { margin-top: 16px; }
.feed-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.feed-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}
.feed-head strong { margin: 0; }
.feed-head a { color: var(--brand); }
.feed-head a:hover { color: var(--brand-hover); }
.feed-tools {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}
.feed-tools form { display: inline-flex; margin: 0; }
.feed-tools .icon-btn {
  width: 32px;
  height: 32px;
}
.feed-tools .icon-btn svg { width: 15px; height: 15px; }
.feed-text { margin: 6px 0 0; }
.feed-item.is-editing .feed-text { display: none; }
form.feed-edit {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}
form.feed-edit[hidden] { display: none !important; }
.feed-edit__actions {
  display: flex;
  gap: 8px;
}
.profile-panel .game-avatar { background: var(--bg); }
.profile-panel .game-feed a { color: var(--brand); }
.profile-panel .game-feed a:hover { color: var(--brand-hover); }
.profile-panel .game-form { margin-top: 20px; }
.profile-panel .game-form textarea { min-height: 108px; }
.profile-side {
  display: grid;
  gap: 20px;
}
.profile-inv,
.profile-stats,
.profile-achs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.profile-inv,
.profile-achs {
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 10px;
}
.profile-inv li,
.profile-achs li {
  position: relative;
  display: flex;
}
.profile-inv .inv-icon,
.profile-achs .inv-icon {
  width: 48px;
  height: 48px;
  background: var(--card);
}
.profile-inv .inv-icon svg,
.profile-achs .inv-icon svg { width: 22px; height: 22px; }
.profile-inv li.is-on .inv-icon { box-shadow: inset 0 0 0 2px var(--brand); }
.profile-inv__qty {
  position: absolute;
  right: -4px;
  bottom: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-stats li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.profile-stats li:first-child { padding-top: 0; }
.profile-stats li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.profile-stats span { color: var(--muted); }
.profile-stats strong {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
}
.profile-more { margin: 16px 0 0; }
.profile-more a { color: var(--brand); font-weight: 600; }
.profile-tables {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.profile-table {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 14px;
  background: var(--card);
  border-radius: 20px;
}
.profile-table__cover {
  height: 112px;
  border-radius: 14px;
  background: #111 center / cover no-repeat;
}
.profile-table__title { font-weight: 700; font-size: 18px; }
.profile-table__title:hover { color: var(--brand); }
.profile-table p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.profile-table p a { color: var(--brand); }
.profile-table p a:hover { color: var(--brand-hover); }
.profile-table .btn { justify-self: end; }
.profile-page .form-stack .profile-table__cover {
  width: 100%;
  max-width: 280px;
  height: 120px;
}
.profile-table .cta-panel { justify-self: end; }
.profile-panel .form-stack {
  margin: 0;
  max-width: none;
}
.profile-panel .form-stack .btn,
.profile-panel .form-stack .btn-outline,
.profile-page .form-stack .btn,
.profile-page .form-stack .btn-outline {
  grid-column: auto;
  justify-self: start;
  width: auto;
}

h2 {
  margin: 0 0 24px;
  padding-left: 16px;
  border-left: 6px solid var(--brand);
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
}

.card:hover h3 { color: var(--brand); }

.card__cover {
  position: relative;
  height: 210px;
  background: #111 center / cover no-repeat;
}

.chip {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.82);
  font-size: 13px;
  font-weight: 700;
}

.chip-seats {
  left: auto;
  right: 12px;
  color: var(--brand);
}

.card h3 {
  margin: 12px 14px 4px;
  font-size: 18px;
  font-weight: 700;
}

.card .card__desc {
  margin: 0 14px 8px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card p {
  margin: 0 14px 16px;
  color: var(--muted);
  font-size: 14px;
}

.table-wrap {
  overflow: auto;
  background: var(--card);
  border-radius: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

tr.open td:last-child { color: var(--brand); font-weight: 700; }

.about {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 40px;
}

.about > div p { color: var(--muted); }

.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.facts li {
  padding: 18px 18px 16px;
  background: var(--card);
  border-radius: 16px;
}

.facts h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.facts p { margin: 0; color: var(--muted); }

.section-form { background: var(--bg-2); }

.form-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 40px;
}

.form-grid > div p { color: var(--muted); }

form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.full, form .btn { grid-column: 1 / -1; }

input, select, textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  outline: none;
}

input:focus, select:focus, textarea:focus { border-color: var(--brand); }
textarea { min-height: 96px; resize: vertical; }

.header__search input {
  height: 38px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
}

.header__search input:focus {
  border: 0;
  outline: none;
  box-shadow: none;
}

.ok {
  grid-column: 1 / -1;
  margin: 0;
  color: #f0c14b;
}

.footer {
  padding: 40px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.footer__in {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
}

.footer__brand {
  max-width: 420px;
}

.footer__brand .logo { margin-bottom: 10px; }

.footer__brand p {
  margin: 0;
  line-height: 1.55;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 20px;
}

.footer__nav a {
  color: var(--muted);
  font-weight: 600;
}

.footer__nav a:hover { color: var(--brand); }

@media (max-width: 980px) {
  .header__in {
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-areas:
      "logo account burger"
      "search search search";
    position: relative;
    height: auto;
    padding: 10px 0 12px;
    gap: 8px 12px;
  }
  .header__user { grid-area: account; }
  .header__search { max-width: none; }
  .header__menu { display: none; }
  .header__menu.is-open {
    display: flex;
    flex-direction: column;
    gap: 16px;
    grid-column: 1 / -1;
    padding: 8px 0 4px;
    background: transparent;
    border: 0;
  }
  .header__menu.is-open nav {
    flex-direction: column;
    gap: 4px;
  }
  .header__menu.is-open nav a {
    padding: 12px 8px;
    border-radius: 8px;
  }
  .header__menu.is-open nav a::after { display: none; }
  .header__menu.is-open nav a.is-on {
    color: var(--brand);
  }
  .header__menu.is-open .header__actions {
    justify-content: stretch;
    flex-direction: column;
    align-items: stretch;
  }
  .burger { display: block; grid-area: burger; margin-left: 0; }
  .footer__in { flex-direction: column; gap: 24px; }
  .footer__nav { justify-content: flex-start; }
  .hero__panel,
  .cards,
  .about,
  .form-grid,
  form { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  .hero__panel { min-height: 0; }
  .hero__text { padding: 28px 24px 28px 22px; }
  .hero__media { min-height: 220px; }
  .hero__art { height: 220px; }
  .game-layout { grid-template-columns: 1fr; }
  .join-sheet__body { grid-template-columns: 1fr; }
  .join-sheet__info { border-right: 0; border-bottom: 1px solid var(--line); }
  .join-sheet__row { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters__search,
  .filters__dates { grid-column: 1 / -1; }
  .game-side { position: static; }
  .cal-stats { grid-template-columns: 1fr; }
  .cal-head { align-items: start; }
  .profile-layout { grid-template-columns: 1fr; }
  .profile-page .profile-hero { padding: 28px; min-height: 260px; }
  .profile-table { grid-template-columns: 96px minmax(0, 1fr); }
  .profile-table .btn,
  .profile-table .cta-panel { grid-column: 1 / -1; justify-self: start; }
  .profile-table__cover { height: 72px; }
  .inv-item { grid-template-columns: 56px minmax(0, 1fr); }
  .inv-item form,
  .inv-item__buy { grid-column: 1 / -1; justify-self: start; }
  .inv-stage { grid-template-columns: 1fr; }
  .inv-detail { order: -1; }
}

@media (max-width: 600px) {
  .cards { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
}

.flash-wrap { min-height: 0; }
.flash {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line);
}
.flash-ok { border-color: var(--brand); color: var(--brand); }
.flash-error { border-color: #c45c5c; color: #f0b4b4; }
.muted { color: var(--muted); }
.muted a { color: var(--brand); }

.cta-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: start;
}

.auth-box { max-width: 520px; }
.auth-box p { color: var(--muted); }
.form-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: 560px;
}
.page-head form {
  display: inline-flex;
  grid-template-columns: none;
  margin: 0;
}
.join-sheet {
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
}
.join-sheet__head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 76px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: #111 center / cover no-repeat;
  overflow: hidden;
}
.join-sheet__head::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(13, 21, 36, 0.88) 0%, rgba(13, 21, 36, 0.55) 100%);
  pointer-events: none;
}
.join-sheet__head > * {
  position: relative;
  z-index: 1;
}
.join-sheet__head p {
  margin: 0 0 2px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
}
.join-sheet__head h1 {
  margin: 0;
  font-size: 18px;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(52vw, 640px);
}
.join-sheet__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(238, 243, 251, 0.16);
  border-radius: 12px;
  background: rgba(13, 21, 36, 0.72);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  flex: 0 0 auto;
  backdrop-filter: blur(8px);
}
.join-sheet__back:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.join-sheet__body {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: stretch;
}
.join-sheet__info {
  padding: 22px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
}
.join-stat {
  margin: 0 0 16px;
}
.join-stat:last-child { margin-bottom: 0; }
.join-stat span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.join-stat strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}
.join-stat a { color: var(--brand); }
.join-stat a:hover { color: var(--brand-hover); }
form.join-sheet__form {
  display: flex;
  flex-direction: column;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 0;
  padding: 22px;
  max-width: none;
}
form.join-sheet__form input[type="hidden"] { display: none; }
form.join-sheet__form .btn {
  align-self: start;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  margin-top: 8px;
  grid-column: auto;
}
form.join-sheet__form textarea { min-height: 96px; }
form.join-sheet__form .muted { margin: 0; }
.join-sheet__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}
.join-sheet__row .muted {
  margin: 6px 0 0;
  font-size: 13px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(90px, 1fr) minmax(90px, 1fr) minmax(190px, 1.4fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 24px;
}
.filters--shop {
  grid-template-columns: minmax(90px, 1fr) minmax(90px, 1fr) minmax(90px, 1fr);
}
.filters__search {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  gap: 12px;
}
.filters__search label { flex: 1; min-width: 0; }
.games-toolbar {
  display: block;
  padding: 20px;
}
.games-toolbar .filters--games,
.games-toolbar .filters--shop {
  margin: 0;
  width: 100%;
}
.games-toolbar .filters__search.ws-search {
  align-items: center;
  margin-bottom: 4px;
}
.games-toolbar .filters__search.ws-search input[type="search"] {
  flex: 1 1 200px;
  min-width: 0;
  height: 40px;
  margin: 0;
}
.games-toolbar .filters label {
  margin: 0;
}
.shop-toolbar {
  display: block;
  padding: 16px 20px;
}
.shop-toolbar .filters--shop-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: end;
  gap: 10px;
  margin: 0;
  width: 100%;
  grid-template-columns: none;
}
.shop-toolbar .filters__q {
  flex: 1 1 160px;
  min-width: 120px;
  height: 40px;
  margin: 0;
}
.shop-toolbar .filters--shop-row > label {
  flex: 0 1 140px;
  min-width: 110px;
  margin: 0;
}
.shop-toolbar .filters--shop-row select {
  height: 40px;
  margin: 0;
}
.shop-toolbar .filters__actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}
.shop-toolbar .filters__actions .btn {
  height: 40px;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .shop-toolbar .filters--shop-row {
    flex-wrap: wrap;
  }
  .shop-toolbar .filters__q {
    flex: 1 1 100%;
  }
  .shop-toolbar .filters__actions {
    margin-left: auto;
  }
}

/* Shop item */
.shop-item .container {
  display: grid;
  gap: 20px;
}
.shop-item__head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: center;
  justify-content: space-between;
}
.shop-item__head-copy {
  min-width: 0;
  flex: 1 1 220px;
}
.shop-item__head-copy .hero__kicker {
  margin: 0 0 8px;
}
.shop-item__head-copy .hero__kicker a {
  color: inherit;
  text-decoration: none;
}
.shop-item__head-copy .hero__kicker a:hover {
  color: var(--text);
}
.shop-item__head h1 {
  margin: 0;
  padding-left: 16px;
  border-left: 6px solid var(--brand);
  font-size: clamp(24px, 3.4vw, 34px);
}
.shop-item__head > .btn {
  flex: 0 0 auto;
}
.shop-item__body {
  display: grid;
  grid-template-columns: minmax(200px, 0.85fr) minmax(0, 1.15fr);
  gap: 20px;
  align-items: stretch;
}
.shop-item__media {
  padding: 28px;
  display: grid;
  place-items: center;
  min-height: 240px;
}
.shop-item__img {
  display: block;
  width: min(220px, 80%);
  height: auto;
  max-height: 240px;
  object-fit: contain;
}
.shop-item__info {
  display: grid;
  gap: 16px;
  align-content: start;
}
.shop-item__info h2 {
  margin: 0;
  font-size: 22px;
}
.shop-item__info > .muted,
.shop-item__info > .game-desc {
  margin: 0;
}
.shop-item__facts {
  margin-top: 4px;
}
.shop-item__buyrow {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
}
.shop-item__price {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  color: var(--brand);
  line-height: 1.1;
}
.shop-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
@media (max-width: 800px) {
  .shop-item__body {
    grid-template-columns: 1fr;
  }
  .shop-item__media {
    min-height: 180px;
  }
}
.filters__dates .filters__range {
  display: flex;
  align-items: center;
  gap: 6px;
}
.filters__range span {
  color: var(--muted);
  flex: 0 0 auto;
}
.filters__range input {
  min-width: 0;
  flex: 1;
  padding-left: 8px;
  padding-right: 8px;
}
.cards.is-loading { opacity: 0.55; pointer-events: none; }

.game-page .lead { color: var(--muted); max-width: 46rem; }
.game-hero {
  position: relative;
  min-height: 300px;
  padding: 32px;
  border-radius: 20px;
  background: #111 center / cover no-repeat;
  margin-bottom: 28px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.game-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 28%, rgba(13, 21, 36, 0.88) 100%);
  pointer-events: none;
}
.game-hero__copy {
  position: relative;
  z-index: 1;
  max-width: 40rem;
  padding-left: 16px;
  border-left: 6px solid var(--brand);
}
.game-hero__copy h1 { margin: 0 0 8px; }
.game-hero__copy p { margin: 0 0 6px; }
.game-hero__copy p:last-child { margin-bottom: 0; }
.game-hero__copy a { color: var(--brand); }
.game-hero__copy a:hover { color: var(--brand-hover); }
.shop-page .game-hero::after {
  background: linear-gradient(180deg, rgba(13, 21, 36, 0.12) 18%, rgba(13, 21, 36, 0.9) 100%);
}
.game-hero__seats {
  color: var(--brand);
  font-weight: 700;
}
.game-hero__tools {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
}
.game-hero__tools form {
  display: inline-flex;
  margin: 0;
}
.game-hero__tools .icon-btn {
  background: rgba(13, 21, 36, 0.72);
  border-color: rgba(238, 243, 251, 0.16);
  color: var(--text);
  backdrop-filter: blur(8px);
}
.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}
.game-desc {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.game-main {
  display: grid;
  gap: 20px;
  min-width: 0;
}
.game-block {
  margin: 0;
  padding: 24px;
  background: var(--card);
  border-radius: 20px;
}
.game-block h2 {
  margin: 0 0 16px;
  font-size: 22px;
}
.game-block > .muted { margin: 0; }
.game-block .game-form { margin-top: 16px; }
.game-roster,
.game-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.game-roster li,
.game-feed li {
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 14px;
}
.game-roster li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.game-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}
.game-roster strong,
.game-feed strong { display: block; }
.game-roster p,
.game-feed p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.game-feed strong span { color: var(--brand); font-weight: 700; }
.game-reply { color: var(--text) !important; }
.game-form {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px;
  margin-top: 16px;
}
.game-form .btn { width: fit-content; }
.game-side {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 16px;
}
.game-master {
  color: inherit;
  text-decoration: none;
}
.game-master p { margin: 0; }
.game-master:hover strong { color: var(--brand); }
.game-master__who {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.game-master strong {
  display: block;
  font-size: 16px;
}
.game-master__rating {
  margin: 4px 0 0;
  color: var(--brand);
  font-size: 14px;
  font-weight: 700;
}
.game-master__bio {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.game-panel {
  padding: 20px;
  background: var(--card);
  border-radius: 16px;
  display: grid;
  gap: 10px;
}
.game-panel__kicker {
  margin: 0;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
}
.game-facts {
  margin: 0;
  display: grid;
  gap: 8px;
}
.game-facts div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
}
.game-facts dt {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.game-facts dd {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}
.game-facts a,
.filter-note a {
  color: var(--brand);
}
.game-facts a:hover,
.filter-note a:hover {
  color: var(--brand-hover);
}
.filter-note { margin: 0 0 18px; }
.game-panel__seats {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.game-actions,
.game-panel form {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px;
}
.game-actions .btn,
.game-panel .btn {
  width: 100%;
}
.game-tools {
  display: flex;
  gap: 8px;
}
.icon-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover,
.icon-btn.is-on {
  color: var(--brand);
  border-color: var(--brand);
}
.game-panel .icon-btn,
.game-actions .icon-btn {
  width: 44px;
}
.frame {
  width: min(480px, calc(100% - 32px));
  max-height: min(80vh, 640px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg-2);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.frame::backdrop {
  background: rgba(8, 12, 22, 0.72);
}
.frame__in {
  padding: 22px;
  overflow: auto;
  max-height: min(80vh, 640px);
}
.frame .game-roster li {
  background: var(--card);
}
.frame__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.frame__head h2 {
  margin: 0;
  padding-left: 0;
  border-left: 0;
  font-size: 22px;
}
.frame__text {
  margin: 0 0 22px;
  color: var(--muted);
}
.frame__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.master-page .lead { max-width: 46rem; }
.master-rating {
  margin: 0 0 16px;
  color: var(--brand);
  font-weight: 700;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 16px 0 32px;
}
.row-actions form { display: inline-flex; grid-template-columns: none; }

.cabinet {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 76px);
}
.side {
  padding: 28px 20px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
}
.side__name {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
}
.side__role { margin: 4px 0 20px; color: var(--muted); font-size: 13px; }
.side nav { display: grid; gap: 4px; margin-bottom: 24px; }
.side nav a {
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
}
.side nav a:hover { color: var(--text); background: var(--card); }
.side nav a.is-on { color: var(--text); background: var(--card); }
.side nav a { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.side form { display: block; }
.side .btn-outline { margin-top: 12px; width: 100%; }
.cabinet__main { padding: 28px 32px 48px; }
.cabinet__main h1 {
  font-family: var(--display);
  font-size: 32px;
  margin: 0 0 16px;
}
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 20px; }
.page-head h1 {
  margin: 0;
  padding-left: 16px;
  border-left: 6px solid var(--brand);
}
.page-head > div { flex: 1; min-width: min(100%, 20rem); }
.page-head > div .muted { margin: 8px 0 0; max-width: 40rem; }
.inv-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 48px;
  align-items: start;
}
.inv-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 12px;
}
.inv-thumb {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--card);
  color: var(--brand);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inv-thumb .inv-icon {
  width: 100%;
  height: 100%;
  background: transparent;
  border-radius: 16px;
}
.inv-thumb .inv-icon svg { width: 44px; height: 44px; }
.inv-thumb.is-on { box-shadow: inset 0 0 0 2px var(--brand); }
.inv-thumb.is-eq::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}
.inv-detail .profile-panel { margin: 0; }
.inv-detail__pic {
  aspect-ratio: 1;
  margin: 0 0 20px;
  border-radius: 16px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
}
.inv-detail__pic .inv-icon {
  width: 100%;
  height: 100%;
  background: transparent;
}
.inv-detail__pic .inv-icon svg { width: 88px; height: 88px; }
.inv-detail .muted { margin: 0; }
.inv-detail__desc {
  margin: 14px 0 0;
  color: var(--text);
  line-height: 1.5;
}
.inv-detail__price {
  margin: 18px 0 20px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  color: var(--brand);
}
.inv-detail form { margin: 0; }
.inv-list,
.inv-shop {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  max-width: 760px;
}
.inv-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  background: var(--card);
  border-radius: 16px;
}
.inv-item.is-on { box-shadow: inset 3px 0 0 var(--brand); }
.inv-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  color: var(--brand);
  text-decoration: none;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
}
a.inv-icon:hover { color: var(--brand-hover); }
.inv-icon svg { width: 26px; height: 26px; }
.inv-item h3 { margin: 0; font-size: 16px; }
a.inv-item {
  color: inherit;
  text-decoration: none;
}
a.inv-item:hover h3 { color: var(--brand); }
.inv-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.inv-item form { margin: 0; }
.inv-item__buy {
  display: grid;
  justify-items: end;
  gap: 8px;
}
.inv-item__buy strong {
  font-family: var(--display);
  font-size: 16px;
}
.ava-wrap { position: relative; display: inline-flex; }
.ava-wrap.is-framed { box-shadow: 0 0 0 2px var(--brand); }
.ava-wrap.is-hat::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -5px;
  width: 72%;
  height: 6px;
  transform: translateX(-50%);
  background: var(--brand);
  border-radius: 3px 3px 1px 1px;
  pointer-events: none;
}
.profile-ava.ava-wrap.is-hat::after {
  top: -8px;
  height: 10px;
  border-radius: 5px 5px 2px 2px;
}
.nick-on { color: var(--brand) !important; }
.cards-2 { grid-template-columns: repeat(2, 1fr); max-width: 720px; }
.card-plain { padding: 16px; gap: 8px; }
.card-plain h3 { margin: 0 0 6px; }
.card-plain p { margin: 0 0 12px; }

.sheet-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  max-width: 960px;
}
.sheet-layout .profile-panel:last-of-type { grid-column: 1 / -1; }
.sheet-combat {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.profile-panel .abilities {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.sheet-del { margin-top: 20px; }
.abilities .mod { color: var(--brand); font-weight: 700; font-size: 13px; }
.inline, .admin-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.admin-row input { min-width: 220px; }

.dungeon-scroll { overflow-x: auto; margin: 16px 0; }
.dungeon {
  display: grid;
  grid-template-columns: repeat(24, 18px);
  gap: 1px;
  width: max-content;
  margin: 0;
  background: #0a101c;
  padding: 6px;
  border-radius: 8px;
}
.dungeon span {
  width: 18px;
  height: 18px;
  display: block;
  background: #1a2740;
}
.dungeon .bm-c-floor,
.dungeon .floor { background: #c4b49a; }
.dungeon .bm-c-room,
.dungeon .room { background: #e6d5b8; }
.dungeon .bm-c-door,
.dungeon .door { background: #8a5a2b; }
.dungeon .bm-c-stairs,
.dungeon .stairs { background: var(--brand); }
.dungeon-tools { display: flex; gap: 10px; margin: 12px 0; }
.dungeon-mini { transform: scale(0.7); transform-origin: top left; margin-bottom: -40px; }

/* Карта стола */
.bm-page .profile-head { margin-bottom: 28px; }
.bm {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  max-width: none;
}
.bm--stack {
  grid-template-columns: 1fr;
  gap: 20px;
}
.bm > input[type="hidden"] {
  display: none;
}
.bm-side {
  grid-column: 1;
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 280px;
}
.bm--stack .bm-stage {
  grid-column: auto;
  order: 1;
}
.bm-tools {
  order: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}
.bm-meta {
  order: 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.bm-panel {
  min-width: 0;
  padding: 16px;
  background: var(--card);
  border-radius: 16px;
  display: grid;
  gap: 0;
  align-content: start;
}
.bm-panel h2,
.bm .bm-panel h2 {
  margin: 0 0 10px;
  padding: 0 0 0 16px;
  border: 0;
  border-left: 6px solid var(--brand);
  font-size: 15px;
  line-height: 1.3;
  font-family: var(--display);
  font-weight: 700;
}
.bm-panel--save .btn { margin-top: 4px; }
.bm-stage {
  grid-column: 2;
  min-width: 0;
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 12px;
}
.bm-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  background: var(--card);
  border-radius: 16px;
  min-width: 0;
}
.bm-step > div { min-width: 0; }
.bm .bm-step h2 {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  font-size: 15px;
  line-height: 1.3;
  font-family: var(--display);
  font-weight: 700;
}
.bm-step__n {
  margin: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--brand);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.bm-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.bm-label {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
  min-width: 0;
}
.bm-label select,
.bm-label input[type="text"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.bm-file {
  min-width: 0;
}
.bm-file__cap { display: block; }
.bm-file__row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}
.bm-file input[type="file"] {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}
.bm-file__btn {
  pointer-events: none;
  flex: 0 0 auto;
  margin: 0;
}
.bm-file__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
}
.bm-panel .btn + .bm-label,
.bm-panel .bm-label + .btn,
.bm-panel .btn + .btn {
  margin-top: 8px;
}
.bm-step .btn + .bm-label,
.bm-step .bm-label + .btn,
.bm-step .btn + .btn {
  margin-top: 8px;
}
.bm .btn,
.bm .btn-outline,
.bm .btn-ghost {
  grid-column: auto;
  width: auto;
  max-width: 100%;
  justify-self: start;
}
.bm-side-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.bm-brushes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.bm--stack .bm-brushes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.bm-brush {
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}
.bm-brush.is-on {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(240, 193, 75, 0.08);
}
.bm-status { margin: 10px 0 0; font-size: 13px; }
.bm-status.is-error { color: #f0b4b4; }

.bm-stage__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  justify-content: space-between;
}
.bm-stage__bar strong {
  font-family: var(--display);
  font-size: 15px;
}
.bm-stage__scroll {
  overflow: auto;
  max-height: min(68vh, 640px);
  border-radius: 12px;
  background: #070b14;
  border: 1px solid var(--line);
  padding: 12px;
}
.bm--stack .bm-stage__scroll {
  max-height: min(70vh, 720px);
}
.battlemap {
  display: grid;
  gap: 0;
  width: max-content;
  margin: 0 auto;
  background-color: #0a101c;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 4px;
  touch-action: none;
  user-select: none;
}
.battlemap span {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(238, 243, 251, 0.07);
  background: rgba(8, 12, 22, 0.88);
  cursor: crosshair;
}
.battlemap span:hover { box-shadow: inset 0 0 0 1px var(--brand); }
.battlemap .bm-c-floor,
.battlemap .bm-c-room {
  background: rgba(240, 193, 75, 0.12);
}
.battlemap .bm-c-door { background: rgba(138, 90, 43, 0.5); }
.battlemap .bm-c-stairs { background: rgba(240, 193, 75, 0.42); }
.battlemap:not(.has-bg) span { background: #152036; }
.battlemap:not(.has-bg) .bm-c-floor,
.battlemap:not(.has-bg) .bm-c-room { background: rgba(196, 180, 154, 0.55); }
.battlemap:not(.has-bg) .bm-c-door { background: #8a5a2b; }
.battlemap:not(.has-bg) .bm-c-stairs { background: var(--brand); }
.bm-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.bm-legend span { display: inline-flex; align-items: center; gap: 8px; }
.bm-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
}
.bm-swatch--wall { background: #152036; border: 1px solid var(--line); }
.bm-swatch--floor { background: rgba(196, 180, 154, 0.7); }
.bm-swatch--door { background: #8a5a2b; }
.bm-swatch--stairs { background: var(--brand); }

.bm-check {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.bm-check input { width: auto; height: auto; }
.bm-pub {
  color: var(--brand);
  font-weight: 700;
}
.bm-lib-search {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 24px;
}
.bm-lib-search label { margin: 0; min-width: 240px; }
.bm-lib--public { margin-top: 0; }

/* Workshop-style map library */
.ws-page .container { display: grid; gap: 20px; }
.ws-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto;
  gap: 24px 32px;
  align-items: end;
}
.map-show .ws-hero {
  align-items: center;
}
.map-show .ws-hero__copy .muted { margin-bottom: 0; }
.map-show .ws-hero__cta {
  justify-content: end;
}
.ws-hero__copy h1 {
  margin: 0 0 12px;
  padding-left: 16px;
  border-left: 6px solid var(--brand);
  font-size: clamp(28px, 3.8vw, 40px);
}
.ws-hero__copy .muted { margin: 0 0 20px; max-width: 40rem; }
.ws-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.ws-hero__stats {
  display: grid;
  gap: 12px;
  min-width: 140px;
}
.ws-hero__stats > div {
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 14px;
}
.ws-hero__stats strong {
  display: block;
  font-family: var(--display);
  font-size: 22px;
  color: var(--brand);
  line-height: 1.2;
}
.ws-hero__stats span {
  color: var(--muted);
  font-size: 13px;
}
.ws-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}
.ws-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
  min-width: 0;
  flex: 1 1 280px;
}
.ws-search input[type="search"] {
  flex: 1 1 200px;
  min-width: 0;
  height: 40px;
  margin: 0;
}
.ws-toolbar__count { margin: 0; font-size: 14px; }
.ws-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.ws-card {
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  min-width: 0;
  color: inherit;
  transition: outline-color 0.15s ease;
  outline: 1px solid transparent;
}
.ws-card:hover {
  outline-color: var(--brand);
}
.ws-card:hover .ws-card__title { color: var(--brand); }
.ws-card__preview {
  display: block;
  aspect-ratio: 16 / 10;
  background: #0a1220 center / cover no-repeat;
}
.ws-card__preview:not(.has-bg) {
  background-image:
    linear-gradient(135deg, rgba(240, 193, 75, 0.08), transparent 55%),
    linear-gradient(160deg, #152036, #0a1220);
}
.ws-card__body {
  display: grid;
  gap: 6px;
  padding: 14px 14px 16px;
  align-content: start;
}
.ws-card__title {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-card__meta {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-card__foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 700px) {
  .ws-hero {
    grid-template-columns: 1fr;
  }
  .ws-hero__stats {
    min-width: 0;
  }
  .ws-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

/* Map detail */
.map-show__stage {
  position: relative;
  display: grid;
  gap: 0;
  width: 100%;
  min-width: 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
}
.map-show__tools {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.map-show__tool {
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(238, 243, 251, 0.16);
  background: rgba(13, 21, 36, 0.78);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.map-show__tool svg {
  width: 20px;
  height: 20px;
  display: block;
}
.map-show__tool:hover {
  border-color: rgba(240, 193, 75, 0.55);
  color: var(--brand);
}
.map-show__tool.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--ink);
}
.map-show__tool:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.map-show__pane--image {
  width: 100%;
}
.map-show__img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}
.map-show__empty {
  margin: 0;
  padding: 48px 24px;
  text-align: center;
}
.map-show__grid-scroll {
  overflow: auto;
  padding: 12px;
}
.map-show__below {
  margin: 0;
}
.map-show__actions {
  gap: 10px;
}
.map-show__actions form { margin: 0; }

.bm--readonly .battlemap { cursor: default; }
.bm--readonly .battlemap span { cursor: default; }
.bm-create__form {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  align-items: end;
  width: 100%;
}
.bm-create__form label {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
}
.bm-create__form select {
  width: 100%;
  height: 40px;
  margin: 0;
}
.bm-create__form .btn {
  flex: 0 0 auto;
  height: 40px;
  margin: 0;
  white-space: nowrap;
}
@media (max-width: 800px) {
  .bm-create__form {
    flex-wrap: wrap;
  }
  .bm-create__form label {
    flex: 1 1 calc(50% - 12px);
  }
  .bm-create__form .btn {
    width: 100%;
  }
}
.bm-page .home-block > h2 {
  margin: 0 0 16px;
  font-size: 22px;
}
.bm-page .home-block .bm-lib {
  margin-top: 4px;
}

/* Characters */
.chars-page .home-block > h2 {
  margin: 0 0 16px;
  font-size: 22px;
}
.chars-create__hint { margin: -4px 0 16px; }
.chars-import {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}
.chars-import__file {
  flex: 1 1 280px;
  margin: 0;
}
.chars-import__file input[type="file"] {
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
}
.char-ai__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.char-ai__prompt { margin: 0; }
.char-ai__status { margin: 12px 0 0; }
.char-ai__status.is-error { color: #f0a0a0; }
.char-wiz h2 { margin: 24px 0 12px; font-size: 22px; }
.char-wiz h2:first-of-type { margin-top: 0; }
.char-wiz__basics {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
}
.char-wiz__basics label { margin: 0; }
.char-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.char-pick__card {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.char-pick__card strong {
  font-family: var(--display);
  font-size: 16px;
}
.char-pick__card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.char-pick__card.is-on {
  border-color: var(--brand);
  box-shadow: inset 3px 0 0 var(--brand);
}
.char-pick__more {
  font-size: 12px;
  color: var(--brand);
  text-decoration: none;
}
.char-pick__more:hover { color: var(--brand-hover); }
.char-wiz__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
}
.char-wiz__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.srd-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.srd-tabs__btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 0;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
  box-shadow: inset 0 -2px 0 transparent;
}
.srd-tabs__btn.is-on {
  color: var(--brand);
  box-shadow: inset 0 -2px 0 var(--brand);
}
.srd-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.srd-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 14px;
}
.srd-layout {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.srd-nav h2 {
  margin: 0 0 12px;
  font-size: 18px;
}
.srd-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.srd-nav__list a {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.srd-nav__list a:hover,
.srd-nav__list a.is-on {
  color: var(--text);
  background: var(--bg);
}
.srd-nav__list a.is-on {
  box-shadow: inset 3px 0 0 var(--brand);
  color: var(--brand);
}
.srd-article__back { margin: 0 0 16px; }
.srd-prose {
  max-width: 52rem;
  line-height: 1.65;
}
.srd-prose h1 {
  margin: 0 0 16px;
  padding-left: 16px;
  border-left: 6px solid var(--brand);
  font-size: clamp(26px, 3.4vw, 36px);
}
.srd-prose h2 {
  margin: 28px 0 12px;
  font-size: 22px;
}
.srd-prose h3 {
  margin: 20px 0 8px;
  font-size: 18px;
}
.srd-prose p { margin: 0 0 12px; }
.srd-prose ul {
  margin: 0 0 16px;
  padding-left: 1.2rem;
}
.srd-prose li { margin: 0 0 6px; }
.srd-prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}
.srd-prose code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--bg);
  font-size: 0.92em;
}
@media (max-width: 860px) {
  .srd-layout { grid-template-columns: 1fr; }
}
.chars-create {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  align-items: end;
  width: 100%;
}
.chars-create label {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
}
.chars-create input {
  width: 100%;
  height: 40px;
  margin: 0;
}
.chars-create .btn {
  flex: 0 0 auto;
  height: 40px;
  margin: 0;
  white-space: nowrap;
}
.chars-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.chars-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 14px 16px;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 14px;
}
.chars-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.chars-card__actions form { margin: 0; }
.chars-card__ava {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--card);
  color: var(--brand);
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
}
.chars-card__copy { min-width: 0; }
.chars-card__title {
  display: block;
  margin: 0 0 4px;
  color: var(--text);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}
.chars-card__title:hover { color: var(--brand); }
.chars-card__line {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}
.chars-sheet {
  display: grid;
  gap: 20px;
}
.chars-grid {
  display: grid;
  gap: 12px 16px;
}
.chars-grid--identity {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.chars-grid--combat {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.chars-grid--notes {
  grid-template-columns: 1fr;
}
.chars-grid label { margin: 0; }
.chars-grid__wide { grid-column: 1 / -1; }
.chars-sheet .abilities {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.chars-sheet .abilities label {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 12px;
  background: var(--bg);
  border-radius: 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}
.chars-sheet .abilities input {
  width: 100%;
  margin: 0;
  text-align: center;
}
.chars-sheet__foot {
  margin-top: 16px;
}
.chars-del {
  display: flex;
  justify-content: flex-start;
}
@media (max-width: 800px) {
  .chars-create {
    flex-wrap: wrap;
  }
  .chars-create label {
    flex: 1 1 calc(50% - 12px);
  }
  .chars-create label:first-child {
    flex: 1 1 100%;
  }
  .chars-create .btn {
    width: 100%;
  }
  .chars-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }
  .chars-card__actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .chars-card__ava {
    width: 48px;
    height: 48px;
    font-size: 15px;
  }
  .chars-grid--identity,
  .chars-grid--combat {
    grid-template-columns: 1fr 1fr;
  }
  .chars-sheet .abilities {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .chars-grid--identity,
  .chars-grid--combat {
    grid-template-columns: 1fr;
  }
  .chars-sheet .abilities {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* LSS-like character constructor */
.lss-page .container { gap: 16px; }
.lss { display: grid; gap: 16px; }
.lss-top {
  display: grid;
  gap: 16px;
}
.lss-top__who {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.lss-ava {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--brand);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
}
.lss-name { margin: 0 0 10px; }
.lss-name input {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
}
.lss-top__meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.lss-top__meta label { margin: 0; }
.lss-top__vitals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lss-chip {
  display: grid;
  gap: 4px;
  margin: 0;
  min-width: 88px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.lss-chip input,
.lss-chip strong {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}
.lss-chip input {
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  width: 100%;
}
.lss-chip--hp { min-width: 140px; }
.lss-hp {
  display: flex;
  align-items: center;
  gap: 4px;
}
.lss-hp input { text-align: center; }
.lss-chip--tog {
  align-content: center;
}
.lss-chip--tog input {
  width: auto;
  height: auto;
  accent-color: var(--brand);
}
.lss-top__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.lss-body {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.35fr);
  gap: 16px;
  align-items: start;
}
.lss-left,
.lss-right {
  display: grid;
  gap: 12px;
}
.lss-stat { padding: 16px; }
.lss-stat__head {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.lss-stat__score {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 10px;
  background: var(--bg);
  border-radius: 14px;
}
.lss-stat__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.lss-stat__score input {
  width: 64px;
  height: 40px;
  margin: 0;
  text-align: center;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
}
.lss-stat__mod {
  color: var(--brand);
  font-size: 15px;
}
.lss-stat__checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lss-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.lss-pill--tog { cursor: pointer; margin: 0; }
.lss-pill--tog input {
  width: auto;
  height: auto;
  margin: 0;
  accent-color: var(--brand);
}
.lss-pill--tog:has(input:checked) {
  border-color: var(--brand);
  color: var(--brand);
}
.lss-skills {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.lss-skill {
  display: grid;
  grid-template-columns: 18px 22px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 10px;
  cursor: pointer;
}
.lss-skill input[type="checkbox"] {
  width: auto;
  height: auto;
  margin: 0;
  accent-color: var(--brand);
}
.lss-skill__expert {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--line);
  cursor: pointer;
  line-height: 1;
}
.lss-skill__expert.is-on { color: var(--brand); }
.lss-skill__name { font-size: 14px; }
.lss-skill__bonus {
  color: var(--brand);
  font-size: 14px;
  min-width: 2.2em;
  text-align: right;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}
.lss-skill__bonus:hover,
.lss-skill__bonus:focus-visible {
  color: var(--text);
  outline: none;
}
.lss-roll-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  display: grid;
  gap: 2px;
  justify-items: center;
  min-width: 160px;
  padding: 14px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel, #18233a);
  color: var(--text);
  box-shadow: none;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.lss-roll-toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.lss-roll-toast__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.lss-roll-toast__total {
  font-family: var(--display);
  font-size: 36px;
  line-height: 1;
  color: var(--brand);
}
.lss-roll-toast__detail {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.lss-roll-toast.is-nat20 {
  border-color: var(--brand);
}
.lss-roll-toast.is-nat20 .lss-roll-toast__total { color: var(--brand); }
.lss-roll-toast.is-nat1 .lss-roll-toast__total { color: #f0b4b4; }
.lss-passives__row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
}
.lss-passives__row div {
  display: grid;
  gap: 2px;
}
.lss-passives__row span {
  font-size: 12px;
  color: var(--muted);
}
.lss-passives__row strong {
  font-family: var(--display);
  font-size: 22px;
  color: var(--brand);
}
.lss-chip--btn {
  cursor: pointer;
  font: inherit;
  text-align: left;
  border: 1px solid transparent;
  color: var(--muted);
  background: var(--bg);
}
.lss-chip--btn:hover,
.lss-chip--btn:focus-visible {
  border-color: var(--brand);
  color: var(--text);
  outline: none;
}
.lss-death {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.lss-death__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.lss-death__group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.lss-death__group input {
  width: 48px;
  margin: 0;
  text-align: center;
}
.lss-spellcast {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.lss-spellcast .lss-chip select {
  margin: 4px 0 0;
  min-width: 140px;
}
.lss-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.lss-slot {
  display: grid;
  grid-template-columns: 18px 1fr auto 1fr;
  gap: 4px;
  align-items: center;
  margin: 0;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.lss-slot input {
  margin: 0;
  text-align: center;
  min-width: 0;
}
.lss-slots__hint { margin: 0 0 16px; font-size: 13px; }
.lss-spellpick {
  margin: 0 0 18px;
  padding: 14px;
  background: var(--bg);
  border-radius: 14px;
}
.lss-spellpick__title {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 18px;
  border-left: 6px solid var(--brand);
  padding-left: 16px;
}
.lss-spellpick__filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}
.lss-spellpick__filters label {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.lss-spellpick__filters select,
.lss-spellpick__filters input {
  margin-top: 6px;
}
.lss-spellpick__search { grid-column: span 2; }
.lss-spellpick__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
}
.lss-spellpick__item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card, #121b2c);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.lss-spellpick__item:hover,
.lss-spellpick__item:focus-visible {
  border-color: var(--brand);
  outline: none;
}
.lss-spellpick__item strong {
  font-size: 14px;
  font-weight: 700;
}
.lss-spellpick__item span {
  flex: 0 0 auto;
  font-size: 12px;
}
.lss-spellpick__meta {
  margin: 10px 0 0;
  font-size: 13px;
}
.chars-del--row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.chars-del--row form { margin: 0; }
@media (max-width: 720px) {
  .lss-spellpick__search { grid-column: 1 / -1; }
}
.lss-weapons__head,
.lss-weapon {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 90px minmax(0, 1.2fr) auto;
  gap: 8px;
  align-items: center;
}
.lss-weapon__rolls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lss-weapon__rolls .lss-pill {
  height: 32px;
  padding: 0 10px;
}
@media (max-width: 640px) {
  .lss-weapons__head,
  .lss-weapon { grid-template-columns: 1fr; }
}
.lss-passives__row div {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 12px;
  min-width: 110px;
}
.lss-passives__row span {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.lss-passives__row strong {
  font-family: var(--display);
  font-size: 20px;
  color: var(--brand);
}
.lss-block-label {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}
.lss-block-label:first-child { margin-top: 0; }
.lss-sidebits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px;
}
.lss-tabs__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.lss-tabs__btn {
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: inset 0 -2px 0 transparent;
}
.lss-tabs__btn.is-on {
  color: var(--brand);
  box-shadow: inset 0 -2px 0 var(--brand);
}
.lss-weapons { margin-bottom: 16px; }
.lss-weapons__head {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lss-weapons__list { display: grid; gap: 8px; margin-bottom: 10px; }
.lss-weapon input { margin: 0; }
@media (max-width: 960px) {
  .lss-body { grid-template-columns: 1fr; }
  .lss-top__meta { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .lss-top__who { grid-template-columns: 1fr; }
  .lss-top__meta { grid-template-columns: 1fr; }
  .lss-stat__head { grid-template-columns: 1fr; }
}

.bm-lib {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.bm-lib__card {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 12px;
  background: var(--bg);
  border-radius: 14px;
}
.bm-lib__preview {
  display: block;
  height: 100px;
  border-radius: 10px;
  background: #0a1220 center / cover no-repeat;
  border: 1px solid var(--line);
}
.bm-lib__preview:not(.has-bg) {
  background-image: linear-gradient(135deg, #152036, #0a1220);
}
.bm-lib__body {
  min-width: 0;
  display: flex;
  gap: 12px 16px;
  align-items: center;
  justify-content: space-between;
}
.bm-lib__copy {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 4px;
}
.bm-lib__title {
  display: block;
  min-width: 0;
  font-family: var(--display);
  font-size: 16px;
  color: var(--text);
  line-height: 1.3;
}
.bm-lib__title:hover { color: var(--brand); }
.bm-lib__status {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}
.bm-lib__meta {
  display: block;
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}
.bm-lib__body .muted { margin: 0; }
.bm-lib__more {
  position: relative;
  flex: 0 0 auto;
  align-self: center;
}
.bm-lib__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 220px;
  padding: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.bm-lib__menu a,
.bm-lib__menu > form > button {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.bm-lib__menu a:hover,
.bm-lib__menu > form > button:hover {
  background: var(--card);
}
.bm-lib__menu > form {
  margin: 0;
  display: block;
}
.bm-lib__menu > form + form,
.bm-lib__menu > a + form,
.bm-lib__menu > form + a {
  margin-top: 4px;
}
.bm-lib__menu > form[data-confirm] {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
.bm-lib__menu > form[data-confirm] button {
  color: #f0b4b4;
}
.bm-lib__attach {
  display: grid;
  gap: 8px;
  margin: 6px 0 0;
  padding: 8px 4px 4px;
  border-top: 1px solid var(--line);
}
.bm-lib__attach label {
  margin: 0;
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.bm-lib__attach select {
  width: 100%;
  min-width: 0;
  height: 36px;
  margin: 0;
}
.bm-lib__attach .btn {
  width: 100%;
}
.bm-lib__more.is-open > [data-dropdown-btn] {
  border-color: var(--brand);
  color: var(--brand);
}
.bm-presets {
  display: grid;
  gap: 8px;
}
.bm--stack .bm-presets {
  grid-template-columns: 1fr;
}
.bm-preset {
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.bm-preset:hover,
.bm-preset.is-on {
  border-color: var(--brand);
  color: var(--brand);
}

@media (max-width: 980px) {
  .bm {
    grid-template-columns: 1fr;
  }
  .bm-side,
  .bm-stage {
    grid-column: 1;
    max-width: none;
  }
  .bm-tools,
  .bm-meta {
    grid-template-columns: 1fr;
  }
  .bm-stage__scroll { max-height: none; }
  .bm-lib__card { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .bm-tools {
    grid-template-columns: 1fr 1fr;
  }
  .bm-tools .bm-panel:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .bm-lib__card { grid-template-columns: 1fr; }
  .master-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

.room-body { background: #0a101c; }
.room {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  min-height: calc(100vh - 76px);
}
.room__media { display: flex; flex-direction: column; min-height: 0; }
.room__bar {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.room__bar a { color: var(--brand); }
.room__jitsi {
  flex: 1;
  width: 100%;
  min-height: 480px;
  border: 0;
  background: #000;
}
.room__side {
  border-left: 1px solid var(--line);
  padding: 16px;
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.room__side h2 { font-size: 18px; margin: 12px 0; padding-left: 10px; }
.chat { display: flex; flex-direction: column; flex: 1; min-height: 240px; }
.chat__log {
  flex: 1;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  min-height: 200px;
}
.vtt-flash {
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}
.chat__line.is-roll { color: var(--brand); }
.facts li.is-unread { border-left: 4px solid var(--brand); }
.dice {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}
.dice button {
  height: 36px;
  min-width: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  font-weight: 700;
}
.dice button:hover { border-color: var(--brand); color: var(--brand); }
.dice-hint { margin: 0 0 10px; font-size: 13px; }
.dice-hint code { color: var(--brand); }
.room__journal { margin-top: 16px; }
.journal { display: grid; gap: 8px; margin: 10px 0; max-height: 180px; overflow: auto; }
.journal article { padding: 10px; background: var(--bg); border-radius: 8px; }
.journal h3 { margin: 0 0 4px; font-size: 13px; color: var(--brand); }
.journal p { margin: 0; font-size: 14px; }
.chat__line b { color: var(--brand); }
.chat__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 980px) {
  .cabinet, .room, .filters { grid-template-columns: 1fr; }
  .sheet-layout,
  .sheet-combat,
  .profile-panel .abilities { grid-template-columns: 1fr; }
  .dungeon { grid-template-columns: repeat(24, 12px); }
  .dungeon span { width: 12px; height: 12px; }
}

.adm {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background: var(--bg);
}
.adm-side {
  display: flex;
  flex-direction: column;
  background: #0a1220;
  border-right: 1px solid var(--line);
  padding: 22px 16px 20px;
}
.adm-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 8px 28px;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.adm-brand small {
  display: block;
  margin-top: 2px;
  color: var(--brand);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.adm-side nav { display: grid; gap: 4px; }
.adm-side nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
}
.adm-side nav a:hover { color: var(--text); background: var(--card); }
.adm-side nav a.is-on {
  color: var(--ink);
  background: var(--brand);
}
.adm-side nav a.is-on .adm-badge {
  background: var(--ink);
  color: var(--brand);
}
.adm-badge {
  min-width: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.adm-side__foot {
  margin-top: auto;
  padding-top: 20px;
  display: grid;
  gap: 10px;
}
.adm-side__foot a { color: var(--muted); font-size: 14px; }
.adm-side__foot a:hover { color: var(--text); }
.adm-side__foot form { display: block; margin-top: 8px; }
.adm-shell { min-width: 0; display: flex; flex-direction: column; }
.adm-top {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 21, 36, 0.92);
}
.adm-top .burger { display: none; }
.adm-top__title {
  margin: 0;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
}
.adm-top__user { margin: 0 0 0 auto; color: var(--muted); font-size: 14px; }
.adm-main { padding: 28px 32px 48px; }
.adm-main > h1 { display: none; }
.adm-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.adm-stat {
  padding: 18px 16px;
  background: var(--card);
  border-radius: 16px;
}
.adm-stat strong {
  display: block;
  font-family: var(--display);
  font-size: 28px;
}
.adm-stat span { color: var(--muted); font-size: 13px; }
.adm-stat:hover strong { color: var(--brand); }
.adm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.adm-panel {
  padding: 18px;
  background: var(--card);
  border-radius: 16px;
  margin-bottom: 16px;
}
.adm-panel h2 {
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  font-size: 18px;
}
.adm-panel__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.adm-panel__head h2 { margin: 0; }
.adm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.adm-list li { display: grid; gap: 2px; }
.adm-list span { color: var(--muted); font-size: 13px; }
.adm-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}
.adm-filters label { min-width: 220px; }
.adm-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.adm-inline input, .adm-inline select { min-width: 0; }
.adm-table td form { margin: 0; display: flex; }
.adm-tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--bg);
  font-size: 12px;
  font-weight: 700;
}
.adm-tag-recruiting, .adm-tag-pending, .adm-tag-open { color: var(--brand); }
.adm-tag-approved, .adm-tag-answered { color: #9ad4a6; }
.adm-tag-closed, .adm-tag-rejected, .adm-tag-running { color: var(--muted); }
.adm-thread { display: grid; gap: 10px; margin: 20px 0; }
.adm-msg {
  padding: 14px 16px;
  background: var(--card);
  border-radius: 12px;
}
.adm-msg h3 { margin: 0 0 6px; font-size: 15px; }
.adm-msg p { margin: 0; }
.adm-back { margin: 0 0 16px; }
.adm-back a { color: var(--muted); font-size: 14px; }
.adm-back a:hover { color: var(--brand); }
.adm-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
  margin: 0 0 16px;
}
.adm-facts dt {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.adm-facts dd { margin: 4px 0 0; }
.adm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.adm-actions a { color: var(--brand); font-size: 14px; }
.adm-list li form { margin-top: 6px; }
.adm-nav-label {
  margin: 14px 8px 4px;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.adm-fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 0 0 16px;
  display: grid;
  gap: 12px;
  max-width: 720px;
}
.adm-fieldset legend {
  padding: 0 8px;
  font-family: var(--display);
  font-size: 14px;
  color: var(--brand);
}
.adm-check {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 500;
}
.adm-check input { width: auto; height: auto; }
.adm-limits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.adm-bars {
  display: flex;
  align-items: end;
  gap: 6px;
  min-height: 140px;
  overflow-x: auto;
  padding-top: 8px;
}
.adm-bar {
  flex: 0 0 36px;
  display: grid;
  grid-template-rows: 1fr auto auto;
  justify-items: center;
  height: 140px;
}
.adm-bar__fill {
  width: 18px;
  align-self: end;
  border-radius: 6px 6px 0 0;
  background: var(--brand);
  opacity: 0.85;
}
.adm-bar__n { font-size: 11px; color: var(--text); }
.adm-bar__d { font-size: 10px; color: var(--muted); }

@media (max-width: 1100px) {
  .adm-stats, .adm-grid { grid-template-columns: 1fr 1fr; }
  .adm-facts { grid-template-columns: 1fr; }
  .adm-limits { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .adm { display: block; }
  .adm-side {
    display: none;
    position: fixed;
    inset: 0 20% 0 0;
    z-index: 30;
  }
  .adm-side.is-open { display: flex; }
  .adm-top .burger { display: block; margin-left: 0; }
}

/* VTT immersive table */
.vtt-body-page {
  margin: 0;
  background: #05080f;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}
.vtt {
  position: relative;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  background: #05080f;
}
.vtt.is-panel-closed {
  grid-template-columns: minmax(0, 1fr) 0;
}
.vtt-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #05080f;
}
.vtt-board-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  background: radial-gradient(ellipse at center, #0c1524 0%, #05080f 70%);
}
.vtt-board-wrap.is-panning { cursor: grabbing; }
.vtt-board {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  background: #0a101c;
  background-repeat: no-repeat;
  background-position: center;
  will-change: transform;
}
.vtt-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(42, 59, 88, 0.55);
  border-radius: 14px;
  background: rgba(13, 21, 36, 0.82);
  backdrop-filter: blur(10px);
}
.vtt-hud__back {
  flex: 0 0 auto;
  color: var(--brand);
  font-size: 18px;
  text-decoration: none;
  padding: 0 6px;
}
.vtt-hud__title {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.vtt-hud__title strong {
  font-family: var(--display);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vtt-hud__title .muted {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vtt-hud__actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.vtt-ruler {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.vtt-zoom {
  flex: 0 0 auto;
  min-width: 3.2em;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(24, 35, 58, 0.7);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.vtt-turn {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.vtt-flash {
  color: #f0b4b4;
  font-size: 12px;
  font-weight: 700;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vtt-tools {
  position: absolute;
  left: 12px;
  top: 72px;
  z-index: 7;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: calc(100% - 120px);
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(42, 59, 88, 0.55);
  border-radius: 14px;
  background: rgba(13, 21, 36, 0.78);
  backdrop-filter: blur(10px);
}
.vtt-tools button {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  text-align: left;
}
.vtt-tools button.is-on,
.vtt-tools button:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.vtt-init {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  max-width: min(720px, calc(100% - 24px));
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(13, 21, 36, 0.78);
  border: 1px solid rgba(42, 59, 88, 0.45);
  backdrop-filter: blur(8px);
}
.vtt-init:empty { display: none; }
.vtt-init__item {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--card);
  font-size: 12px;
}
.vtt-init__item.is-on {
  background: var(--brand);
  color: var(--ink);
  font-weight: 700;
}
.vtt-side {
  width: min(360px, 92vw);
  max-width: 360px;
  border-left: 1px solid var(--line);
  background: #0a1220;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  transition: width 0.2s ease, max-width 0.2s ease, opacity 0.2s ease;
}
.vtt.is-panel-closed .vtt-side {
  width: 0;
  max-width: 0;
  opacity: 0;
  border-left: 0;
  pointer-events: none;
}
.vtt-side__tabs {
  display: flex;
  gap: 4px;
  padding: 10px 10px 0;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
}
.vtt-side__tabs button {
  flex: 1;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: inset 0 -2px 0 transparent;
}
.vtt-side__tabs button.is-on {
  color: var(--brand);
  box-shadow: inset 0 -2px 0 var(--brand);
}
.vtt-side__panes {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vtt-pane {
  display: none;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.vtt-pane.is-on { display: flex; }
.vtt-pane[hidden] { display: none !important; }
.vtt-block {
  padding: 12px;
  border-radius: 12px;
  background: rgba(24, 35, 58, 0.55);
  border: 1px solid rgba(42, 59, 88, 0.4);
}
.vtt-block h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 14px;
}
.vtt-empty { margin: 0; font-size: 13px; }
.vtt-handouts[hidden],
.vtt-music[hidden] { display: none !important; }
.vtt-board.has-map .vtt-cell { opacity: 0.45; }
.vtt-board.has-map .vtt-cell.fog { opacity: 1; }
.vtt-board.is-placing { cursor: crosshair; outline: 2px dashed var(--brand); outline-offset: 2px; }
.vtt-cell {
  display: block !important;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0 !important;
  grid-template-columns: none !important;
  border: 1px solid rgba(42, 59, 88, 0.35);
}
.vtt-cell.bm-c-wall,
.vtt-cell.wall { background: #1a2740; }
.vtt-cell.bm-c-floor,
.vtt-cell.floor { background: #3a3228; }
.vtt-cell.bm-c-room,
.vtt-cell.room { background: #4a4032; }
.vtt-cell.bm-c-door,
.vtt-cell.door { background: #8a5a2b; }
.vtt-cell.bm-c-stairs,
.vtt-cell.stairs { background: #6b5420; }
.vtt-cell.fog { background: #05070c !important; }
.vtt-token {
  position: absolute;
  width: 30px;
  height: 30px;
  margin: 2px;
  border: 0;
  border-radius: 50%;
  color: #14100a;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 0 0 2px rgba(0,0,0,.45);
  z-index: 2;
  overflow: hidden;
}
.vtt-token.is-on { box-shadow: 0 0 0 2px #fff, 0 0 12px var(--brand); }
.vtt-token.is-turn { outline: 2px solid var(--brand); }
.vtt-token.has-art { color: transparent; background-repeat: no-repeat; }
.vtt-hp {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 3px;
  height: 3px;
  background: rgba(0,0,0,.45);
  border-radius: 2px;
  pointer-events: none;
}
.vtt-hp b { display: block; height: 100%; background: #81b29a; }
.vtt-people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.vtt-person {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--text);
  cursor: pointer;
}
.vtt-person span { color: var(--muted); }
.vtt-cond { color: #e07a5f; font-size: 12px; }
.vtt-add {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(24, 35, 58, 0.55);
  border: 1px solid rgba(42, 59, 88, 0.4);
}
.vtt-add h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 14px;
}
.vtt-add p { margin: 0; font-size: 13px; }
.vtt-add input[type="color"] { height: 36px; padding: 2px; }
.vtt-add__row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.vtt-add__row--2 { grid-template-columns: 1fr 1fr; }
.vtt-add__row .btn { width: 100%; }
.vtt-check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  font-size: 13px;
}
.vtt-check input { width: auto; height: auto; flex: 0 0 auto; }
.vtt-side input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.vtt-side textarea,
.vtt-side select {
  width: 100%;
  max-width: 100%;
}
.vtt-side .bm-file { width: 100%; }
.vtt-voice .room__jitsi {
  width: 100%;
  height: 220px;
  border: 0;
  border-radius: 12px;
  background: #000;
}
.vtt-inspect {
  padding: 12px;
  border-radius: 12px;
  background: rgba(24, 35, 58, 0.55);
  border: 1px solid rgba(42, 59, 88, 0.4);
  font-size: 13px;
}
.vtt-sheet summary {
  cursor: pointer;
  font-weight: 700;
}
.vtt-sheet p,
.vtt-handouts p,
.vtt-music p { margin: 0 0 6px; font-size: 12px; color: var(--muted); }
.vtt-abs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  font-size: 12px;
  margin: 8px 0;
}
.vtt-handout { padding: 8px 0; border-top: 1px solid var(--line); min-width: 0; }
.vtt-handout.is-hidden { opacity: 0.55; }
.vtt-handout img { max-width: 100%; border-radius: 8px; margin-top: 6px; }
.vtt-yt { width: 100%; max-width: 100%; height: 160px; border: 0; border-radius: 8px; }
.vtt-side .chat {
  min-height: 280px;
  flex: 1;
  border-radius: 12px;
  border: 1px solid rgba(42, 59, 88, 0.4);
  background: rgba(24, 35, 58, 0.35);
  padding: 10px;
}
.vtt-ping {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--brand);
  box-shadow: 0 0 16px var(--brand);
  pointer-events: none;
  z-index: 3;
  animation: vttping 1.2s ease-out;
}
@keyframes vttping {
  from { transform: scale(0.4); opacity: 1; }
  to { transform: scale(1.6); opacity: 0; }
}
.vtt-cell.aoe {
  box-shadow: inset 0 0 0 2px var(--aoe, #e07a5f);
  background-image: linear-gradient(var(--aoe, #e07a5f), var(--aoe, #e07a5f));
  background-blend-mode: overlay;
}
.chat__line.is-whisper { color: #c77dff; }
@media (max-width: 900px) {
  .vtt {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .vtt.is-panel-closed {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) 0;
  }
  .vtt-side {
    width: 100%;
    max-width: none;
    max-height: 42vh;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .vtt.is-panel-closed .vtt-side {
    max-height: 0;
    width: 100%;
  }
  .vtt-tools {
    flex-direction: row;
    flex-wrap: wrap;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 56px;
    max-height: none;
  }
}

/* AI helper + master tools */
.ai-field {
  display: flex;
  gap: 10px;
  align-items: end;
}
.ai-field input,
.ai-field textarea { flex: 1; min-width: 0; }
.ai-field--stack {
  flex-direction: column;
  align-items: stretch;
}
.ai-field--stack .btn { align-self: start; }
#aiGameStatus.is-error,
#aiTerrainStatus.is-error { color: #f0b4b4; }
.ai-terrain-preview {
  margin-top: 16px;
  display: grid;
  gap: 12px;
  justify-items: start;
}
.ai-terrain-preview img {
  max-width: min(100%, 720px);
  border-radius: 16px;
  border: 1px solid var(--line);
}

.ai-help {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
}
.ai-help__fab {
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: var(--ink);
  font-weight: 700;
  font-family: var(--sans);
  cursor: pointer;
}
.ai-help__fab:hover { background: var(--brand-hover); }
.ai-help__panel {
  width: min(380px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 100px));
  display: none;
  flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.ai-help__panel.is-open {
  display: flex;
}
.ai-help__panel[hidden] {
  display: none !important;
}
.ai-help__head {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.ai-help__head strong {
  font-family: var(--display);
  font-size: 15px;
}
.ai-help__head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.ai-help__log {
  flex: 1;
  overflow: auto;
  padding: 14px 16px;
  display: grid;
  gap: 10px;
  align-content: start;
}
.ai-help__msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.ai-help__msg--bot {
  background: var(--card);
  color: var(--text);
}
.ai-help__msg--user {
  margin-left: auto;
  background: rgba(240, 193, 75, 0.16);
  border: 1px solid rgba(240, 193, 75, 0.35);
}
.ai-help__form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}
.ai-help__form input {
  flex: 1;
  min-width: 0;
  height: 40px;
}
@media (max-width: 600px) {
  .ai-help { right: 12px; bottom: 12px; }
  .ai-field { flex-wrap: wrap; }
}


