/* Scoped to the older arithmetic URL; Pong and all answer logic are unchanged. */
body.legacy-math-site:not([data-view=pong]){margin:0!important;padding:0!important;background:linear-gradient(180deg,#effaff,#f7f1ff 550px,#fff)!important;font-family:var(--minik-font,Arial,sans-serif)!important;color:#35305a}
.legacy-math-site:not([data-view=pong])>.site-header,.legacy-math-site:not([data-view=pong])>.site-footer,.legacy-math-site:not([data-view=pong])>.aurora{display:none!important}
.legacy-math-site #math-website-chrome{position:relative;z-index:40}
.legacy-math-site #math-website-chrome .site-header{position:relative!important;inset:auto!important;width:100%!important;max-width:none!important;display:block!important;height:76px!important;padding:0!important;box-shadow:none!important;border-radius:0!important}
.legacy-math-site #math-website-chrome .brand{background:none!important;border:0!important;box-shadow:none!important;width:auto!important;height:auto!important;padding:0!important}
.legacy-math-site #math-website-chrome .header-inner{display:flex!important;position:relative!important;inset:auto!important}
.legacy-math-site #math-website-chrome .practice-banner{padding-top:30px!important}
.legacy-math-site #math-website-chrome .practice-title{font-weight:900!important}
.legacy-math-site:not([data-view=pong]) #app{max-width:1100px!important;width:calc(100% - 40px)!important;margin:20px auto 35px!important;padding:22px!important;background:#ffffffd9!important;border:3px solid #fff!important;border-radius:34px!important;box-shadow:0 12px 25px #8e70c312!important;position:relative!important;z-index:2}
.legacy-math-site[data-view=home] #app{margin-top:-65px!important;z-index:41}
.legacy-math-site:not([data-view=pong]) #app>.hero{display:block!important;margin:0 0 16px!important;padding:0!important;min-height:0!important;max-height:none!important;height:auto!important;border:0!important;background:none!important;box-shadow:none!important}
.legacy-math-site:not([data-view=pong]) #app>.hero .hero-copy{padding:0!important;text-align:center!important}
.legacy-math-site:not([data-view=pong]) #app>.hero h1,.legacy-math-site:not([data-view=pong]) #app>.hero p,.legacy-math-site:not([data-view=pong]) #app>.hero .hero-art{display:none!important}
.legacy-math-site:not([data-view=pong]) #app>.hero .actions{justify-content:center!important}
.legacy-math-site:not([data-view=pong]) #app button{font-family:inherit;min-height:46px;line-height:1.35;border-radius:18px}
.legacy-math-site:not([data-view=pong]) #app .primary{background:linear-gradient(#946de3,#7043c5)!important;box-shadow:0 4px 0 #5735a1!important;color:white!important}
.legacy-math-site:not([data-view=pong]) #app .secondary{background:#fff!important;border:2px solid #ddcaf1!important;color:#6343a7!important;box-shadow:0 3px 0 #d8cbea!important}
.legacy-math-site:not([data-view=pong]) #app .practice-level-section{margin:0 0 22px!important}
.legacy-math-site:not([data-view=pong]) #app .math-difficulty{border-radius:24px!important;background:#f2eaff!important;border:2px solid #e6d8f7!important}
.legacy-math-site:not([data-view=pong]) #app .game-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:20px!important}
.legacy-math-site:not([data-view=pong]) #app .game-card{padding:19px!important;border:3px solid #fff!important;border-radius:27px!important;box-shadow:0 5px 0 #d6d1e6!important;min-width:0;display:flex!important;flex-direction:column!important;justify-content:space-between!important}
.legacy-math-site #app .game-card.addsub{background:linear-gradient(#fff1b8,#fff9e3)!important}.legacy-math-site #app .game-card.math{background:linear-gradient(#cfebff,#eef9ff)!important}.legacy-math-site #app .game-card.pong{background:linear-gradient(#f7cfe5,#fff0f6)!important}
.legacy-math-site:not([data-view=pong]) #app .menu-illustration{height:125px!important;min-height:0!important;position:relative!important;margin:0 0 12px!important}
.legacy-math-site:not([data-view=pong]) #app .menu-illustration img{position:relative!important;width:auto!important;height:122px!important;max-width:100%!important;object-fit:contain!important;inset:auto!important;margin:auto!important}
.legacy-math-site:not([data-view=pong]) #app .menu-badge{position:absolute!important;inset:4px auto auto 4px!important;z-index:2;font-size:18px!important;padding:6px!important}
.legacy-math-site:not([data-view=pong]) #app .game-card h3{font-size:24px!important;text-align:center!important;margin:6px 0 8px!important;overflow-wrap:normal!important;word-break:normal!important}
.legacy-math-site:not([data-view=pong]) #app .game-card p{font-size:16px!important;text-align:center!important;line-height:1.6!important;margin-bottom:15px!important}
.legacy-math-site:not([data-view=pong]) #app .math-mode-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px!important}
.legacy-math-site:not([data-view=pong]) #app .math-mode-actions button{width:100%!important;padding:10px 6px!important;font-size:17px!important;min-width:0!important}
.legacy-math-site:not([data-view=pong]) #app .panel{background:#fff!important;border:0!important;box-shadow:none!important;margin:0!important;padding:8px!important;width:100%!important}
.legacy-math-site:not([data-view=pong]) #app .quiz-mascot{height:120px!important;width:auto!important;object-fit:contain}
.legacy-math-site:not([data-view=pong]) #app .quiz-question{background:linear-gradient(110deg,#f7edff,#eef8ff);border-radius:24px;padding:18px;color:#583492}
.legacy-math-site:not([data-view=pong]) #app .answer{border:2px solid #ccb6e8;box-shadow:0 4px 0 #d7cbe9;background:#fff;color:#57369a}
.legacy-math-site:not([data-view=pong]) #app .answer.correct{background:#c9f1dc!important;border-color:#57b981!important}.legacy-math-site:not([data-view=pong]) #app .answer.wrong{background:#ffe3ed!important;border-color:#e68cac!important}
@media(max-width:900px){.legacy-math-site:not([data-view=pong]) #app .game-grid{grid-template-columns:1fr!important}.legacy-math-site:not([data-view=pong]) #app .game-card{padding:18px!important}.legacy-math-site #math-website-chrome .site-header{height:auto!important;min-height:102px!important}.legacy-math-site #math-website-chrome .header-inner{flex-wrap:wrap!important}}
@media(max-width:600px){.legacy-math-site:not([data-view=pong]) #app{width:calc(100% - 24px)!important;padding:15px!important;border-radius:27px!important}.legacy-math-site[data-view=home] #app{margin-top:-55px!important}.legacy-math-site #math-website-chrome .practice-title{font-size:40px!important}.legacy-math-site:not([data-view=pong]) #app .answers{gap:12px!important}.legacy-math-site:not([data-view=pong]) #app .answer{font-size:28px!important;padding:13px!important}.legacy-math-site #math-website-chrome .main-nav{width:100%!important}}
/* Old native-header centering must not translate the website navigation. */
html.math-v40[dir] body.legacy-math-site:not(.pong-landscape-active):not([data-view=pong])>header.site-header{display:none!important}
html.math-v40[dir] body.legacy-math-site #math-website-chrome .site-header{transform:none!important;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;margin:0!important}

/* Refined number-picker cards only; never apply to Pong or answer geometry. */
.legacy-math-site[data-view=choose] #app{max-width:850px!important;padding:28px 30px 32px!important}
.legacy-math-site[data-view=choose] #app .number-grid{width:min(560px,100%);margin:0 auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;direction:ltr}
.legacy-math-site[data-view=choose] #app .number-card{display:grid;place-items:center;min-height:74px!important;width:100%;padding:10px!important;font-size:32px;font-weight:850;line-height:1;border:2px solid #fff;border-radius:20px!important;color:white;background:linear-gradient(150deg,#9975e9,#7442c7);box-shadow:0 4px 0 #553195,0 9px 15px #8250c31a;transition:transform .15s,box-shadow .15s}
.legacy-math-site[data-view=choose] #app .number-card:nth-child(3n+2){background:linear-gradient(150deg,#54bfe8,#2387c1);box-shadow:0 4px 0 #15628e,0 9px 15px #237bac1a}
.legacy-math-site[data-view=choose] #app .number-card:nth-child(3n){background:linear-gradient(150deg,#e47aaa,#b94689);box-shadow:0 4px 0 #863163,0 9px 15px #b73e831a}
@media(hover:hover){.legacy-math-site[data-view=choose] #app .number-card:hover{transform:translateY(-2px)}}
.legacy-math-site[data-view=choose] #app .number-card:active{transform:translateY(2px)}
.legacy-math-site[data-view=choose] #app .section-title{margin:5px 0 20px!important}
.legacy-math-site[data-view=choose] #app .quiz-mascot{height:132px!important}
.legacy-math-site #math-website-chrome .back-button{display:inline-flex!important;align-items:center!important;justify-content:center;gap:9px;line-height:1.4}
.legacy-math-site #math-website-chrome .back-icon{display:block;width:20px;height:20px;flex:0 0 20px;transform:scaleX(1)!important}
html[dir=rtl] .legacy-math-site #math-website-chrome .back-icon{transform:scaleX(-1)!important}
@media(max-width:600px){.legacy-math-site[data-view=choose] #app{padding:18px 14px 24px!important}.legacy-math-site[data-view=choose] #app .number-grid{gap:12px}.legacy-math-site[data-view=choose] #app .number-card{min-height:64px!important;font-size:29px;border-radius:17px!important}}
@media(prefers-reduced-motion:reduce){.legacy-math-site[data-view=choose] #app .number-card{transition:none}}

/* The native header deliberately ignored pointer events except its old buttons.
   Restore interaction for the website header, not for any decorative sky layer. */
.legacy-math-site #math-website-chrome .site-header,
.legacy-math-site #math-website-chrome .main-nav{pointer-events:auto!important}
.legacy-math-site #math-website-chrome .main-nav a{pointer-events:auto!important;cursor:pointer!important}
.legacy-math-site .number-scope{border:0;padding:0;margin:16px auto 0;max-width:760px;text-align:center;min-width:0}
.legacy-math-site .number-scope legend{margin:auto;padding:0 12px 9px;font-weight:750;color:#544179}
.legacy-math-site .number-scope-options{display:flex;justify-content:center;gap:12px;flex-wrap:wrap}
.legacy-math-site .number-scope-option{display:flex;align-items:center;gap:9px;border:1px solid #dfd3ef;border-radius:17px;padding:11px 15px;background:white;cursor:pointer;font-size:15px;min-height:46px}
.legacy-math-site .number-scope-option.active{background:#f0e6ff;border-color:#986ed5;color:#603a9c}
.legacy-math-site .number-scope-option input{accent-color:#7443c3;flex:none}
.legacy-math-site .number-scope-option:focus-within{outline:3px solid #3899d6;outline-offset:3px}
/* Only the desktop operation-card group changes size/placement. */
@media(min-width:901px){
 .legacy-math-site[data-view=home] #app .game-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;max-width:960px;margin-inline:auto!important}
 .legacy-math-site[data-view=home] #app .game-card.addsub{grid-column:1!important;grid-row:1!important}
 .legacy-math-site[data-view=home] #app .game-card.math{grid-column:2!important;grid-row:1!important}
 .legacy-math-site[data-view=home] #app .game-card.pong{grid-column:1/-1!important;grid-row:2!important}
}
/* Scope is a second control row, never squeezed beside the level selector. */
.legacy-math-site:not([data-view=pong]) #app .practice-level-section{flex-direction:column!important;align-items:center!important;gap:12px!important}
.legacy-math-site .number-scope{width:100%;margin-top:0}
.legacy-math-site .number-scope legend{max-width:100%}
.legacy-math-site .number-scope-option{max-width:100%;min-width:0;text-align:start;line-height:1.5}
.legacy-math-site .number-scope-option span{min-width:0}
.legacy-math-site .number-scope-option input{width:16px;height:16px;margin:0;flex:0 0 16px}
.legacy-math-site:not([data-view=pong]) #app .math-difficulty{max-width:100%;min-width:0;flex-wrap:wrap}
.legacy-math-site .math-difficulty-buttons{min-width:0}
@media(max-width:360px){.legacy-math-site:not([data-view=pong]) #app .math-difficulty-buttons button{font-size:12px!important;padding:8px 6px!important;min-width:0}}
