/* Пункты 11-12: «Память кадров» (ёлочные шары) и квиз (звёзды вместо букв). Цвета только из палитры. */
:root { --star: polygon(50% 0, 61% 36%, 98% 38%, 68% 59%, 79% 95%, 50% 74%, 21% 95%, 32% 59%, 2% 38%, 39% 36%); --spark: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); }

/* 11. Память кадров: каждая карточка это шар на нитке; переворот объёмный, найденные пары светятся */
html .memory-grid { position: relative; padding-top: 38px; gap: 22px 16px; perspective: 900px; }
html .mg-garland { position: absolute; left: -2%; top: 0; width: 104%; height: 40px; pointer-events: none; overflow: visible; }
html .memory-card { overflow: visible; border: 0; background: none; box-shadow: none; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.3, 1.25, .4, 1); }
html .memory-card.open, html .memory-card.matched { transform: rotateY(180deg); animation: none; box-shadow: none; }
html .memory-card:nth-child(3n+1) { --bauble: var(--cranberry); } html .memory-card:nth-child(3n+2) { --bauble: var(--night-hi); } html .memory-card:nth-child(3n) { --bauble: var(--cranberry-dark); }
html .memory-card::before, html .memory-card:not(.open):not(.matched)::before { content: ""; position: absolute; inset: 0; border: 0; border-radius: 50%; pointer-events: none; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: radial-gradient(circle at 30% 24%, rgba(255,255,255,.7) 0 5%, rgba(255,255,255,.18) 6% 18%, transparent 30%),
    linear-gradient(180deg, transparent 42%, var(--foil-dark) 42% 45%, var(--foil-light) 45% 50%, var(--foil) 50% 54%, var(--foil-dark) 54% 57%, transparent 57%),
    radial-gradient(circle at 24% 72%, rgba(var(--foil-rgb), .85) 0 1.6px, transparent 2.2px), radial-gradient(circle at 76% 70%, rgba(var(--foil-rgb), .85) 0 1.6px, transparent 2.2px), radial-gradient(circle at 50% 84%, rgba(var(--foil-rgb), .85) 0 1.6px, transparent 2.2px),
    radial-gradient(circle at 50% 50%, var(--bauble, var(--cranberry)), color-mix(in srgb, var(--bauble, var(--cranberry)) 55%, #000));
  box-shadow: inset 0 -12px 20px rgba(0,0,0,.4), inset 0 6px 10px rgba(255,255,255,.22), 0 12px 16px -8px rgba(0,0,0,.55); }
html .mc-cap { position: absolute; left: 50%; top: -10%; width: 24%; height: 13%; margin-left: -12%; border-radius: 3px 3px 1px 1px; background: linear-gradient(90deg, var(--foil-dark), var(--foil-light), var(--foil-dark)); box-shadow: 0 1px 2px rgba(0,0,0,.45); backface-visibility: hidden; -webkit-backface-visibility: hidden; pointer-events: none; }
html .memory-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; opacity: 1; transform: rotateY(180deg); backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 3px solid var(--paper-hi); box-shadow: 0 0 0 1.5px var(--foil-shadow), 0 8px 14px -8px rgba(0,0,0,.6); }
html .memory-card.matched img { box-shadow: 0 0 0 2px var(--foil), 0 0 24px rgba(var(--foil-rgb), .8); }
html .memory-status { min-height: 1.5em; font-size: 19px; }
html .mg-sp, html .qz-sp { position: absolute; z-index: 5; width: 7px; height: 7px; margin: -3px 0 0 -3px; background: var(--foil-light); clip-path: var(--spark); pointer-events: none; animation: bSp .9s ease-out forwards; }
@keyframes bSp { to { transform: translate(var(--dx), var(--dy)) scale(.2) rotate(90deg); opacity: 0; } }

/* 12. Квиз: звёзды-прогресс, вопрос на ночной карточке, мерцающая звезда вместо буквы */
html .quiz-box { position: relative; }
html .quiz-prog { display: flex; justify-content: center; gap: 9px; margin: 2px 0 20px; opacity: 1; }
html .quiz-prog i { display: block; width: 20px; height: 20px; background: rgba(var(--ink-rgb), .18); clip-path: var(--star); transition: background .4s, transform .4s; }
html .quiz-prog i.on { background: linear-gradient(135deg, var(--foil-dark), var(--foil-shadow) 60%, var(--foil)); transform: scale(1.14); }
html .quiz-question { position: relative; margin: 24px 0 16px; padding: 34px 18px 20px; border-radius: 18px; text-align: center; color: var(--foil-light); font: 500 24px/1.28 var(--font-serif); text-wrap: balance;
  background: radial-gradient(90% 70% at 50% 0%, rgba(var(--foil-rgb), .22), transparent 70%), linear-gradient(180deg, var(--night-hi), var(--midnight)); box-shadow: inset 0 0 0 1px rgba(var(--foil-rgb), .45), 0 18px 30px -20px rgba(0,0,0,.75); }
html .quiz-question::before { content: ""; position: absolute; left: 50%; top: -19px; width: 36px; height: 36px; margin-left: -18px; padding: 0; transform: none; background: var(--metal); clip-path: var(--star); font: 0; color: transparent; animation: qzPulse 2.8s ease-in-out infinite; }
html .quiz-question::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .6;
  background: radial-gradient(1.5px 1.5px at 10% 34%, var(--foil-light) 50%, transparent 52%), radial-gradient(2px 2px at 88% 22%, var(--foil) 50%, transparent 52%), radial-gradient(1.5px 1.5px at 74% 80%, var(--foil-light) 50%, transparent 52%), radial-gradient(1.5px 1.5px at 22% 84%, var(--foil) 50%, transparent 52%);
  animation: coverTw 4.2s ease-in-out infinite alternate; }
@keyframes qzPulse { 50% { transform: scale(1.18) rotate(8deg); } }
html .quiz-opt-btn { min-height: 60px; padding: 10px 16px 10px 12px; gap: 14px; border-radius: 16px; background: var(--paper-hi); border: 1px solid rgba(var(--ink-rgb), .2); box-shadow: 0 8px 16px -12px rgba(var(--ink-rgb), .55);
  transition: transform .25s, border-color .25s, box-shadow .25s, background-color .25s; }
html .quiz-opt-btn:hover, html .quiz-opt-btn:focus-visible { border-color: var(--foil-shadow); box-shadow: 0 10px 20px -12px rgba(var(--foil-rgb), .95); }
html .qo-l { position: relative; flex: none; width: 42px; height: 42px; border-radius: 50%; font: 0; color: transparent; background: radial-gradient(circle at 35% 30%, var(--night-hi), var(--midnight)); box-shadow: inset 0 0 0 1px rgba(var(--foil-rgb), .55); }
html .qo-l::after { content: ""; position: absolute; inset: 9px; background: var(--metal); clip-path: var(--star); animation: qzTw 3s ease-in-out infinite; }
html .quiz-opt-btn:nth-child(2) .qo-l::after { animation-delay: .6s; } html .quiz-opt-btn:nth-child(3) .qo-l::after { animation-delay: 1.2s; } html .quiz-opt-btn:nth-child(4) .qo-l::after { animation-delay: 1.8s; }
@keyframes qzTw { 50% { transform: scale(.72) rotate(14deg); opacity: .7; } }
html .quiz-opt-btn.correct { background: linear-gradient(100deg, rgba(var(--foil-rgb), .3), var(--paper-hi) 75%); border-color: var(--foil-shadow); box-shadow: 0 0 0 1px var(--foil-shadow), 0 0 26px rgba(var(--foil-rgb), .5); }
html .quiz-opt-btn.correct .qo-l::after { animation: qzBurst .7s ease-out; }
@keyframes qzBurst { 40% { transform: scale(1.7) rotate(40deg); } }
html .quiz-opt-btn.wrong .qo-l::after { background: var(--mist); opacity: .45; animation: none; }
html .quiz-feedback { margin-top: 14px; padding: 12px 14px; border-left: 3px solid var(--foil-shadow); border-radius: 0 12px 12px 0; background: rgba(var(--foil-rgb), .14); font: italic 500 17px/1.4 var(--font-serif); }
html .quiz-result-plaque { background: linear-gradient(180deg, var(--night-hi), var(--midnight)); color: var(--foil-light); box-shadow: inset 0 0 0 1px rgba(var(--foil-rgb), .55), 0 20px 34px -22px rgba(0,0,0,.8); }
html .quiz-result-plaque .cert-kicker { color: var(--mist); }
@media (prefers-reduced-motion: reduce) { html .memory-card { transition: none; } html .quiz-question::before, html .quiz-question::after, html .qo-l::after { animation: none; } }
