/* Страница «Схема зала»: легенда строками с тонкими линиями и растровая схема на тёмной рамке с синим свечением.
   Схема — прозрачный диск; зум и перетаскивание — в scheme.js, без JS это просто картинка.
   Цвета, шрифты, кнопки (.outline-button), фокус и reduced-motion — из common/site.css. */

.scheme {
  --s-gap: clamp(28px, 4vw, 56px);
  --s-line: rgba(255,255,255,.22);
  --s-line-strong: rgba(255,255,255,.3);
  --s-radius: 16px;
  --s-hover: 160ms;
  position: relative;
  isolation: isolate;
}
.scheme p, .scheme li { overflow-wrap: break-word; }
.scheme :focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }

/* == Шапка страницы == */

.scheme-head { text-align: center; }
.scheme .scheme-head__title { margin: 0; }

/* == Сетка: легенда и кнопки в левой колонке, схема справа == */

.scheme-layout { margin-top: var(--page-content-gap); display: grid; row-gap: 0; }
.scheme-legend { grid-area: legend; }

/* == Легенда: строки с тонкими линиями, плашки — цвета со схемы == */

.scheme-legend__list { margin: 0; padding: 0; list-style: none; }
.scheme-legend__item { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--s-line-strong); font-size: clamp(15px, 1.2vw, 17px); line-height: 1.3; }
.scheme-legend__item:last-child { border-bottom: 1px solid var(--s-line-strong); }
.scheme-legend__list--tables { margin-top: clamp(20px, 2.4vw, 32px); }
.scheme-swatch { flex: none; display: grid; place-content: center; width: 44px; height: 28px; border-radius: 4px; font-family: "Benzin", sans-serif; font-weight: 800; font-size: 11px; line-height: 1; }
/* Цвета секторов сняты пипеткой с исходной схемы */
.scheme-swatch--a { background: #1ddfa2; }
.scheme-swatch--b { background: #e39e81; }
.scheme-swatch--c { background: #b3b2fe; }
.scheme-swatch--d { background: #aeedd8; }
/* Миниатюры столов: светлая плашка с обводкой и числом стола */
.scheme-swatch--super { background: var(--paper); border: 1.5px solid var(--blue); color: var(--blue); border-radius: 6px; }
.scheme-swatch--vip { background: var(--paper); border: 1.5px solid #212121; color: #212121; border-radius: 6px; }

/* == Сцена: тёмная рамка и синее свечение под прозрачным диском схемы == */

.scheme-stage { grid-area: stage; position: relative; min-width: 0; }
.scheme-stage__viewport { position: relative; overflow: hidden; border-radius: var(--s-radius); background: #1a1a1a; touch-action: pan-y pinch-zoom; cursor: default; user-select: none; -webkit-user-select: none; }
.scheme-stage__viewport.is-zoomed { cursor: grab; touch-action: none; }
.scheme-stage__viewport.is-dragging { cursor: grabbing; }
.scheme-stage__glow { position: absolute; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(60% 55% at 50% 100%, rgba(0,0,253,.6), transparent 72%), radial-gradient(34% 42% at 96% 4%, rgba(0,0,253,.32), transparent 72%), radial-gradient(30% 36% at 2% 14%, rgba(0,0,253,.22), transparent 72%); }
.scheme-stage__img { position: absolute; inset: 0; z-index: 1; box-sizing: border-box; width: 100%; height: 100%; padding: clamp(10px, 2.2vw, 32px); object-fit: contain; transform-origin: 50% 50%; transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(var(--s, 1)); transition: transform 220ms var(--ease-out); will-change: transform; -webkit-user-drag: none; }
.scheme-stage__viewport.is-dragging .scheme-stage__img { transition: none; }
/* Переход зума гаснет вместе со всеми переходами общим правилом site.css для prefers-reduced-motion */

/* == Инструменты зума: обычный блок сетки, не поверх схемы; hover/focus остаются от .outline-button == */

.scheme-tools { grid-area: tools; display: flex; gap: 8px; }
.scheme-tools[hidden] { display: none; }
.scheme-tool { min-height: 40px; min-width: 40px; padding: 8px 14px; font-size: 18px; line-height: 1; }
.scheme-tool--reset { font-size: 14px; padding: 8px 18px; }
.scheme-tool:disabled { opacity: .35; cursor: default; pointer-events: none; }

/* == Подвал: ссылки на полные версии схемы == */

.scheme-foot { margin: clamp(24px, 3vw, 40px) 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px clamp(20px, 3vw, 40px); font-size: clamp(14px, 1.2vw, 16px); line-height: 1.4; }
.scheme-foot__link { color: var(--muted); text-decoration: underline; text-decoration-color: rgba(255,255,255,.4); text-underline-offset: 3px; border-radius: 3px; transition: color var(--s-hover) var(--ease-out), background-color var(--s-hover) var(--ease-out), box-shadow var(--s-hover) var(--ease-out), text-decoration-color var(--s-hover) var(--ease-out); }
.scheme-foot__link:is(:hover, :focus-visible) { background: var(--paper); box-shadow: 0 0 0 2px var(--paper); color: var(--blue); text-decoration-color: transparent; }

/* == Десктоп: легенда и кнопки в колонке слева, схема фиксированной высоты == */

@media (min-width: 1001px) {
  .scheme-layout { grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); grid-template-rows: auto auto 1fr; grid-template-areas: "legend stage" "tools stage" ". stage"; align-items: start; column-gap: clamp(32px, 4vw, 64px); }
  .scheme-tools { margin-top: clamp(20px, 2.4vw, 32px); }
  .scheme-stage__viewport { height: min(86vh, 880px); min-height: 520px; }
}

/* == Планшет и телефон: легенда и кнопки под схемой, списки в две колонки == */

@media (max-width: 1000px) {
  .scheme-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "legend" "stage" "tools"; }
  .scheme-stage { margin-top: var(--s-gap); }
  .scheme-stage__viewport { aspect-ratio: 1 / 1; height: auto; }
  .scheme-tools { margin-top: 16px; justify-content: center; }
  .scheme-legend__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(16px, 4vw, 32px); row-gap: 0; }
  .scheme-legend__item, .scheme-legend__item:last-child { padding: 8px 0; border: 0; }
}

@media (max-width: 900px) {
  .scheme-tool { min-height: 44px; min-width: 44px; }
}

@media (max-width: 520px) {
  .scheme-legend__list { row-gap: 0; }
  .scheme-legend__item { padding: 8px 0; }
}
