:root {
  --bg: #eef5ff;
  --card: rgba(255, 255, 255, 0.92);
  --text: #102033;
  --muted: #667085;
  --line: #d8e2ef;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --green: #16a34a;
  --orange: #f97316;
  --purple: #7c3aed;
  --danger: #dc2626;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(22, 163, 74, 0.16), transparent 32rem),
    var(--bg);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background: url('/static/img/logo_dtg_80ans.jpg') center 7rem / min(82vw, 760px) no-repeat;
  filter: saturate(1.1);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem clamp(1rem, 4vw, 2rem);
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-weight: 800;
  min-width: 0;
}
.brand img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.nav {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-weight: 700;
  font-size: 0.95rem;
}
.inline-form { display: inline; margin: 0; }
.link-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.container {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 2rem));
  margin: 1.2rem auto 4rem;
}
.card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.glass { backdrop-filter: blur(16px); }
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.2rem, 3vw, 2.3rem);
  margin-bottom: 1rem;
}
.eyebrow {
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 900;
  margin: 0 0 0.3rem;
}
h1 { margin: 0 0 0.6rem; font-size: clamp(1.8rem, 5vw, 3.3rem); line-height: 1.05; }
h2 { margin: 0.5rem 0 0.9rem; font-size: 1.35rem; }
h3 { margin: 0.45rem 0 0.25rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.score-pill {
  min-width: 130px;
  padding: 1rem;
  border-radius: 22px;
  background: linear-gradient(135deg, #2563eb, #16a34a);
  color: white;
  text-align: center;
  box-shadow: 0 18px 40px rgba(37,99,235,0.28);
}
.score-pill span, .score-pill small { display: block; opacity: 0.9; font-weight: 700; }
.score-pill strong { display: block; font-size: 2.5rem; line-height: 1; }

.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 42px;
  padding: 0.65rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(15,23,42,0.12); text-decoration: none; }
.btn.primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.small { min-height: 34px; padding: 0.45rem 0.75rem; font-size: 0.9rem; }
.btn.danger { background: var(--danger); color: white; border-color: var(--danger); }

.progress-card { padding: 1rem; margin-bottom: 1.1rem; }
.progress-help { margin: 0.7rem 0 0; }
.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.7rem; }
.progress { height: 14px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2563eb, #f97316, #16a34a); transition: width 0.3s ease; }

.mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 1rem;
}
.tile { display: flex; flex-direction: column; min-height: 310px; }
.tile-img {
  height: 150px;
  background: linear-gradient(135deg, #e2e8f0, #f8fafc);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.tile-body p { color: var(--muted); margin-top: auto; }
.tile.locked { opacity: 0.72; }
.lock { font-size: 2.8rem; filter: grayscale(0.3); }
.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 900;
  color: white;
}
.badge.blue { background: var(--primary); }
.badge.green { background: var(--green); }
.badge.orange { background: var(--orange); }
.badge.purple { background: var(--purple); }
.badge.gray { background: #64748b; }



.puzzle-shell { padding: 1rem; margin-top: 1rem; }
.puzzle-title { margin-bottom: 1rem; }
.legend { display: flex; gap: 0.8rem; flex-wrap: wrap; font-size: 0.92rem; font-weight: 800; color: var(--muted); }
.dot {
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  margin-right: 0.35rem;
  vertical-align: -1px;
}
.dot.blue { background: var(--primary); }
.dot.purple { background: var(--purple); }
.dot.green { background: var(--green); }

.puzzle-board-wrap {
  position: relative;
  width: min(980px, 100%);
  margin: 0 auto;
}
.board-ghost {
  position: absolute;
  inset: 0;
  background: url('/static/img/logo_dtg_80ans.jpg') center / contain no-repeat;
  opacity: 0.28;
  filter: saturate(1.05);
  pointer-events: none;
}
.puzzle-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  padding: 0.4rem;
}
.puzzle-tile {
  position: relative;
  aspect-ratio: 7 / 4;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.92);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  background: linear-gradient(135deg, rgba(255,255,255,0.88), rgba(255,255,255,0.74));
}
.puzzle-image {
  position: absolute;
  inset: 0;
  background-image: url('/static/img/logo_dtg_80ans.jpg');
  background-repeat: no-repeat;
  background-size: 400% 700%;
  background-position: var(--x) var(--y);
  transform: scale(1.02);
}
.puzzle-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(16,32,51,0.08));
}
.puzzle-tile.locked .puzzle-image {
  filter: grayscale(0.95) blur(7px) brightness(1.08);
  opacity: 0.22;
  transform: scale(1.08);
}
.puzzle-tile.revealed .puzzle-image {
  filter: none;
  opacity: 1;
}
.puzzle-tile.validated {
  box-shadow: 0 12px 32px rgba(22,163,74,0.22);
}
.puzzle-tile.validated::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid rgba(22,163,74,0.72);
  border-radius: 18px;
  z-index: 2;
}
.tile-overlay {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.6rem;
}
.tile-overlay.top {
  top: 0;
  align-items: flex-start;
}
.tile-overlay.bottom {
  bottom: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.94) 35%, rgba(255,255,255,0.98));
}
.tile-overlay.bottom strong {
  display: block;
  font-size: 0.92rem;
  line-height: 1.15;
}
.tile-overlay.bottom p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
}
.tile-btn {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0.35rem 0.7rem;
  background: rgba(255,255,255,0.96);
}
.lock-mini {
  flex: 0 0 auto;
  font-size: 1.15rem;
  filter: grayscale(0.1);
}

.auth-card { width: min(500px, 100%); margin: 2rem auto; padding: 1.5rem; }
.form { display: grid; gap: 1rem; }
label { display: grid; gap: 0.35rem; font-weight: 800; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  font: inherit;
  background: white;
  color: var(--text);
}
textarea { resize: vertical; }
.alert { padding: 0.85rem 1rem; border-radius: 16px; font-weight: 800; margin: 1rem 0; }
.alert.error { background: #fee2e2; color: #991b1b; }
.alert.success { background: #dcfce7; color: #166534; }
.alert.warning { background: #ffedd5; color: #9a3412; }

.scan-card { padding: clamp(1.2rem, 4vw, 2rem); }
.scan-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.points { color: var(--green); font-weight: 900; font-size: 1.2rem; }
.poster {
  width: 100%;
  max-height: 58vh;
  object-fit: contain;
  border-radius: 20px;
  background: #f8fafc;
  border: 1px solid var(--line);
  margin-top: 1rem;
}
.question-text, .answer-text { font-size: 1.15rem; line-height: 1.6; }
.locked-panel { text-align: center; }
.big-icon { font-size: 4rem; }
.qcm-box {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 20px;
  background: #f8fafc;
  border: 1px solid var(--line);
}
.choices { display: grid; gap: 0.75rem; }
.choice {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  cursor: pointer;
}
.choice input { width: auto; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.ranking { display: grid; gap: 0.7rem; }
.rank-row {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}
.rank-row.top { background: linear-gradient(90deg, rgba(37,99,235,0.08), rgba(22,163,74,0.08)); }
.rank-number { font-size: 1.35rem; font-weight: 900; text-align: center; }
.rank-name { font-weight: 900; }
.rank-meta { color: var(--muted); font-size: 0.9rem; }
.rank-score { font-weight: 900; color: var(--primary); }

.admin-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin: 1rem 0; }
.admin-stats { text-align: center; background: #f8fafc; border: 1px solid var(--line); border-radius: 18px; padding: 0.7rem 1rem; }
.admin-stats strong { display: block; font-size: 1.5rem; }
.admin-stats span { color: var(--muted); font-weight: 700; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-top: 1rem; }
.admin-question { padding: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.admin-form { margin-top: 1rem; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.checkline { display: flex; flex-direction: row; align-items: center; gap: 0.5rem; }
.checkline input { width: auto; }
.preview { width: 100%; max-height: 210px; object-fit: contain; border: 1px solid var(--line); border-radius: 18px; background: #f8fafc; margin-top: 0.6rem; }
code { background: #eff6ff; color: #1d4ed8; padding: 0.2rem 0.35rem; border-radius: 8px; }

@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .nav { justify-content: flex-start; gap: 0.75rem; font-size: 0.9rem; }
  .hero { flex-direction: column; align-items: stretch; }
  .score-pill { width: 100%; }
  .puzzle-shell { padding: 0.75rem; }
  .puzzle-board { gap: 0.3rem; padding: 0.15rem; }
  .puzzle-tile { border-radius: 14px; }
  .tile-overlay { padding: 0.35rem 0.38rem; }
  .tile-overlay.bottom strong { font-size: 0.72rem; }
  .tile-overlay.bottom p { font-size: 0.62rem; }
  .tile-btn { min-height: 26px; padding: 0.2rem 0.5rem; font-size: 0.7rem; }
  .badge { font-size: 0.62rem; padding: 0.2rem 0.42rem; }
  .legend { font-size: 0.78rem; }
  .rank-row { grid-template-columns: 38px 1fr auto; }
  .rank-meta { grid-column: 2 / -1; }
  .section-title { align-items: flex-start; flex-direction: column; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}

/* V4 - mosaïque taquin simplifiée */
.card { overflow: visible; }
.topbar, .scan-card, .auth-card, .progress-card, .puzzle-shell { overflow: visible; }

.puzzle-shell { padding: 1.1rem; }
.puzzle-title { padding: 0 0.25rem; }
.puzzle-board-wrap {
  position: relative;
  width: min(980px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 0;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: white;
}
.board-ghost {
  position: absolute;
  inset: 0;
  background: url('/static/img/logo_dtg_80ans.jpg') center / contain no-repeat;
  opacity: 0.16;
  pointer-events: none;
}
.puzzle-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 0;
}
.puzzle-tile,
.puzzle-tile:visited {
  position: relative;
  display: block;
  aspect-ratio: 7 / 4;
  border-radius: 0;
  border: 0;
  border-right: 1px solid rgba(255,255,255,0.86);
  border-bottom: 1px solid rgba(255,255,255,0.86);
  box-shadow: none;
  overflow: hidden;
  color: white;
  background-image: url('/static/img/logo_dtg_80ans.jpg');
  background-repeat: no-repeat;
  background-size: 400% 700%;
  background-position: var(--x) var(--y);
  text-decoration: none;
}
.puzzle-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  background-image: inherit;
  background-repeat: inherit;
  background-size: inherit;
  background-position: inherit;
  transform: scale(1.08);
  filter: grayscale(1) blur(18px) brightness(0.48) contrast(1.08);
  opacity: 0.78;
}
.puzzle-tile.revealed::before {
  filter: none;
  opacity: 1;
  transform: scale(1.01);
}
.puzzle-tile.clickable {
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.puzzle-tile.clickable:hover {
  z-index: 4;
  transform: scale(1.015);
  box-shadow: 0 10px 28px rgba(15,23,42,0.24);
}
.puzzle-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.22), rgba(0,0,0,0.06) 35%, rgba(0,0,0,0.26));
  pointer-events: none;
}
.tile-label {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  z-index: 3;
  min-width: 2.2rem;
  padding: 0.22rem 0.45rem;
  border-radius: 999px;
  color: white;
  font-size: 0.82rem;
  line-height: 1;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 5px 16px rgba(0,0,0,0.22);
}
.q-label { background: rgba(37, 99, 235, 0.92); }
.r-label { background: rgba(124, 58, 237, 0.92); }
.puzzle-tile.locked .tile-label { background: rgba(71, 85, 105, 0.9); }
.puzzle-tile.needs-qcm {
  outline: 4px solid rgba(249, 115, 22, 0.95);
  outline-offset: -4px;
  z-index: 2;
}
.puzzle-tile.validated {
  outline: none;
  outline-offset: 0;
}
.qcm-dot {
  position: absolute;
  right: 0.45rem;
  top: 0.45rem;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.96);
  color: white;
  font-size: 0.9rem;
  font-weight: 900;
  box-shadow: 0 5px 16px rgba(0,0,0,0.22);
}
.answer-pending-question {
  outline: 3px dashed rgba(249, 115, 22, 0.85);
  outline-offset: -5px;
}
.tile-overlay, .puzzle-image, .lock-mini { display: none !important; }
.legend { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


.completion-card {
  width: min(560px, 100%);
  margin: 1.25rem auto 0;
  padding: 1.1rem;
  text-align: center;
  border: 1px solid rgba(249, 115, 22, 0.35);
  border-radius: 18px;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 14px 34px rgba(15,23,42,0.12);
}
.completion-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--green);
}
.completion-card p {
  margin: 0.35rem 0 0.9rem;
  color: var(--muted);
  font-weight: 700;
}
.completion-password {
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  border: 2px dashed rgba(249, 115, 22, 0.9);
  border-radius: 14px;
  color: var(--orange);
  background: rgba(255, 247, 237, 0.96);
  font-size: 1.15rem;
  font-weight: 900;
}

@media (max-width: 760px) {
  .puzzle-shell { padding: 0.65rem; }
  .puzzle-board-wrap { border-radius: 0; }
  .tile-label {
    top: 0.25rem;
    left: 0.25rem;
    min-width: 1.7rem;
    padding: 0.18rem 0.32rem;
    font-size: 0.64rem;
  }
  .qcm-dot {
    top: 0.25rem;
    right: 0.25rem;
    width: 1.1rem;
    height: 1.1rem;
    font-size: 0.72rem;
  }
  .puzzle-tile.needs-qcm { outline-width: 3px; outline-offset: -3px; }
}

/* v5 overrides */
.puzzle-tile.validated,
.puzzle-tile.validated:hover {
  outline: none !important;
  box-shadow: none !important;
}
.puzzle-tile.validated::before {
  border: 0 !important;
  border-radius: 0 !important;
}

/* v6 overrides */
.puzzle-tile::before {
  filter: grayscale(1) blur(32px) brightness(0.18) contrast(1.4) saturate(0.45) !important;
  opacity: 1 !important;
  transform: scale(1.18) !important;
}
.puzzle-tile::after {
  background: rgba(0, 0, 0, 0.68) !important;
}
.puzzle-tile.revealed::before {
  filter: none !important;
  opacity: 1 !important;
  transform: scale(1.01) !important;
}
.puzzle-tile.revealed::after {
  background: rgba(0, 0, 0, 0.03) !important;
}
.puzzle-tile.locked .tile-label {
  background: rgba(15, 23, 42, 0.92) !important;
}
.tile-location {
  position: absolute;
  left: 0.45rem;
  bottom: 0.42rem;
  z-index: 3;
  padding: 0.18rem 0.42rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.78);
  color: white;
  font-size: 0.72rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow: 0 5px 16px rgba(0,0,0,0.22);
}
.puzzle-tile.revealed .tile-location {
  background: rgba(15, 23, 42, 0.56);
}
@media (max-width: 760px) {
  .tile-location {
    left: 0.25rem;
    bottom: 0.25rem;
    padding: 0.14rem 0.28rem;
    font-size: 0.56rem;
  }
}

.rules-card { padding: clamp(1.2rem, 3vw, 2rem); }
.rules-block {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.78);
}
.rules-block h2 { margin-top: 0; }
.rules-block li { margin: 0.45rem 0; }
.cyber-block {
  border-color: rgba(249,115,22,0.35);
  background: rgba(255,247,237,0.86);
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15,23,42,0.62);
  backdrop-filter: blur(8px);
}
.modal-backdrop.hidden { display: none; }
.modal-card {
  width: min(560px, 100%);
  padding: 1.4rem;
}
.modal-card ul { margin-top: 0.6rem; }
.modal-card li { margin: 0.35rem 0; }

/* v8 admin players */
.admin-players-card {
  margin-top: 1rem;
  padding: 1rem;
}
.admin-player-list {
  display: grid;
  gap: 0.7rem;
}
.admin-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.82);
}
.admin-player-row p {
  margin: 0.2rem 0 0;
}
@media (max-width: 760px) {
  .admin-player-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* v9 premium */
:root {
  --premium-dark: #0f172a;
  --premium-gold: #f59e0b;
}
body {
  background:
    radial-gradient(circle at 12% 8%, rgba(245, 158, 11, 0.18), transparent 26rem),
    radial-gradient(circle at 88% 12%, rgba(37, 99, 235, 0.16), transparent 28rem),
    linear-gradient(180deg, #eef5ff 0%, #f8fafc 58%, #eef5ff 100%);
}
.topbar {
  background: rgba(15, 23, 42, 0.88);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 10px 30px rgba(15,23,42,0.16);
}
.brand, .nav a, .link-button { color: white; }
.nav a:hover, .link-button:hover { color: var(--premium-gold); text-decoration: none; }
.brand img { border: 2px solid rgba(255,255,255,0.78); }
.card {
  border: 1px solid rgba(255,255,255,0.86);
  box-shadow: 0 20px 55px rgba(15,23,42,0.11);
}
.hero {
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(255,255,255,0.82));
}
.score-pill {
  background: linear-gradient(135deg, #0f172a, #1d4ed8 55%, #f59e0b);
}
.puzzle-shell {
  background: rgba(255,255,255,0.86);
}
.puzzle-board-wrap {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.55), 0 22px 50px rgba(15,23,42,0.16);
}
.puzzle-tile::before {
  filter: grayscale(1) blur(42px) brightness(0.10) contrast(1.8) saturate(0.2) !important;
  transform: scale(1.26) !important;
}
.puzzle-tile::after {
  background: rgba(0, 0, 0, 0.82) !important;
}
.puzzle-tile.revealed::after { background: rgba(0, 0, 0, 0.015) !important; }
.puzzle-tile.needs-qcm {
  outline: 4px solid rgba(245, 158, 11, 0.98);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.55);
}
.answer-pending-question {
  outline: 3px dashed rgba(245, 158, 11, 0.98);
}
.completion-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(255,247,237,0.94));
}
.premium-admin-head { padding: clamp(1.1rem, 3vw, 1.7rem); }
.admin-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1rem 0;
}
.admin-kpi {
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(248,250,252,0.82));
  text-align: center;
}
.admin-kpi strong {
  display: block;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: var(--primary);
  line-height: 1;
}
.admin-kpi span {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-weight: 800;
}
.premium-row {
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(248,250,252,0.82));
}
.row-actions, .question-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.premium-question-card {
  align-items: flex-start;
  background: rgba(255,255,255,0.9);
}
.premium-question-card h3 { margin-bottom: 0.35rem; }
.qr-hint {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 0;
}
.leaderboard-card { padding: clamp(1.1rem, 3vw, 1.7rem); }
.premium-ranking .rank-row {
  background: rgba(255,255,255,0.92);
  border-color: rgba(203,213,225,0.8);
}
.premium-ranking .rank-row.top {
  background: linear-gradient(90deg, rgba(245,158,11,0.14), rgba(37,99,235,0.08));
}
.rank-row.top:first-child {
  border-color: rgba(245,158,11,0.45);
  box-shadow: 0 12px 30px rgba(245,158,11,0.12);
}
@media (max-width: 760px) {
  .admin-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-actions, .question-actions { justify-content: flex-start; }
  .topbar { background: rgba(15, 23, 42, 0.94); }
}
