/* kidsplace «Игры» — яркие цвета, крупные кнопки под детский палец */
.kg { --ink: #2b1d4a; --muted: #6b5f85; --card: #fff; --soft: #f6f1ff; max-width: 760px; margin: 0 auto; color: var(--ink); font-family: Nunito, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
:is(html, body):is([data-theme="dark"], [data-bs-theme="dark"], .dark) .kg { --ink: #f4f0ff; --muted: #b4aacb; --card: #241d36; --soft: #30264a; }
.kg-ic { width: 1em; height: 1em; fill: currentColor; display: inline-block; vertical-align: middle; flex: none; }
.kg svg.icms-svg-icon { flex: none; }

.kg-hero { position: relative; overflow: hidden; padding: 26px 20px 20px; border-radius: 30px; color: #fff; background: linear-gradient(135deg, #7b2ff7, #c026d3 55%, #ff2e93); box-shadow: 0 16px 40px rgba(192, 38, 211, .3); margin-bottom: 14px; }
.kg-hero__b { position: absolute; border-radius: 50%; }
.kg-hero__b--1 { width: 150px; height: 150px; right: -40px; top: -50px; background: #ffc400; }
.kg-hero__b--2 { width: 90px; height: 90px; left: -28px; bottom: -36px; background: #3ddc97; }
.kg-hero__title { position: relative; display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 1.8rem; font-weight: 900; color: #fff !important; }
.kg-hero__text { position: relative; margin: 0 0 14px; font-weight: 700; opacity: .92; max-width: 480px; }

.kg-ages { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kg-ages__l { font-weight: 900; margin-right: 4px; }
.kg-age { border: 0; cursor: pointer; padding: 8px 14px; border-radius: 999px; font: inherit; font-weight: 900; background: rgba(255,255,255,.22); color: #fff; }
.kg-age.is-on { background: #fff; color: #7b2ff7; }
.kg-ages--mini { margin: 0 0 12px; }
.kg-ages--mini .kg-age { background: var(--soft); color: var(--muted); padding: 6px 12px; font-size: .85rem; }
.kg-ages--mini .kg-age.is-on { background: var(--c, #7b2ff7); color: #fff; }
.kg-ages__sep { width: 2px; height: 22px; background: var(--soft); margin: 0 4px; }

.kg-album { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; border-radius: 22px; background: linear-gradient(135deg, #fff6d6, #ffe9f4); color: var(--ink) !important; text-decoration: none !important; box-shadow: 0 6px 18px rgba(255, 138, 0, .15); }
.kg-album__ic { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, #ffc400, #ff8a00); }
.kg-album__t { flex: 1; display: flex; flex-direction: column; }
.kg-album__t b { font-weight: 900; }
.kg-album__t small { color: #8a6a00; font-weight: 700; }
:is(html, body):is([data-theme="dark"], [data-bs-theme="dark"], .dark) .kg-album { background: linear-gradient(135deg, #3a3014, #3a1a2c); }

.kg-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.kg-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 24px; background: var(--card); color: var(--ink) !important; text-decoration: none !important; box-shadow: 0 8px 22px rgba(123, 47, 247, .1); border-bottom: 5px solid var(--c); transition: transform .2s cubic-bezier(.3,1.6,.5,1); }
.kg-card:hover { transform: translateY(-3px) rotate(-.5deg); }
.kg-card__ic { flex: none; width: 66px; height: 66px; border-radius: 20px; display: flex; align-items: center; justify-content: center; color: #fff; background: var(--c); box-shadow: 0 8px 18px color-mix(in srgb, var(--c) 40%, transparent); }
.kg-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.kg-card__body b { font-size: 1.1rem; font-weight: 900; }
.kg-card__body small { color: var(--muted); font-weight: 700; line-height: 1.3; }
.kg-card__meta { display: flex; gap: 6px; margin-top: 3px; }
.kg-card__age, .kg-card__stars { font-size: .75rem; font-weight: 900; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.kg-card__stars { background: #fff3c4; color: #a37400; }
.kg-card__go { flex: none; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.kg-card.is-hard { opacity: .7; }
.kg-note { margin: 14px 0 0; font-size: .85rem; font-weight: 700; color: var(--muted); text-align: center; }
.kg-note a { color: #7b2ff7; font-weight: 900; }

/* экран игры */
.kg-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.kg-back { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--soft); color: var(--ink) !important; }
.kg-top__ic { width: 40px; height: 40px; border-radius: 13px; display: flex; align-items: center; justify-content: center; color: #fff; background: var(--c, #7b2ff7); }
.kg-top__title { flex: 1; margin: 0; font-size: 1.35rem; font-weight: 900; color: var(--ink) !important; }
.kg-top__stars { display: inline-flex; align-items: center; gap: 5px; padding: 7px 12px; border-radius: 999px; background: #fff3c4; color: #a37400; font-weight: 900; }
.kg-stage { min-height: 360px; padding: 16px; border-radius: 28px; background: var(--card); box-shadow: 0 10px 30px rgba(123, 47, 247, .1); }

.kg-prog { display: flex; gap: 6px; justify-content: center; margin-bottom: 14px; }
.kg-prog i { width: 26px; height: 8px; border-radius: 99px; background: var(--soft); }
.kg-prog i.is-done { background: var(--c, #7b2ff7); }
.kg-prog i.is-now { background: color-mix(in srgb, var(--c, #7b2ff7) 45%, transparent); }

.kg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; cursor: pointer; padding: 12px 20px; border-radius: 999px; font: inherit; font-weight: 900; background: var(--soft); color: var(--ink) !important; text-decoration: none !important; }
.kg-btn--main { background: linear-gradient(135deg, #7b2ff7, #ff2e93); color: #fff !important; box-shadow: 0 8px 20px rgba(255, 46, 147, .3); }
.kg-btn--sm { padding: 6px 12px; font-size: .8rem; }

/* собери слово */
.kg-word { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.kg-pic { position: relative; width: 170px; height: 170px; border: 0; border-radius: 40px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--wc) 14%, #fff); box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--wc) 30%, transparent); animation: kg-bob 3s ease-in-out infinite; }
:is(html, body):is([data-theme="dark"], [data-bs-theme="dark"], .dark) .kg-pic { background: color-mix(in srgb, var(--wc) 20%, #241d36); }
.kg-say { position: absolute; right: -6px; bottom: -6px; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; background: #1f8bff; box-shadow: 0 4px 10px rgba(31,139,255,.4); }
.kg-slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.kg-slot { width: 46px; height: 54px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.7rem; font-weight: 900; background: var(--soft); border-bottom: 4px solid color-mix(in srgb, var(--c, #7b2ff7) 40%, transparent); }
.kg-slot em { font-style: normal; opacity: .22; }
.kg-slot.is-full { background: var(--c, #7b2ff7); color: #fff; border-color: rgba(0,0,0,.15); animation: kg-pop .3s; }
.kg-slots.is-done .kg-slot { background: #12c26a; animation: kg-jump .6s; }
.kg-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 420px; }
.kg-tile { width: 52px; height: 56px; border: 0; border-radius: 16px; cursor: pointer; font: inherit; font-size: 1.6rem; font-weight: 900; color: #fff; background: linear-gradient(135deg, #ff8a00, #ff2e93); box-shadow: 0 5px 0 rgba(0,0,0,.15); animation: kg-in .35s backwards; animation-delay: var(--d); transition: transform .1s; }
.kg-tile:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.15); }
.kg-tile.is-used { visibility: hidden; }
.kg-tile.is-bad { animation: kg-shake .4s; background: #ff3b4f; }

/* мемори */
.kg-memo-info { text-align: center; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; font-weight: 800; color: var(--muted); }
.kg-memo { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 10px; max-width: 460px; margin: 0 auto; }
.kg-mcard { position: relative; aspect-ratio: 1; border: 0; padding: 0; cursor: pointer; background: none; perspective: 600px; animation: kg-in .35s backwards; animation-delay: var(--d); }
.kg-mcard > span { position: absolute; inset: 0; border-radius: 18px; display: flex; align-items: center; justify-content: center; backface-visibility: hidden; transition: transform .4s; }
.kg-mcard__back { color: rgba(255,255,255,.8); background: linear-gradient(135deg, #7b2ff7, #ff2e93); box-shadow: 0 5px 0 rgba(0,0,0,.12); }
.kg-mcard__face { background: var(--soft); transform: rotateY(180deg); box-shadow: inset 0 0 0 3px #e3d6ff; }
.kg-mcard.is-open .kg-mcard__back { transform: rotateY(180deg); }
.kg-mcard.is-open .kg-mcard__face { transform: rotateY(360deg); }
.kg-mcard.is-found .kg-mcard__face { box-shadow: inset 0 0 0 4px #12c26a; animation: kg-jump .5s; }

/* пазл */
.kg-puz { position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; max-width: 420px; margin: 0 auto; aspect-ratio: 1; border-radius: 20px; overflow: hidden; background: var(--soft); }
.kg-piece { border: 0; padding: 0; cursor: pointer; background-size: calc(var(--n) * 100%) calc(var(--n) * 100%); background-repeat: no-repeat; transition: filter .2s, transform .2s; }
.kg-piece.is-sel { outline: 4px solid #ffc400; outline-offset: -4px; filter: brightness(1.1); transform: scale(.96); }
.kg-piece.is-pop { animation: kg-pop .3s; }
.kg-puz.is-done { gap: 0; transition: gap .4s; }
.kg-puz__hint { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* счёт, логика, викторина */
.kg-q { text-align: center; margin-bottom: 16px; }
.kg-qt { font-size: 1.2rem; font-weight: 900; margin: 0 0 10px; }
.kg-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 12px; border-radius: 20px; background: var(--soft); }
.kg-row .kg-ic { animation: kg-in .35s backwards; }
.kg-sum { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.kg-op { font-size: 2rem; font-weight: 900; color: #ff2e93; }
.kg-expr { font-size: 2.6rem; font-weight: 900; letter-spacing: .02em; }
.kg-expr span { color: #ff2e93; }
.kg-qmark { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.4rem; color: #fff; background: #ff2e93; animation: kg-bob 1.6s ease-in-out infinite; }
.kg-opts { display: grid; grid-template-columns: repeat(var(--cols, 1), 1fr); gap: 10px; max-width: 520px; margin: 0 auto; }
.kg-opts--big { max-width: 420px; }
.kg-opt { min-height: 64px; border: 0; cursor: pointer; padding: 12px; border-radius: 20px; font: inherit; font-weight: 900; font-size: 1.05rem; color: var(--ink); background: var(--soft); box-shadow: 0 5px 0 rgba(123,47,247,.15); display: flex; align-items: center; justify-content: center; transition: transform .1s; }
.kg-opt:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(123,47,247,.15); }
.kg-opt .kg-num { font-size: 2rem; color: #7b2ff7; }
.kg-opt.is-ok { background: #12c26a; color: #fff; animation: kg-jump .5s; }
.kg-opt.is-ok .kg-num { color: #fff; }
.kg-opt.is-bad { background: #ffd6dc; animation: kg-shake .4s; opacity: .6; }
.kg-quizq { position: relative; padding: 16px 16px 14px; border-radius: 22px; background: linear-gradient(135deg, #fff6e5, #ffeef6); text-align: left; }
:is(html, body):is([data-theme="dark"], [data-bs-theme="dark"], .dark) .kg-quizq { background: linear-gradient(135deg, #3a2a14, #3a1a2c); }
.kg-quizq__ic { position: absolute; top: -12px; left: 14px; width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; background: #ff3b4f; }
.kg-quizq.is-riddle .kg-quizq__ic { background: #7b2ff7; }
.kg-quizq p { margin: 14px 0 10px; font-size: 1.15rem; font-weight: 800; line-height: 1.45; }

/* итог */
.kg-win { position: fixed; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(43, 29, 74, .55); backdrop-filter: blur(3px); animation: kg-fade .25s; }
.kg-win__box { width: 100%; max-width: 360px; padding: 24px 20px; border-radius: 32px; background: #fff; color: #2b1d4a; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: kg-pop .4s; font-family: Nunito, system-ui, sans-serif; }
:is(html, body):is([data-theme="dark"], [data-bs-theme="dark"], .dark) .kg-win__box { background: #241d36; color: #f4f0ff; }
.kg-win__stars { display: flex; justify-content: center; gap: 6px; margin-bottom: 8px; }
.kg-win__stars span { color: #e6def5; transform: scale(.6); animation: kg-star .5s forwards; }
.kg-win__stars span.is-on { color: #ffc400; filter: drop-shadow(0 4px 6px rgba(255,170,0,.4)); }
.kg-win__t { display: block; font-size: 1.5rem; font-weight: 900; margin-bottom: 12px; }
.kg-win__note { font-size: .85rem; font-weight: 700; color: #6b5f85; }
.kg-win__btns { display: grid; gap: 8px; }
.kg-win__sticker { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 14px; padding: 12px; border-radius: 20px; background: #fff6d6; }
.kg-win__sticker a { font-weight: 900; color: #7b2ff7; }

/* наклейки */
.kg-album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 14px; padding: 16px; border-radius: 28px; background: repeating-linear-gradient(45deg, var(--soft) 0 14px, transparent 14px 28px), var(--card); }
.kg-sticker { aspect-ratio: 1; width: 100%; max-width: 92px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; background: var(--c);
    box-shadow: 0 0 0 5px #fff, 0 8px 16px rgba(0,0,0,.18); transform: rotate(var(--r, 0deg)); }
.kg-sticker.is-off { background: var(--soft); color: #c9bde3; box-shadow: 0 0 0 3px dashed #e3d6ff; border: 3px dashed #d9c8ff; }
.kg-sticker.is-new { width: 84px; height: 84px; animation: kg-pop .6s; }

.kg-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 4001; overflow: hidden; }
.kg-confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: kg-fall 2.2s ease-in forwards; }

@keyframes kg-bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes kg-pop { 0% { transform: scale(.6); } 70% { transform: scale(1.1); } 100% { transform: scale(1); } }
@keyframes kg-jump { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } }
@keyframes kg-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes kg-in { from { opacity: 0; transform: translateY(10px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes kg-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes kg-star { to { transform: scale(1); } }
@keyframes kg-fall { to { transform: translateY(110vh) rotate(720deg); } }
@media (prefers-reduced-motion: reduce) { .kg *, .kg-win * { animation: none !important; } }
@media (max-width: 420px) {
    .kg-slot { width: 38px; height: 46px; font-size: 1.4rem; }
    .kg-tile { width: 46px; height: 50px; font-size: 1.4rem; }
    .kg-pic { width: 140px; height: 140px; }
    .kg-pic .kg-ic { width: 96px !important; height: 96px !important; }
    .kg-list { grid-template-columns: 1fr; }
}

.kg [hidden], .kg-win [hidden] { display: none !important; }

.kg-cell { display: flex; flex-direction: column; }
.kg-cell .kg-card { flex: 1; }
.kg-announce { display: flex; align-items: center; justify-content: center; gap: 6px; margin: -6px 10px 4px; padding: 6px; border: 0; border-radius: 0 0 16px 16px; background: var(--soft); color: var(--muted); font: inherit; font-size: .8rem; font-weight: 800; cursor: pointer; }
.kg-list { align-items: start; }
.kg-btn--soc { background: var(--sc) !important; color: #fff !important; }

/* 1.1.1: выбор голоса */
.kg-voice { width: 38px; height: 38px; border-radius: 12px; border: 0; background: #efe6ff; color: #7b2ff7; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.kg-voice:hover { background: #e2d2ff; }
