* { box-sizing: border-box; }
:root { color-scheme: dark; }
body { margin: 0; background: #101a2a; color: #e1e8f3; font: 14px/1.5 system-ui, -apple-system, sans-serif; }
main { position: relative; isolation: isolate; width: 100%; height: 100svh; min-height: 620px; display: grid; grid-template-rows: auto minmax(0,1fr) auto; gap: 16px; padding: 18px 22px; overflow: hidden; }
.scene { position: absolute; inset: 0; z-index: -2; background: #1f3858; }
.scene::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(#0b14273d,transparent 32%,transparent 63%,#0b14276b); }
canvas { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.glass { border: 1px solid #7792af2b; background: #101b2bd9; backdrop-filter: blur(16px); border-radius: 10px; box-shadow: 0 8px 35px #050b1524; }
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; }
h1 { margin: 1px 0 0; font-size: 21px; font-weight: 550; letter-spacing: -.04em; }
h1 span { font-size: 11px; font-weight: 400; letter-spacing: 0; color: #a1b0c3; margin-left: 10px; }
p { margin: 0; }
.eyebrow { font-size: 9px; letter-spacing: .18em; color: #c6b89e; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.presence { color: #c8d3e1; font-size: 11px; display: flex; gap: 8px; align-items: center; margin-right: 12px; }
.dot { width: 5px; height: 5px; border-radius: 50%; background: #a5baa8; flex: none; }
.room-center { min-height: 0; display: flex; justify-content: space-between; gap: 20px; pointer-events: none; }
.river-label { align-self: end; margin: 0 0 8px 3px; text-shadow: 0 1px 8px #000; }
.scene-caption { font-size: 11px; color: #e1e8f3; }
.river-label p { font-size: 10px; color: #c4d0de; letter-spacing: .1em; margin-top: 5px; }
.chat-panel { pointer-events: auto; position: relative; width: 310px; flex: none; min-height: 0; display: flex; flex-direction: column; padding: 16px; background: #101b2be8; }
.chat-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-heading h2 { font-size: 15px; color: #dfe7f1; letter-spacing: -.03em; margin-top: 2px; font-weight: 500; }
#chat-close { border-color: transparent; background: transparent; color: #9eb0c8; padding: 4px 6px; }
.chat-intro { font-size: 11px; color: #91a3ba; margin: 12px 0 10px; }
#chat-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #41546d transparent; padding-right: 6px; }
#chat-empty { font-size: 12px; color: #8d9eb5; text-align: center; padding: 30px 0; line-height: 1.9; }
.chat-message { margin: 0 0 15px; }
.message-meta { display: flex; align-items: baseline; gap: 7px; font-size: 10px; margin-bottom: 4px; }
.message-name { color: #bac9db; font-weight: 500; }
.message-time { color: #7e90a8; font-size: 9px; }
.message-text { color: #d4dfec; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.chat-message.own .message-name { color: #d5bb92; }
#chat-form { margin-top: 10px; border: 1px solid #40516a; border-radius: 7px; background: #101b2b; padding: 9px; }
#chat-form:focus-within { border-color: #a4b4c9; }
textarea { width: 100%; display: block; background: transparent; border: 0; padding: 0; resize: none; color: #e1e8f3; font-family: inherit; line-height: 1.65; font-size: 12px; outline: none; }
textarea::placeholder { color: #788ba5; }
.chat-compose { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
#chat-count { font-size: 9px; color: #91a3ba; font-variant-numeric: tabular-nums; }
#chat-count.over { color: #ed9690; }
#chat-send { font-size: 11px; background: #384a5f; border-color: #53657c; padding: 4px 10px; }
#chat-status { color: #a7b5c8; font-size: 10px; margin-top: 9px; min-height: 15px; }
#chat-status[data-error="true"] { color: #e2b287; }
#chat-help { color: #778da9; font-size: 9px; margin-top: 3px; }
#chat-latest { position: absolute; bottom: 151px; left: 50%; transform: translateX(-50%); font-size: 10px; box-shadow: 0 4px 16px #0008; white-space: nowrap; }
.bottom-bar { position: relative; padding: 12px 16px 9px; }
.atmosphere { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 11px; color: #b7c2d2; }
#connection { color: #91a6c3; white-space: nowrap; }
.indices { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
.indices article { min-width: 0; padding: 0 18px; border-right: 1px solid #7892b12b; font-variant-numeric: tabular-nums; }
.indices article:first-child { padding-left: 0; }
.indices article:last-child { border-right: 0; padding-right: 0; }
.index-title { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 3px; }
h2 { margin: 0; font-size: 10px; font-weight: 500; letter-spacing: .06em; color: #a7b5c8; }
.market-state { font-size: 9px; color: #8d9db3; }
.value { display: inline-block; font-size: clamp(20px,2vw,29px); font-weight: 500; letter-spacing: -.04em; }
.change { display: inline-block; margin: 0 0 0 11px; font-size: 11px; color: #9aabc2; }
.up .change { color: #ed9690; }
.down .change { color: #90b8ee; }
.asof { color: #8193ad; font-size: 9px; margin-top: 2px; }
.stale .asof { color: #d0b17e; }
.data-note { color: #7e93b0; font-size: 9px; margin-top: 7px; display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.data-note a { color: inherit; text-underline-offset: 2px; }
.settings, footer { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
footer { margin-top: 10px; padding-top: 9px; border-top: 1px solid #7892b12b; }
button, select { background: #223349c9; border: 1px solid #41536d; border-radius: 5px; color: inherit; padding: 6px 10px; font: inherit; font-size: 11px; cursor: pointer; }
button:hover, select:hover { background: #344a64; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid #ffd394; outline-offset: 3px; }
label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; white-space: nowrap; font-size: 11px; color: #a7b5c8; }
input { accent-color: #d5a66e; width: 14px; height: 14px; }
#status { color: #93a7c5; font-size: 10px; margin-left: auto; margin-right: 145px; }
.explore { position: absolute; right: 16px; bottom: 36px; color: #9aabc2; }
summary { cursor: pointer; font-size: 10px; width: fit-content; }
#mode-label { margin-left: 6px; color: #c6b497; }
.explore[open] { background: #101b2bf5; padding: 14px; border: 1px solid #41536d; border-radius: 7px; bottom: 34px; z-index: 3; max-width: calc(100vw - 48px); }
.settings { margin-top: 13px; }
.hint { color: #8193ad; font-size: 10px; margin-top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@media (min-width: 761px) {
  header.glass { background: none; border: 0; backdrop-filter: none; box-shadow: none; padding: 0; border-radius: 0; }
  header>div { padding: 11px 17px; border: 1px solid #7792af2b; border-radius: 9px; background: #101b2bdb; backdrop-filter: blur(16px); }
}
@media (min-width: 761px) and (max-width: 1350px) { .change { display: block; margin-left: 0; } }
@media (max-width: 760px) {
  main { height: auto; min-height: 100svh; grid-template-rows: auto auto auto; align-content: start; gap: 12px; padding: 12px; overflow: visible; }
  .scene { position: relative; grid-row: 2; aspect-ratio: 1672/941; border-radius: 6px; z-index: 0; }
  .scene::after { display: none; } canvas { object-fit: contain; }
  header { grid-row: 1; padding: 10px 12px; } h1 { font-size: 19px; } h1 span { display: block; margin: 2px 0 0; font-size: 10px; }
  .header-actions { flex-wrap: wrap; justify-content: end; gap: 7px; } .presence { width: 100%; justify-content: end; margin: 0; font-size: 10px; }
  #fullscreen { display: none; } .room-center { display: contents; } .river-label { display: none; }
  .bottom-bar { grid-row: 3; padding: 12px; } .atmosphere { font-size: 10px; }
  .chat-panel { position: fixed; z-index: 10; width: auto; left: 12px; right: 12px; top: auto; bottom: 12px; height: min(540px,calc(100dvh - 95px)); max-height: calc(100dvh - 95px); box-shadow: 0 0 0 100vmax #050c1766; }
  textarea { font-size: 16px; }
  .indices { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 0; }
  .indices article { padding: 0 12px; } .indices article:nth-child(2) { border-right: 0; padding-right: 0; }
  .indices article:nth-child(3) { padding-left: 0; } .indices article:nth-child(-n+2) { padding-bottom: 10px; border-bottom: 1px solid #7892b12b; }
  .value { font-size: 23px; } .change { display: block; margin: 1px 0 0; font-size: 11px; }
  footer { gap: 13px; } #status { width: 100%; margin: 0; } .data-note { margin-top: 10px; }
  .explore, .explore[open] { position: static; margin-top: 12px; max-width: 100%; }
}
@media (min-width: 761px) and (max-height: 720px) { main { padding: 12px; gap: 10px; } .chat-intro { margin: 6px 0; } .chat-panel { padding: 12px; } #chat-help { display: none; } #chat-latest { bottom: 126px; } }
@media (max-width: 760px) and (max-height: 500px) {
  .chat-panel { height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); padding: 12px; }
  .chat-intro, #chat-help, .chat-heading .eyebrow { display: none; }
  textarea { height: 32px; }
  #chat-latest { bottom: 118px; }
}

.music-panel { pointer-events: auto; position: absolute; left: 22px; top: 106px; z-index: 4; width: 370px; max-height: calc(100svh - 340px); overflow-y: auto; padding: 16px; background: #101b2bf2; }
.music-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 13px; }
.music-heading h2 { font-size: 15px; letter-spacing: -.03em; color: #dfe7f1; margin-top: 2px; }
.music-panel-actions { display: flex; flex: none; gap: 4px; }
#music-close, #music-stop { background: transparent; border-color: transparent; color: #a6b6cc; padding: 4px; }
.music-player { background: #08111d; border-radius: 6px; overflow: hidden; }
.music-player iframe { display: block; width: 100%; height: 210px; min-width: 200px; min-height: 200px; border: 0; }
#music-status { font-size: 11px; color: #c0cddd; margin-top: 11px; }
#music-status[data-error="true"] { color: #e2b287; }
.music-note { font-size: 10px; color: #91a3ba; margin-top: 4px; }
.music-settings { margin-top: 14px; }
#music-form { margin-top: 10px; }
#music-form label { display: block; font-size: 10px; margin-bottom: 6px; }
#music-url { display: block; width: 100%; height: 36px; background: #101b2b; border: 1px solid #41536d; border-radius: 5px; padding: 8px; font: inherit; font-size: 12px; color: #e1e8f3; }
.music-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.music-external { display: inline-block; margin-top: 12px; color: #a6bbd4; font-size: 10px; text-underline-offset: 3px; }
main:has(.music-panel.is-collapsed:not([hidden])) { overflow: visible; }
.music-panel.is-collapsed { display: grid; grid-template-columns: 200px minmax(0,1fr); gap: 16px; top: calc(100% + 12px); bottom: auto; left: 22px; right: 22px; width: auto; padding: 12px; max-height: none; overflow: visible; }
.is-collapsed .music-player { grid-column: 1; grid-row: 1; }
.is-collapsed .music-heading { grid-column: 2; grid-row: 1; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px; margin: 0; }
.is-collapsed .music-panel-actions { flex-wrap: wrap; }
.is-collapsed .music-heading h2 { font-size: 12px; }
.is-collapsed .eyebrow, .is-collapsed #music-status, .is-collapsed .music-note, .is-collapsed .music-settings, .is-collapsed .music-external { display: none; }
.is-collapsed .music-player iframe { height: 200px; }
@media (max-width: 760px) {
  .music-panel { position: fixed; z-index: 11; left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; max-height: calc(100dvh - 95px); box-shadow: 0 0 0 100vmax #050c1766; }
  #music-url { font-size: 16px; }
  .music-panel.is-collapsed { position: relative; grid-row: 4; top: auto; bottom: auto; left: auto; right: auto; width: 100%; box-shadow: none; }
}
@media (max-height: 600px) {
  .music-panel { max-height: calc(100dvh - 24px); top: 12px; bottom: auto; }
}
