/* Desktop HUD refactor: glass slate + teal, nautical brass accents. */
:root { --hud-glass: rgba(8,22,34,.78); --hud-teal: #2dd4bf; --hud-ink: #effffc; --hud-legal-h: 0px; }

/* Top-right: view pill + language */
#lobby-language-tools { top: 12px; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
#lobby-language-tools > label { display: none; }
#lobby-language-tools #lobby-language-open { min-height: 40px; padding: 8px 16px; border-radius: 999px; border-width: 1px; background: var(--hud-glass); backdrop-filter: blur(10px); }
#lobby-language-tools :is(#hud-tools,#hud-top-cinema) { min-height:40px; padding:8px 14px; border-radius:999px; border-width:1px; background:var(--hud-glass); font-size:13px; }
html[data-screen-play=true] :is(#hud-tools,#hud-top-cinema), html[data-hud-lobby=true] :is(#hud-tools,#hud-top-cinema), html[data-xr-active=true] :is(#hud-tools,#hud-top-cinema) { display:none!important; }
html[data-screen-play=true] #hud-top { display:none!important; }
html:not([data-screen-play=true]) #hud-top .brand-mark { max-width:max(180px, calc(100vw - 950px)); }
#lobby-language-dialog { flex-basis: 100%; }
#hud-view-switch { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid #2dd4bf88; border-radius: 999px; background: var(--hud-glass); backdrop-filter: blur(10px); }
#lobby-language-tools #hud-view-switch button { min-height: 34px; padding: 6px 14px; border: 0; border-radius: 999px; background: transparent; color: #bfe9e1; font: 600 13px var(--sans, system-ui); }
#lobby-language-tools #hud-view-switch button[aria-pressed=true] { background: var(--hud-teal); color: #062029; }
#hud-view-switch small { font-size: 11px; font-weight: 500; }
#lobby-language-tools { max-width: calc(100vw - 24px); }
@media (max-width: 1450px) {
  html:not([data-screen-play=true]) #hud-top { display:none; }
  #hud-view-switch { border-radius: 20px; }
  #lobby-language-tools #hud-view-switch button { max-width: 48vw; white-space: normal; line-height: 1.3; }
}
#lobby-language-tools #hud-view-switch button:disabled { opacity: .5; cursor: not-allowed; }
#hud-view-switch[data-mode=photo] button { display: none; }
#hud-view-photo { padding: 6px 12px; color: #bfe9e1; font: 600 12px var(--sans, system-ui); }
#hud-view-status { flex-basis: 100%; max-width: 340px; margin-left: auto; padding: 6px 10px; border-radius: 8px; background: var(--hud-glass); color: var(--hud-ink); font-size: 12px; border-left: 3px solid var(--hud-teal); }
#hud-view-status[data-error=true] { border-left-color: #d97966; color: #ffd8cf; }
#hud-view-status[hidden] { display: none; }
html[data-hud-lobby=true] #hud-view-switch, html[data-hud-lobby=true] #hud-view-status,
html[data-hud-lobby=true] #hud-cinema-restore { display: none !important; }
html[data-screen-play=true][data-screen-menu=false] #lobby-language-tools { display: flex; }

/* Old bulky Viewing mode card: mode buttons now live in the pill */
.sv-panel .sv-modes, .sv-panel > .sv-title:first-child { display: none !important; }
.sv-panel.hud-in-controls { position: static; width: auto; max-height: none; margin-top: 10px; box-shadow: none; backdrop-filter: none; background: rgba(16,58,73,.5); }
.sv-panel.hud-in-controls[hidden] { display:none!important; }
#sv-root .sv-panel:not(.hud-in-controls) { display: none; }
.hud-secondary-panel { position:static!important; transform:none!important; width:auto!important; margin-top:10px; }
#screen-controls #geo-checkpoints { flex-direction:row; flex-wrap:wrap; }
#screen-controls > label { max-width:none!important; font-size:12px; }

/* Compact floating glass dock */
#screen-toolbar { bottom: calc(var(--hud-legal-h) + 10px); border-color: #2dd4bf66; border-radius: 18px; background: var(--hud-glass); backdrop-filter: blur(14px); box-shadow: 0 10px 30px rgba(2,12,20,.45); }
html[data-screen-play=true][data-screen-menu=false] #screen-toolbar { border-radius: 999px; padding: 6px 8px; }
#screen-toolbar .screen-actions > button { border-radius: 999px; }
#screen-toolbar #hud-enter-vr { background: #bb9864; color: #0b3447; border-color: #e3bf87; }
#screen-streetview[hidden] { display: none; }
#hud-speed { padding: 6px 12px; border-radius: 999px; background: #2dd4bf22; border: 1px solid var(--hud-teal); color: #cffff5; font: 600 13px ui-monospace, monospace; font-variant-numeric: tabular-nums; }
#hud-speed[hidden] { display: none; }
#screen-flight-reticle { display:none; } /* Live telemetry is consolidated into the dock badge. */
html[data-hud-flight=false] .screen-touch-actions { display: none !important; }

/* Quest minimize */
#quest-hud-minimize { float: right; min-height: 30px; padding: 4px 12px; margin: -2px 0 4px 8px; border: 1px solid #2dd4bf88; border-radius: 999px; background: transparent; color: var(--hud-ink); font: 600 12px var(--sans, system-ui); cursor: pointer; }
#quest-hud[data-minimized=true] :is(#quest-list, .xr-photo-note, .xr-status, .walk-controls, .xr-entry > .quest-title) { display: none; }
#quest-hud { bottom: calc(var(--hud-legal-h) + 12px); }
html[data-screen-play=true] .ltc-card { bottom: calc(var(--screen-toolbar-height, 60px) + var(--hud-legal-h) + 24px); }
html[data-screen-play=true] .ltc-card { max-height:calc(100dvh - var(--screen-toolbar-height,60px) - var(--hud-legal-h) - var(--hud-header-h,70px) - 36px); }
.ltc-card { bottom: calc(var(--hud-legal-h) + 12px); }

/* Legal / source strip: full text, multiline, never clipped */
#google-attribution, #photo-credit { box-sizing:border-box; left: 0; right: 0; bottom: 0; max-width: none; width: 100%; border: 0; border-top: 1px solid #bb986466; border-radius: 0; background: rgba(8,22,34,.86); color: #e6f2ee; font: 500 11px/1.4 var(--sans, system-ui); padding: 4px 12px; white-space: normal; overflow: visible; text-overflow: clip; }
#photo-credit { position: fixed; display: flex; flex-wrap: wrap; }
#google-data-sources { display: inline; margin-left: 6px; overflow-wrap: anywhere; }
#sv-root .sv-legal { position: fixed; top:auto; left: 0; right: 0; bottom: 0; max-width:none; box-sizing:border-box; background: rgba(8,22,34,.86); padding: 4px 12px; font-size: 11px; pointer-events: auto; white-space: normal; }
#tiles-status { bottom: calc(var(--hud-legal-h) + 8px); }

/* Cinema */
html[data-hud-cinema=true] :is(#hud-top, #lobby-language-tools, #quest-hud, #lesson-task-root, #screen-toolbar, #regional-exploration, #geo-help, #geo-checkpoints, #lesson-hud, #screen-crosshair, #screen-flight-reticle, #tiles-status, #world-search, #artifact-curator, #artifact-inspect-hint, #teacher-drawer) { display: none !important; }
#hud-cinema-restore { position: fixed; top: 12px; right: 12px; z-index: 13000; min-height: 40px; padding: 8px 16px; border: 1px solid var(--hud-teal); border-radius: 999px; background: var(--hud-glass); backdrop-filter: blur(10px); color: var(--hud-ink); font: 600 13px var(--sans, system-ui); cursor: pointer; opacity: .75; }
#hud-cinema-restore:hover, #hud-cinema-restore:focus-visible { opacity: 1; }
#hud-cinema-restore[hidden], html[data-xr-active=true] #hud-cinema-restore { display: none !important; }
#hud-view-switch button:focus-visible, #hud-cinema-restore:focus-visible, #quest-hud-minimize:focus-visible, #screen-toolbar button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
html[data-xr-active=true] :is(#hud-view-switch, #hud-view-status) { display: none !important; }

#hud-view-switch button, #hud-cinema-restore, #screen-toolbar { transition: background-color .18s ease, opacity .18s ease; }
@media (prefers-reduced-motion: reduce) { #hud-view-switch button, #hud-cinema-restore, #screen-toolbar, #teacher-drawer { transition: none !important; } }
@media (max-width: 700px) {
  html:not([data-hud-lobby=true]) #hud-top { display:none; }
  #lobby-language-tools { left: 8px; right: 8px; max-width: none; }
  #lobby-language-tools #hud-view-switch button { padding: 6px 10px; font-size: 12px; }
  #google-attribution, #photo-credit { font-size: 10px; }
  #quest-hud { bottom: calc(var(--hud-legal-h) + 8px); }
}
