/* MisterSa 3.27.0 — labyrinth game section (course page). Transforms/opacity only; no horizontal scroll. */
.msa-lab .msa-cx-section-head p{text-align:justify;text-justify:inter-word;line-height:1.9;margin:8px 0 0}
/* 3.28.1: no background, no frame — only the wooden board and its ball */
.msa-lab-stage{position:relative;inline-size:min(100%,560px);aspect-ratio:1/1;margin:12px auto 0;background:none;overflow:visible;isolation:isolate}
.msa-lab-canvas{position:absolute;inset:0;outline:none}
.msa-lab-canvas:focus-visible{outline:3px solid rgba(255,131,0,.5);outline-offset:4px;border-radius:24px}
.msa-lab-hint{max-inline-size:560px;margin:6px auto 0;text-align:center;font-size:.88rem;opacity:.85}
.msa-lab-fail{position:absolute;inset:0;display:grid;place-items:center;text-align:center;padding:20px}
.msa-lab-poster{position:absolute;inset:0;display:grid;place-items:center;padding:7%;z-index:2}
.msa-lab-poster[hidden]{display:none}
.msa-lab-svg{inline-size:100%;block-size:auto;filter:drop-shadow(0 18px 22px rgba(80,45,15,.28));transform:perspective(900px) rotateX(14deg);transition:transform .6s cubic-bezier(.2,.8,.2,1)}
.msa-lab-stage:hover .msa-lab-svg{transform:perspective(900px) rotateX(8deg) rotateZ(-2deg)}
.msa-lab-start{position:absolute;inset-block-end:9%;inset-inline:50% auto;transform:translateX(50%);min-height:52px;padding:0 30px;border:0;border-radius:999px;background:#ff8300;color:#fff;font:inherit;font-weight:900;font-size:1.05rem;cursor:pointer;box-shadow:0 10px 26px rgba(255,131,0,.45);transition:box-shadow .2s,background .2s}
.msa-lab-start:hover,.msa-lab-start:focus-visible{background:#ea6c00;box-shadow:0 0 0 4px rgba(255,131,0,.25),0 0 28px rgba(255,131,0,.6);outline:none}
.msa-lab-start:disabled{opacity:.75;cursor:progress}
.msa-lab-hud{position:absolute;inset-block-start:12px;inset-inline:12px;display:flex;align-items:center;gap:8px;z-index:3;pointer-events:none}
.msa-lab-hud[hidden]{display:none}
.msa-lab-hud>*{pointer-events:auto}
.msa-lab-time{min-width:64px;text-align:center;padding:6px 12px;border-radius:999px;background:rgba(255,255,255,.88);color:#0B1B3F;font-weight:900;font-variant-numeric:tabular-nums}
.msa-lab-hint{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.85rem;color:#5b4630}
.msa-lab-hud button{min-height:36px;padding:0 14px;border-radius:999px;border:1.5px solid #ff8300;background:rgba(255,255,255,.9);color:#c2410c;font:inherit;font-weight:800;cursor:pointer}
.msa-lab-hud button:hover{background:#ff8300;color:#fff}
.msa-lab-panel{position:absolute;inset:auto 12px 12px;max-block-size:calc(100% - 64px);overflow:auto;z-index:4;padding:18px;border-radius:22px;background:rgba(255,255,255,.97);box-shadow:0 18px 40px rgba(15,23,42,.18);color:#1b1b1b}
.msa-lab-panel[hidden]{display:none}
.msa-lab-panel h3{margin:0 0 8px;font-size:1.1rem;color:#0B1B3F}
.msa-lab-msg,.msa-lab-small{margin:0 0 10px;line-height:1.9;text-align:justify;text-justify:inter-word}
.msa-lab-small{font-size:.86rem;color:#555}
.msa-lab-msg.is-bad,.msa-lab-note.is-bad{color:#b91c1c}
.msa-lab-note{margin:8px 0 0;min-height:1em;font-size:.88rem}
.msa-lab-form{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.msa-lab-form label{display:flex;flex-direction:column;gap:4px;font-size:.86rem;font-weight:700;min-width:0}
.msa-lab-form input{min-height:44px;padding:0 12px;border:1.5px solid #e5d6bf;border-radius:12px;font:inherit;font-size:1rem;background:#fff;min-width:0}
.msa-lab-form input:focus{border-color:#ff8300;outline:none;box-shadow:0 0 0 3px rgba(255,131,0,.2)}
.msa-lab-form .msa-lab-btn,.msa-lab-form .msa-lab-note,.msa-lab-form .msa-lab-link{grid-column:1/-1}
.msa-lab-btn{display:inline-flex;align-items:center;justify-content:center;min-height:46px;padding:0 20px;border:0;border-radius:999px;background:#ff8300;color:#fff!important;font:inherit;font-weight:800;text-decoration:none;cursor:pointer;transition:box-shadow .2s,background .2s}
.msa-lab-btn:hover,.msa-lab-btn:focus-visible{background:#ea6c00;box-shadow:0 0 18px rgba(255,131,0,.45);outline:none}
.msa-lab-btn:disabled{opacity:.6;cursor:progress}
.msa-lab-link{border:0;background:none;color:#c2410c;font:inherit;font-weight:700;cursor:pointer;min-height:40px}
.msa-lab-code{display:flex;gap:8px;margin:6px 0 10px}
.msa-lab-code input{flex:1;min-width:0;min-height:50px;text-align:center;font:800 1.35rem/1 ui-monospace,Consolas,monospace;letter-spacing:.12em;border:2px dashed #ff8300;border-radius:14px;background:#fff7ed;color:#7c2d12}
.msa-lab-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.msa-lab-help{max-inline-size:560px;margin:14px auto 0;padding-inline-start:1.2em;line-height:1.9;font-size:.9rem;color:inherit;opacity:.92}
.msa-lab-help li{text-align:justify;text-justify:inter-word}
.msa-lab-price{font-weight:900}
@media (max-width:600px){
  /* leave room beside the board for scrolling the page with a finger */
  .msa-lab-stage{inline-size:min(100%,84vw)}
  .msa-lab-form{grid-template-columns:1fr}
  .msa-lab-panel{inset:auto 8px 8px;padding:14px}
  /* phones: the result / form panel becomes a bottom sheet so the fields have room */
  .msa-lab.has-panel .msa-lab-panel{position:fixed;inset:auto 8px max(8px,env(safe-area-inset-bottom));max-block-size:82vh;z-index:100000;box-shadow:0 -10px 40px rgba(15,23,42,.28)}
  .msa-lab-hint{display:none}
}
@media (prefers-reduced-motion:reduce){
  .msa-lab-svg,.msa-lab-start,.msa-lab-btn{transition:none}
  .msa-lab-stage:hover .msa-lab-svg{transform:perspective(900px) rotateX(14deg)}
}
/* 3.27.2: same section on the public course page (no .msa-cx styles there) */
.msa-lab{margin-block:28px}
.msa-lab .msa-cx-section-head>span{display:inline-block;color:#ff8300;font-weight:900;font-size:13px}
.msa-lab .msa-cx-section-head h2{margin:6px 0 0;line-height:1.6}
/* 3.28.2: no card behind the game — the page's own background shows through; text colours follow that background */
#msa-labyrinth.msa-lab{background:none!important;box-shadow:none!important;border:0!important}
#msa-labyrinth .msa-cx-section-head>span{color:#c2410c}
#msa-labyrinth .msa-cx-section-head h2{color:#0b1b3f}
#msa-labyrinth .msa-cx-section-head p,#msa-labyrinth .msa-lab-hint,#msa-labyrinth .msa-lab-fail{color:#3f4a5c;opacity:1}
/* 3.57.0: the result panel is white on every page, so its text stays dark */
#msa-labyrinth .msa-lab-panel,#msa-labyrinth .msa-lab-panel :is(p,li,span,small,label,strong,b,em,div){color:#1b1b1b!important}#msa-labyrinth .msa-lab-panel :is(h2,h3,h4){color:#0B1B3F!important}#msa-labyrinth .msa-lab-panel .msa-lab-btn,#msa-labyrinth .msa-lab-panel .msa-lab-btn *{color:#fff!important}#msa-labyrinth .msa-lab-panel .msa-lab-link{color:#c2410c!important}#msa-labyrinth .msa-lab-panel .msa-lab-msg.is-bad,#msa-labyrinth .msa-lab-panel .msa-lab-note.is-bad{color:#b91c1c!important}#msa-labyrinth .msa-lab-panel .msa-lab-code input{color:#7c2d12!important}
/* dark academy pages (public course page): light text */
.msa-academy-cosmic-page #msa-labyrinth{color:#edf2ff}
.msa-academy-cosmic-page #msa-labyrinth .msa-cx-section-head>span{color:#ffb15c}
.msa-academy-cosmic-page #msa-labyrinth .msa-cx-section-head h2,.msa-academy-cosmic-page #msa-labyrinth .msa-lab-fail{color:#f4f7ff}
.msa-academy-cosmic-page #msa-labyrinth .msa-cx-section-head p,.msa-academy-cosmic-page #msa-labyrinth .msa-lab-hint{color:rgba(237,242,255,.86)}
/* 3.28.2: game over — the board is gone, the code box takes its place (also on phones, no bottom sheet) */
.msa-lab.is-done .msa-lab-stage{aspect-ratio:auto;inline-size:min(100%,560px)}
.msa-lab.is-done .msa-lab-canvas{display:none}
.msa-lab.is-done .msa-lab-hint{display:none}
.msa-lab.is-done .msa-lab-panel,.msa-lab.is-done.has-panel .msa-lab-panel{position:static;inset:auto;max-block-size:none;box-shadow:0 18px 44px rgba(15,23,42,.18);z-index:auto}

/* 3.28.4 — sign-in for players outside Iran */
.msa-lab-alt{margin-top:14px;padding-top:12px;border-top:1px dashed rgba(148,163,184,.5)}
.msa-lab-btn.is-google{background:#fff;color:#1f2937!important;border:1.5px solid #cbd5e1;box-shadow:0 2px 8px rgba(15,23,42,.08)}
.msa-lab-btn.is-google::before{content:"G";display:inline-grid;place-items:center;width:22px;height:22px;margin-inline-end:8px;border-radius:50%;background:conic-gradient(#ea4335 0 25%,#fbbc05 0 50%,#34a853 0 75%,#4285f4 0);color:#fff;font:800 12px/1 Arial,sans-serif}
.msa-lab-btn.is-google:hover,.msa-lab-btn.is-google:focus-visible{background:#fff7ed;border-color:#ff8300}
.msa-lab-btn.is-ghost{background:#0b1b3f;color:#fff!important;border:1.5px solid #0b1b3f}
.msa-lab-btn.is-ghost:hover,.msa-lab-btn.is-ghost:focus-visible{background:#1e3a8a;border-color:#ff8300}
