/* Лингора games 2026-09-30 */
/* ---------- home entry cards ---------- */
.gm-home { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.gm-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 4px; min-height: 96px; min-width: 0;
  margin: 0 !important; padding: 14px; text-align: left; border: 0; color: #fff; font: inherit; cursor: pointer; overflow: hidden;
  background: linear-gradient(135deg, #8B2FD9, #C2268E); box-shadow: 0 10px 24px rgba(194, 38, 142, .28); transition: transform .18s var(--spring, ease); }
.gm-tile:active { transform: scale(.97); }
.gm-tile b { font-size: clamp(15px, 4.4vw, 17px); font-weight: 800; line-height: 1.2; overflow-wrap: break-word; max-width: 70%; position: relative; z-index: 1; }
.gm-tile-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .2); position: relative; z-index: 1; }
.gm-tile-ico svg { fill: #fff; color: #fff; }
.gm-tile-sub { font-size: 12px; font-weight: 700; opacity: .85; position: relative; z-index: 1; }
.gm-tile-sub svg { fill: #fff; vertical-align: -2px; }
.gm-tile-lori.mascot { position: absolute; right: -8px; bottom: -10px; width: 64px; height: 64px; opacity: .95; animation: gmPeek 3.4s ease-in-out infinite; }
.gm-ask { background: linear-gradient(135deg, #FF7AB8, #FFB547); box-shadow: 0 10px 24px rgba(255, 122, 184, .28); }
.gm-ask b { max-width: 100%; }
.gm-ask-lori.mascot { width: 46px; height: 46px; position: relative; z-index: 1; animation: gmPeek 2.8s ease-in-out infinite; }
.gm-ask-q { position: absolute; right: 12px; top: 10px; font-weight: 900; font-size: 18px; opacity: .45; letter-spacing: .05em; }
.gm-home.is-locked .gm-tile { filter: saturate(.55); }
@keyframes gmPeek { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-4deg); } }
.mode.gm-pr { border: 2px solid var(--pink); background: var(--pink-soft); }

/* ---------- «Лори просит слово» sheet ---------- */
.lw { position: fixed; inset: 0; z-index: 57; display: flex; align-items: flex-end; justify-content: center; background: rgba(12, 2, 28, .55); animation: onbIn .25s ease both; }
.lw.out { animation: onbOut .2s ease both; }
.lw-card { position: relative; width: min(520px, 100%); max-height: 92vh; overflow-y: auto; padding: 18px 16px max(16px, env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0;
  background: var(--surface); border: 2px solid var(--line-2); border-bottom: 0; box-shadow: var(--shadow); animation: lwUp .42s var(--spring, ease) both; }
@keyframes lwUp { from { transform: translateY(100%); } to { transform: none; } }
.lw-x { position: absolute; right: 10px; top: 10px; width: 48px; height: 48px; }
.lw-head { display: flex; align-items: flex-end; gap: 10px; margin: 6px 48px 14px 0; }
.lw-lori.mascot { width: 72px; height: 72px; flex: 0 0 72px; animation: onbBob 2.4s ease-in-out infinite; }
.lw-lori.jump { animation: gmJump .6s var(--spring, ease); }
.lw-lori.sway { animation: gmSway .7s ease; }
@keyframes gmJump { 30% { transform: translateY(-16px) scale(1.06); } 60% { transform: translateY(0) scale(.97); } }
@keyframes gmSway { 25% { transform: rotate(-8deg); } 60% { transform: rotate(6deg); } }
.lw-bubble { position: relative; flex: 1 1 auto; min-width: 0; padding: 12px 14px; border-radius: 18px; background: var(--surface-2); border: 2px solid var(--line-2); margin-bottom: 14px; }
.lw-bubble::before { content: ""; position: absolute; left: -9px; bottom: 14px; width: 14px; height: 14px; background: var(--surface-2); border-left: 2px solid var(--line-2); border-bottom: 2px solid var(--line-2); transform: rotate(45deg); }
.lw-q { font-size: clamp(17px, 5vw, 20px); font-weight: 800; line-height: 1.4; overflow-wrap: break-word; }
.lw-hint { margin-top: 6px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.lw-gap { display: inline-block; min-width: 3.2em; padding: 0 8px; margin: 0 2px; border-radius: 10px; text-align: center; background: var(--pink-soft); border-bottom: 3px solid var(--pink); color: var(--pink); }
.lw-gap.ok { background: var(--lagoon-soft); border-color: var(--lagoon); color: var(--lagoon); animation: onbPop .5s var(--spring, ease); }
.lw-gap.bad { background: var(--lagoon-soft); border-color: var(--lagoon); color: var(--lagoon); }
.lw-opts, .gm-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.lw-opt, .gm-opt { min-height: 56px; min-width: 0; padding: 10px 12px; border-radius: 16px; border: 2px solid var(--line-2); border-bottom-width: 4px; background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 800; font-size: clamp(15px, 4.4vw, 17px); overflow-wrap: break-word; cursor: pointer; transition: transform .16s var(--spring, ease); }
.lw-opt:active, .gm-opt:active { transform: translateY(2px) scale(.98); }
.lw-opt.ok, .gm-opt.ok { border-color: var(--lagoon); background: var(--lagoon-soft); animation: onbPop .45s var(--spring, ease); }
.lw-opt.bad, .gm-opt.bad { border-color: var(--rose); background: var(--rose-soft); }
.lw-opt:disabled, .gm-opt:disabled { cursor: default; }
.lw-opt:disabled:not(.ok):not(.bad), .gm-opt:disabled:not(.ok):not(.bad) { opacity: .6; }
.shake { animation: gmShake .45s ease; }
@keyframes gmShake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.lw-foot { margin-top: 14px; }
.lw-xp, .gm-plus { display: block; text-align: center; font-size: 22px; font-weight: 900; color: var(--saffron); margin-bottom: 10px; animation: onbPop .5s var(--spring, ease); }
.lw-explain, .gm-explain { font-size: 14px; color: var(--ink-2); margin-bottom: 10px; line-height: 1.4; overflow-wrap: break-word; }
.gm-explain { margin-top: 12px; }
.lw-btns, .gm-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.lw-btns .btn, .gm-actions .btn { min-height: 52px; }

/* ---------- overlay ---------- */
.gm { position: fixed; inset: 0; z-index: 56; display: flex; flex-direction: column; background: var(--bg);
  background-image: radial-gradient(120% 60% at 100% 0%, var(--bg-glow-2), transparent 60%), radial-gradient(100% 50% at 0% 100%, var(--bg-glow-1), transparent 60%);
  padding: max(8px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom)); animation: onbIn .3s var(--ease-out, ease) both; }
.gm.out { animation: onbOut .2s ease both; }
.gm-top { display: flex; align-items: center; gap: 10px; min-height: 52px; }
.gm-x { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 14px; }
.gm-title { flex: 1 1 auto; min-width: 0; font-weight: 800; font-size: 17px; overflow-wrap: break-word; }
.gm-xp:empty { display: none; }
.gm-xp { color: var(--saffron); font-weight: 800; }
.gm-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 6px 2px 16px; }
.gm-body > * { animation: onbStep .3s var(--ease-out, ease) both; }
.gm-quest { padding: 16px; }
.gm-q-head { display: flex; align-items: center; gap: 12px; }
.gm-q-lori.mascot { width: 60px; height: 60px; flex: 0 0 60px; animation: onbBob 2.6s ease-in-out infinite; }
.gm-path { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 6px; }
.gm-node button { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; min-height: 48px; padding: 4px 2px; border: 0; background: none; color: var(--ink); font: inherit; cursor: pointer; }
.gm-dot { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; font-weight: 900; font-size: 18px; background: var(--surface-3); color: var(--muted); border-bottom: 4px solid rgba(0, 0, 0, .25); }
.gm-dot svg { fill: currentColor; }
.gm-node.done .gm-dot { background: linear-gradient(135deg, #3EDBB0, #0EA5A0); color: #fff; }
.gm-node.cur .gm-dot { background: var(--grad); color: #fff; box-shadow: 0 0 0 5px rgba(255, 111, 181, .22); animation: gmPulse 1.6s ease-in-out infinite; }
@keyframes gmPulse { 50% { transform: scale(1.08); } }
.gm-node.lock button { cursor: default; opacity: .55; }
.gm-place { font-size: 12px; font-weight: 700; line-height: 1.2; text-align: center; color: var(--ink-2); overflow-wrap: break-word; hyphens: auto; max-width: 100%; }
.gm-q-done { display: grid; place-items: center; margin-top: 10px; }
.gm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.gm-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 108px; min-width: 0; padding: 12px 8px; border-radius: 22px; border: 0;
  color: #fff; font: inherit; font-weight: 800; font-size: clamp(14px, 4.2vw, 16px); cursor: pointer; box-shadow: 0 8px 18px rgba(12, 2, 28, .3); transition: transform .18s var(--spring, ease); animation: onbCard .38s var(--ease-out, ease) both; }
.gm-card:active { transform: scale(.96); }
.gm-card svg { fill: #fff; color: #fff; }
.gm-card b { overflow-wrap: break-word; text-align: center; }
.gm-card.c0 { background: linear-gradient(135deg, #A855F7, #7C3AED); } .gm-card.c1 { background: linear-gradient(135deg, #F472B6, #DB2777); animation-delay: .04s; }
.gm-card.c2 { background: linear-gradient(135deg, #34D3A6, #0EA5A0); animation-delay: .08s; } .gm-card.c3 { background: linear-gradient(135deg, #FDBA74, #F472B6); animation-delay: .12s; }
.gm-card.c4 { background: linear-gradient(135deg, #8FB7FF, #7C3AED); animation-delay: .16s; }
.gm-ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: rgba(255, 255, 255, .2); }
.gm-grid .gm-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.gm-prog { height: 12px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 4px 0 12px; }
.gm-prog > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--iris), var(--pink)); transition: width .4s var(--spring, ease); }
.gm-say { display: flex; align-items: flex-end; gap: 10px; margin: 6px 0 16px; }
.gm-say-lori.mascot { width: 64px; height: 64px; flex: 0 0 64px; animation: onbBob 2.6s ease-in-out infinite; }
.gm-bubble { position: relative; flex: 1 1 auto; min-width: 0; padding: 12px 14px; border-radius: 18px; background: var(--surface); border: 2px solid var(--line-2); margin-bottom: 12px; font-weight: 800; }
.gm-bubble::before { content: ""; position: absolute; left: -9px; bottom: 14px; width: 14px; height: 14px; background: var(--surface); border-left: 2px solid var(--line-2); border-bottom: 2px solid var(--line-2); transform: rotate(45deg); }
.gm-hint { font-size: clamp(16px, 4.6vw, 19px); overflow-wrap: break-word; }
.gm-hint svg { fill: currentColor; vertical-align: -3px; }
.gm-sent { display: block; font-size: clamp(17px, 5vw, 20px); line-height: 1.45; overflow-wrap: break-word; }
.gm-sub { display: block; margin-top: 6px; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.gm-opt small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 2px; }
/* anagram */
.gm-slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 60px; margin: 6px 0 18px; }
.gm-slot { width: 44px; height: 54px; min-width: 0; border-radius: 12px; border: 2px dashed var(--line-2); background: transparent; color: var(--ink); font: inherit; font-size: 22px; font-weight: 900; }
.gm-slot.on { border-style: solid; border-color: var(--iris); background: var(--iris-soft); animation: onbPop .3s var(--spring, ease); }
.gm-slots.ok .gm-slot { border-color: var(--lagoon); background: var(--lagoon-soft); }
.gm-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.gm-tile-l { width: 52px; height: 56px; border-radius: 14px; border: 2px solid var(--line-2); border-bottom-width: 4px; background: var(--surface); color: var(--ink); font: inherit; font-size: 24px; font-weight: 900; cursor: pointer; transition: transform .15s var(--spring, ease), opacity .15s; }
.gm-tile-l:active { transform: translateY(2px); }
.gm-tile-l.used { opacity: .2; transform: scale(.9); }
.gm-reveal { width: 100%; text-align: center; font-size: 26px; font-weight: 900; color: var(--lagoon); margin: 10px 0; overflow-wrap: anywhere; }
@media (max-width: 350px) { .gm-slot { width: 36px; height: 48px; font-size: 19px; } .gm-tile-l { width: 46px; height: 50px; font-size: 21px; } }
/* memory */
.gm-mem { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; perspective: 800px; }
.gm-mc { position: relative; min-height: 78px; min-width: 0; padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.gm-mc-in { position: absolute; inset: 0; transition: transform .4s var(--spring, ease); transform-style: preserve-3d; }
.gm-mc.up .gm-mc-in { transform: rotateY(180deg); }
.gm-mc-back, .gm-mc-face { position: absolute; inset: 0; display: grid; place-items: center; padding: 6px; border-radius: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.gm-mc-back { background: var(--grad); color: rgba(255, 255, 255, .7); font-size: 24px; box-shadow: 0 6px 14px rgba(12, 2, 28, .25); }
.gm-mc-face { transform: rotateY(180deg); background: var(--surface); border: 2px solid var(--line-2); color: var(--ink); font-weight: 800; font-size: clamp(12px, 3.6vw, 15px); line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.gm-mc.ok .gm-mc-face { border-color: var(--lagoon); background: var(--lagoon-soft); }
.gm-mc.ok { animation: onbPop .45s var(--spring, ease); }
/* chain */
.gm-chain-now { text-align: center; font-size: clamp(28px, 9vw, 36px); font-weight: 900; margin: 8px 0 4px; overflow-wrap: anywhere; }
.gm-chain-now small { display: block; font-size: 14px; font-weight: 600; color: var(--muted); }
.gm-last { color: var(--pink); display: inline-block; animation: gmPulse 1.4s ease-in-out infinite; }
/* true / false */
.gm-timer { height: 12px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 4px 0 10px; }
.gm-timer > i { display: block; height: 100%; background: linear-gradient(90deg, var(--saffron), var(--pink)); transform-origin: left; transition: transform .1s linear; }
.gm-tf { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 14px; border-radius: 24px; background: var(--surface); border: 2px solid var(--line-2); text-align: center; overflow-wrap: anywhere; }
.gm-tf b { font-size: clamp(26px, 8vw, 32px); }
.gm-tf span { font-size: 18px; font-weight: 700; color: var(--ink-2); }
.gm-tf .gm-eq { color: var(--muted); }
.gm-tf.pop { animation: onbPop .3s var(--spring, ease); }
.gm-tf-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.gm-yes, .gm-no { min-height: 76px; border-radius: 22px; border: 0; border-bottom: 5px solid rgba(0, 0, 0, .25); color: #fff; font-size: 34px; font-weight: 900; cursor: pointer; transition: transform .12s var(--spring, ease); }
.gm-yes { background: linear-gradient(135deg, #34D3A6, #0EA5A0); } .gm-no { background: linear-gradient(135deg, #FF7A98, #DB2777); }
.gm-yes:active, .gm-no:active { transform: translateY(3px) scale(.97); }
/* 5 letters */
.gm-wd { display: grid; gap: 6px; justify-content: center; margin: 4px 0 14px; }
.gm-wr { display: grid; grid-template-columns: repeat(5, 48px); gap: 6px; }
.gm-wc { display: grid; place-items: center; height: 48px; border-radius: 12px; border: 2px solid var(--line-2); font-size: 22px; font-weight: 900; color: var(--ink); background: var(--surface); }
.gm-wc.fill { border-color: var(--iris); animation: onbPop .2s var(--spring, ease); }
.gm-wc.s-g, .gm-wc.s-y, .gm-wc.s-x { color: #fff; border-color: transparent; animation: gmFlip .5s ease both; animation-delay: var(--d, 0ms); }
.gm-wc.s-g { background: #12B886; } .gm-wc.s-y { background: #F59F00; } .gm-wc.s-x { background: var(--surface-3); color: var(--muted); }
@keyframes gmFlip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
.gm-kb { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.gm-k { min-width: 30px; flex: 0 0 auto; height: 48px; padding: 0 7px; border-radius: 10px; border: 0; background: var(--surface-3); color: var(--ink); font: inherit; font-weight: 800; font-size: 16px; cursor: pointer; }
.gm-k.wide { min-width: 56px; } .gm-k.go { background: var(--grad); color: #fff; }
.gm-k.s-g { background: #12B886; color: #fff; } .gm-k.s-y { background: #F59F00; color: #fff; } .gm-k.s-x { opacity: .4; }
@media (max-width: 350px) { .gm-wr { grid-template-columns: repeat(5, 42px); } .gm-wc { height: 42px; font-size: 19px; } .gm-k { min-width: 26px; padding: 0 5px; } }
/* result */
.gm-result { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 4vh; }
.gm-res-lori.mascot { width: 130px; height: 130px; }
.gm-res-lori.jump { animation: gmJump .8s var(--spring, ease) .2s both, onbBob 2.4s ease-in-out 1s infinite; }
.gm-stars { display: flex; gap: 8px; margin: 10px 0 4px; }
.gm-star { font-size: 42px; color: var(--surface-3); }
.gm-star.on { color: var(--saffron); animation: onbPop .5s var(--spring, ease) both; animation-delay: var(--d); text-shadow: 0 4px 14px rgba(255, 196, 92, .45); }
.gm-score { font-size: 20px; font-weight: 800; color: var(--ink-2); }
.gm-reward { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 8px; }
.gm-result .gm-actions { width: 100%; }
@media (prefers-reduced-motion: reduce) {
  .gm-tile-lori.mascot, .gm-ask-lori.mascot, .lw, .lw-card, .lw-lori.mascot, .gm, .gm-body > *, .gm-card, .gm-node.cur .gm-dot, .gm-last, .gm-say-lori.mascot, .gm-q-lori.mascot,
  .gm-res-lori.mascot, .gm-star.on, .gm-wc, .gm-mc.ok, .shake, .gm-tf.pop { animation: none !important; }
  .gm-mc-in { transition: none; }
}
