:root {
  --bg: #171a14;
  --bg-panel: #20241c;
  --border: #3d4434;
  --text: #e6e8dc;
  --text-dim: #9aa38c;
  --accent: #7c9a5c;
  --radius: 10px;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at top, #1e2318 0%, #0e100b 70%);
  color: var(--text);
  min-height: 100vh;
}

.hub-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.6rem 1rem;
  background: linear-gradient(180deg, #262b1f, #14170f);
  border-bottom: 2px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 10;
}

.hub-vecmon-link {
  margin-left: auto;
  margin-right: 0.65rem;
  width: 2.2rem;
  height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line, #3c4930);
  border-radius: 0.55rem;
  color: var(--accent, #a9c957);
  text-decoration: none;
  font-size: 1.25rem;
}
.hub-vecmon-link:hover { border-color: var(--accent, #a9c957); }
.hub-vecmon-link { font-size: 1.75rem; line-height: 1; }
.hub-vecmon-link[hidden] { display: none !important; }

.hub-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.hub-brand-mascot {
  height: 84px;
  width: auto;
  display: block;
  flex: 0 0 auto;
}

.hub-brand-wordmark {
  height: 44px;
  width: auto;
  max-width: 40vw;
  display: block;
}

.lang-toggle {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  background: var(--bg-panel);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
}

.lang-toggle::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 2'%3E%3Crect width='3' height='.5' fill='%23AA151B'/%3E%3Crect y='.5' width='3' height='1' fill='%23F1BF00'/%3E%3Crect y='1.5' width='3' height='.5' fill='%23AA151B'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}
.lang-toggle[data-lang="en"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3Crect width='60' height='30' fill='%23012169'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' stroke='%23FFFFFF' stroke-width='6'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' stroke='%23C8102E' stroke-width='2'/%3E%3Cpath d='M30,0 V30 M0,15 H60' stroke='%23FFFFFF' stroke-width='10'/%3E%3Cpath d='M30,0 V30 M0,15 H60' stroke='%23C8102E' stroke-width='6'/%3E%3C/svg%3E");
}
.lang-toggle[data-lang="es"]::before {
  background-image: linear-gradient(to bottom, #aa151b 0 25%, #f1bf00 25% 75%, #aa151b 75% 100%);
  opacity: 0.48;
}

.lang-toggle .lang-opt { position: relative; z-index: 1; opacity: 0.45; }
.lang-toggle .lang-opt.active { opacity: 1; color: var(--accent); }

.hub-view {
  max-width: 980px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.25rem;
}

.hub-intro { text-align: center; }
.hub-title { font-size: 2rem; margin: 0 0 0.4rem; letter-spacing: 0.03em; }
.hub-subtitle { margin: 0; color: var(--text-dim); }

.hub-games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  width: 100%;
}

.hub-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.75rem 1.5rem 1.5rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.hub-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.hub-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.hub-card-logo { height: 72px; width: auto; object-fit: contain; }

.hub-card-body { text-align: center; }
.hub-card-title { margin: 0 0 0.5rem; font-size: 1.15rem; }
.hub-card-desc { margin: 0 0 0.9rem; color: var(--text-dim); font-size: 0.92rem; line-height: 1.45; }
.hub-card-enter { color: var(--accent); font-weight: 600; letter-spacing: 0.04em; }

.hub-chromakey-link { margin-left: .45rem; color: var(--cyan, #69d3d0); text-decoration: none; font-size: 1.15rem; align-items: center; justify-content: center; }
.hub-chromakey-link:hover { color: var(--accent); }

/* Cross-game search lives on the hub so the three databases remain separate
   while still being discoverable from one place. */
.hub-global-search-wrap { position: relative; flex: 0 0 auto; }
.hub-global-search-toggle {
  width: 2.25rem; height: 2.25rem; padding: 0; display: inline-flex;
  align-items: center; justify-content: center; cursor: pointer;
  color: var(--text); background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.hub-global-search-toggle:hover, .hub-global-search-toggle[aria-expanded="true"] {
  color: var(--accent); border-color: var(--accent);
}
.hub-global-search-panel {
  position: absolute; top: calc(100% + .45rem); right: 0; z-index: 20;
  width: min(31rem, calc(100vw - 1.5rem)); max-height: min(72vh, 38rem);
  padding: .55rem; overflow: hidden; background: var(--bg-panel);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 .8rem 2rem rgba(0,0,0,.42);
}
.hub-global-search-panel[hidden] { display: none; }
.hub-global-search-panel input {
  width: 100%; padding: .58rem .7rem; color: var(--text); background: #151912;
  border: 1px solid var(--border); border-radius: 7px; font: inherit; outline: none;
}
.hub-global-search-panel input:focus { border-color: var(--accent); }
.hub-global-search-status { padding: .35rem .35rem 0; min-height: 1.2rem; color: var(--text-dim); font-size: .74rem; }
.hub-global-search-results { max-height: min(58vh, 31rem); overflow-y: auto; padding-top: .2rem; }
.hub-gs-section { margin-top: .55rem; }
.hub-gs-section:first-child { margin-top: .1rem; }
.hub-gs-section-title { padding: .3rem .4rem; color: var(--text-dim); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.hub-gs-row {
  width: 100%; display: flex; align-items: center; gap: .55rem; padding: .42rem .45rem;
  color: var(--text); background: transparent; border: 0; border-radius: 7px;
  text-align: left; cursor: pointer; font: inherit;
}
.hub-gs-row:hover, .hub-gs-row:focus-visible { background: #2a3023; outline: none; }
.hub-gs-thumb { width: 2rem; height: 2rem; flex: 0 0 auto; object-fit: contain; border-radius: 6px; background: #151912; }
.hub-gs-main { min-width: 0; display: flex; flex-direction: column; gap: .08rem; }
.hub-gs-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.hub-gs-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); font-size: .73rem; }
.hub-gs-game { margin-left: auto; flex: 0 0 auto; color: var(--accent); font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.hub-gs-empty { margin: .7rem .4rem; color: var(--text-dim); font-size: .82rem; }
@media (max-width: 560px) {
  .hub-global-search-panel { position: fixed; top: 4.55rem; left: .75rem; right: .75rem; width: auto; }
  .hub-topbar { padding-left: .65rem; padding-right: .65rem; }
  .hub-brand-wordmark { max-width: 31vw; }
}
