.math-game .math-header-icon{width:40px;height:40px;object-fit:contain;flex:none}.math-icon-button{width:34px;height:34px;flex:none;border:1px solid #a350ed;border-radius:50%;background:#231047;color:white;font-size:16px;cursor:pointer}.math-session-notice,.math-fineprint{color:#cbd4ec;font-size:11px;line-height:1.45;text-align:center}.math-session-notice{padding:9px;margin:0 0 14px;border:1px solid #73569d;border-radius:8px;background:#21143b}.math-question-count{text-align:center;margin:13px 0 5px;color:#e3e8ff;font-size:12px}.math-progress{height:9px;border:1px solid #7479ba;border-radius:999px;overflow:hidden;background:#171a43}.math-progress i{display:block;height:100%;background:linear-gradient(90deg,#00badc,#8affed)}.math-game .play-answers button:not(:disabled){cursor:pointer}.math-game .play-answers .math-eliminated{opacity:.15}.math-feedback{min-height:1.5em;text-align:center;font-weight:700;color:#65f7ed}.math-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}.math-actions button,.math-actions a,.math-modal-close{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:9px 16px;border:1px solid #bc5bed;border-radius:999px;background:#291052;color:white;font:inherit;font-size:13px;font-weight:700;text-decoration:none;cursor:pointer}.math-actions button:disabled{opacity:.5;cursor:not-allowed}.math-actions button:focus-visible,.math-actions a:focus-visible,.math-icon-button:focus-visible,.math-game .play-answers button:focus-visible{outline:3px solid #54eefa;outline-offset:3px}.math-result-card{text-align:center}.math-result-card>span{font-size:55px}.math-result-card h1{margin:12px 0;font-size:28px}.math-result-card p{color:#e3e5fa;font-size:14px}.math-result-card .math-actions{margin-top:18px}.math-settings{width:min(90vw,420px);padding:24px;border:1px solid #c259ff;border-radius:16px;background:#10143d;color:#fff;box-shadow:0 0 28px #9d29e2}.math-settings::backdrop{background:#03051acb}.math-settings p{font-size:13px;color:#dae2fa}.math-modal-close{width:100%;margin-top:12px}.math-fineprint{margin:20px 0 0}@media(max-width:480px){.math-game .play-header{gap:5px}.math-game .math-header-icon{width:26px;height:26px}.math-game .play-game-name{font-size:12px}.math-icon-button{width:28px;height:28px}.math-game .play-balances span{font-size:9px;padding:4px}.math-game .play-content{padding:16px}.math-game .play-question{min-height:80px;margin:14px 0}.math-game .play-answers{gap:8px}.math-game .play-answers button{min-height:48px}.math-result-card p{font-size:12px}}
.math-ad-options{margin-top:10px}.math-ad-options button{font-size:10px;min-height:34px}
.math-mode-select{text-align:center}.math-mode-select h1{margin:12px 0;font-size:25px}.math-mode-select p{color:#d7def4;font-size:12px;line-height:1.5}.math-mode-grid{display:grid;gap:10px;margin:20px 0}.math-mode-grid button{display:flex;flex-direction:column;gap:5px;min-height:72px;padding:13px;border:1px solid #a94de3;border-radius:13px;background:linear-gradient(100deg,#172b65,#32105b);color:white;text-align:left;font:inherit;cursor:pointer}.math-mode-grid button:hover{border-color:#3de8f0}.math-mode-grid button:focus-visible{outline:3px solid #55ecf4;outline-offset:3px}.math-mode-grid strong{font-size:17px}.math-mode-grid small,.math-mode-grid span{color:#dbe5fa;font-size:11px}.math-mode-grid span{color:#fee36a}
.math-mode-grid button .math-mode-action{align-self:flex-end;padding:5px 11px;border:1px solid #ffdc69;border-radius:999px;background:linear-gradient(#ffe351,#f5a800);color:#1b1530;font-size:11px;font-weight:800}
.math-mode-grid button:disabled{opacity:.6;cursor:not-allowed;filter:saturate(.65)}

/* Mode select — game-style redesign */
.math-mode-select .mm-title{margin:6px 0 18px;font-size:clamp(24px,5vw,30px);letter-spacing:.01em;background:linear-gradient(90deg,#fff,#c9b6ff);-webkit-background-clip:text;background-clip:text;color:transparent}
.mm-online-slot:empty{display:none}
.math-mode-select .mm-featured{position:relative;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:14px;width:100%;min-height:96px;padding:18px 18px 18px 20px;border:2px solid #22d3ee;border-radius:18px;background:radial-gradient(circle at 12% 50%,#22d3ee33,transparent 45%),linear-gradient(115deg,#0b3a7a,#3b0f7a 70%,#5b0f8f);box-shadow:0 0 0 1px #22d3ee33,0 10px 30px #22d3ee22,inset 0 0 24px #22d3ee22;color:#fff;text-align:left;font:inherit;cursor:pointer;transition:transform .15s,box-shadow .15s}
.math-mode-select .mm-featured:hover{transform:translateY(-2px);box-shadow:0 0 0 1px #22d3ee66,0 14px 34px #22d3ee44,inset 0 0 24px #22d3ee33}
.math-mode-select .mm-featured:focus-visible{outline:3px solid #55ecf4;outline-offset:3px}
.mm-featured .mm-icon{display:grid;place-items:center;width:54px;height:54px;border-radius:14px;background:#ffffff14;border:1px solid #ffffff2a;font-size:30px}
.mm-featured-text strong{display:block;font-size:20px;font-weight:800}
.mm-featured-text small{display:block;margin-top:3px;color:#bfe9ff;font-size:12px}
.mm-badge{position:absolute;top:-10px;left:18px;padding:2px 9px;border-radius:99px;background:#22c55e;color:#04210f;font-size:10px;font-weight:900;letter-spacing:.08em;box-shadow:0 0 12px #22c55e88}
.math-mode-select .mm-featured .math-mode-action{padding:10px 16px;border:1px solid #ffdc69;border-radius:999px;background:linear-gradient(#ffe351,#f5a800);color:#1b1530;font-size:13px;font-weight:900;white-space:nowrap;box-shadow:0 4px 14px #f5a80055}
.mm-divider{display:flex;align-items:center;gap:12px;margin:22px 0 12px;color:#9aa6cf;font-size:11px;font-weight:800;letter-spacing:.18em;text-transform:uppercase}
.mm-divider::before,.mm-divider::after{content:'';flex:1;height:1px;background:linear-gradient(90deg,transparent,#5b3d93,transparent)}
.math-mode-grid.mm-tiles{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0}
.math-mode-grid.mm-tiles .mm-tile{position:relative;align-items:center;justify-content:center;gap:4px;min-height:150px;padding:16px 8px 14px;border-radius:16px;text-align:center;transition:transform .15s,border-color .15s}
.math-mode-grid.mm-tiles .mm-tile:not(:disabled):hover{transform:translateY(-2px)}
.mm-tile .mm-icon{display:grid;place-items:center;width:52px;height:52px;margin-bottom:6px;border-radius:50%;font-size:26px;background:#ffffff12;border:1px solid #ffffff22}
.math-mode-grid.mm-tiles .mm-tile strong{font-size:17px;font-weight:800}
.math-mode-grid.mm-tiles .mm-tile small{color:#c6d0ee;font-size:11px}
.math-mode-grid.mm-tiles .mm-easy{border-color:#22c55e;background:radial-gradient(circle at 50% 22%,#22c55e33,transparent 55%),linear-gradient(160deg,#0f3b3a,#141b52);box-shadow:inset 0 0 18px #22c55e22}
.math-mode-grid.mm-tiles .mm-moderate{border-color:#6b5a2e;background:linear-gradient(160deg,#2a2440,#181a3d)}
.math-mode-grid.mm-tiles .mm-hard{border-color:#6b2e3a;background:linear-gradient(160deg,#2c1f3d,#181a3d)}
.math-mode-grid.mm-tiles .mm-tile:disabled{opacity:.55;filter:grayscale(.5)}
.math-mode-grid.mm-tiles .mm-tile .math-mode-action{align-self:center;margin-top:8px;padding:6px 16px;font-size:12px}
.math-mode-select .mm-note{margin:14px 0 0;color:#8f9bc4;font-size:11px}
.math-session-notice{display:inline-block;padding:5px 12px;border-radius:99px;border-color:#4b3a75;font-size:11px}
.play-content>.math-session-notice{display:block;width:fit-content;margin:0 auto 14px}
@media(max-width:420px){.math-mode-select .mm-featured{grid-template-columns:auto 1fr;padding:16px}.math-mode-select .mm-featured .math-mode-action{grid-column:1/-1;justify-self:stretch;text-align:center}.math-mode-grid.mm-tiles{gap:7px}.math-mode-grid.mm-tiles .mm-tile{min-height:128px;padding:12px 4px}.mm-tile .mm-icon{width:42px;height:42px;font-size:21px}.math-mode-grid.mm-tiles .mm-tile strong{font-size:14px}}
/* Online lobby (Math Rush is online-only) */
.mm-lobby .mm-level{margin:0 auto 16px;padding:14px 16px;border:1px solid #4b3a75;border-radius:16px;background:linear-gradient(120deg,#171e55,#2a0f55)}
.mm-level-row{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-bottom:8px}
.mm-level-row strong{font-size:20px;font-weight:900}
.mm-level-row span{color:#c6d0ee;font-size:12px}
.mm-level-bar{height:10px;border-radius:99px;background:#0d1238;overflow:hidden;border:1px solid #3a2d63}
.mm-level-bar i{display:block;height:100%;min-width:4px;border-radius:99px;background:linear-gradient(90deg,#22d3ee,#a855f7);box-shadow:0 0 10px #22d3ee88}
.mm-lobby .mm-tiles .mm-tile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:130px;padding:14px 8px;border:1px solid #3a2d63;border-radius:16px;color:#fff;text-align:center}
.mm-lobby .mm-tiles .mm-tile.is-locked{opacity:.5;filter:grayscale(.5)}
.mm-lobby .mm-tiles .mm-tile.is-current{border:2px solid #22d3ee;box-shadow:0 0 18px #22d3ee44,inset 0 0 16px #22d3ee22}
.mm-lobby .mm-tiles .mm-tile strong{font-size:16px;font-weight:800}
.mm-lobby .mm-tiles .mm-tile small{color:#c6d0ee;font-size:11px}
.mm-lobby-actions{margin-top:18px}
.mm-play{display:inline-flex;align-items:center;justify-content:center;width:100%;min-height:56px;padding:12px 20px;border:1px solid #ffdc69;border-radius:999px;background:linear-gradient(#ffe351,#f5a800);color:#1b1530;font:inherit;font-size:18px;font-weight:900;letter-spacing:.02em;text-decoration:none;cursor:pointer;box-shadow:0 6px 20px #f5a80055;transition:transform .15s}
.mm-play:hover:not(:disabled){transform:translateY(-2px)}
.mm-play:disabled{opacity:.55;cursor:not-allowed}
.math-online .math-result-card .mm-play{width:auto;min-width:220px}
@media(max-width:420px){.mm-lobby .mm-tiles .mm-tile{min-height:112px;padding:10px 4px}.mm-play{font-size:16px;min-height:52px}}

/* Rewarded ad buttons (placeholder until Ad Manager approval) */
.mm-rewarded{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}
.mm-reward-btn{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid #6d4bb0;border-radius:14px;background:linear-gradient(120deg,#22184d,#2d1460);color:#fff;font:inherit;text-align:left;cursor:pointer}
.mm-reward-btn:disabled{opacity:.6;cursor:not-allowed}
.mm-reward-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:#ffffff14;font-size:18px}
.mm-reward-text strong{display:block;font-size:14px}
.mm-reward-text small{display:block;color:#b9b4d6;font-size:11px}
.math-result-card+.mm-rewarded,.math-result-card .mm-rewarded{margin:12px auto 0;max-width:420px}
@media(max-width:380px){.mm-rewarded{grid-template-columns:1fr}}

/* Contextual watch-ad buttons */
.mm-lobby-actions{display:grid;gap:10px;justify-items:center}
.mm-lobby-actions .mld-watch-ad.mm-watch-main{width:100%;justify-content:center}
.math-online .math-actions .mld-watch-ad{margin:0}
.math-result-card .mld-watch-ad.mm-watch-main{min-width:260px;justify-content:center;margin-bottom:6px}
.math-result-card .math-actions{display:flex;flex-direction:column;align-items:center;gap:10px}
.math-result-card .mm-secondary{background:transparent;border-color:#5b3d93}
.mm-rewarded{display:flex;justify-content:center;margin-top:12px}

/* Level / XP / coins */
.mm-xp{margin:-6px auto 16px;padding:10px 14px;border:1px solid #6b4d18;border-radius:14px;background:linear-gradient(120deg,#2b1f08,#1d1440)}
.mm-xp-row{display:flex;justify-content:space-between;gap:10px;align-items:baseline;margin-bottom:6px}
.mm-xp-row strong{color:#fde68a;font-size:15px}.mm-xp-row span{color:#e7d9b0;font-size:12px}
.mm-xp-bar{height:8px;border-radius:99px;background:#140f2e;overflow:hidden}.mm-xp-bar i{display:block;height:100%;min-width:3px;border-radius:99px;background:linear-gradient(90deg,#facc15,#f97316)}
.mm-reward-pop{display:grid;gap:4px;margin:4px auto 12px;padding:12px 18px;border:1px solid #facc15;border-radius:14px;background:linear-gradient(120deg,#3b2a05,#2a1352);color:#fef3c7;box-shadow:0 0 18px #facc1544}
.mm-reward-pop strong{font-size:16px}.mm-levelup{color:#4ade80;font-weight:800}

/* Guest / online choice */
.mm-choose{display:grid;gap:12px}
.mm-choose h1{margin:0 0 6px}
.mm-choice{display:flex;align-items:center;gap:14px;width:100%;padding:16px 18px;border-radius:16px;border:1px solid #4b3a75;background:linear-gradient(120deg,#171e55,#2a0f55);color:#fff;font:inherit;text-align:left;text-decoration:none;cursor:pointer;transition:transform .15s}
.mm-choice:hover{transform:translateY(-2px)}
.mm-choice-online{border:2px solid #22d3ee;box-shadow:0 0 16px #22d3ee33}
.mm-choice-icon{display:grid;place-items:center;flex:none;width:48px;height:48px;border-radius:14px;background:#ffffff14;font-size:26px}
.mm-choice-text strong{display:block;font-size:17px}.mm-choice-text small{display:block;color:#c6d0ee;font-size:12px;margin-top:2px}
.mm-guest-cta{display:block;margin-top:14px;color:#7dd3fc;font-size:13px;text-decoration:none}
.mm-guest-reset{display:block;margin:10px auto 0;padding:6px 12px;border:1px solid #4b3a75;border-radius:999px;background:transparent;color:#b9b4d6;font:inherit;font-size:12px;cursor:pointer}
.mm-levels{display:grid;gap:8px;margin:-6px auto 16px}.mm-levels .mm-xp{margin:0}.mm-xp-game{border-color:#1d6b8a;background:linear-gradient(120deg,#08283b,#1d1440)}.mm-xp-game .mm-xp-row strong{color:#7dd3fc}.mm-xp-game .mm-xp-bar i{background:linear-gradient(90deg,#22d3ee,#6366f1)}.mm-gamexp{margin:0 0 10px;color:#7dd3fc;font-weight:800}
