/* Canonical Korean HUD: app.css HUD block + classroom-refresh.css experience block.
 * Only container anchoring and native School entry bindings differ. */
/* 로그인 후 모든 화면에서 유지되는 에이두 스타일 하단 HUD */
.aiedue-rpg-hud {
    position: fixed;
    left: max(24px, calc((100vw - 1100px) / 2 + 22px));
    bottom: 14px;
    z-index: 1050;
    width: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    color: #2c3e50;
    border: 0;
    background: transparent;
    box-shadow: none;
}

/* 상단의 중복 회원 정보 배너는 하단 HUD로 통합한다. */
.view-section > .absolute.top-0.left-0.w-full > [onclick="toggleInfoDrawer()"] {
    display: none !important;
}

.activity-profile-banner,
.drawing-header-banner {
    display: none !important;
}

.rpg-profile-banner {
    position: relative;
    width: 600px;
    min-width: 590px;
    height: 90px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 18px 86px;
    border: 2px solid rgba(255,255,255,.98);
    border-radius: 24px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 14px 36px rgba(50, 91, 69, .18), 0 0 0 2px rgba(183, 228, 161, .5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: width .36s cubic-bezier(.16, 1, .3, 1), min-width .36s cubic-bezier(.16, 1, .3, 1), height .36s cubic-bezier(.16, 1, .3, 1), padding .36s cubic-bezier(.16, 1, .3, 1), border-radius .36s ease;
}

.rpg-profile-portrait {
    position: absolute;
    left: 12px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border: 4px solid #fff;
    border-radius: 50%;
    background: linear-gradient(145deg, #fff4a8, #ffd45f);
    box-shadow: 0 6px 16px rgba(120, 148, 89, .22), 0 0 0 2px #b7e4a1;
}
.rpg-profile-portrait .sync-user-icon { font-size: 1.9rem; line-height: 1; }
.rpg-level-badge {
    position: absolute;
    right: -5px;
    bottom: -4px;
    min-width: 40px;
    padding: 3px 6px;
    border: 2px solid #fff;
    border-radius: 10px;
    color: #fff;
    background: #63b95a;
    font: 900 10px/1.1 Outfit, sans-serif;
    box-shadow: 0 3px 8px rgba(68, 137, 64, .25);
}

.rpg-profile-copy {
    min-width: 86px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    text-align: left;
    transition: opacity .18s ease, transform .3s cubic-bezier(.16, 1, .3, 1), visibility .18s ease;
}
.rpg-profile-copy strong { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #2c3e50; font-size: .94rem; }
.rpg-role-label { color: #62a958; font-size: .64rem; font-weight: 900; }
.rpg-wallet-line { display: flex; gap: 7px; margin-top: 2px; color: #72806f; font-size: .66rem; font-weight: 900; }
.rpg-profile-tools { margin-left: -8px; display: flex; align-items: center; gap: 3px; transform: translateX(-8px); transition: opacity .18s ease, transform .3s cubic-bezier(.16, 1, .3, 1), visibility .18s ease; }
.rpg-tool-button {
    min-width: 38px;
    width: 38px;
    height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    border: 1px solid #e1e9df;
    border-radius: 15px;
    background: #fff;
    color: #667366;
    font-size: .64rem;
    font-weight: 900;
    box-shadow: 0 5px 12px rgba(70, 95, 77, .08);
}
.rpg-tool-button > span:first-child { font-size: .92rem; }
.rpg-logout-button { color: #c46b6b; background: #fff8f7; border-color: #f4dddd; }
.rpg-student-shop-button { color: #3d8d64; background: #f3fbf4; border-color: #d5ead8; }
.rpg-expand-button { color: #4e9a61; border-color: #d5ead8; background: #f3fbf4; }
.rpg-review-button { color: #167a61; border-color: #bde8d7; background: #effbf6; }
.rpg-records-button { color: #3974a6; border-color: #c9def1; background: #f2f8fd; }
.rpg-tool-button.is-active { border-color: #24a36d; background: #dcf7e9; color: #116744; box-shadow: 0 0 0 2px rgba(36,163,109,.18); }
.rpg-expand-button > span:first-child { transition: transform .25s ease; }
.aiedue-rpg-hud.actions-open .rpg-expand-button > span:first-child { transform: rotate(180deg); }

.rpg-action-tray {
    width: 0;
    height: 68px;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 7px 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    border: 0 solid rgba(255,255,255,.98);
    border-radius: 22px;
    background: rgba(255,255,255,.94);
    box-shadow: none;
    transform: translateX(-18px);
    transition: width .3s cubic-bezier(.2,.8,.25,1), padding .3s ease, opacity .2s ease, transform .3s ease, border-width .3s ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.aiedue-rpg-hud.actions-open .rpg-action-tray {
    width: 540px;
    padding-inline: 7px;
    opacity: 1;
    pointer-events: auto;
    border-width: 2px;
    box-shadow: 0 14px 36px rgba(50, 91, 69, .18);
    transform: translateX(0);
}
.rpg-action-button {
    min-width: 0;
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    border: 2px solid transparent;
    border-radius: 19px;
    font-weight: 900;
    letter-spacing: -.02em;
    box-shadow: 0 7px 16px rgba(65, 108, 80, .1);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.rpg-action-button:hover, .rpg-tool-button:hover { filter: brightness(1.015); transform: translateY(-2px); box-shadow: 0 10px 20px rgba(65, 108, 80, .14); }
.rpg-action-button:active, .rpg-tool-button:active { transform: translateY(0); }
.rpg-action-button > span:last-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rpg-action-icon { font-size: 1.35rem; }
.rpg-cloud-button { flex-grow: 1.35; color: #397da4; border-color: #cfeaf5; background: linear-gradient(135deg, #f3fbff, #e7f7fd); }
.rpg-shop-button { color: #3d8d64; border-color: #ccebd7; background: linear-gradient(135deg, #f3fcf5, #e4f7e9); }
.rpg-settings-button { color: #6b7280; border-color: #e2e8f0; background: linear-gradient(135deg, #fff, #f7f8fa); }
.rpg-math-button { color: #137ac0; border-color: #bde3fb; background: linear-gradient(135deg, #f4fbff, #e2f4ff); }

.rpg-experience-track {
    position: absolute;
    left: 76px;
    right: 10px;
    bottom: 6px;
    height: 7px;
    overflow: hidden;
    border: 1px solid #cce8c3;
    border-radius: 999px;
    background: #eaf5e6;
}
.rpg-experience-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #81cf70, #a9e28b); box-shadow: 0 0 8px rgba(111, 201, 93, .45); transition: width .35s ease; }
.rpg-experience-label { position: absolute; right: 14px; bottom: 16px; color: #68a95f; font: 900 9px/1 Outfit, sans-serif; }

/* 학습 중에는 곰 얼굴만 남기고, 눌렀을 때 상태창이 옆으로 펼쳐진다. */
.aiedue-rpg-hud.rpg-collapsed {
    width: auto;
    max-width: none;
}
.aiedue-rpg-hud.rpg-collapsed .rpg-profile-banner {
    width: 86px;
    min-width: 86px;
    height: 86px;
    display: block;
    padding: 0;
    border-radius: 28px;
}
.aiedue-rpg-hud.rpg-collapsed .rpg-profile-portrait {
    position: absolute;
    left: 50%;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: 58px;
    height: 58px;
}
.aiedue-rpg-hud.rpg-collapsed .rpg-profile-copy,
.aiedue-rpg-hud.rpg-collapsed .rpg-profile-tools,
.aiedue-rpg-hud.rpg-collapsed .rpg-experience-track,
.aiedue-rpg-hud.rpg-collapsed .rpg-experience-label {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.aiedue-rpg-hud.rpg-collapsed .rpg-profile-copy {
    transform: translateX(-16px);
}
.aiedue-rpg-hud.rpg-collapsed .rpg-profile-tools {
    transform: translateX(-20px);
}

/* v69: 하단 HUD 메뉴 버튼이 상태바 테두리에 걸치지 않도록 중앙 정렬하고,
   단어 은행은 하단 펼침 메뉴가 아니라 각 단계 화면/전용 팝업에서만 연다. */
.aiedue-rpg-hud .rpg-action-tray .rpg-bank-button,
.aiedue-rpg-hud .rpg-action-tray [data-action="word-bank"] {
    display: none !important;
}

.aiedue-rpg-hud.experience-received .rpg-experience-track { animation: experienceTrackReceive .65s ease; }
@keyframes experienceTrackReceive { 45% { box-shadow: 0 0 0 6px rgba(129, 207, 112, .18), 0 0 18px rgba(129, 207, 112, .45); } }

/* The circle owns experience; the freed row is used for readable wallet/menu controls. */
#school-account-hud { width: min(800px, calc(100% - 36px)); }
#school-account-hud .rpg-profile-banner { height: 88px; padding: 6px 14px 6px 150px; gap: 16px; }
/* Draw the orb surround and panel as one silhouette, so overlaps have no seam. */
#school-account-hud .rpg-profile-banner {
    --hud-crown-size: 138px; --hud-crown-rise: 52px;
    --hud-panel-top: calc(var(--hud-crown-rise) - 2px);
    isolation: isolate; border-color: transparent; background: transparent; box-shadow: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
#school-account-hud .rpg-profile-banner::before {
    content: ''; position: absolute; inset: calc(0px - var(--hud-crown-rise)) -2px -2px;
    z-index: -1; pointer-events: none;
    background:
        radial-gradient(circle closest-side, #fff calc(100% - .5px), transparent) 6px 0 / var(--hud-crown-size) var(--hud-crown-size) no-repeat,
        linear-gradient(#fff, #fff) 24px var(--hud-panel-top) / calc(100% - 48px) calc(100% - var(--hud-panel-top)) no-repeat,
        linear-gradient(#fff, #fff) 0 calc(var(--hud-panel-top) + 24px) / 100% calc(100% - var(--hud-panel-top) - 48px) no-repeat,
        radial-gradient(circle at bottom right, #fff 23.5px, transparent 24px) 0 var(--hud-panel-top) / 24px 24px no-repeat,
        radial-gradient(circle at bottom left, #fff 23.5px, transparent 24px) 100% var(--hud-panel-top) / 24px 24px no-repeat,
        radial-gradient(circle at top right, #fff 23.5px, transparent 24px) 0 100% / 24px 24px no-repeat,
        radial-gradient(circle at top left, #fff 23.5px, transparent 24px) 100% 100% / 24px 24px no-repeat;
    filter: drop-shadow(0 -1px 0 #cde4c7) drop-shadow(1px 0 0 #cde4c7) drop-shadow(-1px 0 0 #cde4c7) drop-shadow(0 1px 0 #cde4c7) drop-shadow(0 14px 18px #325b452e);
    opacity: 1; transition: opacity .2s ease;
}
#school-account-hud.rpg-collapsed .rpg-profile-banner::before { opacity: 0; }
#school-account-hud .rpg-profile-portrait { left: 10px; top: auto; bottom: 4px; transform: none; width: 126px; height: 126px; background: #ffffff45; border: 2px solid #ffffffd9; overflow: visible; box-shadow: 0 4px 12px #789d412e, 0 0 0 1px #bfd995b3; }
.rpg-experience-circle { --experience: 0%; position: absolute; inset: 0; overflow: hidden; border-radius: 50%; background: linear-gradient(145deg, #ffffffb3, #f1f9d580 45%, #e2f3ba99); box-shadow: inset 0 1px 4px #fff, inset 0 -3px 8px #aacb754d; backdrop-filter: blur(6px); isolation: isolate; }
.rpg-circle-water { position: absolute; inset: auto 0 0; height: var(--experience); background: linear-gradient(135deg, #d1efabcc, #a7d96ec9 52%, #b5e885d9); box-shadow: inset 0 2px 0 #edfac6cc; }
.rpg-circle-water::before { content: ''; position: absolute; top: -5px; left: -30%; width: 160%; height: 12px; border-radius: 50%; background: linear-gradient(90deg, #d9efabd9, #b9dd84d9, #e1f4bccc); }
.rpg-experience-circle::after { content: ''; position: absolute; inset: 3px; border-radius: inherit; background: radial-gradient(ellipse at 24% 19%, #ffffffc9 0, #ffffff4d 14%, transparent 34%), linear-gradient(115deg, transparent 25%, #ffffff52 36%, transparent 48%); box-shadow: inset 1px 1px 2px #fff9, inset -1px -2px 3px #fff6; pointer-events: none; }
.rpg-circle-copy { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #4e7435; text-shadow: 0 1px 1px #ffffff80; font-weight: 700; z-index: 1; }
.rpg-circle-percent { font: 700 30px/1.2 Outfit, sans-serif; font-variant-numeric: tabular-nums; }
.rpg-circle-copy small { font: 600 11px/1.4 Outfit, sans-serif; letter-spacing: .12em; }
#school-account-hud .rpg-level-badge { right: -7px; bottom: -3px; min-width: 52px; font-size: 14px; padding: 5px 8px; background: linear-gradient(135deg, #81ad50, #68933f); z-index: 2; }
.rpg-experience-gain { position: absolute; left: 50%; top: 0; white-space: nowrap; color: #567d35; background: #f5ffe1ed; border: 1px solid #bdd891; border-radius: 99px; padding: 6px 12px; font: 700 20px/1.2 Outfit, sans-serif; box-shadow: 0 5px 16px #247d4326; pointer-events: none; z-index: 4; }
.rpg-experience-gain[hidden] { display: none; }
#school-account-hud.experience-received .rpg-profile-portrait { box-shadow: 0 0 0 4px #d4eb9d80, 0 0 20px #b3d97a80; }
#school-account-hud.experience-level-up .rpg-experience-circle { box-shadow: inset 0 0 18px #fff, inset 0 0 0 4px #ffe885; }
#school-account-hud .rpg-profile-copy { min-width: 150px; flex: 1; display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0 8px; }
#school-account-hud .rpg-profile-copy > strong { max-width: 180px; font-size: 15px; line-height: 1.25; }
#school-account-hud .rpg-role-label { font-size: 11px; }
#school-account-hud .rpg-wallet-line { grid-column: 1 / -1; flex-direction: column; gap: 1px; margin-top: 3px; font-size: 12px; width: 100%; }
.rpg-wallet-line > span { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; white-space: nowrap; }
.rpg-points { color: #875508; }
.rpg-warnings { color: #c52632; }
.rpg-wallet-line b { font-size: 18px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.rpg-wallet-line small { font-size: 11px; }
@media (min-width: 761px) {
    #school-account-hud .rpg-profile-copy { grid-template-columns: 124px auto; }
    #school-account-hud .rpg-wallet-line > span {
        display: grid; grid-template-columns: 124px auto; justify-content: start; gap: 8px;
    }
}
#school-account-hud .rpg-profile-tools { margin-left: 0; transform: none; gap: 6px; }
#school-account-hud .rpg-tool-button { min-width: 48px; width: 48px; height: 54px; font-size: 11px; gap: 2px; border-radius: 16px; }
#school-account-hud .rpg-tool-button > span:first-child { font-size: 22px; }
#school-account-hud .rpg-tool-button > span:last-child { display: block; }
#school-account-hud :focus-visible { outline: 3px solid #176b35; outline-offset: 4px; }
/* Folding changes the panel only; the orb retains its size and bottom anchor. */
#school-account-hud.rpg-collapsed { width: 146px; }
#school-account-hud.rpg-collapsed .rpg-profile-banner { width: 146px; min-width: 146px; height: 136px; padding: 0; border-color: transparent; background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
#school-account-hud.rpg-collapsed .rpg-profile-portrait { left: 10px; top: auto; bottom: 4px; transform: none; }
@media (max-width: 760px) {
    #school-account-hud .rpg-profile-banner { --hud-crown-size: 123px; --hud-crown-rise: 51px; }
    #school-account-hud .rpg-profile-banner { height: 124px; padding: 6px 12px 54px 133px; gap: 8px; }
    #school-account-hud .rpg-profile-portrait { width: 111px; height: 111px; top: auto; bottom: 54px; left: 10px; }
    #school-account-hud .rpg-profile-copy { min-width: 0; }
    #school-account-hud .rpg-circle-percent { font-size: 27px; }
    #school-account-hud .rpg-profile-copy > strong { font-size: 14px; }
    #school-account-hud .rpg-role-label { display: none; }
    #school-account-hud .rpg-profile-tools { position: absolute; bottom: 6px; left: 10px; right: 10px; justify-content: space-between; gap: 4px; }
    #school-account-hud .rpg-tool-button { min-width: 40px; width: 46px; flex: 1; max-width: 60px; height: 44px; gap: 0; font-size: 10px; }
    #school-account-hud .rpg-tool-button > span:first-child { font-size: 19px; }
    .aiedue-rpg-hud .rpg-action-tray {
        width: 0; max-width: calc(100vw - 16px); height: 0; display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0;
    }
    .aiedue-rpg-hud.actions-open .rpg-action-tray {
        width: min(340px, calc(100vw - 16px)); height: auto; padding: 7px;
    }
    #school-account-hud .rpg-action-button { width: 100%; min-width: 0; max-width: none; height: 50px; }
    #school-account-hud .rpg-action-button > span:last-child { white-space: normal; line-height: 1.15; }
    #school-account-hud.rpg-collapsed { width: 131px; }
    #school-account-hud.rpg-collapsed .rpg-profile-banner { width: 131px; min-width: 131px; height: 121px; }
}

.school-login-brand img { width: 220px; height: auto; }
.school-sidebar .school-sidebar-brand { margin: 0 0 12px; min-height: 88px; justify-content: center; }
.school-sidebar .school-sidebar-brand img { width: 180px; height: auto; }
.school-sidebar-toggle-row { display: flex; justify-content: flex-end; margin: -6px 0 12px; }
 .school-login-brand img { width: 190px; }
 .school-sidebar .school-sidebar-brand { min-height: 0; margin: 0; }
 .school-sidebar .school-sidebar-brand img { width: 126px; }
#school-account-hud { position: absolute; left: 12px; bottom: 12px; z-index: 130; max-width: calc(100% - 24px); font-family: 'Noto Sans KR', sans-serif; }
#school-account-hud .rpg-profile-banner { min-width: 0; width: 100%; }
#school-account-hud .rpg-action-tray { position: absolute; left: 0; bottom: calc(100% + 62px); }
#school-account-hud [hidden] { display: none !important; }
#school-account-hud button { cursor: pointer; }
.school-sidebar .dashboard-sidebar-panel { padding-bottom: 160px; }
@media (max-width: 760px) { #school-account-hud { left: 8px; bottom: 8px; max-width: calc(100% - 16px); } .school-sidebar .dashboard-sidebar-panel { padding-bottom: 10px; } .school-workspace-scroll { padding-bottom: 160px !important; } }
@media print { #school-account-hud { display: none; } }
/* Original Korean drawer card markup, anchored to the School frame. */
#school-account-popup { position: absolute; right: 0; top: 0; width: min(400px,100%); height: 100%; background: rgba(255,255,255,.94); backdrop-filter: blur(20px); box-shadow: -10px 0 40px #325b452e; padding: 32px; display: flex; flex-direction: column; gap: 24px; overflow-y: auto; z-index: 150; border-left: 1px solid #ffffffdf; }
#school-account-popup[hidden], #school-drawer-overlay[hidden] { display: none !important; }
#school-drawer-overlay { position: absolute; inset: 0; background: #0005; backdrop-filter: blur(3px); z-index: 140; }
#dashboard-container:has(#school-account-hud:not(.rpg-collapsed)) ~ #aiedu-chat-widget { bottom: 180px; }
body:has(#school-account-hud:not(.rpg-collapsed)) #aiedu-chat-widget { bottom: 180px; }
body:has(#school-account-popup:not([hidden])) #aiedu-chat-widget { visibility: hidden; }
