* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at 20% 20%, rgba(59,130,246,0.15), transparent 30%), #0f172a;
  color: #e5e7eb;
  font-family: "Segoe UI", system-ui, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  padding: 24px;
}

.logo-top {
  width: 100%;
  text-align: center;
  margin-bottom: 12px;
}
.logo-top img {
  max-width: 220px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  aspect-ratio: 358 / 147;
}

.app { max-width: 900px; width: 100%; }

header.hero {
  display:flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  margin-bottom: 12px;
  border-radius: 18px;
  background: linear-gradient(120deg, rgba(59,130,246,0.18), rgba(16,185,129,0.12), rgba(59,130,246,0.18));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 40px rgba(0,0,0,0.28);
  align-items: center;
  flex-wrap: wrap;
}
header.hero h1 { margin: 6px 0 6px; font-size: 1.8rem; }
header.hero .subtitle { margin: 6px 0 0; color:#cbd5e1; max-width: 560px; }
header.hero .pill {
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 12px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .5px;
  color:#e0f2fe;
}
.hero-actions { display:flex; flex-direction:column; gap:6px; align-items:flex-end; }
.hero-actions .micro { margin:0; color:#cbd5e1; font-size:.9rem; text-align:right; }

.card {
  background:#111827;
  border-radius: 18px;
  padding: 22px;
  box-shadow:0 25px 40px rgba(0,0,0,.25);
  margin: 14px 0;
  border:1px solid rgba(255,255,255,0.06);
}

.admin-page .admin-hero {
  background: linear-gradient(135deg, rgba(59,130,246,0.18), rgba(14,165,233,0.12), rgba(16,185,129,0.12));
  border: 1px solid rgba(59,130,246,0.25);
  box-shadow: 0 20px 36px rgba(15,23,42,0.45);
}
.admin-page .btn {
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.admin-page .btn.primary {
  background: linear-gradient(135deg, #3b82f6, #0ea5e9);
  border: 1px solid rgba(59,130,246,0.4);
}
.admin-page .btn.secondary {
  background: linear-gradient(135deg, rgba(148,163,184,0.25), rgba(71,85,105,0.45));
  border: 1px solid rgba(148,163,184,0.35);
}
.admin-page .btn.ghost {
  background: rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.12);
}
.admin-page .btn:focus-visible {
  outline: 2px solid rgba(59,130,246,0.7);
  outline-offset: 2px;
}
#quiz { position: relative; overflow: visible; }

.hidden { display:none; }

.progressbar {
  width: 100%;
  height: 10px;
  background: #1f2937;
  border-radius: 20px;
  margin-bottom: 12px;
}
#progressFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg,#3b82f6,#06b6d4);
  border-radius: 20px;
  transition: width .25s ease;
}
#progressText { color:#9ca3af; margin:6px 0 14px; }

.category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--cat-color, #1f2937);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  color: var(--cat-color, #a5b4fc);
  font-weight: 600;
  position: absolute;
  right: 16px;
  bottom: -14px;
  margin: 0;
}

h1,h2,h3 { margin-top: 0; }

.question-head {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}
.question-head .question-meta {
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:4px;
}
.difficulty-chip {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:4px 10px;
  border-radius:999px;
  font-weight:700;
  font-size:0.95rem;
  color:#0f172a;
  background:#22c55e;
}
.difficulty-chip.soft { background:#22c55e; color:#0f172a; }
.difficulty-chip.medium { background:#f59e0b; color:#0f172a; }
.difficulty-chip.hard { background:#ef4444; color:#0f172a; }

.choices { display:flex; flex-wrap:wrap; gap:10px; }
.btn {
  border:none;
  padding:12px 18px;
  border-radius: 12px;
  cursor:pointer;
  font-size:1rem;
  color:white;
  transition: transform .1s ease, opacity .2s ease;
}
.btn:hover { transform: translateY(-1px); opacity: .95; }
.btn.primary { background:#1d4ed8; border:1px solid rgba(255,255,255,0.12); }
.btn.secondary { background:#6b7280; }
.btn.ghost {
  background: rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.12);
}
.btn.ghost:hover { opacity: 0.95; }

.choice.neutral { background:#16a34a; }
.choice.light { background:#22c55e; }
.choice.medium { background:#f59e0b; }
.choice.strong { background:#ef4444; }

.big { font-size:2.1rem; font-weight:800; margin-bottom: 6px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size:.8rem; color:#9ca3af; margin:0 0 6px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.06);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
}
.tag.purity-tag { font-size: 1.1rem; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #0f172a;
  background: linear-gradient(135deg, #facc15, #fb7185);
  margin-left: 6px;
}
.badge.hidden { display: none; }


.last { margin-top: 14px; color:#9ca3af; }

.actions { display:flex; gap:10px; flex-wrap:wrap; margin-top: 18px; justify-content:center; }
.actions.pager {
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}
.actions.pager .btn {
  background: linear-gradient(135deg, rgba(59,130,246,0.25), rgba(30,64,175,0.25));
  border: 1px solid rgba(148,163,184,0.25);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.actions.pager .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.actions.pager .btn:focus { outline: none; }
.actions.pager .btn:focus-visible {
  outline: 2px solid rgba(59,130,246,0.7);
  outline-offset: 2px;
}
.actions.pager .micro {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(148,163,184,0.2);
  user-select: none;
}

/* Résultat amélioré */
.result-card { transition: background .3s ease, border-color .3s ease; }
.result-card.purity-high { background: linear-gradient(135deg,#0f172a,#0b2a1d); border-color: rgba(16,185,129,0.35); }
.result-card.purity-mid { background: linear-gradient(135deg,#0f172a,#10213d); border-color: rgba(59,130,246,0.35); }
.result-card.purity-low { background: linear-gradient(135deg,#0f172a,#2a1c0c); border-color: rgba(245,158,11,0.35); }
.result-card.purity-chaos { background: linear-gradient(135deg,#120c1a,#2a0b0b); border-color: rgba(239,68,68,0.35); }

.result-top { display:flex; justify-content:space-between; align-items:center; gap:20px; flex-wrap:wrap; }
.result-text { max-width: 440px; }

.gauge-block { text-align:center; }
.gauge {
  width: 170px; height: 170px;
  border-radius: 50%;
  background:#1f2937;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05), 0 12px 30px rgba(0,0,0,0.35);
}
.gauge-center {
  position:absolute; inset:22px;
  background:#0f172a;
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
#globalGaugeValue { font-weight:800; font-size:1.3rem; }
.gauge-label { color:#9ca3af; margin-top:8px; font-size:.9rem; }

.chart-card {
  margin-top: 18px;
  background:#0b1325;
  border:1px solid #1f2937;
  border-radius: 16px;
  padding: 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}
.chart-header { display:flex; justify-content:space-between; align-items:flex-end; gap:12px; flex-wrap:wrap; }
.chart-header h3 { margin:4px 0 0; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.category-pill {
  background:#111827;
  border:1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 10px 12px;
  display:flex;
  justify-content: space-between;
  align-items:center;
  font-weight:600;
  position: relative;
  overflow: hidden;
}
.category-pill::before {
  content: "";
  position:absolute; inset:0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04));
  opacity: .8;
}
.category-pill strong { position:relative; z-index:1; }
.category-pill span { position:relative; z-index:1; color:#d1d5db; font-weight:500; }

.bar-chart { margin-top: 14px; display:flex; flex-direction:column; gap:12px; }
.bar { display:flex; flex-direction:column; gap:6px; }
.bar-label { display:flex; justify-content:space-between; color:#9ca3af; font-size:.95rem; }
.bar-track {
  width:100%;
  background:#1f2937;
  border-radius: 10px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,0.05);
}
.bar-fill {
  height: 12px;
  width:0;
  border-radius: 10px;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  transition: width .3s ease;
}
.bar.global .bar-fill { height:14px; }
.bar.global .bar-label strong { color:#fff; }

.levels-card {
  margin-top: 18px;
  background:#0b1325;
  border:1px solid #1f2937;
  border-radius: 16px;
  padding: 14px;
}
.compare-card {
  margin-top: 14px;
  background:#0b1325;
  border:1px solid #1f2937;
  border-radius: 16px;
  padding: 14px;
}

.time-card {
  margin-top: 14px;
  background:#0b1325;
  border:1px solid #1f2937;
  border-radius: 16px;
  padding: 14px;
}
.time-grid {
  display:flex;
  gap: 12px;
  flex-wrap: wrap;
}
.time-item {
  flex: 1 1 180px;
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(148,163,184,0.2);
  border-radius: 12px;
  padding: 10px 12px;
  display:flex;
  flex-direction:column;
  gap:6px;
  color:#e2e8f0;
}
.time-item span { color:#94a3b8; font-size:0.9rem; }
.time-item strong { font-size:1.1rem; color:#f8fafc; }
.compare-bar {
  position: relative;
  height: 18px;
  background: linear-gradient(90deg,#22c55e,#f59e0b,#ef4444);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: visible;
  margin: 10px 0;
}
.compare-marker {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  border: 2px solid #0f172a;
}
.compare-label {
  position: absolute;
  bottom: 100%;
  margin-bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  color: #0f172a;
  font-size: 0.8rem;
  white-space: nowrap;
  background: rgba(248,250,252,0.9);
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.compare-marker.user {
  background: #60a5fa;
  box-shadow: 0 0 10px rgba(96,165,250,0.7);
}
.compare-marker.avg {
  background: #fbbf24;
  box-shadow: 0 0 10px rgba(251,191,36,0.7);
}
.compare-stats {
  display:flex;
  justify-content: space-between;
  gap: 8px;
  color:#cbd5e1;
  font-size: 0.95rem;
}
.compare-note { margin-top: 6px; color:#cbd5e1; }
.levels-scale {
  display:flex;
  gap:6px;
  margin: 8px 0 12px;
  flex-wrap:wrap;
  overflow:hidden;
  border-radius: 12px;
  border:1px solid #1f2937;
}
.level-segment {
  flex:1 1 180px;
  padding:14px 12px;
  display:flex;
  flex-direction:column;
  gap:4px;
  color:#f8fafc;
  font-weight:700;
  position: relative;
}
.level-segment small { color:#e2e8f0; font-weight:600; }
.level-segment .range { font-size:.85rem; opacity:0.92; text-transform: uppercase; letter-spacing:.05em; }
.level-segment::after {
  content:"";
  position:absolute;
  inset:0;
  background: rgba(15,23,42,0.5);
}
.level-segment > * { position: relative; z-index: 1; }

.table { margin-top: 8px; overflow-x: auto; }
.table-head, .table-row {
  display:grid;
  grid-template-columns: 30px 1fr 170px 200px 240px;
  gap:12px;
  align-items:center;
  min-width: 560px;
}
.table-head { color:#9ca3af; font-size:.9rem; }
.table-row { padding:8px 10px; background:#0b1325; border:1px solid #1f2937; border-radius:10px; margin-top:6px; }
.table-row span:nth-child(2) { font-weight:700; }
.table-row span:nth-child(3) { color:#cbd5e1; font-size:.9rem; display:flex; justify-content:flex-start; gap:6px; flex-wrap:wrap; }
.score-cell {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:4px 10px;
  border-radius:999px;
  font-weight:700;
  color:#f8fafc;
  background: rgba(15,23,42,0.85);
  border:1px solid rgba(148,163,184,0.35);
  box-shadow: inset 4px 0 0 var(--score-accent, #334155);
}
.difficulty-pill {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:4px 8px;
  border-radius:999px;
  font-weight:700;
  color:#0f172a;
  background: var(--diff-color, #22c55e);
}
.cat-text { font-weight:700; color:#cbd5e1; }
.diff-cell { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.status-pill {
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 8px;
  border-radius:999px;
  font-weight:700;
  font-size:.85rem;
  border:1px solid transparent;
}
.status-pill.on { background:#10291b; color:#34d399; border-color:rgba(52,211,153,0.35); }
.status-pill.off { background:#2f1b1b; color:#fca5a5; border-color:rgba(252,165,165,0.35); }
.row-inactive { opacity:0.6; }
.actions-cell { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; align-items:center; }
.q-select { width:16px; height:16px; }
.diff-inline { min-width:110px; padding:6px 8px; border-radius:8px; border:1px solid #334155; background:#0b1221; color:#e2e8f0; }
.diff-tags-list { display:flex; flex-direction:column; gap:8px; margin-top:10px; }
.diff-tag-row { display:grid; grid-template-columns:120px 1fr 220px; gap:12px; align-items:center; padding:10px; background:#0c1324; border:1px solid #1f2937; border-radius:10px; }
.diff-meta { font-size:12px; color:#94a3b8; }
.diff-actions { display:flex; justify-content:flex-end; gap:8px; }
.table-row.dragging { opacity: 1; box-shadow: 0 0 0 2px rgba(96,165,250,0.4); }
.table-row.drag-over { transform: translateY(4px); transition: transform 0.15s ease; }
.drag-handle {
  display:flex;
  align-items:center;
  justify-content:center;
  color:#9ca3af;
  cursor:grab;
  font-weight:700;
}
.drag-text { display:block; }
.drag-ghost { position:absolute; top:-9999px; opacity:1; pointer-events:none; }
.drag-text { display:block; }
.table-row.drag-shadow { box-shadow: 0 0 0 2px rgba(96,165,250,0.4); }

.security select,
.security input { background:#0b1325; border:1px solid #1f2937; color:#e5e7eb; padding:8px 10px; border-radius:8px; }

/* Security page table spacing */
.security .table-head, .security .table-row {
  grid-template-columns: 1.2fr 160px 1fr;
  gap: 16px;
  min-width: 520px;
}
.security-logs .table-head, .security-logs .table-row {
  grid-template-columns: 1.2fr 1fr 120px 180px;
  gap: 16px;
  min-width: 560px;
}
.security-logs .table-head span { white-space: nowrap; }
.security-logs .table-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-leaderboard .table-head,
.admin-leaderboard .table-row {
  grid-template-columns: 1fr 70px 80px 120px 90px;
}
.admin-leaderboard .table-row button { width: 100%; }
.table-subhead {
  padding: 8px 10px;
  font-weight: 700;
  color: #e5e7eb;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 10px;
  margin-top: 10px;
}
.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: color-mix(in srgb, var(--cat-color, #3b82f6) 16%, #0b1325);
  color: var(--cat-color, #60a5fa);
  font-weight: 700;
}
.order-block { margin-top: 12px; }
.order-head { display:flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cat-order-list { display:flex; flex-direction:column; gap:8px; margin-top:6px; }
.cat-order-item {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 10px;
  background:#0b1325;
  border:1px solid #1f2937;
  border-radius:10px;
}
.cat-order-actions { display:flex; gap:6px; }
.cat-actions {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:6px 0 10px;
  align-items:center;
}
.cat-actions select,
.cat-actions input {
  background:#0b1325;
  border:1px solid #1f2937;
  color:#e5e7eb;
  padding:8px 10px;
  border-radius:8px;
}
.btn.danger { background:#ef4444; }
.leaderboard-table .table-head,
.leaderboard-table .table-row {
  grid-template-columns: 1fr 70px 80px 90px 120px;
}

.leaderboard-table .table-body {
  height: 430px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding-right: 4px;
}
.table-body.loading {
  position: relative;
  border: 1px solid #1f2937;
  border-radius: 10px;
  background: #0b1325;
  overflow: hidden;
}
.table-body.loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, rgba(17,24,39,0) 0%, rgba(148,163,184,0.14) 50%, rgba(17,24,39,0) 100%);
  transform: translateX(-100%);
  animation: leaderboard-shimmer 1.3s infinite;
}
@keyframes leaderboard-shimmer {
  100% { transform: translateX(100%); }
}

.empty-msg {
  text-align: center;
  color: #9ca3af;
  padding: 10px;
  font-size: 0.95rem;
}
@media (max-width: 480px) {
  .hero h1 { font-size: 1.5rem; }
  .hero .subtitle { font-size: 0.95rem; }
  .table { overflow-x: auto; }
  .table-head, .table-row { min-width: 360px; }
  #question { font-size: 1.1rem; }
  .choices .btn { width: 100%; }
  .btn { padding: 12px 14px; }
  .pseudo-row input {
    padding: 9px 10px;
    font-size: 0.95rem;
    border-radius: 8px;
  }
}

.intro-top {
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:center;
  flex-wrap:wrap;
}
.intro-actions { display:flex; gap:10px; align-items:flex-start; flex-direction:column; }
.intro-actions input {
  background:#0b1325;
  border:1px solid #1f2937;
  color:#e5e7eb;
  padding:10px 12px;
  border-radius:10px;
  min-width: 220px;
}
.error-text { color:#f87171; margin:6px 0 0; }
.micro { color:#9ca3af; font-size:.9rem; }

.pseudo-block { margin-bottom: 12px; }
.pseudo-row {
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.pseudo-row input {
  flex:1 1 220px;
  background:#0b1325;
  border:1px solid #1f2937;
  color:#e5e7eb;
  padding:10px 12px;
  border-radius:10px;
}
#countryQuiz { display:none; }
.intro-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top:12px;
}
.intro-item {
  background:#0b1325;
  border:1px solid #1f2937;
  border-radius:12px;
  padding:10px 12px;
}
.intro-item p { margin: 6px 0 0; color:#cbd5e1; }

.feedback-form {
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:10px;
}
.feedback-form select,
.feedback-form input,
.feedback-form textarea {
  background:#0b1325;
  border:1px solid #1f2937;
  color:#e5e7eb;
  padding:10px 12px;
  border-radius:10px;
  font-size:1rem;
}
.feedback-form textarea { resize: vertical; min-height: 140px; }

.feedback-page .feedback-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 14px;
  align-items: start;
}
.feedback-form-card,
.feedback-side {
  background: #0b1325;
  border: 1px solid #1f2937;
  border-radius: 14px;
  padding: 14px;
}
.feedback-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feedback-list {
  margin: 0;
  padding-left: 18px;
  color: #cbd5e1;
}
.feedback-list li { margin: 6px 0; }
.feedback-note {
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.3);
  color: #dbeafe;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
}
@media (max-width: 760px) {
  .feedback-page .feedback-layout { grid-template-columns: 1fr; }
}

.admin-feedback .table-head,
.admin-feedback .table-row {
  grid-template-columns: 90px 120px 1fr 120px 150px 150px;
}
.admin-feedback .table-row span:nth-child(3) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feedback-message {
  background: #0b1325;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 12px;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
  margin-bottom: 12px;
}

.legal-page { padding-top: 10px; }
.legal-footer {
  margin-top: 14px;
  display:flex;
  gap:12px;
}
.legal-footer a {
  color:#93c5fd;
  text-decoration:none;
}
.legal-footer a:hover { text-decoration:underline; }
.legal-links { display:flex; gap:10px; flex-wrap:wrap; padding:12px; background:#0b1325; border:1px solid #1f2937; border-radius:12px; justify-content:center; }
.legal-links.hidden { display:none; }
.pill-dark { background: rgba(255,255,255,0.06); padding:6px 10px; border-radius:999px; }
.runs-text { font-size:1rem; color:#e5e7eb; font-weight:600; }
.runs-banner {
  display:flex;
  justify-content:center;
  margin: 12px 0 6px;
}
.spinner { text-align:center; color:#9ca3af; padding:10px; }
.success-text { color:#4ade80; margin:6px 0; }

/* Confettis */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 3000;
}
.confetti-piece {
  position: absolute;
  width: 10px;
  height: 14px;
  opacity: 0.9;
  animation: confetti-fall 4.6s linear forwards;
  transform-origin: left top;
}
@keyframes confetti-fall {
  0% { transform: translate3d(0,0,0) rotateZ(0deg); }
  100% { transform: translate3d(0, 120vh, 0) rotateZ(360deg); opacity: 0; }
}

@media (max-width: 600px) {
  body { padding: 14px; }
  .gauge { width: 120px; height: 120px; }
  .gauge-center { inset: 14px; }
  .hero { flex-direction: column; align-items: flex-start; }
    .leaderboard-table .table-head {
    display: none;
  }
  .leaderboard-table .table-body {
    height: 360px;
    overflow-y: auto;
    padding-right: 0;
  }
  .leaderboard-table .table-row {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "pseudo country"
      "score time"
      "date date";
    gap: 6px 10px;
    padding: 10px 12px;
    border-radius: 12px;
  }
  .leaderboard-table .table-row span:nth-child(1) {
    grid-area: pseudo;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .leaderboard-table .table-row span:nth-child(2) {
    grid-area: country;
    justify-self: end;
  }
  .leaderboard-table .table-row span:nth-child(3) {
    grid-area: score;
    justify-self: start;
  }
  .leaderboard-table .table-row span:nth-child(4) {
    grid-area: time;
    justify-self: end;
    color: #e2e8f0;
  }
  .leaderboard-table .table-row span:nth-child(5) {
    grid-area: date;
    justify-self: start;
    color: #94a3b8;
    font-size: 0.82rem;
  }
  .admin-leaderboard .table-head,
  .admin-leaderboard .table-row {
    grid-template-columns: 1fr 50px 70px 90px 70px;
  }
  .intro-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .category-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .choices .btn { flex: 1 1 45%; text-align: center; }
  .pseudo-row { flex-direction: column; align-items: stretch; }
  .actions { justify-content: center; }
  .chart-card, .levels-card, .result-card { padding: 14px; }
}

/* Modal admin edit */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  z-index: 4000;
  padding: 16px;
}
.modal.hidden { display: none; }
.modal-dialog { max-width: 760px; width: 100%; }


/* Traffic admin */
.traffic-select {
  background:#0b1325;
  border:1px solid #1f2937;
  color:#e5e7eb;
  padding:8px 10px;
  border-radius:8px;
}
.traffic-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap:10px;
  margin:10px 0;
}
.traffic-metric {
  background:#0b1325;
  border:1px solid #1f2937;
  border-radius:10px;
  padding:10px 12px;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.traffic-metric span { color:#94a3b8; font-size:0.85rem; }
.traffic-metric strong { font-size:1.2rem; color:#e5e7eb; }
.traffic-series {
  display:flex;
  flex-direction:column;
  gap:8px;
  margin:12px 0;
}
.traffic-row {
  display:grid;
  grid-template-columns: 110px 1fr 50px;
  gap:8px;
  align-items:center;
  font-size:0.9rem;
  color:#cbd5e1;
}
.traffic-bar {
  height:8px;
  background:#1f2937;
  border-radius:999px;
  overflow:hidden;
}
.traffic-bar-fill {
  height:100%;
  background: linear-gradient(90deg,#3b82f6,#06b6d4);
}
.traffic-bar-fill.success { background: linear-gradient(90deg,#22c55e,#4ade80); }
.traffic-bar-fill.fail { background: linear-gradient(90deg,#ef4444,#f97316); }
.traffic-columns {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap:12px;
  margin-top:10px;
}
.traffic-list {
  display:flex;
  flex-direction:column;
  gap:6px;
}
.traffic-item {
  display:flex;
  justify-content:space-between;
  gap:8px;
  background:#0b1325;
  border:1px solid #1f2937;
  border-radius:10px;
  padding:8px 10px;
  font-size:0.9rem;
}
.traffic-label { color:#e2e8f0; font-weight:600; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.traffic-tag { font-size:0.72rem; padding:2px 8px; border-radius:999px; background:#1f2937; color:#e2e8f0; border:1px solid rgba(255,255,255,0.08); }
.traffic-tag.human { background: rgba(34,197,94,0.16); color:#4ade80; border-color: rgba(34,197,94,0.3); }
.traffic-tag.bot { background: rgba(239,68,68,0.16); color:#fca5a5; border-color: rgba(239,68,68,0.3); }
.traffic-value { color:#94a3b8; }


.traffic-live-note { color:#94a3b8; font-size:0.9rem; }


/* Live traffic */
.live-visual { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin:10px 0 16px; }
.live-indicator { display:flex; align-items:center; gap:8px; font-weight:700; color:#e2e8f0; }
.live-dot { width:10px; height:10px; border-radius:999px; background:#22c55e; box-shadow:0 0 0 0 rgba(34,197,94,0.7); animation: live-pulse 1.4s infinite; }
.live-text { letter-spacing:0.02em; }
.live-chart { display:flex; align-items:flex-end; gap:4px; height:44px; min-width:180px; flex:1; background:#0b1325; border:1px solid #1f2937; border-radius:10px; padding:8px; }
.live-bar { width:6px; min-height:8px; border-radius:6px 6px 2px 2px; background: linear-gradient(180deg,#22c55e,#3b82f6); opacity:0.9; transition: height 0.2s ease; }
@keyframes live-pulse { 0% { box-shadow:0 0 0 0 rgba(34,197,94,0.7); } 70% { box-shadow:0 0 0 8px rgba(34,197,94,0); } 100% { box-shadow:0 0 0 0 rgba(34,197,94,0); } }


.live-controls { display:flex; align-items:center; gap:8px; color:#94a3b8; }
.live-label { font-size:0.85rem; }
.live-select { min-width:70px; }


.live-id { color:#94a3b8; font-weight:500; margin-left:6px; }


.traffic-chart { display:flex; flex-direction:column; gap:10px; margin-top:6px; }
.traffic-chart-row { display:flex; flex-direction:column; gap:6px; }
.traffic-chart-meta { display:flex; justify-content:space-between; font-size:0.9rem; color:#cbd5e1; }
.traffic-chart-value { color:#94a3b8; }
.traffic-chart-bar { height:8px; background:#1f2937; border-radius:999px; overflow:hidden; }
.traffic-chart-fill { height:100%; background: linear-gradient(90deg,#22c55e,#3b82f6); }


.traffic-chart-label { color:#e2e8f0; font-weight:600; }

.country-panel {
  display:grid;
  grid-template-columns: minmax(280px, 1.4fr) minmax(220px, 1fr);
  gap:14px;
  align-items:stretch;
}
.country-map {
  min-height: 320px;
  background:#0b1325;
  border:1px solid #1f2937;
  border-radius:14px;
  overflow:hidden;
}
.country-map .jvm-container { height: 100%; }
.jvm-tooltip {
  background:#0b1325;
  color:#e5e7eb;
  border:1px solid #1f2937;
  padding:6px 10px;
  border-radius:8px;
  font-size:0.85rem;
  box-shadow:0 8px 20px rgba(2,6,23,0.6);
}
@media (max-width: 720px) {
  .country-panel { grid-template-columns: 1fr; }
  .country-map { min-height: 240px; }
}

.country-visual {
  display:flex;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
}
.mini-globe {
  width:120px;
  height:120px;
  border-radius:999px;
  background: radial-gradient(circle at 30% 30%, rgba(59,130,246,0.35), rgba(2,6,23,0.9));
  border:1px solid rgba(59,130,246,0.25);
  box-shadow: inset 0 0 0 1px rgba(148,163,184,0.12), 0 10px 22px rgba(2,6,23,0.6);
  display:flex;
  align-items:center;
  justify-content:center;
}
.mini-globe svg { width:100%; height:100%; }
.mini-globe .globe-spin {
  transform-origin: 60px 60px;
  animation: globe-spin 14s linear infinite;
}
@keyframes globe-spin {
  to { transform: rotate(360deg); }
}



.feedback-count {
  text-align: right;
  color: #94a3b8;
  margin-top: 4px;
}


.dashboard-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap:10px;
  margin-top:12px;
}
.dash-bar {
  height: 8px;
  background:#1f2937;
  border-radius:999px;
  overflow:hidden;
  margin-top:8px;
}
.dash-bar-fill {
  height:100%;
  width:0;
  background: linear-gradient(90deg,#22c55e,#3b82f6);
}
.dash-split {
  display:flex;
  width:100%;
  height:8px;
  border-radius:999px;
  overflow:hidden;
  background:#1f2937;
  margin-top:8px;
}
.dash-split-human {
  height:100%;
  width:50%;
  background:#22c55e;
}
.dash-split-bot {
  height:100%;
  width:50%;
  background:#ef4444;
}
/* Dashboard visual refresh */
.dashboard-shell {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 450px at -20% -40%, rgba(59,130,246,0.16), transparent 58%),
    radial-gradient(900px 380px at 120% -20%, rgba(16,185,129,0.12), transparent 55%),
    linear-gradient(160deg, #0b1325 0%, #111827 55%, #0b1325 100%);
}
.dashboard-shell::after {
  content: "";
  position: absolute;
  right: -140px;
  bottom: -140px;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, rgba(59,130,246,0.22), rgba(59,130,246,0));
  pointer-events: none;
}
.dashboard-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.dashboard-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  font-weight: 700;
  color: #dbeafe;
  border: 1px solid rgba(59,130,246,0.38);
  background: rgba(37,99,235,0.24);
}
.dashboard-refresh {
  color: #9ca3af;
  font-size: 0.85rem;
}

.dashboard-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.dashboard-tile {
  position: relative;
  border-radius: 14px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(148,163,184,0.22);
  background:
    linear-gradient(180deg, rgba(15,23,42,0.85) 0%, rgba(2,6,23,0.85) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 12px 24px rgba(2,6,23,0.35);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.dashboard-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(148,163,184,0.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 16px 26px rgba(2,6,23,0.45);
}
.dashboard-tile strong {
  display: inline-block;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #c7d2fe;
  margin-bottom: 8px;
}
.dashboard-tile p {
  margin: 6px 0;
  color: #cbd5e1;
}
.dash-kpi {
  font-size: 1.3rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1;
  margin-right: 4px;
}
.tile-traffic .dash-kpi { color: #93c5fd; }
.tile-live .dash-kpi { color: #86efac; }
.tile-feedback .dash-kpi { color: #fcd34d; }
.tile-security .dash-kpi { color: #fca5a5; }
.tile-leaderboard .dash-kpi { color: #c4b5fd; }

.dash-bar {
  height: 10px;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}
.dash-bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e 0%, #06b6d4 50%, #3b82f6 100%);
  box-shadow: 0 0 10px rgba(34,197,94,0.45);
}
.dash-split {
  display: flex;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid rgba(148,163,184,0.18);
  background: rgba(15,23,42,0.9);
}
.dash-split-human {
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, #16a34a, #4ade80);
}
.dash-split-bot {
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, #ef4444, #f97316);
}

@media (max-width: 780px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .dash-kpi {
    font-size: 1.2rem;
  }
}
/* Unified admin pages visual language */
.admin-page .btn {
  text-decoration: none;
}
.admin-nav {
  gap: 8px;
}
.admin-nav .btn {
  border-radius: 999px;
  padding: 9px 14px;
  border: 1px solid rgba(148,163,184,0.35);
  background: linear-gradient(135deg, rgba(30,41,59,0.9), rgba(51,65,85,0.7));
}
.admin-nav .btn.is-active {
  background: linear-gradient(135deg, rgba(37,99,235,0.95), rgba(14,165,233,0.9));
  border-color: rgba(125,211,252,0.75);
  box-shadow: 0 8px 20px rgba(14,165,233,0.28);
}

.panel-section {
  background:
    radial-gradient(800px 280px at 10% -25%, rgba(59,130,246,0.12), transparent 62%),
    linear-gradient(170deg, rgba(10,18,36,0.95), rgba(2,6,23,0.96));
  border: 1px solid rgba(59,130,246,0.18);
  box-shadow: 0 16px 30px rgba(2,6,23,0.4);
}
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.section-head h2 {
  margin-bottom: 4px;
}
.section-head .micro {
  margin: 0;
}
.section-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #dbeafe;
  border: 1px solid rgba(56,189,248,0.45);
  background: rgba(14,116,144,0.25);
}
.section-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-section .traffic-grid {
  gap: 12px;
}
.panel-section .traffic-metric {
  border-radius: 12px;
  border-color: rgba(148,163,184,0.24);
  background: linear-gradient(180deg, rgba(15,23,42,0.8), rgba(2,6,23,0.85));
}
.panel-section .traffic-metric strong {
  font-size: 1.25rem;
  color: #f8fafc;
}

@media (max-width: 780px) {
  .admin-nav {
    gap: 6px;
  }
  .admin-nav .btn {
    padding: 8px 12px;
  }
}







/* SEO admin */
.seo-metric strong {
  color: #93c5fd;
}
.seo-facts,
.seo-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.seo-check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #0b1325;
  border: 1px solid #1f2937;
  border-radius: 10px;
  padding: 10px 12px;
}
.seo-check-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.seo-check-left strong {
  color: #e2e8f0;
  font-size: 0.95rem;
}
.seo-check-left .micro {
  color: #94a3b8;
  white-space: normal;
  word-break: break-word;
}

.tile-seo .dash-kpi { color: #fcd34d; }
.tile-seo .dash-bar-fill { background: linear-gradient(90deg, #f59e0b, #22c55e); }


.seo-card-link { cursor: pointer; }
.seo-card-link:focus-visible { outline: 2px solid rgba(245,158,11,0.85); outline-offset: 2px; }
.seo-card-link .micro { color: #cbd5e1; }





/* Home page visual polish */
.home-page {
  background:
    radial-gradient(1200px 620px at -8% -16%, rgba(14, 165, 233, 0.28), transparent 58%),
    radial-gradient(920px 520px at 108% -8%, rgba(34, 197, 94, 0.18), transparent 62%),
    radial-gradient(860px 560px at 50% 115%, rgba(99, 102, 241, 0.20), transparent 64%),
    linear-gradient(165deg, #070d1b 0%, #0a1222 48%, #091325 100%);
}
.home-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black 38%, transparent 100%);
  opacity: 0.16;
  z-index: 0;
}
.home-page .app {
  position: relative;
  z-index: 1;
  animation: app-rise .45s ease-out;
}
@keyframes app-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.home-page .logo-top img {
  filter: drop-shadow(0 12px 26px rgba(15, 23, 42, 0.72));
}
.home-page #hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background:
    radial-gradient(130% 90% at 8% 0%, rgba(8, 145, 178, 0.24), transparent 62%),
    radial-gradient(120% 100% at 100% 100%, rgba(79, 70, 229, 0.26), transparent 64%),
    linear-gradient(135deg, rgba(8, 47, 73, 0.86), rgba(30, 58, 138, 0.78) 52%, rgba(37, 99, 235, 0.56));
  box-shadow: 0 24px 46px rgba(2, 6, 23, 0.45);
}
.home-page #hero::before {
  content: none;
}
.home-page #hero .subtitle {
  color: #dbeafe;
}
.home-page .hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.home-page .hero-highlights span {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #dbeafe;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.5);
}
.home-page #startBtn {
  background: linear-gradient(135deg, #2563eb, #0891b2);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}
.home-page #startBtn:hover {
  transform: translateY(-2px);
}
.home-page #intro.card {
  border-color: rgba(148, 163, 184, 0.2);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(11, 19, 37, 0.94));
}
.home-page .intro-item {
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.home-page .intro-item:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.45);
  background: #0d1a32;
}
.home-page .leaderboard.card {
  margin-top: 14px !important;
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 14px 30px rgba(2, 6, 23, 0.35);
}
.home-page .table-head {
  background: rgba(15, 23, 42, 0.72);
  border-radius: 10px;
  padding: 8px 10px;
}
.home-page .runs-banner {
  margin: 16px 0 4px;
}
.home-page .runs-text {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(8, 145, 178, 0.14));
  padding: 9px 16px;
}
.home-page .legal-links {
  margin-top: 12px;
  border-color: rgba(148, 163, 184, 0.2);
  background: linear-gradient(180deg, rgba(11, 19, 37, 0.95), rgba(9, 15, 30, 0.95));
}
.home-page .legal-links .btn.ghost {
  border-color: rgba(148, 163, 184, 0.35);
  background: transparent;
  text-decoration: none;
}
.home-page .legal-links .btn.ghost:hover {
  background: transparent;
  text-decoration: none;
}
@media (max-width: 600px) {
  .home-page::before {
    opacity: 0.12;
    background-size: 28px 28px;
  }
  .home-page .hero-highlights {
    margin-top: 10px;
    gap: 6px;
  }
  .home-page .hero-highlights span {
    font-size: 0.72rem;
    padding: 4px 9px;
  }
  .home-page #hero {
    padding: 18px;
  }
}


/* Home UX and readability refinements */
.eyebrow { color: #b8c5d8; }
.micro { color: #b9c8dc; }
.btn:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.9);
  outline-offset: 2px;
}
.home-page .hero-actions {
  align-items: flex-end;
  gap: 8px;
}
.home-page .hero-hint {
  margin: 0;
  font-size: 0.88rem;
  color: #dbeafe;
}
.home-page .intro-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.leaderboard-table .score-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 4px 12px;
  font-weight: 800;
  font-size: 1.02rem;
}
.table-body.loading {
  background: linear-gradient(180deg, #0a1428, #0b1730);
}
.table-body.loading::before {
  background: linear-gradient(110deg, rgba(17,24,39,0) 0%, rgba(125,211,252,0.16) 50%, rgba(17,24,39,0) 100%);
}
@media (max-width: 760px) {
  .home-page .hero-actions {
    align-items: flex-start;
  }
  .home-page .intro-grid {
    grid-template-columns: 1fr;
  }
}
