/* Вкладка «Матрица» (matrixtab.js): продолжение app.css и today.css, значения из макета Б (_design/matrix/), с 06.10.2026
   вариант А «Открыть карты» (_design/matrix_free/). Здесь только первый экран: заголовок, схема, счёт открытых карт, вход
   без даты. Всё ниже первого экрана и лист точки в matrix_more.css (его подключает matrix_more.js). */

.screen--matrix { display: block; padding: calc(var(--top-pad) + 8px) 0 calc(var(--dock-room) + 26px); }
.screen--matrix[hidden] { display: none; }
.screen--matrix ::selection { background: rgba(192, 146, 70, .276); color: #1e2347; }

/* ---------- заголовок ---------- */
.mx-head { margin-top: 12px; text-align: center; }
.mx-title { margin: 0; font: 600 35px/1.04 var(--serif); letter-spacing: .005em; color: var(--ink); text-wrap: balance; }
.mx-title:focus { outline: none; }
.mx-tagline { margin: 3px 0 0; font: italic 500 21px/1.2 var(--serif); color: var(--cream); }
.mx-date { margin: 5px 0 0; font: italic 500 19px/1.3 var(--serif); font-variant-numeric: lining-nums; color: var(--t-ivory-2); }
.mx-edit { position: relative; margin-left: 4px; padding: 0; border: 0; background: none; cursor: pointer; vertical-align: 1px;
  font: 500 14.5px/1.3 var(--sans); font-style: normal; color: var(--gold-ink); text-decoration: underline; text-underline-offset: 4px;
  text-decoration-color: rgba(192, 146, 70, .5); -webkit-tap-highlight-color: transparent; }
.mx-edit::before { content: ''; position: absolute; inset: -12px -8px; }                 /* зона нажатия 44 px */
.mx-edit:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

/* ---------- схема во всю ширину экрана ---------- */
.mx-chart { position: relative; margin: 2px calc(-1 * var(--gutter)) 0; }
.mx-chart svg, .mx-ghost svg { display: block; width: 100%; height: auto; overflow: visible; -webkit-tap-highlight-color: transparent; }
.mx-chart text { font-family: var(--sans); font-weight: 700; font-variant-numeric: lining-nums; text-rendering: geometricPrecision; }
.mx-chart .mx-lab { font: italic 500 12.5px var(--serif); letter-spacing: .01em; }
.mx-hit { fill: transparent; cursor: pointer; }
.mx-chart [data-hit] { outline: none; cursor: pointer; }
.mx-focus { fill: none; stroke: var(--gold-2); stroke-width: 1.6; opacity: 0; pointer-events: none; }
.mx-chart [data-hit]:focus-visible .mx-focus { opacity: 1; }
/* зона только что загорелась: свет проступает один раз */
.mx-pt.is-new .mx-glow { transform-box: fill-box; transform-origin: center; animation: mx-lit-in 1.2s var(--ease) both; }
@keyframes mx-lit-in { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }

/* ---------- вариант А: кольцо у центра, пока ни одна карта не открыта, и переворот только что открытой ---------- */
.mx-start { fill: none; stroke: #c09246; stroke-width: 1.3; stroke-opacity: .85; pointer-events: none; }
.mx-start--pulse { stroke-width: 1.4; transform-box: fill-box; transform-origin: center; animation: mx-pulse 2.4s var(--ease) infinite; }
@keyframes mx-pulse { 0% { opacity: .95; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.22); } }
.mx-pt.is-flip .mx-shape { transform-box: fill-box; transform-origin: center; animation: mx-face .5s var(--ease) both; }
@keyframes mx-face { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- под схемой: ромбы девяти карт, «Открыто N из 9», какую открыть следующей ---------- */
.mx-status { display: flex; flex-direction: column; align-items: center; margin: 6px 0 0; text-align: center; }
.mx-status .pager { margin: 4px 0 0; gap: 10px; }
.mx-open__n { margin: 9px 0 0; font: italic 500 20px/1.2 var(--serif); font-variant-numeric: lining-nums; color: var(--ink); }
.mx-open__hint { margin: 3px auto 0; max-width: 30ch; font: 400 14px/1.42 var(--sans); color: var(--t-ivory-2); text-wrap: balance; }
.mx-open__all { position: relative; margin: 6px auto 0; padding: 6px 4px; border: 0; background: none; cursor: pointer; font: 500 14px/1.3 var(--sans);
  color: var(--gold-ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(192, 146, 70, .5);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.mx-open__all::before { content: ''; position: absolute; inset: -6px -10px; }        /* зона нажатия 44 px */
.mx-open__all:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.mx-more:empty { display: none; }

/* ---------- первый вход без даты ---------- */
.screen--matrix.is-intro .mx-head { margin-top: 14px; }
.mx-intro { margin: 10px auto 0; max-width: 34ch; text-align: center; font-size: 15.5px; line-height: 1.45; color: var(--ivory-2); text-wrap: balance; }
.mx-ghost { width: 214px; margin: 6px auto 0; }
.mx-form { width: 100%; max-width: 340px; margin: 8px auto 0; text-align: center; }
.mx-form .field-label { margin-bottom: 7px; }
.mx-form .field { height: 54px; }
.mx-form .field-msg { margin: 6px 0 10px; }
.mx-cancel { position: relative; margin: 14px auto 0; padding: 0; border: 0; background: none; cursor: pointer; font: 500 15px/1.3 var(--sans); color: var(--gold-ink);
  text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(192, 146, 70, .5); -webkit-tap-highlight-color: transparent; }
.mx-cancel::before { content: ''; position: absolute; inset: -12px -14px; }
.mx-cancel:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.mx-fine { margin: 16px auto 0; max-width: 36ch; text-align: center; font-size: 13px; line-height: 1.45; color: var(--muted); text-wrap: balance; }
.mx-ghost[hidden] { display: none; }
/* самые низкие экраны без даты: плотнее, чтобы поле и кнопка встали над панелью (ступень ставит matrixtab.js) */
.screen--matrix.is-compact .mx-head { margin-top: 8px; }
.screen--matrix.is-compact .mx-title { font-size: 30px; }
.screen--matrix.is-compact .mx-tagline { font-size: 18px; margin-top: 1px; }
.screen--matrix.is-compact .mx-intro { margin-top: 6px; font-size: 14px; line-height: 1.4; }
.screen--matrix.is-compact .mx-form { margin-top: 10px; }
.screen--matrix.is-compact .mx-form .field { height: 50px; }
.screen--matrix.is-compact .mx-form .field-msg { margin: 4px 0 8px; }

/* ---------- узкие телефоны ---------- */
@media (max-width: 370px) {
  .mx-title { font-size: 32px; }
  .mx-tagline { font-size: 19px; }
}

/* ---------- без движения ---------- */
@media (prefers-reduced-motion: reduce) {
  .mx-pt.is-new .mx-glow { animation: none; }
  .mx-start--pulse { animation: none; opacity: 0; }
  .mx-pt.is-flip .mx-shape { animation: none; }
}
