/* Academia Interativa: self-contained brown chess study layout. */
body.academy-page{background:radial-gradient(ellipse at 50% -5%,#3d2c20,#17130f 60%,#0d1215);color:#f8f1e5;min-height:100dvh}
.academy-page .academy-header{max-width:none;min-height:66px;display:flex;align-items:center;flex-direction:row;gap:14px;padding:calc(9px + env(safe-area-inset-top)) clamp(12px,2vw,32px) 9px;background:#101b20;border-bottom:1px solid #564431;position:sticky;top:0;z-index:30}
.academy-header .edu-brand{flex:0 0 auto}.academy-header .edu-brand img{border-radius:6px}.academy-head-title{font-size:clamp(.85rem,1.4vw,1.13rem);font-weight:800;letter-spacing:.015em;flex:1}.academy-header .academy-exit{font:inherit;font-weight:750;border:1px solid #947e64;border-radius:8px;color:#fff4e4;background:#392c23;padding:8px 13px;cursor:pointer;white-space:nowrap}.academy-header .academy-exit:hover{background:#59402d}.academy-page .mca-site-language{order:2}
.academy-screen{width:min(100%,1720px);margin:0 auto;padding:clamp(12px,1.8vw,24px);display:grid;grid-template-columns:minmax(190px,270px) minmax(0,1fr) minmax(205px,285px);align-items:start;gap:clamp(10px,1.4vw,22px)}
.academy-panel{border:1px solid #735944;border-radius:13px;background:linear-gradient(180deg,#31271f,#211d19);box-shadow:0 8px 24px #0004;padding:clamp(13px,1.4vw,21px)}
.academy-panel h2{font-size:1.1rem;color:#ffe0aa;margin:0 0 12px}.academy-panel p{line-height:1.65;color:#f1e6d7}.academy-panel .academy-quiet{font-size:.87rem;color:#dac7af}
.academy-levels{display:flex;flex-direction:column;gap:9px}.academy-level{width:100%;text-align:left;color:#f3e3cd;background:#27231f;border:1px solid #66513c;border-radius:9px;padding:11px 12px;cursor:pointer;display:flex;flex-direction:column;gap:4px}.academy-level strong{font-size:.88rem}.academy-level span{font-size:.77rem;color:#cdb8a1}.academy-level.current{border-color:#deb373;background:#443324}.academy-level.finished{border-left:4px solid #3cab67}.academy-level:disabled{opacity:.5;cursor:default}.academy-level:hover:not(:disabled){border-color:#dfb777}
.academy-progress-track{height:9px;border-radius:8px;overflow:hidden;background:#594838;margin:8px 0 5px}.academy-progress-track>div{height:100%;background:#5bd690;width:0;transition:width .25s}.academy-progress-label{font-size:.86rem;font-weight:750;color:#eadbc2}
.academy-main{display:flex;flex-direction:column;align-items:center;gap:9px;min-width:0}.academy-current-head{display:flex;width:min(100%,690px);align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;color:#f0d8b6}.academy-current-head strong{font-size:1.04rem}.academy-current-head small{color:#d5b99e}
.academy-board-wrap{width:min(100%, calc(100dvh - 298px), 690px);min-width:0;max-width:690px;background:#171814;border:1px solid #876747;border-radius:10px;padding:clamp(5px,.6vw,10px);box-shadow:0 12px 35px #0008}
.academy-board{width:100%;aspect-ratio:1;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));position:relative;overflow:hidden;border:3px solid #916e4d;touch-action:pan-y;border-radius:3px}
.academy-square{display:flex;justify-content:center;align-items:center;position:relative;min-width:0;min-height:0;border:0;padding:0;cursor:pointer;aspect-ratio:1;user-select:none;touch-action:none}.academy-light{background:#f0d9b5}.academy-dark{background:#b58863}.academy-square img{width:87%;height:87%;object-fit:contain;position:relative;z-index:1;pointer-events:none;user-select:none;-webkit-user-drag:none}
.academy-selected{box-shadow:inset 0 0 0 3px #5388b8}.academy-hint-from{box-shadow:inset 0 0 0 5px #13ae4b;background-image:linear-gradient(#69e29d66,#69e29d66)}.academy-hint-to{background-image:linear-gradient(#25d87999,#25d87999);box-shadow:inset 0 0 0 4px #008e37}.academy-error-square{background-image:linear-gradient(#ef454e99,#ef454e99);box-shadow:inset 0 0 0 5px #e22132;animation:academy-shake .25s 1}.academy-good-square{background-image:linear-gradient(#25c96a88,#25c96a88);box-shadow:inset 0 0 0 3px #19954c}
.academy-hint-arrow{position:absolute;inset:0;width:100%;height:100%;z-index:4;pointer-events:none;filter:drop-shadow(0 1px 2px #072b18)}
.academy-coordinate{font-size:clamp(8px,1.15vw,12px);position:absolute;z-index:2;font-weight:800;pointer-events:none}.academy-coordinate.rank{top:1px;left:3px}.academy-coordinate.file{bottom:1px;right:3px}.academy-light .academy-coordinate{color:#77543b}.academy-dark .academy-coordinate{color:#fff0d5}
.academy-toolbar{width:min(100%,690px);display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}.academy-toolbar button{font:inherit;font-size:clamp(.69rem,.93vw,.89rem);font-weight:750;padding:9px 4px;border-radius:8px;border:1px solid #a08769;background:#3d3328;color:#f9ecd7;cursor:pointer;min-height:42px}.academy-toolbar button:hover:not(:disabled){background:#6b4c30}.academy-toolbar button:disabled{opacity:.37;cursor:not-allowed}.academy-toolbar [data-academy-next]:not(:disabled){background:#1c6944;border-color:#4ac47b}.academy-toolbar [data-academy-hint]:not(:disabled){border-color:#ddbb78}
.academy-mobile-instruction{display:none}.academy-puzzle-label{font-size:.84rem;text-transform:capitalize;color:#dfbd8c;font-weight:750}.academy-target{font-size:1.04rem;font-weight:750;color:#fff1da;line-height:1.6}.academy-feedback{padding:12px;border:1px solid #71614d;border-radius:9px;background:#282621;min-height:100px;white-space:pre-line}.academy-feedback p{margin:0;font-size:.96rem}.academy-feedback p + p{margin-top:.95em}.academy-feedback-head{font-weight:800}.academy-feedback-right{border-color:#398456;background:#173a2a}.academy-feedback-right p{color:#c4f4d4}.academy-feedback-wrong{border-color:#b65b58;background:#42282a}.academy-feedback-wrong p{color:#ffe3e0}.academy-feedback-hint{border-color:#3ba86b;background:#183c30}.academy-feedback-hint p{color:#dcf6e6}.academy-finish{margin:12px 0 0;color:#9ff0bc;font-weight:800;font-size:.96rem}
.academy-promotion:not([hidden]){margin-top:10px;border:1px solid #e1b97a;padding:12px;background:#3a2b1c;border-radius:8px}.academy-promotion p{margin:0 0 10px}.academy-promotion-options{display:flex;gap:8px}.academy-promotion-options button{flex:1;border:1px solid #bb986b;border-radius:8px;background:#59412b;cursor:pointer;padding:3px}.academy-promotion-options img{height:50px;width:50px;max-width:100%;object-fit:contain}
.academy-resume-dialog{max-width:min(470px,calc(100vw - 26px));border:1px solid #d6aa6d;border-radius:18px;padding:24px;background:#231f1c;color:#ffefda;box-shadow:0 24px 95px #000a}.academy-resume-dialog::backdrop{background:#020609c9;backdrop-filter:blur(4px)}.academy-resume-dialog h2{margin:0 0 10px;color:#f1c98a;font-size:1.55rem}.academy-resume-dialog p{margin:0 0 12px;line-height:1.6}.academy-resume-dialog button{width:100%;display:block;border:1px solid #927458;border-radius:9px;background:#493929;color:#fff8ec;padding:11px 12px;margin-top:9px;cursor:pointer;font:inherit;font-weight:760}.academy-resume-dialog [data-academy-dialog-continue]{background:#197044;border-color:#51bb7c}.academy-resume-dialog [data-academy-dialog-restart]{background:#6b4428}.academy-resume-dialog small{display:block;font-size:.83rem;color:#d7bfa3;margin-top:10px}
@keyframes academy-shake{0%,100%{transform:translateX(0)}35%{transform:translateX(-3px)}70%{transform:translateX(3px)}}
@media(min-width:1021px){.academy-page{overflow-x:hidden}.academy-screen{min-height:calc(100dvh - 68px)}.academy-panel{max-height:calc(100dvh - 100px);overflow:auto}}
@media(max-width:1020px){.academy-screen{grid-template-columns:1fr minmax(0,1.65fr);align-items:start}.academy-right{grid-column:1/-1}.academy-board-wrap{width:min(100%,calc(100dvh - 245px),620px)}.academy-left{grid-row:1}.academy-main{grid-column:2;grid-row:1}.academy-header .academy-head-title{display:none}}
@media(max-width:650px){.academy-header{padding:calc(8px + env(safe-area-inset-top)) 10px 8px;gap:8px;min-height:60px}.academy-header .edu-brand{font-size:.83rem;gap:5px}.academy-header .edu-brand img{width:28px;height:28px}.academy-header .academy-exit{padding:6px 8px;font-size:.81rem}.academy-page .academy-screen{grid-template-columns:1fr;display:flex;flex-direction:column;gap:12px;padding:10px}.academy-main{order:0;width:100%}.academy-left{order:1;width:100%}.academy-right{order:2;width:100%}.academy-current-head{gap:4px}.academy-board-wrap{width:min(100%,calc(100dvh - 175px),570px)}.academy-toolbar{gap:4px}.academy-toolbar button{min-height:41px;font-size:.7rem;padding:6px 1px}.academy-levels{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.academy-panel{width:100%;padding:13px}.academy-mobile-instruction{display:block;width:100%;padding:11px 13px;border:1px solid #7d624a;border-radius:10px;background:#3d2d20;color:#f8ead5;font-weight:750;font-size:.95rem}.academy-mobile-instruction strong{color:#e8c58c}.academy-left .academy-levels-title{margin-top:15px}.academy-right .academy-feedback{min-height:80px}}
@media(max-width:370px){.academy-toolbar{grid-template-columns:repeat(5,minmax(0,1fr))}.academy-toolbar button{font-size:.61rem}.academy-page .mca-site-language select{max-width:96px}}
@media(prefers-reduced-motion:reduce){.academy-error-square{animation:none}.academy-progress-track>div{transition:none}}
.academy-how{margin-top:16px;color:#e2d0ba;font-size:.89rem}.academy-how summary{cursor:pointer;font-weight:800;color:#e6be85}.academy-how p{margin:10px 0;line-height:1.6}
@media(max-width:650px){.academy-how{padding:8px 0}}

/* Viewport-contained Academia Maumau Chess experience on phones/tablets.
   Full educational text stays in the source and is available in the lesson dialog. */
.academy-legal-dot{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;z-index:3}
.academy-legal-dot:before{content:'';display:block;width:26%;aspect-ratio:1;border-radius:50%;background:#147b48aa;box-shadow:0 0 0 1px #f3eac0a0}
.academy-legal-capture:before{width:83%;height:83%;aspect-ratio:auto;border:5px solid #16854dcb;background:transparent;box-sizing:border-box}
.academy-mobile-summary{display:none}
.academy-completion-actions[hidden]{display:none!important}
.academy-completion-actions{display:flex;align-items:center;flex-wrap:wrap;gap:7px}
.academy-completion-actions button{font:inherit;font-weight:750;cursor:pointer;border-radius:8px;padding:8px 11px;border:1px solid #8f795d;background:#443125;color:#fff0d9}
.academy-completion-actions .academy-completion-another{background:#17643f;border-color:#60c28c}
.academy-theory-dialog{width:min(650px,calc(100vw - 24px));max-height:min(84dvh,740px);border:1px solid #b48b60;border-radius:14px;background:#261f1a;color:#f6ead8;padding:15px;overflow:hidden;flex-direction:column;gap:10px}
.academy-theory-dialog[open]{display:flex}.academy-theory-dialog::backdrop{background:#080c0bd0}
.academy-theory-dialog h2{color:#ffe0a9;margin:0;font-size:1.13rem}
.academy-theory-body{min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;line-height:1.55}
.academy-theory-body .academy-panel{border:none;background:transparent;box-shadow:none;max-height:none;overflow:visible;padding:0}
.academy-theory-body .edu-prose{line-height:1.55}.academy-theory-body p{margin:0 0 .8em}
.academy-theory-close,.academy-theory-trigger{font:inherit;color:#fff1dc;background:#56402d;border:1px solid #a98a61;border-radius:8px;padding:8px;cursor:pointer}
.academy-theory-close{flex:0 0 auto}
@media(max-width:800px){
 body.academy-page{height:100dvh;min-height:0;overflow:hidden;overscroll-behavior:none}
 .academy-page .academy-header{position:relative;height:50px;min-height:50px;max-height:50px;flex-wrap:nowrap;padding:5px 9px;gap:6px;z-index:30}
 .academy-page .academy-header .edu-brand{font-size:0;flex:0 0 auto;gap:0}
 .academy-page .academy-header .edu-brand img{width:31px;height:31px;flex:none}
 .academy-page .academy-header .academy-head-title{display:block;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:clamp(.77rem,2.5vw,.99rem);line-height:1.1}
 .academy-page .academy-header .academy-exit{order:4;padding:5px 7px;min-height:33px;font-size:.72rem}
 .academy-page .academy-header .mca-site-language{order:3;flex:0 1 auto;margin:0}
 .academy-page .academy-header .mca-site-language select{max-width:105px;min-width:0;font-size:.73rem}
 .academy-page .academy-screen{display:block;height:calc(100dvh - 50px);min-height:0;max-height:calc(100dvh - 50px);overflow:hidden;padding:5px 8px!important;width:100%;margin:0 auto}
 .academy-page .academy-main{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;width:100%;height:100%;min-height:0;gap:4px!important;grid-column:auto;grid-row:auto;order:0}
 .academy-page .academy-left,.academy-page .academy-right{display:none!important}
 .academy-page .academy-current-head{flex:none;min-height:0!important;line-height:1.15;width:100%;font-size:.75rem;flex-wrap:nowrap!important}
 .academy-page .academy-current-head strong{font-size:.77rem}
 .academy-page .academy-current-head small{white-space:nowrap;font-size:.7rem}
 .academy-page .academy-mobile-instruction{display:block;width:100%;flex:0 0 auto;line-height:1.28;padding:5px 8px;font-size:clamp(.71rem,2.5vw,.87rem);font-weight:600;margin:0;min-height:0!important}
 .academy-page .academy-board-wrap,.academy-study-page .academy-board-wrap{box-sizing:border-box;width:var(--academy-fit-board,min(100%,calc(100dvh - 280px)))!important;max-width:100%;flex:0 0 auto;padding:3px;border-radius:6px;margin:0}
 .academy-page .academy-board{border-width:2px;touch-action:none}
 .academy-page .academy-toolbar{width:100%;max-width:none;flex:none;gap:3px;grid-template-columns:repeat(5,minmax(0,1fr))}
 .academy-page .academy-toolbar button{padding:4px 1px;min-height:33px;font-size:clamp(.58rem,2.25vw,.76rem);border-radius:6px;line-height:1.15}
 .academy-page .academy-mobile-summary{display:block;flex:0 0 auto;width:100%;min-height:42px;padding:6px 8px;max-height:min(27dvh,175px);overflow-y:auto;overscroll-behavior:contain;border:1px solid #806446;border-radius:8px;background:#29241e;font-size:clamp(.71rem,2.5vw,.87rem);line-height:1.3;color:#f3e6d7}
 .academy-page .academy-mobile-message p{margin:0 0 4px;line-height:1.3;white-space:pre-line}
 .academy-page .academy-mobile-message p:last-child{margin-bottom:0}
 .academy-page .academy-mobile-message .academy-feedback-head{font-size:inherit;font-weight:800}
 .academy-page .academy-mobile-ok{border-color:#398456;background:#173a2a}
 .academy-page .academy-mobile-error{border-color:#c46b5a;background:#42282a}
 .academy-page .academy-mobile-hint{border-color:#3ba86b;background:#183c30}
 .academy-page .academy-completion-actions{margin-top:6px;display:grid;grid-template-columns:1fr 1fr;gap:5px}
 .academy-page .academy-completion-heading{grid-column:1/-1;font-size:.76rem;color:#a5efbf}
 .academy-page .academy-completion-actions button{font-size:clamp(.69rem,2.5vw,.85rem);padding:6px 3px;min-height:33px}
 .academy-page .academy-theory-trigger{display:block;width:100%;margin-top:6px;padding:4px;font-size:.76rem}
 .academy-page .academy-promotion:not([hidden]){display:block;position:fixed!important;top:50%;left:50%;transform:translate(-50%,-50%);z-index:120;width:min(350px,calc(100vw - 24px));padding:16px;background:#3a2b1c;box-shadow:0 0 0 150vmax #090d0cba,0 14px 45px #000c}
 .academy-page .academy-promotion:not([hidden]) .academy-promotion-options button{min-width:0}
 .academy-page .academy-promotion-options img{height:clamp(40px,12vw,60px);width:clamp(40px,12vw,60px)}
 .academy-page .academy-resume-dialog{max-height:90dvh;overflow-y:auto}
}
@media(max-width:365px){.academy-page .academy-header .academy-head-title{font-size:.7rem}.academy-page .academy-header .mca-site-language select{max-width:85px}.academy-page .academy-header .academy-exit{font-size:.65rem;padding:4px 5px}.academy-page .academy-header .edu-brand img{width:27px;height:27px}}
@media(max-height:600px) and (max-width:800px){.academy-page .academy-header{height:43px;min-height:43px;max-height:43px}.academy-page .academy-screen{height:calc(100dvh - 43px);max-height:calc(100dvh - 43px)}.academy-page .academy-current-head{font-size:.7rem}.academy-page .academy-mobile-instruction{padding:3px 5px}.academy-page .academy-toolbar button{min-height:29px}.academy-page .academy-mobile-summary{padding:4px 6px}}

@media(min-width:801px){.academy-desktop-completion:not([hidden]){display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}.academy-desktop-completion .academy-completion-heading{grid-column:1/-1;color:#adf2c9}.academy-desktop-completion button{padding:10px 5px}}
@media(max-width:800px){.academy-page .academy-desktop-completion{display:none!important}.academy-theory-body .academy-panel{display:block!important}}

/* End of full training: two required choices, always over the board (not in sidebar). */
.academy-course-complete-dialog{position:fixed;inset:0;margin:auto;box-sizing:border-box;width:min(460px,calc(100vw - 24px));max-height:min(86dvh,560px);overflow:auto;padding:clamp(17px,4vw,28px);background:#28221c;color:#fff0dc;border:2px solid #ccab7c;border-radius:18px;box-shadow:0 24px 90px #000d;text-align:center;z-index:99999;font-family:inherit}
.academy-course-complete-dialog::backdrop{background:#050a0bd7;backdrop-filter:blur(3px)}
.academy-course-complete-dialog h2{margin:0 0 12px;color:#b2f4cd;font-size:clamp(1.1rem,4vw,1.5rem);line-height:1.36}
.academy-course-complete-dialog p{line-height:1.55;margin:0 0 21px;font-size:clamp(.9rem,3.1vw,1.02rem)}
.academy-course-complete-dialog button{display:block;width:100%;cursor:pointer;font:inherit;font-weight:800;border-radius:10px;padding:13px 10px;min-height:48px;margin-top:11px;border:1px solid #b3976b;background:#443326;color:#fff2e1}
.academy-course-complete-dialog .academy-course-continue{background:#146d43;border-color:#53c88d}
.academy-course-complete-dialog button:focus-visible{outline:3px solid #8bdfb1;outline-offset:3px}

/* Completion is voluntary: the explanation of the final move remains visible. */
.academy-review-finish[hidden]{display:none!important}
.academy-review-finish{width:min(100%,420px);align-self:center;display:block;margin:6px auto 0;min-height:38px;border:1px solid #67cf90;border-radius:9px;background:#195b3d;color:#e7ffee;font:inherit;font-size:.91rem;font-weight:800;cursor:pointer;padding:7px 14px}
.academy-review-finish:hover,.academy-review-finish:focus-visible{background:#1e7450;outline-color:#80e4ab}
@media(max-width:800px){.academy-review-finish{flex:0 0 auto;min-height:33px;width:100%;font-size:.76rem;margin:2px 0 0;padding:5px 8px}}
.academy-seo-heading{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}

/* Jornada didática: o aluno vê o tema/nível e não a contagem de exercícios. */
.academy-page [data-academy-stage],.academy-page [data-academy-progress-label],.academy-page .academy-progress-track{display:none!important}

/* 2026-11-23: correção das cores marrons residuais na Academia mobile.
   Mantém os estados semânticos de acerto/erro/dica e os destaques das peças. */
@media(max-width:800px){
  body.academy-page .academy-mobile-instruction,
  body.academy-page .academy-mobile-summary:not(.academy-mobile-ok):not(.academy-mobile-error):not(.academy-mobile-hint){
    background:var(--mca-ui-light-surface,#1b3038)!important;
    border-color:var(--mca-ui-accent-border,#5d91c5)!important;
    color:var(--mca-ui-ink,#f1f5f8)!important;
  }
  body.academy-page .academy-mobile-instruction strong,
  body.academy-page .academy-mobile-summary .academy-feedback-head{
    color:var(--mca-ui-accent-strong,#89c8ff)!important;
  }
  body.academy-page .academy-promotion:not([hidden]){
    background:var(--mca-ui-panel,#15242a)!important;
    color:var(--mca-ui-ink,#f1f5f8)!important;
    border-color:var(--mca-ui-accent-border,#5d91c5)!important;
  }
}
