/* Whole-screen atmosphere, with a light reading surface throughout. */
#gameModal { transition:background .65s ease; }
#gameModal .gm-box { transition:box-shadow .6s ease, border-color .6s ease; }
#gameModal.ec-fx-warm { background:rgba(17,24,39,.72); }
#gameModal.ec-fx-fire { background:radial-gradient(ellipse at 50% 45%,rgba(151,29,32,.82),rgba(53,7,13,.97)); }
#gameModal.ec-fx-legend { background:radial-gradient(ellipse at 50% 38%,#42101b 0%,#0c0710 65%,#020307 100%); }
#gameModal.ec-fx-fire .gm-box { border:2px solid #dc493b; box-shadow:0 0 0 5px #f44c271f,0 0 90px #f0443866; }
#gameModal.ec-fx-legend .gm-box { border:2px solid #f4664d; box-shadow:0 0 0 6px #8f192c55,0 0 115px #cc1b3b80,0 25px 95px #000b; }
#gameModal.ec-fx-fire .gm-body { background:linear-gradient(135deg,#fff8f2,#fff 48%,#fff0ed); }
#gameModal.ec-fx-legend .gm-body { background:linear-gradient(135deg,#f8eef0,#fff 38%,#fff 68%,#f6e8ee); }
#gameModal .ec-fx-callout { position:fixed; z-index:6; left:50%; top:21%; transform:translate(-50%,-50%); display:flex; align-items:center; flex-direction:column; gap:3px; pointer-events:none; color:#fff6da; text-shadow:0 2px 0 #7d241f,0 5px 22px #000b; white-space:nowrap; animation:ec-fx-enter .95s ease both; }
#gameModal .ec-fx-callout span { font-size:12px; font-weight:900; letter-spacing:.2em; padding:4px 10px; border-radius:5px; background:#37171ce8; }
#gameModal .ec-fx-callout strong { font-size:clamp(29px,4vw,56px); font-weight:950; letter-spacing:-.04em; }
#gameModal .ec-fx-streak { position:fixed; right:24px; bottom:18px; z-index:6; padding:7px 15px; background:#211725f5; color:#fff1bd; border:1px solid #fd785c; border-radius:7px; font-size:13px; font-weight:850; pointer-events:none; box-shadow:0 3px 20px #0004; }
#gameModal.ec-fx-hit .gm-box { animation:ec-fx-impact .45s ease; }
#gameModal.ec-fx-milestone .ec-fx-callout { animation-duration:1.45s; }
#gameModal.ec-fx-legend .ec-fx-callout strong { color:#ffd47b; }
@keyframes ec-fx-enter { 0% { opacity:0; transform:translate(-50%,-50%) scale(.76); } 18%,75% { opacity:1; transform:translate(-50%,-50%) scale(1); } 100% { opacity:0; transform:translate(-50%,-62%) scale(1.03); } }
@keyframes ec-fx-impact { 0% { filter:brightness(1); } 25% { filter:brightness(1.06); } 100% { filter:brightness(1); } }
@media((max-width:640px) and (not ((hover: hover) and (pointer: fine)))) { #gameModal .ec-fx-callout { top:23%; } #gameModal .ec-fx-streak { right:10px; bottom:10px; font-size:11px; padding:5px 10px; } }
@media(prefers-reduced-motion:reduce) { #gameModal,#gameModal .gm-box { transition:none; } #gameModal .ec-fx-callout,#gameModal.ec-fx-hit .gm-box { animation:none; } }

/* Keep the installed matching confirmation button free of the streak badge. */
.mm-playing #gameModal .ec-fx-streak { top:72px; bottom:auto; right:13px; font-size:10px; padding:4px 6px; }

/* Twenty: fractured violet. Thirty: cyan energy. Forty: a bright platinum dawn. */
#gameModal.ec-fx-rift { --ec-fx-light:#a892ff; --ec-fx-edge:#7952ef; background:radial-gradient(ellipse at 50% 20%,#31246e 0%,#160c34 52%,#070712 100%); }
#gameModal.ec-fx-surge { --ec-fx-light:#74fff1; --ec-fx-edge:#13bccc; background:radial-gradient(ellipse at 48% 24%,#b5fcf1 0%,#2382a6 38%,#102e61 75%,#10142d 100%); }
#gameModal.ec-fx-nova { --ec-fx-light:#fff0b0; --ec-fx-edge:#dcaa45; background:radial-gradient(ellipse at 50% 8%,#fffef6 0%,#ffebb2 30%,#b6edf0 60%,#aba3eb 100%); }
#gameModal:is(.ec-fx-rift,.ec-fx-surge,.ec-fx-nova) .gm-box { border:2px solid var(--ec-fx-light); box-shadow:0 0 0 5px color-mix(in srgb,var(--ec-fx-edge),transparent 65%),0 0 100px var(--ec-fx-edge); }
#gameModal.ec-fx-rift .gm-body { background:linear-gradient(130deg,#f0e9ff,#fff 35%,#fff 66%,#eee9ff); }
#gameModal.ec-fx-surge .gm-body { background:linear-gradient(125deg,#d9faf5,#fff 34%,#fff 68%,#dceaff); }
#gameModal.ec-fx-nova .gm-body { background:linear-gradient(125deg,#fff0c5,#fffdf9 32%,#fff 60%,#d9f5f7 82%,#e5e0ff); }
#gameModal .ec-fx-arena { position:fixed; inset:0; z-index:4; pointer-events:none; overflow:hidden; color:var(--ec-fx-light); }
#gameModal .ec-fx-wash { position:absolute; inset:0; opacity:.38; background:radial-gradient(ellipse at 50% 50%,transparent 57%,var(--ec-fx-edge) 130%); }
#gameModal .ec-fx-fractures { position:absolute; inset:0; width:100%; height:100%; opacity:.42; filter:drop-shadow(0 0 5px var(--ec-fx-edge)); }
#gameModal .ec-fx-shards { opacity:.18; }
#gameModal.ec-fx-surge .ec-fx-fractures { opacity:.65; }
#gameModal.ec-fx-nova .ec-fx-fractures { color:#9b6c27; opacity:.52; }
#gameModal.ec-fx-nova .ec-fx-wash { opacity:.24; }
#gameModal:is(.ec-fx-rift,.ec-fx-surge,.ec-fx-nova) .ec-fx-callout { color:var(--ec-fx-light); text-shadow:0 2px 0 #18142a,0 4px 24px #090622; }
#gameModal:is(.ec-fx-rift,.ec-fx-surge,.ec-fx-nova) .ec-fx-streak { color:var(--ec-fx-light); border-color:var(--ec-fx-light); background:#17142dec; }
#gameModal.ec-fx-nova .ec-fx-callout { color:#fff6c9; }
#gameModal.ec-fx-breakthrough .ec-fx-fractures { animation:ec-fx-fracture-open 1.35s ease-out both; }
#gameModal.ec-fx-breakthrough .ec-fx-wash { animation:ec-fx-energy-release 1.35s ease-out both; }
#gameModal.ec-fx-breakthrough .ec-fx-callout strong { font-size:clamp(36px,5vw,70px); }
@keyframes ec-fx-fracture-open { 0% { opacity:0; transform:scale(.97); } 24% { opacity:.8; transform:scale(1); } 100% { opacity:.42; transform:scale(1.035); } }
@keyframes ec-fx-energy-release { 0% { opacity:0; transform:scale(.92); } 28% { opacity:.48; transform:scale(1); } 100% { opacity:.2; transform:scale(1.07); } }
@media((max-width:640px) and (not ((hover: hover) and (pointer: fine)))) { #gameModal .ec-fx-fractures { opacity:.27; } #gameModal .ec-fx-wash { opacity:.18; } #gameModal.ec-fx-breakthrough .ec-fx-callout strong { font-size:clamp(32px,10vw,48px); } }
@media(prefers-reduced-motion:reduce) { #gameModal.ec-fx-breakthrough .ec-fx-fractures,#gameModal.ec-fx-breakthrough .ec-fx-wash { animation:none; transform:none; } }

/* A continuous rise on every answer from10 through40, including full-screen phone boards. */
#gameModal.ec-fx-legend { --ec-fx-light:#ffb1c6; --ec-fx-edge:#e44979; }
#gameModal .ec-fx-electric { position:absolute;inset:0;width:100%;height:100%;opacity:var(--ec-fx-electric-alpha,.2);filter:drop-shadow(0 0 5px currentColor); }
#gameModal .ec-fx-electric path { stroke-width:var(--ec-fx-bolt-width,1.4px);stroke-dasharray:1;stroke-dashoffset:calc(1 - var(--ec-fx-reach,.15)); }
#gameModal .ec-fx-arena .ec-fx-fractures { opacity:var(--ec-fx-crack-alpha,.08); }
#gameModal .ec-fx-arena .ec-fx-wash { opacity:var(--ec-fx-wash-alpha,.06); }
#gameModal.ec-fx-hit .ec-fx-electric { animation:ec-fx-corner-charge .75s ease-out both; }
@keyframes ec-fx-corner-charge { 0% { transform:scale(.99); } 38% { transform:scale(1.012); } 100% { transform:scale(1); } }
@media((max-width:640px) and (not ((hover: hover) and (pointer: fine)))) { #gameModal .ec-fx-arena { opacity:.82; } }
@media(prefers-reduced-motion:reduce) { #gameModal.ec-fx-hit .ec-fx-electric { animation:none;transform:none; } }

/* Keep later mobile-match.css white backgrounds from hiding the combo surface. */
#gameModal.ec-fx-fire { --ec-fx-phone-surface:linear-gradient(135deg,#ffe3db,#fff 34%,#fff 66%,#ffe5de); }
#gameModal.ec-fx-legend { --ec-fx-phone-surface:linear-gradient(135deg,#ddd2e3,#fff 34%,#fff 66%,#e5cad7); }
#gameModal.ec-fx-rift { --ec-fx-phone-surface:linear-gradient(135deg,#d8c6ff,#fff 34%,#fff 66%,#dfd3ff); }
#gameModal.ec-fx-surge { --ec-fx-phone-surface:linear-gradient(135deg,#b1f8ec,#fff 34%,#fff 66%,#b6d7ff); }
#gameModal.ec-fx-nova { --ec-fx-phone-surface:linear-gradient(135deg,#ffe79d,#fffef7 33%,#fff 61%,#c2f2f7 82%,#d2c7ff); }
body.mm-playing #gameModal:is(.ec-fx-fire,.ec-fx-legend,.ec-fx-rift,.ec-fx-surge,.ec-fx-nova) .gm-body.mm-match-body,
.gm-touch-matching #gameModal:is(.ec-fx-fire,.ec-fx-legend,.ec-fx-rift,.ec-fx-surge,.ec-fx-nova) .gm-body.vs-match-body { background:var(--ec-fx-phone-surface); }
@keyframes ec-fx-fracture-open { 0% { opacity:0;transform:scale(.97); } 24% { opacity:calc(var(--ec-fx-crack-alpha,.1) + .18);transform:scale(1); } 100% { opacity:var(--ec-fx-crack-alpha,.1);transform:scale(1.035); } }
@keyframes ec-fx-energy-release { 0% { opacity:0;transform:scale(.92); } 28% { opacity:calc(var(--ec-fx-wash-alpha,.1) + .14);transform:scale(1); } 100% { opacity:var(--ec-fx-wash-alpha,.1);transform:scale(1.07); } }
