/* Grade3 integration only. Visual tokens/HUD/notebook use the Grade4 source. */
[hidden]{display:none!important}#legacy-hooks{display:none!important}#hud .slots{pointer-events:auto}#hud button.slot{cursor:pointer;text-align:left;font-family:Jua}#hud .slot .cd{pointer-events:none}#hud .talk-prompt,#hud .goal,#hud .pause-button{pointer-events:auto}#hud .element-note{display:block}.mb-study-hud{bottom:90px}#hud .reso-line{white-space:normal}
#overlay{z-index:2500}#panel{outline:0}#panel:not(.is-journal) .mb-study-body{overflow:auto}#panel .row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}#panel .between{justify-content:space-between}#panel .eyebrow{color:#7a6650;font:14px MBJua;letter-spacing:1px}#panel .muted{color:#7a6650;font-size:14px}#panel .full{width:100%}#panel .swatches{display:flex;gap:10px;margin:14px 0 22px}#panel .swatches button{flex:1;color:white;border-color:#d8bd8b}#panel .swatches button.selected{outline:3px solid #dca145}#panel .profile-note{font-size:13px;color:#7a6650}#panel .figure{max-width:100%;max-height:180px;object-fit:contain;background:white;border-radius:10px}#panel .feedback{min-height:30px;margin:8px 0}#panel .progress{height:6px;background:#e1d3b4;margin-top:12px;border-radius:6px}#panel .progress i{height:100%;display:block;background:#a2aa6b}#panel .checkrow{display:flex;align-items:center;gap:8px}#panel .mb-choices button{width:100%}#panel .answer{font-size:25px}#panel .question-title{font-size:26px}#panel .mb-lesson-card h3{font-size:22px}
#overlay:has(.welcome){background:radial-gradient(#0000,#2a160a99);backdrop-filter:none;justify-content:end;padding-right:4vw}#panel.welcome{width:min(510px,94vw);max-height:94vh;overflow:auto;text-align:left}#panel.welcome h1{font-size:42px;line-height:1.2;text-align:left}#panel.welcome input{font:20px Nanum;border:2px solid #baaa88;border-radius:12px;padding:13px;width:100%;margin:8px 0}#panel.welcome .mb-study-body{padding:0}
#dialog{position:fixed;bottom:30px;left:50%;transform:translateX(-50%);width:min(720px,92vw);border:4px solid #6b3f24;border-radius:24px;background:#fbf4e3;box-shadow:0 6px 0 #4a2a17;padding:20px 28px;z-index:2000;font-family:Jua;color:#3a2c22}#speaker{font-size:19px;color:#9b622f}#line{font-size:30px;margin:12px 0 18px}#dialog button{font:18px Jua;border:2px solid #c9a46a;background:#f5e7c7;color:#684429;border-radius:12px;padding:10px 22px;cursor:pointer}#dialog-next{background:#f08a3a!important;color:white!important;margin-right:10px}#toast{position:fixed;top:32%;left:50%;transform:translateX(-50%);max-width:85vw;background:#fbf4e3f0;border:2px solid #c9a46a;color:#6b3f24;border-radius:18px;padding:12px 22px;font:19px Jua;opacity:0;pointer-events:none;z-index:2600}#toast.on{opacity:1}
#map-canvas{display:block;width:min(100%,620px);height:auto;margin:12px auto;border:4px solid #8a6238;border-radius:10px;background:#e9d8b0}.touch-mode .mb-study-hud{bottom:auto;top:calc(var(--goal-bottom,160px) + 12px);left:18px;transform:none}.touch-mode #hud .slots,.touch-mode #hud .talk-prompt{display:none}.touch-mode .touch-interact{pointer-events:auto}
@media(max-width:700px){#overlay:has(.welcome){justify-content:center;padding:12px}#panel.welcome h1{font-size:33px}.mb-study-hud{bottom:78px}#line{font-size:25px}#dialog{bottom:14px;padding:16px 20px}}@media(max-height:600px){#panel.welcome h1{font-size:30px}#panel.welcome p{margin:6px 0}#panel.welcome{padding:16px 22px}.mb-study-hud{bottom:76px}}

/* Claude 10-28: lists, practice choice and rest menu were full-screen sheets with a few buttons on top and empty paper below.
   Compact sheets size to their content, sit low-centre so the forest stays visible above. */
#panel.mb-study-sheet.compact{width:min(760px,94vw);height:auto;max-height:84dvh}#overlay:has(.compact){background:rgba(26,34,26,.38);backdrop-filter:none}#panel.compact .mb-study-body{padding-bottom:18px}#panel.compact .mb-lesson-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px}#panel.compact .row{justify-content:center}
/* Claude 10-29: grade 3 number pad under the answer field */
#hud .weapon-switch,.weapon-switch-touch{display:flex;gap:8px;pointer-events:auto;justify-content:center}
.weapon-switch button{min-height:48px;min-width:112px;padding:8px 12px;border:2px solid #b7a279;border-radius:14px;background:#fbf4e3;color:#4b4d32;font:18px Jua,sans-serif;cursor:pointer;box-shadow:0 3px 0 #9c7a4c44}
.weapon-switch button small{font-size:13px;opacity:.8}.weapon-switch button[aria-pressed="true"]{background:#396b53;border-color:#b9ce93;color:#fff9e9;box-shadow:0 0 0 2px #c9dbaa88}
.weapon-switch button:disabled{opacity:.55}.weapon-switch button:focus-visible{outline:3px solid #eea84b;outline-offset:3px}
.touch-mode #hud .weapon-switch{display:none}.weapon-switch-touch{grid-column:1/-1}.touch-actions .weapon-switch-touch button{flex:1;min-width:0;min-height:48px;font-size:17px}
#panel .g3-keypad{display:grid;grid-template-columns:repeat(6,minmax(44px,62px));gap:7px;margin:10px 0 4px}#panel .g3-keypad button{min-height:46px;font:24px MBJua,Jua,sans-serif;padding:0;border-radius:13px}#panel .g3-keypad button[data-key="지우기"]{font-size:15px}


/* Grade4 tablet.css: learning controls, unchanged. */
body.touch-mode .mb-study{padding:10px}
body.touch-mode .mb-study-sheet{width:100%;height:calc(var(--touch-viewport-height,100dvh) - 20px);max-height:none;border-width:8px;border-bottom-width:10px}
body.touch-mode .mb-study header{padding:10px 14px;gap:10px}
body.touch-mode .mb-study h2{font-size:23px}
body.touch-mode .mb-study-head-actions button{min-height:48px;font-size:17px}
body.touch-mode .mb-study input,body.touch-mode .mb-study textarea{font-size:20px;min-height:48px}
body.touch-mode .mb-question-tabs{flex-wrap:nowrap;overflow-x:auto;min-height:54px;flex-shrink:0}
body.touch-mode .mb-question-tabs button{min-width:48px;flex-shrink:0}
body.touch-mode .mb-study button{min-height:48px}
.mb-study-hud{flex-wrap:wrap;max-width:calc(100vw - 24px)}

/* Question sheet fits one tablet screen (1024x768): the card scrolls inside itself, so the answer box, 정답 확인 and the opened keypad never fall below the fold. */
.mb-study-sheet.is-question .mb-question-grid{grid-template-rows:minmax(0,1fr);min-height:0}
.mb-study-sheet.is-question .mb-question-left{min-height:0}
.mb-study-sheet.is-question .mb-question-card{min-height:0;overflow-y:auto}
.mb-study-sheet.is-question .mb-question-figure{display:block;width:auto;max-width:100%;max-height:min(21vh,160px);object-fit:contain;margin:6px auto}
.mb-study-sheet.is-question .mb-memo{min-height:0}
.mb-study-sheet.is-question .mb-memo canvas{min-height:120px}

/* Fewer buttons on the play screen for Grade 3: 오답노트, 성장나무 and 장비 가방 open from inside 배움 수첩 (its bottom row), so the HUD keeps one book button. */
.mb-study-hud #notes-button,.mb-study-hud #growth-button,.mb-study-hud #bag-button{display:none}

/* Grade3 textbook unit picker: keep the two-page book below a single row. */
#panel.is-journal .mb-study-body{flex-direction:column}
#panel.is-journal .mb-study-body>nav[aria-label="단원 선택"]{flex:0 0 auto;flex-wrap:nowrap;overflow-x:auto;margin:0;padding:8px 16px;border-bottom:1px solid #d9c7a7}
#panel.is-journal .mb-study-body>nav[aria-label="단원 선택"] button{flex:0 0 auto;white-space:nowrap;font-size:15px;min-height:38px;padding:6px 12px}
