:root {
  --bg: #05080f;
  --surface: rgba(12, 17, 27, 0.82);
  --border: #1a2233;
  --fg: #e9edf4;
  --muted: #9aa3b2;
  --red: #de1735;
  --blue: #47a7f5;
  --cyan: #66d9ff;
  --gold: #f0c75a;
  --green: #3fb950;
  --space: 'Space Grotesk', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#eco { position: fixed; inset: 0; z-index: 0; }

/* SSIP hub logo: centered over the subtle rotating WebGL globe */
.hub-logo {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: clamp(58px, 7.5vw, 86px); height: auto; z-index: 2; pointer-events: none;
  border-radius: 50%;
  filter: drop-shadow(0 0 18px rgba(71, 167, 245, 0.5)) drop-shadow(0 0 7px rgba(0, 0, 0, 0.7));
  animation: hub-breathe 8s ease-in-out infinite;
}

@keyframes hub-breathe {
  0%, 100% { opacity: 0.92; }
  50% { opacity: 1; }
}

/* 3D labels */
.eco-labels { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.eco-label {
  position: absolute; top: 0; left: 0;
  font-family: var(--space); font-size: 11px; font-weight: 500; letter-spacing: 0.04em;
  color: #cdd6e6; white-space: nowrap;
  text-shadow: 0 0 8px rgba(0,0,0,0.9), 0 1px 2px rgba(0,0,0,0.9);
  padding: 1px 5px; border-radius: 4px;
}
.eco-label.is-focus { color: #fff; background: rgba(71,167,245,0.18); }
.eco-label.is-reg { color: var(--green); }

/* top bar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 24px;
  padding: 22px 26px 40px;
  background: linear-gradient(180deg, rgba(5,8,15,0.92) 0%, rgba(5,8,15,0.55) 60%, transparent 100%);
  pointer-events: none;
}
.topbar .brand { pointer-events: auto; }
.eyebrow {
  font-family: var(--space); font-size: 11px; font-weight: 600; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--blue);
}
.topbar h1 {
  font-family: var(--space); font-weight: 600; font-size: clamp(18px, 2.3vw, 26px);
  margin: 6px 0 4px; letter-spacing: 0.01em;
}
.topbar h1 span { color: var(--red); }
.tag { margin: 0; color: var(--muted); font-size: 13px; }

.finder-wrap { pointer-events: auto; }
.finder {
  width: min(320px, 42vw); padding: 11px 14px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); color: var(--fg);
  font-family: var(--body); font-size: 14px; outline: none;
  backdrop-filter: blur(8px);
}
.finder:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(71,167,245,0.18); }
.finder::placeholder { color: var(--muted); }

/* stats */
.stats {
  position: fixed; left: 26px; bottom: 64px; z-index: 3; display: flex; gap: 22px;
}
.stats div { display: flex; flex-direction: column; }
.stats strong { font-family: var(--space); font-size: 22px; font-weight: 600; }
.stats span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }

/* legend */
.legend {
  position: fixed; right: 26px; bottom: 64px; z-index: 3;
  display: flex; flex-direction: column; gap: 7px; align-items: flex-end;
}
.lg { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.lg::after { content: ''; width: 9px; height: 9px; border-radius: 50%; }
.lg-cloud::after { background: #47506a; }
.lg-org::after { background: var(--blue); box-shadow: 0 0 7px var(--blue); }
.lg-sponsor::after { background: var(--gold); box-shadow: 0 0 7px var(--gold); }
.lg-organiser::after { background: #ffd98a; box-shadow: 0 0 9px #ffd98a; width: 11px; height: 11px; }
.lg-reg::after { background: var(--green); box-shadow: 0 0 7px var(--green); }

/* panel */
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 90vw); z-index: 4;
  background: var(--surface); backdrop-filter: blur(14px); border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform 0.32s cubic-bezier(0.2,0.7,0.2,1);
  overflow-y: auto; padding: 56px 24px 24px;
}
.panel.open { transform: translateX(0); }
.panel-close {
  position: absolute; top: 14px; right: 16px; background: none; border: none; color: var(--muted);
  font-size: 26px; line-height: 1; cursor: pointer;
}
.panel-close:hover { color: var(--fg); }

.p-name { font-family: var(--space); font-size: 20px; font-weight: 600; margin: 0 0 4px; }
.p-meta { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }
.p-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.badge {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px;
  border: 1px solid var(--border); color: var(--muted); letter-spacing: 0.03em;
}
.badge.table { color: var(--blue); border-color: rgba(71,167,245,0.4); }
.badge.sponsor { color: var(--gold); border-color: rgba(240,199,90,0.4); }
.badge.host { color: var(--cyan); border-color: rgba(102,217,255,0.4); }
.badge.organiser { color: #ffd98a; border-color: rgba(255,217,138,0.45); }
.p-desc { font-size: 13.5px; line-height: 1.55; color: #cdd6e6; margin-bottom: 16px; }
.p-h { font-family: var(--space); font-size: 11px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); margin: 16px 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 4px 9px; border-radius: 7px; background: rgba(71,167,245,0.08); border: 1px solid rgba(71,167,245,0.18); color: #cdd6e6; }
.chip.need { background: rgba(240,199,90,0.07); border-color: rgba(240,199,90,0.18); }
.p-link { display: inline-block; margin-top: 14px; color: var(--blue); font-size: 13px; text-decoration: none; }
.p-link:hover { text-decoration: underline; }

/* matches */
.match {
  display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--border); cursor: pointer;
}
.match:hover .m-name { color: var(--blue); }
.m-score {
  font-family: var(--space); font-weight: 600; font-size: 15px; min-width: 38px;
  color: var(--green); text-align: center;
}
.m-score small { display: block; font-size: 9px; color: var(--muted); font-weight: 400; }
.m-name { font-size: 13.5px; font-weight: 600; margin: 0 0 2px; }
.m-reason { font-size: 12px; color: var(--muted); line-height: 1.45; }
.m-table { font-size: 11px; color: var(--blue); }

/* footer */
.footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 12px 26px; font-size: 12px; color: var(--muted);
  background: linear-gradient(0deg, rgba(5,8,15,0.92), transparent);
}
.cta {
  pointer-events: auto; color: var(--fg); text-decoration: none; font-weight: 600; font-size: 12.5px;
  padding: 8px 16px; border-radius: 8px; background: var(--red);
}
.cta:hover { filter: brightness(1.1); }

/* find-my-matches CTA + sheet */
.find-cta {
  position: fixed; z-index: 5; right: 26px; top: 92px;
  background: var(--red); color: #fff; border: none; cursor: pointer;
  font-family: var(--space); font-weight: 600; font-size: 13.5px; letter-spacing: 0.02em;
  padding: 11px 18px; border-radius: 10px; box-shadow: 0 6px 22px rgba(222,23,53,0.35);
}
.find-cta:hover { filter: brightness(1.08); }

.sheet {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: rgba(3, 6, 12, 0.7); backdrop-filter: blur(4px); padding: 18px;
}
.sheet[hidden] { display: none; }
.sheet-card {
  position: relative; width: min(440px, 100%); max-height: 90vh; overflow-y: auto;
  background: #0b111c; border: 1px solid var(--border); border-radius: 16px; padding: 26px 22px 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.sheet-close { position: absolute; top: 12px; right: 14px; background: none; border: none; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; }
.sheet-close:hover { color: var(--fg); }
.sheet-h { font-family: var(--space); font-size: 19px; font-weight: 600; margin: 0 0 6px; }
.sheet-h2 { font-family: var(--space); font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin: 16px 0 8px; }
.sheet-sub { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin: 0 0 16px; }
.sheet-search {
  width: 100%; padding: 13px 14px; border-radius: 10px; margin-bottom: 12px;
  background: #070c15; border: 1px solid var(--border); color: var(--fg); font-family: var(--body); font-size: 16px; outline: none;
}
.sheet-search:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(71,167,245,0.18); }
.sheet-go {
  width: 100%; padding: 13px; border-radius: 10px; border: none; cursor: pointer; margin-top: 4px;
  background: var(--blue); color: #04101e; font-family: var(--space); font-weight: 600; font-size: 15px;
}
.sheet-go:hover { filter: brightness(1.06); }
.sheet-link { display: block; width: 100%; margin-top: 12px; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; text-decoration: underline; }
.sheet-link:hover { color: var(--fg); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: #cdd6e6;
  padding: 8px 11px; border: 1px solid var(--border); border-radius: 9px; cursor: pointer; background: #070c15;
}
.opt input { accent-color: var(--blue); width: 16px; height: 16px; }

/* always-visible return-to-SSIP button + recommended table */
.topbar { padding-top: 52px; }
.back-ssip {
  position: fixed; top: 16px; left: 24px; z-index: 30;
  color: var(--muted); background: rgba(12, 17, 27, 0.72); border: 1px solid var(--border);
  padding: 7px 13px; border-radius: 8px; font-size: 12.5px; font-weight: 500; text-decoration: none; backdrop-filter: blur(6px);
}
.back-ssip:hover { color: var(--fg); border-color: var(--blue); }
.res-rec {
  background: rgba(71, 167, 245, 0.1); border: 1px solid rgba(71, 167, 245, 0.3);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
}
.res-rec strong { font-family: var(--space); color: var(--blue); font-size: 15px; }
.res-rec span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.r-error { color: var(--red); font-size: 12.5px; margin-top: 10px; }

@media (max-width: 640px) {
  .find-cta { left: 16px; right: 16px; top: auto; bottom: 14px; text-align: center; padding: 15px; font-size: 15px; }
  .sheet { padding: 0; align-items: stretch; }
  .sheet-card { width: 100%; max-height: 100vh; border-radius: 0; padding-top: 40px; }
  .footer { display: none; }

  .topbar { flex-direction: column; gap: 12px; }
  .stats { bottom: 56px; gap: 16px; }
  .legend { display: none; }
  .footer span { display: none; }
}

.ai-note { display:block; padding:10px 12px; margin-bottom:10px; border-radius:10px; background:rgba(80,180,255,0.08); border:1px solid rgba(80,180,255,0.25); font-size:13px; line-height:1.45; }
.ai-note strong { color:#7cc4ff; }


.m-who { font-size:12px; margin-top:4px; color:#cbd5e1; }
.m-who strong { color:#7cc4ff; font-weight:600; }

