:root { --panel: rgba(18, 22, 28, 0.72); --line: rgba(255, 255, 255, 0.16); --fg: #f2f4f6; --dim: #aab3bd; --accent: #f0b429; --gap: clamp(8px, 1.4vw, 16px); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #10141a; color: var(--fg); font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
kbd { display: inline-block; min-width: 1.5em; padding: 0 .35em; margin: 0 .1em; text-align: center; font: 600 12px/1.6 ui-monospace, Menlo, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: rgba(255, 255, 255, .08); }
button { font: inherit; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
button:hover { border-color: rgba(255, 255, 255, .4); }
button.on { background: var(--accent); border-color: var(--accent); color: #1a1a1a; }
button.on kbd { border-color: rgba(0, 0, 0, .35); background: rgba(0, 0, 0, .1); }
.dim { color: var(--dim); }

#loading { position: fixed; inset: 0; display: grid; place-items: center; background: #10141a; z-index: 10; }
#loading .box { width: min(520px, 88vw); }
#loading h1 { font-size: 20px; margin: 0 0 6px; }
#loading .bar { height: 4px; background: rgba(255, 255, 255, .12); border-radius: 2px; overflow: hidden; }
#loading .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
#loading pre { white-space: pre-wrap; color: #ffb4a8; background: rgba(255, 80, 60, .08); border: 1px solid rgba(255, 80, 60, .35); border-radius: 8px; padding: 10px; margin-top: 12px; }

button:disabled { opacity: .45; cursor: default; }

/* corners: title + status top left, help top right, chat (and the touch stick under it) bottom left, actions bottom right */
#top { position: fixed; top: var(--gap); left: var(--gap); pointer-events: none; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
#place { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100vw - var(--help-w, 0px) - 3 * var(--gap)); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
#lift-floors { display: contents; }
#top > * { pointer-events: auto; }
#place { color: var(--fg); font: inherit; cursor: pointer; text-align: left; }
#guide { display: flex; align-items: center; gap: 6px; background: var(--accent); color: #1a1a1a; border-radius: 12px; padding: 4px 6px 4px 12px; font-weight: 600; max-width: calc(100vw - var(--help-w, 0px) - 3 * var(--gap)); }
#guide button { padding: 0 7px; background: rgba(0, 0, 0, .12); border-color: rgba(0, 0, 0, .25); color: #1a1a1a; }
#dir { position: fixed; left: 50%; top: 12vh; transform: translateX(-50%); z-index: 25; width: min(420px, 92vw); max-height: 70vh; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; background: rgba(18, 22, 30, 0.95); border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(0, 0, 0, .45); }
.dir-head { display: flex; justify-content: space-between; align-items: center; } .dir-head button { padding: 0 9px; }
#dir-search { padding: 8px 10px; border-radius: 8px; border: 1px solid #47506a; background: #0e1118; color: inherit; font: inherit; }
#dir-list { overflow-y: auto; min-height: 0; } #dir-list h3 { margin: 8px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); }
.dir-room { display: flex; align-items: center; gap: 6px; padding: 3px 0; } .dir-room span { flex: 1; min-width: 0; } .dir-room button { padding: 4px 10px; } .dir-none { color: var(--dim); margin: 8px 0; }
#top > * { pointer-events: auto; }
.title { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; white-space: nowrap; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.title span { color: var(--dim); margin-left: 8px; }

#help { position: fixed; top: var(--gap); right: var(--gap); z-index: 13; display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  max-width: min(430px, calc(100vw - var(--title-w, 0px) - 3 * var(--gap))); max-height: calc(100vh - 2 * var(--gap) - var(--actions-h, 40px) - 8px); }
#help-toggle { padding: 6px 10px; white-space: nowrap; flex: none; }
#help ul { margin: 0; padding: 8px 14px 10px; list-style: none; overflow-y: auto; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
#help li { margin: 3px 0; }
#help li.about { margin-top: 6px; padding-top: 5px; border-top: 1px dashed var(--line); font-size: 12px; }
#help.collapsed ul { display: none; }

#status { position: fixed; left: var(--gap); top: calc(var(--gap) + var(--top-h, 34px) + 8px); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; pointer-events: none; white-space: nowrap; max-width: calc(100vw - var(--help-w, 0px) - 3 * var(--gap)); overflow: hidden; text-overflow: ellipsis; }
#actions { position: fixed; right: var(--gap); bottom: var(--gap); display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 46vw; }
#actions button { min-width: 64px; min-height: 40px; }
.touch-only { display: none; }
.touch-help { display: none; }
#stick { position: fixed; left: calc(var(--gap) + 8px); bottom: calc(var(--gap) + 8px); width: 120px; height: 120px; border-radius: 50%; background: rgba(18, 22, 28, .45); border: 1px solid var(--line); touch-action: none; }
#stick i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px; border-radius: 50%; background: rgba(255, 255, 255, .35); }

@media (max-width: 900px) { body { font-size: 13px; } }
@media (max-width: 620px) { .title:not(.partial) span { display: none; } }
/* touch: stick bottom left with the chat above it, action grid bottom right */
@media (pointer: coarse) {
  .touch-only { display: inline-block; }
  .touch-help { display: list-item; }
  .key-help { display: none; }
  #help-toggle kbd { display: none; }
  #actions { display: grid; grid-template-columns: 1fr 1fr; max-width: none; width: min(190px, 48vw); }
  #actions button { min-height: 46px; min-width: 0; padding: 8px 6px; }
  #actions kbd { display: none; }
  #status { white-space: normal; border-radius: 12px; }
}

/* multiplayer: entry screen, chat, name plates, speech bubbles */
#entry { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 30; width: min(320px, 86vw); display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; border-radius: 14px; background: rgba(18, 22, 30, 0.94); color: #f2f4f8; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45); font: 14px/1.35 system-ui, sans-serif; }
#entry h2 { margin: 0 0 4px; font-size: 17px; } #entry label { font-size: 12px; opacity: 0.75; }
#entry input { padding: 8px 10px; border-radius: 8px; border: 1px solid #47506a; background: #0e1118; color: inherit; font: inherit; }
#entry-colors { display: flex; gap: 8px; flex-wrap: wrap; } .swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; } .swatch.on { border-color: #fff; box-shadow: 0 0 0 2px #1b2030; }
.entry-row { display: flex; gap: 6px; flex-wrap: wrap; } .pick { padding: 6px 9px; border-radius: 8px; border: 1px solid #47506a; background: #0e1118; color: #e8ecf4; font: 12px system-ui, sans-serif; cursor: pointer; } .pick.on { border-color: #f0b429; background: #2a2414; color: #ffd166; }
#entry-join { margin-top: 6px; padding: 9px; border: 0; border-radius: 8px; background: #f0b429; color: #1b1e25; font: 600 14px system-ui, sans-serif; cursor: pointer; }
/* the chat column ends below the status line (--below-status) and whatever toasts hang under it (--toasts-h, measured): its log gives way first */
:root { --below-status: calc(var(--gap) + var(--top-h, 34px) + 8px + var(--status-h, 0px) + 8px); }
#chat { position: fixed; left: var(--gap); bottom: var(--gap); z-index: 12; width: min(300px, 46vw); max-height: calc(100vh - var(--gap) - var(--below-status) - var(--toasts-h, 0px) - 8px); display: flex; flex-direction: column; gap: 4px; font: 12.5px/1.35 system-ui, sans-serif; color: #f2f4f8; }
@media (pointer: coarse) { #chat { bottom: calc(var(--gap) + 136px); max-height: calc(100vh - var(--gap) - 136px - var(--below-status) - var(--toasts-h, 0px) - 8px); } }      /* above the stick (8 + 120 + 8) */
/* a phone held sideways has no height for that: the chat column stands beside the stick, up to the buttons on the right */
@media (pointer: coarse) and (max-height: 500px) { #chat { left: calc(var(--gap) + 136px); bottom: var(--gap); width: min(300px, calc(54vw - 136px - 3 * var(--gap))); max-height: calc(100vh - var(--gap) - var(--below-status) - var(--toasts-h, 0px) - 8px); } }
/* phone upright: the open help ends above the chat (stick 136 px + the chat at its tallest 190 px), and scrolls inside */
@media (pointer: coarse) and (max-width: 620px) { #help { max-height: calc(100vh - 2 * var(--gap) - 136px - 190px - 8px); } }
#chat-status { align-self: flex-start; padding: 2px 8px; border-radius: 9px; background: rgba(18, 22, 30, 0.72); font-size: 11px; } #chat-status.off { background: rgba(140, 40, 30, 0.8); }
#chat-log { max-height: 120px; flex: 0 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9); }
.chat-line { overflow-wrap: anywhere; } .chat-line.sys { opacity: 0.7; font-style: italic; }
#chat-input { padding: 6px 9px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(18, 22, 30, 0.6); color: inherit; font: inherit; } #chat-input:focus { outline: none; background: rgba(18, 22, 30, 0.92); border-color: #f0b429; }
#plates { position: fixed; inset: 0; z-index: 8; pointer-events: none; overflow: hidden; }
.plate-hint { padding: 2px 8px; border-radius: 9px; background: var(--accent); color: #1a1a1a; }
.bubble.shout { max-width: none; white-space: nowrap; font: 800 20px/1.2 system-ui, sans-serif; color: #1a1a1a; background: var(--accent); padding: 7px 14px; border-radius: 14px; box-shadow: 0 3px 14px rgba(0, 0, 0, .45); }
/* short notices: under the status line at the left, so they stay inside the window and clear of the help, the object panel and the buttons on the right */
#toasts { position: fixed; left: var(--gap); top: var(--below-status); z-index: 14; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; pointer-events: none; max-width: min(48vw, 420px); }
.toast { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; padding: 6px 12px; border-radius: 16px; overflow-wrap: anywhere; background: rgba(18, 22, 30, 0.9); border: 1px solid var(--line); color: #f2f4f8; font: 600 13.5px/1.3 system-ui, sans-serif; text-align: center; }
.plate { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; white-space: nowrap; font: 600 12px/1.2 system-ui, sans-serif; }
.plate-name { padding: 2px 8px; border-radius: 9px; background: rgba(18, 22, 30, 0.72); color: #fff; }
.bubble { max-width: 220px; white-space: normal; overflow-wrap: anywhere; text-align: center; padding: 5px 9px; border-radius: 10px; background: rgba(255, 255, 255, 0.95); color: #1b1e25; font-weight: 500; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
@media (max-height: 500px) { #chat-log { max-height: 48px; } }      /* short windows: the chat stays clear of the status line */

/* interior interactions: the prompt at the thing the use key acts on, the NPC panel in the chat column, NPC answers in the chat log */
#use-prompt { position: fixed; left: 0; top: 0; z-index: 9; pointer-events: none; padding: 3px 10px; border-radius: 10px; background: var(--accent); color: #1a1a1a; font: 700 12.5px/1.2 system-ui, sans-serif; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); }
#use-prompt.off { background: rgba(18, 22, 30, 0.82); color: #f2f4f8; }
#btn-use { background: var(--accent); color: #1a1a1a; border-color: transparent; font-weight: 700; }
#npc-panel { display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 4px 6px; padding: 6px 8px; border-radius: 10px; background: rgba(18, 22, 30, 0.86); border: 1px solid var(--line); flex: none; }
#npc-name { grid-area: 1 / 1 / 2 / 3; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } #npc-voice-gear { grid-area: 1 / 3; } #npc-mic { grid-area: 2 / 1; } #npc-type { grid-area: 2 / 2 / 3 / 4; }      /* name and gear, then the two ways to talk */
#npc-starters { grid-area: 3 / 1 / 4 / 4; } #npc-voice { grid-area: 4 / 1 / 5 / 4; } #npc-voice-opts { grid-area: 5 / 1 / 6 / 4; }
#npc-panel[hidden] { display: none; }
#npc-name { font-weight: 700; color: var(--accent); }
#npc-starters { display: flex; flex-direction: column; gap: 3px; }
#npc-panel button { text-align: left; padding: 5px 8px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.08); color: inherit; font: inherit; cursor: pointer; min-height: 0; }
#npc-panel button:hover:not(:disabled) { background: rgba(240, 180, 41, 0.25); } #npc-panel button:disabled { opacity: 0.55; cursor: default; }
#npc-type { font-size: 11px; opacity: 0.9; padding: 2px 8px; }
#chat-input.to-npc { border-color: var(--accent); background: rgba(40, 32, 10, 0.92); }
.chat-line.npc, .chat-line.tip, .chat-line.ask { padding: 3px 7px; border-radius: 7px; background: rgba(18, 22, 30, 0.78); text-shadow: none; margin-top: 2px; }
.chat-line.tip { color: #ffe9a8; font-size: 11.5px; } .chat-line.ask { opacity: 0.85; }
.npc-listen { margin-left: 6px; padding: 1px 7px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.1); color: inherit; font: inherit; font-size: 11px; cursor: pointer; min-height: 0; pointer-events: auto; }
.npc-listen.on { background: var(--accent); color: #1a1a1a; } .npc-listen:disabled { opacity: 0.5; cursor: default; }
.plate.npc .plate-name { background: rgba(47, 143, 143, 0.9); } .plate.npc.target .plate-name { background: var(--accent); color: #1a1a1a; }
#chat.talking #chat-log { max-height: min(240px, 34vh); }
@media (max-height: 500px) { #chat.talking #chat-log { max-height: 96px; } #npc-starters button { padding: 3px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } #chat.talking #chat-status { display: none; } }

/* the panel of a shared object (screen, sticky wall, book shelf): right side, between the help button and the action buttons; scrolls inside */
#obj-panel { position: fixed; right: var(--gap); top: max(calc(var(--gap) + 46px), var(--below-status)); z-index: 13; width: min(340px, 44vw); max-height: calc(100vh - var(--actions-h, 100px) - 2 * var(--gap) - max(calc(var(--gap) + 46px), var(--below-status))); display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 12px; background: rgba(18, 22, 30, 0.93); border: 1px solid var(--line); color: var(--fg); font: 13px/1.4 system-ui, sans-serif; }
#obj-panel[hidden] { display: none; }
#obj-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--accent); }
#obj-close { min-width: 0; min-height: 0; padding: 2px 8px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: inherit; cursor: pointer; }
#obj-panel { overflow: hidden; } #obj-head, #obj-bar { flex: none; }
#obj-body { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; min-height: 0; }
#obj-bar { display: flex; flex-wrap: wrap; gap: 6px; }
#obj-panel button { font: inherit; } #obj-bar button, .obj-form button, .obj-head { padding: 5px 10px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.08); color: inherit; cursor: pointer; min-height: 0; min-width: 0; }
#obj-bar button:hover:not(:disabled), .obj-form button:hover, .obj-head:hover { background: rgba(240, 180, 41, 0.25); } #obj-bar button:disabled { opacity: 0.5; cursor: default; } #obj-bar button.on, .obj-head.on { background: var(--accent); color: #1a1a1a; border-color: transparent; }
.obj-big { font-size: 16px; font-weight: 700; } .obj-dim { color: var(--dim); font-size: 11.5px; } .obj-sub { margin-top: 5px; color: var(--accent); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; }
.obj-item::before { content: "• "; color: var(--accent); } .obj-lyric { font-size: 14.5px; font-weight: 600; } .obj-en { font-weight: 600; margin-top: 3px; } .obj-vi { color: #b9c7d6; font-size: 12px; font-style: italic; }
.obj-heads { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; } .obj-head { font-size: 11px; padding: 3px 8px; }
.obj-form { display: flex; gap: 6px; margin: 4px 0; } #obj-note { flex: 1; min-width: 0; padding: 5px 8px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(18, 22, 30, 0.6); color: inherit; font: inherit; } #obj-note:focus { outline: none; border-color: var(--accent); }
.obj-note { padding: 3px 7px; border-radius: 7px; background: rgba(255, 255, 255, 0.07); } .obj-note i { color: var(--dim); } .obj-del { float: right; padding: 0 6px; border-radius: 7px; border: 1px solid var(--line); background: transparent; color: inherit; cursor: pointer; min-height: 0; min-width: 0; }
#look-prompt { position: fixed; left: 0; top: 0; z-index: 9; pointer-events: none; padding: 3px 10px; border-radius: 10px; background: rgba(18, 22, 30, 0.88); border: 1px solid var(--accent); color: #fff; font: 700 12.5px/1.2 system-ui, sans-serif; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); }
#btn-look { border-color: var(--accent); }
@media (max-height: 500px) { #obj-panel { width: min(300px, 44vw); font-size: 12px; padding: 7px 9px; } }
/* a phone held sideways: the buttons fill the right side, so the object's panel takes the chat column's place beside the stick while it is open */
@media (pointer: coarse) and (max-height: 500px) { #obj-panel { right: auto; left: calc(var(--gap) + 136px); width: min(340px, calc(54vw - 136px - 3 * var(--gap))); top: calc(var(--below-status) + var(--toasts-h, 0px)); max-height: calc(100vh - var(--gap) - var(--below-status) - var(--toasts-h, 0px)); } body.obj-open #chat { display: none; } }

/* voice: the microphone button, what it is doing, the options behind the gear */
#npc-mic, #npc-voice-gear { font-size: 11px; opacity: 0.95; padding: 2px 8px; white-space: nowrap; } #npc-panel #npc-mic, #npc-panel #npc-type { text-align: center; }
#npc-mic.on { background: #b0433c; border-color: transparent; color: #fff; opacity: 1; } #npc-mic.live { animation: mic-pulse 1.1s ease-in-out infinite; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 4px rgba(176, 67, 60, 0.35); } }
@media (prefers-reduced-motion: reduce) { #npc-mic.live { animation: none; outline: 2px solid #fff; } }
#npc-mic kbd { font-size: 10px; }
#npc-voice { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 11.5px; line-height: 1.3; } #npc-voice[hidden], #npc-voice-opts[hidden] { display: none; }
#npc-voice-text { flex: 1 1 60%; min-width: 0; overflow-wrap: anywhere; } #npc-voice.live #npc-voice-text { color: #ffb4ad; font-weight: 600; } #npc-voice.busy #npc-voice-text { color: #ffe9a8; } #npc-voice.error #npc-voice-text { color: #ffb4ad; }
#npc-send, #npc-voice-use, #npc-voice-alt { flex: none; padding: 3px 10px; font-size: 11.5px; } #npc-voice-switch { align-self: flex-start; padding: 3px 9px; font-size: 11px; } #npc-voice-switch[hidden] { display: none; } #npc-send { background: var(--accent); color: #1a1a1a; border-color: transparent; font-weight: 700; }
#npc-voice-opts { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; padding-top: 2px; border-top: 1px solid var(--line); }
.voice-opt { display: flex; align-items: center; gap: 6px; min-height: 24px; cursor: pointer; } .voice-opt input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
#npc-voice-note { color: var(--dim); font-size: 10.5px; line-height: 1.3; }
@media (pointer: coarse) { #npc-mic, #npc-type, #npc-voice-gear { padding: 5px 9px; } .voice-opt { min-height: 32px; } .voice-opt input { width: 20px; height: 20px; } #npc-send, #npc-voice-use, #npc-voice-alt, #npc-voice-switch { padding: 6px 12px; } }

/* classroom lesson (net/hud.js setLesson): the bar above the NPC panel while the player sits on a student seat */
#lesson-bar { display: flex; flex-direction: column; gap: 4px; padding: 6px 8px; border-radius: 10px; background: rgba(16, 53, 63, 0.92); border: 1px solid rgba(240, 180, 41, 0.45); flex: none; }
#lesson-bar[hidden], #lesson-last[hidden], #lesson-rows[hidden], #lesson-note[hidden] { display: none; }
#lesson-rows { display: flex; flex-direction: column; gap: 3px; } .lesson-row { display: flex; gap: 6px; align-items: flex-start; } .lesson-text { min-width: 0; flex: 1 1 auto; } .lesson-row .en { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.lesson-row .vi { font-size: 11px; color: #9fc3cc; line-height: 1.25; } #lesson-bar.no-gloss .vi { display: none; } .lesson-row.hint .en { color: #ffe9a8; font-weight: 500; } .lesson-row.cmp .en { color: #ffb347; font-weight: 500; font-size: 11.5px; }
#lesson-bar .lesson-listen { flex: none; padding: 1px 6px; } #lesson-bar .lesson-listen.on { background: var(--accent); border-color: transparent; } #lesson-note { font-size: 10.5px; color: var(--dim); line-height: 1.3; }
#lesson-vi[aria-pressed="true"] { background: rgba(159, 195, 204, 0.3); } #chat.in-lesson #npc-starters { display: none; }
#lesson-bar.mine { border-color: #ff8a80; box-shadow: 0 0 0 1px rgba(255, 138, 128, 0.5); }
#lesson-title { font-weight: 700; color: var(--accent); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#lesson-status { font-size: 11.5px; line-height: 1.3; min-width: 0; overflow-wrap: anywhere; }
#lesson-acts { display: flex; gap: 6px; flex-wrap: wrap; } #lesson-acts > span { display: contents; } #lesson-last { display: flex; gap: 6px; align-items: center; font-size: 11.5px; }
#lesson-last span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#lesson-bar button { padding: 3px 9px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.09); color: inherit; font: inherit; font-size: 11.5px; cursor: pointer; min-height: 0; white-space: nowrap; }
#lesson-bar button:hover:not(:disabled) { background: rgba(240, 180, 41, 0.25); } #lesson-bar button:disabled { opacity: 0.55; cursor: default; } #lesson-bar button[hidden] { display: none; }
#lesson-bar button kbd { font-size: 10px; } #lesson-turn.on { background: #b0433c; border-color: transparent; color: #fff; } #lesson-next { background: var(--accent); color: #1a1a1a; border-color: transparent; font-weight: 700; }
#npc-panel.public { border-color: #ff8a80; } #npc-panel.public #npc-name { color: #ffb4ad; } #npc-panel.public #npc-starters { display: none; }
#chat-input.editing { border-color: #8fd3ff; box-shadow: 0 0 0 1px rgba(143, 211, 255, 0.6); }
#npc-mic { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
@media (pointer: coarse) { #lesson-bar button { padding: 6px 11px; } }
/* a small upright phone in the lesson: the chat lines keep to their latest two (they scroll), so the board has the room above the bar */
#lesson-more { display: none; }
@media (pointer: coarse) and (max-width: 520px) { body.in-lesson #place { display: none; } }      /* the room's name line gives its place to the board on a small upright phone */
@media (pointer: coarse) and (max-width: 520px) { #chat.in-lesson #chat-log { max-height: 46px; flex: none; } #chat.in-lesson #lesson-rows { max-height: 21vh; overflow-y: auto; }
  #lesson-bar #lesson-more:not([hidden]) { display: inline-block; } #lesson-bar:not(.open) #lesson-rows, #lesson-bar:not(.open) #lesson-note, #lesson-bar:not(.open) #lesson-vi, #lesson-bar:not(.open) #lesson-extra, #lesson-bar:not(.open) #ta-box { display: none; } #ta-box { max-height: 24vh; overflow-y: auto; } }
/* the player's own speech bubble (listening, the words so far, the sentence that was sent) */
.bubble.own { background: rgba(27, 30, 37, 0.94); color: #fff; border: 1px solid rgba(255, 255, 255, 0.35); font-weight: 600; max-width: 240px; font-size: 13px; }
.bubble.own.live { border-color: #ff8a80; } .bubble.own.busy { border-color: #ffe9a8; color: #ffe9a8; } .bubble.own.sent { background: rgba(255, 255, 255, 0.96); color: #1b1e25; border-color: transparent; }
.bubble.own.public { box-shadow: 0 0 0 2px #ff8a80, 0 2px 8px rgba(0, 0, 0, 0.3); }
.chat-line .edit-last::before { content: '✎'; }
.chat-line .edit-last { margin-left: 6px; padding: 0 6px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.08); color: inherit; font: inherit; font-size: 11px; cursor: pointer; min-height: 0; }
.chat-line.public b { color: #ffb4ad; }
#lesson-extra { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; } .lesson-x { padding: 5px 8px; border-radius: 8px; border: 1px solid #3d5a66; background: #10202a; color: #dfe9ee; font: 12px system-ui, sans-serif; cursor: pointer; } .lesson-x.on { border-color: #f0b429; color: #ffd166; } .lesson-x:disabled { opacity: 0.45; cursor: default; }
#ta-box { margin-top: 6px; padding: 7px 9px; border-radius: 9px; border: 1px dashed #5f9fbf; background: rgba(12, 28, 38, 0.92); font: 12px system-ui, sans-serif; color: #e6f1f6; } #ta-box b { display: block; color: #8fd0ee; font-weight: 600; margin-bottom: 4px; } .ta-line { display: flex; gap: 6px; align-items: flex-start; margin-top: 3px; } .ta-line .vi { color: #9fc3cc; } .ta-line.note .en { color: #9fc3cc; font-style: italic; }
#lesson-more.cue { border-color: #5f9fbf; color: #8fd0ee; }
#update-bar { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 95; background: #1f8a4c; color: #fff; font: 600 14px system-ui, sans-serif; padding: 8px 12px; border-radius: 9px; box-shadow: 0 4px 16px rgba(0,0,0,.5); display: flex; gap: 10px; align-items: center; } #update-bar[hidden] { display: none; } #update-bar button { font: inherit; padding: 4px 10px; border-radius: 6px; border: 0; cursor: pointer; }
/* the top-right buttons (Today task, My progress, the venue, Events) in one row left of Controls, in that order from the right; they wrap instead of covering each other (src/main.js moves them in) */
#hud-dock { position: fixed; top: var(--gap); right: 132px; z-index: 60; display: flex; flex-direction: row-reverse; flex-wrap: wrap; justify-content: flex-start; align-items: flex-start; gap: 8px; max-width: calc(100vw - 132px - 46vw); pointer-events: none; }
#hud-dock > * { position: static !important; top: auto !important; right: auto !important; pointer-events: auto; flex: none; }
#hud-dock #dt-btn { order: 1; } #hud-dock #pg-btn { order: 2; } #hud-dock #vn-btn { order: 3; } #hud-dock #ev-btn { order: 4; }
#hud-dock.touch { top: 56px; right: 10px; flex-direction: column; align-items: flex-end; flex-wrap: nowrap; max-width: 44vw; }      /* (touch: a column under Controls, beside the left HUD, which keeps to 52 % of the width) */
body.touch-ui #top { max-width: 52vw; } body.touch-ui #top > * { max-width: 100%; box-sizing: border-box; }
