:root {
  color-scheme: dark;

  --bg: #684573;
  --panel: rgb(24 12 30 / 0.55);
  --panel-edge: rgb(255 255 255 / 0.07);
  --rule: rgb(255 255 255 / 0.1);
  --bar: #34203c;
  --text: #fff;
  --text-body: rgb(255 255 255 / 0.86);
  --text-muted: rgb(255 255 255 / 0.74);
  --gold: #ecb849;
  --gold-light: #f5cf7c;
  --ink: #1f1424;

  --font-display: "Sofia Sans Semi Condensed", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  --gutter: clamp(0.75rem, 0.35rem + 1.8vw, 2rem);
  --nav-width: clamp(12.5rem, 9rem + 5vw, 15rem);
  --column-gap: clamp(1.5rem, 0.5rem + 2.5vw, 3rem);
  --panel-pad: clamp(1.125rem, 0.75rem + 1.6vw, 2.25rem);
  --block-gap: clamp(1.25rem, 1rem + 0.9vw, 1.875rem);
  --radius-panel: 0.875rem;
  --radius-media: 0.625rem;
  --news-content-width: 50rem;
  --news-width: calc(var(--news-content-width) + 2 * var(--panel-pad) + 2px);
  --layout-width: min(100% - 2 * var(--gutter), var(--nav-width) + var(--column-gap) + var(--news-width));
  --sticky-offset: 1rem;
}

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

[hidden] {
  display: none !important;
}

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.9rem + 0.4vw, 1.125rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 0.125rem solid var(--gold);
  outline-offset: 0.1875rem;
}

::selection {
  background: var(--gold);
  color: var(--ink);
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: var(--gutter);
  z-index: 80;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  background: var(--gold);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.page-controls {
  position: fixed;
  top: 1rem;
  right: var(--gutter);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.3125rem;
  border: 1px solid rgb(255 255 255 / 0.08);
  border-radius: 0.875rem;
  background: var(--bar);
  box-shadow: 0 0.375rem 1.25rem rgb(0 0 0 / 0.22);
}

.nsfw-switch,
.lang-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.25rem;
  padding: 0.375rem 0.625rem;
  border-radius: 0.5625rem;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nsfw-switch__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.nsfw-switch__track {
  position: relative;
  flex: none;
  width: 2.125rem;
  height: 1.25rem;
  border-radius: 2em;
  background: rgb(255 255 255 / 0.2);
  transition: background-color 0.15s ease;
}

.nsfw-switch__track::after {
  content: "";
  position: absolute;
  top: 0.1875rem;
  left: 0.1875rem;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.15s ease;
}

.nsfw-switch__input:checked + .nsfw-switch__track {
  background: var(--gold);
}

.nsfw-switch__input:checked + .nsfw-switch__track::after {
  background: var(--ink);
  transform: translateX(0.875rem);
}

.nsfw-switch__input:checked ~ .nsfw-switch__label {
  color: var(--gold);
}

.nsfw-switch__input:focus-visible + .nsfw-switch__track {
  outline: 0.125rem solid var(--gold);
  outline-offset: 0.1875rem;
}

.lang-switch {
  position: relative;
}

.lang-picker {
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
}

.lang-picker[aria-expanded="true"] {
  background: rgb(255 255 255 / 0.07);
  color: var(--text);
}

.lang-picker:focus-visible {
  outline: 0.125rem solid var(--gold);
  outline-offset: 0.125rem;
}

.lang-flag {
  flex: none;
  width: 1.25rem;
  height: 0.9375rem;
  border-radius: 0.1875rem;
  object-fit: cover;
}

.lang-flag--blank {
  background: rgb(255 255 255 / 0.14);
}

.lang-picker__code {
  min-width: 1.5rem;
  letter-spacing: 0.02em;
}

.lang-picker__chevron {
  flex: none;
  width: 0.6875rem;
  height: 0.5rem;
  margin-left: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s ease;
}

.lang-picker[aria-expanded="true"] .lang-picker__chevron {
  transform: rotate(180deg);
}

/* Список языков в стиле сайта: флаг, название на самом языке, код; выбранный — золотом. */
.lang-menu {
  position: absolute;
  top: calc(100% + 0.625rem);
  right: -0.3125rem;
  z-index: 2;
  display: grid;
  align-content: start;
  gap: 0.125rem;
  width: 15rem;
  margin: 0;
  padding: 0.375rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  border-radius: 0.875rem;
  background: var(--bar);
  box-shadow: 0 0.75rem 2rem rgb(0 0 0 / 0.45);
  scrollbar-width: thin;
  scrollbar-color: rgb(255 255 255 / 0.25) transparent;
}

.lang-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.625rem;
  border-radius: 0.5625rem;
  color: var(--text-body);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  user-select: none;
}

.lang-option:focus {
  outline: none;
}

.lang-option:focus-visible {
  outline: 0.125rem solid var(--gold);
  outline-offset: -0.125rem;
}

/* Иероглифы берутся из системного шрифта: при той же жирности они крупнее и тяжелее латиницы. */
.lang-option__name:lang(zh),
.lang-option__name:lang(ja),
.lang-option__name:lang(ko) {
  font-size: 0.9375rem;
  font-weight: 500;
}

.lang-option__code {
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.lang-option[aria-selected="true"],
.lang-option[aria-selected="true"] .lang-option__code {
  color: var(--gold);
}

.lang-option[aria-selected="true"] {
  background: rgb(0 0 0 / 0.28);
}

.page-state {
  width: min(100% - 2 * var(--gutter), 32rem);
  margin: clamp(2.5rem, 1rem + 6vw, 5rem) auto;
  padding: 2rem 1.75rem;
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius-panel);
  background: var(--panel);
  color: var(--text-body);
  text-align: center;
}

.page-state p {
  margin: 0;
}

.retry-button,
.file-link {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.625rem 1.125rem;
  border: 0;
  border-radius: 0.5rem;
  background: var(--gold);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
}

.retry-button:hover,
.file-link:hover {
  background: var(--gold-light);
}

.cta-link {
  display: inline-flex;
  align-items: center;
  margin-top: 0.25rem;
  padding: 0.875rem 1.75rem;
  border-radius: 0.625rem;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.cta-link:hover {
  background: var(--gold-light);
}

.layout {
  display: grid;
  grid-template-columns: var(--nav-width) minmax(0, 1fr);
  grid-template-areas:
    "head head"
    "nav  sections";
  column-gap: var(--column-gap);
  align-items: start;
  width: var(--layout-width);
  margin-inline: auto;
  padding-bottom: clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
}

.site-footer {
  width: 100%;
  margin: 0;
  padding: 0 var(--gutter) clamp(1.25rem, 0.8rem + 1.5vw, 2rem);
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.4;
  text-align: center;
}

.update-header {
  grid-area: head;
  padding-block: clamp(1.5rem, 0.8rem + 2.6vw, 3.25rem) clamp(1.25rem, 0.8rem + 1.6vw, 2.25rem);
}

.update-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 1.5rem + 3vw, 4.25rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.update-meta {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.section-nav {
  grid-area: nav;
  position: sticky;
  top: 1rem;
  min-width: 0;
}

.nav-scroll {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: calc(100vh - 2rem);
  margin: 0;
  padding: 0 0.375rem 0 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: rgb(255 255 255 / 0.25) transparent;
}

@supports (height: 1dvh) {
  .nav-scroll {
    max-height: calc(100dvh - 2rem);
  }
}

.nav-link {
  display: grid;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* Активный раздел — на фоне панели новостей и с ярким превью; превью остальных приглушены. */
.nav-link[aria-current="true"] {
  background: var(--panel);
  color: var(--gold);
}

.nav-label {
  padding-inline: 0.125rem;
}

/* Переключатель разделов нужен только на мобиле, на десктопе разделы — колонка слева. */
.nav-toggle {
  display: none;
}

/* Под открытым списком разделов: затемняет страницу и ловит тап, чтобы закрыть список. */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 19;
  touch-action: none;
}

.nav-thumb {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 0.5rem;
  background: rgb(0 0 0 / 0.3);
  box-shadow: 0 0.25rem 0.75rem rgb(0 0 0 / 0.3);
  filter: brightness(0.6) saturate(0.8);
  transition: filter 0.15s ease;
}

.nav-link[aria-current="true"] .nav-thumb {
  filter: none;
}

.nav-thumb picture,
.nav-thumb img {
  display: block;
  width: 100%;
  height: 100%;
}

.nav-thumb img {
  object-fit: cover;
}

.nav-thumb__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgb(14 8 18 / 0.62);
  transform: translate(-50%, -50%);
}

.nav-thumb__play svg {
  width: 1.125rem;
  height: 1.125rem;
  margin-left: 0.125rem;
  fill: #fff;
}

.sections {
  grid-area: sections;
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 0.75rem + 1vw, 1.75rem);
  min-width: 0;
}

.section {
  scroll-margin-top: var(--sticky-offset);
  padding: var(--panel-pad);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius-panel);
  background: var(--panel);
}

.section h2 {
  margin: 0 0 clamp(1rem, 0.8rem + 0.7vw, 1.5rem);
  font-family: var(--font-display);
  font-size: clamp(1.625rem, 1.25rem + 1.4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.block-list {
  display: flex;
  flex-direction: column;
  gap: var(--block-gap);
}

.entry {
  min-width: 0;
  margin: 0;
}

.block-list > .entry--text:not(:first-child),
.block-list > .has-caption + * {
  padding-top: var(--block-gap);
  border-top: 1px solid var(--rule);
}

.entry h3 {
  max-width: 34em;
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.12rem + 0.5vw, 1.5rem);
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
}

figcaption {
  margin-top: 0.875rem;
}

.entry figcaption h3 {
  margin-bottom: 0.375rem;
  font-size: clamp(1.125rem, 1.05rem + 0.3vw, 1.3125rem);
}

.prose {
  max-width: 66ch;
  color: var(--text-body);
}

.prose > * {
  margin: 0;
}

.prose > * + * {
  margin-top: 0.75em;
}

.prose p {
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.media-frame {
  position: relative;
  border-radius: var(--radius-media);
}

.media-frame.is-loading {
  aspect-ratio: 3 / 2;
  background: rgb(255 255 255 / 0.05);
}

.media-frame.is-error {
  display: grid;
  place-items: center;
  min-height: 10rem;
  background: rgb(0 0 0 / 0.2);
}

.lightbox-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius-media);
  background: none;
  cursor: pointer;
}

.media-frame.is-loading .lightbox-trigger {
  position: absolute;
  inset: 0;
}

.media-frame picture {
  display: block;
}

/* drop-shadow повторяет форму картинки: у коллажей с прозрачными промежутками тень у каждой плитки. */
.media-frame img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-media);
  filter: drop-shadow(0 0.5rem 0.875rem rgb(0 0 0 / 0.38));
}

.entry--gallery .media-frame {
  touch-action: pan-y pinch-zoom;
}

.media-frame.is-loading picture,
.media-frame.is-loading img {
  height: 100%;
}

.media-frame.is-loading img {
  opacity: 0;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(7rem, 22%), 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.gallery-thumb {
  display: block;
  aspect-ratio: 3 / 2;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0.4375rem;
  background: rgb(0 0 0 / 0.25);
  box-shadow: 0 0.25rem 0.625rem rgb(0 0 0 / 0.3);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

.gallery-thumb picture,
.gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
}

.gallery-thumb img {
  object-fit: cover;
}

.gallery-thumb[aria-current="true"] {
  opacity: 1;
  box-shadow: 0 0 0 0.125rem var(--gold), 0 0.25rem 0.625rem rgb(0 0 0 / 0.3);
}

/* Края большой картинки галереи; курсор-стрелка показывает, куда листает клик. */
.gallery-edge {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  width: 28%;
  padding: 0 0.75rem;
  border: 0;
  background: none;
  color: var(--text);
}

.gallery-edge--prev {
  left: 0;
  justify-content: flex-start;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='14.5' fill='%23180c1e' fill-opacity='.8' stroke='%23fff' stroke-width='1.5'/%3E%3Cpath d='M18.5 10.5 13 16l5.5 5.5' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 16 16, w-resize;
}

.gallery-edge--next {
  right: 0;
  justify-content: flex-end;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='14.5' fill='%23180c1e' fill-opacity='.8' stroke='%23fff' stroke-width='1.5'/%3E%3Cpath d='M13.5 10.5 19 16l-5.5 5.5' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 16 16, e-resize;
}

.gallery-edge svg {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5625rem;
  border-radius: 50%;
  background: rgb(14 8 18 / 0.6);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.media-frame:hover .gallery-edge svg,
.gallery-edge:focus-visible svg {
  opacity: 0.9;
}

.gallery-edge:focus-visible {
  outline-offset: -0.25rem;
}

.discord-link {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.6875rem 1rem 0.6875rem 0.875rem;
  border-radius: 0.625rem;
  background: #5865f2;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.discord-link__logo {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
}

.discord-link__arrow {
  flex: none;
  width: 1rem;
  height: 1rem;
  margin-left: 0.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.8;
  transition: transform 0.15s ease;
}

.discord-link:hover {
  background: #4752c4;
}

.discord-link:hover .discord-link__arrow {
  transform: translate(0.125rem, -0.125rem);
}

.media-frame--video {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0.5rem 1.25rem rgb(0 0 0 / 0.38);
}

/* До запуска весь кадр — кнопка Play; на паузе с контролами нижняя полоса остаётся под перемотку. */
.video-play {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.media-frame--video.has-controls .video-play {
  bottom: 3.5rem;
}

.media-frame--video.is-playing .video-play {
  display: none;
}

.video-play svg {
  width: clamp(3.5rem, 2.75rem + 3vw, 4.75rem);
  height: auto;
  transition: transform 0.15s ease;
}

.video-play__disc {
  fill: rgb(14 8 18 / 0.62);
  stroke: rgb(255 255 255 / 0.85);
  stroke-width: 1.5;
  transition: fill 0.15s ease;
}

.video-play__glyph {
  fill: #fff;
}

.video-play:hover svg {
  transform: scale(1.06);
}

.video-play:hover .video-play__disc {
  fill: rgb(14 8 18 / 0.8);
}

.media-frame--video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Копия для бесшовного повтора ждёт на первом кадре: отрисована, но прозрачна. */
.media-frame--video video.is-standby {
  opacity: 0;
  pointer-events: none;
}

.media-fallback {
  margin: 0;
  padding: 1rem;
  color: var(--text-muted);
  text-align: center;
}

.media-frame--video .media-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

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

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 3.75rem var(--gutter) var(--gutter);
  background: rgb(14 8 18 / 0.97);
  overscroll-behavior: contain;
  /* Одним пальцем — свайп по слайдам без прокрутки страницы под лайтбоксом, двумя — зум. */
  touch-action: pinch-zoom;
}

.lightbox-figure {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  margin: 0;
}

.lightbox-caption {
  max-width: min(48rem, 100%);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-wrap: balance;
}

.lightbox-counter {
  position: fixed;
  top: 0.75rem;
  left: var(--gutter);
  margin: 0;
  padding: 0.625rem 0.25rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.5rem;
}

.lightbox-dialog {
  max-width: 100%;
}

/* picture — только носитель source для AVIF, раскладку задаёт сама картинка. */
.lightbox-dialog picture {
  display: contents;
}

/* Сцена по размеру картинки: края для листания лежат строго в её границах. */
.lightbox-stage {
  position: relative;
  width: fit-content;
  max-width: 100%;
}

.lightbox-stage:hover .gallery-edge svg {
  opacity: 0.9;
}

.lightbox:not(.is-gallery) .lightbox-stage {
  cursor: zoom-out;
}

.lightbox-image {
  width: auto;
  height: auto;
  max-width: calc(100vw - 2 * var(--gutter));
  max-height: calc(100vh - 3.75rem - var(--gutter));
  border-radius: var(--radius-media);
}

.lightbox.has-caption .lightbox-image {
  max-height: calc(100vh - 3.75rem - var(--gutter) - 2.25rem);
}

@supports (height: 1svh) {
  .lightbox-image {
    max-height: calc(100svh - 3.75rem - var(--gutter));
  }

  .lightbox.has-caption .lightbox-image {
    max-height: calc(100svh - 3.75rem - var(--gutter) - 2.25rem);
  }
}

.lightbox-close {
  position: fixed;
  top: 0.75rem;
  right: var(--gutter);
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.12);
  color: var(--text);
  cursor: pointer;
}

.lightbox-close svg {
  width: 1.375rem;
  height: 1.375rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lightbox-close:hover {
  background: rgb(255 255 255 / 0.22);
}

.zip-import {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.25rem;
  padding: 0.375rem 0.625rem;
  border-radius: 0.5625rem;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.zip-import__icon {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zip-import__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.zip-import:has(.zip-import__input:focus-visible) {
  outline: 0.125rem solid var(--gold);
  outline-offset: 0.125rem;
}

.toast {
  position: fixed;
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 60;
  width: max-content;
  max-width: calc(100vw - 2 * var(--gutter));
  padding: 0.75rem 1.125rem;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 0.75rem;
  background: var(--bar);
  box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.35);
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.4;
  transform: translateX(-50%);
}

.toast.is-error {
  border-color: rgb(255 120 120 / 0.55);
}

body.is-dropping::after {
  content: "";
  position: fixed;
  inset: 0.75rem;
  z-index: 70;
  border: 0.1875rem dashed var(--gold);
  border-radius: 1rem;
  background: rgb(236 184 73 / 0.06);
  pointer-events: none;
}

@media (hover: hover) {
  .gallery-thumb:hover {
    opacity: 1;
  }

  .nav-link:not([aria-current="true"]):hover {
    background: rgb(0 0 0 / 0.14);
    color: var(--text);
  }

  .nav-link:not([aria-current="true"]):hover .nav-thumb {
    filter: brightness(0.85) saturate(0.9);
  }

  .nsfw-switch:hover,
  .lang-picker:hover,
  .zip-import:hover {
    background: rgb(255 255 255 / 0.07);
    color: var(--text);
  }

  .lang-option:not([aria-selected="true"]):hover {
    background: rgb(255 255 255 / 0.07);
    color: var(--text);
  }
}

@media (hover: none) {
  .gallery-edge svg {
    opacity: 0.85;
  }
}

@media (max-width: 56.25em) {
  /* A grid area would trap the sticky nav inside its own row.
     Статьи во всю ширину экрана: поля только внутри панелей. */
  .layout {
    display: block;
    width: 100%;
  }

  /* Панель стоит в липкой полосе справа от переключателя разделов (её туда переносит app.js). */
  .page-controls {
    position: static;
    flex: none;
    flex-direction: row;
    gap: 0.125rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .nsfw-switch,
  .lang-picker,
  .zip-import {
    gap: 0.375rem;
    min-height: 2rem;
    padding: 0.25rem 0.5rem;
    border-radius: 2em;
    font-size: 0.9375rem;
  }

  .zip-import__label {
    display: none;
  }

  .nsfw-switch__track {
    width: 1.875rem;
    height: 1.125rem;
  }

  .nsfw-switch__track::after {
    width: 0.75rem;
    height: 0.75rem;
  }

  .nsfw-switch__input:checked + .nsfw-switch__track::after {
    transform: translateX(0.75rem);
  }

  .lang-menu {
    top: calc(100% + 0.8125rem);
    right: 0;
    width: min(15rem, calc(100vw - 1rem));
  }

  /* На мобиле страница под открытым списком затемняется. */
  .nav-backdrop {
    background: rgb(14 8 18 / 0.55);
  }

  .update-header {
    padding-inline: 1rem;
  }

  /* Липкая полоса: текущий раздел (по нажатию — список всех разделов) и панель 18+ и языка.
     Вбок ничего не прокручивается, и ничто ничего не перекрывает. */
  .section-nav {
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0 0 clamp(0.75rem, 0.5rem + 1vw, 1.25rem);
    padding: 0.3125rem 0.5rem 0.3125rem 0;
    border-block: 1px solid rgb(255 255 255 / 0.08);
    background: var(--bar);
  }

  .nav-toggle {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    min-height: 2.5rem;
    padding: 0 0.5rem 0 1rem;
    border: 0;
    background: none;
    color: var(--gold);
    font-family: var(--font-display);
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
  }

  .nav-toggle__label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-toggle__chevron {
    flex: none;
    width: 0.75rem;
    height: 0.5rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.15s ease;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle__chevron {
    transform: rotate(180deg);
  }

  /* Список выпадает под полосой и не длиннее остатка экрана; превью — как в колонке на десктопе. */
  .nav-scroll {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    gap: 0.125rem;
    max-height: var(--menu-height, 70vh);
    padding: 0.5rem 0.5rem 0.75rem;
    border-bottom: 1px solid rgb(255 255 255 / 0.08);
    background: var(--bar);
    box-shadow: 0 1.25rem 2rem rgb(0 0 0 / 0.4);
  }

  .section-nav.is-open .nav-scroll {
    display: flex;
  }

  .nav-link {
    grid-template-columns: 4.5rem minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    padding: 0.375rem 0.5rem;
    border-radius: 0.625rem;
    font-size: 1rem;
  }

  .nav-thumb {
    border-radius: 0.375rem;
    box-shadow: none;
  }

  .nav-thumb__play {
    width: 1.5rem;
    height: 1.5rem;
  }

  .nav-thumb__play svg {
    width: 0.75rem;
    height: 0.75rem;
  }

  .nav-label {
    grid-column: 2;
    padding: 0;
  }

  .section {
    padding-inline: 1rem;
    border-inline: 0;
    border-radius: 0;
  }
}

/* На узком телефоне полосе нужнее место, чем импорту архива. */
@media (max-width: 30em) {
  .zip-import {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-link,
  .nav-thumb,
  .nav-toggle__chevron,
  .gallery-thumb,
  .gallery-edge svg,
  .nsfw-switch,
  .lang-picker,
  .lang-picker__chevron,
  .zip-import,
  .nsfw-switch__track,
  .nsfw-switch__track::after,
  .discord-link,
  .discord-link__arrow,
  .cta-link,
  .video-play svg,
  .video-play__disc {
    transition: none;
  }
}
