/* Игры: раскладка, карточки, варианты ответа */
.game-nav { position: sticky; top: var(--header-h); z-index: 15; background: var(--paper); border-bottom: 1px solid var(--line); }
.game-nav .chips { overflow-x: auto; scrollbar-width: none; }
.game-nav .chip b { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 50%; background: var(--paper-2); font-size: .72rem; }
.game { padding: 44px 0 50px; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 74px); }
.game:first-child { border-top: 0; }
.game__in { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 40px; align-items: start; }
.game__side h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.1; margin: 0 0 12px; }
.game__side p { font-size: .98rem; line-height: 1.62; color: var(--ink-2); margin: 0 0 12px; }
.game__stat { font-size: .9rem; color: var(--muted); padding: 8px 12px; border-radius: 10px; background: var(--paper-2); }
.game__stat b { color: var(--ink); }
.game__area { min-width: 0; }
.game__cap { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); margin: 0 0 10px; }
.game__cap .ico { width: 14px; height: 14px; vertical-align: -2px; }
.game__out:empty { display: none; }

.g-result { margin-top: 18px; padding: 16px 18px; border-radius: 14px; background: var(--paper-2); border: 1px solid var(--line); }
.g-result b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.9rem; line-height: 1.1; color: var(--red); }
.g-result p { margin: 6px 0 0; font-size: .95rem; line-height: 1.55; }
.g-result.is-ok { background: #E4EEDC; border-color: #BFD4B0; }
.g-result.is-ok b { color: #3F6B34; }
.g-record { color: #8A6212; font-weight: 600; }

/* Лента времени */
.tpool { display: flex; flex-wrap: wrap; gap: 8px; min-height: 62px; padding: 12px; border: 1.5px dashed var(--line); border-radius: 14px; margin-bottom: 22px; background: var(--card); }
.tpool.is-empty { opacity: .7; }
.tpool .muted { margin: 8px; font-size: .9rem; color: var(--muted); }
.tcard { padding: 9px 13px; border: 1.5px solid var(--line); border-radius: 999px; background: #FFFDF8; color: var(--ink); font: 600 .9rem/1.25 var(--font-ui); cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.tcard:hover { border-color: var(--gold); background: #FFF7E6; transform: translateY(-1px); }
.tline { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: tl; }
.tline::before { content: 'Нажимайте на карточки выше — они встанут сюда по порядку'; display: block; font-size: .86rem; color: var(--muted); padding: 14px; border: 1.5px dashed var(--line); border-radius: 14px; text-align: center; }
.tline:not(:empty)::before { display: none; }
.tslot { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 14px 11px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #FFFDF8; color: var(--ink); font: 600 .98rem/1.3 var(--font-ui); cursor: pointer; }
.tslot::before { content: ''; position: absolute; left: 50%; top: 100%; width: 2px; height: 8px; background: var(--line); }
.tslot:last-child::before { display: none; }
.tslot:hover { border-color: var(--gold); }
.tslot__n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-2); font-weight: 700; }
.tslot b { margin-left: auto; font-family: var(--font-display); font-weight: 400; font-size: 1.25rem; color: var(--muted); }
.tslot.is-ok { border-color: #7FA66E; background: #EEF5E8; } .tslot.is-ok .tslot__n { background: #7FA66E; color: #fff; }
.tslot.is-bad { border-color: #D08776; background: #FBEDE9; } .tslot.is-bad .tslot__n { background: #C25A44; color: #fff; }

/* Викторина и «Угадай место» */
.g-progress { display: flex; align-items: center; gap: 12px; font-size: .86rem; color: var(--muted); margin-bottom: 14px; }
.g-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.g-bar i { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 999px; transition: width .3s var(--ease); }
.g-q { font-family: var(--font-read); font-size: clamp(1.15rem, 1.9vw, 1.4rem); line-height: 1.45; margin: 0 0 18px; }
.opts { display: grid; gap: 10px; }
.opts--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opt { display: flex; align-items: center; gap: 12px; text-align: left; padding: 13px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: #FFFDF8; color: var(--ink); font: 600 .98rem/1.35 var(--font-ui); cursor: pointer; transition: border-color .15s, background .15s; }
.opt__k { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--paper-2); font-weight: 700; font-size: .85rem; }
.opt:hover:not([disabled]) { border-color: var(--gold); background: #FFF7E6; }
.opt.is-ok { border-color: #5E8C4E; background: #E6F0DD; } .opt.is-ok .opt__k { background: #5E8C4E; color: #fff; }
.opt.is-bad { border-color: #C25A44; background: #F9E2DC; opacity: .85; } .opt.is-bad .opt__k { background: #C25A44; color: #fff; }
.opt[disabled] { cursor: default; }
.g-why { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--paper-2); font-family: var(--font-read); font-size: .98rem; line-height: 1.6; }
.g-why b { color: var(--red); }
.g-why.is-ok b { color: #3F6B34; }
#quiz-next, #gs-next { margin-top: 16px; }

/* Найди пару */
.mgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; perspective: 900px; }
.mcard { position: relative; aspect-ratio: 4 / 3; padding: 0; border: 0; background: transparent; cursor: pointer; }
.mcard__in { position: absolute; inset: 0; transition: transform .45s var(--ease); transform-style: preserve-3d; border-radius: 12px; }
.mcard.is-open .mcard__in { transform: rotateY(180deg); }
.mcard__back, .mcard__face { position: absolute; inset: 0; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 12px; overflow: hidden; }
.mcard__back { background: var(--volga-ink); color: var(--gold-2); background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .04) 0 8px, transparent 8px 16px); }
.mcard__back .ico { width: 26px; height: 26px; }
.mcard__face { transform: rotateY(180deg); background: #FFFDF8; border: 1.5px solid var(--line); padding: 8px; font-size: .86rem; font-weight: 600; text-align: center; }
.mcard__face img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.mcard.is-done .mcard__face { border-color: #7FA66E; background: #EEF5E8; }
.mcard.is-done { cursor: default; animation: memPop .4s var(--ease); }
@keyframes memPop { 50% { transform: scale(1.05); } }

/* Пазл */
.pgrid { --img: none; position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; aspect-ratio: 4 / 3; padding: 6px; border-radius: 14px; background: var(--volga-ink); background-image: linear-gradient(rgba(13, 40, 51, .78), rgba(13, 40, 51, .78)), var(--img); background-size: cover; background-position: center; max-width: 620px; }
.ptile { border: 0; padding: 0; border-radius: 6px; background-image: var(--img); background-size: 300% 300%; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(13, 40, 51, .6); transition: transform .12s; }
.ptile:hover { transform: scale(.985); }
.ptile--blank { background: transparent; box-shadow: none; }
.ptile.is-done { animation: memPop .4s var(--ease); }

/* Угадай место */
.gs-view { aspect-ratio: 16 / 9; border-radius: 14px; background-color: var(--volga-ink); background-repeat: no-repeat; transition: background-size .4s var(--ease); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 14px; }
.gs-view.is-open { background-size: contain !important; }
#gs-opts { margin-top: 4px; }

@media (max-width: 960px) {
  .game__in { grid-template-columns: 1fr; gap: 20px; }
  .mgrid { gap: 8px; }
  .mcard__face { font-size: .76rem; padding: 5px; }
}
@media (max-width: 560px) {
  .game { padding: 30px 0 34px; }
  .opts--2 { grid-template-columns: 1fr; }
  .mcard__face { font-size: .68rem; }
}
@media (prefers-reduced-motion: reduce) {
  .mcard__in, .gs-view, .ptile, .g-bar i { transition: none; }
  .mcard.is-done, .ptile.is-done { animation: none; }
}
