/*
 * pxchess.css — Design system commun
 * Chargé par : index.html, play/game.html, gallery/index.html
 *
 * Contient : tokens, reset, body, typographie, topbar, footer,
 *            boutons, overlays, animations partagées.
 * NE contient PAS : styles spécifiques à une page (board, arena,
 *            controls, camp picker, splash, gallery grid…).
 */

/* ── Google Fonts ────────────────────────────────────────────── */
/* Fonts loaded via <link> preconnect in each HTML head */

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  --bg:           #090909;
  --surface:      #0f0f11;
  --surface2:     #141417;
  --border:       #1c1c22;
  --border2:      #2a2a34;
  --text:         #e4e4ea;
  --muted:        #54545e;
  --muted2:       #8a8a96;
  --accent:       #CAFF00;
  --accent-dim:   #7A9900;
  --font-display: 'Bebas Neue', sans-serif;
  --font-ui:      'IBM Plex Mono', monospace;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }

/* ── Body ────────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  min-height: 100vh;
  /* Micro structural grid */
  background-image:
    repeating-linear-gradient(0deg,
      transparent, transparent 39px,
      rgba(255,255,255,.013) 39px, rgba(255,255,255,.013) 40px),
    repeating-linear-gradient(90deg,
      transparent, transparent 39px,
      rgba(255,255,255,.013) 39px, rgba(255,255,255,.013) 40px);
}

/* ── Load animations ─────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.reveal { animation: fadeUp .38s ease-out both; }
.d1 { animation-delay: .04s; }
.d2 { animation-delay: .10s; }
.d3 { animation-delay: .18s; }
.d4 { animation-delay: .26s; }
.d5 { animation-delay: .34s; }

/* ── Logo ────────────────────────────────────────────────────── */
/* <img class="logo" src="/assets/svg/logo.svg" alt="pxchess"> */
.logo {
  display: block;
  flex-shrink: 0;
  user-select: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
  width: 100%;
  max-width: 960px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px 14px;
  border-bottom: 1px solid var(--border);
}

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
  width: 100%;
  max-width: 960px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px 14px;
  border-top: 1px solid var(--border);
}
.footerLabel {
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer a {
  color: var(--muted2);
  text-decoration: none;
  transition: color .12s;
}
.footer a:hover { color: var(--accent); }

/* ── Nav (landing + gallery) ─────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 80;
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(9,9,9,.92);
  backdrop-filter: blur(10px);
}
.nav-play {
  font-family: var(--font-ui);
  font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent-dim);
  background: transparent; padding: 7px 18px; border-radius: 4px;
  text-decoration: none; transition: background .14s, color .14s;
}
.nav-play:hover { background: var(--accent); color: var(--bg); }
.nav-link {
  font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted2);
  text-decoration: none; transition: color .12s;
}
.nav-link:hover { color: var(--accent); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  font-family: var(--font-ui);
  font-size: 12px; font-weight: 500; letter-spacing: .06em;
  color: var(--muted2); background: transparent;
  border: 1px solid var(--border2); border-radius: 4px;
  padding: 6px 11px; cursor: pointer;
  transition: color .12s, border-color .12s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { color: var(--text); border-color: var(--muted); }
.btn:disabled { opacity: .28; cursor: not-allowed; }

.btn-primary {
  color: var(--accent);
  border-color: var(--accent-dim);
}
.btn-primary:hover:not(:disabled) {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

/* ── Overlay (base) ──────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.91);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
.overlay.hidden { display: none; }

@keyframes overlayIn {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Tooltip ─────────────────────────────────────────────────── */
#tooltip {
  position: fixed; pointer-events: none;
  display: none; align-items: center; gap: 6px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 5px; padding: 6px 8px;
  font-family: var(--font-ui); font-size: 11px; color: var(--text);
  white-space: nowrap; z-index: 200;
  box-shadow: 0 4px 16px rgba(0,0,0,.7);
  min-width: 0;
}
body.tooltips #tooltip { display: flex; }
/* Never show tooltip on touch devices */
@media (hover: none) { body.tooltips #tooltip { display: none !important; } }

#tooltip-dot {
  width: 14px; height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,.15);
  flex-shrink: 0;
}
#tooltip-sq { font-size: 10px; color: var(--muted); margin-left: 1px; }

/* ── Scroll reveal (landing + gallery) ───────────────────────── */
.sr {
  opacity: 0; transform: translateY(20px);
  transition: opacity .6s ease-out, transform .6s ease-out;
}
.sr.visible { opacity: 1; transform: translateY(0); }
