:root{
  --bg0:#070812;
  --bg1:#0b1022;
  --panel: rgba(255,255,255,.06);
  --panel2: rgba(255,255,255,.09);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.60);
  --muted2: rgba(255,255,255,.38);
  --hot: #8af;
  --acid:#6ff3c1;
  --ember:#ff7aa8;
  --gold:#ffd166;
  --shadow: 0 16px 50px rgba(0,0,0,.55);
  --r: 16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: var(--sans);
  background: radial-gradient(1000px 700px at 20% 10%, rgba(120,170,255,.12), transparent 60%),
              radial-gradient(1000px 700px at 80% 20%, rgba(120,255,210,.10), transparent 55%),
              radial-gradient(900px 800px at 50% 90%, rgba(255,120,170,.08), transparent 55%),
              linear-gradient(180deg, var(--bg0), var(--bg1));
  color: var(--text);
  overflow-x:hidden;
}

.bg-aurora{
  position:fixed; inset:-20vh -20vw;
  filter: blur(50px) saturate(115%);
  opacity:.7;
  background:
    conic-gradient(from 90deg at 50% 50%,
      rgba(122,180,255,.16),
      rgba(110,255,200,.14),
      rgba(255,120,170,.12),
      rgba(255,210,120,.10),
      rgba(122,180,255,.16));
  animation: drift 18s linear infinite;
  pointer-events:none;
  mix-blend-mode: screen;
}
@keyframes drift{
  0%{transform: translate3d(-2%, -1%, 0) rotate(0deg) scale(1.15)}
  50%{transform: translate3d(2%, 1%, 0) rotate(180deg) scale(1.22)}
  100%{transform: translate3d(-2%, -1%, 0) rotate(360deg) scale(1.15)}
}
.noise{
  position:fixed; inset:0;
  opacity:.08;
  pointer-events:none;
  background-image:
    repeating-radial-gradient(circle at 10% 20%,
      rgba(255,255,255,.06) 0 1px,
      transparent 1px 3px);
  mix-blend-mode: overlay;
}

.wrap{max-width: 1200px; margin: 24px auto 70px; padding: 0 18px;}

.topbar{
  position:sticky; top:0; z-index:10;
  background: rgba(5,7,18,.80);
  backdrop-filter: blur(14px);
}
.topbar-inner{
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 18px;
  display:flex; align-items:center; gap:14px;
}
.brand{display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--text); flex-shrink:0}
.brand-orb{
  width:22px;height:22px;border-radius:50%;
  background: radial-gradient(circle at 30% 30%, #c8e8ff, #47f 40%, #103 74%);
  box-shadow: 0 0 18px rgba(130,170,255,.50), 0 0 6px rgba(130,170,255,.30);
}
.brand-name{
  font-weight:800;
  font-size:18px;
  letter-spacing:-.3px;
  color: var(--text);
}
.brand-accent{
  color: var(--acid);
  font-weight:800;
}

.nav{display:flex; gap:6px; align-items:center; flex-wrap:wrap; flex:1}
.nav a{
  text-decoration:none; color:var(--muted);
  padding:8px 12px; border-radius: 999px;
  font-size:14px;
  transition: color .15s, background .15s;
}
.nav a:hover{color:var(--text); background: rgba(255,255,255,.06)}
.nav a.active{color:var(--text); background: rgba(120,170,255,.14)}
.pill{
  background: linear-gradient(180deg, rgba(140,180,255,.22), rgba(120,255,210,.12));
  color: var(--text) !important;
  padding:8px 14px; border-radius: 999px;
  font-size:14px;
  text-decoration:none;
  display:inline-block;
}
.pill:hover{background: linear-gradient(180deg, rgba(140,180,255,.30), rgba(120,255,210,.18)) !important}
button.pill{
  cursor:pointer;
  font-family:inherit;
  font-size:14px;
}
.iconbtn{
  width:36px;height:36px;border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor:pointer;
  border:none;
  flex-shrink:0;
}
.iconbtn:hover{background: rgba(255,255,255,.10)}

.hero{
  background: rgba(255,255,255,.04);
  border-radius: calc(var(--r) + 6px);
  box-shadow: var(--shadow);
  padding: 24px;
  overflow:visible;
  position:relative;
}
.hero::after{
  content:"";
  position:absolute; inset:-2px;
  background: radial-gradient(600px 220px at 20% 0%, rgba(140,180,255,.14), transparent 60%),
              radial-gradient(500px 220px at 80% 10%, rgba(110,255,200,.10), transparent 55%);
  pointer-events:none;
  z-index:0;
  border-radius: calc(var(--r) + 8px);
}
.hero > *{position:relative; z-index:1}
.searchbar{z-index:2}

.hgrid{display:grid; grid-template-columns: 1fr; gap: 20px}

.h-title{font-size: 26px; font-weight: 800; letter-spacing:.2px; margin: 0 0 8px}
.h-sub{margin:0 0 16px; color: var(--muted); line-height: 1.5; font-size:15px}

.searchbar{
  position:relative;
  display:flex; gap:10px; align-items:center;
}
.searchbar input{
  flex:1;
  border-radius: 14px;
  background: rgba(0,0,0,.30);
  color: var(--text);
  padding: 13px 16px;
  outline:none;
  border:none;
  font-size:15px;
  font-family:inherit;
}
.searchbar input:focus{
  box-shadow: 0 0 0 2px rgba(140,180,255,.40);
}
.searchbar input::placeholder{color:var(--muted2)}
.searchbar button{
  border-radius: 14px;
  padding: 13px 18px;
  background: rgba(140,180,255,.16);
  color: var(--text);
  cursor:pointer;
  border:none;
  font-size:14px;
  font-family:inherit;
}
.searchbar button:hover{background: rgba(140,180,255,.24)}

.suggest{
  position:absolute;
  top: 52px; left:0; right: 0;
  border-radius: 14px;
  background: rgba(10,12,26,.98);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  overflow:hidden;
  display:none;
  z-index: 100;
}
.suggest .item{
  display:flex; justify-content:space-between; gap:10px;
  padding: 11px 14px;
  text-decoration:none;
  color: var(--text);
}
.suggest .item + .item{border-top: 1px solid rgba(255,255,255,.04)}
.suggest .item:hover,.suggest .item.active{background: rgba(140,180,255,.10)}
.suggest .rhs{color: var(--muted); font-family: var(--mono); font-size:12px}

.grid{
  margin-top: 16px;
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
@media (max-width: 980px){.grid{grid-template-columns: 1fr 1fr}}
@media (max-width: 620px){.grid{grid-template-columns: 1fr}}

.card{
  background: rgba(255,255,255,.05);
  border-radius: var(--r);
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.card h3{margin:0 0 12px; font-size:12px; letter-spacing:.8px; text-transform: uppercase; color: var(--muted); font-weight:600}
.muted{color: var(--muted)}
.muted2{color: var(--muted2)}

.wordline{
  display:flex; align-items:baseline; gap:10px; flex-wrap:wrap;
}
.wordline a{
  color: var(--text);
  text-decoration:none;
  font-weight: 800;
  font-size: 30px;
  letter-spacing:.2px;
}
.wordline a:hover{text-decoration: underline}
.tag{
  display:inline-flex; align-items:center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}
.pos-noun .tag,.tag.pos-noun{background: rgba(140,180,255,.14); color:rgba(180,210,255,.9)}
.pos-verb .tag,.tag.pos-verb{background: rgba(110,255,200,.12); color:rgba(150,255,220,.9)}
.pos-adj .tag,.tag.pos-adj{background: rgba(255,120,170,.12); color:rgba(255,170,200,.9)}
.pos-adv .tag,.tag.pos-adv{background: rgba(255,210,120,.12); color:rgba(255,230,170,.9)}

.list{
  display:flex; flex-direction:column; gap:6px;
}
.row{
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,.20);
}
.row:hover{background: rgba(0,0,0,.28)}
.row a{color: var(--text); text-decoration:none; font-weight:700; font-size:15px}
.row a:hover{text-decoration: underline}
.row .meta{color: var(--muted); font-family: var(--mono); font-size: 12px; text-align:right; white-space:nowrap; flex-shrink:0}

.bar{
  width:100%;
  height:5px; border-radius:999px;
  background: rgba(255,255,255,.08);
  overflow:hidden;
  margin-top:7px;
}
.bar > i{
  display:block; height:100%;
  background: linear-gradient(90deg, rgba(140,180,255,.70), rgba(110,255,200,.60), rgba(255,120,170,.50));
  border-radius:999px;
}

.two-col{
  display:grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
}
@media (max-width: 980px){.two-col{grid-template-columns: 1fr}}

.galaxy-wrap{
  width:100%;
  background: #020308;
  border-radius: var(--r);
  overflow:hidden;
  margin-top:16px;
  z-index: 0;
}
.galaxy-canvas{
  display:block;
  width:100%;
  min-height:340px;
}

/* ── CSS galaxy ─────────────────────────────────────────── */
.galaxy-css {
  position: relative;
  width: 100%;
  min-height: 340px;
  background: #020308;
  overflow: hidden;
}
.galaxy-nebula {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.galaxy-dust {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  pointer-events: none;
  z-index: 0;
}
.galaxy-center {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.galaxy-center-glow {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,228,255,0.45) 0%, rgba(140,190,255,0.18) 40%, transparent 70%);
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
}
.galaxy-center-core {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px 4px rgba(200,228,255,0.7);
}
.galaxy-center-label {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 800;
  color: rgba(255,255,255,0.95);
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(140,190,255,0.8);
}
.galaxy-node {
  position: absolute;
  width: 0; height: 0;        /* zero-size anchor — children use position:absolute */
  text-decoration: none;
  cursor: pointer;
  z-index: 2;
}
.galaxy-node:hover {
  z-index: 10;
}
.galaxy-node-core {
  border-radius: 50%;
  transition: filter .15s;
}
.galaxy-node-label {
  white-space: nowrap;
  font-family: var(--sans);
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  transition: opacity .15s;
}
.galaxy-node-score {
  font-size: 10px;
  color: rgba(180,210,255,0.75);
  font-family: var(--mono);
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
  white-space: nowrap;
}
.galaxy-node:hover .galaxy-node-score { opacity: 1; }
.galaxy-node:hover .galaxy-node-label { opacity: 1 !important; font-weight: 700; }
.galaxy-node:hover .galaxy-node-core { filter: brightness(1.6); }
.galaxy-node.shared .galaxy-node-label { color: rgba(111,243,193,0.85); }
.galaxy-node.shared:hover .galaxy-node-label { color: rgba(111,243,193,1); }
.galaxy-center.word-a .galaxy-center-core { background: #88aaff; box-shadow: 0 0 10px 4px rgba(136,170,255,0.7); }
.galaxy-center.word-a .galaxy-center-glow { background: radial-gradient(circle, rgba(136,170,255,0.45) 0%, rgba(100,140,255,0.18) 40%, transparent 70%); }
.galaxy-center.word-b .galaxy-center-core { background: #ff7aa8; box-shadow: 0 0 10px 4px rgba(255,122,168,0.7); }
.galaxy-center.word-b .galaxy-center-glow { background: radial-gradient(circle, rgba(255,122,168,0.45) 0%, rgba(255,80,130,0.18) 40%, transparent 70%); }

.footer{
  background: rgba(5,7,18,.50);
  backdrop-filter: blur(10px);
  margin-top:40px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.footer-inner{
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 18px;
  display:flex;
  justify-content: center;
  align-items: center;
  gap:10px;
  flex-wrap:wrap;
  font-size: 13px;
  color: var(--muted2);
}
.footer-inner a{
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.footer-inner a:hover{color: var(--text)}
.footer-logo{
  font-weight: 800;
  font-size: 14px;
  color: var(--muted);
}
.footer-sep{color: var(--muted2); opacity:.5}
.footer-copy{color: var(--muted2)}
kbd{
  font-family: var(--mono);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(255,255,255,.10);
}

.hr{
  height:1px; background: rgba(255,255,255,.08);
  margin: 14px 0;
}

.pager{
  display:flex; gap:6px; flex-wrap:wrap; align-items:center;
  margin-top:14px;
}
.pager a{
  padding: 7px 11px;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  text-decoration:none;
  color: var(--text);
  font-size:14px;
}
.pager a:hover{background: rgba(255,255,255,.10)}
.pager a.active{background: rgba(140,180,255,.18)}

.kbd-dialog::backdrop{background: rgba(0,0,0,.60)}
.kbd-card{
  width:min(580px, 92vw);
  border-radius: 18px;
  background: rgba(10,12,26,.95);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  padding: 20px;
  border:none;
}
.kbd-title{font-weight:800; font-size: 16px; margin-bottom: 12px}
.kbd-grid{display:grid; grid-template-columns: 1fr 1fr; gap: 10px; color: var(--muted); font-size:14px}
@media (max-width: 560px){.kbd-grid{grid-template-columns: 1fr}}
.kbd-actions{display:flex; justify-content:flex-end; margin-top: 16px}

.daily-pair{
  display:flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pair-word{
  display:flex; align-items:center; gap:8px; flex-shrink:0;
}
.pair-word a{
  font-size:22px; font-weight:800; color:var(--text); text-decoration:none;
}
.pair-word a:hover{text-decoration:underline}
.pair-connector{
  color:var(--muted2); font-size:12px; font-family:var(--mono);
  display:flex; align-items:center; gap:6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.pair-score{
  height:5px; border-radius:999px;
  background: linear-gradient(90deg, rgba(140,180,255,.70), rgba(110,255,200,.60));
  flex-shrink: 0;
  min-width: 4px;
}

.compare-inputs{
  display:flex; gap:12px; flex-wrap:wrap; align-items:flex-end; margin-bottom:20px;
}
.compare-field{display:flex; flex-direction:column; gap:6px; flex:1; min-width:180px}
.compare-field label{font-size:12px; color:var(--muted2); font-family:var(--mono); letter-spacing:.5px; text-transform:uppercase}
.compare-field .field-wrap{position:relative; z-index:2}
.compare-field input{
  width:100%;
  border-radius:12px;
  background: rgba(0,0,0,.28);
  color:var(--text);
  padding:11px 14px;
  font-size:15px;
  font-family:inherit;
  border:none;
  outline:none;
}
.compare-field input:focus{box-shadow:0 0 0 2px rgba(140,180,255,.35)}
.compare-field .suggest{top:46px}
.compare-field:first-child {
  z-index: 10;
}

@media(max-width:600px){
  .h-title{font-size:20px}
  .wordline a{font-size:24px}
  .nav a{padding:6px 8px; font-size:13px}
}

/* Neighbour grid chips */
.nb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.nb-chip {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 11px;
  border-radius: 12px;
  background: rgba(0,0,0,.22);
  text-decoration: none;
  color: var(--text);
  transition: background .15s;
}
.nb-chip:hover {
  background: rgba(140,180,255,.12);
}
.nb-name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nb-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nb-score {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted2);
  margin-left: auto;
}
.tag-sm {
  padding: 2px 7px !important;
  font-size: 10px !important;
}
.tag-active {
  background: transparent !important;
  color: var(--muted) !important;
  box-shadow: none;
  font-weight: 400;
  cursor: default;
  pointer-events: none;
}
/* POS links that are NOT active look clearly prominent */
.wordline .tag:not(.tag-active) {
  opacity: 1;
  /* background: rgba(255,255,255,.18) !important;
  color: var(--text) !important; */
  font-weight: 700;
  transition: background .15s;
}
.wordline .tag:not(.tag-active):hover {
  background: rgba(255,255,255,.28) !important;
  text-decoration: none;
}
