/* Обновлённые игры (2026-10): «Взлом», «Дождь», «Память», «Собери иероглиф». */

/* ---- «Взлом терминала»: слои защиты ---- */
.hack { max-width: 640px; position: relative; overflow: hidden; }
.hack::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px);
}
.hack-stage { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 12px; align-items: center; }
.hack-target { text-align: center; }
.hack-svg { width: 100%; max-width: 168px; display: block; margin: 0 auto; overflow: visible; }
.hack-scan { fill: none; stroke: rgba(var(--accent-rgb), .18); stroke-width: 1; stroke-dasharray: 2 6; }
.hack-ring { transform-origin: 100px 100px; animation: hack-spin linear infinite; }
.hack-ring:nth-of-type(even) { animation-direction: reverse; }
.hack-seg { fill: none; stroke: #ff4d5e; stroke-width: 7; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(255, 77, 94, .7)); transition: stroke .2s; }
.hack-ring:not(.is-current) .hack-seg { stroke: rgba(255, 77, 94, .45); filter: none; }
.hack-ring.is-current .hack-seg { stroke: #ff9a3d; filter: drop-shadow(0 0 5px rgba(255, 154, 61, .8)); }
.hack-seg.is-gone { stroke: rgba(var(--accent-rgb), .22) !important; stroke-width: 2; stroke-dasharray: 3 5; filter: none !important; }
.hack-ring.is-broken { animation: hack-shatter .7s ease-out forwards; }
.hack-ring.is-broken .hack-seg { stroke: var(--accent); }
.hack-core polygon { fill: rgba(var(--accent-rgb), .12); stroke: var(--accent); stroke-width: 2; }
.hack-core text { fill: var(--accent); font-size: 26px; text-anchor: middle; dominant-baseline: middle; font-family: var(--sans); }
.hack-core { transform-origin: 100px 100px; }
.hack-core.is-boss polygon { fill: rgba(255, 201, 77, .2); stroke: #ffc94d; }
.hack-core.is-boss text { fill: #ffc94d; }
.hack-core.is-boss { animation: hack-pulse 1s ease-in-out infinite; }
.hack-core.is-open { animation: hack-open .8s ease-out; }
.hack-core.is-open polygon { fill: rgba(57, 255, 136, .25); stroke: #39ff88; }
.hack-core.is-open text { fill: #39ff88; }
.hack-status { font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; color: var(--text-dim); margin-top: 4px; }
.hack-bossing .hack-status { color: #ffc94d; }
.hack-log { min-height: 8.4em; }
.hack-bonus { animation: hack-pop .5s ease-out; }
.hack-q { position: relative; border-radius: 12px; padding: 8px; }
.hack-q.is-boss { border: 1px solid rgba(255, 201, 77, .6); background: rgba(255, 201, 77, .07); box-shadow: 0 0 24px rgba(255, 201, 77, .15) inset; }
.hack-boss-tag { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; color: #ffc94d; }
.hack-hanzi { font-size: 3.4rem; text-shadow: 0 0 18px rgba(var(--accent-rgb), .35); }
.hack-low .hack-time > span { animation: hack-blink .5s steps(2) infinite; }
.hack-low #hack-time { color: var(--error); }
/* Ошибка — глитч: строка смещается с цветными двойниками. */
.hack-wrong { animation: hack-glitch .35s steps(4); }
.hack-wrong .hack-q { animation: hack-rgb .35s steps(3); }
@keyframes hack-spin { to { transform: rotate(360deg); } }
@keyframes hack-shatter { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; stroke-width: 1; } }
@keyframes hack-pulse { 50% { transform: scale(1.08); } }
@keyframes hack-open { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes hack-pop { 0% { transform: scale(.7); opacity: 0; } 60% { transform: scale(1.1); opacity: 1; } }
@keyframes hack-blink { 50% { opacity: .3; } }
@keyframes hack-glitch {
  0% { transform: translate(0); } 25% { transform: translate(-4px, 1px); clip-path: inset(10% 0 40% 0); }
  50% { transform: translate(3px, -1px); clip-path: inset(50% 0 5% 0); } 75% { transform: translate(-2px, 0); clip-path: none; } 100% { transform: none; }
}
@keyframes hack-rgb { 0%, 100% { text-shadow: none; } 33% { text-shadow: -3px 0 #ff4d5e, 3px 0 #2de2e6; } 66% { text-shadow: 3px 0 #ff4d5e, -3px 0 #2de2e6; } }
@media (max-width: 520px) {
  .hack-stage { grid-template-columns: 112px minmax(0, 1fr); gap: 8px; }
  .hack-log { min-height: 6.5em; font-size: .66rem; }
  .hack-status { font-size: .58rem; white-space: nowrap; letter-spacing: .02em; }
  .hack-hanzi { font-size: 2.8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .hack-ring, .hack-core.is-boss, .hack-wrong, .hack-wrong .hack-q, .hack-low .hack-time > span { animation: none; }
}

/* ---- «Иероглифный дождь»: холст, дрон-ловец, гроза ---- */
.rain { max-width: 600px; }
.rain-field { background: radial-gradient(120% 80% at 50% 0%, rgba(var(--accent-rgb), .10), transparent 60%), linear-gradient(180deg, #070c16, #0b1424 70%, #0a1220); }
.rain-sky { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.rain-drop {
  z-index: 1; border-radius: 16px; border-color: rgba(var(--accent-rgb), .55);
  background: radial-gradient(120% 90% at 50% 20%, rgba(var(--accent-rgb), .22), rgba(10, 18, 32, .92) 70%);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), .30), inset 0 1px 0 rgba(255, 255, 255, .15);
  text-shadow: 0 0 10px rgba(var(--accent-rgb), .5);
}
.rain-drop::before {
  content: ""; position: absolute; left: 50%; bottom: 100%; width: 2px; height: 26px; transform: translateX(-50%);
  background: linear-gradient(to top, rgba(var(--accent-rgb), .55), transparent); pointer-events: none;
}
.rain-caught { animation: rain-absorb .45s ease-in forwards; }
@keyframes rain-absorb { 60% { transform: scale(1.15); } to { opacity: 0; filter: blur(2px); } }
.rain-ground { bottom: 38px; height: 2px; }
.rain-field::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 38px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 77, 94, .06), rgba(0, 0, 0, .35));
}
.rain-next { font-family: var(--mono); font-size: .8rem; color: #b84fff; }
.rain-is-storm .rain-field { border-color: rgba(184, 79, 255, .6); box-shadow: 0 0 24px rgba(184, 79, 255, .25); }
.rain-is-storm .rain-drop { border-color: rgba(184, 79, 255, .7); box-shadow: 0 0 16px rgba(184, 79, 255, .4); }
.rain-storm-ask { gap: 6px 10px; }
.rain-storm-tag { width: 100%; font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; color: #ffc94d; }
.rain-storm-word { font-style: normal; font-weight: 700; font-size: 1.2rem; color: var(--text); padding: 2px 10px; border-radius: 8px; border: 1px solid rgba(184, 79, 255, .5); }
.rain-storm-word.is-got { color: var(--success); border-color: var(--success); text-decoration: line-through; }
.rain-plus { color: var(--text-dim); }
@media (prefers-reduced-motion: reduce) { .rain-caught { animation: none; opacity: .4; } }

/* ---- «Память»: 3D-переворот, неоновые рубашки, улёт пары ---- */
.mem-card {
  display: block; position: relative; padding: 0; border: 0; background: none; overflow: visible;
  perspective: 700px; border-radius: 12px;
}
.mem-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.mem-inner {
  display: block; position: absolute; inset: 0; transform-style: preserve-3d;
  transition: transform .2s;
}
.mem-side {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 6px 4px; border-radius: 12px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border: 1px solid var(--border);
}
.mem-cover {
  border-color: rgba(var(--accent-rgb), .45);
  background:
    radial-gradient(circle at 50% 50%, rgba(var(--accent-rgb), .22), transparent 42%),
    linear-gradient(90deg, transparent 49%, rgba(var(--accent-rgb), .18) 49% 51%, transparent 51%) 0 0 / 100% 18px,
    linear-gradient(0deg, transparent 49%, rgba(var(--accent-rgb), .12) 49% 51%, transparent 51%) 0 0 / 18px 100%,
    linear-gradient(160deg, #0d1a2c, #0a111d 60%, #130d24);
  box-shadow: inset 0 0 0 4px rgba(10, 17, 29, .9), inset 0 0 0 5px rgba(var(--accent-rgb), .25);
}
.mem-cover::before, .mem-cover::after {
  content: ""; position: absolute; width: 10px; height: 10px; border: 2px solid rgba(var(--accent-rgb), .6);
}
.mem-cover::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.mem-cover::after { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
.mem-back {
  width: 46px; height: 46px; display: grid; place-items: center; font-size: 1.5rem; color: var(--accent);
  clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
  background: rgba(var(--accent-rgb), .14); text-shadow: 0 0 10px rgba(var(--accent-rgb), .8);
}
.mem-closed:hover .mem-inner { transform: translateY(-3px) rotateX(6deg); }
.mem-closed:hover .mem-cover { border-color: var(--accent); }
.mem-face { transform: rotateY(180deg); background: linear-gradient(180deg, #131f33, #0d1626); color: var(--text); }
.mem-open .mem-inner, .mem-matched .mem-inner { transform: rotateY(180deg); }
.mem-open .mem-face { border-color: var(--accent); box-shadow: 0 0 14px var(--accent-dim); }
.mem-miss .mem-face { border-color: rgba(255, 77, 94, .75); box-shadow: 0 0 12px rgba(255, 77, 94, .4); animation: mem-nope .35s ease .25s; }
.mem-matched { cursor: default; }
.mem-matched.mem-face-sound { cursor: pointer; }
.mem-matched .mem-face { border-color: rgba(57, 255, 136, .55); background: rgba(57, 255, 136, .07); }
.mem-matched .mem-inner { transform: rotateY(180deg) scale(.94); }
.mem-matched .mem-face { opacity: .7; }
.mem-hit .mem-face { animation: mem-glow .7s ease-out; }
.mem-anim.mem-open .mem-inner { animation: mem-turn-open .42s cubic-bezier(.3, .7, .3, 1.2); }
.mem-anim.mem-closed .mem-inner { animation: mem-turn-close .42s ease-in-out; }
.mem-hit .mem-inner { animation: mem-collect .7s ease-out; }
.mem-hit::after {
  content: ""; position: absolute; inset: -14px; pointer-events: none; border-radius: 50%;
  background:
    radial-gradient(circle, #39ff88 0 2px, transparent 3px) 10% 20% / 22px 22px,
    radial-gradient(circle, #ffc94d 0 2px, transparent 3px) 70% 60% / 26px 26px,
    radial-gradient(circle, #2de2e6 0 1.5px, transparent 2.5px) 40% 80% / 18px 18px;
  animation: mem-sparks .7s ease-out forwards;
}
.mem-deal .mem-inner { animation: mem-deal .45s cubic-bezier(.2, .8, .3, 1.2) backwards; animation-delay: var(--deal, 0ms); }
@keyframes mem-turn-open { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }
@keyframes mem-turn-close { from { transform: rotateY(180deg); } to { transform: rotateY(0); } }
@keyframes mem-collect {
  0% { transform: rotateY(180deg) scale(1); }
  35% { transform: rotateY(180deg) scale(1.12) translateY(-6px); }
  100% { transform: rotateY(180deg) scale(.94); }
}
@keyframes mem-glow {
  0% { opacity: 1; }
  35% { opacity: 1; box-shadow: 0 0 22px rgba(57, 255, 136, .9); border-color: #39ff88; }
  100% { opacity: .7; }
}
@keyframes mem-sparks { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.5) rotate(25deg); opacity: 0; } }
@keyframes mem-nope { 25% { transform: translateX(-4px) rotateY(180deg); } 75% { transform: translateX(4px) rotateY(180deg); } }
@keyframes mem-deal { from { transform: translateY(-30px) rotateZ(-8deg) scale(.7); } }
@media (prefers-reduced-motion: reduce) {
  .mem-anim .mem-inner, .mem-hit .mem-inner, .mem-deal .mem-inner, .mem-hit::after, .mem-miss .mem-face, .mem-hit .mem-face { animation: none !important; }
}

/* ---- «Собери иероглиф»: сборка, таймер-комбо ---- */
.build-stage { width: 100%; }
.build { max-width: 600px; position: relative; }
.build-timer { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .07); overflow: hidden; margin: 8px 0 2px; }
.build-timer > span { display: block; height: 100%; background: linear-gradient(90deg, #ffc94d, var(--accent)); transform-origin: left; animation: build-drain linear forwards; }
@keyframes build-drain { from { transform: scaleX(1); } to { transform: scaleX(0); opacity: .35; } }
.build-combo { font-family: var(--mono); font-size: .8rem; color: #ffc94d; text-shadow: 0 0 8px rgba(255, 201, 77, .6); animation: hack-pop .4s ease-out; }
.build-quick { text-align: center; font-family: var(--mono); color: #ffc94d; font-size: .85rem; margin-top: 2px; animation: hack-pop .4s ease-out; }
.build-part-show {
  border-radius: 14px; border: 1px solid rgba(var(--accent-rgb), .4);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), .10), rgba(var(--accent-rgb), .02));
  box-shadow: 0 0 14px rgba(var(--accent-rgb), .12);
}
.build-target { text-shadow: 0 0 22px rgba(var(--accent-rgb), .45); }
.build-tile { border-radius: 14px; transition: transform .12s, box-shadow .2s; }
.build-on { transform: translateY(-3px); }
.build-forge {
  position: relative; height: 190px; margin: 10px 0 4px; display: grid; place-items: center;
  border-radius: 16px; overflow: hidden;
  background: radial-gradient(closest-side, rgba(var(--accent-rgb), .16), transparent);
}
.build-is-bad .build-forge { background: radial-gradient(closest-side, rgba(255, 201, 77, .12), transparent); }
.build-fly {
  position: absolute; left: 50%; top: 50%; font-family: var(--sans); font-size: 3rem; color: var(--accent);
  text-shadow: 0 0 12px rgba(var(--accent-rgb), .7);
  transform: translate(calc(-50% + var(--x) * 130px), -50%);
  animation: build-fly .55s cubic-bezier(.5, 0, .7, .4) forwards;
}
@keyframes build-fly { to { transform: translate(-50%, -50%) scale(.4); opacity: 0; } }
.build-forge-glyph { width: 170px; height: 170px; opacity: 0; animation: build-appear .3s ease-out .42s forwards; }
.build-forge-glyph .hz-svg { max-width: 170px; margin: 0; }
.build-forge-plain { font-family: var(--sans); font-size: 7rem; line-height: 170px; text-align: center; color: var(--text); }
.build-forge .hz-stroke { stroke-dasharray: var(--len) var(--len); stroke-dashoffset: var(--len); animation: build-draw var(--ms) linear var(--d) forwards; }
.build-forge .hz-stroke-solid { opacity: 0; animation: build-appear .15s linear var(--d) forwards; }
.build-is-ok .build-forge .hz-stroke { stroke: #39ff88; }
.build-is-ok .build-forge .hz-stroke-solid { fill: #39ff88; }
.build-flash {
  position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .9), rgba(var(--accent-rgb), .4) 40%, transparent 70%);
  opacity: 0; animation: build-flash .6s ease-out .4s;
}
@keyframes build-draw { to { stroke-dashoffset: 0; } }
@keyframes build-appear { to { opacity: 1; } }
@keyframes build-flash { 0% { opacity: 1; transform: scale(.3); } 100% { opacity: 0; transform: scale(7); } }
.build-is-ok { animation: build-ok-glow 1s ease-out; }
@keyframes build-ok-glow { 30% { box-shadow: 0 0 30px rgba(57, 255, 136, .35); } }
@media (max-width: 520px) {
  .build-forge { height: 160px; }
  .build-forge-glyph { width: 140px; height: 140px; }
  .build-forge-glyph .hz-svg { max-width: 140px; }
  .build-fly { font-size: 2.4rem; transform: translate(calc(-50% + var(--x) * 100px), -50%); }
}
@media (prefers-reduced-motion: reduce) {
  .build-fly { display: none; }
  .build-forge-glyph, .build-forge .hz-stroke, .build-forge .hz-stroke-solid { animation-duration: 1ms !important; animation-delay: 0ms !important; }
  .build-flash, .build-is-ok, .build-timer > span { animation: none; }
}

/* ---- «Башни Архитектора»: карты, стройка ---- */
.tower-maps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 4px; }
.tower-map {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 14px; cursor: pointer;
  border: 1px solid rgba(255, 211, 107, .35); color: var(--text); font: inherit; text-align: center;
  background: linear-gradient(160deg, rgba(20, 60, 50, .9), rgba(10, 30, 26, .9));
}
.tower-map-wall { background: linear-gradient(160deg, rgba(150, 70, 55, .85), rgba(60, 35, 30, .9)); }
.tower-map-market { background: linear-gradient(160deg, rgba(90, 20, 30, .9), rgba(25, 12, 24, .95)); }
.tower-map-zh { font-family: var(--sans); font-size: 1.6rem; color: #ffd36b; text-shadow: 0 0 10px rgba(255, 211, 107, .4); }
.tower-map b { font-size: .9rem; }
.tower-map span:last-child { font-size: .72rem; color: var(--text-dim); }
.tower-map.is-on { border-color: #ffd36b; box-shadow: 0 0 0 2px rgba(255, 211, 107, .35), 0 0 18px rgba(255, 211, 107, .25); }
.tower-map:disabled { opacity: .45; cursor: default; filter: grayscale(.6); }
.tower-ru { color: #ffd36b; font-size: 1.3rem; }
.tower-crys { font-family: var(--mono); color: #7bf0ff; }
.tower-up .tower-cards { grid-template-columns: repeat(4, 1fr); }
.tower-kind.is-on { border-color: #ffd36b; background: rgba(255, 211, 107, .12); box-shadow: 0 0 14px rgba(255, 211, 107, .25); }
.tower-glyph { font-family: var(--sans); font-size: 1.2rem; color: #ff8a6a; }
.tower-cost { font-style: normal; font-family: var(--mono); font-size: .8rem; color: #7bf0ff; margin-left: 4px; }
.tower-pads, .tower-ups { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: .85rem; color: var(--text-dim); }
.tower-pads span, .tower-ups span { width: 100%; }
.tower-pad { min-width: 44px; min-height: 40px; padding: 4px 10px; }
.tower-upg { min-height: 38px; padding: 4px 10px; font-size: .82rem; }
.tower-go { display: flex; margin: 10px auto 0; }
.towers-garden .tower-canvas { border-color: rgba(120, 220, 170, .35); }
.towers-wall .tower-canvas { border-color: rgba(255, 170, 90, .4); }
.towers-market .tower-canvas { border-color: rgba(255, 90, 90, .4); }
@media (max-width: 860px) { .tower-up .tower-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .tower-maps { gap: 6px; } .tower-map-zh { font-size: 1.3rem; } .tower-card span { display: none; } .tower-card .tower-glyph { display: inline; } }
/* На стройке панель не «прилипает»: площадки на карте должны быть видны и нажимаемы. */
.answer-sheet.tower-up { position: static; box-shadow: none; }

/* ---- «Тоны-гонки»: город, соперники, газ в одном ряду с дорожками ---- */
.tones .tone-lanes { grid-template-columns: repeat(4, 1fr) minmax(54px, .8fr); }
.tones .tone-gas {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 2px; border-radius: 10px; cursor: pointer;
  font: 700 1.3rem/1 var(--sans); color: #ffb347; border: 1px solid rgba(255, 179, 71, .55);
  background: linear-gradient(180deg, rgba(255, 140, 50, .18), rgba(255, 90, 40, .06));
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.tones .tone-gas span { font-size: .68rem; font-weight: 600; color: var(--text-dim); }
.tones .tone-gas:active:not(:disabled) { transform: translateY(1px); background: rgba(255, 140, 50, .3); }
.tones .tone-gas:disabled { opacity: .4; cursor: default; }
.tones .tone-controls { justify-content: center; }
.tones .tone-canvas { border-color: rgba(255, 150, 80, .35); }
.tone-place { font-family: var(--mono); font-size: .85rem; color: #ffb347; }
.tone-duo { font-family: var(--mono); font-size: .8rem; color: #ffe08a; border: 1px solid rgba(255, 224, 138, .5); border-radius: 999px; padding: 1px 8px; }
@media (max-width: 480px) { .tones .tone-lanes { gap: 4px; } .tones .tone-lane .tone-line { width: 30px; height: 22px; } }

/* ---- «Дешифратор»: иероглиф → как читается ---- */
.decode { max-width: 600px; position: relative; overflow: hidden; }
.decode::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px);
}
.decode-hud {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; color: var(--text-dim);
}
.decode-hud b { color: var(--accent); font-size: 1.15rem; }
.decode-lives { color: #ff4d5e; font-size: 1.15rem; letter-spacing: 0.12em; }
.decode-time { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin: 8px 0 10px; }
.decode-time > span { display: block; height: 100%; background: linear-gradient(90deg, var(--error), var(--accent)); }
.decode-q { text-align: center; margin: 10px 0 14px; }
.decode-ask { color: var(--text-dim); font-size: 0.9rem; }
.decode-hanzi { font-family: var(--sans); font-size: 4rem; line-height: 1.25; overflow-wrap: anywhere; text-shadow: 0 0 18px rgba(var(--accent-rgb), .35); }
.decode-ru { min-height: 1.5em; color: var(--text-dim); font-size: 0.95rem; }
.decode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.decode-opt { text-align: center; min-height: 58px; font-family: var(--sans); font-size: 1.25rem; overflow-wrap: anywhere; }
.decode-note { text-align: center; margin-top: 10px; font-size: 0.95rem; color: var(--text-dim); }
.decode-note b { color: var(--text); font-family: var(--sans); }
.decode-low .decode-time > span { animation: hack-blink .5s steps(2) infinite; }
.decode-wrong { animation: hack-glitch .35s steps(4); }
@media (max-width: 520px) {
  .decode-hanzi { font-size: 3.2rem; }
  .decode-opt { font-size: 1.05rem; min-height: 54px; }
}
@media (prefers-reduced-motion: reduce) { .decode-low .decode-time > span, .decode-wrong { animation: none; } }
body[data-motion="off"] .decode-low .decode-time > span, body[data-motion="off"] .decode-wrong { animation: none; }

/* «Память»: табло пар над полем (memPairsHtml) */
.mem-pairs { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.mem-slot { min-width: 40px; height: 32px; padding: 0 6px; border-radius: 8px; display: grid; place-items: center;
  border: 1px dashed rgba(var(--accent-rgb), .35); color: var(--success); font-size: 1.1rem; line-height: 1; }
.mem-slot.on { border: 1px solid rgba(57, 255, 136, .6); background: rgba(57, 255, 136, .08); box-shadow: 0 0 10px rgba(57, 255, 136, .25); }
.mem-slot.new { animation: mem-slot-in .5s .25s backwards; }
@keyframes mem-slot-in { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mem-slot.new { animation: none; } }
body[data-motion=off] .mem-slot.new { animation: none; }
