:root {
  /* NBD Finder brand tokens */
  --bg-dark: #0f1115;                          /* page background (near-black) */
  --bg-panel: rgba(22, 25, 31, 0.7);           /* glassy panels */
  --bg-panel-solid: rgba(15, 17, 21, 0.95);
  --neon-green: #00ff88;                        /* PRIMARY accent */
  --neon-blue: #00e5ff;                         /* secondary accent */
  --neon-pink: #ff007f;
  --neon-orange: #f59e0b;
  --text-main: #ffffff;
  --text-muted: #b0b6bc;
  --border-glass: rgba(255, 255, 255, 0.1);
  --shadow-glow: 0 0 20px rgba(0, 255, 136, 0.4); /* signature green glow */
  --font-heading: "Outfit", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: 0.5px;
}

a {
  color: var(--neon-green);
  text-decoration: none;
}

#scene-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- NBD Finder brand bar (slim top strip) ---------- */

#brand-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(12px + env(safe-area-inset-top)) calc(20px + env(safe-area-inset-right)) 12px calc(20px + env(safe-area-inset-left));
  background: rgba(10, 12, 15, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-glass);
}

.brand-wordmark {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand-wordmark .bw-nbd { color: #fff; }
.brand-wordmark .bw-finder { color: var(--neon-green); }
.brand-wordmark:hover .bw-finder { text-shadow: var(--shadow-glow); }

.brand-slogan {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}

.brand-backlink {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.15s;
}
.brand-backlink:hover { color: var(--neon-green); }

@media (max-width: 720px) {
  .brand-slogan { display: none; }
}

@media (max-width: 600px) {
  .brand-wordmark { font-size: 18px; }
}

/* ---------- bottom trick bar ---------- */

#trick-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  gap: 10px;
  justify-content: safe center;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 26px 16px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0));
  transition: opacity 0.4s;
}

#trick-bar::-webkit-scrollbar {
  display: none;
}

.trick {
  flex: 0 0 180px;
  width: 180px;
  height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  scroll-snap-align: start;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--text-main);
  background: var(--bg-panel);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 9px 14px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.trick:hover {
  background: rgba(30, 34, 41, 0.85);
  border-color: rgba(0, 255, 136, 0.6);
  transform: translateY(-2px);
}

.trick.disabled {
  opacity: 0.4;
  cursor: default;
}

.trick.disabled:hover {
  background: var(--bg-panel);
  border-color: var(--border-glass);
  transform: none;
}

.t-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.t-meta {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.t-photog {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.75;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* the trick being viewed (or flown to) — neon-outline, green glow */
.trick.active {
  background: rgba(0, 255, 136, 0.12);
  border-color: var(--neon-green);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.trick.active .t-name {
  color: var(--neon-green);
}

/* ---------- matched view chrome ---------- */

/* dev ?snap= jumps: no fades, so headless screenshots are deterministic */
body.snap #trick-bar {
  transition: none;
}

#back-btn,
#info-btn {
  position: fixed;
  top: calc(62px + env(safe-area-inset-top));
  z-index: 30;
  font: inherit;
  font-size: 13px;
  color: var(--text-main);
  background: var(--bg-panel);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

#back-btn:hover,
#info-btn:hover {
  color: var(--neon-green);
  border-color: rgba(0, 255, 136, 0.6);
  box-shadow: var(--shadow-glow);
}

#back-btn {
  left: 18px;
  display: none;
}

#info-btn {
  right: 18px;
}

body.matched #back-btn {
  display: block;
}

/* ---------- history popup ---------- */

#history-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.25s ease;
}

#history-modal.open {
  opacity: 1;
}

#history-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

#history-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(600px, calc(100vw - 48px));
  max-height: 78vh;
  overflow-y: auto;
  background: var(--bg-panel-solid);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-top: 2px solid var(--neon-green);
  border-radius: 12px;
  padding: 28px 32px 24px;
  color: #e8e8e8;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6);
}

#history-card h2 {
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-main);
}

.h-sub {
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--neon-green);
  opacity: 0.85;
  margin: 6px 0 16px;
}

#history-card p:not(.h-sub) {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 12px;
}

#history-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: #999;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s;
}

#history-close:hover {
  color: var(--neon-green);
}
