@font-face {
  font-family: Montserrat;
  src: url('./assets/fonts/montserrat.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: Montserrat, system-ui, sans-serif;
  color: #eff5f7;
  background: #0a1018;
  --dim: #a5b4c4;
  --line: #273747;
  --panel: #101b26;
  --mint: #a3f3d1;
  --teal: #78ddb8;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: wait; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }
.shell { width: min(1230px, calc(100% - 64px)); margin-inline: auto; }
.topbar { border-bottom: 1px solid #1e2a37; }
.topbar-inner { min-height: 72px; display: flex; gap: 34px; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.04rem; white-space: nowrap; }
.planet-icon { width: 28px; height: 28px; border: 2px solid var(--mint); border-radius: 50%; position: relative; display: inline-block; flex: none; transform: rotate(-24deg); }
.planet-icon::before { content: ""; position: absolute; inset: 3px -5px; border: 1px solid var(--mint); border-radius: 50%; }
.toplinks { display: flex; gap: 22px; color: var(--dim); font-size: .94rem; }
.toplinks a:hover, .footer a:hover { color: var(--mint); }
.topbar #language { margin-left: auto; width: auto; min-width: 94px; font-size: .88rem; }
.identity { color: var(--dim); font-size: .85rem; white-space: nowrap; }
.launch { display: grid; grid-template-columns: .82fr 1.18fr; align-items: center; gap: 46px; padding: 34px 0 40px; }
.launch-copy { padding: 25px 0; }
.eyebrow { font-weight: 750; letter-spacing: .17em; font-size: .82rem; color: var(--teal); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(3rem, 6.2vw, 6.05rem); line-height: .98; letter-spacing: -.075em; margin: .22em 0; }
h1 em { font-style: normal; color: var(--mint); }
.lead { max-width: 37ch; color: #bfccd7; line-height: 1.6; font-size: 1.13rem; margin: 23px 0 31px; }
.site-selection { max-width: 370px; background: #101c27; border: 1px solid var(--line); border-radius: 16px; display: flex; justify-content: space-between; align-items: center; padding: 15px 18px; }
.site-selection strong { display: block; font-size: 1.13rem; margin: 4px 0; }
.muted { color: var(--dim); line-height: 1.45; }
.site-selection .muted, .coords, .identity { font-size: .88rem; }
.coords { color: var(--teal); font-variant-numeric: tabular-nums; }
.location-dot { width: 26px; height: 26px; border: solid 1px #6fd4b0; border-radius: 50%; position: relative; }
.location-dot::after { content: ""; position: absolute; inset: 7px; background: var(--teal); border-radius: 50%; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 15px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 15px; border: 1px solid transparent; border-radius: 10px; font-weight: 750; color: inherit; background: transparent; }
.primary { background: var(--mint); color: #0c3024; }
.primary:hover { background: #c0ffe7; }
.secondary { background: #14202c; border-color: var(--line); }
.secondary:hover { background: #233344; }
.orbital { min-width: 0; border-radius: 23px; border: 1px solid #223849; padding: 16px 18px; overflow: hidden; position: relative; background: radial-gradient(ellipse at 49% 56%, #102d3b 8%, #0b1827 49%, #0b131f 83%); }
.orbital::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .48; background-image: radial-gradient(circle, #c3edff 1px, transparent 1.7px), radial-gradient(circle, #a6e0e6 1px, transparent 1.8px); background-size: 82px 79px, 131px 109px; background-position: 17px 4px, 46px 31px; }
.orbital > * { position: relative; }
.orbital-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .77rem; font-weight: 750; letter-spacing: .13em; color: #a9c5d5; }
.orbital-live { display: inline-flex; gap: 7px; align-items: center; text-transform: uppercase; }
.orbital-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 11px var(--teal); }
.planet-stage { display: grid; place-items: center; }
#globe { width: min(100%, 460px); height: auto; aspect-ratio: 1; touch-action: none; cursor: grab; display: block; }
#globe:active { cursor: grabbing; }
.globe-help { text-align: center; font-size: .86rem; color: var(--dim); }
.locations { display: flex; justify-content: center; gap: 7px; flex-wrap: wrap; margin-top: 11px; }
.locations button { border: 1px solid var(--line); border-radius: 999px; min-height: 34px; background: #131f2d; color: #d7e4ed; padding: 5px 11px; font-size: .88rem; }
.locations button[aria-pressed="true"] { background: #213f39; border-color: #7ed7b5; color: #ddffee; }
.directory { margin-bottom: 30px; scroll-margin: 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); letter-spacing: -.035em; }
.section-head p { color: var(--dim); margin-top: 5px; }
.world-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.world-card { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.world-card h3 { margin: 0 0 7px; overflow-wrap: anywhere; }
.world-card p + .coords { margin-top: -6px; color: var(--teal); }
.nearby-link { padding: 8px 0; border: 0; background: none; color: var(--teal); font-size: .93rem; font-weight: 650; }
.nearby-link:hover { text-decoration: underline; }
.globe-legend { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--dim); font-size: .78rem; margin-block: 5px 0; }
.globe-legend::before { content: ""; width: 7px; height: 7px; flex: none; border-radius: 50%; background: #ffdb93; }
.world-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 12px; }
.world-filters label { display: grid; gap: 5px; min-width: 155px; font-size: .9rem; }
.world-filters p { padding-bottom: 8px; font-size: .9rem; }
.world-card p { color: var(--dim); padding-bottom: 14px; font-size: .89rem; }
.demo-card { border-top: 2px solid var(--teal); }
.world-card .demo-description { color: #eff5f7; }
.world-card .button { margin-top: auto; }
.footer { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--dim); border-top: 1px solid #1e2a37; font-size: .83rem; }
.notice { border-radius: 10px; background: #493028; padding: 12px; margin-bottom: 16px; color: #ffdfc8; }
.startup-note { margin-block: 16px 0; }
.quick-play-note { color: var(--dim); font-size: .9rem; margin-block: 8px 16px; }
.room-header { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin: 26px 0 16px; }
.room-header h1 { font-size: clamp(2rem, 5vw, 3.7rem); overflow-wrap: anywhere; }
.back-link { color: var(--teal); font-weight: 650; }
.room-layout { display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 14px; margin-bottom: 22px; }
.world-frame, .room-panel { border: 1px solid var(--line); border-radius: 17px; background: var(--panel); min-width: 0; }
.board-head, .board-message { padding: 9px 12px; }
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sync-status { color: var(--mint); font-size: .89rem; }
.zoom { display: flex; gap: 6px; }
.zoom button { width: 38px; min-height: 36px; border-radius: 8px; background: #1b2c3c; border: 1px solid var(--line); color: #fff; font-size: 1.16rem; }
.board-wrap { background: radial-gradient(ellipse at center, #274c55, #101c2a 76%); height: clamp(410px, 56vh, 640px); }
#board { display: block; width: 100%; height: 100%; touch-action: none; }
.board-message { color: #ffdfb5; min-height: 40px; font-size: .9rem; }
.room-panel { padding: 14px; }
.mode-control { display: flex; gap: 6px; flex-wrap: wrap; }
.mode-control .button[aria-pressed="true"], .tiles .button[aria-pressed="true"] { background: #234739; border-color: var(--mint); }
.room-panel p { margin: 10px 0; font-size: .89rem; }
.room-panel h2 { font-size: 1.05rem; margin: 15px 0 8px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tiles .button { font-size: .87rem; gap: 6px; padding: 7px; }
.swatch { height: 10px; width: 10px; border-radius: 3px; background: var(--teal); flex: none; }
.tile-1 { background: #ddc2a3; }.tile-2 { background: #599fc9; }.tile-3 { background: #2b9a5d; }
.tile-4 { background: #efa070; }.tile-5 { background: #c58555; }.tile-6 { background: #9bafc5; }.tile-7 { background: #eece77; }
.tile-8 { background: #cdb4fd; }
.people { margin-top: 15px; border-top: 1px solid var(--line); }
.people ul { margin: 0; list-style: none; padding: 0; color: var(--dim); font-size: .9rem; }
.people li { margin: 5px 0; }
.people h2 :is(#trail-count, #online) { color: var(--mint); margin-left: 5px; }
dialog { color: inherit; background: #101c28; border: 1px solid #3b4c5e; border-radius: 16px; padding: 20px; width: min(500px, 94%); max-height: 90dvh; }
dialog::backdrop { background: #03080ed8; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.close { background: #1c2b3a; border: 1px solid var(--line); border-radius: 8px; width: 38px; height: 38px; color: #fff; font-size: 1.3rem; }
dialog form { display: grid; gap: 12px; margin-top: 12px; align-items: start; justify-items: start; }
dialog label { font-size: .93rem; font-weight: 650; display: grid; gap: 5px; width: 100%; }
input, select { background: #0a131e; color: #eff5f7; border: 1px solid #40536a; border-radius: 8px; min-height: 42px; padding: 8px 10px; width: 100%; min-width: 0; }
.form-note { color: var(--dim); font-size: .89rem; line-height: 1.45; }
.form-error { color: #ffb8ac; font-size: .9rem; }
.form-error:empty, #share-status:empty { display: none; }
#account-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
#account-options button[aria-pressed="true"] { background: #234739; border-color: var(--mint); }
#account-logout { margin-top: 12px; }
#account-error { margin-top: 8px; }
.account-trigger { white-space: nowrap; }
#history-dialog .form-note { margin-bottom: 10px; }
#history-status:not(:empty) { margin-top: 10px; }
#history-list { display: grid; gap: 8px; padding: 0; margin: 12px 0 0; list-style: none; }
#history-list li { display: grid; gap: 5px; padding: 10px; background: #182838; border-radius: 8px; }
#history-list .button { justify-self: start; }
.share-field { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin: 12px 0; }
.share-field label { grid-column: 1 / -1; }
#share-status { margin-top: 10px; }
@media (max-width: 880px) { .launch { gap: 20px; }.world-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 680px) {
  .shell { width: calc(100% - 26px); }
  .topbar-inner { min-height: 56px; gap: 12px; }
  .toplinks { display: none; }
  .launch { grid-template-columns: 1fr; padding: 18px 0 22px; gap: 0; }
  .launch-copy { padding: 10px 0 18px; }
  .lead { margin: 12px 0 16px; font-size: 1rem; }
  .orbital { padding: 13px 12px; }
  .world-grid, .room-layout { grid-template-columns: 1fr; }
  .board-wrap { height: clamp(310px, 55vh, 465px); }
  .room-header { align-items: start; flex-direction: column; }
  .room-header .actions { margin-top: 0; }
  .tiles { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width: 440px) {
  .topbar .identity { display: none; }
  .topbar .brand { min-width: 0; font-size: .9rem; }
  .topbar .brand strong { overflow: hidden; text-overflow: ellipsis; }
  .account-trigger { font-size: .85rem; padding-inline: 9px; }
}

.board-controls { display: flex; align-items: center; gap: 7px; }
#toggle-view { min-height: 36px; padding: 5px 10px; font-size: .78rem; white-space: nowrap; }
.world-frame:has(#world-viewport:not([hidden])) .board-wrap { height: clamp(350px, 61vh, 760px); }
#world-viewport { position: relative; width: 100%; height: 100%; isolation: isolate; }
#world-3d { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#world-3d:focus-visible { outline: 1px solid #91c9b6; outline-offset: -1px; }
#world-3d:active { cursor: grabbing; }
.world-touch { display: none; }
#world-stick {
  position: absolute; left: 15px; bottom: 15px; width: 76px; height: 76px; place-items: center;
  background: #16272f9b; border: 1px solid #c7e1d69c; border-radius: 50%; touch-action: none;
}
#world-stick i { width: 34px; height: 34px; border-radius: 50%; background: #d0eddbc4; pointer-events: none;
  transform: translate(var(--thumb-x,0px), var(--thumb-y,0px)); }
#world-jump { position: absolute; right: 15px; bottom: 15px; min-height: 44px; background: #16272fc9; }
#world-viewport[data-touch="true"] .world-touch { display: grid; }
@media (pointer: coarse) {
  .world-touch { display: grid; }
}
@media (max-width: 900px) {
  .world-frame:has(#world-viewport:not([hidden])) .board-wrap { height: clamp(265px, 56svh, 510px); }
}
