/* ============================================================
   RAP GUESSR — Styles partagés (toutes pages)
   ============================================================ */
:root {
  --bg: #0a0a0a;
  --paper: #f4f1ea;
  --ink: #111;
  --accent: #ff3c00;
  --accent-2: #ffd400;
  --muted: #6b6b6b;
  --grid: rgba(255,255,255,0.04);
  --danger: #ff5050;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--paper);
  font-family: 'JetBrains Mono', monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.4 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.35;
  mix-blend-mode: overlay;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 2;
  max-width: 980px;
  margin: 0 auto;
  padding: 30px 24px 80px;
}

/* ===== HEADER ===== */
header.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 2px solid var(--paper);
  padding-bottom: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.logo {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(34px, 6vw, 56px);
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--paper);
  position: relative;
  text-decoration: none;
}
.logo span {
  color: var(--accent);
  display: inline-block;
  transform: rotate(-3deg);
}
.logo::after {
  content: "FR";
  position: absolute;
  top: -8px;
  right: -32px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  color: var(--accent-2);
  background: var(--ink);
  padding: 2px 6px;
  transform: rotate(8deg);
  border: 1px solid var(--accent-2);
}

/* Nav */
nav.site-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
nav.site-nav a {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.15em;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid transparent;
  transition: all 0.15s;
}
nav.site-nav a:hover { color: var(--paper); }
nav.site-nav a.active {
  color: var(--accent);
  border-color: var(--accent);
}

.meta-stamp {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  text-align: right;
  line-height: 1.4;
  letter-spacing: 0.08em;
}
.meta-stamp .date { color: var(--accent-2); }
.meta-stamp .puzzle-num { color: var(--paper); font-size: 22px; }

/* ===== FORMS / INPUTS ===== */
.label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--accent-2);
  margin-bottom: 6px;
  display: block;
}
input[type="text"], input[type="password"] {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--paper);
  color: var(--paper);
  padding: 10px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  outline: none;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}
input[type="text"]:focus, input[type="password"]:focus {
  border-color: var(--accent);
}
input[type="text"]::placeholder, input[type="password"]::placeholder {
  color: #555;
  text-transform: lowercase;
  font-style: italic;
}

button {
  font-family: 'Archivo Black', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 2px solid var(--paper);
  background: var(--paper);
  color: var(--ink);
  padding: 12px 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
  flex: 1;
  min-width: 120px;
}
button:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--paper);
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button.ghost {
  background: transparent;
  color: var(--paper);
}
.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--accent);
  color: var(--ink);
  padding: 10px 20px;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.1em;
  z-index: 100;
  transition: transform 0.3s;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== SHAKE ANIMATION ===== */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.shake { animation: shake 0.3s; }

/* ===== STATS BAR ===== */
.stats-bar {
  display: flex;
  gap: 20px;
  margin-top: 28px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  justify-content: space-around;
}
.stat { text-align: center; }
.stat .num {
  font-family: 'Archivo Black', sans-serif;
  font-size: 28px;
  color: var(--accent);
  display: block;
}
.stat .lbl {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--muted);
}

/* ===== FOOTER ===== */
footer.site-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #2a2a2a;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}
footer.site-footer .accent { color: var(--accent); }

/* ===== PASSWORD GATE ===== */
#gate {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#gate.hidden { display: none; }
.gate-box {
  max-width: 420px;
  width: 100%;
  text-align: center;
  position: relative;
  z-index: 2;
}
.gate-logo {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(36px, 8vw, 56px);
  line-height: 0.9;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.gate-logo span { color: var(--accent); display: inline-block; transform: rotate(-3deg); }
.gate-sub {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.2em;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 32px;
}
.gate-lock {
  font-family: 'Bebas Neue', sans-serif;
  color: var(--accent-2);
  letter-spacing: 0.25em;
  font-size: 14px;
  margin-bottom: 20px;
  border: 1px dashed var(--accent-2);
  padding: 8px 12px;
  display: inline-block;
}
#gate input { text-align: center; letter-spacing: 0.1em; }
#gate button { width: 100%; }
.gate-error {
  color: var(--danger);
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.15em;
  font-size: 13px;
  margin-top: 12px;
  min-height: 18px;
}

/* ===== HOME PAGE — Game cards ===== */
.home-intro {
  text-align: center;
  margin: 40px 0;
}
.home-intro h1 {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(36px, 6vw, 56px);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.home-intro p {
  color: var(--muted);
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.2em;
  font-size: 14px;
}

.game-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}
@media (max-width: 980px) {
  .game-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .game-cards { grid-template-columns: 1fr; }
}

.game-card {
  position: relative;
  background: #141414;
  border: 2px solid var(--paper);
  padding: 32px 28px;
  text-decoration: none;
  color: var(--paper);
  transition: all 0.2s;
  display: block;
  overflow: hidden;
}
.game-card:hover {
  transform: translate(-4px, -4px);
  box-shadow: 8px 8px 0 var(--accent);
  border-color: var(--accent);
}
.game-card .badge {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--accent-2);
  border: 1px solid var(--accent-2);
  padding: 2px 8px;
  display: inline-block;
  margin-bottom: 20px;
}
.game-card h2 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 32px;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1;
}
.game-card h2 .accent { color: var(--accent); }
.game-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.game-card .play-cta {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.2em;
  color: var(--paper);
  border-top: 1px solid #2a2a2a;
  padding-top: 16px;
  font-size: 14px;
}
.game-card .play-cta::after {
  content: " →";
  color: var(--accent);
}
