/* Готовые блоки страницы. Каждый уже проверен на телефоне (360), планшете, ноутбуке и широком мониторе.
   Новый блок — по их образцу: внутри .container, сетки через .grid или minmax(0, 1fr), без фиксированной высоты у текста. */

/* Шапка: на телефоне меню прячется в кнопку */
.header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.header-in { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: var(--tap); font-weight: 700; font-size: var(--fs-18); color: var(--ink); text-decoration: none; }
.nav { display: flex; align-items: center; gap: var(--sp-1); }
.nav a:not(.btn) { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--sp-3); border-radius: var(--r-pill); color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.nav a:not(.btn):hover { color: var(--ink); background: var(--surface-2); }
.nav-toggle { display: none; width: var(--tap); height: var(--tap); border: 0; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink); cursor: pointer; align-items: center; justify-content: center; }
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; padding: var(--sp-2) var(--gutter) var(--sp-4); background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .header:not(.is-open) .nav { display: none; }
  .nav .btn { margin-top: var(--sp-2); }
}

/* Первый экран */
.hero { padding-block: clamp(48px, 9vw, 128px) var(--section); }
.hero-in { display: grid; gap: var(--sp-10); align-items: center; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.hero-text { display: flex; flex-direction: column; gap: var(--sp-6); }
.hero .lead { max-width: 52ch; }
@media (max-width: 860px) { .hero-in { grid-template-columns: minmax(0, 1fr); } }

/* Заголовок секции */
.sec-head { display: flex; flex-direction: column; gap: var(--sp-3); max-width: var(--maxw-text); margin-bottom: var(--sp-10); }

/* Карточки преимуществ / услуг */
.card { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-6); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }

/* Галерея: одинаковые пропорции, фото обрезается красиво, а не растягивается */
.gallery { --min: 240px; }
.gallery figure { margin: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.gallery figcaption { font-size: var(--fs-14); color: var(--ink-soft); }

/* Отзывы */
.quote { display: flex; flex-direction: column; gap: var(--sp-4); padding: var(--sp-6); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.quote p { font-size: var(--fs-18); }
.quote-who { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-14); color: var(--ink-soft); }
.avatar { width: 44px; height: 44px; flex: none; border-radius: var(--r-pill); object-fit: cover; background: var(--accent-soft); }

/* Вопросы и ответы: <details> работает без JS */
.faq { display: flex; flex-direction: column; gap: var(--sp-3); max-width: 820px; }
.faq details { border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); min-height: var(--tap); padding: var(--sp-4) var(--sp-6); font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; flex: none; font-size: var(--fs-24); line-height: 1; color: var(--accent); transition: transform var(--dur-fast) var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > p { padding: 0 var(--sp-6) var(--sp-5); color: var(--ink-soft); }

/* Призыв + форма */
.cta { display: grid; gap: var(--sp-8); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; padding: clamp(24px, 5vw, 56px); border-radius: var(--r-lg); background: var(--accent-soft); }
.form { display: flex; flex-direction: column; gap: var(--sp-4); }
.form > .btn { align-self: flex-start; }  /* кнопка по ширине надписи, не во всю форму */
.form-ok { display: none; padding: var(--sp-4); border-radius: var(--r); background: var(--surface); font-weight: 600; }
.form.is-sent .form-ok { display: block; }
@media (max-width: 860px) { .cta { grid-template-columns: minmax(0, 1fr); } }

/* Подвал */
.footer { padding-block: var(--sp-10); border-top: 1px solid var(--line); color: var(--ink-soft); font-size: var(--fs-14); }
.footer-in { display: flex; flex-wrap: wrap; gap: var(--sp-4) var(--sp-8); justify-content: space-between; align-items: center; }
.footer a { color: var(--ink-soft); display: inline-flex; align-items: center; min-height: var(--tap); }

/* Сайт Саши и Насти: логотип, первый экран с веером карточек */
.logo-ic { width: 28px; height: 28px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.logo { font-family: var(--font-head); font-size: var(--fs-16); font-weight: 700; }
.btn-ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-ghost { border-color: var(--ink); }
.btn[hidden] { display: none; }
.eyebrow { font-family: var(--font-head); font-size: var(--fs-12); letter-spacing: .1em; }
h1 { font-weight: 800; }

.hero { position: relative; overflow: hidden; padding-block: clamp(40px, 6vw, 96px) clamp(40px, 6vw, 80px); background: radial-gradient(60% 80% at 100% 0%, var(--accent-soft), transparent 70%), radial-gradient(50% 70% at 0% 100%, color-mix(in srgb, var(--c-good) 35%, transparent), transparent 70%); }
.hero h1 em { font-style: normal; color: var(--accent); }
.fan { position: relative; height: clamp(240px, 30vw, 360px); }
.fan-card { position: absolute; top: 50%; left: 50%; display: flex; flex-direction: column; gap: var(--sp-3); width: 46%; aspect-ratio: 5 / 7; padding: var(--sp-4); border-radius: var(--r); background: var(--c, var(--c-good)); color: var(--ink); box-shadow: var(--shadow-lift); font: 700 var(--fs-14)/1.3 var(--font-head); translate: -50% -50%; transform: rotate(var(--rot, 0deg)) translateX(var(--dx, 0)); transition: transform var(--dur) var(--ease); }
.fan-card svg { width: 48px; height: 48px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.fan:hover .fan-card { transform: rotate(calc(var(--rot, 0deg) * 1.3)) translateX(calc(var(--dx, 0px) * 1.3)); }
@media (max-width: 860px) { .fan { height: 200px; } .fan-card { width: 128px; padding: var(--sp-3); } .fan-card svg { width: 32px; height: 32px; } }

/* Игра: поле-дорожка слева, карточка справа; на планшете стоя и телефоне — поле сверху */
.play { padding-block: var(--sp-8) var(--section); scroll-margin-top: 64px; }
.game { display: grid; gap: var(--sp-8); grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.game-panel { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; scroll-margin-top: 80px; }
.game, .game button { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
@media (max-width: 1000px) { .game { grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); } .board-wrap { max-width: 760px; } }

/* Поле: координаты клеток — в процентах от поля (100 × 72), дорожка — SVG того же размера */
.board-wrap { position: relative; overflow: clip; padding: var(--sp-4); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.board { position: relative; aspect-ratio: 100 / 72; margin: 0; padding: 0; list-style: none; container-type: inline-size; }
.board-path { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: var(--line); stroke-width: .8; stroke-linecap: round; stroke-dasharray: .01 2.4; }
.board .cell { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) / 72 * 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; width: 14%; aspect-ratio: 1; border-radius: 50%; background: var(--c); color: var(--ink); translate: -50% -50%; transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.cell-ic { width: 40%; height: 40%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cell-n { font: 700 clamp(12px, 2cqi, 16px)/1 var(--font-head); }
.cell-lab { position: absolute; top: 100%; left: 50%; margin-top: var(--sp-1); translate: -50% 0; font-size: clamp(12px, 2.2cqi, 14px); font-weight: 600; line-height: 1.3; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board .cell-end { width: 16%; border: 2px dashed var(--ink); background: var(--surface); }
.cell-big { font: 700 clamp(12px, 2.6cqi, 18px)/1 var(--font-head); }
.board .cell-fin { width: 20%; border: 0; background: var(--ink); color: var(--accent-ink); }
.cell-fin .cell-big { font-size: clamp(14px, 4cqi, 24px); }
.board .cell.is-next { transform: scale(1.12); box-shadow: 0 0 0 4px var(--surface), 0 0 0 8px var(--who, var(--p0)); }

/* Фишки: слой во всё поле, сдвиг translate в % от поля — едут плавно по дорожке */
.tok { position: absolute; inset: 0; pointer-events: none; transform: translate(calc(var(--x) * 1%), calc(var(--y) / 72 * 100%)); transition: transform var(--dur) var(--ease); }
.tok-dot { position: absolute; top: 0; left: 0; display: flex; align-items: center; justify-content: center; width: 7%; aspect-ratio: 1; border: 3px solid var(--surface); border-radius: 50%; background: var(--pc); color: var(--accent-ink); box-shadow: var(--shadow-lift); translate: calc(-50% + var(--ox)) -115%; }
.tok-dot svg { width: 52%; height: 52%; fill: currentColor; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.tok-0 { --pc: var(--p0); --ox: -40%; }
.tok-1 { --pc: var(--p1); --ox: 40%; }
.tok.is-turn { z-index: 2; }
/* узкое поле (телефон): подписи клеток не помещаются — номер и значок остаются */
@container (max-width: 420px) { .cell-lab { display: none; } }

/* Кто где: две плашки игроков */
.players { display: grid; gap: var(--sp-2); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pl { display: flex; align-items: center; gap: var(--sp-2); min-height: 56px; padding: var(--sp-2) var(--sp-3); border: 2px solid var(--line); border-radius: var(--r); background: var(--surface); font-weight: 700; transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.pl.is-turn { border-color: var(--pc); box-shadow: var(--shadow); }
.pl-0 { --pc: var(--p0); } .pl-1 { --pc: var(--p1); }
.pl-steps { margin-left: auto; font-size: var(--fs-14); font-weight: 600; color: var(--ink-soft); }
.g-token { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--pc); color: var(--accent-ink); }
.g-token-0 { --pc: var(--p0); } .g-token-1 { --pc: var(--p1); }
.g-token svg { width: 16px; height: 16px; fill: currentColor; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }

/* Панель хода */
.g-box { display: flex; flex-direction: column; gap: var(--sp-4); padding: var(--sp-6); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.g-kicker { display: inline-flex; align-items: center; gap: var(--sp-2); font: 700 var(--fs-12)/1.5 var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.g-title { font-size: var(--fs-24); font-weight: 700; line-height: 1.3; text-wrap: balance; }
.g-big { min-height: 64px; padding-inline: var(--sp-8); font-size: var(--fs-18); background: var(--pc, var(--accent)); }
.g-big:hover { background: var(--pc, var(--accent)); color: var(--accent-ink); }
.g-who { display: grid; gap: var(--sp-3); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.g-who .btn { flex-direction: column; min-height: 120px; border-radius: var(--r-lg); background: var(--pc); font-family: var(--font-head); }
.g-who .g-token { width: 48px; height: 48px; background: var(--surface); color: var(--pc); }
.g-who .g-token svg { width: 24px; height: 24px; }
.g-next { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3); border-radius: var(--r); background: var(--c); font-weight: 700; }
.g-next .g-ic { width: 32px; height: 32px; }

/* Карточка: рубашкой вверх, нажал — переворачивается */
.g-card { position: relative; min-height: 360px; perspective: 1400px; cursor: pointer; animation: g-deal var(--dur) var(--ease); }
.g-card-in { position: relative; display: grid; min-height: inherit; transform-style: preserve-3d; transition: transform var(--dur) var(--ease); }
.g-card.is-open .g-card-in { transform: rotateY(180deg); }
.g-card.is-open { cursor: default; }
.g-face { grid-area: 1 / 1; display: flex; flex-direction: column; gap: var(--sp-4); padding: var(--sp-6); border-radius: var(--r-lg); background: var(--c); color: var(--ink); box-shadow: var(--shadow-lift); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.g-front { transform: rotateY(180deg); }
.g-back { align-items: center; justify-content: center; text-align: center; }
.g-back-ic { display: flex; align-items: center; justify-content: center; width: 128px; height: 128px; margin-bottom: var(--sp-2); border-radius: 50%; background: color-mix(in srgb, var(--surface) 50%, transparent); }
.g-back-ic .g-ic { width: 64px; height: 64px; }
.g-back-name { font: 700 var(--fs-24)/1.3 var(--font-head); }
.g-tap { display: inline-flex; align-items: center; min-height: var(--tap); padding: var(--sp-2) var(--sp-4); border-radius: var(--r-pill); background: var(--ink); color: var(--accent-ink); font-weight: 700; }
.g-card-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.g-tag { display: inline-flex; align-items: center; gap: var(--sp-2); font: 700 var(--fs-12)/1.5 var(--font-head); letter-spacing: .06em; text-transform: uppercase; }
.g-no { font: 800 var(--fs-24)/1 var(--font-head); }
.g-ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.g-q { flex: 1; display: flex; align-items: center; font-size: var(--fs-24); font-weight: 700; line-height: 1.35; text-wrap: pretty; }
.g-q-small { padding-bottom: var(--sp-3); border-bottom: 2px solid currentColor; font-weight: 600; opacity: .8; }
.g-card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-4); font-size: var(--fs-14); font-weight: 700; }
.g-card-foot span { display: inline-flex; align-items: center; gap: var(--sp-2); }
.g-card-foot .g-token { width: 24px; height: 24px; }
.g-card-foot .g-token svg { width: 12px; height: 12px; }
.g-joker-card .g-face { color: var(--accent-ink); }
.g-joker-card .g-q-small { color: var(--accent-ink); }

.g-actions .btn { gap: var(--sp-2); }
.g-actions .btn:not(.btn-ghost) { min-height: 56px; padding-inline: var(--sp-8); }
.g-actions .btn-ghost { min-height: 56px; }

/* Джокеры в руке — маленькие тёмные карты */
.g-jokers { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); font-size: var(--fs-14); }
.g-jokers > .muted { flex-basis: 100%; }
.g-joker { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 56px; padding: var(--sp-2) var(--sp-4); border: 0; border-radius: var(--r); background: var(--c-joker); color: var(--c-good); font: 700 var(--fs-14)/1.2 var(--font); cursor: pointer; box-shadow: var(--shadow); transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); }
.g-joker:hover:not(:disabled) { transform: translateY(-4px); }
.g-joker:disabled { opacity: .45; cursor: default; box-shadow: none; }
.g-reset { align-self: flex-start; min-height: var(--tap); padding: 0; border: 0; background: none; color: var(--ink-soft); font: inherit; font-size: var(--fs-14); text-decoration: underline; cursor: pointer; }

/* Финал: салют один раз и таймер объятия */
.g-final { position: relative; align-items: center; text-align: center; overflow: hidden; background: radial-gradient(80% 60% at 50% 0%, var(--accent-soft), var(--surface)); }
.g-final p { max-width: 40ch; }
.g-final .row { justify-content: center; }
.g-final-ic { width: 64px; height: 64px; fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.g-timer { display: flex; align-items: center; justify-content: center; width: 160px; height: 160px; border: 8px solid var(--accent-soft); border-radius: 50%; color: var(--accent); font: 800 var(--fs-h1)/1 var(--font-head); }
.g-timer[hidden] { display: none; }
.g-timer span { animation: g-tick var(--dur) var(--ease); }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: 30%; left: 50%; width: 10px; height: 14px; border-radius: 2px; background: var(--c); opacity: 0; animation: g-boom 1200ms var(--ease) forwards; animation-delay: var(--d); }

.care { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.care li { padding: var(--sp-2) var(--sp-4); border-radius: var(--r-pill); background: var(--c); font-size: var(--fs-14); font-weight: 600; }
.care-wrap { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-8); }
.care-wrap .eyebrow { color: var(--accent-deep); }

/* На бумаге — одна строка и две кнопки */
.paper { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-6); padding: clamp(24px, 4vw, 40px); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.paper-text { display: flex; flex-direction: column; gap: var(--sp-2); max-width: 52ch; }

@media (max-width: 480px) {
  .g-box { padding: var(--sp-5); }
  .g-face { padding: var(--sp-5); }
  .g-q { font-size: var(--fs-20); }
  .g-card { min-height: 320px; }
  .board-wrap { padding: var(--sp-2); }
  .g-who .btn { min-height: 104px; }
  .g-actions { flex-wrap: nowrap; }
  .g-actions .btn:not(.btn-ghost) { flex: 1; padding-inline: var(--sp-4); }
  .g-joker { flex: 1 1 140px; }
}

@keyframes g-deal { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes g-tick { from { opacity: .4; transform: scale(1.3); } to { opacity: 1; transform: none; } }
@keyframes g-boom { 0% { opacity: 1; transform: translate(0, 0); } 100% { opacity: 0; transform: translate(var(--tx), var(--ty)); } }
