/* MineWorld Space world map: dark green, clean, no frames around the 3D view. */
:root {
  color-scheme: dark;
  --ink: #eaf6ea;
  --mute: #9cb7a0;
  --green: #4ade4a;
  --green-2: #2f9e44;
  --glass: rgba(9, 20, 12, 0.62);
  --glass-2: rgba(16, 34, 20, 0.78);
  --line: rgba(120, 220, 130, 0.22);
  --display: 'Silkscreen', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --gap: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #a9cdea; color: var(--ink); font: 14px/1.4 var(--font); -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; cursor: grab; }
#view.grabbing { cursor: grabbing; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

#top { position: fixed; z-index: 5; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: max(var(--gap), env(safe-area-inset-top)) max(var(--gap), env(safe-area-inset-right)) 0 max(var(--gap), env(safe-area-inset-left)); pointer-events: none; }
#top > * { pointer-events: auto; }
.spacer { flex: 1; }
.brand { display: flex; align-items: center; gap: 10px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 6px 14px 6px 8px; border-radius: 12px; }
.brand img { image-rendering: pixelated; border-radius: 6px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .02em; }
.brand-text small { color: var(--mute); font-size: 11px; }
.brand:hover { background: var(--glass-2); }
.chip { display: inline-flex; align-items: center; gap: 7px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 0; padding: 9px 14px; border-radius: 12px; }
.chip:hover, .chip[aria-expanded="true"] { background: var(--glass-2); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #6b7f6e; }
.chip.live .dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.chip .arrow { color: var(--green); }

#dims { display: flex; gap: 4px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 4px; border-radius: 12px; }
#dims:empty { display: none; }
#dims button { background: transparent; border: 0; padding: 6px 12px; border-radius: 8px; color: var(--mute); }
#dims button.on { background: var(--green); color: #06260a; font-weight: 600; }

#players-panel { position: fixed; z-index: 6; top: 64px; right: var(--gap); width: min(280px, calc(100vw - 2 * var(--gap))); max-height: 50vh; overflow: auto; background: var(--glass-2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 14px; padding: 14px; }
#players-panel h2, #help h2 { margin: 0 0 8px; font: 700 13px var(--display); letter-spacing: .04em; color: var(--green); }
#players-list { list-style: none; margin: 0; padding: 0; }
#players-list li { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; cursor: pointer; }
#players-list li:hover { background: rgba(74, 222, 74, .12); }
#players-list img, .marker img { width: 24px; height: 24px; image-rendering: pixelated; border-radius: 4px; background: #1d3a24; flex: none; }
.marker img { width: 20px; height: 20px; border-radius: 3px; }
#players-list small { display: block; color: var(--mute); font-size: 11px; }
#players-empty { margin: 0; color: var(--mute); }
#players-panel ul:not(:empty) + #players-empty { display: none; }

#markers { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.marker { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; transform: translate(-50%, -100%); pointer-events: auto; cursor: pointer; will-change: transform; background: none; border: 0; padding: 0; color: var(--ink); font: inherit; }
.marker:focus-visible .tag { outline: 2px solid var(--green); }
.marker .tag { display: flex; align-items: center; gap: 6px; background: var(--glass-2); padding: 3px 8px 3px 3px; border-radius: 9px; white-space: nowrap; font-size: 12px; font-weight: 600; }
.marker .pin { width: 2px; height: 10px; background: var(--green); border-radius: 1px; }
.marker.spawn .tag { padding: 4px 9px; color: #ffe27a; }
.marker.spawn .pin { background: #ffe27a; }
.marker.far .tag { opacity: .75; }

#status { position: fixed; z-index: 4; left: 50%; top: 66px; transform: translateX(-50%); background: var(--glass-2); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 8px 14px; border-radius: 12px; color: var(--ink); max-width: calc(100vw - 2 * var(--gap)); text-align: center; }
#status progress { width: 120px; height: 6px; vertical-align: middle; margin-left: 8px; accent-color: var(--green); }
#empty, #error { position: fixed; z-index: 4; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 2 * var(--gap))); text-align: center; background: var(--glass-2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 24px; border-radius: 18px; }
#empty h1 { margin: 0 0 6px; font: 700 18px var(--display); color: var(--green); }
#empty p, #error { margin: 0; color: var(--mute); }

#coords { position: fixed; z-index: 4; left: max(var(--gap), env(safe-area-inset-left)); bottom: max(var(--gap), env(safe-area-inset-bottom)); background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 7px 12px; border-radius: 10px; font: 13px ui-monospace, 'SFMono-Regular', Menlo, monospace; color: var(--ink); min-width: 9.5em; }

#compass { position: fixed; z-index: 4; right: max(var(--gap), env(safe-area-inset-right)); bottom: max(76px, calc(env(safe-area-inset-bottom) + 64px)); width: 64px; height: 64px; padding: 0; border: 0; border-radius: 50%; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
#compass svg { width: 100%; height: 100%; display: block; }
#compass .ring { fill: none; stroke: var(--line); stroke-width: 2; }
#compass .north { fill: #ff6b5e; } #compass .south { fill: #cfe5d2; opacity: .8; }
#compass text { font: 700 14px var(--display); text-anchor: middle; fill: var(--mute); }
#compass text.n { fill: #ff6b5e; }
#compass-rose { transition: transform .08s linear; }

#bar { position: fixed; z-index: 5; left: 50%; bottom: max(var(--gap), env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 4px; background: var(--glass-2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 5px; border-radius: 14px; max-width: calc(100vw - 2 * var(--gap)); }
#bar button { background: transparent; border: 0; padding: 9px 14px; border-radius: 10px; color: var(--mute); min-width: 44px; }
#bar button:hover { color: var(--ink); background: rgba(74, 222, 74, .12); }
#bar button.on { background: var(--green); color: #06260a; font-weight: 700; }
#bar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
#bar button.icon { display: grid; place-items: center; padding: 6px 10px; }
#bar button.icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; display: none; }
#btn-sky .sun circle, #btn-sky .moon path, #btn-sky .auto path { fill: currentColor; }
#btn-sky[data-state="day"] .sun, #btn-sky[data-state="night"] .moon, #btn-sky[data-state="auto"] .auto { display: block; }
#btn-sky[data-state="day"] { color: #ffd65a; }
#btn-sky[data-state="night"] { color: #b9c8ff; }
#roof-note { position: fixed; z-index: 4; right: max(var(--gap), env(safe-area-inset-right)); top: 64px; margin: 0; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 6px 10px; border-radius: 10px; font-size: 12px; color: #ffb4a4; }

#help { position: fixed; z-index: 6; left: 50%; bottom: 76px; transform: translateX(-50%); width: min(420px, calc(100vw - 2 * var(--gap))); background: var(--glass-2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 16px 18px; border-radius: 16px; }
#help dl { margin: 0; display: grid; grid-template-columns: 4.5em 1fr; gap: 6px 10px; }
#help dt { color: var(--green); font-weight: 700; } #help dd { margin: 0; color: var(--ink); }

#stick { position: fixed; z-index: 4; left: 28px; bottom: 90px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255, 255, 255, .10); border: 2px solid rgba(255, 255, 255, .25); touch-action: none; }
#stick-knob { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(74, 222, 74, .75); }
#fly-buttons { position: fixed; z-index: 4; right: 24px; bottom: 150px; display: flex; flex-direction: column; gap: 10px; }
#fly-buttons button { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--glass-2); color: var(--ink); touch-action: none; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; margin: 0; background: #0a140d; color: var(--ink); }

@media (max-width: 640px) {
  .chip.site { display: none; }
  #roof-note { top: auto; bottom: max(118px, calc(env(safe-area-inset-bottom) + 108px)); }
  .brand-text small, .chip .lbl { display: none; }
  #top { gap: 8px; }
  #dims button { padding: 6px 9px; }
  #coords { font-size: 12px; min-width: 0; bottom: max(70px, calc(env(safe-area-inset-bottom) + 62px)); }
  #compass { width: 52px; height: 52px; bottom: max(70px, calc(env(safe-area-inset-bottom) + 62px)); }
  #bar button { padding: 9px 9px; min-width: 40px; }
}
#coords:has(#coord-text:empty) { display: none; }
