:root {
  --bg: #0a0e09;
  --panel: rgba(12, 17, 11, .92);
  --line: #263422;
  --text: #d8e0d0;
  --dim: #8a967f;
  --amber: #ffb347;
  --a: #4fc3f7;
  --b: #ff6e56;
  --mono: "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font: 14px/1.45 -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}
#map { position: absolute; inset: 0; }
#map canvas { filter: saturate(.65) brightness(.75); }
#fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; }

#topbar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: baseline; gap: 14px;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(5,8,5,.85), rgba(5,8,5,0));
  pointer-events: none; z-index: 5;
}
.brand { font-family: var(--mono); font-size: 20px; font-weight: 700; letter-spacing: 2px; color: #fff; }
.brand span { color: var(--amber); }
.tagline { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }

#panel {
  position: absolute; top: 60px; left: 14px;
  width: 330px; max-height: calc(100% - 80px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  z-index: 6;
  backdrop-filter: blur(6px);
}
.pick { display: flex; gap: 8px; align-items: end; }
.side { flex: 1; }
.side label { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; margin-bottom: 4px; }
.side-a label { color: var(--a); }
.side-b label { color: var(--b); }
.vs { font-family: var(--mono); color: var(--dim); padding-bottom: 9px; font-size: 12px; }
select {
  width: 100%; padding: 7px 6px;
  background: #101710; color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  font-size: 13px;
}
.mode-row { margin-top: 10px; }
.mode-row label { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--dim); display: block; margin-bottom: 4px; }

#launch {
  width: 100%; margin-top: 12px; padding: 11px;
  font-family: var(--mono); font-size: 14px; font-weight: 700; letter-spacing: 2px;
  color: #1a1206; background: linear-gradient(180deg, #ffc36b, #e89a2f);
  border: 0; border-radius: 7px; cursor: pointer;
}
#launch:disabled { background: #2a3226; color: #5c6653; cursor: not-allowed; }
#launch:not(:disabled):hover { filter: brightness(1.1); }

.hidden { display: none !important; }

#compare { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.cmp-head { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; margin-bottom: 8px; }
.cmp-head .na { color: var(--a); } .cmp-head .nb { color: var(--b); }
.cmp-row { margin-bottom: 7px; }
.cmp-label { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--dim); }
.cmp-label b { color: var(--text); font-family: var(--mono); font-weight: 600; }
.cmp-bar { display: flex; height: 5px; border-radius: 3px; overflow: hidden; background: #1c241a; margin-top: 3px; }
.cmp-bar .fa { background: var(--a); }
.cmp-bar .fb { background: var(--b); margin-left: auto; }
.rank-line { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-bottom: 8px; }

#results { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
#results h3 { font-family: var(--mono); font-size: 13px; letter-spacing: 1px; color: var(--amber); margin-bottom: 8px; }
.res-winner { font-size: 15px; margin-bottom: 6px; }
.res-winner b { font-family: var(--mono); }
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 12.5px; }
.res-grid .k { color: var(--dim); }
.res-grid .v { font-family: var(--mono); text-align: right; }
.res-note { margin-top: 8px; font-size: 11.5px; color: var(--dim); }
.res-note a { color: var(--amber); }
.share-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.share-row span { font-family: var(--mono); font-size: 11px; color: var(--dim); letter-spacing: 1px; }
.share-row button, .share-row a {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .5px;
  color: var(--amber); background: #1c2418; border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 10px; cursor: pointer; text-decoration: none;
}
.share-row button:hover, .share-row a:hover { border-color: var(--amber); }
.prob-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin: 6px 0 10px; }
.prob-bar .pa { background: var(--a); }
.prob-bar .pb { background: var(--b); }

#ticker {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  font-family: var(--mono); font-size: 13px; letter-spacing: 2px;
  color: var(--amber); background: rgba(10,14,9,.85);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 18px; z-index: 6; white-space: nowrap;
}
#ticker::before { content: "▶ "; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.explore { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; gap: 14px; }
.explore a { color: var(--dim); font-size: 12px; font-family: var(--mono); letter-spacing: .5px; text-decoration: none; }
.explore a:hover { color: var(--amber); }

.fineprint { margin-top: 12px; font-size: 10.5px; color: #5f6a56; line-height: 1.4; }

.maplibregl-ctrl-attrib { font-size: 10px !important; background: rgba(10,14,9,.7) !important; color: #7a8570 !important; }
.maplibregl-ctrl-attrib a { color: #9aa590 !important; }

@media (max-width: 720px) {
  #panel {
    top: auto; bottom: 0; left: 0; right: 0;
    width: 100%; max-height: 58%;
    border-radius: 12px 12px 0 0;
  }
  #ticker { bottom: auto; top: 64px; font-size: 11px; }
  .tagline { display: none; }
}
