:root {
  --bg: #0a0a12;
  --card: #12121c;
  --purple: #7c3aed;
  --purple-glow: #a78bfa;
  --text: #f4f4f5;
  --muted: rgba(255, 255, 255, 0.5);
}

/* Toggle langue */
.nav-toggles {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.5rem;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.65rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  letter-spacing: 0.08em;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  border-color: var(--purple);
}

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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  background: rgba(10, 10, 18, 0.9);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.logo-name {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  white-space: nowrap;
}

.logo-word,
.logo-accent {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.logo-word {
  color: var(--text);
}

.logo-accent {
  color: var(--purple-glow);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.site-nav a:hover,
.site-nav a.nav-active {
  color: var(--text);
}

.site-nav a.nav-active {
  color: var(--purple-glow);
}

.version-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.1);
  border-radius: 999px;
  vertical-align: middle;
}

.version-pill:not(:empty) {
  display: inline-block;
}

.site-nav .version-pill[hidden] {
  display: none;
}

.footer-version {
  margin-top: 0.5rem;
  color: rgba(167, 139, 250, 0.85);
}

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  padding: 4rem 1.5rem 5rem;
  max-width: 1080px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    order: -1;
    max-height: 220px;
  }
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  max-height: 340px;
}

.hero-screenshot {
  display: block;
  width: 100%;
  max-width: 520px;
  max-height: 320px;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid rgba(124, 58, 237, 0.25);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 40px rgba(124, 58, 237, 0.15);
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.1);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.lead {
  color: var(--muted);
  max-width: 28rem;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.75rem;
  border-radius: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple), #9333ea);
  color: #fff;
  box-shadow: 0 0 32px rgba(124, 58, 237, 0.45);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 48px rgba(124, 58, 237, 0.55);
}

.btn-discord {
  background: linear-gradient(135deg, #5865f2, #4752c4);
  color: #fff;
  gap: 0.6rem;
  box-shadow: 0 0 28px rgba(88, 101, 242, 0.35);
}

.btn-discord:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 44px rgba(88, 101, 242, 0.5);
}

.btn-discord svg {
  display: block;
}

.hidden {
  display: none !important;
}

.discord-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding: 0.6rem 0.85rem;
  background: rgba(88, 101, 242, 0.12);
  border: 1px solid rgba(88, 101, 242, 0.35);
  border-radius: 12px;
  max-width: max-content;
}

.discord-user img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.discord-user-info {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
}

.discord-user-info strong {
  color: #fff;
}

.discord-user-info a {
  color: rgba(167, 139, 250, 0.85);
  font-size: 0.75rem;
  text-decoration: none;
}

.discord-user-info a:hover {
  text-decoration: underline;
}

.discord-message {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  max-width: 32rem;
}

.discord-message.info {
  color: rgba(255, 255, 255, 0.75);
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.25);
}

.discord-message.success {
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.discord-message.error {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-credit {
  margin-top: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
}

.footer-credit strong {
  color: var(--purple-glow);
  font-weight: 700;
}

.stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  padding: 2rem 0;
}

.stat-tile {
  position: relative;
  background: linear-gradient(160deg, rgba(124, 58, 237, 0.08), rgba(124, 58, 237, 0.02));
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 16px;
  padding: 1.4rem 1.25rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.stat-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% -20%, rgba(124, 58, 237, 0.18), transparent 55%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}

.stat-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 58, 237, 0.45);
  box-shadow: 0 12px 30px rgba(124, 58, 237, 0.18);
}

.stat-tile:hover::before { opacity: 1; }

.stat-icon {
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(124, 58, 237, 0.18);
  color: var(--purple-glow);
  margin-bottom: 0.4rem;
}

.stat-icon--playing {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

.stat-icon--discord {
  background: rgba(88, 101, 242, 0.18);
  color: #a5b4fc;
}

.stat-number {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  font-feature-settings: 'tnum';
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
  margin-top: 0.15rem;
}

.stat-sublabel {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-pulse {
  position: absolute;
  top: -8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  opacity: 0;
}

.stat-pulse.pulse-tick {
  animation: statPulse 1.2s ease-out;
}

@keyframes statPulse {
  0%   { opacity: 0.9; box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); }
  100% { opacity: 0;   box-shadow: 0 0 0 14px rgba(52, 211, 153, 0); }
}

@media (max-width: 600px) {
  .stat-tile { padding: 1.1rem 1rem 0.9rem; }
  .stat-number { font-size: 1.55rem; }
}

/* ============ ARTICLES ============ */
.articles {
  padding: 1rem 0 2rem;
}
.articles-header {
  margin-bottom: 1.25rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.articles-header h2 { font-size: 1.4rem; margin: 0; }
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.article-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.article-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent, var(--purple-glow));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
  text-decoration: none;
}
.article-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(124, 58, 237, 0.04));
  overflow: hidden;
}
.article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.article-thumb--empty {
  background:
    radial-gradient(circle at 30% 30%, var(--accent, var(--purple-glow))25, transparent 60%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent);
}
.article-card-body {
  padding: 1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}
.article-card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.7rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.article-card-cat {
  background: var(--accent, var(--purple-glow))20;
  color: var(--accent, var(--purple-glow));
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 0.65rem;
}
.article-pin {
  background: rgba(251, 191, 36, 0.15);
  color: #fde68a;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}
.article-card h3 {
  font-size: 1rem;
  margin: 0;
  color: var(--text);
  line-height: 1.35;
}
.article-card-body p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-cta {
  margin-top: auto;
  font-size: 0.78rem;
  color: var(--accent, var(--purple-glow));
  font-weight: 600;
}
.article-card-skeleton {
  height: 240px;
  background: linear-gradient(110deg, var(--card) 30%, rgba(255, 255, 255, 0.04) 50%, var(--card) 70%);
  background-size: 200% 100%;
  border-radius: 16px;
  animation: skel 1.5s infinite linear;
}
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.article-empty {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  background: var(--card);
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  grid-column: 1 / -1;
}

/* ============ ARTICLE PAGE ============ */
.article-page {
  padding: 2rem 1rem 4rem;
  max-width: 800px;
  margin: 0 auto;
}
.article-loading {
  text-align: center;
  color: var(--muted);
  padding: 3rem;
}
.article-back {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.article-back:hover { color: var(--text); }
.article-hero {
  aspect-ratio: 21 / 9;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 2rem;
  border: 1px solid var(--accent, rgba(124, 58, 237, 0.3));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.article-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-head { margin-bottom: 2rem; }
.article-cat {
  display: inline-block;
  background: var(--accent, var(--purple-glow))20;
  color: var(--accent, var(--purple-glow));
  padding: 0.25rem 0.7rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}
.article-head h1 {
  font-size: 2rem;
  margin: 0 0 0.5rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.article-sub {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 0.5rem;
}
.article-head time {
  display: block;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.article-body {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
}
.article-body h2, .article-body h3, .article-body h4 {
  margin: 1.8rem 0 0.8rem;
  color: var(--text);
}
.article-body p { margin-bottom: 1.1rem; }
.article-body ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1.1rem; }
.article-body li { margin-bottom: 0.4rem; }
.article-body a { color: var(--purple-glow); text-decoration: underline; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  padding-bottom: 4rem;
}

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 1.25rem;
}

.card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.85rem;
  color: var(--muted);
}

.changelog {
  padding: 1rem 1.5rem 4rem;
  max-width: 1080px;
  margin: 0 auto;
}

.changelog-header {
  margin-bottom: 1.5rem;
}

.changelog-header h2 {
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
}

.hint-text {
  color: var(--muted);
  font-size: 0.85rem;
}

.changelog-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.changelog-empty {
  background: var(--card);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.changelog-entry {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.changelog-entry:has(details[open]) {
  border-left: 3px solid var(--purple-glow);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.12);
}

.changelog-entry details {
  width: 100%;
}

.changelog-entry summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 1rem 1.4rem;
  user-select: none;
  flex-wrap: wrap;
  transition: background 0.15s;
}

.changelog-entry summary::-webkit-details-marker { display: none; }

.changelog-entry summary:hover {
  background: rgba(124, 58, 237, 0.05);
}

.changelog-summary-main {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.changelog-summary-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.changelog-version {
  font-weight: 800;
  font-size: 1rem;
  color: var(--purple-glow);
  padding: 0.2rem 0.55rem;
  background: rgba(124, 58, 237, 0.12);
  border-radius: 8px;
  font-family: ui-monospace, monospace;
}

.changelog-title {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 600;
}

.changelog-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.4), rgba(124, 58, 237, 0.15));
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
}

.changelog-chevron {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 0.9rem;
  color: var(--purple-glow);
}

.changelog-entry details[open] .changelog-chevron {
  transform: rotate(180deg);
}

.changelog-body {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  padding: 0 1.4rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1rem;
  animation: changelogReveal 0.25s ease;
}

@keyframes changelogReveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.changelog-body p {
  margin-bottom: 0.5rem;
}

.changelog-body ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0.25rem 0 0;
}

.changelog-body li {
  margin-bottom: 0.3rem;
  line-height: 1.5;
}

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 2rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}
