/* ============================================================================
   Foxha Games — стили витрины игр.
   Внешних ресурсов нет: только системные шрифты, цвета и инлайновый SVG-заглушка.
   Порядок разделов:
     1. Переменные и сброс
     2. Базовые элементы (кнопки, поля, бейджи, уведомления)
     3. Шапка и вкладки
     4. Каркас страницы и панели
     5. Каталог: сетка карточек и пагинация
     6. Аккаунт: формы, профиль, сессии
     7. Моя студия: загрузка и список игр
     8. Модальное окно карточки игры
     9. Плеер web-сборки и её настройки
    10. Тосты и подвал
    11. Адаптивность
   ========================================================================== */

/* ─────────────────────────── 1. Переменные и сброс ─────────────────────────── */

:root {
  --bg: #10100f;
  --bg-elevated: #191918;
  --bg-elevated-2: #222220;
  --bg-input: #141413;
  --border: #2d2c28;
  --border-strong: #45423c;
  --accent: #ff8a24;
  --accent-hover: #ffa348;
  --accent-soft: rgba(255, 138, 36, 0.14);
  --text: #f4f1eb;
  --text-secondary: #b7b3aa;
  --text-muted: #928e85;
  --success: #3fbf7f;
  --danger: #e5484d;
  --warning: #e2b13c;
  --radius: 16px;
  --radius-small: 8px;
  --radius-pill: 999px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --transition: 160ms ease;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", "Liberation Sans", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  /* Никакого горизонтального скролла на телефоне. */
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 520px at 12% -12%, rgba(255, 138, 36, 0.12), transparent 62%),
    radial-gradient(900px 480px at 92% 0%, rgba(255, 138, 36, 0.1), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

img,
svg,
video {
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.25;
}

p {
  margin: 0;
}

ul, ol, dl, dd {
  margin: 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85em;
}

/* Скрытые блоки: атрибут hidden всегда важнее любого display. */
[hidden] {
  display: none !important;
}

/* Видимый фокус для клавиатурной навигации. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 40;
  padding: 10px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-small);
  color: var(--text);
  transition: top var(--transition);
}

.skip-link:focus {
  top: 12px;
}

.noscript {
  margin: 24px auto;
  max-width: 720px;
  padding: 16px;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  color: var(--text);
}

/* ─────────────────────────── 2. Базовые элементы ─────────────────────────── */

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--bg-elevated-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition), background var(--transition),
    border-color var(--transition), color var(--transition);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--text);
  text-decoration: none;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #14100e;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #14100e;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.btn-danger {
  background: transparent;
  border-color: rgba(229, 72, 77, 0.55);
  color: #ff9a9d;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(229, 72, 77, 0.14);
  border-color: var(--danger);
  color: #ffd0d1;
}

.btn-small {
  padding: 7px 13px;
  font-size: 0.85rem;
}

/* Кнопка-обёртка над скрытым input[type=file] */
.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* Поля ввода */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-grow {
  flex: 1 1 260px;
}

.field-action {
  justify-content: flex-end;
}

.field-spacer {
  display: block;
  height: 1px;
}

.field label,
.form label > span,
.checkbox span {
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 11px 13px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  color: var(--text);
  font: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 96px;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
    linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
  background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

input[type="file"] {
  padding: 9px 11px;
  background: var(--bg-input);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-small);
  color: var(--text-secondary);
  font: inherit;
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--bg-elevated-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.hint {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Строка состояния под формой или списком */
.status-line {
  min-height: 1.2em;
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.status-line.is-error {
  color: #ff9a9d;
}

.status-line.is-success {
  color: #8fe0b4;
}

/* Инлайновые результаты: сообщения и ссылки из письма */
.inline-result {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-small);
  color: var(--text-secondary);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.inline-result.is-error {
  border-left-color: var(--danger);
  color: #ffb4b6;
}

.inline-result.is-success {
  border-left-color: var(--success);
  color: #b6e8cd;
}

.inline-result a {
  word-break: break-all;
}

/* Бейджи и чипы */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(63, 191, 127, 0.14);
  border: 1px solid rgba(63, 191, 127, 0.4);
  color: #8fe0b4;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-hidden {
  background: rgba(163, 168, 184, 0.12);
  border-color: rgba(163, 168, 184, 0.35);
  color: var(--text-secondary);
}

.badge-warning {
  background: rgba(226, 177, 60, 0.14);
  border-color: rgba(226, 177, 60, 0.4);
  color: #f0cf85;
}

.badge-current {
  background: var(--accent-soft);
  border-color: rgba(255, 138, 36, 0.45);
  color: #ffb65c;
}

.chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  white-space: nowrap;
}

.chip:empty {
  display: none;
}

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

/* Уведомление под шапкой (глубокие ссылки) */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}

.notice.is-error {
  border-left-color: var(--danger);
}

.notice.is-success {
  border-left-color: var(--success);
}

.notice-text {
  flex: 1 1 auto;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.notice-text a {
  word-break: break-all;
}

.notice-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.notice-close:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* ─────────────────────────── 3. Шапка и вкладки ─────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(16, 16, 15, 0.88);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand:hover {
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
}

.brand-accent {
  color: var(--accent);
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.tab {
  padding: 8px 16px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}

.tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.tab.is-active {
  background: var(--accent);
  color: #14100e;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  min-width: 0;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* Круглые кнопки-иконки в шапке: «добавить игру», «войти» и «профиль». */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  color: var(--text);
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.icon-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.header-name {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 600;
}

/* ─────────────────────────── 4. Каркас страницы и панели ─────────────────────────── */

.layout {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* Каталог показывает много игр сразу, поэтому занимает больше ширины. */
.layout.is-wide {
  max-width: 1360px;
}

.view:focus {
  outline: none;
}

.panel {
  margin-bottom: 22px;
  padding: 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.panel-title {
  margin-bottom: 12px;
  font-size: 1.12rem;
}

.panel-subtitle {
  margin-bottom: 10px;
  font-size: 0.98rem;
  color: var(--text-secondary);
}

.panel-text {
  margin-bottom: 14px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-head .panel-title {
  margin-bottom: 0;
}

.divider {
  margin: 20px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 560px;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.row-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.empty-state {
  padding: 34px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-align: center;
}

/* ─────────────────────────── 5. Каталог ─────────────────────────── */

/*
  Раскладка как на itch.io: слева колонка разделов (порядок выдачи и жанры),
  справа — широкая сетка карточек, чтобы на экран помещалось много игр.
*/
.catalog-shell {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.catalog-side {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.side-title {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.side-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Жанров может быть много: список прокручивается, не растягивая страницу. */
.side-list-scroll {
  max-height: 46vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

.side-link {
  display: block;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--radius-small);
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.89rem;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.side-link.is-active {
  background: var(--accent-soft);
  color: #ffb65c;
  font-weight: 600;
}

.side-link-reset {
  color: var(--text-muted);
}

.side-empty {
  display: block;
  padding: 6px 10px;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.catalog-main {
  min-width: 0;
}

.catalog-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.catalog-head .field {
  max-width: none;
}

.catalog-count {
  margin: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 22px 18px;
  margin-top: 4px;
  padding: 0;
  list-style: none;
}

.card-item {
  display: flex;
}

/*
  Карточка каталога без рамки: обложка крупным планом, подпись под ней.
  Так виднее сами игры, а сетка получается плотнее.
*/
#catalogGrid .game-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

#catalogGrid .game-card:hover {
  transform: none;
  box-shadow: none;
}

#catalogGrid .card-cover {
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  transition: border-color var(--transition), box-shadow var(--transition);
}

#catalogGrid .game-card:hover .card-cover,
#catalogGrid .game-card:focus-visible .card-cover {
  border-color: var(--accent);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

#catalogGrid .card-body {
  gap: 4px;
  padding: 0;
}

#catalogGrid .card-title {
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.28;
}

#catalogGrid .game-card:hover .card-title {
  color: var(--accent);
}

#catalogGrid .card-line {
  gap: 6px;
  /* Строка подписи не переносится: карточки в ряду остаются одной высоты. */
  flex-wrap: nowrap;
  font-size: 0.78rem;
}

#catalogGrid .card-author {
  min-width: 0;
  color: var(--text-secondary);
}

/* Метки в карточке каталога — просто подпись, без «пилюль». */
#catalogGrid .chip {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-muted);
  font-size: 0.78rem;
}

#catalogGrid .chip-accent {
  color: #ffb65c;
}

/* Кнопка «Играть» — поверх обложки, появляется при наведении. */
#catalogGrid .card-play {
  position: absolute;
  top: 8px;
  right: 8px;
  bottom: auto;
  z-index: 1;
}

@media (hover: hover) {
  #catalogGrid .card-play {
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity var(--transition), transform var(--transition);
  }

  #catalogGrid .game-card:hover .card-play,
  #catalogGrid .game-card:focus-within .card-play {
    opacity: 1;
    transform: none;
  }
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.pagination-info {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Базовая карточка игры: рамка и подъём при наведении. Каталог переопределяет её ниже. */
.game-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition),
    box-shadow var(--transition);
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

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

.card-cover,
.studio-cover {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-input);
  overflow: hidden;
}

/* Обложку наполняет app.js: картинка или заглушка занимают слот целиком. */
.card-cover-media {
  display: block;
  width: 100%;
  height: 100%;
}

/* Иконки сборок: правый нижний угол обложки, поверх картинки. */
.card-builds {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-build {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  background: rgba(10, 12, 17, 0.72);
  color: #e9ecf5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Web-сборка — акцентным цветом, как метка «В браузере» в подписи. */
.card-build-web {
  color: #ffb65c;
}

.card-cover .cover-img,
.card-cover .cover-placeholder,
.studio-cover .cover-img,
.studio-cover .cover-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-placeholder {
  background: #141413;
}

.cover-placeholder-text {
  fill: var(--text-muted);
  font-family: var(--font);
  font-size: 13px;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 16px;
}

.card-title {
  font-size: 1.02rem;
  font-weight: 700;
  transition: color var(--transition);
  overflow-wrap: anywhere;
}

.card-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 0.83rem;
}

.card-line-meta {
  color: var(--text-muted);
}

.card-author {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.pagination-info {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ─────────────────────────── 6. Аккаунт ─────────────────────────── */

.auth-panel {
  max-width: 640px;
}

/* Текстовая кнопка-ссылка: «Забыли пароль?» на экране входа. */
.link-btn {
  align-self: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color var(--transition);
}

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

.link-btn:focus-visible,
.link-back:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Возврат с экрана восстановления доступа на экран входа. */
.link-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: color var(--transition);
}

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

.switch {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.switch-btn {
  padding: 8px 18px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

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

.switch-btn.is-active {
  background: var(--accent);
  color: #14100e;
}

.profile-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.profile-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.profile-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.profile-row dt {
  flex: 0 0 170px;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.profile-row dd {
  flex: 1 1 220px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}

.profile-email {
  color: var(--text);
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  padding: 0;
  list-style: none;
}

.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
}

.session-info {
  min-width: 0;
}

.session-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.session-meta {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

/* ─────────────────────────── 7. Моя студия ─────────────────────────── */

.progress-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

progress {
  width: 100%;
  height: 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--bg-input);
  overflow: hidden;
}

progress::-webkit-progress-bar {
  background: var(--bg-input);
  border-radius: var(--radius-pill);
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--accent), #ff8a5c);
  border-radius: var(--radius-pill);
  transition: width var(--transition);
}

progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: var(--radius-pill);
}

.progress-text {
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.studio-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
  padding: 0;
  list-style: none;
}

.studio-item {
  padding: 16px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.studio-main {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.studio-cover {
  flex: 0 0 148px;
  width: 148px;
  border-radius: var(--radius-small);
  border: 1px solid var(--border);
}

.studio-info {
  min-width: 0;
  flex: 1 1 auto;
}

.studio-title {
  font-size: 1.04rem;
  overflow-wrap: anywhere;
}

.studio-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 0.83rem;
}

.studio-slug {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.studio-row-status:empty {
  display: none;
}

.studio-edit {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  max-width: 100%;
}

/* ─────────── 8. Страница игры: галерея, карточка действий, описание ─────────── */

/* Раскладка в духе itch.io: слева картинки и описание, справа — панель с кнопками. */
.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 26px;
  align-items: start;
}

.game-main {
  min-width: 0;
}

.game-gallery {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-shot {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
}

.game-shot-img,
.game-shot .cover-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.game-thumb {
  display: block;
  width: 96px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--bg-input);
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
}

.game-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.game-thumb:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.game-thumb.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.game-info {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.game-title {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.game-author {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.game-error {
  margin: 0;
  color: #ff9a9d;
}

.game-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-actions .btn {
  width: 100%;
  justify-content: center;
}

.game-facts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.86rem;
}

.game-facts li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.game-fact-label {
  color: var(--text-muted);
}

.game-fact-value {
  color: var(--text);
  text-align: right;
  overflow-wrap: anywhere;
}

.game-owner {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.game-back {
  margin-top: 26px;
}

/* ─────────── Разметка описания ─────────── */

.markdown {
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.game-description {
  margin-top: 26px;
}

.markdown > :first-child {
  margin-top: 0;
}

.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5 {
  margin: 22px 0 10px;
  color: var(--text);
  line-height: 1.25;
}

.markdown h2 {
  font-size: 1.34rem;
}

.markdown h3 {
  font-size: 1.14rem;
}

.markdown h4,
.markdown h5 {
  font-size: 1rem;
}

.markdown p {
  margin: 0 0 12px;
}

.markdown a {
  color: var(--accent-hover);
}

.markdown strong {
  color: var(--text);
}

.markdown ul,
.markdown ol {
  margin: 0 0 12px;
  padding-left: 22px;
}

.markdown li {
  margin-bottom: 4px;
}

.markdown blockquote {
  margin: 0 0 12px;
  padding: 8px 14px;
  border-left: 3px solid var(--accent);
  background: var(--bg-elevated-2);
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
}

.markdown code {
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--bg-input);
  color: #ffb65c;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.88em;
}

.markdown pre {
  margin: 0 0 12px;
  padding: 12px 14px;
  overflow-x: auto;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
}

.markdown pre code {
  padding: 0;
  background: none;
  color: var(--text);
}

.markdown hr {
  margin: 18px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.markdown-image {
  display: block;
  max-width: 100%;
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
}

/* ─────────── Скриншоты в «Моей студии» ─────────── */

.shot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.shot-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}

.shot-thumb {
  display: block;
  width: 140px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--bg-input);
}

.shot-empty {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 0.86rem;
}

/* Предпросмотр описания в формах: рамка, чтобы отличался от обычного текста. */
.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 600;
}

.shot-preview {
  min-height: 44px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-small);
}

/* ─────────────────────────── 9. Плеер web-сборки и её настройки ─────────────────────────── */

/* Плеер занимает окно целиком: тёмная сцена, сверху шапка, снизу подпись сборки. */
.view-player {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.player {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 0;
  padding: 18px;
  background: #0b0d12;
  border-color: var(--border-strong);
}

.player-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.player-heading {
  min-width: 0;
  flex: 1 1 240px;
}

.player-title {
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}

.player-author {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.player-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.player-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 138, 36, 0.45);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-small);
}

.player-alert-text {
  flex: 1 1 240px;
  color: var(--text);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.player-status {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

/* Сцена плеера: заглушка, рамка и оверлеи лежат друг на друге. */
.player-stage {
  position: relative;
  width: 100%;
}

.player-frame-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: #05060a;
}

/* Полосы прокрутки выключены — прячем их и у обёртки кадра. */
.player-frame-wrap.is-no-scroll {
  overflow: hidden;
}

.player-frame-wrap.is-scroll {
  overflow: auto;
}

/* Полный экран: кадр занимает весь экран, лишние поля убираем. */
.player:fullscreen {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #05060a;
}

.player:fullscreen .player-head,
.player:fullscreen .player-meta,
.player:fullscreen .player-hint,
.player:fullscreen .player-status,
.player:fullscreen .player-alert {
  display: none;
}

.player:fullscreen .player-stage {
  flex: 1 1 auto;
  min-height: 0;
}

.player:fullscreen .player-frame-wrap {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
}

.player-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #05060a;
}

.player-frame.is-hidden {
  display: none;
}

/* Постер «Запуск по клику»: сборка грузится только после нажатия кнопки. */
.player-poster {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  background: rgba(5, 6, 10, 0.86);
  text-align: center;
}

.player-poster-art {
  position: absolute;
  inset: 0;
  opacity: 0.22;
}

.player-poster-art .cover-img,
.player-poster-art .cover-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-poster-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.player-poster-hint {
  max-width: 460px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.btn-launch {
  padding: 16px 34px;
  font-size: 1.05rem;
  box-shadow: 0 14px 32px rgba(255, 138, 36, 0.32);
}

/* Оверлеи поверх кадра: загрузка и «Поверните телефон». */
.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
  background: rgba(5, 6, 10, 0.82);
  color: var(--text);
  text-align: center;
  font-size: 0.95rem;
}

.player-orientation {
  background: rgba(5, 6, 10, 0.72);
  font-size: 1.05rem;
  font-weight: 600;
}

.player-orientation-icon {
  display: inline-flex;
  color: var(--accent);
  animation: player-rotate 2.4s ease-in-out infinite;
}

/* Спиннер загрузки: только CSS, без картинок и внешних файлов. */
.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinner-rotate 800ms linear infinite;
}

@keyframes spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

@keyframes player-rotate {
  0%,
  45% {
    transform: rotate(0deg);
  }
  55%,
  100% {
    transform: rotate(90deg);
  }
}

.player-meta {
  color: var(--text-secondary);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.player-hint {
  padding: 10px 12px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-small);
  color: var(--text-secondary);
  font-size: 0.84rem;
}

/* Кнопка «Играть» на карточке каталога: не открывает окно игры. */
.game-card {
  position: relative;
}

.card-play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1;
}

/* Место под кнопку «Играть»: она лежит поверх нижней строки карточки. */
.game-card .card-body {
  padding-bottom: 48px;
}

.chip-accent {
  background: var(--accent-soft);
  border-color: rgba(255, 138, 36, 0.45);
  color: #ffb65c;
  font-weight: 600;
}

/* Блок web-сборки в строке «Моей студии». */
.studio-cover-col {
  flex: 0 0 148px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.studio-cover-col .studio-cover {
  flex: 0 0 auto;
  width: 100%;
}

.studio-cover-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.studio-web {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.studio-web-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.studio-web-summary::marker {
  color: var(--text-muted);
}

.studio-web-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
  padding: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
}

.status-chip {
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-chip.is-on {
  background: rgba(63, 191, 127, 0.14);
  border-color: rgba(63, 191, 127, 0.4);
  color: #8fe0b4;
}

.studio-web-info {
  color: var(--text-secondary);
  font-size: 0.83rem;
  overflow-wrap: anywhere;
}

.studio-web-form {
  max-width: 100%;
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.settings-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
}

.settings-item-wide {
  grid-column: 1 / -1;
}

.settings-title {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.hint-warning {
  padding: 10px 12px;
  background: rgba(226, 177, 60, 0.12);
  border: 1px solid rgba(226, 177, 60, 0.35);
  border-radius: var(--radius-small);
  color: #f0cf85;
}

/* ─────────────────────────── 10. Тосты и подвал ─────────────────────────── */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 40px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-small);
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: toast-in 180ms ease-out;
}

.toast-success {
  border-left-color: var(--success);
}

.toast-error {
  border-left-color: var(--danger);
}

.toast-text {
  flex: 1 1 auto;
  color: var(--text);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.toast-close {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

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

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 20px 28px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.health {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.health-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-muted);
}

.health-dot.is-ok {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(63, 191, 127, 0.18);
}

.health-dot.is-down {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.18);
}

/* ─────────────────────────── 11. Профиль игрока ─────────────────────────── */

/* Акцент профиля: палитра задаётся классом, свой цвет — переменными (их ставит app.js). */
.view-profile {
  --profile-accent: #ff8a24;
  --profile-accent-soft: rgba(255, 138, 36, 0.16);
}

.view-profile.accent-orange {
  --profile-accent: #ff8a24;
  --profile-accent-soft: rgba(255, 138, 36, 0.16);
}

.view-profile.accent-violet {
  --profile-accent: #8b5cf6;
  --profile-accent-soft: rgba(139, 92, 246, 0.18);
}

.view-profile.accent-azure {
  --profile-accent: #3b82f6;
  --profile-accent-soft: rgba(59, 130, 246, 0.18);
}

.view-profile.accent-emerald {
  --profile-accent: #10b981;
  --profile-accent-soft: rgba(16, 185, 129, 0.18);
}

.view-profile.accent-rose {
  --profile-accent: #f43f5e;
  --profile-accent-soft: rgba(244, 63, 94, 0.18);
}

.view-profile.accent-gold {
  --profile-accent: #eab308;
  --profile-accent-soft: rgba(234, 179, 8, 0.18);
}

.view-profile.accent-slate {
  --profile-accent: #94a3b8;
  --profile-accent-soft: rgba(148, 163, 184, 0.18);
}

/* Имя в шапке сайта — кнопка, ведущая на свою страницу. */
button.header-name {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button.header-name:hover {
  color: var(--accent);
}

.meta-author {
  font-weight: 600;
}

/* ─────────── Карточка профиля: шапка, аватар, имя ─────────── */

.profile-card {
  position: relative;
  margin-bottom: 22px;
  padding: 0 22px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.profile-cover {
  height: 180px;
  margin: 0 -22px;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  background:
    radial-gradient(120% 170% at 10% 0%, var(--profile-accent-soft), transparent 62%),
    radial-gradient(90% 150% at 86% 4%, rgba(90, 110, 220, 0.24), transparent 62%),
    linear-gradient(140deg, #241b33, #17131f 55%, #141413);
}

.view-profile.cover-solid .profile-cover {
  background: linear-gradient(160deg, var(--profile-accent), #17131f);
}

.view-profile.cover-grid .profile-cover {
  background-color: #141413;
  background-image:
    linear-gradient(var(--profile-accent-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--profile-accent-soft) 1px, transparent 1px);
  background-size: 40px 40px;
}

.view-profile.cover-none .profile-cover {
  display: none;
}

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

.profile-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.profile-avatar {
  flex: 0 0 auto;
  width: 104px;
  height: 104px;
  margin-top: -46px;
  overflow: hidden;
  border-radius: 50%;
  border: 4px solid var(--bg-elevated);
  background: var(--bg-input);
}

.view-profile.cover-none .profile-avatar {
  margin-top: 18px;
}

.view-profile.avatar-squircle .profile-avatar {
  border-radius: 30px;
}

.view-profile.avatar-square .profile-avatar {
  border-radius: 14px;
}

.profile-avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--profile-accent-soft);
  color: var(--profile-accent);
  font-size: 2.2rem;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-ident {
  flex: 1 1 240px;
  min-width: 0;
  padding-bottom: 4px;
}

.profile-name {
  font-size: 1.7rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.profile-tagline {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.profile-handle {
  margin-top: 6px;
  color: var(--profile-accent);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.profile-joined {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.profile-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
  padding-bottom: 4px;
}

.profile-bio {
  max-width: 78ch;
  margin-top: 16px;
  color: var(--text-secondary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ─────────── Счётчики ─────────── */

.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding: 0;
  list-style: none;
}

.profile-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 104px;
  padding: 10px 14px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
}

.profile-stat-value {
  color: var(--profile-accent);
  font-size: 1.15rem;
  font-weight: 700;
}

.profile-stat-label {
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ─────────── Две колонки: разделы и ссылки слева, игры справа ─────────── */

.profile-columns {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.profile-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-block {
  padding: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.profile-block-title {
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  list-style: none;
}

.profile-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.profile-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.profile-nav-item.is-active {
  background: var(--profile-accent-soft);
  border-color: var(--profile-accent);
  color: var(--text);
}

.profile-nav-count {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.profile-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.profile-link a {
  display: block;
  padding: 9px 12px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  color: var(--text);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.profile-link a:hover {
  border-color: var(--profile-accent);
  text-decoration: none;
}

.profile-links-empty {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.profile-main {
  min-width: 0;
}

/* Размер карточек игр выбирается в настройках профиля. */
.view-profile[data-card-size='compact'] .profile-games {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.view-profile[data-card-size='comfortable'] .profile-games {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.view-profile[data-card-size='large'] .profile-games {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* ─────────── Редактор профиля ─────────── */

.profile-editor {
  max-width: 100%;
  scroll-margin-top: 90px;
}

.profile-editor-nav { display: flex; gap: 6px; overflow-x: auto; padding: 6px; margin: 18px 0 24px; background: var(--bg-elevated-2); border-radius: 12px; }
.profile-editor-nav button { flex: 1; white-space: nowrap; padding: 12px 16px; border: 1px solid transparent; border-radius: 8px; color: var(--text-secondary); background: transparent; cursor: pointer; font: inherit; }
.profile-editor-nav button.is-active { color: var(--accent); border-color: var(--accent); background: var(--bg-elevated); }
.profile-editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.profile-editor-fields { min-width: 0; }
.profile-editor .editor-group { padding: 22px; }
.profile-editor .editor-group legend { color: var(--text); font-size: 1rem; }
.profile-editor-preview { position: sticky; top: 90px; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg-elevated-2); }
#playerEditorPreview { margin: 14px 0; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elevated); padding-bottom: 18px; }
#playerEditorPreview > h3, #playerEditorPreview > p, #playerEditorPreview > span { margin-left: 16px; margin-right: 16px; overflow-wrap: anywhere; }
.editor-preview-cover { height: 90px; background: radial-gradient(ellipse at top right, var(--preview-accent), transparent 85%), var(--bg-elevated-2); }
.editor-preview-cover.cover-solid { background: var(--preview-accent); }
.editor-preview-cover.cover-grid { background: repeating-linear-gradient(0deg, transparent 0 19px, var(--preview-accent) 20px 21px), repeating-linear-gradient(90deg, var(--bg-elevated-2) 0 19px, var(--preview-accent) 20px 21px); }
.editor-preview-cover.cover-none { height: 36px; background: transparent; }
.editor-preview-cover img, .editor-preview-avatar img, .profile-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.editor-preview-avatar { position: relative; width: 64px; height: 64px; margin: -24px 16px 12px; border: 3px solid var(--bg-elevated); border-radius: 50%; overflow: hidden; display: grid; place-items: center; color: var(--bg-elevated); background: var(--preview-accent); font-size: 1.6rem; font-weight: 800; }
.editor-preview-avatar.shape-squircle { border-radius: 18px; }
.editor-preview-avatar.shape-square { border-radius: 4px; }
.editor-preview-tagline { color: var(--preview-accent); }
.editor-preview-bio { white-space: pre-wrap; font-size: .88rem; line-height: 1.6; }
.editor-preview-link { display: block; font-size: .85rem; color: var(--preview-accent); margin-top: 8px; }
.profile-editor-footer { position: sticky; bottom: 12px; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 22px; padding: 16px 20px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 8px 30px #0005; }
.profile-editor-footer .form-actions, .profile-editor-footer p { margin: 0; }
.profile-editor-footer .status-line:empty { display: none; }
.profile-field-error { color: var(--danger, #ff7979); font-size: .86rem; margin-top: 6px; }
.profile-editor [aria-invalid='true'] { border-color: var(--danger, #ff7979); }
.profile-image-note { padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--bg-elevated-2); font-size: .88rem; line-height: 1.6; margin-bottom: 18px; }
.profile-image-preview { height: 140px; display: grid; place-items: center; border: 1px dashed var(--border); border-radius: 12px; overflow: hidden; background: var(--bg-elevated-2); }
.profile-image-preview-avatar { width: 140px; }
.profile-editor .swatch { width: 40px; height: 40px; }
.profile-editor .settings-grid .checkbox { padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.profile-editor .link-editor-row { grid-template-columns: minmax(0, 1fr); }
.profile-editor .link-editor-row [data-action='link-remove'] { justify-self: start; }
@media (max-width: 1000px) { .profile-editor-layout { grid-template-columns: minmax(0, 1fr); } .profile-editor-preview { position: static; max-width: 440px; width: 100%; } }
@media (max-width: 600px) { .profile-editor .editor-group { padding: 14px; } .profile-editor .editor-grid { grid-template-columns: minmax(0, 1fr); } .profile-editor-footer { flex-direction: column; align-items: stretch; bottom: 4px; padding: 12px; } .profile-editor-footer .form-actions { display: flex; } .profile-editor-footer .form-actions .btn { flex: 1; } .profile-editor-nav button { padding: 10px 12px; } }

.editor-group {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
}

.editor-group legend {
  padding: 0 8px;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 700;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.editor-grid + .editor-grid {
  margin-top: 14px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field-label {
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 600;
}

.input-prefix {
  display: flex;
  align-items: stretch;
}

.input-prefix-mark {
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: var(--radius-small) 0 0 var(--radius-small);
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

.input-prefix input {
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition);
}

.swatch:hover {
  transform: scale(1.08);
}

.swatch.is-active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg-elevated);
}

input[type='color'] {
  width: 54px;
  height: 42px;
  padding: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  cursor: pointer;
}

.color-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.link-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  padding: 0;
  list-style: none;
}

.link-editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
}

/* ─────────────────────────── 12. Адаптивность ─────────────────────────── */

@media (max-width: 1080px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 18px 14px;
  }
}

/* Колонка разделов уходит наверх: жанры становятся «облаком» кнопок. */
@media (max-width: 720px) {
  .catalog-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .catalog-side {
    position: static;
    gap: 16px;
  }

  .side-list,
  .side-list-scroll {
    flex-direction: row;
    flex-wrap: wrap;
    max-height: none;
    overflow: visible;
  }

  .side-link {
    width: auto;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    white-space: normal;
    text-align: center;
  }

  .side-link.is-active {
    border-color: rgba(255, 138, 36, 0.45);
  }
}

@media (max-width: 900px) {
  .header-inner {
    padding: 10px 16px;
  }

  .layout {
    padding: 18px 16px 40px;
  }

  .panel {
    padding: 18px;
  }

  .profile-row dt {
    flex: 1 1 100%;
  }

  /* Профиль: колонки складываются в одну, шапка становится ниже. */
  .profile-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-cover {
    height: 150px;
  }

  .profile-actions {
    margin-left: 0;
  }

  /* Страница игры: панель с кнопками уходит под галерею и описание. */
  .game-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .game-info {
    position: static;
  }
}

@media (max-width: 720px) {
  /* Плеер на телефоне: сцена занимает почти весь экран, кнопки переносятся. */
  .view-player {
    padding: 0;
  }

  .player {
    padding: 12px;
  }

  .player-head {
    flex-direction: column;
    align-items: stretch;
  }

  .player-actions {
    width: 100%;
  }

  .player-actions .btn {
    flex: 1 1 auto;
  }

  .player-frame-wrap {
    min-height: 58vh;
    aspect-ratio: auto;
  }

  .card-play {
    right: 10px;
    bottom: 10px;
  }

  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand user"
      "tabs tabs";
    align-items: center;
    gap: 10px;
  }

  .brand {
    grid-area: brand;
    min-width: 0;
  }

  /* На узком экране имя витрины уступает место кнопкам: текст обрезается многоточием. */
  .brand-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-actions {
    grid-area: user;
    margin-left: 0;
  }

  .header-name {
    max-width: 120px;
  }

  .tabs {
    grid-area: tabs;
    width: 100%;
    min-width: 0; /* без этого полоса вкладок растягивает шапку и выдавливает кнопку входа */
    justify-content: space-between;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .tab {
    flex: 0 0 auto;
    padding: 8px 12px;
    text-align: center;
  }

  .field-grow {
    flex: 1 1 100%;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
  }

  .studio-main {
    flex-direction: column;
  }

  .studio-cover {
    flex: 0 0 auto;
    width: 100%;
  }

  .studio-cover-col {
    flex: 1 1 auto;
    width: 100%;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  /* Профиль на телефоне: аватар над именем, ссылки в редакторе — в столбик. */
  .profile-head {
    align-items: flex-start;
  }

  .profile-cover {
    height: 130px;
  }

  .profile-avatar {
    width: 84px;
    height: 84px;
    margin-top: -38px;
  }

  .profile-name {
    font-size: 1.4rem;
  }

  .link-editor-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-stat {
    flex: 1 1 40%;
  }

  /* Страница игры на телефоне: миниатюры мельче. */
  .game-thumb {
    width: 78px;
  }

  .toasts {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }
}

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

  .btn {
    padding: 10px 15px;
  }
}

/* Уважаем системную настройку «меньше движения». */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ─────────────────────────── 12. Аналитика автора ─────────────────────────── */

.analytics-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  margin: 16px 0 4px;
}

.analytics-toolbar .field {
  min-width: 220px;
}

/* Карточки показателей: просмотры, запуски, время, скачивания. */
.analytics-cards {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 12px 0 0;
  padding: 0;
}

.analytics-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
}

.analytics-card-value {
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.15;
}

.analytics-card-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.analytics-card-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* График по дням: столбики на блоках, без внешних библиотек. */
.analytics-chart-note {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.analytics-chart {
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--bg-input);
  padding: 14px 14px 8px;
}

.analytics-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 190px;
}

.analytics-bar {
  flex: 1 1 0;
  display: flex;
  align-items: flex-end;
  min-width: 3px;
  height: 100%;
}

.analytics-bar-fill {
  width: 100%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--accent), rgba(255, 138, 36, 0.5));
  transition: height var(--transition);
}

.analytics-bar-fill.is-zero {
  background: var(--border-strong);
}

.analytics-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.analytics-chart-peak {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* Два блока рядом: источники и таблица игр. */
.analytics-columns {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(340px, 1.5fr);
  gap: 16px;
  align-items: start;
}

.analytics-sources {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.analytics-source {
  display: grid;
  grid-template-columns: minmax(90px, 150px) 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 0.88rem;
}

.analytics-source-name {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-source-bar {
  display: block;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-input);
  border: 1px solid var(--border);
  overflow: hidden;
}

.analytics-source-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-pill);
}

.analytics-source-value {
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.analytics-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.analytics-table th,
.analytics-table td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.analytics-table th:first-child,
.analytics-table td:first-child {
  text-align: left;
}

.analytics-table th {
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Строка игры открывает её отчёт. */
.analytics-row {
  cursor: pointer;
  transition: background var(--transition);
}

.analytics-row:hover,
.analytics-row:focus-visible {
  background: var(--bg-elevated-2);
}

.analytics-row.is-active {
  background: var(--accent-soft);
}

.analytics-cell-title {
  max-width: 280px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

@media (max-width: 720px) {
  .analytics-bars {
    height: 140px;
  }

  .analytics-toolbar .field {
    min-width: 0;
    flex: 1 1 100%;
  }

  .analytics-source {
    grid-template-columns: minmax(80px, 110px) 1fr auto;
  }

  .analytics-card-value {
    font-size: 1.4rem;
  }
}

/* ─────────────────────────── 13. Отзывы и оценки ─────────────────────────── */

:root {
  --star: #eab308;
  --star-empty: #3a4152;
}

/* Рейтинг 0…100 на обложке карточки в каталоге. */
.card-rating {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(16, 16, 15, 0.86);
  border: 1px solid var(--warning);
  color: var(--warning);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
  backdrop-filter: blur(2px);
}

.card-rating.is-high {
  border-color: var(--success);
  color: var(--success);
}

.card-rating.is-low {
  border-color: var(--border-strong);
  color: var(--text-muted);
}

/* Полоска звёзд: заполненные — золотые, пустые — приглушённые. */
.stars {
  display: inline-flex;
  gap: 2px;
  line-height: 1;
  color: var(--star-empty);
  font-size: 1rem;
}

.stars .star {
  color: inherit;
}

.stars .star.is-on {
  color: var(--star);
}

/* В форме звёзды — кнопки: сбрасываем вид кнопки, оставляя крупную цель для клика. */
.stars-interactive .star {
  padding: 2px 4px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--star-empty);
  cursor: pointer;
  transition: color var(--transition), transform var(--transition);
}

.stars-interactive .star:hover,
.stars-interactive .star:focus-visible {
  color: var(--star);
  transform: scale(1.12);
}

.stars-interactive .star.is-on {
  color: var(--star);
}

.game-reviews {
  margin-top: 16px;
}

/* Сводка: большая оценка, звёзды и число отзывов. */
.reviews-score {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.reviews-score-value {
  color: var(--text);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.reviews-score-max,
.reviews-score-count,
.reviews-score-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.review-criteria {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px 20px;
  margin: 16px 0 0;
  padding: 0;
}

.review-criterion {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto 42px;
  gap: 10px;
  align-items: center;
  font-size: 0.9rem;
}

.review-criterion-label {
  color: var(--text-secondary);
}

.review-criterion-value {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: right;
}

/* Форма отзыва. */
.review-form,
.rating-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.review-pickers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px 24px;
  margin-bottom: 14px;
}

.review-picker {
  display: grid;
  grid-template-columns: 110px auto;
  grid-template-areas:
    "label stars"
    "hint hint";
  gap: 2px 10px;
  align-items: center;
}

.review-picker-label {
  grid-area: label;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.review-picker .stars {
  grid-area: stars;
}

.review-picker-hint {
  grid-area: hint;
  color: var(--text-muted);
  font-size: 0.76rem;
}

/* Список отзывов. */
.review-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
}

.review-item {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--bg-elevated-2);
}

.review-item.is-mine {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.review-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.review-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-weight: 700;
}

.review-ident {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.review-author {
  color: var(--text);
  font-weight: 600;
}

.review-date {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.review-score {
  margin-left: auto;
  color: var(--star);
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
}

.review-item-stars {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 10px 0 0;
  padding: 0;
}

.review-item-star {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
}

.review-item-star-label {
  color: var(--text-muted);
}

.review-item-star .stars {
  font-size: 0.85rem;
}

.review-text {
  margin-top: 10px;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .review-picker {
    grid-template-columns: 1fr;
    grid-template-areas:
      "label"
      "stars"
      "hint";
  }

  .reviews-score-value {
    font-size: 1.6rem;
  }
}

/* Foxha Games: фирменное оформление и главная витрина. */
body {
  background: radial-gradient(900px 450px at 90% 0, rgba(255, 138, 36, .035), transparent 70%), var(--bg);
}
.header-inner { max-width: 1360px; min-height: 80px; gap: 36px; }
.brand { font-size: 1.35rem; letter-spacing: -.6px; }
.brand-mark { align-items: center; }
.tabs { background: transparent; border: 0; padding: 0; border-radius: 0; }
.tab { border-radius: 8px; font-size: .9rem; }
.tab.is-active { background: var(--accent-soft); color: var(--accent); }
#headerAddGame { width: auto; padding: 0 16px; gap: 8px; border-radius: 8px; background: var(--accent); border-color: var(--accent); color: #18120c; font: inherit; font-size: .85rem; font-weight: 700; }
#headerAddGame:hover { background: var(--accent-hover); }
.btn { border-radius: 8px; }
.layout { padding-top: 30px; }
.catalog-hero { position: relative; display: grid; grid-template-columns: 1.35fr 1fr; min-height: 350px; margin-bottom: 40px; overflow: hidden; border: 1px solid #3d3023; border-radius: 20px; background: linear-gradient(115deg, #211b15, #191714 60%, #2b2015); }
.hero-copy { padding: 40px 0 42px 42px; z-index: 1; }
.hero-eyebrow, .section-eyebrow { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.hero-eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.hero-eyebrow > span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px #ff8a2470; }
.hero-copy h1 { font-size: clamp(2.5rem, 4.5vw, 4rem); line-height: 1.05; letter-spacing: -.045em; font-weight: 800; }
.hero-copy h1 > span { color: var(--accent); }
.hero-description { margin-top: 20px; font-size: .95rem; line-height: 1.7; color: #beb6aa; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; margin-top: 26px; }
.hero-actions .btn { gap: 24px; font-size: .88rem; padding: 13px 18px; }
.hero-explore { color: var(--text); font-size: .86rem; }
.hero-explore > span { margin-left: 8px; color: var(--accent); }
.hero-art { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; background: radial-gradient(ellipse at center, #ff8a2418, transparent 65%); }
.hero-art::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(#ff8a2408 1px, transparent 1px), linear-gradient(90deg, #ff8a2408 1px, transparent 1px); background-size: 32px 32px; mask-image: radial-gradient(ellipse, black, transparent 70%); }
.hero-fox { position: relative; width: 210px; height: 210px; transform: rotate(-9deg); filter: drop-shadow(0 22px 24px #0006); }
.hero-orbit { position: absolute; width: 310px; height: 310px; border: 1px solid #ff8a2428; border-radius: 50%; }
.orbit-two { width: 390px; height: 390px; border-style: dashed; transform: rotate(20deg); }
.hero-sticker { position: absolute; padding: 9px 15px; border: 1px solid #5b4631; border-radius: 8px; background: #242019; color: #ffd0a0; font: 600 .8rem ui-monospace, Consolas, monospace; box-shadow: 0 8px 24px #0004; }
.sticker-code { left: 6%; top: 23%; transform: rotate(-10deg); }
.sticker-play { right: 7%; bottom: 25%; transform: rotate(10deg); background: #ff8a24; border-color: #ff8a24; color: #211407; }
.hero-spark { position: absolute; color: #ffb65c; font: 300 36px monospace; }
.spark-one { right: 17%; top: 14%; }
.spark-two { left: 19%; bottom: 18%; font-size: 22px; }
.art-caption { position: absolute; bottom: 28px; color: #a28b72; font: 10px ui-monospace, Consolas, monospace; letter-spacing: .18em; }
.catalog-section-title { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 26px; scroll-margin-top: 100px; }
.section-eyebrow { margin-bottom: 8px; font-size: .65rem; }
.catalog-section-title h2 { font-size: 1.65rem; letter-spacing: -.035em; }
.catalog-section-note { color: var(--text-muted); font-size: .8rem; }
.catalog-shell { grid-template-columns: 180px minmax(0, 1fr); gap: 30px; }
.catalog-side { padding-right: 18px; border-right: 1px solid var(--border); gap: 26px; top: 104px; }
.side-title { color: #a39d92; font-size: .65rem; padding-left: 10px; margin-bottom: 10px; }
.side-link { padding: 8px 10px; font-size: .83rem; }
.side-link.is-active { color: var(--accent); background: #ff8a2414; box-shadow: inset 2px 0 var(--accent); border-radius: 0 6px 6px 0; }
.catalog-head { gap: 12px; margin-bottom: 18px; }
.catalog-head .field { flex: initial; }
.catalog-head .field label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#catalogSearch { min-height: 46px; padding-left: 42px; background-color: #191918; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23928e85' stroke-width='1.7'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m16 16 5 5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 19px; background-position: 14px center; font-size: .87rem; }
.catalog-count { font-size: .78rem; }
.card-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 24px 20px; }
#catalogGrid .game-card { position: relative; border-radius: 12px; background: #191918; border: 1px solid var(--border); gap: 0; overflow: hidden; transition: border-color var(--transition), transform var(--transition); }
#catalogGrid .game-card:hover { transform: translateY(-3px); border-color: #66503a; }
#catalogGrid .card-cover { border: 0; border-radius: 0; }
#catalogGrid .card-body { padding: 14px; gap: 8px; }
#catalogGrid .card-title { font-size: 1rem; font-weight: 700; letter-spacing: -.02em; }
#catalogGrid .card-line { flex-wrap: wrap; }
#catalogGrid .card-author { margin-left: auto; }
#catalogGrid .card-line-meta { color: var(--text-muted); font-size: .7rem; padding-top: 8px; border-top: 1px solid var(--border); }
#catalogGrid .chip { padding: 2px 6px; border-radius: 4px; background: #ffffff07; color: #b7b3aa; font-size: .68rem; }
#catalogGrid .chip-accent { background: var(--accent-soft); color: #ffb65c; }
#catalogGrid .card-play { top: 10px; right: 10px; }
.panel { box-shadow: 0 6px 22px #00000012; }
.auth-panel { margin-top: 24px; border-top: 2px solid var(--accent); }
.empty-state { background: #191918; padding: 48px 24px; }
.site-footer { padding: 24px 20px; background: #131312; font-size: .78rem; }
.footer-text strong { color: var(--accent); }
.footer-separator { padding: 0 10px; color: #625e54; }
@media (max-width: 1000px) {
  .hero-copy { padding: 32px; }
  .hero-fox { width: 170px; height: 170px; }
  .hero-orbit { width: 250px; height: 250px; }
  .orbit-two { width: 320px; height: 320px; }
  .sticker-code { left: 0; font-size: .7rem; }
  .sticker-play { right: 4%; }
  .catalog-section-note { display: none; }
  .header-inner { gap: 24px; }
}
@media (max-width: 720px) {
  .header-inner { min-height: 68px; gap: 12px; padding: 12px 16px; }
  .brand { font-size: 1.1rem; }
  .brand-mark img { width: 30px; height: 30px; }
  .header-actions { gap: 8px; }
  .publish-label { display: none; }
  #headerAddGame { padding: 0; width: 36px; height: 36px; }
  .tabs { margin-left: 0; order: 0; width: 100%; justify-content: flex-start; }
  .tab { padding: 7px 10px; font-size: .8rem; }
  .layout { padding: 20px 16px 32px; }
  .catalog-hero { grid-template-columns: 1fr; margin-bottom: 28px; }
  .hero-copy { padding: 28px 24px; }
  .hero-copy h1 { font-size: 2.8rem; }
  .hero-eyebrow { font-size: .6rem; letter-spacing: .06em; }
  .hero-description { font-size: .86rem; }
  .hero-description br { display: none; }
  .hero-actions { gap: 16px; margin-top: 22px; }
  .hero-art { min-height: 210px; border-top: 1px solid #ff8a241a; overflow: hidden; }
  .hero-fox { width: 140px; height: 140px; }
  .art-caption { bottom: 12px; font-size: 8px; }
  .sticker-code { left: 10%; top: 16%; }
  .sticker-play { right: 10%; bottom: 21%; }
  .catalog-section-title h2 { font-size: 1.4rem; }
  .catalog-shell { grid-template-columns: 1fr; gap: 20px; }
  .catalog-side { position: static; border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 18px; gap: 14px; }
  .side-list, .side-list-scroll { flex-direction: row; flex-wrap: wrap; max-height: 150px; overflow-y: auto; gap: 5px; }
  .side-link { width: auto; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: .76rem; }
  .side-link.is-active { border-radius: 6px; box-shadow: none; border-color: #ff8a2455; }
  .side-title { padding-left: 0; margin-bottom: 7px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  #catalogGrid .card-body { padding: 10px; }
  #catalogGrid .card-title { font-size: .88rem; }
  #catalogGrid .card-author { margin-left: 0; }
  .site-footer { gap: 12px; text-align: center; }
}
@media (max-width: 390px) {
  .header-inner { gap: 8px; }
  .brand { font-size: 1rem; gap: 6px; }
  .tab { padding: 6px; }
  .hero-copy { padding: 24px 20px; }
  .hero-copy h1 { font-size: 2.4rem; }
  .hero-explore { font-size: .8rem; }
  .hero-sticker { padding: 7px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* Аналитика: фильтры, интерактивные показатели и читаемый отчёт. */
.analytics-overview { padding: 28px; }
.analytics-overview .panel-head { align-items: start; }
.analytics-overview h1.panel-title { margin: 8px 0; font-size: 1.9rem; letter-spacing: -.035em; overflow-wrap: anywhere; }
.analytics-overview .panel-text { margin: 0; }
.analytics-toolbar { margin: 24px 0 18px; padding: 18px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px; gap: 24px; }
.analytics-toolbar .field:first-child { flex: 1; max-width: 480px; }
.analytics-toolbar .field-label { font-size: .86rem; color: var(--text-secondary); font-weight: 600; }
.view-analytics .switch { border-radius: 8px; max-width: 100%; margin-bottom: 0; }
.analytics-toolbar .field-label { margin-bottom: 0; }
.analytics-toolbar select, .analytics-toolbar .switch { min-height: 46px; }
.view-analytics .switch-btn { border-radius: 5px; white-space: nowrap; padding: 10px 16px; }
.analytics-period { font-size: .78rem; color: var(--text-secondary); margin-bottom: 12px; }
#analyticsStatus:empty { display: none; }
#analyticsStatus { margin: 8px 0 16px; }
.analytics-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; gap: 14px; }
.analytics-card { padding: 0; background: var(--bg-input); overflow: hidden; transition: border-color var(--transition); }
.analytics-card.is-active { border-color: var(--accent); background: #ff8a240b; }
.analytics-card-button { display: flex; flex-direction: column; align-items: start; gap: 14px; padding: 20px; border: 0; width: 100%; height: 100%; color: var(--text); background: transparent; font: inherit; text-align: left; cursor: pointer; }
.analytics-card-button:hover { background: #ffffff04; }
.analytics-card-button:focus-visible { outline-offset: -4px; }
.analytics-card-value { font-size: clamp(1.4rem, 2.4vw, 2rem); font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.analytics-card-label { font-size: .82rem; font-weight: 600; }
.analytics-card.is-active .analytics-card-label { color: var(--accent); }
.analytics-card-hint { font-size: .73rem; line-height: 1.6; }
.analytics-help { margin-top: 20px; color: var(--text-secondary); font-size: .8rem; max-width: 850px; }
.analytics-help summary { cursor: pointer; width: fit-content; padding: 6px 0; }
.analytics-help p { margin-top: 10px; line-height: 1.7; }
#analyticsLifetime { color: var(--text-muted); }
.analytics-chart-panel .panel-head { gap: 16px; margin-bottom: 14px; }
.analytics-chart-panel > .hint { margin-bottom: 14px; font-size: .75rem; }
.analytics-chart { position: relative; padding: 20px 16px 12px 76px; border-color: var(--border); }
.analytics-bars { height: 220px; background: repeating-linear-gradient(to top, var(--border) 0, var(--border) 1px, transparent 1px, transparent 50%); }
.analytics-scale { position: absolute; left: 10px; top: 20px; bottom: 64px; display: flex; flex-direction: column; justify-content: space-between; max-width: 60px; font-size: .65rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.analytics-bar { border: 0; padding: 0 1px; background: transparent; cursor: pointer; position: relative; }
.analytics-bar:hover, .analytics-bar[aria-pressed="true"] { background: #ff8a2415; }
.analytics-bar:hover .analytics-bar-fill, .analytics-bar[aria-pressed="true"] .analytics-bar-fill { background: #ffc17d; }
.analytics-bar:focus-visible { outline-offset: 0; z-index: 1; }
.analytics-day-detail { min-height: 24px; margin-top: 12px; color: var(--accent); font-size: .85rem; font-weight: 600; }
.analytics-columns { grid-template-columns: minmax(0, 1fr); }
.analytics-sources { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 36px; }
.analytics-source { grid-template-columns: 1fr auto; gap: 8px; }
.analytics-source-name { grid-column: 1; font-size: .85rem; }
.analytics-source-value { grid-column: 2; grid-row: 1; }
.analytics-source-bar { grid-column: 1 / -1; grid-row: 2; height: 6px; }
.analytics-sort { min-width: 190px; }
.analytics-sort select { padding-top: 8px; padding-bottom: 8px; font-size: .8rem; }
.analytics-table-wrap { scrollbar-width: thin; }
.analytics-table { font-variant-numeric: tabular-nums; }
.analytics-table th { text-transform: none; letter-spacing: 0; font-size: .78rem; background: var(--bg-input); }
.analytics-table th, .analytics-table td { padding: 14px 12px; }
.analytics-table td:first-child { color: var(--text); }
.analytics-cell-title::after { content: ' ↗'; color: var(--accent); font-weight: 400; }
.analytics-studio-link { margin-top: 18px; }
#analyticsContent.is-loading .analytics-cards, #analyticsContent.is-loading .analytics-chart, #analyticsContent.is-loading .analytics-sources, #analyticsContent.is-loading .analytics-table-wrap { opacity: .3; pointer-events: none; }
#analyticsContent.is-loading .analytics-card-button > span, #analyticsContent.is-loading .analytics-chart > *, #analyticsContent.is-loading .analytics-table tbody, #analyticsContent.is-loading .analytics-sources > *, #analyticsContent.is-loading #analyticsChartNote, #analyticsContent.is-loading #analyticsDayDetail { visibility: hidden; }
#analyticsContent.has-error .analytics-cards, #analyticsContent.has-error .analytics-chart-panel, #analyticsContent.has-error .analytics-columns, #analyticsContent.has-error .analytics-help, #analyticsContent.has-error .analytics-period { display: none; }
@media (max-width: 980px) {
  .analytics-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .analytics-overview { padding: 18px; }
  .analytics-overview h1.panel-title { font-size: 1.5rem; }
  .analytics-toolbar { padding: 12px; gap: 16px; }
  .analytics-toolbar .field:first-child { flex: 1 1 100%; max-width: none; }
  .analytics-toolbar .switch { display: flex; width: 100%; }
  .analytics-toolbar .switch-btn { flex: 1; padding: 9px 10px; }
  .analytics-cards { gap: 10px; }
  .analytics-card-button { padding: 14px; gap: 10px; }
  .analytics-card-label { font-size: .72rem; }
  .analytics-card-value { font-size: 1.4rem; }
  .analytics-card-hint { font-size: .67rem; }
  #analyticsMetrics { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  #analyticsMetrics .switch-btn { padding: 8px; font-size: .8rem; }
  .analytics-bars { height: 170px; gap: 1px; }
  .analytics-bar { min-width: 0; padding: 0; }
  .analytics-chart { padding-left: 60px; }
  .analytics-scale { max-width: 46px; font-size: .6rem; }
  .analytics-sources { grid-template-columns: 1fr; }
  .analytics-sort { width: 100%; }
  .analytics-table th:first-child, .analytics-table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--bg-elevated); max-width: 150px; }
  .analytics-row.is-active td:first-child { background: #33261a; }
  .analytics-table th:first-child { background: var(--bg-input); }
}

/* Публикация: понятные группы, изображения до отправки и обратная связь. */
.publication-panel { padding: 30px; }
.publication-title { margin: 10px 0; font-size: clamp(1.6rem, 3vw, 2.1rem); letter-spacing: -.04em; }
#uploadForm { max-width: none; gap: 24px; }
.publication-required { color: var(--text-secondary); font-size: .8rem; padding: 12px 16px; border-left: 2px solid var(--accent); background: var(--accent-soft); border-radius: 0 6px 6px 0; }
.publication-step { margin: 0; padding: 22px; min-width: 0; border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; gap: 20px; background: var(--bg-input); }
.publication-step legend { padding: 0 10px; color: var(--text); font-weight: 700; font-size: 1rem; }
.publication-step legend > span { color: var(--accent); font: 700 .8rem ui-monospace, Consolas, monospace; margin-right: 10px; }
.publication-step-note { color: var(--text-secondary); font-size: .82rem; margin-top: 0; }
.publication-step .field { gap: 8px; }
.publication-step input[type=text], .publication-step textarea { background: var(--bg-elevated); }
.publication-step input[type=file] { padding: 16px; min-height: 62px; border-color: #5a4834; background: #ff8a2405; font-size: .8rem; }
.publication-step input[type=file]::file-selector-button { border-radius: 6px; font-size: .78rem; background: var(--accent-soft); border-color: #ff8a2430; color: var(--accent); padding: 9px 12px; }
.publication-step input[type=file]:focus-visible { outline: 2px solid var(--accent); }
.publication-step .hint { font-size: .75rem; line-height: 1.6; }
.required-mark { color: var(--accent); }
.publication-description-preview { color: var(--text-secondary); font-size: .8rem; }
.publication-description-preview summary { cursor: pointer; padding: 6px 0; }
.publication-description-preview .shot-preview { margin-top: 12px; background: var(--bg-elevated); }
.publication-media-grid, .publication-build-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.publication-media-grid { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
.publication-cover-preview { aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px dashed var(--border-strong); border-radius: 8px; background: var(--bg-elevated); color: var(--text-muted); font-size: .78rem; }
.publication-cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.publication-media-note { padding: 10px 12px; border: 1px solid #ff8a2428; border-radius: 6px; color: #d6b28c; font-size: .75rem; background: #ff8a2406; }
.publication-shots { padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.publication-shot { position: relative; min-width: 0; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.publication-shot img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: contain; background: #0d0d0c; }
.publication-shot-caption { display: block; padding: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .65rem; color: var(--text-secondary); }
.publication-shot-remove { position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--border-strong); border-radius: 6px; background: #10100fe8; color: var(--text); cursor: pointer; font-size: 1.2rem; }
.publication-shot-remove:hover { color: var(--accent); border-color: var(--accent); }
.publication-build-grid .field { padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-elevated); }
.publication-submit { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 18px; padding: 20px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px; }
.publication-submit strong { font-size: .9rem; }
.publication-submit .hint { margin-top: 6px; font-size: .75rem; }
.publication-feedback { padding: 14px 16px; color: #b3e3c6; background: #3fbf7f0b; border: 1px solid #3fbf7f40; border-radius: 8px; font-size: .84rem; line-height: 1.7; }
.publication-feedback.is-error { color: #ffb7a8; border-color: #e5484d60; background: #e5484d0b; }
.publication-field-error { color: #ffb7a8; font-size: .78rem; }
#uploadForm [aria-invalid=true] { border-color: var(--danger); }
#uploadForm input:disabled, #uploadForm textarea:disabled { opacity: .55; }
#uploadForm [disabled] button, #uploadForm button:disabled { cursor: default; }
@media (max-width: 720px) {
  .publication-panel { padding: 18px; }
  #uploadForm { gap: 20px; }
  .publication-step { padding: 16px; gap: 18px; }
  .publication-media-grid, .publication-build-grid { grid-template-columns: 1fr; gap: 20px; }
  .publication-shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .publication-submit { padding: 16px; }
  .publication-submit .form-actions { width: 100%; }
  .publication-submit .btn-primary { width: 100%; }
  .publication-submit .btn-ghost { width: 100%; }
}

/* Страница игры: название, быстрый запуск и галерея без потери контекста. */
.game-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.game-topline .link-btn { color: var(--text-secondary); font-size: .85rem; }
.game-section-nav { display: flex; gap: 24px; font-size: .8rem; }
.game-section-nav a { color: var(--text-secondary); }
.game-section-nav a:hover { color: var(--accent); }
.game-heading { margin-bottom: 28px; }
.game-heading .game-title { font-size: clamp(1.8rem, 3.5vw, 2.7rem); font-weight: 800; letter-spacing: -.04em; }
.game-heading .game-author { margin-top: 10px; }
.game-heading-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 14px; }
.game-rating-link { color: #e7c7a6; font-size: .8rem; }
.game-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; }
.game-info { top: 104px; padding: 22px; gap: 18px; }
.game-info-title { font-size: 1.1rem; letter-spacing: -.02em; }
.game-details-title { font-size: .7rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: .08em; }
.game-actions .btn { min-height: 46px; font-size: .9rem; }
.game-availability { font-size: .8rem; line-height: 1.6; color: var(--text-secondary); padding: 12px; background: var(--bg-input); border-radius: 8px; }
.game-facts { gap: 12px; font-size: .78rem; }
.game-facts li { padding-top: 12px; }
.game-fact-value { max-width: 60%; }
.game-owner { padding-top: 18px; border-top: 1px solid var(--border); gap: 8px; }
.game-owner .btn { flex: 1 1 auto; font-size: .75rem; }
.game-gallery { gap: 12px; }
.game-shot { border-radius: 12px; background: #0c0c0b; }
.game-shot-img { object-fit: contain; }
.game-gallery-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
#gameGalleryCounter { color: var(--text-secondary); font-size: .75rem; font-variant-numeric: tabular-nums; }
.game-gallery-controls { display: flex; align-items: center; gap: 8px; }
.game-gallery-controls .icon-btn { width: 32px; height: 32px; border-radius: 6px; }
.game-gallery-controls button:disabled { opacity: .35; cursor: default; }
.game-thumbs { flex-wrap: nowrap; overflow-x: auto; padding: 3px 2px 10px; scrollbar-width: thin; }
.game-thumbs li { flex: 0 0 auto; }
.game-thumb { width: 104px; border-radius: 6px; }
.game-thumb.is-active { border-color: var(--accent); opacity: 1; }
.game-thumb:not(.is-active) { opacity: .65; }
.game-thumb:hover { opacity: 1; transform: none; }
.game-about { margin-top: 26px; padding: 24px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; scroll-margin-top: 105px; }
.game-about > h2 { font-size: 1.15rem; }
.game-about .game-description { margin-top: 18px; }
.game-review-intro { margin-top: 12px; color: var(--text-secondary); font-size: .85rem; }
#gameReviews { margin-top: 26px; padding: 26px; scroll-margin-top: 105px; }
#gameReviews > .panel-head { gap: 18px; }
#reviewLoginHint { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-input); margin-top: 18px; }
.game-lightbox { width: min(1200px, 94vw); max-width: 94vw; max-height: 92vh; padding: 18px; border: 1px solid var(--border-strong); border-radius: 14px; background: #141413; color: var(--text); box-shadow: var(--shadow); }
.game-lightbox[open] { display: flex; flex-direction: column; gap: 16px; }
.game-lightbox::backdrop { background: #000d; backdrop-filter: blur(6px); }
.game-lightbox-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.game-lightbox-head h2 { font-size: .9rem; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.game-lightbox-head .btn { flex-shrink: 0; }
#gameLightboxImage { display: block; width: 100%; max-height: 68vh; min-height: 0; object-fit: contain; background: #0c0c0b; border-radius: 8px; }
.game-lightbox-controls { display: flex; justify-content: center; align-items: center; gap: 20px; color: var(--text-secondary); font-size: .8rem; }
.game-lightbox-controls .btn { padding: 8px 16px; }
@media (max-width: 900px) {
  .game-layout { grid-template-columns: minmax(0, 1fr); }
  .game-info { position: static; order: -1; }
  .game-info .game-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
  .game-actions { flex-direction: row; flex-wrap: wrap; }
  .game-actions .btn { flex: 1 1 180px; width: auto; }
}
@media (max-width: 600px) {
  .game-topline { align-items: start; gap: 12px; margin-bottom: 20px; }
  .game-section-nav { gap: 12px; font-size: .7rem; }
  .game-section-nav a:first-child { display: none; }
  .game-heading { margin-bottom: 20px; }
  .game-heading .game-title { font-size: 1.8rem; }
  .game-info { padding: 18px; gap: 16px; }
  .game-info .game-facts { grid-template-columns: 1fr; }
  .game-gallery-controls { gap: 6px; }
  #gameShotExpand { font-size: .72rem; padding: 8px 10px; }
  .game-thumb { width: 76px; }
  .game-about, #gameReviews { padding: 18px; }
  .game-lightbox { padding: 12px; width: 96vw; max-width: 96vw; }
  .game-lightbox-head h2 { font-size: .75rem; }
  .game-lightbox-controls { gap: 12px; font-size: .72rem; }
  .game-review-intro { font-size: .78rem; }
}
.game-details summary { cursor: pointer; color: var(--text-secondary); font-size: .82rem; padding: 8px 0; }
.game-details[open] summary { margin-bottom: 14px; color: var(--text); }
.game-details summary:hover { color: var(--accent); }
button.game-shot { display: block; width: 100%; padding: 0; color: var(--text); cursor: zoom-in; }
button.game-shot:disabled { cursor: default; }
button.game-shot:not(:disabled):hover { border-color: var(--accent); }
