/* Compact game-first modal language shared by Tetris and Värvisadu. */
.game #game-overlay,.match3-game-page .match3-overlay{padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));background:radial-gradient(circle at 50% 32%,rgba(139,92,246,.17),transparent 46%),rgba(2,4,13,.55);backdrop-filter:blur(13px) saturate(1.14);-webkit-backdrop-filter:blur(13px) saturate(1.14)}
.game #game-overlay .modal,.match3-game-page .match3-modal{position:relative;width:min(430px,calc(100vw - 22px));max-height:calc(100dvh - 20px);overflow:hidden;padding:clamp(17px,3.4vw,25px);border:1px solid rgba(255,255,255,.2);border-radius:30px;background:radial-gradient(circle at 18% 0,rgba(139,92,246,.27),transparent 42%),linear-gradient(145deg,rgba(29,25,57,.88),rgba(7,13,27,.92));box-shadow:inset 0 1px rgba(255,255,255,.22),inset 0 -1px rgba(0,0,0,.55),0 28px 75px rgba(0,0,0,.62),0 0 55px rgba(124,58,237,.17);text-align:center;isolation:isolate}
.game #game-overlay .modal:before,.match3-game-page .match3-modal:before{content:"";position:absolute;z-index:-1;inset:0;border-radius:inherit;background:linear-gradient(115deg,rgba(255,255,255,.11),transparent 28% 72%,rgba(96,165,250,.07));pointer-events:none}.game #game-overlay .modal:after,.match3-game-page .match3-modal:after{content:"";position:absolute;top:0;left:18%;width:64%;height:1px;background:linear-gradient(90deg,transparent,#ddd6fe,transparent);box-shadow:0 0 24px #8b5cf6;pointer-events:none}
.game-modal-emblem,.match3-modal-hero{position:relative;display:grid;width:68px;height:68px;margin:0 auto 10px;place-items:center;border:1px solid rgba(255,255,255,.26);border-radius:22px;background:radial-gradient(circle at 35% 28%,#fff 0 3%,#c4b5fd 6% 15%,#7c3aed 28%,#172554 68%,#070b18);box-shadow:inset 0 1px #fff7,0 13px 30px #0008,0 0 38px #8b5cf680;transform:rotate(45deg)}
.game-modal-emblem>strong,.match3-modal-hero>strong{color:#fff;font-size:27px;line-height:1;text-shadow:0 0 14px #fff,0 0 28px #8b5cf6;transform:rotate(-45deg)}.game-modal-emblem i,.match3-modal-hero i{position:absolute;width:5px;height:5px;border-radius:50%;background:#fff;box-shadow:0 0 11px #a78bfa;animation:game-modal-orbit 3s linear infinite}.game-modal-emblem i:first-child,.match3-modal-hero i:first-child{top:7px;left:31px;transform-origin:2px 27px}.game-modal-emblem i:nth-child(2),.match3-modal-hero i:nth-child(2){right:8px;bottom:13px;animation-delay:-1.5s;transform-origin:-21px -13px}
.match3-modal-hero{background:radial-gradient(circle at 35% 28%,#fff 0 3%,#f9a8d4 7% 17%,#ec4899 30%,#7c3aed 62%,#11152b);box-shadow:inset 0 1px #fff7,0 13px 30px #0008,0 0 42px #ec489977}.match3-modal-hero>strong{color:#fff4bd;text-shadow:0 0 12px #fff,0 0 25px #f472b6}
.game #game-overlay .eyebrow,.match3-game-page .match3-modal .eyebrow{display:block;margin:0 0 4px;color:#c4b5fd;font-size:8px;letter-spacing:.16em}.match3-game-page .match3-modal .eyebrow{color:#f9a8d4}.game #game-overlay h1,.match3-game-page .match3-modal h2{margin:4px 0 7px;font-size:clamp(24px,6vw,33px);line-height:1.05;text-wrap:balance}.game #game-overlay .modal>p,.match3-game-page .match3-modal>p{max-width:355px;margin:0 auto;color:#d5dbea;font-size:13px;line-height:1.45;text-wrap:balance}
.game #game-overlay .game-ruleset-summary{max-height:112px;margin:11px 0 0;padding:9px 12px;border-color:#ffffff14;border-radius:14px;background:#ffffff08;overflow:auto;text-align:left}.game #game-overlay .game-ruleset-summary strong{font-size:9px}.game #game-overlay .game-ruleset-summary ul{display:flex;flex-wrap:wrap;gap:4px 13px;margin:5px 0 0;padding:0;list-style:none}.game #game-overlay .game-ruleset-summary li{font-size:10px}
.game #game-overlay .modal-actions,.match3-game-page .match3-modal-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:14px}.game #game-overlay .modal-actions>*:only-child,.match3-game-page .match3-modal-actions>*:only-child{grid-column:1/-1}.game #game-overlay .button,.match3-game-page .match3-modal-actions .button{display:inline-flex;min-width:0;min-height:44px;align-items:center;justify-content:center;gap:7px;margin:0;padding:9px 11px;border-radius:14px;white-space:normal}.game #game-overlay .button span,.match3-game-page .button span{font-size:13px}
.game #game-overlay .tetris-run-summary{grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;margin:11px 0}.game #game-overlay .tetris-run-summary div{padding:7px 3px;border-color:#ffffff15;border-radius:12px;background:#ffffff08}.game #game-overlay .tetris-run-summary b{font-size:clamp(13px,3.5vw,17px)}.game #game-overlay .tetris-run-summary span{font-size:6px}
.game #game-overlay.tetris-result-overlay .game-modal-emblem{background:radial-gradient(circle at 35% 28%,#fff 0 3%,#a7f3d0 7% 17%,#10b981 31%,#3730a3 66%,#080b18);box-shadow:inset 0 1px #fff7,0 13px 30px #0008,0 0 43px #34d39970}.game #game-overlay.tetris-result-overlay .game-modal-emblem>strong{font-size:0}.game #game-overlay.tetris-result-overlay .game-modal-emblem>strong:before{content:"✓";font-size:29px}
.match3-game-page .match3-modal:has([data-match3-start][hidden]) .match3-modal-hero{background:radial-gradient(circle at 35% 28%,#fff 0 3%,#fde68a 7% 17%,#f59e0b 30%,#db2777 63%,#181127)}
.match3-game-page .match3-result-overlay .match3-modal{background:radial-gradient(circle at 50% -8%,rgba(244,114,182,.3),transparent 42%),linear-gradient(150deg,rgba(38,20,55,.9),rgba(7,17,31,.94));box-shadow:inset 0 1px #ffffff35,0 28px 80px #000c,0 0 60px #ec489933}
.m3j-game>.match3-overlay.m3j-page-result{overflow:hidden!important;place-items:center}.m3j-game .m3j-start-emblem{width:66px;height:66px;margin:0 auto 10px;border-radius:22px}.m3j-game .m3j-start-emblem strong{font-size:25px}.m3j-game .m3j-intro-piece{margin-bottom:10px;transform:scale(.84)}
.m3j-game>.m3j-page-result .match3-modal{width:min(430px,calc(100vw - 22px))!important;max-height:calc(100dvh - 20px)!important;overflow:hidden!important;padding:clamp(15px,3vw,22px)!important;border:1px solid #ffffff24!important;border-radius:30px!important;background:radial-gradient(circle at 50% -8%,color-mix(in srgb,var(--m3j-level-accent,#f472b6) 25%,transparent),transparent 42%),linear-gradient(150deg,rgba(35,23,53,.91),rgba(7,14,28,.95))!important;box-shadow:inset 0 1px #ffffff32,0 28px 80px #000c,0 0 60px color-mix(in srgb,var(--m3j-level-accent,#f472b6) 22%,transparent)!important;backdrop-filter:blur(18px)!important}
@keyframes game-modal-orbit{to{rotate:360deg}}
@keyframes game-overlay-soft-in{from{opacity:0;backdrop-filter:blur(0)}to{opacity:1}}@keyframes game-dialog-soft-in{from{opacity:0;transform:translateY(14px) scale(.975);filter:blur(4px)}to{opacity:1;transform:none;filter:none}}
.game #game-overlay:not([hidden]),.match3-game-page .match3-overlay:not([hidden]){animation:game-overlay-soft-in .34s ease-out both}.game #game-overlay:not([hidden]) .modal,.match3-game-page .match3-overlay:not([hidden]) .match3-modal{animation:game-dialog-soft-in .46s cubic-bezier(.18,.82,.24,1) both}
@media(max-width:520px){.game #game-overlay .modal,.match3-game-page .match3-modal{width:min(96vw,410px);max-height:calc(100dvh - 16px);padding:14px 12px;border-radius:24px;overflow:hidden}.game-modal-emblem,.match3-modal-hero{width:54px;height:54px;margin-bottom:8px;border-radius:17px}.game-modal-emblem>strong,.match3-modal-hero>strong{font-size:22px}.game-modal-emblem i:first-child,.match3-modal-hero i:first-child{left:24px;transform-origin:2px 21px}.game #game-overlay h1,.match3-game-page .match3-modal h2{font-size:23px}.game #game-overlay .modal>p,.match3-game-page .match3-modal>p{font-size:11px;line-height:1.35}.game #game-overlay .game-ruleset-summary{max-height:82px;margin-top:8px;padding:7px 9px}.game #game-overlay .modal-actions,.match3-game-page .match3-modal-actions{gap:7px;margin-top:10px}.game #game-overlay .button,.match3-game-page .match3-modal-actions .button{min-height:41px;padding:7px 8px;font-size:12px}.game #game-overlay .tetris-run-summary{grid-template-columns:repeat(5,minmax(0,1fr));margin:8px 0}.game #game-overlay .tetris-run-summary div{padding:5px 2px}.game #game-overlay .tetris-run-summary b{font-size:12px}.game #game-overlay .tetris-run-summary span{font-size:5px;letter-spacing:0}.match3-game-page .m3j-run-summary{grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;margin:8px 0}.match3-game-page .m3j-run-summary>b{padding:5px 2px;font-size:10px}.match3-game-page .m3j-run-summary small{font-size:5px}.m3j-game>.m3j-page-result .match3-modal{width:96vw!important;max-height:calc(100dvh - 16px)!important;padding:13px 10px!important;border-radius:24px!important}.m3j-game .m3j-result-scene{height:72px;margin:-4px auto 0}.m3j-game .m3j-result-score{margin-top:5px;padding:6px 10px}.m3j-game .m3j-next-countdown{margin-top:7px;padding:6px 9px}.m3j-game .m3j-start-emblem{width:54px;height:54px;margin-bottom:7px;border-radius:18px}.m3j-game .m3j-start-emblem strong{font-size:21px}}
@media(max-height:600px){.game-modal-emblem,.match3-modal-hero,.m3j-start-emblem,.m3j-intro-piece,.m3j-intro-icon{display:none!important}.game #game-overlay .game-ruleset-summary{max-height:70px}.game #game-overlay .modal,.match3-game-page .match3-modal{padding-block:11px}}
@media(prefers-reduced-motion:reduce){.game-modal-emblem i,.match3-modal-hero i,.game #game-overlay:not([hidden]),.match3-game-page .match3-overlay:not([hidden]),.game #game-overlay:not([hidden]) .modal,.match3-game-page .match3-overlay:not([hidden]) .match3-modal{animation:none}}
