/* public/style.css - remplace entièrement ce fichier */

body { background:#0b0b0f; color:#eee; font-family: Inter, Arial, sans-serif; text-align:center; min-height:100vh; position:relative; padding-bottom:60px; }
.app { max-width:960px; margin:20px auto; padding:10px; }

/* neon title */
#appTitle { font-size:36px; margin:6px 0 18px; color:#e9e7ff; letter-spacing:1px; }
#appTitle.neon {
  color: #e9e7ff;
  text-shadow:
    0 0 6px rgba(123,48,217,0.9),
    0 0 12px rgba(123,48,217,0.6),
    0 0 24px rgba(171,107,255,0.25);
  font-weight:800;
}

#playerListTitle { font-size:17px; margin-top: 50px; color:#e9e7ff; letter-spacing:1px; }
#playerListTitle.neon {
  color: #e9e7ff;
  text-shadow:
    0 0 6px rgba(123,48,217,0.9),
    0 0 12px rgba(123,48,217,0.6),
    0 0 24px rgba(171,107,255,0.25);
  font-weight:500;
}

/* LOBBY CARD - responsive improved */
/* increased gap to give more breathing room between create/join columns */
.lobby-card {
  display:flex;
  gap:36px; /* increased space between left and right */
  justify-content:space-between;
  align-items:stretch;
  background: linear-gradient(180deg,#0f0e13,#14121a);
  border-radius:12px;
  padding:18px;
  box-shadow: 0 20px 60px rgba(6,6,10,0.6);
  margin: 8px auto 18px;
  max-width:920px;
  flex-wrap:wrap;
}
.lobby-left, .lobby-right { flex:1 1 420px; min-width:320px; }
.lobby-creator { display:flex; flex-direction:column; gap:8px; align-items:flex-start; width:100%; }
.field-label { font-size:13px; color:#cfcffa; opacity:0.85; text-transform:uppercase; letter-spacing:0.6px; margin-bottom:4px; }
#nameInput, #joinCode, #roundsInput { width:100%; padding:10px 12px; border-radius:8px; border:1px solid rgba(255,255,255,0.04); background: rgba(255,255,255,0.02); color:#fff; outline:none; }
#nameInput::placeholder, #joinCode::placeholder { color: rgba(255,255,255,0.26); }
.join-row { display:flex; gap:8px; margin-top:6px; align-items:center; }
.join-row input { flex:1; }
.primary, .secondary {
  padding:10px 14px; border:none; border-radius:8px; cursor:pointer; font-weight:600; box-shadow: 0 10px 30px rgba(123,48,217,0.08);
}
.primary { background: linear-gradient(90deg,#7f2bff,#b36bff); color:#fff; }
.secondary { background: linear-gradient(90deg,#2b2f39,#3a3f4a); color:#fff; }

/* responsive: stack nicely on narrow widths */
@media (max-width:820px) {
  .lobby-card { flex-direction:column; gap:16px; padding:14px; }
  .lobby-left, .lobby-right { min-width:0; flex-basis:100%; }
  .join-row { flex-direction:row; }
}

/* lobby info box */
.lobby-info { margin-top:12px; text-align:left; color:#dcd9ff; font-size:14px; }
.lobby-status {
  background: linear-gradient(180deg,#101018,#16161d);
  padding:10px; border-radius:10px; border:1px solid rgba(255,255,255,0.03);
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  flex-wrap:wrap;
}
.lobby-status .left { display:flex; flex-direction:column; gap:4px; min-width:150px; }
.lobby-status .small { font-size:13px; color:#bfbbe6; opacity:0.95; }

/* host code capsule */
.host-code {
  display:flex;
  gap:8px;
  align-items:center;
}
.code-pill {
  padding:8px 12px;
  border-radius:8px;
  font-weight:800;
  letter-spacing:2px;
  background: linear-gradient(90deg,#0f0b1a,#1a0f2b);
  border:1px solid rgba(155,107,255,0.14);
  box-shadow: 0 8px 30px rgba(107,45,185,0.08);
  user-select: all;
}
.code-hidden {
  filter: blur(4px);
  opacity:0.85;
}

/* copy & toggle buttons */
.btn-inline {
  padding:8px 10px; border-radius:8px; border:none; cursor:pointer; font-size:13px; font-weight:600;
}
.btn-toggle { background: rgba(255,255,255,0.04); color:#ddd; }
.btn-copy { background: linear-gradient(90deg,#6b2df5,#ab6bff); color:#fff; }

/* top bar in-game */
.game-topbar { width:100%; display:flex; justify-content:flex-end; padding:8px 0 12px 0; max-width:880px; margin: 0 auto 6px; }
.host-code-game-wrap { display:flex; gap:8px; align-items:center; background: rgba(255,255,255,0.02); padding:6px 10px; border-radius:999px; border:1px solid rgba(255,255,255,0.03); }

/* helper text */
.helper { font-size:13px; color:#cfcaf0; opacity:0.9; margin-top:8px; }

/* rules card (updated - prettier list) */
/* ensure rules-card spans full width at bottom of lobby-card */
.rules-card {
  margin-top:14px;
  background: linear-gradient(180deg,#0b0b10,#111019);
  padding:14px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.04);
  color:#dcd9ff;
  text-align:left;
  font-size:14px;
  box-shadow: 0 8px 30px rgba(6,6,10,0.45);
  flex: 1 1 100%;
  order: 99; /* keep it visually at the bottom */
}

/* header */
.rules-card h3 {
  display:flex;
  align-items:center;
  gap:10px;
  margin:0 0 12px 0;
  font-size:16px;
  color:#f7f4ff;
  letter-spacing:0.4px;
}

/* styled ordered list with numbered badges */
.rules-list {
  list-style:none;
  padding:0;
  margin:0;
  counter-reset: rule;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.rules-list li {
  counter-increment: rule;
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding:12px;
  border-radius:10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0.01));
  border:1px solid rgba(255,255,255,0.02);
  transition: transform 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 6px 18px rgba(6,6,10,0.35);
}
.rules-list li:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(6,6,10,0.55);
}

/* numeric badge on the left */
.rules-list li::before {
  content: counter(rule);
  min-width:36px;
  height:36px;
  line-height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  color: #111;
  background: linear-gradient(90deg,#ffd36b,#ffb74d);
  border-radius:9px;
  box-shadow: 0 8px 30px rgba(255,183,77,0.08);
  flex-shrink:0;
  font-size:14px;
}

/* subtle alternating rows for readability */
.rules-list li:nth-child(odd) {
  background: linear-gradient(180deg, rgba(255,255,255,0.012), rgba(255,255,255,0.008));
}
.rules-list li:nth-child(even) {
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.005));
}

/* main text inside a rule; allow multi-line */
.rules-list li {
  font-size:14px;
  color:#e9e7ff;
}
.rules-list li strong { font-weight:800; color:#ffd36b; }

/* highlight the "dépasser" word in rules */
.rules-list li .danger { color:#ff6b6b; font-weight:800; }

/* adapt on small screens: stack badge above text */
@media (max-width:520px) {
  .rules-list li {
    flex-direction:row;
    gap:10px;
    align-items:flex-start;
    padding:10px;
  }
}

/* --- CONNECTION WARNING (added) --- */
.connection-warning {
  margin-top:14px;
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border-radius:10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border:1px solid rgba(255,255,255,0.03);
  color:#efeaff;
  font-size:13px;
}

/* left column inside warning */
.connection-warning .conn-left {
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

/* icon inherits currentColor to adapt to status classes */
.conn-icon { width:28px; height:28px; display:block; fill: currentColor; flex:0 0 28px; }

/* text block */
.conn-text { text-align:left; min-width:0; }
.conn-title { font-weight:700; font-size:13px; color:#efeaff; }
.conn-status { font-weight:800; font-size:14px; color:#ffd36b; margin-top:2px; }

/* meta (right side) */
.conn-meta { font-size:12px; color:#cfcff0; opacity:0.95; }

/* status colors via classes on container */
.connection-warning.conn-good { color:#39b54a; background: linear-gradient(180deg, rgba(57,181,74,0.06), rgba(255,255,255,0.01)); border-color: rgba(57,181,74,0.12); }
.connection-warning.conn-fair { color:#ffb347; background: linear-gradient(180deg, rgba(255,179,71,0.04), rgba(255,255,255,0.01)); border-color: rgba(255,179,71,0.12); }
.connection-warning.conn-poor { color:#ff6b6b; background: linear-gradient(180deg, rgba(255,107,107,0.04), rgba(255,255,255,0.01)); border-color: rgba(255,107,107,0.12); }
.connection-warning.conn-unknown { color:#bfbbe6; background: linear-gradient(180deg, rgba(191,187,230,0.02), rgba(255,255,255,0.01)); border-color: rgba(191,187,230,0.04); }

/* small screens tweak for connection box */
@media (max-width:640px) {
  .connection-warning { flex-direction:column; align-items:flex-start; gap:8px; }
  .conn-meta { align-self:stretch; text-align:left; }
}

/* video + round + timeline */
/* Container keeps fixed area; video is forced to fill the container and will scale up if smaller */
#video-container { width:880px; max-width:calc(100% - 40px); height:496px; margin: 12px auto; background:#000; display:flex; align-items:center; justify-content:center; overflow:hidden; border-radius:12px; box-shadow:0 6px 40px rgba(107,45,185,0.18); position:relative; }
/* IMPORTANT: width/height 100% + object-fit:contain => small videos are scaled up to fit the container while preserving aspect ratio */
#video-container video { width:100%; height:100%; object-fit:contain; border-radius:8px; }

/* PLAYER OVERLAY */
.player-overlay {
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background: linear-gradient(180deg, rgba(2,2,6,0.65), rgba(8,6,14,0.35));
  z-index: 12;
  pointer-events: none; /* overlay non-interactive */
}
.player-overlay-text {
  font-size:20px;
  font-weight:800;
  color:#e9e7ff;
  padding:12px 18px;
  border-radius:10px;
  background: rgba(16,10,30,0.6);
  box-shadow:
    0 0 20px rgba(123,48,217,0.12),
    0 6px 30px rgba(6,6,10,0.6);
  text-shadow: 0 0 8px rgba(171,107,255,0.18);
}

/* round info (custom) */
#roundInfo { display:flex; align-items:center; justify-content:center; gap:12px; margin-top:6px; margin-bottom:8px; flex-wrap:wrap; }
.round-title { font-size:14px; color:#cfcffa; text-transform:uppercase; opacity:0.9; }
.round-number { font-size:20px; font-weight:700; color:#fff; background:linear-gradient(90deg,#6b2df5,#ab6bff); padding:6px 12px; border-radius:8px; box-shadow: 0 6px 18px rgba(107,45,185,0.12); }
.round-total { font-size:14px; color:#bfbcff; opacity:0.8; }

/* TIMELINE (redesign) */
#timeline-container { width:880px; max-width:calc(100% - 40px); margin:10px auto; }
#timeline-background {
  --timeline-height:14px;
  --timeline-radius:10px;
  --progress-glow: 0 8px 30px rgba(123,48,217,0.12);
  position:relative;
  height: var(--timeline-height);
  background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border-radius: var(--timeline-radius);
  box-shadow: inset 0 0 18px rgba(58,10,106,0.18);
  overflow:hidden;
  cursor: pointer;
  margin: 0 auto;
}

/* progress fill that grows from left to right (width updated via JS) */
#progressFill {
  position:absolute;
  left:0; top:0; bottom:0;
  width:0%;
  border-radius: var(--timeline-radius);
  background: linear-gradient(90deg,#7f2bff,#b36bff);
  box-shadow: var(--progress-glow);
  z-index:2;
  pointer-events:none;
  opacity:0.95;
  transition: none !important;
  will-change: width;
}

/* graduations — using the inner element so scripts can toggle visibility if needed */
#graduations {
  position:absolute;
  left:0; right:0; top:0; bottom:0;
  z-index:1;
  pointer-events:none;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)),
    repeating-linear-gradient(to right,
      rgba(255,255,255,0.03) 0px,
      rgba(255,255,255,0.03) 1px,
      transparent 1px,
      transparent 20px
    );
  background-size: auto 100%, 100% 100%;
  opacity:0.9;
}

/* cursor: vertical indicator with a top handle circle for clarity */
#cursor {
  position:absolute;
  top:50%;
  transform: translateY(-50%);
  left:0%;
  width:2px;
  height:calc(var(--timeline-height) + 18px);
  border-radius:2px;
  background:#9b6bff;
  box-shadow:0 0 12px rgba(155,107,255,0.85), 0 0 28px rgba(155,107,255,0.12);
  z-index:4;
  pointer-events:none;
  transition: none !important;
  will-change: left;
}
#cursor::before {
  content:'';
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  top:-10px;
  width:14px;
  height:14px;
  border-radius:50%;
  background:linear-gradient(90deg,#fff,#d9cfff);
  box-shadow: 0 6px 20px rgba(155,107,255,0.14), 0 0 18px rgba(155,107,255,0.22);
}

/* limit marker (where the target time is) */
#limit-marker {
  position:absolute;
  top:-6px;
  width:2px;
  height:calc(var(--timeline-height) + 24px);
  border-radius:2px;
  background:#ff5b5b;
  box-shadow:0 0 10px #ff5b5b, 0 6px 20px rgba(255,91,91,0.08);
  z-index:5;
  display:none;
  pointer-events:none;
}
#limit-marker::after {
  content:'';
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  top:-22px;
  width:8px;
  height:8px;
  border-radius:50%;
  background:#ff5b5b;
  box-shadow:0 0 14px rgba(255,91,91,0.9);
}

/* time labels below timeline */
#timeLabels {
  display:flex;
  justify-content:space-between;
  font-size:12px;
  color:#bfbbe6;
  margin-top:8px;
  max-width:880px;
  margin-left:auto;
  margin-right:auto;
  gap:8px;
  padding:0 6px;
}
#timeLabels span { user-select:none; }

/* main button & timer */
#actionBtn { padding:14px 28px; font-size:16px; background:linear-gradient(90deg,#7f2bff,#b36bff); color:#fff; border:none; border-radius:10px; cursor:pointer; box-shadow: 0 8px 24px rgba(123,48,217,0.18); }
#actionBtn:disabled { background:#222; cursor:not-allowed; color:#888; box-shadow:none; }
#timer { font-family: 'Roboto Mono', monospace; margin-top:12px; font-size:22px; background: rgba(255,255,255,0.03); display:inline-block; padding:6px 10px; border-radius:8px; color:#e9defc; box-shadow: inset 0 -2px 6px rgba(0,0,0,0.4); }

/* players list */
.players-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 8px auto 12px;
  max-width: 880px;
}
.playerTag {
  background: linear-gradient(180deg,#14121a,#0e0d10);
  border: 1px solid rgba(255,255,255,0.04);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
  color: #ddd;
  box-shadow: 0 6px 18px rgba(107,45,185,0.06);
  display:flex;
  gap:8px;
  align-items:center;
}
.playerTag .order { opacity: 0.7; margin-right: 6px; }
.playerTag.active { outline: 2px solid rgba(155,107,255,0.45); color: #fff; }
.playerTag.done { border-color: rgba(58,125,42,0.35); box-shadow: 0 6px 18px rgba(58,125,42,0.06); color: #b6ffb6; }

/* tag pill next to player name (no brackets) */
.playerBadge {
  background: rgba(255,255,255,0.03);
  padding: 4px 8px;
  border-radius: 6px;
  font-weight:700;
  font-size:12px;
  color:#ffd36b;
  border: 1px solid rgba(255,211,107,0.08);
}

/* --- Specific tag colors requested --- 
   Founder (anglais) / Fondateur (français) -> rouge
   Friend (anglais)  / Ami (français)       -> vert
   On fournit les 4 classes pour compatibilité. */
.playerBadge.tag-founder,
.playerBadge.tag-fondateur {
  background: linear-gradient(180deg,#8a0b0b,#5a0404);
  color: #fff;
  border: 1px solid rgba(255,80,80,0.12);
  box-shadow: 0 6px 18px rgba(170,50,50,0.06);
}

.playerBadge.tag-friend,
.playerBadge.tag-ami {
  background: linear-gradient(180deg,#0b8a26,#056a17);
  color: #fff;
  border: 1px solid rgba(80,255,120,0.12);
  box-shadow: 0 6px 18px rgba(30,140,70,0.06);
}

/* crown for host (with tooltip via title attr) */
.hostCrown { margin-right:6px; font-size:16px; }

/* style pour joueur qui a dépassé */
.playerTag.over { border-color: #8a0b0b; box-shadow: 0 6px 18px rgba(255,77,77,0.08); color: #ffb6b6; background: linear-gradient(180deg,#2a0a0a,#180606); }

/* overlay recap */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(4,4,10,0.65);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index: 9999;
}
.overlay-content {
  width: 680px;
  max-width: calc(100% - 48px);
  background: linear-gradient(180deg,#0f0e13,#18161c);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(6,6,10,0.6);
  color: #f0edf8;
  text-align:left;
}
.overlay-content h2 { margin:0 0 12px; color:#fff; }
.summary-row { display:flex; justify-content:space-between; padding:8px 0; border-bottom:1px dashed rgba(255,255,255,0.03); }
.summary-row .left { display:flex; gap:10px; align-items:center; }
.summary-row .name { font-weight:600; }
.summary-row .meta { font-size:13px; color:#cfcff0; opacity:0.9; }
#nextRoundBtn { margin-top:12px; padding:10px 16px; background:linear-gradient(90deg,#6b2df5,#ab6bff); color:#fff; border:none; border-radius:8px; cursor:pointer; }
#nextRoundBtn:disabled { background:#333; cursor:not-allowed; color:#777; }

/* podium styles (final leaderboard) */
.podium { display:flex; gap:18px; justify-content:center; align-items:flex-end; margin-top:12px; }
.podium .pod {
  width:160px;
  display:flex;
  flex-direction:column;
  align-items:center;
}
.pod .rank {
  width:100%;
  height:100px;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  font-weight:900;
  font-size:20px;
  color:#111;
  border-radius:8px 8px 0 0;
}
.pod .name { margin-top:10px; font-weight:800; color:#fff; display:flex; gap:8px; align-items:center; }
.pod .pts { margin:4px 0 0 0; color:#ffd36b; font-weight:800; }

/* sizes */
.pod.first .rank { height:160px; background: linear-gradient(90deg,#ffd36b,#ffb74d); box-shadow: 0 18px 60px rgba(255,183,77,0.12); }
.pod.second .rank { height:120px; background: linear-gradient(90deg,#c0c0c0,#8f8f8f); box-shadow: 0 12px 36px rgba(150,150,150,0.08); }
.pod.third .rank { height:100px; background: linear-gradient(90deg,#d9a46a,#b07a3f); box-shadow: 0 8px 26px rgba(176,122,63,0.06); }

/* FINAL LEADERBOARD container */
#finalLeaderboard {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg,#07060a,#0f0e13);
  color: #fff;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index: 9998;
}
.final-container {
  width: min(1000px, 92%);
  background: linear-gradient(180deg,#13121a,#0f0e13);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7);
  text-align:center;
}
.final-container h2 { margin:0 0 16px; font-size:28px; }
.final-row { display:flex; justify-content:space-between; padding:10px 14px; border-bottom:1px solid rgba(255,255,255,0.03); font-size:18px; }
.final-row .pos { font-weight:700; width:60px; text-align:left; }
.final-row .name { flex:1; text-align:left; padding-left:8px; }
.final-row .pts { width:120px; text-align:right; font-weight:800; color:#ffd36b; }
#backHomeBtn { margin-top:18px; padding:10px 18px; background:linear-gradient(90deg,#7f2bff,#b36bff); color:#fff; border:none; border-radius:8px; cursor:pointer; }

/* footer */
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 12px;
  text-align: center;
  font-size:13px;
  color: #cfcff0;
  opacity:0.75;
  pointer-events: none;
  user-select: none;
  z-index: 2000;
}

/* small responsive tweaks for timeline on narrow screens */
@media (max-width:920px) {
  #video-container { height:420px; }
  #timeline-container, #timeline-background, #timeLabels { max-width:calc(100% - 28px); }
}

@media (max-width:520px) {
  #video-container { height:320px; }
  #appTitle { font-size:28px; }
  .site-footer { font-size:12px; bottom:8px; }
}

/* -------------------------------------------------------------------
   FULLSCREEN TRANSITION OVERLAY
   - .title-overlay : full screen dark gradient with blurred background
   - .title-anim : centered card with neon text and sweep animation
   - used by client.js showTitleOverlay(...) (adds/removes .active)
   ------------------------------------------------------------------- */

.title-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient( circle at 30% 20%, rgba(123,48,217,0.06), transparent 10%),
              linear-gradient(180deg, rgba(3,3,6,0.85), rgba(8,6,14,0.95));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 360ms ease, visibility 360ms ease;
  backdrop-filter: blur(2px) saturate(1.05);
}

/* when active -> visible + allow interaction blocking */
.title-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* the animated card */
.title-anim {
  width: min(920px, 88%);
  max-width: 920px;
  padding: 34px 36px;
  border-radius: 14px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transform: translateY(8px) scale(0.98);
  background: linear-gradient(180deg, rgba(20,12,30,0.75), rgba(10,6,18,0.6));
  box-shadow:
    0 30px 80px rgba(7,4,20,0.8),
    0 8px 30px rgba(123,48,217,0.08);
  border: 1px solid rgba(155,107,255,0.08);
  transition: transform 420ms cubic-bezier(.2,.9,.3,1), box-shadow 420ms ease;
  will-change: transform, opacity;
}

/* enlarged + glowing when overlay active */
.title-overlay.active .title-anim {
  transform: translateY(0) scale(1);
  box-shadow:
    0 40px 120px rgba(7,4,20,0.9),
    0 18px 60px rgba(123,48,217,0.14);
}

/* Main title neon */
.title-anim .title-main {
  font-size: 48px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 1px;
  margin-bottom: 6px;
  text-transform: none;
  text-shadow:
    0 0 16px rgba(171,107,255,0.18),
    0 0 34px rgba(123,48,217,0.16),
    0 10px 40px rgba(8,6,14,0.6);
}

/* Subtitle */
.title-anim .title-sub {
  font-size: 16px;
  color: rgba(220,215,255,0.95);
  opacity: 0.95;
  margin-bottom: 10px;
}

/* thin sweep effect sliding across */
.title-anim .sweep {
  position: absolute;
  left: -120%;
  top: 0;
  width: 220%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.06) 45%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 55%, rgba(255,255,255,0) 100%);
  transform: skewX(-12deg);
  opacity: 0;
}

/* sparkles layer (subtle particle-like dots) */
.title-anim .sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 10% 20%, rgba(255,255,255,0.06) 0px, transparent 6px),
                    radial-gradient(circle at 80% 40%, rgba(255,255,255,0.04) 0px, transparent 6px),
                    radial-gradient(circle at 40% 80%, rgba(255,255,255,0.02) 0px, transparent 6px);
  mix-blend-mode: screen;
  opacity: 0;
}

/* active animations */
.title-overlay.active .sweep {
  animation: sweepMove 1100ms cubic-bezier(.22,.9,.3,1);
  opacity: 1;
}
.title-overlay.active .sparkles {
  animation: sparkPop 1000ms linear;
  opacity: 1;
}

/* small pop on open */
@keyframes sweepMove {
  0% { left: -120%; transform: skewX(-12deg) scale(1); opacity: 0; }
  30% { opacity: 0.6; }
  60% { left: 10%; opacity: 1; transform: skewX(-6deg) scale(1.02); }
  100% { left: 120%; opacity: 0; transform: skewX(0deg) scale(1); }
}

/* quick sparkle fade */
@keyframes sparkPop {
  0% { opacity: 0; transform: translateY(6px) scale(0.98); filter: blur(6px); }
  40% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  100% { opacity: 0.6; transform: translateY(-6px) scale(1.02); filter: blur(2px); }
}

/* small screens tweak */
@media (max-width:520px) {
  .title-anim { padding: 20px; border-radius:10px; }
  .title-anim .title-main { font-size: 28px; }
  .title-anim .title-sub { font-size:13px; }
}
