/* GEODE — HUD */

:root {
  --accent: #7de3ff;
  --accent-dim: rgba(125, 227, 255, 0.25);
  --glass: rgba(6, 12, 20, 0.55);
  --text: #cfe8f5;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --sans: -apple-system, 'Helvetica Neue', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; overflow: hidden; background: #01030a; }
#app, #app canvas { position: fixed; inset: 0; }

#hud {
  position: fixed; inset: 0;
  pointer-events: none;
  font-family: var(--sans);
  color: var(--text);
  user-select: none;
  z-index: 10;
}

/* ---------- top-left: brand + crumbs ---------- */
#top-left { position: absolute; top: 18px; left: 20px; display: flex; flex-direction: column; gap: 10px; }
#brand {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.5em;
  color: var(--accent); opacity: 0.9;
}
#crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; max-width: 46vw; pointer-events: auto; }
#crumbs .chip {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  padding: 4px 10px; border: 1px solid var(--accent-dim); border-radius: 999px;
  background: var(--glass); backdrop-filter: blur(10px);
  cursor: pointer; transition: all 0.15s;
  white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis;
}
#crumbs .chip:hover { border-color: var(--accent); color: var(--accent); }
#crumbs .chip.here { color: var(--accent); border-color: var(--accent); background: rgba(125, 227, 255, 0.1); }
#crumbs .sep { color: var(--accent-dim); font-size: 9px; }

/* ---------- top-right: stats + buttons ---------- */
#top-right { position: absolute; top: 18px; right: 20px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#stats {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: #8fb3c6;
  background: var(--glass); backdrop-filter: blur(10px);
  padding: 5px 12px; border: 1px solid var(--accent-dim); border-radius: 999px;
}
#stats:empty { display: none; }
#modes { display: flex; gap: 6px; pointer-events: auto; }
#modes span {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: #8fb3c6;
  background: var(--glass); backdrop-filter: blur(10px);
  padding: 4px 11px; border: 1px solid var(--accent-dim); border-radius: 999px;
  cursor: pointer; transition: all 0.15s;
}
#modes span:hover { border-color: var(--accent); color: var(--accent); }
#buttons { display: flex; gap: 6px; pointer-events: auto; }
#buttons button {
  font-family: var(--mono); font-size: 12px; color: var(--text);
  width: 32px; height: 28px; border: 1px solid var(--accent-dim); border-radius: 7px;
  background: var(--glass); backdrop-filter: blur(10px); cursor: pointer;
  transition: all 0.15s;
}
#buttons button:hover { border-color: var(--accent); color: var(--accent); }
#buttons button.on { color: #0a141c; background: var(--accent); border-color: var(--accent); }

/* ---------- reticle ---------- */
#reticle {
  position: absolute; left: 50%; top: 50%; width: 44px; height: 44px;
  transform: translate(-50%, -50%); opacity: 0.85;
}
#reticle b {
  position: absolute; left: 50%; top: 50%; width: 3px; height: 3px;
  background: var(--accent); border-radius: 50%;
  transform: translate(-50%, -50%);
}
#reticle i {
  position: absolute; width: 10px; height: 10px;
  border: 1.5px solid var(--accent); opacity: 0.55;
  transition: all 0.18s ease;
}
#reticle i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; }
#reticle i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; }
#reticle i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; }
#reticle i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; }
#reticle.lock i { opacity: 1; }
#reticle.lock i:nth-child(1) { left: 6px; top: 6px; }
#reticle.lock i:nth-child(2) { right: 6px; top: 6px; }
#reticle.lock i:nth-child(3) { left: 6px; bottom: 6px; }
#reticle.lock i:nth-child(4) { right: 6px; bottom: 6px; }

/* ---------- target panel ---------- */
#target {
  position: absolute; left: 50%; top: 50%;
  transform: translate(40px, -50%);
  min-width: 200px; max-width: 320px;
  background: var(--glass); backdrop-filter: blur(14px);
  border: 1px solid var(--accent-dim); border-left: 2px solid var(--accent);
  border-radius: 10px; padding: 12px 16px;
  opacity: 0; transition: opacity 0.15s;
}
#target.show { opacity: 1; }
.t-name { font-size: 15px; font-weight: 600; margin-bottom: 6px; word-break: break-all; }
.t-meta { display: flex; flex-wrap: wrap; gap: 10px; font-family: var(--mono); font-size: 10.5px; color: #8fb3c6; align-items: center; }
.t-kind { border: 1px solid; border-radius: 4px; padding: 1px 6px; letter-spacing: 0.12em; }
.t-hint { margin-top: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; color: #6c93a8; }

/* ---------- speed / boost ---------- */
#bottom { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); }
#speedo {
  display: flex; align-items: center; gap: 12px;
  background: var(--glass); backdrop-filter: blur(10px);
  border: 1px solid var(--accent-dim); border-radius: 999px;
  padding: 8px 20px;
}
#speed-val { font-family: var(--mono); font-size: 22px; color: var(--accent); }
#speed-unit { font-family: var(--mono); font-size: 10px; color: #6c93a8; margin-left: -6px; }
#speedo .bar {
  position: relative; width: 130px; height: 5px;
  background: rgba(125, 227, 255, 0.12); border-radius: 3px; overflow: hidden;
}
#speedo .bar > div { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.1s; }
#boost-wrap { overflow: visible; }
#boost-wrap > div { background: #ffd84d; }
#boost-wrap.boosting > div { background: #ffb84d; box-shadow: 0 0 8px #ffb84d; }
#boost-wrap.hot > div { background: #ff5252; }
#boost-wrap label {
  position: absolute; right: -46px; top: -3px;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em; color: #6c93a8;
}

/* ---------- banner ---------- */
#banner {
  position: absolute; left: 50%; top: 26%;
  transform: translateX(-50%);
  text-align: center; opacity: 0; pointer-events: none;
}
#banner.show { animation: banner 2.6s ease forwards; }
.b-main {
  font-size: 40px; font-weight: 200; letter-spacing: 0.35em;
  color: #eaf6ff; text-shadow: 0 0 30px rgba(125, 227, 255, 0.6);
  text-transform: uppercase; white-space: nowrap; margin-left: 0.35em;
}
.b-sub { margin-top: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.3em; color: #7fa3b8; }
@keyframes banner {
  0% { opacity: 0; transform: translateX(-50%) scale(0.94); }
  12% { opacity: 1; transform: translateX(-50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------- toast ---------- */
#toast {
  position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  background: var(--glass); backdrop-filter: blur(10px);
  border: 1px solid var(--accent-dim); border-radius: 8px;
  padding: 8px 16px; opacity: 0; transition: opacity 0.2s;
  max-width: 70vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#toast.show { opacity: 1; }
#toast.err { border-color: rgba(255, 82, 82, 0.6); color: #ffb3b3; }
#toast.warn { border-color: rgba(255, 216, 77, 0.5); color: #ffe9a8; }

/* ---------- exit marker ---------- */
#exit-marker {
  position: absolute; display: none;
  transform: translate(-50%, -50%);
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.25em;
  color: var(--accent); text-align: center; opacity: 0.75;
}
#exit-marker span { display: block; font-size: 12px; transform: rotate(var(--rot, 0rad)); }
#exit-marker.edge { opacity: 1; }

/* ---------- preview panel ---------- */
#preview {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(0.97);
  width: min(76vw, 1000px); max-height: 82vh;
  display: none; flex-direction: column;
  background: rgba(4, 9, 16, 0.88); backdrop-filter: blur(18px);
  border: 1px solid var(--accent-dim); border-radius: 14px;
  overflow: hidden; pointer-events: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s;
}
#preview.show { display: flex; transform: translate(-50%, -50%) scale(1); }
.p-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--accent-dim);
}
#p-title { font-family: var(--mono); font-size: 13px; color: var(--accent); word-break: break-all; }
.p-btns { display: flex; gap: 8px; flex-shrink: 0; }
.p-btns button {
  font-family: var(--mono); font-size: 11px; color: var(--text);
  border: 1px solid var(--accent-dim); border-radius: 7px;
  background: transparent; cursor: pointer; padding: 5px 12px;
}
.p-btns button:hover { border-color: var(--accent); color: var(--accent); }
#p-body { overflow: auto; display: flex; justify-content: center; min-height: 120px; }
#p-body img, #p-body video { max-width: 100%; max-height: 72vh; object-fit: contain; }
#p-body iframe { width: 100%; height: 72vh; border: 0; background: #fff; }
#p-body pre {
  width: 100%; margin: 0; padding: 18px 22px;
  font-family: var(--mono); font-size: 12px; line-height: 1.55;
  color: var(--text); white-space: pre-wrap; word-break: break-word;
}

/* ---------- now playing ---------- */
#nowplaying {
  position: absolute; bottom: 26px; left: 22px;
  display: none; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; color: var(--text);
  background: var(--glass); backdrop-filter: blur(10px);
  border: 1px solid var(--accent-dim); border-radius: 999px;
  padding: 7px 14px; max-width: 34vw;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#nowplaying.show { display: flex; }
.np-hint { color: #6c93a8; font-size: 9px; letter-spacing: 0.15em; }
.np-eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 10px; }
.np-eq i { width: 3px; background: var(--accent); animation: eq 0.8s ease-in-out infinite; }
.np-eq i:nth-child(1) { animation-delay: 0s; }
.np-eq i:nth-child(2) { animation-delay: 0.25s; }
.np-eq i:nth-child(3) { animation-delay: 0.5s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 10px; } }

/* ---------- search ---------- */
#search {
  position: absolute; left: 50%; top: 16%;
  transform: translateX(-50%);
  width: min(640px, 84vw);
  display: none; flex-direction: column;
  background: rgba(4, 9, 16, 0.9); backdrop-filter: blur(18px);
  border: 1px solid var(--accent-dim); border-radius: 14px;
  overflow: hidden; pointer-events: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
#search.show { display: flex; }
#search-input {
  background: transparent; border: 0; outline: 0;
  padding: 16px 20px; font-family: var(--mono); font-size: 16px;
  color: var(--accent); letter-spacing: 0.04em;
}
#search-status {
  padding: 0 20px 10px; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.12em; color: #6c93a8;
}
#search-results { max-height: 46vh; overflow-y: auto; }
.s-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 20px; cursor: pointer; font-size: 13px;
  border-top: 1px solid rgba(125, 227, 255, 0.06);
}
.s-row:hover, .s-row.sel { background: rgba(125, 227, 255, 0.08); }
.s-row i { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.s-name { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-size { font-family: var(--mono); font-size: 10px; color: #6c93a8; flex-shrink: 0; }
.s-path {
  font-family: var(--mono); font-size: 10px; color: #56788c;
  margin-left: auto; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 40%; direction: rtl;
}

/* ---------- prompt ---------- */
#prompt {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center;
  background: rgba(1, 3, 10, 0.55); backdrop-filter: blur(4px);
  pointer-events: auto;
}
#prompt.show { display: flex; }
#prompt .p-box {
  background: rgba(4, 9, 16, 0.92); border: 1px solid var(--accent-dim);
  border-radius: 12px; padding: 20px 26px; min-width: 320px;
}
#prompt-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em;
  color: var(--accent); margin-bottom: 12px; text-transform: uppercase;
}
#prompt-input {
  width: 100%; background: rgba(125, 227, 255, 0.06);
  border: 1px solid var(--accent-dim); border-radius: 7px;
  padding: 9px 12px; font-size: 14px; color: var(--text); outline: 0;
}

/* ---------- help ---------- */
#help {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center;
  background: rgba(1, 3, 10, 0.7); backdrop-filter: blur(6px);
  pointer-events: auto;
}
#help.show { display: flex; }
#help .panel {
  background: var(--glass); border: 1px solid var(--accent-dim);
  border-radius: 14px; padding: 28px 36px; max-width: 420px;
}
#help h2 { font-family: var(--mono); font-size: 14px; letter-spacing: 0.2em; color: var(--accent); margin-bottom: 18px; }
#help table { border-collapse: collapse; width: 100%; }
#help td { padding: 4px 0; font-size: 13px; }
#help td:first-child { font-family: var(--mono); font-size: 11px; color: var(--accent); padding-right: 26px; white-space: nowrap; }
#help p { margin-top: 16px; font-size: 12px; color: #8fb3c6; line-height: 1.6; }

/* ---------- splash ---------- */
#splash {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(6, 16, 28, 0.55), rgba(1, 3, 10, 0.88));
  pointer-events: auto; cursor: pointer;
  transition: opacity 0.5s;
}
#splash.gone { opacity: 0; pointer-events: none; }
.s-inner { text-align: center; }
.s-mark { font-size: 42px; color: var(--accent); text-shadow: 0 0 40px var(--accent); margin-bottom: 18px; }
#splash h1 {
  font-weight: 100; font-size: 54px; letter-spacing: 0.6em;
  color: #eaf6ff; margin-left: 0.6em; text-shadow: 0 0 60px rgba(125, 227, 255, 0.5);
}
.s-tag { margin-top: 10px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.35em; color: #7fa3b8; }
.s-go {
  margin-top: 46px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.3em;
  color: var(--accent); animation: pulse 2s ease-in-out infinite;
}
#grant {
  margin-top: 22px; padding: 10px 26px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.25em;
  color: #0a141c; background: var(--accent);
  border: 0; border-radius: 999px; cursor: pointer;
  box-shadow: 0 0 30px rgba(125, 227, 255, 0.4);
}
#grant:hover { box-shadow: 0 0 46px rgba(125, 227, 255, 0.7); }
.s-keys { margin-top: 34px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.s-keys span {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: #6c93a8;
  border: 1px solid rgba(125, 227, 255, 0.15); border-radius: 999px; padding: 4px 12px;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
