/* ============================================================
   INTERACTIVE MAP — shared styles
   Dark wallpaper, brass accent, one game list on the home page.
   ============================================================ */

:root {
  --bg: #080a09;
  --bg-2: #0f1412;
  --surface: rgba(236, 233, 223, 0.05);
  --surface-2: rgba(236, 233, 223, 0.10);
  --border: rgba(236, 233, 223, 0.10);
  --border-2: rgba(236, 233, 223, 0.16);
  --text: #f0ede4;
  --text-dim: #97a09a;
  --accent: #d4a24e;          /* brass */
  --accent-2: #e6bc74;

  /* both font sets are listed so every page uses whichever it loaded */
  --font-display: "Manrope", "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "DM Mono", "IBM Plex Mono", "Consolas", monospace;

  /* strong custom easings — the built-in CSS ones are too weak */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { min-height: 100%; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection { background: var(--accent); color: var(--bg); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(236, 233, 223, 0.14);
  border-radius: 5px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: rgba(236, 233, 223, 0.24); }

/* ---------------- Wallpaper ---------------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.ambient .glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  will-change: transform;
}
.ambient .g1 {
  width: 62vw; height: 62vw; top: -22vw; right: -14vw;
  background: radial-gradient(circle, rgba(111, 174, 148, 0.30), transparent 68%);
  animation: drift-a 34s var(--ease-in-out) infinite alternate;
}
.ambient .g2 {
  width: 54vw; height: 54vw; bottom: -20vw; left: -12vw;
  background: radial-gradient(circle, rgba(212, 162, 78, 0.26), transparent 68%);
  animation: drift-b 42s var(--ease-in-out) infinite alternate;
}
.ambient .g3 {
  width: 40vw; height: 40vw; top: 32%; left: 42%;
  background: radial-gradient(circle, rgba(120, 130, 220, 0.16), transparent 70%);
  animation: drift-a 50s var(--ease-in-out) infinite alternate-reverse;
}
@keyframes drift-a { to { transform: translate3d(-6%, 8%, 0) scale(1.12); } }
@keyframes drift-b { to { transform: translate3d(8%, -7%, 0) scale(1.08); } }

/* film grain, keeps the flat dark from looking plasticky */
.ambient .grain {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.ambient .vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 40%, transparent 40%, rgba(0,0,0,0.65) 100%);
}

/* ---------------- Site header ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 18px clamp(20px, 4vw, 48px);
  background: linear-gradient(180deg, rgba(8,10,9,0.85), rgba(8,10,9,0));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.brand {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text);
}
.brand span { color: var(--accent); }

.desktop-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.desktop-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.desktop-nav a:hover { color: var(--text); background: var(--surface-2); }
.desktop-nav a.is-active { color: var(--text); background: var(--surface); }

/* ---------------- Sub-page top bar (topic pages) ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 28px;
  background: rgba(8, 10, 9, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.navlinks { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.navlinks a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 7px 12px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.navlinks a:hover { color: var(--text); background: var(--surface-2); }

/* language dropdown (kept for pages that use it) */
.lang { position: relative; }
.lang > button {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 8px 12px; border-radius: 10px;
  cursor: pointer; font-size: 0.9rem;
  transition: background 0.15s ease, transform 160ms var(--ease-out);
}
.lang > button:hover { background: var(--surface-2); }
.lang > button:active { transform: scale(0.97); }
.lang .menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 140px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 6px; display: none;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  transform-origin: top right;
}
.lang.open .menu { display: block; animation: menu-in 150ms var(--ease-out); }
@keyframes menu-in { from { opacity: 0; transform: scale(0.95); } }
.lang .menu a {
  display: block; padding: 8px 10px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: 0.9rem;
}
.lang .menu a:hover { background: var(--surface-2); }
.lang .menu a.disabled { color: var(--text-dim); cursor: default; }

/* ---------------- Shared bits ---------------- */

main { flex: 1; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.eyebrow span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

/* ---------------- Home: page head ---------------- */

.page-head {
  padding: clamp(40px, 8vh, 80px) clamp(20px, 4vw, 48px) clamp(24px, 4vh, 36px);
  animation: fade-up 0.6s var(--ease-out) backwards;
}
.page-head h1 {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
}
.title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.summary {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } }

/* ---------------- Home: full-width game list ---------------- */

.games {
  /* columns: name · developer · maps · updated */
  --cols: minmax(0, 2.6fr) minmax(0, 1.5fr) minmax(0, 0.6fr) minmax(0, 1.1fr);
  --logo: 40px;               /* icon size — the one number to change */
  padding: 0 clamp(20px, 4vw, 48px) clamp(48px, 8vh, 88px);
}

.games-head,
.game-row {
  display: grid;
  grid-template-columns: var(--cols);
  gap: 20px;
  align-items: center;
  padding: 0 16px;
}
.games-head {
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.games-head button {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 4px 6px;
  margin-left: -6px;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  transition: color 0.15s ease, background 0.15s ease;
}
.games-head button:hover { color: var(--text); background: var(--surface); }
.games-head .ar { color: var(--accent); font-size: 0.6rem; }
.games-head .c-maps { justify-self: end; }
.games-head .c-maps { margin-left: 0; margin-right: -6px; }
.games-head button.c-maps { justify-content: flex-end; }

.game-row {
  padding-top: 9px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(236, 233, 223, 0.05);
  transition: background 0.15s ease;
}
.game-row:hover { background: var(--surface); }
.game-row > * { min-width: 0; }

/* name cell: the logo and the name share one link */
.c-name {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text);
  text-decoration: none;
  border-radius: 12px;
}
a.c-name:hover .nm { color: var(--accent-2); }
a.c-name:hover .logo { transform: scale(1.06); }
.c-name.is-soon { cursor: not-allowed; }
.soon-tag {
  flex: none;
  padding: 4px 9px;
  border: 1px solid rgba(212, 162, 78, 0.4);
  border-radius: 999px;
  background: rgba(212, 162, 78, 0.1);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--accent-2);
}
.c-name.is-soon .nm { color: var(--text-dim); }
.c-name.is-soon .logo { filter: grayscale(0.7) brightness(0.8); }

.logo {
  position: relative;
  flex: none;
  width: var(--logo);
  height: var(--logo);
  overflow: hidden;
  border-radius: calc(var(--logo) * 0.28);
  display: grid;
  place-items: center;
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--c, #9aa39b) 78%, white 22%),
    var(--c, #9aa39b) 60%,
    color-mix(in srgb, var(--c, #9aa39b) 62%, black 38%));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28);
  transition: transform 220ms var(--ease-out), filter 220ms ease;
}
.logo .ini {
  font-family: var(--font-display);
  font-size: calc(var(--logo) * 0.34);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}
/* the game's own logo, when games-meta.json has one; covers the initials */
.logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nm {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease;
}
.c-dev {
  font-size: 0.92rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.c-maps,
.c-date {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--text-dim);
  white-space: nowrap;
}
.c-maps { text-align: right; justify-self: end; }
.c-date[title] { cursor: default; }

.games-empty {
  padding: 24px 16px;
  color: var(--text-dim);
  font-size: 0.92rem;
}

.stamp {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* ---------------- About page ---------------- */

.about {
  max-width: 680px;
  padding: 0 clamp(20px, 4vw, 48px) clamp(48px, 8vh, 88px);
}
.about p {
  margin-bottom: 16px;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-dim);
}
.about-back {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent-2);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}
.about-back:hover { color: var(--text); }

/* ---------------- Footer ---------------- */

footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: clamp(34px, 6vh, 58px) clamp(20px, 4vw, 48px);
  display: flex;
  align-items: center;
  gap: 18px 30px;
  flex-wrap: wrap;
  width: 100%;
}
footer > p {
  color: var(--text-dim);
  font-size: 0.88rem;
  max-width: 320px;
}
footer > div { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
footer > div a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.86rem;
  padding: 7px 12px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
footer > div a:hover { color: var(--text); background: var(--surface-2); }
footer small {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* legacy footer grid (kept for any page still using it) */
.footgrid { max-width: 1100px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; }
.footgrid .col h4 {
  font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--text-dim); margin-bottom: 10px;
}
.footgrid .col a { display: block; color: var(--text); opacity: 0.8; text-decoration: none; font-size: 0.9rem; padding: 3px 0; }
.footgrid .col a:hover { opacity: 1; color: var(--accent); }
.copyright { max-width: 1100px; margin: 22px auto 0; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); }

/* ---------------- Reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------- Responsive ---------------- */

@media (max-width: 900px) {
  .desktop-nav { display: none; }
}
@media (max-width: 720px) {
  /* phones: name and updated date only, bigger tap targets */
  .games { --cols: minmax(0, 1fr) auto; --logo: 36px; }
  .games-head .c-dev, .games-head .c-maps,
  .game-row .c-dev, .game-row .c-maps { display: none; }
  .games-head, .game-row { padding-left: 10px; padding-right: 10px; gap: 12px; }
  .game-row { padding-top: 11px; padding-bottom: 11px; }
  .c-name { gap: 12px; }
  .nm { font-size: 0.95rem; }
  /* the label goes under the name so the name keeps its width */
  .c-name.is-soon {
    display: grid;
    grid-template-columns: var(--logo) minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 4px;
  }
  .c-name.is-soon .logo { grid-row: span 2; }
  .soon-tag { justify-self: start; padding: 2px 7px; font-size: 0.56rem; }
  footer > div { margin-left: 0; }
}
