:root {
  --accent: #B8FF2C;
  --accent-fg: #0b0b0b;
  --bg: #0b0b0b;
  --panel: rgba(16, 16, 16, 0.82);
  --border: rgba(255, 255, 255, 0.12);
  --fg: #f2f2f2;
  --fg2: #a8a8a8;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--fg);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
#canvas { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; }
#map2d { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; z-index: 1; }
#progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); width: 0; z-index: 9;
  transition: width .15s linear; }
#message { position: fixed; top: 40%; width: 100%; text-align: center; color: #ff6b6b; font-weight: 600; z-index: 8; pointer-events: none; }

/* spinner (vendored viewer markup) */
#spinner { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 2; pointer-events: none; }
.cube-wrapper { transform-style: preserve-3d; }
.cube { transform-style: preserve-3d; transform: rotateX(45deg) rotateZ(45deg); animation: rotation 2s infinite; }
.cube-faces { transform-style: preserve-3d; height: 40px; width: 40px; position: relative; border: 2px solid var(--accent); opacity: .6; }
@keyframes rotation { from { transform: rotateX(45deg) rotateY(0) rotateZ(45deg); } to { transform: rotateX(45deg) rotateY(360deg) rotateZ(45deg); } }
body:not(.loading) #spinner { display: none; }

/* marker (3D views) */
#pole { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
#poleline { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 4; }
#acc { fill: rgba(184, 255, 44, 0.10); stroke: rgba(184, 255, 44, 0.55); stroke-width: 1; }
#marker { position: fixed; z-index: 4; pointer-events: none; transform: translate(-50%, -50%); width: 0; height: 0; }
#marker .dot { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--accent-fg); }
#marker .pulse { position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(184, 255, 44, .25); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.4); opacity: 0; } }
#marker .tag { position: absolute; left: 14px; top: -11px; padding: 2px 8px; border-radius: 6px; background: var(--accent);
  color: var(--accent-fg); font-size: 12px; font-weight: 700; }

/* HUD */
#hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; display: flex; flex-direction: column; justify-content: space-between; }
#hud > * { pointer-events: auto; }
/* the top holds the ways out: the wordmark (aereus.de), share, and Talk to us */
.top { display: flex; align-items: center; justify-content: space-between; padding: calc(6px + var(--safe-top)) 8px 4px;
  background: linear-gradient(to bottom, rgba(0,0,0,.45), transparent); }
.brandlink { display: block; padding: 10px 8px; }
.brandlink img { display: block; height: 17px; width: auto; opacity: .95; }
.iconbtn { display: grid; place-items: center; padding: 0; border: 1px solid var(--border); background: var(--panel);
  color: var(--fg); width: 38px; height: 38px; border-radius: 50%; font-size: 17px; backdrop-filter: blur(8px); }
.outlinks { display: flex; align-items: center; gap: 8px; padding-right: 4px; }
.talkbtn { display: flex; align-items: center; height: 38px; padding: 0 14px; border-radius: 19px; font-size: 13px;
  font-weight: 700; text-decoration: none; background: var(--accent); color: var(--accent-fg); white-space: nowrap; }
.talkbtn:active { transform: scale(.96); }
#toast { position: fixed; left: 50%; top: calc(64px + var(--safe-top)); transform: translateX(-50%); z-index: 9;
  padding: 7px 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--border);
  font-size: 13px; max-width: calc(100% - 32px); overflow-wrap: anywhere; backdrop-filter: blur(8px); }
.tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 0 12px; }
/* "P" reads as a parking sign before the label is read */
.pillbtn { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px 0 6px; border-radius: 19px;
  border: 1px solid var(--border); background: var(--panel); color: var(--fg); font: inherit; font-size: 13px;
  font-weight: 600; backdrop-filter: blur(8px); white-space: nowrap; }
.pillbtn b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px;
  background: var(--accent); color: var(--accent-fg); font-size: 14px; font-weight: 800; }
.pillbtn:active, .iconbtn:active { transform: scale(.96); }
/* below ~386 px the label would wrap the title onto two lines: keep only the sign */
@media (max-width: 385px) {
  #home { padding: 0 6px; }
  #home span { display: none; }
}

/* the caption names the layer just above the chips that switch it: small, out of the way */
#caption { padding: 0 12px; max-width: 460px; pointer-events: none; }
#caption.in { animation: capin .34s cubic-bezier(.2,.8,.3,1) both; }
@keyframes capin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.capline { display: flex; align-items: center; gap: 7px; }
#caption h2 { margin: 0; font-size: 15px; line-height: 1.2; text-shadow: 0 2px 10px rgba(0,0,0,.8); }
#caption p { margin: 2px 0 0; font-size: 12px; color: #d0d0d0; max-width: 40ch;
  text-shadow: 0 2px 8px rgba(0,0,0,.85); }
.badge { font-size: 10px; font-weight: 800; letter-spacing: .09em; padding: 2px 6px; border-radius: 5px;
  background: var(--accent); color: var(--accent-fg); }
.badge[class~="2d"] { background: #7cc7ff; }

#legend { position: absolute; right: 12px; top: calc(60px + var(--safe-top)); display: flex; flex-direction: column; gap: 4px;
  padding: 8px 10px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; font-size: 12px;
  backdrop-filter: blur(8px); }
#legend div { display: flex; align-items: center; gap: 8px; }
#legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* bottom: status, the asset rail, the call to action */
.bottom { display: flex; flex-direction: column; gap: 8px; padding: 10px 0 calc(10px + var(--safe-bottom));
  background: linear-gradient(to top, rgba(0,0,0,.72), transparent); }
.status { font-size: 12px; color: var(--fg2); text-align: center; min-height: 15px; padding: 0 12px; }

.rail { display: flex; gap: 8px; overflow-x: auto; padding: 2px 12px 4px; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; }
.rail::-webkit-scrollbar { display: none; }
.rail button { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; border: 1px solid var(--border);
  background: var(--panel); color: var(--fg); padding: 9px 13px; border-radius: 11px; font: inherit; font-size: 13.5px;
  font-weight: 600; white-space: nowrap; backdrop-filter: blur(8px); transition: background .16s, color .16s, border-color .16s; }
.rail button.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.rail button.on .chipbadge { background: rgba(0,0,0,.22); color: var(--accent-fg); }
.chipbadge { font-size: 9px; font-weight: 800; letter-spacing: .08em; padding: 2px 5px; border-radius: 4px;
  background: rgba(255,255,255,.11); color: var(--fg2); }
.chipbadge[class~="3d"] { color: var(--accent); }
.chipbadge[class~="2d"] { color: #7cc7ff; }

.btn { border: 1px solid var(--border); background: var(--panel); color: var(--fg); padding: 12px 18px; border-radius: 12px; font: inherit;
  font-weight: 600; backdrop-filter: blur(8px); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn.ghost { background: transparent; color: var(--fg2); }
.btn:disabled { opacity: .55; }
.bottom .btn { margin: 0 12px; }

/* landing */
#landing { position: fixed; inset: 0; z-index: 7; display: flex; align-items: flex-end; justify-content: center;
  background: radial-gradient(120% 90% at 50% 0%, rgba(20,20,20,.72), rgba(8,8,8,.95)); backdrop-filter: blur(3px); }
.card { width: 100%; max-width: 460px; padding: 22px 20px calc(22px + var(--safe-bottom)); background: var(--panel);
  border-top: 1px solid var(--border); border-radius: 18px 18px 0 0; display: flex; flex-direction: column; gap: 10px; }
.card h1 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.card p { margin: 0; font-size: 14px; color: var(--fg2); }
.card p b { color: var(--fg); }
.card .fine { font-size: 11.5px; color: #7d7d7d; }
#loadline { height: 3px; background: rgba(255,255,255,.1); border-radius: 2px; overflow: hidden; margin-top: 4px; }
#loadbar { height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }

/* ?fps=1: the viewer's fps counter, for tuning ?draft on a real phone */
#quality { position: fixed; top: calc(8px + env(safe-area-inset-top, 0px)); left: 8px; z-index: 9;
  font: 12px ui-monospace, monospace; color: var(--accent); background: rgba(0,0,0,.6); padding: 3px 7px; border-radius: 6px; }
