/* Datafloq brand: green #5aaf62 -> #8ae64d, dark #0b1e16, Figtree */
:root {
  --bg: #040907;
  --panel: rgba(11, 30, 22, 0.88);
  --panel-solid: #0b1e16;
  --line: rgba(138, 230, 77, 0.18);
  --accent: #8ae64d;
  --accent-2: #5aaf62;
  --text: #edf4ef;
  --muted: #a9b9ae;
  --lit: #c4f79a;
  --radius: 12px;
  --gutter: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.45 Figtree, system-ui, sans-serif; }
#app { position: relative; width: 100%; height: 100%; min-height: 520px; overflow: hidden; }
#globe { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#globe:active { cursor: grabbing; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.brand { position: absolute; top: 20px; left: 24px; max-width: min(460px, calc(100% - 420px)); pointer-events: none; }
.brand a, .brand .stats { pointer-events: auto; }
.brand .logo img { display: block; height: 31px; width: auto; }
.brand h1 { margin: 12px 0 4px; font-size: clamp(22px, 2.6vw, 32px); line-height: 1.12; font-weight: 800; letter-spacing: -0.01em; text-shadow: 0 2px 12px rgba(0,0,0,0.6); }
.brand .sub { margin: 0; color: var(--muted); font-size: 15px; text-shadow: 0 1px 8px rgba(0,0,0,0.7); }
.brand .stats { margin: 10px 0 0; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }

#panel { position: absolute; top: 16px; right: 16px; bottom: 64px; width: 340px; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(8px); }
.panel-head { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.panel-head input, .panel-head select { width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); background: rgba(0,0,0,0.35); }
.panel-head input:focus-visible, .panel-head select:focus-visible, button:focus-visible, #list button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#list { list-style: none; margin: 0; padding: 4px; overflow-y: auto; flex: 1; }
#list button { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; }
#list button:hover, #list button[aria-current="true"] { background: rgba(138, 230, 77, 0.10); }
#list .dot { width: 10px; height: 10px; border-radius: 50%; }
#list .t-A { background: var(--lit); box-shadow: 0 0 8px var(--accent-2); }
#list .t-B { background: rgba(138, 230, 77, 0.45); border: 1px solid var(--accent); }
#list .t-C { border: 1.5px solid rgba(255,255,255,0.75); }
#list .dot.u { background: none; border: 2.5px solid var(--lit); }
#list .nm { font-weight: 600; line-height: 1.25; }
#list .loc { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
#list .val { font-size: 13px; color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
#list .val.claimed { color: var(--muted); }
.panel-note { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.panel-note:empty { display: none; }

.legend { position: absolute; left: 24px; bottom: 64px; display: flex; flex-direction: column; gap: 6px; padding: 10px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.legend label { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; }
.legend input { accent-color: var(--accent-2); margin: 0; }
.sw { display: inline-block; width: 8px; height: 20px; border-radius: 2px; }
.sw-lit { background: var(--lit); box-shadow: 0 0 8px var(--accent-2); }
.sw-glass { background: rgba(138,230,77,0.40); border: 1px solid rgba(180,240,140,0.75); }
.sw-unsized { width: 14px; height: 9px; border-radius: 50%; background: none; border: 2.5px solid var(--lit); box-shadow: 0 0 8px var(--accent-2); margin: 0 -3px; }
.sw-claim { width: 2px; background: rgba(255,255,255,0.85); position: relative; margin: 0 3px; }
.sw-claim::before { content: ""; position: absolute; top: -3px; left: -5px; width: 12px; height: 5px; border: 1.5px solid rgba(255,255,255,0.85); border-radius: 50%; }

.zoom { position: absolute; right: 372px; bottom: 64px; display: flex; flex-direction: column; gap: 6px; }
.zoom button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-size: 20px; line-height: 1; cursor: pointer; }
.zoom button:hover { border-color: var(--accent); }

#listToggle { display: none; }

#tip { position: absolute; z-index: 5; pointer-events: none; max-width: 280px; padding: 8px 11px; border-radius: 9px; background: var(--panel-solid);
  border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0,0,0,0.5); font-size: 14px; }
#tip strong { display: block; }
#tip span { color: var(--accent); }
#hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 10px 16px; border-radius: 10px; background: rgba(0,0,0,0.7); pointer-events: none; }

#card { position: absolute; z-index: 6; left: 16px; top: 16px; bottom: 64px; width: 380px; overflow-y: auto; padding: 18px 18px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(8px); }
#card .close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: none; font-size: 22px; line-height: 1; cursor: pointer; }
#card .pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
#card .pill.A { background: var(--accent); color: #0b1e16; }
#card .pill.B { border: 1px solid var(--accent); color: var(--accent); }
#card .pill.C { border: 1px solid rgba(255,255,255,0.6); color: var(--text); }
#card h2 { margin: 10px 40px 2px 0; font-size: 22px; line-height: 1.2; }
#card .where { margin: 0 0 12px; color: var(--muted); }
#card .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 12px; }
#card .num { padding: 9px; border-radius: 9px; background: rgba(0,0,0,0.3); border: 1px solid var(--line); }
#card .num b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
#card .num small { color: var(--muted); font-size: 12px; line-height: 1.25; display: block; }
#card .num.live b { color: var(--accent); }
#card dl { display: grid; grid-template-columns: 92px 1fr; gap: 4px 10px; margin: 0 0 12px; font-size: 14px; }
#card dt { color: var(--muted); }
#card dd { margin: 0; }
#card h3 { margin: 14px 0 6px; font-size: 13px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); }
#card .basis { color: var(--muted); font-size: 13px; margin: 0 0 6px; }
#card ul { margin: 0; padding-left: 18px; font-size: 14px; }
#card li { margin: 3px 0; }
#card .src li { overflow-wrap: anywhere; }

.credit { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 24px; font-size: 12px; color: var(--muted);
  background: linear-gradient(transparent, rgba(0,0,0,0.75)); }
.credit a { color: var(--muted); }

#loading { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg); color: var(--muted); transition: opacity 0.5s; }
#loading.done { opacity: 0; pointer-events: none; }

/* phones and narrow embeds */
@media (max-width: 899px) {
  .brand { top: 14px; left: var(--gutter); right: var(--gutter); max-width: none; }
  .brand .logo img { height: 24px; }
  .brand h1 { font-size: 20px; margin-top: 8px; }
  .brand .sub { display: none; }
  .brand .stats { font-size: 13px; margin-top: 4px; }
  #panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 62%; border-radius: var(--radius) var(--radius) 0 0; transform: translateY(105%); transition: transform 0.25s; z-index: 7; }
  #panel.open { transform: none; }
  #panel { padding-bottom: 64px; }
  #card { padding-bottom: 72px; }
  .legend { left: var(--gutter); bottom: 96px; padding: 8px 10px; }
  .legend label { font-size: 13px; }
  .zoom { right: var(--gutter); bottom: 96px; }
  #listToggle { display: block; position: absolute; left: 50%; transform: translateX(-50%); bottom: 40px; z-index: 8; padding: 9px 18px; border-radius: 99px;
    border: 1px solid var(--accent); background: var(--panel-solid); font-weight: 600; cursor: pointer; }
  #card { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 70%; border-radius: var(--radius) var(--radius) 0 0; z-index: 9; }
  .credit { padding: 6px var(--gutter); font-size: 10.5px; background: rgba(4,9,7,0.85); z-index: 6; }
  .credit-long { display: none; }
}
@media (prefers-reduced-motion: reduce) { #panel, #loading { transition: none; } }
