/* ============================================================
   TAO3C V51-Mob — Premium Design System
   Overrides & polish for menus, modes, odyssey, ranking.
   Load AFTER all other CSS.
   ============================================================ */

:root {
  /* Core premium palette */
  --pr-bg-0: #05030f;
  --pr-bg-1: #0a0725;
  --pr-bg-2: #140933;
  --pr-bg-3: #1b0a3d;

  /* Category accents */
  --pr-3hess: #a855f7;        /* purple */
  --pr-3hess-2: #d8b4ff;
  --pr-3hance: #22c55e;       /* green (matches --cat-color) */
  --pr-3hance-2: #7dd3fc;
  --pr-3haos: #f43f5e;        /* pink-red */
  --pr-3haos-2: #fb7185;
  --pr-3hase: #fbbf24;        /* gold */
  --pr-3hase-2: #fcd34d;

  --pr-gold: #ffd54a;
  --pr-silver: #cfd3dc;
  --pr-bronze: #d68d5c;

  /* Glass / glow tokens */
  --pr-glass: rgba(18, 12, 46, 0.62);
  --pr-glass-strong: rgba(10, 6, 28, 0.82);
  --pr-border-soft: rgba(255, 255, 255, 0.08);
  --pr-border-mid: rgba(168, 85, 247, 0.25);
  --pr-text: #f5f1ff;
  --pr-text-dim: rgba(220, 210, 255, 0.55);
}

/* ---------- Global star-field background for menus ---------- */
#startMenu::before,
#modeSelectScreen::before,
#teamSelectScreen::before,
#odysseyMenuScreen::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(1200px 800px at 20% 10%,  rgba(168, 85, 247, 0.18), transparent 60%),
    radial-gradient(900px 700px at 85% 25%,  rgba(34, 211, 238, 0.12), transparent 55%),
    radial-gradient(1000px 900px at 50% 120%, rgba(244, 63, 94, 0.10), transparent 60%);
  animation: prAuroraShift 18s ease-in-out infinite alternate;
}
@keyframes prAuroraShift {
  0%   { filter: hue-rotate(0deg)    brightness(1); }
  100% { filter: hue-rotate(25deg)   brightness(1.08); }
}

/* ---------- Background glow overlay ---------- */
#startMenu, #modeSelectScreen {
  background:
    radial-gradient(ellipse at top, rgba(75, 35, 145, 0.35), transparent 65%),
    linear-gradient(180deg, #05030f 0%, #0a0725 45%, #140933 100%) !important;
}

/* ---------- Logo ---------- */
.menu-logo img {
  width: 132px !important; height: 132px !important;
  border-radius: 28px !important;
  box-shadow:
    0 0 48px rgba(168, 85, 247, 0.55),
    0 0 96px rgba(168, 85, 247, 0.25),
    inset 0 0 0 2px rgba(255, 255, 255, 0.08) !important;
  animation: prLogoGlow 4.5s ease-in-out infinite;
}
@keyframes prLogoGlow {
  0%, 100% { filter: brightness(1)   saturate(1); }
  50%      { filter: brightness(1.12) saturate(1.18); }
}

.menu-title {
  font-size: 34px !important;
  font-weight: 900 !important;
  letter-spacing: 0.12em !important;
  background: linear-gradient(135deg, #fff 0%, #d8b4ff 40%, #89b4ff 75%, #22d3ee 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 32px rgba(168, 85, 247, 0.6),
    0 0 64px rgba(168, 85, 247, 0.25) !important;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}
.menu-subtitle {
  font-size: 11px !important;
  letter-spacing: 0.28em !important;
  color: rgba(216, 180, 255, 0.75) !important;
  text-transform: uppercase;
}

/* ---------- Play buttons ---------- */
.menu-play-btn {
  padding: 16px 20px !important;
  border-radius: 18px !important;
  border: 1.5px solid rgba(255, 255, 255, 0.1) !important;
  background:
    linear-gradient(135deg, rgba(40, 20, 80, 0.85), rgba(15, 10, 35, 0.92)) !important;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -2px 8px rgba(0, 0, 0, 0.4) !important;
  position: relative; overflow: hidden;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.2s, border-color 0.25s !important;
}
.menu-play-btn::before {
  content: '';
  position: absolute; top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transform: skewX(-20deg);
  animation: prShine 5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes prShine {
  0%, 80% { left: -60%; }
  100%    { left: 140%; }
}
.menu-play-btn:active { transform: scale(0.96) !important; }

.menu-play-btn .btn-icon {
  width: 52px !important; height: 52px !important;
  border-radius: 14px !important;
  font-size: 28px !important;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.4),
    inset 0 1px 2px rgba(255, 255, 255, 0.3),
    inset 0 -2px 6px rgba(0, 0, 0, 0.35) !important;
}
.menu-play-btn .btn-label {
  font-size: 17px !important; font-weight: 800 !important;
  letter-spacing: 0.02em;
}
.menu-play-btn .btn-desc {
  font-size: 11px !important;
  color: rgba(216, 180, 255, 0.55) !important;
  letter-spacing: 0.05em;
}

/* Per-button neon accent */
.btn-1p {
  border-color: rgba(168, 85, 247, 0.35) !important;
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(168, 85, 247, 0.15) inset,
    0 0 24px rgba(168, 85, 247, 0.2) !important;
}
.btn-1p .btn-icon {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 55%, #4c1d95 100%) !important;
}
.btn-2p {
  border-color: rgba(34, 211, 238, 0.35) !important;
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(34, 211, 238, 0.15) inset,
    0 0 24px rgba(34, 211, 238, 0.2) !important;
}
.btn-2p .btn-icon {
  background: linear-gradient(135deg, #0ea5e9 0%, #22d3ee 55%, #0c4a6e 100%) !important;
}
.btn-mp {
  border-color: rgba(251, 191, 36, 0.35) !important;
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(251, 191, 36, 0.18) inset,
    0 0 24px rgba(251, 191, 36, 0.18) !important;
}
.btn-mp .btn-icon {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 55%, #78350f 100%) !important;
}
.btn-watch {
  border-color: rgba(74, 222, 128, 0.35) !important;
}
.btn-watch .btn-icon {
  background: linear-gradient(135deg, #16a34a 0%, #4ade80 55%, #14532d 100%) !important;
}

/* ---------- Category chips (3HESS / 3HANCE / 3HAOS) ---------- */
#startMenu > div[style*="display:flex"][style*="gap:8px"] > div {
  border-radius: 14px !important;
  padding: 8px 14px !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.2s;
}

/* ---------- Section titles ---------- */
.menu-section-title {
  font-size: 10px !important;
  letter-spacing: 0.3em !important;
  color: rgba(216, 180, 255, 0.55) !important;
  padding-left: 4px !important;
  position: relative;
}
.menu-section-title::after {
  content: '';
  display: inline-block;
  width: 40px; height: 1px;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.6), transparent);
  margin-left: 10px; vertical-align: middle;
}

/* ---------- Category tabs (3HESS/3HANCE/3HAOS/3HASE) ---------- */
.cat-tab {
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
.cat-tab.active {
  color: #fff !important;
  border-bottom-width: 3px !important;
  text-shadow: 0 0 18px var(--cat-color, #a855f7);
}
.cat-tab .cat-emoji {
  font-size: 20px !important;
  filter: drop-shadow(0 0 6px var(--cat-color, #a855f7));
  transition: transform 0.25s;
}
.cat-tab.active .cat-emoji {
  transform: scale(1.1);
}

/* ---------- Mode cards ---------- */
.mode-card {
  border-radius: 18px !important;
  border: 1.5px solid rgba(255, 255, 255, 0.08) !important;
  background: linear-gradient(160deg, rgba(30, 18, 65, 0.85) 0%, rgba(12, 8, 36, 0.95) 100%) !important;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
  position: relative; overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.25s,
              border-color 0.25s !important;
}
.mode-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(168, 85, 247, 0.25), transparent 60%);
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.mode-card:hover::before,
.mode-card:active::before { opacity: 1; }
.mode-card:hover {
  transform: translateY(-2px);
  border-color: var(--cat-color, rgba(168, 85, 247, 0.55)) !important;
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.65),
    0 0 0 1px var(--cat-color, rgba(168, 85, 247, 0.3)),
    0 0 28px var(--cat-color, rgba(168, 85, 247, 0.28)) !important;
}
.mode-card:active { transform: scale(0.96) !important; }

.mode-card img {
  height: 100px !important;
  filter: saturate(1.1) contrast(1.05);
}
.mode-card .mode-info { padding: 10px 12px 12px !important; }
.mode-card .mode-name {
  font-size: 13px !important; font-weight: 800 !important;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.mode-card .mode-desc {
  font-size: 10px !important;
  color: rgba(216, 180, 255, 0.6) !important;
  line-height: 1.35 !important;
}
.mode-card .mode-icon {
  font-size: 22px !important;
  background: rgba(0, 0, 0, 0.65) !important;
  border-radius: 10px !important;
  padding: 3px 8px !important;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  backdrop-filter: blur(6px);
}

/* ---------- Rubric headers (sous-catégories) ---------- */
.rubric-header {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 2px 10px;
  padding: 8px 14px 8px 10px;
  position: relative;
  border-radius: 12px;
  background:
    linear-gradient(90deg,
      rgba(255, 255, 255, 0.04) 0%,
      rgba(255, 255, 255, 0.01) 100%);
  border-left: 3px solid var(--cat-color, #a855f7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.rubric-header::before {
  content: '';
  position: absolute; left: -3px; top: 0; bottom: 0; width: 3px;
  background: var(--cat-color, #a855f7);
  filter: blur(6px); opacity: 0.75;
}
.rubric-emoji {
  font-size: 22px;
  filter: drop-shadow(0 0 10px var(--cat-color, #a855f7));
  flex-shrink: 0;
}
.rubric-title {
  flex: 1;
  font-size: 13px; font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(90deg, #fff 0%, var(--cat-color, #d8b4ff) 140%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.rubric-count {
  font-size: 10px; font-weight: 800;
  padding: 3px 9px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--cat-color, rgba(168, 85, 247, 0.4));
  color: var(--cat-color, #d8b4ff);
  letter-spacing: 0.1em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 12px rgba(0, 0, 0, 0.3);
}

.mode-grid.rubricated .rubric-header:first-child { margin-top: 8px; }

/* Per-category tint on cards (uses data-cat attr if present, else via grid parent) */
.mode-card[data-cat="3hess"] { border-color: rgba(168, 85, 247, 0.18) !important; }
.mode-card[data-cat="3hance"] { border-color: rgba(34, 197, 94, 0.22) !important; }
.mode-card[data-cat="3haos"]  { border-color: rgba(239, 68, 68, 0.22) !important; }
.mode-card[data-cat="3hase"]  { border-color: rgba(245, 158, 11, 0.22) !important; }

/* ---------- Menu back header ---------- */
.mode-back {
  background: linear-gradient(180deg, rgba(6, 3, 15, 0.96), rgba(10, 7, 37, 0.85)) !important;
  border-bottom: 1px solid rgba(168, 85, 247, 0.18);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.mode-back button {
  font-size: 22px !important;
  padding: 6px 12px !important;
  border-radius: 10px !important;
  transition: background 0.2s;
}
.mode-back button:hover {
  background: rgba(168, 85, 247, 0.15) !important;
}
.mode-back span {
  font-size: 16px !important;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #fff, #d8b4ff);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Menu settings selects ---------- */
.menu-settings select {
  padding: 10px 12px !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, rgba(30, 18, 65, 0.8), rgba(12, 8, 36, 0.9)) !important;
  border: 1px solid rgba(168, 85, 247, 0.2) !important;
  color: #e9d5ff !important;
  font-size: 12px !important; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.menu-settings select:focus {
  outline: none;
  border-color: rgba(168, 85, 247, 0.55) !important;
  box-shadow:
    0 0 0 3px rgba(168, 85, 247, 0.15),
    0 0 18px rgba(168, 85, 247, 0.3);
}

/* ============================================================
   Stage cards (sélecteur de décor) — 3D hero preview
   ============================================================ */
#stageSelectScreen {
  background:
    radial-gradient(ellipse at top, rgba(75, 35, 145, 0.35), transparent 65%),
    linear-gradient(180deg, #05030f 0%, #0a0725 45%, #140933 100%) !important;
}
.stage-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  padding: 12px 16px 40px; width: 100%; max-width: 440px;
}
.stage-card {
  border-radius: 18px !important;
  border: 1.5px solid rgba(255, 255, 255, 0.08) !important;
  background: linear-gradient(160deg,
    color-mix(in srgb, var(--stage-tint, #a855f7) 18%, rgba(15, 10, 35, 0.9)) 0%,
    rgba(10, 6, 28, 0.95) 100%) !important;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
  overflow: hidden; position: relative;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.25s,
              border-color 0.25s !important;
}
.stage-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%,
    color-mix(in srgb, var(--stage-tint, #a855f7) 35%, transparent),
    transparent 60%);
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.stage-card:hover::before,
.stage-card:active::before { opacity: 1; }
.stage-card:hover {
  transform: translateY(-2px);
  border-color: var(--stage-tint, #a855f7) !important;
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.65),
    0 0 0 1px var(--stage-tint, #a855f7),
    0 0 30px color-mix(in srgb, var(--stage-tint, #a855f7) 40%, transparent) !important;
}
.stage-card:active { transform: scale(0.96) !important; }

.stage-art {
  position: relative;
  width: 100%; height: 120px;
  background:
    radial-gradient(ellipse at 50% 70%,
      color-mix(in srgb, var(--stage-tint, #a855f7) 25%, transparent) 0%,
      rgba(8, 5, 22, 0.85) 70%),
    radial-gradient(ellipse at 50% 30%,
      color-mix(in srgb, var(--stage-tint, #a855f7) 15%, transparent) 0%,
      transparent 60%);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.stage-art canvas {
  width: 100%; height: 100%; display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.stage-card:hover .stage-art canvas {
  transform: scale(1.08) rotate(-2deg);
}
.stage-art-fallback {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 54px;
  opacity: 0; pointer-events: none;
  filter: drop-shadow(0 0 18px var(--stage-tint, #a855f7));
  transition: opacity 0.3s;
}
.stage-card[data-thumb-failed="1"] .stage-art canvas { display: none; }
.stage-card[data-thumb-failed="1"] .stage-art-fallback { opacity: 1; }

.stage-card .stage-info { padding: 10px 12px 12px; }
.stage-card .stage-name {
  font-size: 14px; font-weight: 800;
  color: #fff;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.stage-card .stage-desc {
  font-size: 10px;
  color: rgba(216, 180, 255, 0.65);
  line-height: 1.35; margin-top: 2px;
}
.stage-card .stage-icon {
  top: 8px; right: 8px;
  font-size: 22px !important;
  background: rgba(0, 0, 0, 0.7) !important;
  border-radius: 10px !important;
  padding: 3px 8px !important;
  backdrop-filter: blur(6px);
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.6),
    0 0 0 1px color-mix(in srgb, var(--stage-tint, #a855f7) 45%, transparent) inset,
    0 0 14px color-mix(in srgb, var(--stage-tint, #a855f7) 40%, transparent);
}

.stage-header {
  background: linear-gradient(180deg, rgba(6, 3, 15, 0.96), rgba(10, 7, 37, 0.85)) !important;
  border-bottom: 1px solid rgba(168, 85, 247, 0.18);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.stage-header span {
  background: linear-gradient(135deg, #fff, #d8b4ff);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============================================================
   Odyssey menu — premium polish (complements odyssey_menu.js)
   ============================================================ */
#odysseyMenuScreen .ody-card {
  background:
    linear-gradient(140deg,
      rgba(60, 30, 120, 0.65) 0%,
      rgba(25, 12, 60, 0.92) 100%) !important;
  border: 1.5px solid rgba(168, 85, 247, 0.28) !important;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 18px rgba(168, 85, 247, 0.08) !important;
  backdrop-filter: blur(10px) saturate(130%);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.25s !important;
}
#odysseyMenuScreen .ody-card:hover:not(.locked) {
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(216, 180, 255, 0.25),
    0 0 30px rgba(168, 85, 247, 0.35) !important;
}
#odysseyMenuScreen .ody-card.current {
  border-color: rgba(216, 180, 255, 0.65) !important;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.6),
    0 0 32px rgba(168, 85, 247, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
  animation: prCurrentPulse 2.8s ease-in-out infinite;
}
@keyframes prCurrentPulse {
  0%, 100% { box-shadow: 0 10px 30px rgba(0,0,0,0.6), 0 0 32px rgba(168, 85, 247, 0.45); }
  50%      { box-shadow: 0 10px 34px rgba(0,0,0,0.65), 0 0 48px rgba(168, 85, 247, 0.7); }
}
#odysseyMenuScreen .ody-card.boss {
  background:
    linear-gradient(140deg,
      rgba(180, 30, 50, 0.6) 0%,
      rgba(60, 10, 40, 0.95) 100%) !important;
  border-color: rgba(244, 63, 94, 0.55) !important;
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.7),
    0 0 40px rgba(244, 63, 94, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}
#odysseyMenuScreen .ody-card.done {
  background:
    linear-gradient(140deg,
      rgba(16, 90, 60, 0.6) 0%,
      rgba(6, 40, 30, 0.9) 100%) !important;
  border-color: rgba(74, 222, 128, 0.45) !important;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.5),
    0 0 22px rgba(74, 222, 128, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}
#odysseyMenuScreen .ody-emoji {
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.6)) !important;
  font-size: 36px !important;
}
#odysseyMenuScreen .ody-card.boss .ody-emoji {
  filter: drop-shadow(0 0 14px rgba(244, 63, 94, 0.75)) !important;
  animation: prBossPulse 1.8s ease-in-out infinite;
}
@keyframes prBossPulse {
  0%, 100% { transform: scale(1)    rotate(0deg); }
  50%      { transform: scale(1.08) rotate(-3deg); }
}
#odysseyMenuScreen .ody-card.done .ody-emoji {
  filter: drop-shadow(0 0 10px rgba(74, 222, 128, 0.65)) !important;
}

/* ============================================================
   Ranking screen — premium trophy vibe
   ============================================================ */
#rankingOverlay {
  background:
    radial-gradient(circle at 50% 30%, rgba(168, 85, 247, 0.22), transparent 60%),
    radial-gradient(circle at 50% 80%, rgba(34, 211, 238, 0.12), transparent 65%),
    rgba(2, 0, 10, 0.94) !important;
  backdrop-filter: blur(18px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(140%) !important;
}
#rankingOverlay .pr-panel {
  background:
    linear-gradient(160deg, rgba(40, 20, 95, 0.85) 0%, rgba(10, 6, 30, 0.95) 100%);
  border: 1.5px solid rgba(168, 85, 247, 0.35);
  border-radius: 24px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(168, 85, 247, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  padding: 28px 24px 22px;
  max-width: 380px; width: 92%;
  backdrop-filter: blur(14px);
  position: relative; overflow: hidden;
}
#rankingOverlay .pr-panel::before {
  content: '';
  position: absolute; top: -1px; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216, 180, 255, 0.7), transparent);
}
#rankingOverlay .pr-title {
  font-size: 32px !important;
  font-weight: 900 !important;
  letter-spacing: 0.08em !important;
  text-align: center;
  margin: 0 0 4px !important;
}
#rankingOverlay .pr-subtitle {
  font-size: 12px;
  color: rgba(216, 180, 255, 0.65);
  letter-spacing: 0.25em;
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 18px;
}
#rankingOverlay .pr-score {
  font-size: 56px !important;
  font-weight: 900 !important;
  text-align: center;
  background: linear-gradient(135deg, #fff 0%, #ffd54a 45%, #f59e0b 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 40px rgba(255, 213, 74, 0.4);
  line-height: 1;
  margin: 6px 0 0;
}
#rankingOverlay .pr-score-label {
  font-size: 10px;
  letter-spacing: 0.35em;
  color: rgba(216, 180, 255, 0.5);
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 12px;
}
#rankingOverlay .pr-grade {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 76px; height: 76px;
  border-radius: 22px;
  font-size: 42px; font-weight: 900;
  background: linear-gradient(135deg, rgba(255, 213, 74, 0.22), rgba(168, 85, 247, 0.15));
  border: 2px solid currentColor;
  box-shadow:
    0 0 32px currentColor,
    inset 0 2px 6px rgba(255, 255, 255, 0.2),
    inset 0 -2px 6px rgba(0, 0, 0, 0.25);
  margin: 12px auto;
}
#rankingOverlay .pr-name-input {
  background: rgba(10, 6, 28, 0.6);
  border: 1.5px solid rgba(168, 85, 247, 0.35);
  border-radius: 12px;
  color: #fff;
  font-size: 22px; font-weight: 800;
  text-align: center; letter-spacing: 0.3em;
  padding: 10px 12px;
  width: 140px;
  text-transform: uppercase;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#rankingOverlay .pr-name-input:focus {
  outline: none;
  border-color: rgba(216, 180, 255, 0.75);
  box-shadow:
    0 0 0 4px rgba(168, 85, 247, 0.2),
    0 0 24px rgba(168, 85, 247, 0.45);
}
#rankingOverlay .pr-btn {
  padding: 12px 22px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  font-size: 14px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 6px 18px rgba(124, 58, 237, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.2s, box-shadow 0.25s;
}
#rankingOverlay .pr-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 10px 26px rgba(124, 58, 237, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
#rankingOverlay .pr-btn:active { transform: scale(0.96); }
#rankingOverlay .pr-btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

#rankingOverlay .pr-leaderboard {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid rgba(168, 85, 247, 0.18);
  max-height: 220px; overflow-y: auto;
}
#rankingOverlay .pr-lb-row {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  gap: 10px; align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  color: rgba(240, 235, 255, 0.85);
  transition: background 0.2s;
}
#rankingOverlay .pr-lb-row:hover { background: rgba(168, 85, 247, 0.08); }
#rankingOverlay .pr-lb-row.me {
  background: rgba(168, 85, 247, 0.18);
  box-shadow: inset 0 0 0 1px rgba(216, 180, 255, 0.35);
}
#rankingOverlay .pr-lb-rank {
  font-weight: 900; font-size: 13px;
  text-align: center;
}
#rankingOverlay .pr-lb-row.gold    .pr-lb-rank { color: var(--pr-gold); text-shadow: 0 0 8px var(--pr-gold); }
#rankingOverlay .pr-lb-row.silver  .pr-lb-rank { color: var(--pr-silver); text-shadow: 0 0 6px var(--pr-silver); }
#rankingOverlay .pr-lb-row.bronze  .pr-lb-rank { color: var(--pr-bronze); text-shadow: 0 0 6px var(--pr-bronze); }

/* ============================================================
   Pause menu
   ============================================================ */
#pauseMenuPanel {
  background:
    linear-gradient(160deg, rgba(30, 18, 65, 0.9) 0%, rgba(10, 6, 28, 0.96) 100%) !important;
  border: 1.5px solid rgba(168, 85, 247, 0.35) !important;
  border-radius: 22px !important;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.7),
    0 0 50px rgba(168, 85, 247, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}
#pauseMenuPanel button {
  background: rgba(168, 85, 247, 0.12) !important;
  border: 1px solid rgba(168, 85, 247, 0.3) !important;
  color: #e9d5ff !important;
  border-radius: 12px !important;
  font-weight: 700;
  transition: background 0.2s, transform 0.15s;
}
#pauseMenuPanel button:hover {
  background: rgba(168, 85, 247, 0.25) !important;
}
#pauseMenuPanel button:active { transform: scale(0.96); }

/* ============================================================
   Check alert banner (ÉCHEC)
   ============================================================ */
#checkInfo {
  background:
    linear-gradient(135deg, rgba(220, 38, 55, 0.92), rgba(150, 15, 30, 0.96)) !important;
  border: 1.5px solid rgba(255, 120, 130, 0.5) !important;
  box-shadow:
    0 0 50px rgba(244, 63, 94, 0.55),
    0 8px 22px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  text-shadow: 0 0 12px rgba(255, 200, 200, 0.65);
  letter-spacing: 0.2em;
}

/* ============================================================
   Scrollbar polish
   ============================================================ */
#modeSelectScreen::-webkit-scrollbar,
#startMenu::-webkit-scrollbar,
#rankingOverlay *::-webkit-scrollbar {
  width: 6px;
}
#modeSelectScreen::-webkit-scrollbar-thumb,
#startMenu::-webkit-scrollbar-thumb,
#rankingOverlay *::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.5), rgba(124, 58, 237, 0.5));
  border-radius: 3px;
}

/* ============================================================
   Small breakpoint tweaks
   ============================================================ */
@media (max-width: 380px) {
  .menu-title { font-size: 30px !important; }
  .menu-logo img { width: 112px !important; height: 112px !important; }
  .menu-play-btn { padding: 14px 16px !important; }
  .menu-play-btn .btn-icon { width: 46px !important; height: 46px !important; font-size: 24px !important; }
  .mode-card img { height: 84px !important; }
}
