/*
 * Game Jam — Игры за выходные (волна 1). Айдентика «Пуговок»:
 * палитра из скилла конкурса и шрифт Onest (OFL, хранится на портале — W1-14).
 * Стили ограничены .gj-page, чтобы не влиять на оболочку портала.
 */
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/Onest-Cyrillic-VF.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/Onest-Latin-VF.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

.gj-page {
  --gj-navy: #1f2742;
  --gj-violet: #6260c6;
  --gj-violet-strong: #4d4bb0;
  --gj-lilac: #d2d0ff;
  --gj-lilac-soft: #e9e8ff;
  --gj-coral: #e8623e;
  --gj-coral-text: #b8431f;
  --gj-cream: #fff4df;
  --gj-paper: #fffdf7;
  --gj-sun: #fed78c;
  --gj-surface: #ffffff;
  --gj-text: var(--gj-navy);
  --gj-muted: #4a5170;
  --gj-border: #dcdaf5;
  --gj-focus: var(--gj-violet);
  --gj-radius: 20px;
  box-sizing: border-box;
  min-width: 0;
  background: var(--gj-paper);
  color: var(--gj-text);
  font-family: "Onest", "Montserrat", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  padding-bottom: 56px;
}

[data-theme="dark"] .gj-page {
  --gj-paper: #141a2e;
  --gj-surface: #1f2742;
  --gj-cream: #2a3150;
  --gj-lilac-soft: #262d4d;
  --gj-text: #f4f3ff;
  --gj-muted: #c9c8e8;
  --gj-border: #3a4269;
  --gj-coral-text: #ff9c7f;
  --gj-focus: var(--gj-sun);
}

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

.gj-page :focus-visible {
  outline: 3px solid var(--gj-focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.gj-page a {
  color: var(--gj-violet-strong);
  text-underline-offset: 3px;
}

[data-theme="dark"] .gj-page a {
  color: var(--gj-lilac);
}

.gj-page code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--gj-lilac-soft);
  font-size: 0.92em;
}

.gj-wrap {
  width: min(100% - 32px, 1120px);
  margin-inline: auto;
}

/* ---------- Hero ---------- */
.gj-hero {
  position: relative;
  overflow: hidden;
  margin: 24px auto 0;
  width: min(100% - 32px, 1180px);
  border-radius: 28px;
  background: var(--gj-navy);
  color: #ffffff;
  --gj-focus: var(--gj-sun);
}

.gj-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  width: 100%;
  padding: 56px 48px;
}

.gj-hero__eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--gj-sun);
  color: var(--gj-navy);
  font-size: 0.85rem;
  font-weight: 600;
}

/* .gj-page в селекторе: правило портала html[data-fbvs-portal] :is(h1, …) (0,1,2) иначе перебивает цвет. */
.gj-page .gj-hero__title {
  margin: 0 0 16px;
  color: #ffffff;
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

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

.gj-hero__lead strong {
  color: #ffffff;
}

.gj-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* Статус «Вы зарегистрированы» — плашка над кнопками, а не элемент ряда кнопок (26.11.2026). */
.gj-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: -12px 0 16px;
  padding: 6px 14px 6px 6px;
  border: 1px solid rgb(210 208 255 / 45%);
  border-radius: 999px;
  background: rgb(255 255 255 / 10%);
  color: #ffffff;
  font-weight: 700;
  line-height: 1.3;
}

.gj-badge__icon {
  flex: none;
  padding: 4px;
  border-radius: 50%;
  background: var(--gj-sun);
  color: var(--gj-navy);
}

.gj-hero a {
  color: inherit;
}

.gj-countdown {
  padding: 24px;
  border-radius: var(--gj-radius);
  background: rgb(255 255 255 / 8%);
  border: 1px solid rgb(210 208 255 / 30%);
}

.gj-countdown__label {
  margin: 0 0 12px;
  color: var(--gj-lilac);
  font-weight: 600;
}

.gj-countdown__units {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.gj-countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 4px;
  border-radius: 14px;
  background: rgb(31 39 66 / 70%);
}

.gj-countdown__unit b {
  color: var(--gj-sun);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.gj-countdown__unit small {
  color: var(--gj-lilac);
  font-size: 0.8rem;
}

.gj-countdown__when {
  margin: 12px 0 0;
  color: #ffffff;
  font-size: 0.95rem;
}

/* Пуговицы — декоративный мотив «Пуговок». */
.gj-button-deco {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 38% 38%, var(--gj-navy) 0 7%, transparent 7.5%),
    radial-gradient(circle at 62% 38%, var(--gj-navy) 0 7%, transparent 7.5%),
    radial-gradient(circle at 38% 62%, var(--gj-navy) 0 7%, transparent 7.5%),
    radial-gradient(circle at 62% 62%, var(--gj-navy) 0 7%, transparent 7.5%),
    radial-gradient(
      circle,
      transparent 0 58%,
      rgb(31 39 66 / 22%) 58.5% 62%,
      transparent 62.5%
    ),
    var(--gj-button-color, var(--gj-coral));
}

.gj-button-deco--a {
  top: -38px;
  right: 30%;
  width: 120px;
  height: 120px;
  --gj-button-color: var(--gj-coral);
  opacity: 0.9;
}

.gj-button-deco--b {
  right: -30px;
  bottom: -40px;
  width: 170px;
  height: 170px;
  --gj-button-color: var(--gj-violet);
}

.gj-button-deco--c {
  left: 46%;
  bottom: 18px;
  width: 54px;
  height: 54px;
  --gj-button-color: var(--gj-sun);
  opacity: 0.85;
}

/* ---------- Buttons and chips ---------- */
.gj-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border: 2px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background-color 0.15s ease;
}

.gj-btn:hover {
  transform: translateY(-1px);
}

.gj-btn:disabled {
  cursor: progress;
  opacity: 0.7;
  transform: none;
}

/*
 * <button class="gj-btn">: правила портала html[data-fbvs-portal] :is(…, button) { font: inherit } (0,1,2)
 * и :is(.btn, button…):not(.btn--sm) { min-height: 44px } (0,3,2) перебивают .gj-btn, поэтому кнопки
 * были тоньше и ниже ссылок того же вида. Компактные .gjw-btn остаются 44 px намеренно.
 */
html[data-fbvs-portal] main.gj-page button.gj-btn {
  font-weight: 700;
}

html[data-fbvs-portal] main.gj-page button.gj-btn:not(.gjw-btn) {
  min-height: 48px;
}

/*
 * Цвет кнопок-ссылок задан селектором (0,3,0): правило портала
 * html[data-fbvs-portal] :is(a:not(.btn)) (0,2,2) иначе красит текст кнопки цветом ссылки.
 */
.gj-page .gj-btn.gj-btn--sun {
  background: var(--gj-sun);
  color: var(--gj-navy);
}

.gj-page .gj-btn.gj-btn--primary {
  background: var(--gj-violet);
  color: #ffffff;
}

.gj-page .gj-btn.gj-btn--primary:hover {
  background: var(--gj-violet-strong);
}

.gj-page .gj-btn.gj-btn--ghost {
  border-color: rgb(255 255 255 / 70%);
  color: #ffffff;
}

.gj-page .gj-btn.gj-btn--outline {
  border-color: var(--gj-violet);
  color: var(--gj-violet-strong);
  background: transparent;
}

[data-theme="dark"] .gj-page .gj-btn.gj-btn--outline {
  color: var(--gj-lilac);
  border-color: var(--gj-lilac);
}

.gj-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.4;
}

.gj-chip--role {
  background: var(--gj-lilac);
  color: var(--gj-navy);
}

.gj-chip--now {
  margin-left: 6px;
  background: #ffffff;
  color: var(--gj-navy);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Role line (внутри «Ваше участие») ---------- */
.gj-role {
  margin: 0 0 20px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--gj-border);
}

.gj-role__line {
  margin: 0;
}

.gj-role__line + .gj-role__line {
  margin-top: 6px;
}

.gj-role__line--note {
  color: var(--gj-muted);
}

/* ---------- Sections ---------- */
.gj-section {
  margin-top: 56px;
}

/* Цель перехода по #id не уходит под верхнюю шапку; значение задаёт js/anchor-navigation.js. */
.gj-page [id] {
  scroll-margin-top: var(--fbvs-anchor-offset, 16px);
}

/* ---------- Правила: мини-навигация по разделам ---------- */
.gj-rules {
  margin-top: 56px;
}

.gj-toc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 16px 20px;
  border: 1px solid var(--gj-border);
  border-radius: var(--gj-radius);
  background: var(--gj-surface);
}

.gj-toc__title {
  margin: 0;
  font-weight: 800;
}

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

/* (0,3,0): правило портала html[data-fbvs-portal] :is(a:not(.btn)) (0,2,2) иначе красит текст цветом ссылки. */
.gj-page .gj-toc .gj-toc__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--gj-lilac-soft);
  color: var(--gj-text);
  font-weight: 700;
  text-decoration: none;
}

.gj-page .gj-toc .gj-toc__link:hover {
  background: var(--gj-lilac);
  color: var(--gj-navy);
}

.gj-toc + .gj-section {
  margin-top: 32px;
}

.gj-page .gj-h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  color: var(--gj-text);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.gj-h2::before {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 38%, var(--gj-paper) 0 9%, transparent 10%),
    radial-gradient(circle at 62% 38%, var(--gj-paper) 0 9%, transparent 10%),
    radial-gradient(circle at 38% 62%, var(--gj-paper) 0 9%, transparent 10%),
    radial-gradient(circle at 62% 62%, var(--gj-paper) 0 9%, transparent 10%),
    var(--gj-coral);
  content: "";
}

.gj-page .gj-h3 {
  margin: 0 0 10px;
  color: var(--gj-text);
  font-size: 1.15rem;
  font-weight: 700;
}

.gj-muted {
  color: var(--gj-muted);
}

.gj-list {
  margin: 0;
  padding-left: 1.2rem;
}

.gj-list li + li {
  margin-top: 8px;
}

.gj-list li::marker {
  color: var(--gj-coral);
}

/* ---------- Schedule ---------- */
.gj-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.gj-step {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--gj-border);
  border-radius: var(--gj-radius);
  background: var(--gj-surface);
}

.gj-step__num {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gj-lilac-soft);
  color: var(--gj-text);
  font-weight: 800;
}

.gj-step__title {
  font-weight: 700;
}

.gj-step__when {
  color: var(--gj-muted);
  font-size: 0.92rem;
}

.gj-step--current {
  border-color: var(--gj-violet);
  background: var(--gj-violet);
  color: #ffffff;
}

.gj-step--current .gj-step__num {
  background: var(--gj-sun);
  color: var(--gj-navy);
}

.gj-step--current .gj-step__when {
  color: #ffffff;
}

/* ---------- Prizes ---------- */
.gj-prizes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 16px;
  margin-bottom: 20px;
}

.gj-prize {
  padding: 28px;
  border-radius: var(--gj-radius);
}

.gj-prize p {
  margin: 0;
}

.gj-prize__title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
}

.gj-prize--jury {
  background: var(--gj-violet);
  color: #ffffff;
}

.gj-prize--jury .gj-prize__title {
  color: #ffffff;
}

.gj-prize__amount {
  margin: 0 0 12px !important;
  color: var(--gj-sun);
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
}

.gj-prize--audience {
  border: 1px solid var(--gj-border);
  background: var(--gj-cream);
}

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

.gj-places li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--gj-surface);
}

.gj-places__place {
  font-weight: 600;
}

.gj-places__amount {
  color: var(--gj-coral-text);
  font-size: 1.5rem;
  font-weight: 800;
}

/* ---------- Cards ---------- */
.gj-columns,
.gj-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.gj-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gj-card {
  padding: 22px;
  border: 1px solid var(--gj-border);
  border-radius: var(--gj-radius);
  background: var(--gj-surface);
}

.gj-card p {
  margin: 0;
}

.gj-card p + p {
  margin-top: 10px;
}

.gj-card--soft {
  border-color: transparent;
  background: var(--gj-lilac-soft);
}

.gj-card--warn {
  border: 2px solid var(--gj-coral);
}

/* ---------- Materials ---------- */
.gj-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gj-page .gj-link-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 20px 52px 20px 22px;
  position: relative;
  border: 1px solid var(--gj-border);
  border-radius: var(--gj-radius);
  background: var(--gj-surface);
  color: var(--gj-text);
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}

.gj-link-card::after {
  position: absolute;
  top: 20px;
  right: 20px;
  color: var(--gj-coral);
  font-size: 1.25rem;
  font-weight: 800;
  content: "↗";
}

.gj-link-card:hover {
  border-color: var(--gj-violet);
  transform: translateY(-2px);
}

.gj-link-card__title {
  font-weight: 700;
}

.gj-link-card__copy {
  color: var(--gj-muted);
  font-size: 0.92rem;
}

/* ---------- Registration ---------- */
.gj-register {
  margin-top: 32px;
  padding: 32px;
  border: 2px solid var(--gj-lilac);
  border-radius: 28px;
  background: var(--gj-surface);
}

.gj-notice {
  margin: 0;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--gj-cream);
}

.gj-status {
  margin-bottom: 16px;
  padding: 20px;
  border-radius: var(--gj-radius);
  background: var(--gj-lilac-soft);
}

.gj-status__title {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 800;
}

.gj-status .gj-muted {
  margin: 0 0 12px;
}

.gj-summary {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 16px;
  margin: 0;
}

.gj-summary dt {
  color: var(--gj-muted);
}

.gj-summary dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.gj-edit > summary {
  list-style: none;
}

.gj-edit > summary::-webkit-details-marker {
  display: none;
}

.gj-edit[open] > summary {
  margin-bottom: 20px;
}

.gj-guest p {
  margin: 0 0 8px;
}

.gj-guest .gj-btn {
  margin-top: 8px;
}

.gj-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
  max-width: 760px;
}

.gj-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gj-field label {
  font-weight: 600;
}

.gj-field input[type="text"],
.gj-field input[type="email"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px solid var(--gj-border);
  border-radius: 12px;
  background: var(--gj-paper);
  color: var(--gj-text);
  font: inherit;
}

.gj-field input:focus-visible {
  border-color: var(--gj-violet);
  outline-offset: 1px;
}

.gj-field input[aria-invalid="true"] {
  border-color: var(--gj-coral);
}

.gj-field--check,
.gj-form > .gj-field__hint,
.gj-form__error,
.gj-form__actions {
  grid-column: 1 / -1;
}

.gj-field--check {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  column-gap: 12px;
}

.gj-field--check input {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--gj-violet);
}

.gj-field--check label {
  font-weight: 500;
}

.gj-field--check .gj-field__error {
  grid-column: 2;
}

.gj-field__hint {
  margin: 0;
  color: var(--gj-muted);
  font-size: 0.88rem;
}

.gj-field__error,
.gj-form__error {
  margin: 0;
  color: var(--gj-coral-text);
  font-size: 0.92rem;
  font-weight: 600;
}

.gj-req {
  color: var(--gj-coral-text);
}

.gj-opt {
  color: var(--gj-muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.gj-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
}

.gj-form__status {
  margin: 0;
  color: var(--gj-muted);
  font-weight: 600;
}

/* ---------- FAQ ---------- */
.gj-faq {
  display: grid;
  gap: 10px;
}

.gj-faq__item {
  border: 1px solid var(--gj-border);
  border-radius: 16px;
  background: var(--gj-surface);
}

.gj-faq__item summary {
  position: relative;
  padding: 16px 48px 16px 20px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.gj-faq__item summary::-webkit-details-marker {
  display: none;
}

.gj-faq__item summary::after {
  position: absolute;
  top: 50%;
  right: 20px;
  color: var(--gj-coral);
  font-size: 1.4rem;
  line-height: 1;
  content: "+";
  transform: translateY(-50%);
}

.gj-faq__item[open] summary::after {
  content: "−";
}

.gj-faq__item p {
  margin: 0;
  padding: 0 20px 18px;
}

/* ---------- Contact ---------- */
.gj-contact {
  margin-top: 56px;
  padding: 24px 28px;
  border-radius: var(--gj-radius);
  background: var(--gj-cream);
}

.gj-contact p {
  margin: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .gj-hero__inner {
    grid-template-columns: minmax(0, 1fr);
    padding: 40px 28px;
  }

  .gj-steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .gj-step {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    column-gap: 14px;
    row-gap: 2px;
    align-items: center;
  }

  .gj-step__when {
    grid-column: 2;
  }

  .gj-columns,
  .gj-cards,
  .gj-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gj-button-deco--a {
    right: 12%;
  }
}

@media (max-width: 640px) {
  .gj-hero {
    width: calc(100% - 20px);
    margin-top: 12px;
    border-radius: 22px;
  }

  .gj-hero__inner {
    padding: 32px 20px;
  }

  .gj-hero__lead {
    font-size: 1rem;
  }

  /* Основные кнопки — во всю ширину, второстепенные (ghost) — по две в ряд. */
  .gj-hero__actions .gj-btn {
    flex: 1 1 100%;
    min-width: 0;
    text-align: center;
  }

  .gj-hero__actions .gj-btn.gj-btn--ghost {
    flex: 1 1 calc(50% - 6px);
    padding-inline: 12px;
  }

  .gj-countdown {
    padding: 16px;
  }

  .gj-button-deco--a {
    top: -50px;
    right: -30px;
    width: 110px;
    height: 110px;
  }

  .gj-button-deco--b,
  .gj-button-deco--c {
    display: none;
  }

  .gj-section {
    margin-top: 40px;
  }

  .gj-prizes,
  .gj-columns,
  .gj-cards,
  .gj-links,
  .gj-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .gj-register {
    margin-top: 24px;
    padding: 22px 18px;
    border-radius: 22px;
  }

  .gj-rules {
    margin-top: 40px;
  }

  .gj-toc {
    padding: 14px 16px;
  }

  .gj-toc + .gj-section {
    margin-top: 28px;
  }

  .gj-prize {
    padding: 22px;
  }

  .gj-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .gj-summary dd {
    margin-bottom: 6px;
  }

  .gj-form__actions .gj-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gj-btn,
  .gj-link-card {
    transition: none;
  }

  .gj-btn:hover,
  .gj-link-card:hover {
    transform: none;
  }
}

/*
 * ---------- Волна 2: «Мои работы» (/gamejam/my) и плашка режима проверки ----------
 * Цвета меток заданы явно (не через переменные темы), чтобы контраст ≥ 4.5:1
 * сохранялся и в светлой, и в тёмной теме.
 */
.gj-page [hidden] {
  display: none !important;
}

.gj-testmode {
  margin-top: 16px;
  margin-bottom: 0;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--gj-sun);
  color: var(--gj-navy);
}

.gj-page .gj-testmode a {
  color: var(--gj-navy);
}

.gjw-head {
  margin: 24px auto 0;
  width: min(100% - 32px, 1180px);
  border-radius: 28px;
  background: var(--gj-navy);
  color: #ffffff;
  --gj-focus: var(--gj-sun);
}

.gjw-head__inner {
  padding: 40px 48px;
}

.gjw-head__back {
  margin: 0 0 12px;
  font-weight: 600;
}

/* (0,3,1): правило портала для ссылок (0,2,2) иначе красит ссылку в цвет темы. */
.gj-page .gjw-head .gjw-head__back a {
  color: var(--gj-sun);
}

.gj-page .gjw-head__title {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.gjw-head__lead {
  max-width: 760px;
  margin: 0;
  color: #ffffff;
  font-size: 1.05rem;
}

.gjw-head__lead strong {
  color: var(--gj-sun);
}

/* Второй абзац шапки: пометка «Авторы скрыты до окончания голосования…» (D20). */
.gjw-head__lead + .gjw-head__lead {
  margin-top: 8px;
}

.gjw__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 20px;
}

.gj-page .gjw__bar .gj-h2 {
  margin: 0;
}

.gjw > .gj-notice,
.gjw > .gjw-state,
.gjw__notice,
.gjw__load-error {
  margin: 0 0 20px;
}

.gjw-state p {
  margin: 0 0 12px;
}

.gjw__notice {
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--gj-lilac-soft);
  font-weight: 600;
}

.gjw__notice--error {
  background: #ffe7dc;
  color: #8a2e12;
}

/* ---------- Редактор ---------- */
.gjw-editor {
  margin: 0 0 28px;
  padding: 28px 32px;
  border: 2px solid var(--gj-lilac);
  border-radius: 28px;
  background: var(--gj-surface);
}

.gj-page .gjw-editor .gj-h3 {
  margin-bottom: 18px;
  font-size: 1.35rem;
}

.gjw-form {
  grid-template-columns: minmax(0, 1fr);
}

.gjw-form > .gj-field__hint,
.gjw-form > .gjw-fieldset,
.gjw-form > .gjw-progress {
  grid-column: 1 / -1;
}

.gj-field input[type="url"],
.gj-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px solid var(--gj-border);
  border-radius: 12px;
  background: var(--gj-paper);
  color: var(--gj-text);
  font: inherit;
}

.gj-field textarea {
  min-height: 140px;
  resize: vertical;
}

.gj-field textarea:focus-visible {
  border-color: var(--gj-violet);
  outline-offset: 1px;
}

.gj-field textarea[aria-invalid="true"] {
  border-color: var(--gj-coral);
}

.gj-field input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 1.5px dashed var(--gj-violet);
  border-radius: 12px;
  background: var(--gj-lilac-soft);
  color: var(--gj-text);
  font: inherit;
  font-size: 0.95rem;
}

.gj-field input[type="file"][aria-invalid="true"] {
  border-color: var(--gj-coral);
}

.gj-field input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--gj-violet);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.gjw-fieldset {
  display: grid;
  gap: 16px;
  min-width: 0;
  margin: 0;
  padding: 18px 20px 20px;
  border: 1.5px solid var(--gj-border);
  border-radius: 16px;
}

.gjw-fieldset legend {
  padding: 0 6px;
  font-weight: 700;
}

.gjw-current {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--gj-cream);
  overflow-wrap: anywhere;
}

.gjw-link-btn {
  padding: 4px 6px;
  border: 0;
  background: none;
  color: var(--gj-coral-text);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.gjw-progress {
  display: grid;
  gap: 6px;
}

.gjw-progress progress {
  width: 100%;
  height: 12px;
  accent-color: var(--gj-violet);
}

.gjw-progress span {
  color: var(--gj-muted);
  font-size: 0.92rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ---------- Список работ ---------- */
.gjw-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gjw-list:empty {
  display: none;
}

.gjw__empty {
  margin: 0;
}

.gjw-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 22px 24px;
  border: 1px solid var(--gj-border);
  border-radius: var(--gj-radius);
  background: var(--gj-surface);
}

.gjw-card--test {
  border: 2px dashed var(--gj-violet);
}

[data-theme="dark"] .gj-page .gjw-card--test {
  border-color: var(--gj-sun);
}

.gjw-card__head {
  display: grid;
  gap: 6px;
}

.gjw-card__no {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--gj-muted);
  font-size: 0.92rem;
}

.gjw-card__no strong {
  color: var(--gj-text);
}

.gj-page .gjw-card__title {
  margin: 0;
  color: var(--gj-text);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.gjw-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.gjw-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e9e8ff;
  color: #1f2742;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
}

.gjw-tag--draft {
  background: #fff4df;
  color: #1f2742;
}

.gjw-tag--submitted {
  background: #d2d0ff;
  color: #1f2742;
}

.gjw-tag--approved,
.gjw-tag--check-passed {
  background: #d7f5e1;
  color: #14532d;
}

.gjw-tag--rejected,
.gjw-tag--withdrawn {
  background: #f1f1f4;
  color: #4a5170;
}

.gjw-tag--check-checking {
  background: #fed78c;
  color: #1f2742;
}

.gjw-tag--check-warn {
  background: #ffe7dc;
  color: #8a2e12;
}

.gjw-tag--check-blocked {
  background: #b8431f;
  color: #ffffff;
}

.gjw-tag--test {
  background: #1f2742;
  color: #fed78c;
  letter-spacing: 0.04em;
}

[data-theme="dark"] .gj-page .gjw-tag--test {
  background: #fed78c;
  color: #1f2742;
}

/* Волна 3: номер в голосовании (W3-8). Цвета фиксированы — контраст одинаков в обеих темах. */
.gjw-tag--number {
  background: #1f2742;
  color: #ffffff;
}

[data-theme="dark"] .gj-page .gjw-tag--number {
  background: #d2d0ff;
  color: #1f2742;
}

.gjw-card__warn,
.gjw-card__alert,
.gjw-card__ok {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
}

.gjw-card__ok {
  border-left: 4px solid #2f8f55;
  background: #d7f5e1;
  color: #14532d;
}

.gjw-card__warn {
  border-left: 4px solid var(--gj-coral);
  background: var(--gj-cream);
}

.gjw-card__alert {
  border: 2px solid var(--gj-coral);
  color: var(--gj-coral-text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.gjw-card__meta {
  font-size: 0.95rem;
}

.gjw-card__desc summary {
  font-weight: 700;
  cursor: pointer;
}

.gjw-card__desc p {
  margin: 8px 0 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.gjw-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.gj-page .gj-btn.gjw-btn {
  min-height: 44px;
  padding: 8px 18px;
  font-size: 0.95rem;
}

.gj-page .gj-btn.gjw-btn--danger {
  border-color: var(--gj-coral-text);
  background: transparent;
  color: var(--gj-coral-text);
}

.gj-page .gj-btn.gjw-btn--danger:hover {
  background: #ffe7dc;
  color: #8a2e12;
}

/* Обложка от автора (27.11.2026): панель внутри карточки работы, её рисует js/modules/gamejam-cover-author.js.
   Цвета берутся из переменных страницы, метки статуса имеют фиксированные пары цветов (контраст одинаков в обеих темах). */
.gjw-cover[hidden],
.gjw-cover__panel[hidden] {
  display: none;
}

.gjw-cover__panel {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--gj-border);
  border-radius: 14px;
  background: var(--gj-lilac-soft);
}

.gjw-cover__body {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.gjw-cover__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.gj-page .gjw-cover__title {
  margin: 0;
  color: var(--gj-text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
}

.gjw-cover__tag--pending {
  background: #fed78c;
  color: #1f2742;
}

.gjw-cover__tag--published {
  background: #d7f5e1;
  color: #14532d;
}

.gjw-cover__tag--returned {
  background: #ffe7dc;
  color: #8a2e12;
}

.gjw-cover__tag--superseded {
  background: #f1f1f4;
  color: #4a5170;
}

.gjw-cover__main {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.gjw-cover__preview {
  margin: 0;
}

/* Without a picture the text takes the whole panel instead of the narrow column made for the preview (review C-04). */
.gjw-cover__info:only-child {
  grid-column: 1 / -1;
}

/* The prepared frame is what the author checks before sending, so it gets the full width of the panel (the panel itself is
   only about 500px wide on a desktop: a second column would squeeze the text and the buttons). */
.gjw-cover__main--staged {
  grid-template-columns: minmax(0, 1fr);
}

.gjw-cover__main--staged .gjw-cover__preview {
  max-width: 560px;
}

.gjw-cover__caption {
  margin-top: 6px;
  color: var(--gj-muted);
  font-size: 0.9rem;
}

.gjw-cover__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--gj-border);
  border-radius: 10px;
  background: var(--gj-surface);
}

.gjw-cover__info {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.gjw-cover__info p {
  margin: 0;
  overflow-wrap: anywhere;
}

.gjw-cover__meta,
.gjw-cover__hint {
  color: var(--gj-muted);
  font-size: 0.9rem;
}

.gjw-cover__reason {
  padding: 10px 12px;
  border: 2px solid var(--gj-coral);
  border-radius: 10px;
  color: var(--gj-coral-text);
  font-weight: 600;
}

.gjw-cover__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gjw-cover__confirm {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid var(--gj-coral);
  border-radius: 10px;
}

.gjw-cover__status,
.gjw-cover__error {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.gjw-cover__status:not(:empty),
.gjw-cover__error:not(:empty) {
  margin-top: 12px;
}

.gjw-cover__error {
  color: var(--gj-coral-text);
}

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

  .gjw-cover__actions .gj-btn {
    flex: 1 1 100%;
  }
}

.gjw-help .gj-list {
  margin-bottom: 14px;
}

@media (max-width: 640px) {
  .gjw-head {
    width: calc(100% - 20px);
    margin-top: 12px;
    border-radius: 22px;
  }

  .gjw-head__inner {
    padding: 28px 20px;
  }

  .gj-testmode {
    width: calc(100% - 20px);
  }

  .gjw__bar .gj-btn {
    width: 100%;
  }

  .gjw-editor {
    padding: 22px 16px;
    border-radius: 22px;
  }

  .gjw-fieldset {
    padding: 14px 14px 16px;
  }

  .gjw-card {
    padding: 18px 16px;
  }

  .gjw-card__actions .gj-btn {
    flex: 1 1 100%;
  }
}

/* Строка «Мои работы» в блоке «Ваше участие» страницы /gamejam (волна 2); с 26.11.2026 стоит перед личными данными. */
.gj-status__works {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 4px 0 16px;
}

.gj-status__works:last-child {
  margin-bottom: 0;
}

.gj-status .gj-status__works .gj-muted {
  margin: 0;
}

/* Wave 3: game sandbox (views/partials/gamejam/game-frame.ejs) and the moderation preview page. */
.gj-frame {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 16px 0;
  border: 1px solid var(--gj-border);
  border-radius: 16px;
  overflow: hidden;
  background: #000;
}
.gj-frame__iframe {
  display: block;
  width: 100%;
  height: min(78vh, 720px);
  border: 0;
  background: #000;
}
.gjp__meta {
  margin: 4px 0 12px;
}
.gjp__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 8px 0 0;
}
@media (max-width: 640px) {
  .gj-frame {
    border-radius: 12px;
  }
  .gj-frame__iframe {
    height: 70vh;
  }
}

/* ---------- Wave 4: voting (/gamejam/vote), catalog (/gamejam/works), game page and ranking ---------- */
.gj-page .gj-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.gjv__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 20px;
}
.gjv__bar .gj-h2 {
  margin: 0;
}
/* D29: прогресс — только текст «Оценено пар: N», без общего числа и полосы. */
.gjv__progress-text {
  margin: 0;
  font-weight: 700;
}
.gjv-state,
.gjv-error {
  margin: 0 0 16px;
}
.gjv-state .gj-h3 {
  margin: 0 0 8px;
}
.gjv-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.gjv-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.gjv-card__cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--gj-lilac-soft);
}
.gjv-card__cover-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  color: var(--gj-muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.gjv-card__cover-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gjv-card__more {
  min-width: 0;
  border: 1px solid var(--gj-border);
  border-radius: 12px;
  background: var(--gj-surface);
  color: var(--gj-text);
}
.gjv-card__more > summary {
  display: list-item;
  min-height: 44px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.gjv-card__more > summary:focus-visible {
  outline: 3px solid var(--gj-focus);
  outline-offset: 3px;
}
.gjv-card__blocks {
  padding: 0 14px 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.gjv-card__blocks p {
  margin: 0 0 1em;
  white-space: pre-line;
}
.gjv-card__blocks ul,
.gjv-card__blocks ol {
  margin: 0 0 1em;
  padding-inline-start: 1.5em;
}
.gjv-card__blocks li + li {
  margin-top: 0.4em;
}
.gjv-card__blocks > :last-child {
  margin-bottom: 0;
}
.gjv-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.gjv-card__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.gjv-card__desc {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.gjv-card__author {
  margin: 0;
}
.gjv-card__opened {
  color: var(--gj-muted);
  font-size: 0.9rem;
  font-weight: 600;
}
.gjv-card__play {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}
.gjv-card__hint {
  margin: 0;
  font-size: 0.9rem;
}
/* D27: «Эта игра лучше» — последняя в карточке своей игры, на всю ширину; карточки одной высоты, кнопки на одном уровне. */
.gjv-card__vote {
  width: 100%;
  margin-top: 6px;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}
.gj-page .gj-btn[aria-pressed="true"] {
  background: var(--gj-navy);
  color: #ffffff;
}
[data-theme="dark"] .gj-page .gj-btn[aria-pressed="true"] {
  background: var(--gj-sun);
  color: var(--gj-navy);
}
.gj-page .gj-btn:disabled {
  background: var(--gj-lilac-soft);
  border-color: var(--gj-border);
  color: var(--gj-muted);
  cursor: not-allowed;
  opacity: 1;
}
.gjv-actions__hint {
  margin: 16px 0 0;
  text-align: center;
}
.gjv-actions__hint:empty {
  display: none;
}
/* D29: подсказки «сначала сыграть» — яркая жёлтая плашка по центру, тёмно-синий жирный текст
   (контраст около 10:1, одинаково в обеих темах: --gj-sun и --gj-navy тёмная тема не меняет).
   Служебные «Отправляем…» и пауза между голосами остаются обычной серой строкой (.gj-muted). */
.gjv-actions__hint--attention {
  width: fit-content;
  max-width: 100%;
  margin: 20px auto 0;
  padding: 12px 20px;
  border-radius: 14px;
  background: var(--gj-sun);
  color: var(--gj-navy);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
/* D27: «Пропустить пару» — отдельная строка под карточками и над окном игры, кнопка компактнее основных. */
.gjv-skip {
  display: flex;
  justify-content: center;
  margin: 12px 0 0;
}
html[data-fbvs-portal] main.gj-page button.gj-btn.gjv-skip__btn,
.gj-page .gj-btn.gjv-skip__btn {
  min-height: 40px;
  padding: 6px 18px;
  font-size: 0.9rem;
}
.gjv-stage {
  margin-top: 24px;
}
.gjv-stage__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
.gjv-stage__title {
  margin: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.gjv-stage__note {
  margin: 0;
  font-size: 0.9rem;
}
/* D27: окно игры как на /gamejam/play (.gjplay-stage): вся ширина, высота до 72% экрана и 800 px, полный экран. */
.gjv-stage__warning {
  margin: 12px 0 0;
}
.gjv-stage__screen {
  width: 100%;
  min-width: 0;
}
.gjv-stage__screen .gj-frame {
  width: 100%;
  max-width: none;
  margin: 12px 0;
}
.gjv-stage__screen .gj-frame__iframe {
  width: 100%;
  height: min(72vh, 800px);
  height: min(72dvh, 800px);
}
.gjv-stage__screen:fullscreen {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #000;
}
.gjv-stage__screen:fullscreen .gj-frame {
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
}
.gjv-stage__screen:fullscreen .gj-frame__iframe {
  height: 100%;
}
.gjv-stage__actions {
  gap: 12px;
  margin: 0 0 8px;
}
.gjv-stage__actions > .gj-btn {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}
.gjv-stage__fullscreen-status {
  margin: 0 0 8px;
}
.gjv-stage__fullscreen-status:empty {
  display: none;
}
.gjv-links {
  margin: 0;
}
.gjc__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0;
}
.gjc-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gjc-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.gjc-card__actions {
  margin: auto 0 0;
}
.gjc__count {
  font-weight: 600;
}
.gjplay__desc {
  max-width: 760px;
  margin: 0 0 8px;
}
.gjr-scroll {
  overflow-x: auto;
  border: 1px solid var(--gj-border);
  border-radius: 16px;
  background: var(--gj-surface);
}
.gjr-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}
.gjr-table th,
.gjr-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gj-border);
  text-align: left;
  vertical-align: top;
}
.gjr-table thead th {
  background: var(--gj-lilac-soft);
  font-weight: 800;
}
.gjr-table tbody tr:last-child th,
.gjr-table tbody tr:last-child td {
  border-bottom: 0;
}
.gjr-table .gjr-num {
  text-align: right;
  white-space: nowrap;
}
.gjr-table tr[data-needs-decision="true"] {
  background: var(--gj-cream);
}
.gjr__note {
  margin: 16px 0 0;
}
@media (max-width: 760px) {
  .gjv-cards {
    grid-template-columns: minmax(0, 1fr);
  }
  .gjw-head__inner {
    padding: 28px 22px;
  }
}
@media (max-width: 640px) {
  .gjv-stage__actions > .gj-btn {
    flex: 1 1 100%;
  }
  .gjv-stage__screen .gj-frame__iframe {
    height: 65vh;
    height: 65dvh;
  }
  .gjv-stage__screen:fullscreen .gj-frame__iframe {
    height: 100%;
  }
}

/* Presentation UI 2026-11-26 */
html[data-fbvs-portal="a"] main:is(.gjc-page, .gjplay-page) a.gj-btn {
  text-decoration: none;
}

.gjc-page .gjw-head {
  width: min(100% - 32px, 1120px);
  margin-top: 24px;
  border-radius: 0;
  background: transparent;
  color: var(--gj-text);
  --gj-focus: var(--gj-violet);
}
[data-theme="dark"] .gjc-page .gjw-head {
  --gj-focus: var(--gj-sun);
}
.gjc-page .gjw-head__inner {
  padding: 0;
}
.gjc-page .gjw-head .gjw-head__title {
  color: var(--gj-text);
  font-size: clamp(1.75rem, 3vw, 2.4rem);
}
.gjc-page .gjw-head .gjw-head__lead {
  color: var(--gj-muted);
  font-size: 1rem;
}
.gjc-page .gjw-head .gjw-head__lead strong {
  color: var(--gj-text);
}
.gjc-page .gjw-head .gjw-head__back a {
  color: var(--gj-violet-strong);
}
[data-theme="dark"] .gjc-page .gjw-head .gjw-head__back a {
  color: var(--gj-lilac);
}
.gjc-page .gj-testmode {
  width: min(100% - 32px, 1120px);
}
.gjc-page .gjc {
  margin-top: 24px;
  container-type: inline-size;
}
.gjc-page .gjc-list {
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}
@container (min-width: 650px) {
  .gjc-page .gjc-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@container (min-width: 1000px) {
  .gjc-page .gjc-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.gjc-page .gjc-card {
  padding: 16px;
  gap: 12px;
  min-width: 0;
}
.gjc-page .gjc-card__preview {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: var(--gj-lilac-soft);
  color: var(--gj-text);
  text-decoration: none;
}
.gjc-page .gjc-card__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  color: var(--gj-muted);
  font-weight: 700;
}
.gjc-page .gjc-card__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gjc-page .gjc-card .gjv-card__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--gj-text);
}
.gjc-page .gjc-card .gjc-card__title-link {
  color: var(--gj-text);
  text-decoration: none;
}
.gjc-page .gjc-card .gjc-card__title-link:hover {
  text-decoration: underline;
}
.gjc-page .gjc-card .gjv-card__desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.gjc-page .gjc-card .gjc-card__actions {
  margin: auto 0 0;
}
.gjc-page .gjc-card .gjc-card__actions .gj-btn {
  width: 100%;
  text-align: center;
}

.gjplay-page .gjp {
  margin-top: 24px;
  min-width: 0;
}
.gjplay-page .gjp .gj-h2 {
  overflow-wrap: anywhere;
}
.gjplay-page .gjplay__summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  margin: 0 0 12px;
  line-height: 1.5;
}
.gjplay-page .gj-testmode,
.gjplay-page .gjplay__warning {
  margin: 12px 0;
  width: auto;
}
.gjplay-page .gjplay-stage {
  width: 100%;
  min-width: 0;
}
.gjplay-page .gjplay-stage .gj-frame {
  width: 100%;
  max-width: none;
  margin: 12px 0;
}
.gjplay-page .gjplay-stage .gj-frame__iframe {
  width: 100%;
  height: min(72vh, 800px);
  height: min(72dvh, 800px);
}
.gjplay-page .gjplay-stage:fullscreen {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #000;
}
.gjplay-page .gjplay-stage:fullscreen .gj-frame {
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
}
.gjplay-page .gjplay-stage:fullscreen .gj-frame__iframe {
  height: 100%;
}
.gjplay-page .gjp__actions {
  gap: 12px;
  margin-top: 12px;
}
.gjplay-page .gjp__actions > .gj-btn {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}
.gjplay-page .gjplay__fullscreen-status {
  margin: 8px 0 0;
}
.gjplay-page .gjplay__fullscreen-status:empty {
  display: none;
}
.gjplay-page .gj-description {
  margin-top: 24px;
  border: 1px solid var(--gj-border);
  border-radius: 16px;
  background: var(--gj-surface);
}
.gjplay-page .gj-description > summary {
  padding: 16px;
  min-height: 48px;
  cursor: pointer;
  font-weight: 700;
}
.gjplay-page .gj-description__body {
  max-width: 70ch;
  padding: 0 16px 16px;
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.gjplay-page .gj-description__body p {
  margin: 0 0 1em;
  white-space: pre-line;
}
.gjplay-page .gj-description__body ul {
  margin: 0 0 1em;
  padding-inline-start: 1.5em;
}
.gjplay-page .gj-description__body li + li {
  margin-top: 0.4em;
}
@media (max-width: 640px) {
  .gjplay-page .gjp__actions > .gj-btn {
    flex: 1 1 100%;
  }
  .gjplay-page .gjplay-stage .gj-frame__iframe {
    height: 65vh;
    height: 65dvh;
  }
  .gjplay-page .gjplay-stage:fullscreen .gj-frame__iframe {
    height: 100%;
  }
}

/* Application counts (27.11): reuse the countdown card, tiles and theme tokens. */
.gj-hero__aside {
  display: grid;
  gap: 16px;
  min-width: 0;
  width: 100%;
}
.gj-applications__units {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.gj-applications .gj-countdown__unit {
  min-width: 0;
}
.gj-applications .gj-countdown__unit b {
  max-width: 100%;
  overflow-wrap: anywhere;
}

/*
 * D24–D26 (27.11): звёзды под игрой, «следующая игра», отметки «сыграно», колонки звёзд и времени в рейтинге.
 * Смысл не держится на цвете: выбранная звезда залита, невыбранная контурная; рядом всегда текст «Ваша оценка: N из 10»;
 * сыгранная игра отмечена знаком «✓» и словами для чтения с экрана. Цели нажатия не меньше 44px, фокус виден.
 */
.gjrate {
  margin: 24px 0 0;
  padding: 20px;
  border: 1px solid var(--gj-border);
  border-radius: 16px;
  background: var(--gj-surface);
  min-width: 0;
}
.gjrate__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.3;
}
.gjrate__hint,
.gjrate__value,
.gjrate__deadline,
.gjrate__status,
.gjrate__actions,
.gjrate__readonly,
.gjrate [data-gjrate-message],
.gjrate [data-gjrate-testmode] {
  margin: 10px 0 0;
}
.gjrate__stars {
  display: grid;
  grid-template-columns: repeat(5, minmax(44px, 56px));
  gap: 6px;
  justify-content: start;
  margin-top: 12px;
}
.gjrate__star {
  appearance: none;
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 2px solid var(--gj-violet);
  border-radius: 12px;
  background: var(--gj-surface);
  color: var(--gj-muted);
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
/* Невыбранная звезда — контур, выбранная — заливка: различие в форме, а не только в цвете. */
.gjrate__star > span,
.gjrate__star--static {
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1.5px currentColor;
}
.gjrate__star.is-on {
  border-color: var(--gj-violet-strong);
  background: var(--gj-sun);
  color: var(--gj-navy);
}
.gjrate__star.is-on > span,
.gjrate__star--static.is-on {
  -webkit-text-fill-color: currentColor;
  -webkit-text-stroke: 0;
}
@media (hover: hover) {
  .gjrate__star:hover {
    border-color: var(--gj-violet-strong);
  }
}
.gjrate__star--static {
  min-width: 32px;
  min-height: 32px;
  border-width: 1px;
  border-radius: 8px;
  font-size: 1.15rem;
  cursor: default;
}
[data-theme="dark"] .gjrate__star {
  border-color: var(--gj-lilac);
}
[data-theme="dark"] .gjrate__star.is-on {
  border-color: var(--gj-sun);
}
.gjrate__readonly {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.gjrate__readonly-text {
  margin-inline-start: 8px;
}
.gjrate__value {
  overflow-wrap: anywhere;
}
.gjrate__status:empty {
  display: none;
}
.gjrate__status[data-error="true"] {
  color: var(--gj-coral-text);
  font-weight: 700;
}
.gjrate__status[data-error="true"]::before {
  content: "⚠ ";
  content: "⚠ " / "";
}
.gjrate__note {
  margin: 16px 0 0;
  padding: 12px 16px;
  border-inline-start: 4px solid var(--gj-violet-strong);
  border-radius: 8px;
  background: var(--gj-lilac-soft);
  font-size: 0.95rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
@media (min-width: 640px) {
  .gjrate__stars {
    grid-template-columns: repeat(10, 48px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .gjrate__star {
    transition: none;
  }
}
@media (forced-colors: active) {
  .gjrate__star.is-on {
    forced-color-adjust: none;
    border-color: Highlight;
    background: Highlight;
    color: HighlightText;
  }
}

/* Панель «Вы сыграли в N из M игр» на странице игры и в каталоге. */
.gjprog {
  margin: 24px 0 0;
  padding: 20px;
  border: 1px solid var(--gj-border);
  border-radius: 16px;
  background: var(--gj-surface);
  min-width: 0;
}
.gjprog__title {
  margin: 0 0 10px;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.3;
}
.gjprog__bar,
.gjc__progress-bar {
  appearance: none;
  display: block;
  width: 100%;
  max-width: 480px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--gj-lilac-soft);
  color: var(--gj-violet-strong);
}
.gjprog__bar::-webkit-progress-bar,
.gjc__progress-bar::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--gj-lilac-soft);
}
.gjprog__bar::-webkit-progress-value,
.gjc__progress-bar::-webkit-progress-value {
  border-radius: 999px;
  background: var(--gj-violet-strong);
}
.gjprog__bar::-moz-progress-bar,
.gjc__progress-bar::-moz-progress-bar {
  border-radius: 999px;
  background: var(--gj-violet-strong);
}
[data-theme="dark"] .gjprog__bar::-webkit-progress-value,
[data-theme="dark"] .gjc__progress-bar::-webkit-progress-value {
  background: var(--gj-sun);
}
[data-theme="dark"] .gjprog__bar::-moz-progress-bar,
[data-theme="dark"] .gjc__progress-bar::-moz-progress-bar {
  background: var(--gj-sun);
}
.gjprog__done {
  margin: 12px 0 0;
  font-weight: 600;
}
.gjprog__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.gjprog__item {
  margin: 0;
}
.gj-page .gjprog__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 12px;
  border: 2px solid var(--gj-border);
  border-radius: 999px;
  background: var(--gj-surface);
  color: var(--gj-text);
  font-weight: 700;
  text-decoration: none;
}
.gj-page .gjprog__chip.is-played {
  border-color: var(--gj-violet-strong);
  background: var(--gj-lilac-soft);
}
.gj-page .gjprog__chip.is-current {
  box-shadow: 0 0 0 3px var(--gj-violet-strong);
}
.gj-page .gjprog__chip.is-off {
  border-style: dashed;
  background: transparent;
  color: var(--gj-muted);
  font-weight: 600;
}
.gjprog__chip small {
  font-size: 0.8rem;
  font-weight: 600;
}
[data-theme="dark"] .gj-page .gjprog__chip.is-played {
  border-color: var(--gj-lilac);
}
[data-theme="dark"] .gj-page .gjprog__chip.is-current {
  box-shadow: 0 0 0 3px var(--gj-sun);
}

/* Кнопка «Следующая игра» под игрой. */
.gjplay-page .gjp__nav {
  margin-top: 20px;
}
.gjplay-page .gjp__nav > .gj-btn[data-gjplay-next] {
  min-width: 220px;
  gap: 0.4em;
}

/* Каталог: счётчик «сыграно» и отметка на карточке. */
.gjc__progress {
  margin: 0 0 20px;
  padding: 16px 20px;
  border: 1px solid var(--gj-border);
  border-radius: 16px;
  background: var(--gj-surface);
}
.gjc__progress-text {
  margin: 0 0 8px;
}
.gjc__guest-hint {
  margin: 0 0 16px;
}
/* Каталог: порядок карточек (D28) — пояснение и кнопки «Перемешать» / «По порядку». */
.gjc__order {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin: 0 0 20px;
}
.gjc__order .gjc__order-note {
  flex: 1 1 320px;
  margin: 0;
}
.gjc__order-note {
  max-width: 760px;
  margin: 0 0 16px;
  color: var(--gj-muted);
}
.gjc__order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.gjc__order-form {
  margin: 0;
}
@media (max-width: 640px) {
  .gjc__order-actions,
  .gjc__order-form,
  .gjc__order-actions .gj-btn {
    width: 100%;
  }
}
.gjc-page .gjc-card--played {
  border-color: var(--gj-violet-strong);
}
.gjc-card__played {
  color: var(--gj-violet-strong);
  font-weight: 700;
}
[data-theme="dark"] .gjc-card__played {
  color: var(--gj-lilac);
}
[data-theme="dark"] .gjc-page .gjc-card--played {
  border-color: var(--gj-lilac);
}

/* Рейтинг: колонки «Звёзды зрителей» и «Время в игре», строка итогов. */
.gjr-table {
  min-width: 1100px;
}
.gjr-table thead th:nth-child(3),
.gjr-table thead th:nth-child(4) {
  min-width: 160px;
}
.gjr-sub {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
  white-space: nowrap;
}
.gjr-table thead th {
  white-space: nowrap;
}
.gjr-table tfoot th,
.gjr-table tfoot td {
  border-top: 2px solid var(--gj-violet-strong);
  border-bottom: 0;
  background: var(--gj-lilac-soft);
  font-weight: 800;
}
