:root {
  --bg: #070811;
  --bg-secondary: #0d1221;
  --panel: rgba(13, 18, 33, 0.72);
  --panel-strong: rgba(18, 24, 42, 0.92);
  --text: #f5f7ff;
  --muted: #9ba8cb;
  --line: rgba(255, 255, 255, 0.1);
  --cyan: #4de7ff;
  --violet: #8e6bff;
  --pink: #ff4fd8;
  --green: #50ff9f;
  --yellow: #ffd95c;
  --danger: #ff6b87;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius-lg: 28px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(142, 107, 255, 0.18), transparent 25%),
    radial-gradient(circle at top right, rgba(77, 231, 255, 0.12), transparent 28%),
    linear-gradient(135deg, var(--bg), var(--bg-secondary));
  overflow-x: hidden;
}

h1, h2, h3 {
  margin: 0;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.02em;
}

p {
  margin: 0;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  padding-left: 1.2rem;
  color: var(--muted);
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 85%);
  pointer-events: none;
}

.orb {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.34;
  pointer-events: none;
}

.orb-a { background: var(--violet); top: -80px; left: -90px; }
.orb-b { background: var(--cyan); top: 18%; right: -100px; }
.orb-c { background: var(--pink); bottom: -120px; left: 25%; }

.site-header,
.page-shell,
.hero-shell,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 7%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #fff;
  box-shadow: 0 0 30px rgba(77, 231, 255, 0.35);
}

.nav-links {
  display: flex;
  gap: 24px;
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--text);
}

.hero-shell,
.page-shell {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
}

.hero-shell {
  min-height: calc(100vh - 120px);
  display: grid;
  align-items: center;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 36px;
  padding: 46px;
}

.glass,
.glass-soft {
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.glass { border-radius: var(--radius-lg); margin-top: 40px; }
.glass-soft { border-radius: var(--radius-md); }

.hero-copy {
  display: grid;
  gap: 22px;
  align-content: center;
}

.eyebrow {
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero-copy h1,
.page-intro h1 {
  font-size: clamp(2.5rem, 5vw, 4.9rem);
  line-height: 1.04;
}

.hero-copy h1 span {
  color: var(--cyan);
  text-shadow: 0 0 28px rgba(77, 231, 255, 0.35);
}

.hero-text,
.page-intro p:last-child {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #fff;
  box-shadow: 0 12px 30px rgba(77, 231, 255, 0.15);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
  color: #40c0d7;
}

.btn-secondary:hover {
  border-color: rgba(77, 231, 255, 0.45);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.w-full { width: 100%; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat-card,
.visual-card {
  padding: 18px;
}

.stat-card strong {
  display: block;
  font-size: 1.35rem;
  font-family: 'Orbitron', sans-serif;
  margin-bottom: 8px;
}

.stat-card span {
  color: var(--muted);
}

.hero-visual {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  padding: 24px;
}

.visual-main {
  position: absolute;
  top: 30px;
  left: 28px;
  right: 80px;
  z-index: 2;
}

.visual-side {
  position: absolute;
  bottom: 26px;
  right: 26px;
  width: min(260px, 70%);
  z-index: 2;
}

.visual-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px;
}

.visual-card h2 {
  margin: 14px 0 10px;
  font-size: 2rem;
}

.visual-card p {
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(80, 255, 159, 0.14);
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 700;
}

.chip-alt {
  background: rgba(255, 217, 92, 0.12);
  color: var(--yellow);
}

.pulse-ring {
  position: absolute;
  inset: 15% 10% auto auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(77, 231, 255, 0.18);
  box-shadow: 0 0 80px rgba(77, 231, 255, 0.15), inset 0 0 80px rgba(142, 107, 255, 0.12);
  animation: pulse 4s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(0.95); opacity: 0.6; }
  50% { transform: scale(1.05); opacity: 1; }
}

.page-intro,
.progress-box,
.tips-box {
  padding: 28px;
}

.page-intro.small-gap {
  padding-bottom: 24px;
}

.categories-grid,
.enigmes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.difficulty-card,
.enigme-card {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
  overflow: hidden;
}

.difficulty-card::before,
.enigme-card::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
  opacity: 0.16;
}

.difficulty-card h3,
.enigme-card h3 {
  font-size: 1.55rem;
}

.difficulty-card p,
.enigme-card p {
  color: var(--muted);
}

.difficulty-tag {
  display: inline-flex;
  width: fit-content;
  min-height: 30px;
  padding: 0 12px;
  align-items: center;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255,255,255,0.06);
}

.difficulty-meta,
.enigme-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.difficulty-easy { box-shadow: inset 0 0 0 1px rgba(80,255,159,0.1), var(--shadow); }
.difficulty-normal { box-shadow: inset 0 0 0 1px rgba(77,231,255,0.1), var(--shadow); }
.difficulty-hard { box-shadow: inset 0 0 0 1px rgba(255,217,92,0.1), var(--shadow); }
.difficulty-extreme { box-shadow: inset 0 0 0 1px rgba(255,79,216,0.12), var(--shadow); }

.locked {
  opacity: 0.55;
}

.locked .btn {
  pointer-events: none;
  opacity: 0.5;
}

.enigme-card textarea,
.enigme-card input {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  outline: none;
  font: inherit;
}

.enigme-card input:focus {
  border-color: rgba(77, 231, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(77, 231, 255, 0.08);
}

.enigme-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.enigme-card.resolved {
  border-color: rgba(80, 255, 159, 0.35);
  box-shadow: 0 0 0 1px rgba(80, 255, 159, 0.12), var(--shadow);
}

.enigme-card.resolved .enigme-title::after {
  content: ' ✓';
  color: var(--green);
}

@media (max-width: 980px) {
  .hero-panel,
  .progress-box,
  .categories-grid,
  .enigmes-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 720px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 14px;
  }

  .hero-shell,
  .page-shell {
    width: min(100% - 24px, 1200px);
  }

  .hero-panel,
  .page-intro,
  .progress-box,
  .tips-box,
  .difficulty-card,
  .enigme-card {
    padding: 20px;
  }

  .hero-copy h1,
  .page-intro h1 {
    font-size: clamp(2rem, 11vw, 3.2rem);
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .visual-main {
    right: 28px;
  }

  .visual-side {
    width: auto;
    left: 28px;
  }
}

.page-shell {
  display: grid;
  gap: 24px;
  padding: 24px 0 60px;
}

.progress-box {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
  align-items: center;
}

.progress-right {
  min-width: min(420px, 100%);
  display: grid;
  gap: 10px;
}

.progress-track {
  width: 100%;
  height: 14px;
  background: rgba(255,255,255,0.07);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  box-shadow: 0 0 24px rgba(77, 231, 255, 0.35);
  transition: width 0.35s ease;
}

.progress-label {
  color: var(--muted);
}

.feedback {
  min-height: 24px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.25s ease;
}

.feedback.success { color: var(--green); }
.feedback.error { color: var(--danger); }
.feedback.hint { color: var(--yellow); text-shadow: 0 0 10px rgba(255, 217, 92, 0.18); }

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible,
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.site-footer {
  text-align: center;
  padding: 18px 24px 30px;
  color: var(--muted);
}

.profile-badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.comment-form-box,
.comments-list-box,
.comments-home-box {
  padding: 28px;
}

.comment-form {
  display: grid;
  gap: 18px;
}

.comment-form select,
.comment-form textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: #48d9f1;
  padding: 14px 16px;
  font: inherit;
  outline: none;
}

.comment-form textarea {
  min-height: 180px;
  resize: vertical;
}

.comments-list {
  display: grid;
  gap: 18px;
}

.comment-card {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.scanline {
  position: fixed;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.03), rgba(255,255,255,0.00) 2px, transparent 4px);
  background-size: 100% 5px;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}

.lab-theme {
  background:
    radial-gradient(circle at top left, rgba(0, 255, 170, 0.10), transparent 25%),
    radial-gradient(circle at top right, rgba(77, 231, 255, 0.10), transparent 28%),
    radial-gradient(circle at bottom left, rgba(142, 107, 255, 0.09), transparent 25%),
    linear-gradient(135deg, #05080e, #08131c 55%, #071017);
}

.nox-message {
  margin-top: 18px;
  padding: 16px 18px;
  display: grid;
  gap: 8px;
  border-left: 3px solid var(--cyan);
}

.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  padding-bottom: 60px;
}

.difficulty-card {
  display: grid;
  gap: 16px;
  padding: 22px;
  min-height: 260px;
}

.difficulty-top,
.difficulty-footer,
.enigme-meta,
.enigme-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.difficulty-status {
  color: var(--muted);
  font-size: 0.92rem;
}

.difficulty-card h3,
.enigme-title,
.progress-box h2 {
  font-size: 1.3rem;
}

.difficulty-card p {
  color: var(--muted);
}

.page-intro,
.progress-box {
  padding: 28px;
}

.enigmes-grid {
  display: grid;
  gap: 20px;
}

.enigme-card {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.enigme-card input {
  width: 100%;
  min-height: 50px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

.enigme-card input:focus {
  border-color: rgba(77, 231, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(77, 231, 255, 0.08);
}

.resolved {
  border-color: rgba(80, 255, 159, 0.25);
  box-shadow: 0 18px 40px rgba(0,0,0,0.35), 0 0 0 1px rgba(80,255,159,0.08) inset;
}

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

  .progress-box {
    flex-direction: column;
    align-items: stretch;
  }

  .progress-right {
    min-width: 0;
  }
}

@media (max-width: 700px) {
  .site-header {
    flex-direction: column;
    gap: 14px;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero-shell,
  .page-shell {
    width: min(100% - 24px, 1200px);
  }

  .hero-panel,
  .page-intro,
  .progress-box,
  .difficulty-card,
  .enigme-card {
    padding: 20px;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }
}

/* ===== Header appli connecté ===== */
.app-header {
  width: min(1280px, calc(100% - 48px));
  margin: 18px auto 0;
  padding: 18px 24px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  background: rgba(10, 14, 25, 0.78);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.nav-links-app {
  align-items: center;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-header {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  white-space: nowrap;
}

/* ===== Leaderboard ===== */
.leaderboard-shell {
  padding: 28px;
  display: grid;
  gap: 26px;
}

.leaderboard-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.leaderboard-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(77, 231, 255, 0.12);
  border: 1px solid rgba(77, 231, 255, 0.22);
  color: var(--cyan);
  font-weight: 700;
}

.leaderboard-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.podium-card {
  position: relative;
  padding: 24px;
  display: grid;
  gap: 12px;
  text-align: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}

.podium-card::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--violet), var(--cyan), var(--pink));
  opacity: 0.9;
}

.podium-card h3 {
  font-size: 1.35rem;
}

.podium-card p {
  color: var(--muted);
}

.podium-rank {
  font-size: 2rem;
}

.podium-place {
  color: var(--cyan);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.podium-1 {
  transform: translateY(-8px);
  box-shadow: 0 0 0 1px rgba(255, 217, 92, 0.12), var(--shadow);
}

.podium-2 {
  box-shadow: 0 0 0 1px rgba(77, 231, 255, 0.08), var(--shadow);
}

.podium-3 {
  transform: translateY(8px);
  box-shadow: 0 0 0 1px rgba(255, 79, 216, 0.08), var(--shadow);
}

.leaderboard-list-wrap {
  display: grid;
  gap: 12px;
}

.leaderboard-list-head,
.leaderboard-row {
  display: grid;
  grid-template-columns: 110px 1fr 180px;
  gap: 18px;
  align-items: center;
}

.leaderboard-list-head {
  padding: 0 18px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
}

.leaderboard-list {
  display: grid;
  gap: 12px;
}

.leaderboard-row {
  padding: 18px 20px;
  border: 1px solid rgba(255,255,255,0.08);
}

.leaderboard-rank {
  font-family: 'Orbitron', sans-serif;
  color: var(--cyan);
  font-weight: 700;
}

.leaderboard-player {
  font-weight: 700;
  font-size: 1.02rem;
}

.leaderboard-score {
  justify-self: end;
  font-family: 'Orbitron', sans-serif;
  color: var(--green);
}

.leaderboard-empty {
  padding: 22px;
  text-align: center;
  color: var(--muted);
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .app-header {
    width: min(100% - 24px, 1280px);
    grid-template-columns: 1fr;
  }

  .site-header.app-header {
    display: grid;
    gap: 16px;
  }

  .nav-links-app,
  .header-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  .leaderboard-podium {
    grid-template-columns: 1fr;
  }

  .podium-1 {
    transform: none;
  }

  .leaderboard-list-head {
    display: none;
  }

  .leaderboard-row {
    grid-template-columns: 90px 1fr 100px;
    gap: 12px;
  }

  .leaderboard-score {
    justify-self: start;
  }
}

@media (max-width: 720px) {
  .app-header {
    padding: 18px;
    margin-top: 12px;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .btn {
    flex: 1 1 100%;
  }

  .leaderboard-shell {
    padding: 20px;
  }
}

/* ===== Auth pages ===== */
.auth-page {
  min-height: 100vh;
}

.auth-header {
  width: min(1180px, calc(100% - 48px));
  margin: 18px auto 0;
  padding: 18px 24px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  background: rgba(10, 14, 25, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.auth-shell {
  width: min(100%, 560px);
  margin: 48px auto;
  padding: 0 16px 40px;
}

.auth-card {
  padding: 32px;
  display: grid;
  gap: 24px;
}

.auth-intro {
  display: grid;
  gap: 12px;
}

.auth-text {
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 18px;
}

.form-group {
  display: grid;
  gap: 8px;
}

.form-group label {
  font-weight: 600;
  color: var(--text);
}

.form-group input {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  outline: none;
  font: inherit;
}

.form-group input:focus {
  border-color: rgba(77, 231, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(77, 231, 255, 0.08);
}

.form-group input::placeholder {
  color: rgba(255,255,255,0.35);
}

.auth-switch {
  text-align: center;
  color: var(--muted);
}

.auth-switch a {
  color: var(--cyan);
  font-weight: 700;
}

.nav-links-home {
  align-items: center;
}

@media (max-width: 720px) {
  .auth-header {
    width: min(100% - 24px, 1180px);
    padding: 18px;
  }

  .auth-card {
    padding: 22px;
  }
}

.header-user {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  font-weight: 600;
}

/* ===== Profil joueur ===== */
.profile-hero {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 24px;
  padding: 28px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.profile-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(77,231,255,0.08), transparent 40%);
  pointer-events: none;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  box-shadow: 0 0 30px rgba(77, 231, 255, 0.35);
  position: relative;
}

.profile-avatar::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 1px solid rgba(77,231,255,0.2);
}

.profile-main-info {
  display: grid;
  gap: 8px;
}

.profile-main-info h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.profile-message {
  color: var(--muted);
}

.profile-rank-card {
  padding: 24px;
  display: grid;
  gap: 10px;
  justify-items: start;
}

.profile-rank-card strong {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.2rem;
  color: var(--cyan);
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.profile-stat {
  padding: 22px;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.profile-stat:hover {
  transform: translateY(-3px);
  border-color: rgba(77,231,255,0.25);
}

.profile-stat-label {
  color: var(--muted);
  font-weight: 600;
}

.profile-stat strong {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
}

.profile-progress-box {
  padding: 28px;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
  align-items: center;
}

.profile-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .profile-hero,
  .profile-progress-box,
  .profile-stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .profile-hero,
  .profile-progress-box,
  .profile-stat {
    padding: 20px;
  }

  .profile-identity {
    align-items: flex-start;
  }
}

/* ===== Profil - catégories ===== */
.profile-categories-box {
  padding: 28px;
  display: grid;
  gap: 22px;
}

.profile-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.profile-categories-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.profile-category-card {
  padding: 22px;
  display: grid;
  gap: 16px;
  border: 1px solid rgba(255,255,255,0.08);
}

.profile-category-top,
.profile-category-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.profile-category-card h3 {
  font-size: 1.35rem;
}

.profile-category-card p {
  color: var(--muted);
}

.profile-category-percent {
  font-family: 'Orbitron', sans-serif;
  color: var(--cyan);
  font-weight: 700;
}

.profile-mini-track {
  height: 12px;
}

.profile-complete {
  color: var(--green);
  font-weight: 700;
}

.profile-progressing {
  color: var(--yellow);
  font-weight: 700;
}

@media (max-width: 980px) {
  .profile-categories-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .profile-categories-box,
  .profile-category-card {
    padding: 20px;
  }

  .profile-category-top,
  .profile-category-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ===== Profil - badges ===== */
.profile-badges-box {
  padding: 28px;
  display: grid;
  gap: 22px;
}

.profile-badge-card {
  padding: 22px;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.profile-badge-card:hover {
  transform: translateY(-3px);
}

.profile-badge-icon {
  font-size: 2rem;
}

.profile-badge-card h3 {
  font-size: 1.2rem;
}

.profile-badge-card p {
  color: var(--muted);
}

.profile-badge-state {
  font-weight: 700;
}

.profile-badge-card.unlocked {
  box-shadow: 0 0 0 1px rgba(80, 255, 159, 0.14), var(--shadow);
}

.profile-badge-card.unlocked .profile-badge-state {
  color: var(--green);
}

.locked-badge {
  opacity: 0.6;
}

.locked-badge .profile-badge-state {
  color: var(--yellow);
}

/* ===== Nox narration ===== */
.nox-story-box {
  padding: 28px;
  display: grid;
  gap: 22px;
}

.nox-story-card {
  padding: 22px;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(77, 231, 255, 0.14);
}

.nox-story-card strong {
  color: var(--cyan);
}

.nox-story-card p {
  color: var(--text);
}

.nox-zones-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.nox-zone-card {
  padding: 20px;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255,255,255,0.08);
}

.nox-zone-card h3 {
  font-size: 1.15rem;
}

.nox-zone-card p {
  color: var(--muted);
}

.nox-zone-card span {
  font-weight: 700;
}

.zone-open {
  box-shadow: 0 0 0 1px rgba(77, 231, 255, 0.14), var(--shadow);
}

.zone-open span {
  color: var(--cyan);
}

.zone-locked {
  opacity: 0.6;
}

.zone-locked span {
  color: var(--yellow);
}

/* ===== Nox phrase catégorie ===== */
.profile-category-nox {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .profile-badges-grid,
  .nox-zones-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .profile-badges-box,
  .nox-story-box,
  .profile-badge-card,
  .nox-zone-card,
  .nox-story-card {
    padding: 20px;
  }
}

/* ===== XP / Niveau ===== */
.profile-xp-box {
  padding: 28px;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
  align-items: center;
}

.profile-xp-header {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
}

.profile-xp-header span:first-child {
  font-family: 'Orbitron', sans-serif;
  color: var(--cyan);
}

.profile-xp-header span:last-child {
  color: var(--muted);
}

.profile-xp-right {
  display: grid;
  gap: 10px;
}

.badge-card {
  padding: 20px;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}

.badge-card:hover {
  transform: translateY(-4px);
}

.badge-card.unlocked {
  border-color: rgba(80, 255, 159, 0.35);
  box-shadow: 0 0 0 1px rgba(80,255,159,0.10) inset, var(--shadow);
}

.badge-card.locked {
  opacity: 0.55;
  filter: grayscale(0.25);
}

.badge-icon {
  font-size: 2rem;
  line-height: 1;
}

.badge-card h3 {
  font-size: 1.05rem;
}

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

.badge-state {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-card.unlocked .badge-state {
  color: var(--green);
}

.badge-card.locked .badge-state {
  color: var(--muted);
}

.toast-wrap {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: grid;
  gap: 12px;
  pointer-events: none;
}

.toast-item {
  min-width: 240px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(10, 14, 25, 0.92);
  color: var(--text);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  transform: translateX(30px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  font-weight: 600;
}

.toast-item.visible {
  transform: translateX(0);
  opacity: 1;
}

.toast-item.success {
  border-color: rgba(80, 255, 159, 0.35);
  box-shadow: 0 0 0 1px rgba(80,255,159,0.10) inset, var(--shadow);
}

.toast-item.error {
  border-color: rgba(255, 107, 135, 0.35);
  box-shadow: 0 0 0 1px rgba(255,107,135,0.10) inset, var(--shadow);
}

.toast-item.info {
  border-color: rgba(77, 231, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(77,231,255,0.10) inset, var(--shadow);
}

.success-flash {
  animation: successPulse 0.8s ease;
}

@keyframes successPulse {
  0% {
    transform: scale(1);
    box-shadow: var(--shadow);
  }
  30% {
    transform: scale(1.015);
    box-shadow: 0 0 0 1px rgba(80,255,159,0.20) inset, 0 0 28px rgba(80,255,159,0.18);
  }
  100% {
    transform: scale(1);
    box-shadow: var(--shadow);
  }
}

.success-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.success-burst span {
  position: absolute;
  font-size: 1.2rem;
  opacity: 0;
  animation: burstFloat 1s ease forwards;
}

.success-burst span:nth-child(1) {
  top: 12%;
  left: 14%;
}

.success-burst span:nth-child(2) {
  top: 18%;
  right: 16%;
}

.success-burst span:nth-child(3) {
  bottom: 18%;
  left: 20%;
}

.success-burst span:nth-child(4) {
  bottom: 14%;
  right: 20%;
}

@keyframes burstFloat {
  0% {
    transform: translateY(8px) scale(0.8);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateY(-16px) scale(1.1);
    opacity: 0;
  }
}

.toast-item.success {
  border-color: rgba(80, 255, 159, 0.35);
}

.toast-item.error {
  border-color: rgba(255, 107, 135, 0.35);
}

.toast-item.info {
  border-color: rgba(77, 231, 255, 0.35);
}

.comment-top,
.comment-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.comment-stars {
  color: var(--yellow);
  font-weight: 700;
}

.comments-page-shell {
  gap: 24px;
}

.comments-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: start;
}

.comment-rating-row,
.comment-message-row {
  display: grid;
  gap: 10px;
}

.comment-rating-row label,
.comment-message-row label {
  font-weight: 700;
  color: var(--text);
}

.comment-form select:focus,
.comment-form textarea:focus {
  border-color: rgba(77, 231, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(77, 231, 255, 0.08);
}

.comment-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.comment-form-tip {
  color: var(--muted);
  font-size: 0.92rem;
}

.comments-list-large {
  gap: 20px;
}

.comment-card-modern {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.comment-card-top,
.comment-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.comment-user-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.comment-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-family: 'Orbitron', sans-serif;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #fff;
  box-shadow: 0 10px 24px rgba(77, 231, 255, 0.18);
}

.comment-username {
  display: block;
  font-size: 1rem;
}

.comment-date {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 2px;
}

.comment-rating-badge {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 217, 92, 0.12);
  color: var(--yellow);
  font-weight: 700;
  white-space: nowrap;
}

.comment-message {
  color: var(--text);
  line-height: 1.75;
  font-size: 1rem;
}

.comment-like-count {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Bloc top commentaires accueil */
.top-comments-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.top-comment-card {
  position: relative;
  overflow: hidden;
  min-height: 240px;
  border: 1px solid rgba(255,255,255,0.08);
}

.top-comment-rank {
  position: absolute;
  top: 14px;
  right: 14px;
  min-width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-family: 'Orbitron', sans-serif;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}

.top-comment-rank-1 {
  box-shadow: 0 0 0 1px rgba(255, 217, 92, 0.16) inset, var(--shadow);
}

.top-comment-rank-2 {
  box-shadow: 0 0 0 1px rgba(77, 231, 255, 0.14) inset, var(--shadow);
}

.top-comment-rank-3 {
  box-shadow: 0 0 0 1px rgba(142, 107, 255, 0.14) inset, var(--shadow);
}

.top-comment-rank-1 .top-comment-rank {
  background: rgba(255, 217, 92, 0.12);
  color: var(--yellow);
}

.top-comment-rank-2 .top-comment-rank {
  background: rgba(77, 231, 255, 0.12);
  color: var(--cyan);
}

.top-comment-rank-3 .top-comment-rank {
  background: rgba(142, 107, 255, 0.14);
  color: #c8b7ff;
}

@media (max-width: 980px) {
  .comments-layout {
    grid-template-columns: 1fr;
  }

  .top-comments-grid {
    grid-template-columns: 1fr;
  }
}

.comments-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.comments-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(77, 231, 255, 0.16);
}

.admin-comments-shell {
  gap: 24px;
}

.admin-comments-box {
  padding: 28px;
}

.admin-comments-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-filter-btn.active {
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(77, 231, 255, 0.16);
}

.admin-comments-list {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.admin-comment-card {
  padding: 22px;
  display: grid;
  gap: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.admin-comment-top,
.admin-comment-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-comment-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-status-badge.approved {
  background: rgba(80, 255, 159, 0.12);
  color: var(--green);
}

.admin-status-badge.hidden {
  background: rgba(255, 107, 135, 0.12);
  color: var(--danger);
}

.admin-comment-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-action-btn {
  min-height: 42px;
  padding: 0 16px;
}

.admin-action-btn.danger {
  border-color: rgba(255, 107, 135, 0.3);
  color: var(--danger);
}

.admin-action-btn.danger:hover {
  border-color: rgba(255, 107, 135, 0.55);
}

@media (max-width: 900px) {
  .admin-comment-bottom {
    align-items: stretch;
  }

  .admin-comment-actions {
    width: 100%;
  }

  .admin-comment-actions .btn {
    flex: 1 1 140px;
  }
}

.admin-home-shell {
  gap: 24px;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}

.admin-stat-card {
  padding: 22px;
  display: grid;
  gap: 10px;
  min-height: 120px;
  border: 1px solid rgba(255,255,255,0.08);
}

.admin-stat-card strong {
  font-size: 2rem;
  font-family: 'Orbitron', sans-serif;
}

.admin-stat-label {
  color: var(--muted);
  font-size: 0.95rem;
}

.admin-links-box,
.admin-panel-box {
  padding: 28px;
}

.admin-links-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.admin-link-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  min-height: 220px;
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.admin-link-card:hover {
  transform: translateY(-4px);
  border-color: rgba(77, 231, 255, 0.35);
}

.admin-link-icon {
  font-size: 2rem;
  line-height: 1;
}

.admin-link-card h3 {
  font-size: 1.12rem;
}

.admin-link-card p {
  color: var(--muted);
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.admin-list-box {
  display: grid;
  gap: 14px;
}

.admin-list-item {
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  border: 1px solid rgba(255,255,255,0.08);
}

.admin-list-item p {
  color: var(--muted);
  margin-top: 4px;
}

.admin-list-tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.admin-comment-preview {
  display: grid;
  gap: 10px;
}

.admin-comment-preview-top,
.admin-comment-preview-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-comment-preview-bottom {
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 1100px) {
  .admin-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-links-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .admin-stats-grid,
  .admin-links-grid {
    grid-template-columns: 1fr;
  }
}

.admin-enigmas-shell {
  gap: 24px;
}

.admin-enigmas-box {
  padding: 28px;
}

.admin-enigmas-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-enigmas-list {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.admin-enigma-card {
  padding: 22px;
  display: grid;
  gap: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.admin-enigma-top,
.admin-enigma-bottom {
  display: grid;
  gap: 14px;
}

.admin-enigma-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-enigma-title-row h3 {
  margin: 0;
  font-size: 1.15rem;
}

.admin-enigma-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.admin-enigma-question {
  color: var(--muted);
  line-height: 1.75;
}

.admin-enigma-answer-box {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
}

.admin-enigma-edit[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 700px) {
  .admin-enigma-title-row,
  .admin-enigma-meta {
    align-items: flex-start;
  }
}

/* Admin enigmes amélioré */
.admin-enigmas-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.admin-enigmas-toolbar-bottom {
  margin-top: 12px;
  margin-bottom: 4px;
}

.admin-enigmas-search-wrap {
  flex: 1 1 420px;
}

.admin-enigmas-search,
.admin-enigmas-select {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 0 14px;
  font: inherit;
  outline: none;
}

.admin-enigmas-select {
  min-width: 220px;
}

.admin-enigmas-select.small {
  min-width: 90px;
  width: auto;
}

.admin-enigmas-search:focus,
.admin-enigmas-select:focus {
  border-color: rgba(77, 231, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(77, 231, 255, 0.08);
}

.admin-enigmas-summary {
  color: var(--muted);
  font-size: 0.95rem;
}

.admin-enigmas-per-page-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.admin-enigmas-pagination {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 20px;
}

.admin-page-btn.active {
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(77, 231, 255, 0.16);
}

@media (max-width: 760px) {
  .admin-enigmas-search-wrap,
  .admin-enigmas-select {
    flex: 1 1 100%;
    width: 100%;
  }

  .admin-enigmas-per-page-wrap {
    width: 100%;
    justify-content: space-between;
  }
}

.admin-enigma-form {
  display: grid;
  gap: 20px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.admin-enigma-form .form-group {
  display: grid;
  gap: 8px;
}

.admin-enigma-form label {
  font-weight: 700;
  color: var(--text);
}

.admin-enigma-form input,
.admin-enigma-form select,
.admin-enigma-form textarea {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font: inherit;
  outline: none;
}

.admin-enigma-form textarea {
  min-height: 170px;
  resize: vertical;
}

.admin-enigma-form input:focus,
.admin-enigma-form select:focus,
.admin-enigma-form textarea:focus {
  border-color: rgba(77, 231, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(77, 231, 255, 0.08);
}

.admin-enigma-form select option {
  color: #000;
}

.admin-form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 800px) {
  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-form-actions .btn {
    width: 100%;
  }
}

/* ===== Global HUD ===== */
.global-hud-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 0;
}

.global-hud {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: center;
  border: 1px solid rgba(77, 231, 255, 0.14);
}

.hud-identity-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hud-avatar {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.35rem;
  color: #fff;
  background: linear-gradient(135deg, rgba(125,92,255,0.9), rgba(77,231,255,0.9));
  box-shadow: 0 10px 30px rgba(77, 231, 255, 0.18);
}

.hud-kicker,
.hud-subtext,
.hud-nox-line {
  color: var(--muted);
}

.hud-kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 6px;
}

.hud-subtext {
  display: block;
  margin-top: 4px;
  font-size: 0.92rem;
}

.hud-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.hud-stat-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.hud-stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}

.hud-stat-card strong {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.05rem;
}

.hud-progress-block {
  display: grid;
  gap: 10px;
}

.hud-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
}

.hud-track {
  height: 12px;
}

.hud-fill {
  box-shadow: 0 0 24px rgba(77, 231, 255, 0.35);
}

.hud-nox-line {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
}

@media (max-width: 1120px) {
  .global-hud {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .global-hud-shell {
    width: min(1180px, calc(100% - 20px));
  }

  .hud-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.profile-rank-extra {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0.95;
}

.profile-rank-extra span {
  font-size: 14px;
  color: #c8f7ff;
}

.profile-identity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}

.profile-meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.16);
  color: #bff8ff;
  font-size: 13px;
  font-weight: 600;
}

.profile-progress-status {
  margin-top: 10px;
  font-size: 14px;
  color: #9bdfff;
  opacity: 0.92;
}

.profile-xp-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-xp-percent {
  font-weight: 700;
  color: #7ee7ff;
  font-size: 15px;
}

.profile-badge-card.unlocked {
  border: 1px solid rgba(0, 255, 170, 0.24);
  box-shadow: 0 0 18px rgba(0, 255, 170, 0.08);
}

.profile-badge-card.locked-badge {
  opacity: 0.62;
  filter: grayscale(0.15);
}

.profile-category-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.profile-progress-box .progress-fill {
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  box-shadow: 0 0 18px rgba(77,231,255,0.35);
}

.profile-badge-card.unlocked {
  transform: scale(1.02);
}

.profile-badge-card.unlocked:hover {
  transform: scale(1.04);
}

.profile-category-card.complete {
  border: 1px solid rgba(80,255,159,0.25);
  box-shadow: 0 0 0 1px rgba(80,255,159,0.08) inset;
}

.profile-hero,
.profile-stats-grid,
.profile-progress-box,
.profile-xp-box {
  animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.enigmas-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 8px 0 50px;
}

.pagination-info {
  color: var(--muted);
  font-weight: 700;
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  border: 1px solid rgba(77, 231, 255, 0.35);
  background: rgba(10, 14, 25, 0.88);
  color: var(--cyan);
  font-size: 1.4rem;
  font-weight: 900;
  cursor: pointer;
  z-index: 999;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 0.25s ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.solved-toggle-wrap {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

/* ===== Dossier joueur ===== */
.player-dossier {
  display: grid;
  gap: 14px;
  padding: 22px;
  border-left: 3px solid var(--cyan);
  margin-bottom: 18px;
}

.player-dossier h3 {
  font-size: 1.2rem;
  color: var(--cyan);
}

.dossier-intro {
  color: var(--muted);
}

.dossier-list {
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--text);
}

.dossier-warning {
  color: var(--danger);
  font-weight: 700;
  font-size: 0.95rem;
}

.dossier-tip {
  color: var(--yellow);
  font-size: 0.95rem;
}