:root{font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#172033;background:#f6f8fc}*{box-sizing:border-box}body{margin:0}.mobile-games-body{min-height:100vh;background:linear-gradient(180deg,#eef4ff 0,#f8fafc 42%,#f5f7fb 100%)}button,input,select{font:inherit}.mg-topbar{position:sticky;top:0;z-index:20;display:flex;justify-content:space-between;align-items:center;padding:14px max(16px,env(safe-area-inset-left));background:rgba(255,255,255,.94);border-bottom:1px solid #dce4f2;backdrop-filter:blur(12px);font-weight:800}.mg-brand{font-size:1.25rem;text-decoration:none;color:#172033}.mg-brand span{color:#f97316}.mg-shell{width:min(1120px,100%);margin:auto;padding:18px clamp(14px,3vw,32px) 56px}.mg-hero{display:grid;grid-template-columns:1.6fr .8fr;gap:18px;align-items:center;padding:26px;border-radius:24px;background:#172033;color:white;box-shadow:0 14px 40px rgba(30,41,59,.12)}.mg-hero h1{font-size:clamp(2rem,5vw,3.5rem);line-height:1;margin:.15em 0}.mg-hero p{line-height:1.55;color:#dbe7ff}.mg-eyebrow{margin:0 0 6px;font-size:.77rem;font-weight:900;letter-spacing:.11em;text-transform:uppercase}.mg-privacy{display:flex;flex-direction:column;gap:7px;padding:18px;border-radius:18px;background:rgba(255,255,255,.09)}.mg-privacy span{font-size:.9rem;line-height:1.45;color:#dbe7ff}.mg-notice{margin:18px 0;padding:16px;border-radius:16px;display:flex;flex-direction:column;gap:4px}.mg-notice.error{background:#fff0f0;border:1px solid #fecaca;color:#991b1b}.mg-profile-card,.mg-level-picker,.mg-game-section,.mg-board-section{margin-top:18px;padding:20px;border-radius:22px;background:white;border:1px solid #e2e8f0;box-shadow:0 8px 24px rgba(15,23,42,.05)}.mg-profile-summary{display:flex;justify-content:space-between;gap:14px;align-items:center}.mg-profile-summary>div{display:flex;align-items:center;gap:12px}.mg-level-icon{font-size:2.2rem}.mg-profile-summary small,.mg-profile-summary span{display:block;color:#64748b}.mg-profile-summary strong{display:block;font-size:1.2rem}.mg-profile-form{display:grid;grid-template-columns:1.4fr .8fr 1fr auto;gap:12px;align-items:end}.mg-form-heading{grid-column:1/-1;display:flex;justify-content:space-between}.mg-form-heading span{display:block;color:#64748b}.mg-profile-form label{display:flex;flex-direction:column;gap:5px;font-weight:800;font-size:.87rem}.mg-profile-form input,.mg-profile-form select,.mg-board-controls select{min-height:46px;padding:10px 12px;border:1px solid #cbd5e1;border-radius:12px;background:white}.mg-primary,.mg-small-button,.mg-result-actions button,.mg-order-answer button{min-height:44px;border:0;border-radius:12px;padding:10px 15px;font-weight:900;cursor:pointer}.mg-primary{background:#2563eb;color:white}.mg-small-button,.mg-result-actions button:not(.mg-primary),.mg-order-answer button:not(.mg-primary){background:#eef2ff;color:#334155}.mg-form-message{grid-column:1/-1;margin:0;color:#b91c1c}.mg-dashboard{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;margin-top:14px}.mg-dashboard article{padding:14px;border-radius:16px;background:white;border:1px solid #e2e8f0;text-align:center}.mg-dashboard span{display:block;font-size:.78rem;color:#64748b}.mg-dashboard strong{display:block;font-size:1.35rem;margin-top:4px}.mg-level-picker{display:grid;grid-template-columns:.7fr 1.6fr;gap:18px;align-items:center}.mg-level-picker h2,.mg-section-title h2{margin:.1em 0}.mg-level-picker p{margin:.25em 0;color:#64748b}.mg-level-buttons{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.mg-level-buttons button{padding:14px;border:2px solid #e2e8f0;background:#f8fafc;border-radius:16px;text-align:left;cursor:pointer}.mg-level-buttons button.active{border-color:#2563eb;background:#eff6ff}.mg-level-buttons strong,.mg-level-buttons span,.mg-level-buttons small{display:block}.mg-level-buttons span,.mg-level-buttons small{color:#64748b;margin-top:2px}.mg-section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.mg-section-title>span{font-weight:800;color:#64748b}.mg-game-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.mg-game-card{display:grid;grid-template-columns:auto 1fr;gap:12px;align-items:start;min-height:154px;padding:16px;border:1px solid #e2e8f0;border-radius:18px;background:#fbfdff;text-align:left;cursor:pointer;transition:.16s transform,.16s box-shadow}.mg-game-card:hover{transform:translateY(-2px);box-shadow:0 10px 24px rgba(37,99,235,.1)}.mg-game-icon{font-size:2rem}.mg-game-card strong,.mg-game-card span{display:block}.mg-game-card span[lang=th]{font-size:.85rem;color:#64748b}.mg-game-card p{font-size:.86rem;line-height:1.4;color:#64748b}.mg-game-card i{grid-column:2;font-style:normal;font-weight:900;color:#2563eb}.mg-board-tabs{display:flex;gap:6px}.mg-board-tabs button{border:0;border-radius:999px;padding:8px 12px;background:#f1f5f9;font-weight:800}.mg-board-tabs button.active{background:#172033;color:white}.mg-board-controls{display:flex;gap:10px;margin-bottom:12px}.mg-board-controls select{flex:1}.mg-leaderboard{list-style:none;margin:0;padding:0;display:grid;gap:7px}.mg-leaderboard li{display:grid;grid-template-columns:48px 1fr auto auto;gap:10px;align-items:center;padding:11px 13px;border-radius:13px;background:#f8fafc}.mg-leaderboard li.empty{display:block;color:#64748b}.mg-rank{font-weight:900}.mg-board-name{font-weight:850}.mg-board-name small{display:block;color:#64748b}.mg-board-score{font-weight:950}.mg-play-overlay,.mg-result-overlay{position:fixed;inset:0;z-index:100;background:rgba(15,23,42,.74);display:grid;place-items:center;padding:14px}.mg-play-card,.mg-result-card{width:min(620px,100%);max-height:calc(100vh - 28px);overflow:auto;border-radius:24px;background:white;padding:18px;box-shadow:0 30px 90px rgba(0,0,0,.3)}.mg-play-head{display:grid;grid-template-columns:44px 1fr auto;gap:10px;align-items:center}.mg-close{width:42px;height:42px;border:0;border-radius:50%;font-size:1.6rem;background:#f1f5f9}.mg-play-head span,.mg-play-head strong{display:block}.mg-timer{display:flex;gap:5px;align-items:center;font-size:1.2rem}.mg-progress{height:8px;margin:14px 0;background:#e2e8f0;border-radius:99px;overflow:hidden}.mg-progress i{display:block;height:100%;background:#2563eb;width:0}.mg-question{padding:20px 8px;text-align:center}.mg-question h2{font-size:clamp(1.5rem,6vw,2.4rem);margin:.2em}.mg-question p{font-size:1rem;color:#64748b}.mg-listen-button{border:0;background:#eff6ff;border-radius:999px;padding:12px 18px;font-weight:900;color:#1d4ed8}.mg-answer-area{display:grid;grid-template-columns:1fr 1fr;gap:10px}.mg-answer{min-height:64px;padding:12px;border:2px solid #dbe3ee;border-radius:16px;background:white;font-weight:850;cursor:pointer}.mg-answer:active{transform:scale(.98)}.mg-order-answer{margin-top:12px;padding:12px;border-radius:14px;background:#f8fafc}.mg-order-answer>div{min-height:50px;padding:10px;border:1px dashed #94a3b8;border-radius:10px;margin-bottom:10px;font-weight:900}.mg-feedback{text-align:center;min-height:24px;font-weight:900}.mg-result-card{text-align:center}.mg-result-icon{font-size:3rem}.mg-result-score strong{font-size:3.5rem;display:block}.mg-result-score span{color:#64748b}.mg-xp-gain{font-size:1.3rem;font-weight:900;color:#2563eb}.mg-ranks{display:flex;justify-content:center;gap:16px;flex-wrap:wrap}.mg-result-actions{display:flex;gap:10px;justify-content:center;margin-top:18px}[hidden]{display:none!important}@media(max-width:800px){.mg-hero,.mg-level-picker{grid-template-columns:1fr}.mg-game-grid{grid-template-columns:1fr 1fr}.mg-dashboard{grid-template-columns:repeat(3,1fr)}.mg-profile-form{grid-template-columns:1fr 1fr}.mg-profile-form .mg-primary{grid-column:1/-1}.mg-form-message{grid-column:1/-1}}@media(max-width:520px){.mg-shell{padding:12px 10px 42px}.mg-topbar{font-size:.86rem}.mg-hero,.mg-profile-card,.mg-level-picker,.mg-game-section,.mg-board-section{padding:15px;border-radius:18px}.mg-game-grid{grid-template-columns:1fr}.mg-level-buttons{grid-template-columns:1fr}.mg-dashboard{grid-template-columns:1fr 1fr}.mg-profile-form{grid-template-columns:1fr}.mg-answer-area{grid-template-columns:1fr}.mg-leaderboard li{grid-template-columns:36px 1fr auto}.mg-leaderboard .mg-board-plays{display:none}.mg-board-controls{flex-direction:column}.mg-play-overlay,.mg-result-overlay{padding:0;align-items:end}.mg-play-card,.mg-result-card{border-radius:24px 24px 0 0;max-height:94vh;padding-bottom:max(18px,env(safe-area-inset-bottom))}}
/* V278.2 public-home, connectivity and kid-friendly mobile refinements. */
.mg-top-actions{display:flex;align-items:center;gap:10px}.mg-top-actions a{min-height:38px;display:inline-flex;align-items:center;padding:8px 12px;border-radius:999px;background:#eef2ff;color:#1e40af;text-decoration:none;font-weight:900}.mg-network{font-size:.78rem;font-weight:900;color:#15803d}.mg-network.offline{color:#b45309}.mg-hero-chips{display:flex;flex-wrap:wrap;gap:7px;margin-top:14px}.mg-hero-chips span{padding:7px 10px;border-radius:999px;background:rgba(255,255,255,.1);color:#e8f1ff;font-size:.78rem;font-weight:850}.mg-live-note{margin:11px 2px 0;color:#64748b;font-size:.8rem}.mg-live-dot{display:inline-block;width:8px;height:8px;margin-right:5px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 4px rgba(34,197,94,.12)}.mg-game-card:focus-visible,.mg-answer:focus-visible,.mg-level-buttons button:focus-visible,.mg-top-actions a:focus-visible{outline:3px solid #f59e0b;outline-offset:3px}.mg-game-card{touch-action:manipulation}.mg-answer{touch-action:manipulation;-webkit-tap-highlight-color:transparent}.mg-answer:disabled{opacity:.55}.mg-play-card[data-network-waiting="1"]::after{content:"Waiting for connection… / รออินเทอร์เน็ต…";display:block;margin-top:12px;padding:9px;border-radius:10px;background:#fff7ed;color:#9a3412;text-align:center;font-weight:900}.mg-toast{position:fixed;left:50%;bottom:max(18px,env(safe-area-inset-bottom));z-index:160;transform:translateX(-50%);max-width:min(92vw,520px);padding:11px 16px;border-radius:999px;background:#172033;color:#fff;font-weight:850;box-shadow:0 10px 30px rgba(15,23,42,.25)}
@media(max-width:620px){.mg-topbar{gap:8px}.mg-topbar-title{display:none}.mg-top-actions{margin-left:auto}.mg-top-actions a{font-size:.78rem;padding:7px 9px}.mg-network{font-size:.72rem}.mg-hero{padding-top:20px}.mg-hero h1{font-size:clamp(2rem,11vw,3rem)}.mg-game-card{min-height:126px}.mg-game-icon{font-size:2.4rem}.mg-game-card strong{font-size:1.08rem}.mg-game-card i{font-size:.9rem}}

/* V278.5 Thai-first, bilingual, clutter-free public Game Center. */
html[data-ui-lang="th"] [data-copy-en],
html[data-ui-lang="en"] [data-copy-th]{display:none!important}
.mg-topbar{min-height:58px;padding:8px max(10px,env(safe-area-inset-left)) 8px max(10px,env(safe-area-inset-right));gap:8px}
.mg-top-actions{gap:7px;margin-left:auto}.mg-network-dot{font-size:.72rem;color:#16a34a;line-height:1}.mg-network-dot.offline{color:#d97706}
.mg-language-toggle{display:inline-grid;grid-template-columns:1fr 1fr;padding:3px;border:1px solid var(--stroke,#dce4f2);border-radius:999px;background:var(--surface-soft,#f1f5f9)}
.mg-language-toggle button{min-width:42px;min-height:32px;border:0;border-radius:999px;padding:4px 8px;background:transparent;color:var(--muted,#64748b);font:inherit;font-size:.76rem;font-weight:900;cursor:pointer}
.mg-language-toggle button.active{background:var(--surface-solid,#fff);color:var(--text,#172033);box-shadow:0 2px 8px rgba(15,23,42,.08)}
.mg-classroom-link{min-height:36px!important;padding:7px 10px!important}.mg-shell{padding-top:10px}
.mg-home-head{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 4px 4px}.mg-home-head h1{margin:0;font-size:clamp(1.9rem,8vw,3rem);line-height:1}.mg-home-head .mg-eyebrow{margin-bottom:5px;color:var(--muted,#64748b)}.mg-home-subtitle{display:block;margin-top:5px;color:var(--muted,#64748b);font-size:.9rem;font-weight:800}.mg-home-icon{font-size:2.4rem}
.mg-profile-card,.mg-level-picker,.mg-game-section,.mg-board-section{margin-top:12px;padding:14px;border-radius:18px}.mg-profile-form{gap:9px}.mg-form-heading{align-items:center}.mg-form-heading>div>span{font-size:.78rem}.mg-dashboard{margin-top:10px;display:flex;gap:8px;overflow-x:auto;scroll-snap-type:x proximity;padding-bottom:2px}.mg-dashboard article{min-width:96px;flex:1 0 96px;padding:10px;scroll-snap-align:start}.mg-dashboard strong{font-size:1.15rem}.mg-dashboard span{font-size:.7rem}
.mg-level-picker{display:block}.mg-compact-heading{display:flex;align-items:end;justify-content:space-between;margin-bottom:9px}.mg-compact-heading .mg-eyebrow{display:none}.mg-compact-heading h2{font-size:1rem;margin:0}.mg-level-buttons{grid-template-columns:repeat(3,1fr);gap:7px}.mg-level-buttons button{min-height:70px;padding:9px 8px;text-align:center;border-radius:14px}.mg-level-buttons strong{font-size:.88rem}.mg-level-buttons span{font-size:.72rem}.mg-level-buttons small{font-size:.67rem}
.mg-section-title{margin-bottom:10px}.mg-section-title h2{font-size:1.15rem}.mg-section-title .mg-eyebrow{margin-bottom:2px}.mg-section-title>span{font-size:.78rem}.mg-game-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.mg-game-card{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-height:118px;padding:11px 8px;text-align:center;border-radius:16px}.mg-game-card:hover{transform:none}.mg-game-icon{font-size:2.25rem;line-height:1}.mg-game-card strong{font-size:.92rem;line-height:1.15}.mg-game-title-th{font-size:.74rem!important;line-height:1.2;color:var(--muted,#64748b)!important;margin-top:3px}.mg-game-card i,.mg-game-card p{display:none!important}
.mg-board-tabs{gap:4px}.mg-board-tabs button{padding:7px 9px;font-size:.76rem}.mg-board-controls{gap:7px;margin-bottom:9px}.mg-board-controls select{min-height:42px;padding:8px 9px}.mg-leaderboard{gap:5px}.mg-leaderboard li{padding:9px 10px}.mg-question{padding:14px 5px}.mg-question-th{margin:0 0 6px!important;color:var(--muted,#64748b)!important;font-weight:800}.mg-question h2{margin:.1em;font-size:clamp(1.4rem,7vw,2.2rem)}.mg-result-th{display:block;margin-top:-5px;color:var(--muted,#64748b);font-weight:800}
@media(min-width:700px){.mg-game-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.mg-game-card{min-height:132px}.mg-dashboard{display:grid;grid-template-columns:repeat(5,1fr);overflow:visible}.mg-dashboard article{min-width:0}.mg-level-picker{display:grid;grid-template-columns:.45fr 1.55fr}.mg-compact-heading{display:block;margin:0}.mg-compact-heading .mg-eyebrow{display:block}.mg-compact-heading h2{font-size:1.15rem}}
@media(min-width:1050px){.mg-game-grid{grid-template-columns:repeat(6,minmax(0,1fr))}}
@media(max-width:520px){.mg-shell{padding:8px 9px 34px}.mg-topbar{font-size:.82rem}.mg-brand{font-size:1.05rem}.mg-classroom-link span:not(:first-child){display:none!important}.mg-classroom-link{width:36px;padding:6px!important;justify-content:center}.mg-profile-card,.mg-level-picker,.mg-game-section,.mg-board-section{padding:12px;border-radius:16px}.mg-profile-form{grid-template-columns:1fr}.mg-form-heading{grid-column:1}.mg-level-buttons{grid-template-columns:repeat(3,1fr)}.mg-game-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.mg-board-controls{flex-direction:row}.mg-board-controls select{min-width:0}.mg-leaderboard li{grid-template-columns:32px 1fr auto}.mg-home-icon{font-size:2rem}.mg-home-head{padding-inline:2px}}

/* V278.6 game-first setup flow: no nickname/class/difficulty controls on the first screen. */
.mg-game-section{margin-top:8px}.mg-game-card{min-height:112px}.mg-board-section{margin-top:12px}
.mg-setup-overlay{position:fixed;inset:0;z-index:110;background:rgba(15,23,42,.74);display:grid;align-items:end;padding:0}
.mg-setup-card{width:100%;max-height:94vh;overflow:auto;background:var(--surface-solid,#fff);color:var(--text,#172033);border-radius:24px 24px 0 0;padding:16px 14px max(20px,env(safe-area-inset-bottom));box-shadow:0 -18px 60px rgba(15,23,42,.28)}
.mg-setup-head{display:grid;grid-template-columns:42px 1fr;align-items:center;gap:10px}.mg-setup-head h2{margin:2px 0 0;font-size:1.2rem}.mg-setup-head small{color:var(--muted,#64748b);font-weight:800}
.mg-player-row{display:flex;align-items:center;gap:12px;margin:14px 0;padding:12px;border-radius:16px;background:var(--surface-soft,#f8fafc)}.mg-player-avatar{display:grid;place-items:center;width:52px;height:52px;border-radius:16px;background:#fff;font-size:1.9rem;box-shadow:0 3px 12px rgba(15,23,42,.08)}.mg-player-row small,.mg-player-row strong,.mg-player-row span{display:block}.mg-player-row strong{font-size:1.08rem}.mg-bound-badge{margin-top:3px;color:#15803d;font-size:.7rem;font-weight:850}
.mg-player-form{display:grid;gap:14px}.mg-name-field>span,.mg-field-title{display:block;margin-bottom:7px;font-size:.78rem;font-weight:900;color:var(--muted,#64748b)}.mg-name-field>div{display:grid;grid-template-columns:1fr 46px;gap:7px}.mg-name-field input{width:100%;min-height:46px;border:1px solid var(--stroke,#dbe3ee);border-radius:13px;background:var(--surface-solid,#fff);color:var(--text,#172033);padding:10px 12px;font:inherit;font-weight:850}.mg-name-field button{border:1px solid var(--stroke,#dbe3ee);border-radius:13px;background:var(--surface-soft,#f8fafc);font-size:1.15rem}
.mg-avatar-picker>div{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}.mg-avatar-picker button{min-width:0;min-height:72px;border:2px solid var(--stroke,#dbe3ee);border-radius:14px;background:var(--surface-solid,#fff);color:var(--text,#172033);padding:7px 4px;cursor:pointer}.mg-avatar-picker button.active{border-color:#2563eb;background:#eff6ff}.mg-avatar-picker b{display:block;font-size:1.45rem;line-height:1}.mg-avatar-picker small{display:block;margin-top:5px;font-size:.62rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mg-setup-level .mg-level-buttons{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.mg-setup-level .mg-level-buttons button{min-height:68px;padding:8px 5px;text-align:center;border-radius:13px}.mg-start-button{width:100%;min-height:50px;border-radius:15px;font-size:1rem}.mg-form-message{min-height:18px;margin:0;color:#b91c1c;font-size:.78rem;font-weight:800}.mg-result-actions button{min-height:44px}
@media(min-width:680px){.mg-setup-overlay{align-items:center;padding:18px}.mg-setup-card{max-width:560px;margin:auto;border-radius:24px;padding:20px}.mg-avatar-picker>div{grid-template-columns:repeat(8,minmax(0,1fr))}.mg-game-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(min-width:1050px){.mg-game-grid{grid-template-columns:repeat(6,minmax(0,1fr))}}

/* V278.6.2 theme-contrast bridge for public Game Center.
   The Game Center predates the site-wide palette engine and historically used
   hard-coded light surfaces. Bind every public-game surface to the active
   Catchie theme so dark palettes never render light cards with light text. */
:root[data-theme] .mobile-games-body{
  background:var(--theme-gradient,var(--page-bg))!important;
  color:var(--theme-readable-text,var(--text))!important;
}
:root[data-theme] .mg-topbar{
  background:var(--surface)!important;
  border-color:var(--stroke)!important;
  color:var(--theme-readable-text,var(--text))!important;
  box-shadow:0 1px 0 color-mix(in srgb,var(--stroke) 72%,transparent);
}
:root[data-theme] .mg-brand{color:var(--theme-readable-text,var(--text))!important}
:root[data-theme] .mg-top-actions a,
:root[data-theme] .mg-language-toggle{
  background:var(--surface-soft)!important;
  color:var(--theme-readable-text,var(--text))!important;
  border-color:var(--stroke)!important;
}
:root[data-theme] .mg-language-toggle button{color:var(--theme-readable-muted,var(--muted))!important}
:root[data-theme] .mg-language-toggle button.active{
  background:var(--surface-solid)!important;
  color:var(--theme-readable-text,var(--text))!important;
  box-shadow:var(--shadow2)!important;
}
:root[data-theme] .mg-home-head,
:root[data-theme] .mg-home-head h1{color:var(--theme-readable-text,var(--text))!important}
:root[data-theme] .mg-home-head .mg-eyebrow,
:root[data-theme] .mg-home-subtitle,
:root[data-theme] .mg-section-title .mg-eyebrow,
:root[data-theme] .mg-section-title>span{
  color:var(--theme-readable-muted,var(--muted))!important;
  opacity:1!important;
}
:root[data-theme] .mg-profile-card,
:root[data-theme] .mg-level-picker,
:root[data-theme] .mg-game-section,
:root[data-theme] .mg-board-section,
:root[data-theme] .mg-play-card,
:root[data-theme] .mg-result-card,
:root[data-theme] .mg-setup-card{
  background:var(--card,var(--surface))!important;
  color:var(--theme-readable-text,var(--text))!important;
  border-color:var(--stroke)!important;
  box-shadow:var(--shadow)!important;
}
:root[data-theme] .mg-dashboard article,
:root[data-theme] .mg-game-card,
:root[data-theme] .mg-level-buttons button,
:root[data-theme] .mg-leaderboard li,
:root[data-theme] .mg-player-row,
:root[data-theme] .mg-order-answer{
  background:var(--surface-soft)!important;
  color:var(--theme-readable-text,var(--text))!important;
  border-color:var(--stroke)!important;
}
:root[data-theme] .mg-game-card:hover,
:root[data-theme] .mg-level-buttons button:hover,
:root[data-theme] .mg-avatar-picker button:hover,
:root[data-theme] .mg-answer:hover{
  background:var(--surface-solid)!important;
  border-color:var(--stroke-strong)!important;
  box-shadow:var(--shadow2)!important;
}
:root[data-theme] .mg-game-card strong,
:root[data-theme] .mg-board-name,
:root[data-theme] .mg-board-score,
:root[data-theme] .mg-rank,
:root[data-theme] .mg-play-head,
:root[data-theme] .mg-result-card,
:root[data-theme] .mg-player-row strong{
  color:var(--theme-readable-text,var(--text))!important;
}
:root[data-theme] .mg-game-title-th,
:root[data-theme] .mg-dashboard span,
:root[data-theme] .mg-level-buttons span,
:root[data-theme] .mg-level-buttons small,
:root[data-theme] .mg-board-name small,
:root[data-theme] .mg-leaderboard li.empty,
:root[data-theme] .mg-question p,
:root[data-theme] .mg-question-th,
:root[data-theme] .mg-result-th,
:root[data-theme] .mg-result-score span,
:root[data-theme] .mg-player-row small,
:root[data-theme] .mg-field-title,
:root[data-theme] .mg-name-field>span,
:root[data-theme] .mg-setup-head small{
  color:var(--theme-readable-muted,var(--muted))!important;
  opacity:1!important;
}
:root[data-theme] .mg-board-tabs button,
:root[data-theme] .mg-small-button,
:root[data-theme] .mg-result-actions button:not(.mg-primary),
:root[data-theme] .mg-order-answer button:not(.mg-primary),
:root[data-theme] .mg-close,
:root[data-theme] .mg-name-field button{
  background:var(--surface-muted)!important;
  color:var(--theme-readable-text,var(--text))!important;
  border-color:var(--stroke)!important;
}
:root[data-theme] .mg-board-tabs button.active,
:root[data-theme] .mg-primary,
:root[data-theme] .mg-start-button{
  background:linear-gradient(135deg,var(--theme-button-start,var(--primary)),var(--theme-button-end,var(--primary2)))!important;
  color:var(--theme-button-text,#fff)!important;
  border-color:transparent!important;
}
:root[data-theme] .mg-level-buttons button.active,
:root[data-theme] .mg-avatar-picker button.active{
  background:var(--primary-soft)!important;
  color:var(--theme-readable-text,var(--text))!important;
  border-color:var(--primary)!important;
  box-shadow:0 0 0 1px color-mix(in srgb,var(--primary) 42%,transparent)!important;
}
:root[data-theme] .mg-avatar-picker button,
:root[data-theme] .mg-answer,
:root[data-theme] .mg-name-field input,
:root[data-theme] .mg-board-controls select,
:root[data-theme] .mg-profile-form input,
:root[data-theme] .mg-profile-form select{
  background:var(--surface-solid)!important;
  color:var(--theme-readable-text,var(--text))!important;
  border-color:var(--stroke)!important;
}
:root[data-theme] .mg-player-avatar{
  background:var(--surface-muted)!important;
  color:var(--theme-readable-text,var(--text))!important;
  box-shadow:var(--shadow2)!important;
}
:root[data-theme] .mg-progress{background:var(--surface-muted)!important}
:root[data-theme] .mg-progress i{background:linear-gradient(90deg,var(--primary),var(--primary2))!important}
:root[data-theme] .mg-listen-button{
  background:var(--primary-soft)!important;
  color:var(--theme-link-text,var(--primary))!important;
  border:1px solid var(--stroke-strong)!important;
}
:root[data-theme] .mg-play-overlay,
:root[data-theme] .mg-result-overlay,
:root[data-theme] .mg-setup-overlay{background:var(--overlay)!important}
:root[data-theme] .mg-toast{
  background:var(--surface-solid)!important;
  color:var(--theme-readable-text,var(--text))!important;
  border:1px solid var(--stroke)!important;
  box-shadow:var(--shadow)!important;
}
:root[data-theme] .mg-notice.error{
  background:var(--bad-soft)!important;
  color:var(--theme-bad-text,var(--bad))!important;
  border-color:color-mix(in srgb,var(--bad) 50%,var(--stroke))!important;
}
:root[data-theme] .mg-bound-badge{color:var(--theme-good-text,var(--good))!important}
:root[data-theme] .mg-form-message{color:var(--theme-bad-text,var(--bad))!important}
.mg-course-card{text-decoration:none;color:inherit;box-sizing:border-box}.mg-course-card [data-copy-en]{font-size:.78rem;color:var(--mg-muted);font-weight:700}

/* V279.11 fullscreen leaderboard, mobile game-fill layout, compact footer and result leaderboard. */
.mg-home-footer{display:flex;justify-content:center;align-items:center;gap:5px;flex-wrap:wrap;padding:8px 12px max(10px,env(safe-area-inset-bottom));font-size:.68rem;line-height:1.3;color:var(--muted,#64748b);text-align:center}.mg-home-footer a{color:inherit;text-decoration:underline;text-underline-offset:2px}.mg-leaderboard-card{border-style:dashed}.mg-board-overlay{position:fixed;inset:0;z-index:120;background:rgba(15,23,42,.76);display:grid;place-items:center;padding:14px}.mg-board-card{width:min(760px,100%);height:min(92vh,900px);display:flex;flex-direction:column;overflow:hidden;border-radius:24px;background:var(--surface-solid,#fff);color:var(--text,#172033);padding:18px;box-shadow:0 30px 90px rgba(0,0,0,.3)}.mg-fullscreen-head{display:grid;grid-template-columns:44px 1fr;gap:10px;align-items:center;margin-bottom:10px}.mg-fullscreen-head h2,.mg-result-board-head h3{margin:.1em 0}.mg-board-card>.mg-board-tabs{align-self:flex-end;margin:-48px 0 12px}.mg-full-leaderboard{min-height:0;overflow:auto;overscroll-behavior:contain;padding-right:2px}.mg-result-card{width:min(760px,100%);text-align:left;display:flex;flex-direction:column}.mg-result-summary{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center}.mg-result-summary h2{margin:0}.mg-result-summary .mg-result-icon{font-size:2.35rem}.mg-result-summary .mg-result-score{text-align:right}.mg-result-summary .mg-result-score strong{font-size:2.5rem}.mg-result-stats{display:flex;gap:8px 14px;align-items:center;flex-wrap:wrap;margin:10px 0 12px;padding:10px 12px;border-radius:14px;background:var(--surface-soft,#f8fafc);font-size:.86rem}.mg-result-stats .mg-xp-gain{margin:0;font-size:1rem}.mg-result-board{display:flex;min-height:0;flex:1;flex-direction:column;padding-top:4px}.mg-result-board-head{display:flex;justify-content:space-between;align-items:end;gap:10px;margin-bottom:9px}.mg-result-board .mg-full-leaderboard{flex:1}.mg-result-actions{flex:0 0 auto;margin-top:12px}.mg-result-actions .mg-primary{min-width:150px}
:root[data-theme] .mg-board-card{background:var(--card,var(--surface))!important;color:var(--theme-readable-text,var(--text))!important;border:1px solid var(--stroke)!important;box-shadow:var(--shadow)!important}:root[data-theme] .mg-result-stats{background:var(--surface-soft)!important;color:var(--theme-readable-text,var(--text))!important}:root[data-theme] .mg-home-footer{color:var(--theme-readable-muted,var(--muted))!important}:root[data-theme] .mg-home-footer a{color:var(--theme-link-text,var(--primary))!important}:root[data-theme] .mg-board-overlay{background:var(--overlay)!important}
@media(max-width:680px){.mobile-games-body{min-height:100dvh}.mg-topbar{padding:9px max(10px,env(safe-area-inset-left));min-height:52px}.mg-shell{width:100%;min-height:calc(100dvh - 52px);padding:8px 7px 8px;display:flex;flex-direction:column}.mg-home-head{padding:2px 3px 5px}.mg-home-head h1{font-size:1.45rem}.mg-home-subtitle{font-size:.76rem}.mg-home-icon{font-size:1.8rem}.mg-game-section{flex:1;display:flex;flex-direction:column;margin-top:5px!important;padding:9px!important;border-radius:15px!important}.mg-game-section .mg-section-title{margin-bottom:8px}.mg-game-section .mg-section-title h2{font-size:1.05rem}.mg-game-grid{flex:1;grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-auto-rows:minmax(88px,1fr);gap:7px!important}.mg-game-card{display:flex!important;min-width:0;min-height:88px!important;height:100%;flex-direction:column;align-items:center;justify-content:center;gap:5px!important;padding:8px 5px!important;border-radius:14px!important;text-align:center!important}.mg-game-icon{font-size:1.65rem;line-height:1}.mg-game-card strong{font-size:.78rem;line-height:1.13}.mg-game-title-th,.mg-course-card [data-copy-en]{font-size:.64rem!important;line-height:1.15;margin-top:3px}.mg-home-footer{padding:5px 8px max(7px,env(safe-area-inset-bottom));font-size:.6rem}.mg-play-overlay,.mg-result-overlay,.mg-board-overlay{padding:0!important;place-items:stretch!important;align-items:stretch!important}.mg-play-card,.mg-result-card,.mg-board-card{width:100%!important;height:100dvh!important;max-height:none!important;border-radius:0!important;padding:12px 11px max(12px,env(safe-area-inset-bottom))!important}.mg-play-card{display:flex;flex-direction:column}.mg-play-card .mg-answer-area{flex:1}.mg-board-card>.mg-board-tabs{align-self:stretch;margin:0 0 9px}.mg-board-tabs{display:grid!important;grid-template-columns:1fr 1fr}.mg-board-tabs button{min-height:40px}.mg-board-controls{display:grid!important;grid-template-columns:1fr 1fr;gap:7px!important;margin-bottom:8px}.mg-board-controls select{min-width:0;min-height:42px}.mg-leaderboard li{grid-template-columns:34px minmax(0,1fr) auto auto!important;gap:6px!important;padding:9px 8px!important}.mg-board-name{min-width:0;overflow:hidden;text-overflow:ellipsis}.mg-board-plays{font-size:.7rem}.mg-result-summary{grid-template-columns:auto 1fr auto;gap:8px}.mg-result-summary .mg-result-icon{font-size:2rem}.mg-result-summary h2{font-size:1.15rem}.mg-result-summary .mg-result-score strong{font-size:2rem}.mg-result-stats{margin:7px 0 8px;padding:8px;font-size:.74rem}.mg-result-board-head{align-items:center}.mg-result-board-head h3{font-size:.88rem}.mg-result-board-head .mg-board-tabs{display:flex!important}.mg-result-board-head .mg-board-tabs button{min-height:34px;padding:6px 9px}.mg-result-actions{display:grid;grid-template-columns:1.2fr .8fr;gap:7px;position:sticky;bottom:0;padding-top:8px;background:inherit}.mg-result-actions button{width:100%;min-width:0}.mg-setup-level .mg-level-buttons{grid-template-columns:repeat(2,minmax(0,1fr))!important}.mg-setup-level .mg-level-buttons button{min-height:62px!important}.mg-setup-level .mg-level-buttons strong{font-size:.74rem}}
@media(max-width:350px){.mg-game-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.mg-game-card{min-height:86px!important}.mg-leaderboard li{grid-template-columns:31px minmax(0,1fr) auto!important}.mg-board-plays{display:none}}

/* V279.20 fantasy quest-map stage path with grouped clusters, decorative connectors, and auto-start on unlocked stage tap. */
.mg-setup-screen{display:grid;gap:14px}.mg-step-note{margin-top:-4px}.mg-stage-screen{gap:12px}.mg-stage-screen-head{position:relative;display:grid;gap:10px;padding:16px 16px 18px;border-radius:26px;background:linear-gradient(145deg,rgba(37,99,235,.22),rgba(99,102,241,.18) 45%,rgba(168,85,247,.18));border:1px solid rgba(129,140,248,.26);box-shadow:0 18px 38px rgba(30,41,59,.18),inset 0 1px 0 rgba(255,255,255,.18);overflow:hidden;isolation:isolate}.mg-stage-screen-head::before,.mg-stage-screen-head::after{content:"";position:absolute;border-radius:999px;pointer-events:none;z-index:0}.mg-stage-screen-head::before{width:180px;height:180px;right:-40px;top:-40px;background:radial-gradient(circle,rgba(129,140,248,.38) 0,rgba(129,140,248,.08) 42%,transparent 68%)}.mg-stage-screen-head::after{width:120px;height:120px;left:-18px;bottom:-22px;background:radial-gradient(circle,rgba(34,211,238,.26) 0,rgba(34,211,238,.05) 45%,transparent 72%)}.mg-stage-screen-head>*{position:relative;z-index:1}.mg-stage-screen-copy{display:grid;gap:4px}.mg-stage-screen-copy .mg-field-title{margin:0;letter-spacing:.02em}.mg-stage-screen-copy strong{font-size:1.04rem;font-weight:950;color:var(--text,#172033)}.mg-stage-screen-tip{margin:0;color:var(--muted,#5b6780);font-size:.72rem;line-height:1.45;font-weight:700}.mg-stage-back{justify-self:start;display:inline-flex;align-items:center;gap:8px;padding:9px 13px;border:1px solid rgba(255,255,255,.22);border-radius:999px;background:linear-gradient(180deg,rgba(255,255,255,.78),rgba(255,255,255,.56));backdrop-filter:blur(8px);color:var(--text,#172033);font-weight:900;cursor:pointer;box-shadow:0 10px 20px rgba(15,23,42,.12)}.mg-stage-band-pill{justify-self:start;display:inline-flex;align-items:center;gap:8px;padding:9px 13px;border-radius:999px;background:linear-gradient(90deg,#6366f1,#8b5cf6);color:#eef2ff;font-weight:950;box-shadow:0 10px 26px rgba(79,70,229,.28),inset 0 1px 0 rgba(255,255,255,.14)}
.mg-stage-grid.mg-stage-path{position:relative;display:grid;gap:12px;padding:14px 10px;border-radius:30px;background:linear-gradient(180deg,rgba(14,21,38,.18),rgba(29,42,79,.14));border:1px solid rgba(148,163,184,.24);overflow:hidden;isolation:isolate;box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 18px 42px rgba(15,23,42,.14)}.mg-stage-grid.mg-stage-path::before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 10% 12%,rgba(255,255,255,.12) 0 14px,transparent 15px),radial-gradient(circle at 90% 22%,rgba(255,255,255,.1) 0 12px,transparent 13px),radial-gradient(circle at 22% 76%,rgba(167,139,250,.16) 0 20px,transparent 21px),radial-gradient(circle at 78% 68%,rgba(34,211,238,.14) 0 18px,transparent 19px);pointer-events:none}.mg-stage-grid.mg-stage-path::after{content:"";position:absolute;inset:20px 18px;background:linear-gradient(180deg,transparent,rgba(129,140,248,.09),transparent);pointer-events:none;opacity:.85}.mg-stage-group{position:relative;display:grid;gap:12px;padding:14px 12px;border-radius:24px;background:linear-gradient(180deg,rgba(244,247,255,.94),rgba(223,231,255,.88));border:1px solid rgba(165,180,252,.22);box-shadow:0 12px 28px rgba(48,63,120,.14),inset 0 1px 0 rgba(255,255,255,.88)}.mg-stage-group::before{content:"";position:absolute;inset:0;border-radius:24px;background:radial-gradient(circle at 14% 18%,rgba(255,255,255,.42) 0 16px,transparent 17px),radial-gradient(circle at 84% 22%,rgba(255,255,255,.26) 0 12px,transparent 13px),linear-gradient(145deg,transparent,rgba(129,140,248,.05));pointer-events:none}.mg-stage-group.is-current{border-color:#c4b5fd;box-shadow:0 0 0 2px rgba(167,139,250,.18),0 18px 36px rgba(99,102,241,.18),0 0 28px rgba(139,92,246,.14)}.mg-stage-group.is-complete{border-color:#6ee7b7;box-shadow:0 0 0 2px rgba(110,231,183,.16),0 18px 34px rgba(16,185,129,.16),0 0 22px rgba(16,185,129,.12)}.mg-stage-group.is-locked{opacity:.85;filter:saturate(.76)}.mg-stage-group-head{display:flex;align-items:center;gap:10px}.mg-stage-group-badge{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;border-radius:16px;background:linear-gradient(180deg,#6366f1,#8b5cf6);color:#fff;font-size:1.3rem;box-shadow:0 12px 22px rgba(99,102,241,.24),inset 0 1px 0 rgba(255,255,255,.22)}.mg-stage-group-head strong{display:block;font-size:.96rem;font-weight:950;color:#18233a}.mg-stage-group-head small{display:block;font-size:.7rem;line-height:1.3;color:#52617d;font-weight:800}.mg-stage-group-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.mg-stage-connector{position:relative;display:grid;grid-template-columns:18px 1fr auto 1fr 18px;align-items:center;gap:8px;min-height:50px;padding:0 8px}.mg-stage-road-dot{width:12px;height:12px;border-radius:999px;background:linear-gradient(180deg,#fef08a,#f59e0b);box-shadow:0 0 0 5px rgba(245,158,11,.12),0 0 18px rgba(245,158,11,.26)}.mg-stage-road-line{height:8px;border-radius:999px;background:linear-gradient(90deg,rgba(148,163,184,.58),rgba(100,116,139,.76));box-shadow:inset 0 1px 0 rgba(255,255,255,.16)}.mg-stage-road-character{display:grid;place-items:center;min-width:54px;height:54px;padding:0 10px;border-radius:18px;background:linear-gradient(180deg,rgba(255,255,255,.9),rgba(224,231,255,.92));border:1px solid rgba(129,140,248,.22);font-size:1.55rem;box-shadow:0 12px 24px rgba(48,63,120,.14);animation:mgRoadFloat 2.8s ease-in-out infinite}.mg-stage-connector.is-open .mg-stage-road-line{background:linear-gradient(90deg,#38bdf8,#8b5cf6,#f472b6);box-shadow:0 0 16px rgba(129,140,248,.26)}.mg-stage-connector.is-open .mg-stage-road-character{box-shadow:0 0 0 2px rgba(129,140,248,.12),0 14px 26px rgba(99,102,241,.22),0 0 20px rgba(34,211,238,.16)}.mg-stage-connector.is-locked .mg-stage-road-line{opacity:.58}.mg-stage-connector.is-locked .mg-stage-road-character{filter:grayscale(.18);opacity:.88}
.mg-stage-grid button{position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0;min-height:96px;padding:12px 5px 15px;border:2px solid rgba(165,180,252,.7);border-radius:28px;background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(230,238,255,.92));color:#1f2a44;font-weight:900;cursor:pointer;transition:transform .22s ease,box-shadow .22s ease,border-color .22s ease,filter .22s ease,opacity .18s ease;box-shadow:0 8px 20px rgba(79,70,229,.12),inset 0 1px 0 rgba(255,255,255,.85);overflow:hidden}.mg-stage-grid button::before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 28% 20%,rgba(255,255,255,.42) 0 16px,transparent 17px),radial-gradient(circle at 80% 82%,rgba(255,255,255,.18) 0 14px,transparent 15px);pointer-events:none;opacity:.9}.mg-stage-grid button::after{content:"";position:absolute;inset:-7px;border-radius:32px;border:2px solid transparent;opacity:0;transition:opacity .22s ease,transform .22s ease;pointer-events:none}.mg-stage-grid button:not(:disabled):hover{transform:translateY(-2px) scale(1.02);box-shadow:0 16px 34px rgba(79,70,229,.18)}.mg-stage-grid button:not(:disabled):active{transform:translateY(1px) scale(.985)}.mg-stage-icon{display:grid;place-items:center;width:28px;height:28px;border-radius:999px;background:rgba(99,102,241,.12);font-size:1rem;box-shadow:inset 0 1px 0 rgba(255,255,255,.55)}.mg-stage-grid button.playable{border-color:#7c93ff;background:linear-gradient(180deg,#edf2ff,#dce7ff);box-shadow:0 12px 26px rgba(99,102,241,.16),0 0 0 1px rgba(99,102,241,.08) inset}.mg-stage-grid button.playable::after{opacity:1;border-color:rgba(129,140,248,.35)}.mg-stage-grid button.playable .mg-stage-number{color:#334155}.mg-stage-grid button.playable .mg-stage-status::before{content:"✨";font-size:.82rem}.mg-stage-grid button.playable:hover .mg-stage-status{transform:scale(1.08)}.mg-stage-number{display:block;font-size:1.8rem;line-height:1;font-weight:980;text-shadow:0 1px 0 rgba(255,255,255,.55);font-family:ui-rounded,"Trebuchet MS",system-ui,sans-serif;letter-spacing:.02em}.mg-stage-caption{display:block;font-size:.64rem;line-height:1.1;font-weight:850;opacity:.86;letter-spacing:.03em}.mg-stage-status{position:absolute;right:8px;top:8px;width:25px;height:25px;border-radius:999px;display:grid;place-items:center;background:rgba(79,70,229,.12);box-shadow:inset 0 0 0 1px rgba(79,70,229,.12);transition:transform .2s ease}.mg-stage-status::before{content:"●";font-size:.8rem;color:#6366f1}.mg-stage-grid button.complete{border-color:#10b981;background:linear-gradient(180deg,#6ee7b7,#10b981);color:#ecfeff;box-shadow:0 18px 34px rgba(16,185,129,.24),0 0 24px rgba(16,185,129,.18)}.mg-stage-grid button.complete .mg-stage-icon{background:rgba(236,253,245,.18)}.mg-stage-grid button.complete::after{opacity:1;border-color:rgba(254,240,138,.48);box-shadow:0 0 0 3px rgba(254,240,138,.12)}.mg-stage-grid button.complete .mg-stage-status{background:rgba(236,253,245,.22);box-shadow:inset 0 0 0 1px rgba(236,253,245,.24)}.mg-stage-grid button.complete .mg-stage-status::before{content:"★";color:#fef08a}.mg-stage-grid button.complete .mg-stage-caption,.mg-stage-grid button.complete .mg-stage-number{text-shadow:0 1px 10px rgba(6,95,70,.18)}.mg-stage-grid button.active{border-color:#d8b4fe;background:linear-gradient(180deg,#8b5cf6,#4338ca);color:#eef2ff;box-shadow:0 0 0 2px rgba(196,181,253,.2),0 22px 36px rgba(79,70,229,.34),0 0 28px rgba(139,92,246,.28);animation:mgStagePulse 2s ease-in-out infinite}.mg-stage-grid button.active .mg-stage-icon{background:rgba(255,255,255,.16);color:#fff}.mg-stage-grid button.active::after{opacity:1;border-color:rgba(196,181,253,.65);animation:mgStageOrbit 2.2s linear infinite}.mg-stage-grid button.active .mg-stage-status{background:rgba(255,255,255,.2);box-shadow:inset 0 0 0 1px rgba(255,255,255,.16)}.mg-stage-grid button.active .mg-stage-status::before{content:"▶";font-size:.72rem;color:#fff}.mg-stage-grid button.locked{border-color:#72809a;background:linear-gradient(180deg,rgba(148,163,184,.75),rgba(100,116,139,.86));color:#e2e8f0;cursor:not-allowed;box-shadow:none;filter:saturate(.45) brightness(.92);opacity:.92}.mg-stage-grid button.locked .mg-stage-icon{background:rgba(15,23,42,.12)}.mg-stage-grid button.locked::after{opacity:.82;border-color:rgba(255,255,255,.09);background:linear-gradient(180deg,rgba(15,23,42,.12),rgba(15,23,42,.22))}.mg-stage-grid button.locked .mg-stage-status{background:rgba(15,23,42,.18);box-shadow:inset 0 0 0 1px rgba(255,255,255,.08)}.mg-stage-grid button.locked .mg-stage-status::before{content:"🔑";font-size:.8rem;filter:grayscale(1)}.mg-stage-grid button.loading{pointer-events:none;opacity:.82}.mg-stage-grid button.loading::after{opacity:1;border-color:rgba(255,255,255,.5);animation:mgStageSpin .8s linear infinite}.mg-stage-grid button.loading .mg-stage-status::before{content:"⏳"}.mg-stage-grid button.locked .mg-stage-number,.mg-stage-grid button.locked .mg-stage-caption{text-shadow:none}.mg-start-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.mg-stage-note{margin:0;color:var(--muted,#64748b);font-size:.72rem;line-height:1.45}.mg-stage-path-note{padding:0 3px;font-weight:700}.mg-setup-level .mg-level-buttons button.locked{opacity:.48;cursor:not-allowed}.mg-setup-level .mg-level-buttons button.complete{border-color:#22c55e}.mg-setup-level .mg-level-buttons button.complete small{color:#15803d}.mg-result-pass{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:8px 0 2px;padding:9px 11px;border:1px solid var(--stroke,#dbe3ee);border-radius:13px;background:var(--surface-soft,#f8fafc);font-size:.78rem}.mg-result-pass strong{font-size:.88rem}.mg-result-pass.passed{border-color:#22c55e;background:#ecfdf5;color:#166534}.mg-result-pass.failed{border-color:#f59e0b;background:#fffbeb;color:#92400e}.mg-result-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:8px}.mg-result-actions .mg-primary{min-width:0}.mg-result-actions button.retry-primary{background:#2563eb;color:#fff}.mg-result-actions button.retry-primary:hover{filter:brightness(.96)}
@keyframes mgStagePulse{0%,100%{transform:translateY(0) scale(1);box-shadow:0 0 0 2px rgba(196,181,253,.2),0 22px 36px rgba(79,70,229,.34),0 0 18px rgba(139,92,246,.18)}50%{transform:translateY(-2px) scale(1.018);box-shadow:0 0 0 4px rgba(196,181,253,.16),0 26px 40px rgba(79,70,229,.36),0 0 30px rgba(139,92,246,.34)}}@keyframes mgStageOrbit{0%{transform:scale(.96);opacity:.75}50%{transform:scale(1.04);opacity:1}100%{transform:scale(.96);opacity:.75}}@keyframes mgStageSpin{from{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes mgRoadFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}
:root[data-theme] .mg-stage-screen-head{background:linear-gradient(135deg,var(--primary-soft),color-mix(in srgb,var(--primary) 18%,transparent),rgba(99,102,241,.18))!important;border-color:var(--stroke)!important;box-shadow:var(--shadow),inset 0 1px 0 rgba(255,255,255,.08)!important}:root[data-theme] .mg-stage-screen-copy strong,:root[data-theme] .mg-stage-back{color:var(--theme-readable-text,var(--text))!important}:root[data-theme] .mg-stage-screen-tip,:root[data-theme] .mg-stage-note{color:var(--theme-readable-muted,var(--muted))!important}:root[data-theme] .mg-stage-back{background:linear-gradient(180deg,var(--surface-solid),var(--surface-soft))!important;border:1px solid var(--stroke)!important;box-shadow:var(--shadow)!important}:root[data-theme] .mg-stage-band-pill{background:linear-gradient(90deg,var(--primary),color-mix(in srgb,var(--primary) 68%,#8b5cf6))!important;color:var(--theme-on-primary,#fff)!important}:root[data-theme] .mg-stage-grid.mg-stage-path{background:linear-gradient(180deg,var(--surface-soft),var(--surface-solid))!important;border:1px solid var(--stroke)!important}:root[data-theme] .mg-stage-group{background:linear-gradient(180deg,var(--surface-solid),var(--surface-soft))!important;border-color:var(--stroke)!important}.mg-stage-grid button::before{mix-blend-mode:screen}:root[data-theme] .mg-stage-group-head strong,:root[data-theme] .mg-stage-grid button,:root[data-theme] .mg-stage-back{color:var(--theme-readable-text,var(--text))!important}:root[data-theme] .mg-stage-group-head small{color:var(--theme-readable-muted,var(--muted))!important}:root[data-theme] .mg-stage-group-badge{background:linear-gradient(180deg,var(--primary),color-mix(in srgb,var(--primary) 70%,#8b5cf6))!important}:root[data-theme] .mg-stage-road-character{background:linear-gradient(180deg,var(--surface-solid),var(--surface-soft))!important;border:1px solid var(--stroke)!important;color:var(--theme-readable-text,var(--text))!important}:root[data-theme] .mg-stage-road-line{background:linear-gradient(90deg,color-mix(in srgb,var(--stroke) 35%,var(--surface)),color-mix(in srgb,var(--stroke-strong) 65%,var(--surface)))!important}:root[data-theme] .mg-stage-connector.is-open .mg-stage-road-line{background:linear-gradient(90deg,color-mix(in srgb,var(--good) 60%,#38bdf8),var(--primary),color-mix(in srgb,var(--warn) 45%,#f472b6))!important}:root[data-theme] .mg-stage-grid button{background:linear-gradient(180deg,var(--surface-solid),var(--surface-soft))!important;border-color:color-mix(in srgb,var(--primary) 40%,var(--stroke))!important}:root[data-theme] .mg-stage-icon{background:color-mix(in srgb,var(--primary-soft) 70%,transparent)!important}:root[data-theme] .mg-stage-grid button.playable{background:linear-gradient(180deg,color-mix(in srgb,var(--primary-soft) 60%,#fff),var(--surface-soft))!important;border-color:color-mix(in srgb,var(--primary) 65%,var(--stroke))!important}:root[data-theme] .mg-stage-grid button.active{background:linear-gradient(180deg,var(--primary),color-mix(in srgb,var(--primary) 70%,var(--surface-solid)))!important;color:var(--theme-on-primary,#fff)!important;border-color:var(--primary)!important}:root[data-theme] .mg-stage-grid button.active .mg-stage-icon{background:rgba(255,255,255,.18)!important;color:var(--theme-on-primary,#fff)!important}:root[data-theme] .mg-stage-grid button.complete{background:linear-gradient(180deg,var(--good),color-mix(in srgb,var(--good) 65%,var(--surface-solid)))!important;color:var(--theme-on-good,#fff)!important;border-color:var(--good)!important}:root[data-theme] .mg-stage-grid button.locked{background:linear-gradient(180deg,color-mix(in srgb,var(--surface-soft) 80%,#94a3b8),color-mix(in srgb,var(--surface) 70%,#64748b))!important;color:var(--theme-readable-muted,var(--muted))!important;border-color:var(--stroke-strong)!important}:root[data-theme] .mg-stage-status{background:rgba(255,255,255,.12)!important;box-shadow:inset 0 0 0 1px rgba(255,255,255,.16)!important}:root[data-theme] .mg-result-pass{background:var(--surface-soft)!important;color:var(--theme-readable-text,var(--text))!important;border-color:var(--stroke)!important}:root[data-theme] .mg-result-pass.passed{background:var(--good-soft)!important;color:var(--theme-good-text,var(--good))!important;border-color:var(--good)!important}:root[data-theme] .mg-result-pass.failed{background:var(--warn-soft)!important;color:var(--theme-warn-text,var(--warn))!important;border-color:var(--warn)!important}
@media(max-width:680px){.mg-setup-card{max-height:100dvh!important}.mg-setup-level .mg-level-buttons{grid-template-columns:repeat(3,minmax(0,1fr))!important}.mg-setup-level .mg-level-buttons button{min-height:76px!important;padding:8px 4px!important}.mg-setup-level .mg-level-buttons strong{font-size:.7rem!important;line-height:1.08}.mg-setup-level .mg-level-buttons span,.mg-setup-level .mg-level-buttons small{font-size:.61rem;line-height:1.14}.mg-stage-screen{gap:10px}.mg-stage-screen-head{padding:12px 12px 16px;border-radius:20px}.mg-stage-screen-copy strong{font-size:.94rem}.mg-stage-screen-tip{font-size:.67rem}.mg-stage-back,.mg-stage-band-pill{font-size:.72rem}.mg-stage-grid.mg-stage-path{gap:10px;padding:12px 8px;border-radius:24px}.mg-stage-group{padding:12px 10px;border-radius:20px}.mg-stage-group-badge{width:40px;height:40px;flex-basis:40px;border-radius:14px}.mg-stage-group-head strong{font-size:.88rem}.mg-stage-group-head small{font-size:.64rem}.mg-stage-group-grid{gap:9px}.mg-stage-grid button{min-height:82px;padding:10px 3px 11px;border-radius:22px}.mg-stage-icon{width:24px;height:24px;font-size:.9rem}.mg-stage-number{font-size:1.52rem}.mg-stage-caption{font-size:.58rem}.mg-stage-status{width:22px;height:22px;right:6px;top:6px}.mg-stage-connector{grid-template-columns:12px 1fr auto 1fr 12px;gap:6px;min-height:44px;padding:0 2px}.mg-stage-road-dot{width:10px;height:10px}.mg-stage-road-line{height:6px}.mg-stage-road-character{min-width:46px;height:46px;font-size:1.3rem;border-radius:16px}.mg-stage-note{font-size:.66rem}.mg-result-actions{grid-template-columns:repeat(auto-fit,minmax(92px,1fr))!important}.mg-result-actions button{padding-inline:7px!important;font-size:.76rem}.mg-result-pass{font-size:.7rem}.mg-result-pass strong{font-size:.78rem}}

/* V282.7 Catchie.link brand mark */
.mg-brand{display:inline-flex;align-items:center;gap:.5rem}.mg-brand img{width:32px;height:32px;object-fit:contain;flex:0 0 auto}.mg-brand-word{display:inline-flex;align-items:baseline}
