.immersive-mode { overflow: hidden; background: #dce5e3; }
.immersive-shell { position: relative; isolation: isolate; width: 100%; max-width: none; height: 100dvh; min-height: 540px; padding: 0; margin: 0; overflow: hidden; font-family: 'Times New Roman', 'PMingLiU', serif; }
.classroom-canvas { position: absolute; inset: 0; z-index: -1; }
.classroom-canvas canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.classroom-canvas canvas:active { cursor: grabbing; }
.room-header { position: absolute; z-index: 4; inset: 0 0 auto; display: flex; justify-content: space-between; gap: 20px; align-items: center; height: 80px; padding: 15px 25px; background: #f9fcf8ef; border-bottom: 1px solid #c7d6d0; }
.room-identity { display: flex; gap: 16px; align-items: center; }
.room-identity > a { font: 700 25px 'Times New Roman', serif; color: #087f83; }
.room-brand-caption { display: none !important; }
.room-divider { width: 1px; height: 30px; background: #c5d3ce; }
.room-identity > div strong { font-size: 15px; display: block; }
.room-identity small { color: #6d7f79; font-size: 11px; display: block; margin-top: 3px; }
.room-header-actions { display: flex; gap: 12px; align-items: center; }
.room-tool { width: 37px; height: 37px; display: inline-grid; place-items: center; border-radius: 4px; border: 1px solid transparent; color: #49675d; background: transparent; flex-shrink: 0; }
.room-tool:hover { background: #e0ebe5; border-color: #c3d6ca; }
.room-tool svg { width: 19px; height: 19px; }
.room-prototype { font-size: 11px; color: #688278; padding-right: 10px; }
.room-example { font-size: 13px; display: flex; align-items: center; gap: 7px; color: #256f66; padding: 7px 10px; }
.room-end { display: flex; gap: 8px; align-items: center; color: #285b53; padding: 8px 13px; border: 1px solid #9ab8aa; border-radius: 4px; font-size: 14px; margin-left: 8px; }
.room-end:hover { background: #dae9df; }
.room-topic { position: absolute; top: 98px; left: 26px; display: flex; gap: 9px; align-items: center; background: #f9fcf3e8; border: 1px solid #b3c8bc; padding: 11px 15px; border-radius: 4px; max-width: calc(100% - 52px); color: #345d52; font-size: 16px; line-height: 1.5; text-align: left; z-index: 2; box-shadow: 0 3px 14px #26413710; }
.room-topic > svg:last-child { width: 14px; height: 14px; }
.world-labels { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.world-student { position: absolute; transform: translate(-50%, 0); pointer-events: auto; padding: 7px 17px 8px; color: #234b43; background: #f9fcf6ed; box-shadow: 0 4px 12px #233c3026; border: 1px solid #c1d3c7; border-radius: 5px; min-width: 105px; text-align: left; line-height: 1.35; }
.world-student .world-state { display: block; font-size: 10px; color: #6a8878; }
.world-student strong { display: block; font-size: 16px; margin-top: 3px; }
.world-signal { position: absolute; right: 10px; top: 23px; display: none; }
.world-student.raised:not(.speaking) .world-signal { display: inline; }
.world-signal svg { width: 16px; height: 16px; }
.world-student.selected { border-color: #147c78; background: #e4f4e8; box-shadow: 0 0 0 2px #147c7840, 0 4px 12px #233c3026; }
.world-student.speaking { border-color: #087f83; color: #fff; background: #087f83; }
.world-student.speaking .world-state { color: #d5eee4; }
.room-coach { position: absolute; top: 98px; right: 25px; width: 290px; z-index: 3; border: 1px solid #b4cec0; border-radius: 5px; background: #f9fcf5f2; box-shadow: 0 6px 24px #193b2f12; padding: 13px 17px 16px; }
.room-coach header { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #5f7c6d; font-size: 12px; margin-bottom: 8px; }
.room-coach header > span { display: flex; align-items: center; gap: 7px; }
.room-coach .room-tool { width: 25px; height: 25px; }
.room-coach h2 { font-size: 18px; margin: 9px 0 12px; }
.room-coach p { font-size: 14px; line-height: 1.85; color: #5b7569; margin-bottom: 12px; }
.room-coach-purpose { color: #087f83; font-size: 13px; border-top: 1px solid #d3e3d8; padding-top: 11px; }
.room-coach-purpose > span { display: block; font-size: 12px; margin-top: 2px; }
.coach-demonstrate { display: flex; gap: 7px; align-items: center; color: #3d7764; font-size: 12px; margin-top: 14px; padding: 0; }
.coach-demonstrate svg { width: 16px; height: 16px; }
.coach-reopen { position: absolute; top: 99px; right: 25px; background: #f9fcf5ed; border: 1px solid #b4cec0; padding: 10px 13px; border-radius: 4px; color: #4c7663; font-size: 12px; }
.room-perspective { position: absolute; bottom: 27px; left: 25px; display: flex; align-items: center; gap: 6px; color: #527163; font-size: 12px; background: #f8fcf5c9; padding: 3px 9px 3px 3px; border-radius: 4px; }
.room-subtitle { position: absolute; bottom: 170px; left: 50%; transform: translateX(-50%); width: min(780px, calc(100% - 60px)); background: #f8fcf5f0; border: 1px solid #b9d0bf; box-shadow: 0 4px 20px #26442f15; border-radius: 5px; padding: 12px 48px 13px 17px; }
.room-subtitle > span { font-size: 12px; font-weight: 700; color: #087f83; }
.room-subtitle p { font-size: 17px; margin: 5px 0 0; line-height: 1.7; color: #294c41; max-height: 88px; overflow-y: auto; }
.room-subtitle > button { position: absolute; top: 12px; right: 12px; color: #759284; padding: 5px; }
.room-subtitle.teacher > span { color: #b86345; }
.room-controls { position: absolute; bottom: 17px; left: 50%; transform: translateX(-50%); width: min(680px, calc(100% - 42px)); min-height: 130px; display: grid; grid-template-columns: 1fr 1.4fr 1fr; align-items: center; padding: 12px 25px 10px; background: #f4faf3f0; border: 1px solid #bdd2c0; border-radius: 7px; box-shadow: 0 6px 28px #34593a26; }
.room-target > span { display: block; color: #7a8b7d; font-size: 11px; }
.room-target strong { display: block; font-size: 18px; margin-top: 6px; }
.room-target button { font-size: 11px; color: #648777; padding: 6px 0 0; }
.voice-control { text-align: center; display: flex; flex-direction: column; align-items: center; }
.room-mic { width: 65px; height: 65px; padding: 0; background: #087f83; color: #fff; border: 4px solid #e6f3e6; outline: 1px solid #a9cabc; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 4px 12px #287b6e25; user-select: none; touch-action: none; }
.room-mic svg { width: 29px; height: 29px; }
.room-mic:hover { background: #086f71; }
.room-mic.recording { background: #bd5d4d; outline-color: #bd5d4d; box-shadow: 0 0 0 7px #bd5d4d25; }
.voice-control strong { font-size: 13px; margin-top: 6px; }
.voice-control > span { font-size: 10px; color: #7a9181; margin-top: 3px; white-space: nowrap; }
.room-session { text-align: right; }
.room-session > span { display: block; font-family: 'Times New Roman', serif; font-size: 20px; color: #5b7869; font-variant-numeric: tabular-nums; }
.room-session > div { display: flex; gap: 3px; justify-content: flex-end; }
.room-session small { display: block; color: #8b9b8e; font-size: 10px; }
.room-pending { position: absolute; bottom: 165px; left: 50%; transform: translateX(-50%); z-index: 6; width: min(600px, calc(100% - 40px)); padding: 12px 15px; background: #fcfdf8; border: 1px solid #9bbda5; border-radius: 5px; box-shadow: 0 5px 28px #284e3330; }
.room-pending > label { display: block; font-size: 12px; color: #5d7c68; margin-bottom: 6px; }
.room-pending textarea { min-height: 70px; font-size: 15px; border: 0; padding: 3px; margin: 0; background: transparent; resize: none; }
.room-pending > div { display: flex; gap: 8px; justify-content: flex-end; }
.room-pending [data-room=confirm-draft] { background: #087f83; color: #fff; }
.room-history { position: absolute; z-index: 8; top: 80px; right: 0; bottom: 0; width: min(390px, 100%); background: #f9fcf7fa; border-left: 1px solid #b9cfc2; box-shadow: -7px 0 30px #24402f20; display: flex; flex-direction: column; }
.room-history > header, .room-task > header { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 15px 20px; border-bottom: 1px solid #d3e3d7; }
.room-history h2, .room-task h2 { font-size: 18px; }
#room-history-body { overflow: auto; padding: 10px 20px; }
.room-log { border-bottom: 1px solid #d7e5d9; padding: 13px 0; }
.room-log small { color: #357767; font-size: 12px; }
.room-log p { margin: 6px 0 0; font-size: 14px; line-height: 1.8; }
.room-log.teacher small { color: #b46e53; }
.room-task { position: absolute; top: 155px; left: 25px; width: min(470px, calc(100% - 50px)); background: #fbfdf7fa; border: 1px solid #b5cebc; border-radius: 5px; z-index: 7; box-shadow: 0 5px 20px #24402f20; }
.room-task h3 { padding: 20px 20px 15px; font-size: 18px; }
.room-task p { padding: 0 20px; font-size: 15px; line-height: 1.85; }
.room-task small { display: block; padding: 0 20px 20px; color: #7b9280; font-size: 11px; }
.room-notice { position: absolute; top: 95px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 40px); padding: 11px 18px; color: #fff; background: #365f4f; border-radius: 5px; z-index: 10; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.room-notice.visible { opacity: 1; }
.room-paused .classroom-canvas { filter: saturate(.6); }
.room-webgl-error { max-width: 550px; margin: 180px auto; padding: 25px; }
@media (max-width: 1000px) {
  .room-identity { gap: 10px; }
  .room-header { padding-inline: 17px; }
  .room-header-actions { gap: 5px; }
  .room-prototype { display: none; }
  .room-coach { width: 255px; top: 160px; right: 16px; padding: 10px 14px 13px; }
  .room-coach h2 { font-size: 16px; }
  .room-coach p { font-size: 13px; }
}
@media (max-width: 650px) {
  .immersive-shell { min-height: 570px; }
  .room-header { height: 65px; padding: 9px 11px; gap: 8px; }
  .room-identity { gap: 6px; }
  .room-identity > a { font-size: 19px; }
  .room-brand-caption { display: block !important; font: 9px 'Times New Roman', 'PMingLiU', serif !important; color: #6d7f79; margin-top: 1px !important; }
  .room-identity > div, .room-divider { display: none; }
  .room-header-actions { gap: 2px; }
  .room-tool { width: 31px; height: 34px; padding: 5px; }
  .room-tool svg { width: 17px; height: 17px; }
  .room-example { padding: 5px; }
  .room-example > span { display: none; }
  .room-header [data-room=fullscreen] { display: none; }
  .room-end { margin-left: 3px; padding: 6px 7px; gap: 5px; font-size: 12px; }
  .room-end svg { width: 16px; height: 16px; }
  .room-topic { top: 80px; left: 15px; max-width: calc(100% - 30px); font-size: 14px; padding: 9px 11px; }
  .room-topic > svg:first-child { width: 16px; height: 16px; }
  .room-coach { top: 134px; width: min(300px, calc(100% - 30px)); right: 15px; }
  .coach-reopen { top: 133px; right: 15px; padding: 7px 10px; }
  .world-student { min-width: 77px; padding: 5px 9px 6px; border-radius: 4px; }
  .world-student strong { font-size: 14px; }
  .world-state { font-size: 9px !important; }
  .world-signal { top: 20px; right: 7px; }
  .world-signal svg { width: 12px; height: 12px; }
  .room-controls { bottom: 13px; width: calc(100% - 26px); min-height: 133px; padding: 10px 12px; grid-template-columns: 1fr 1.6fr 1fr; }
  .room-mic { width: 60px; height: 60px; }
  .voice-control strong { font-size: 12px; }
  .voice-control > span { font-size: 9px; white-space: normal; max-width: 150px; }
  .room-target > span { font-size: 9px; }
  .room-target strong { font-size: 15px; }
  .room-target button { font-size: 10px; }
  .room-session > span { font-size: 17px; }
  .room-subtitle { bottom: 161px; width: calc(100% - 30px); padding: 10px 37px 11px 12px; }
  .room-subtitle > span { font-size: 10px; }
  .room-subtitle p { font-size: 14px; line-height: 1.7; max-height: 73px; }
  .room-subtitle > button { top: 10px; right: 8px; padding: 3px; }
  .room-subtitle > button svg { width: 16px; height: 16px; }
  .room-perspective { bottom: 152px; left: 15px; display: none; }
  .room-pending { bottom: 160px; width: calc(100% - 30px); }
  .room-task { top: 132px; left: 15px; width: calc(100% - 30px); }
  .room-history { top: 65px; }
  .room-notice { top: 130px; font-size: 12px; width: calc(100% - 30px); }
}
@media (max-height: 700px) and (min-width: 651px) {
  .room-header { height: 65px; }
  .room-topic, .room-coach { top: 80px; }
  .room-coach { max-height: 235px; overflow: auto; }
  .room-controls { min-height: 112px; padding-block: 7px; bottom: 10px; }
  .room-mic { width: 52px; height: 52px; }
  .room-subtitle { bottom: 137px; padding-block: 8px; }
  .room-subtitle p { font-size: 15px; max-height: 55px; }
}
