/* Legal & Info — one footer entry point instead of a row of legal links.
   Kept in its own file so it stays isolated from the 200KB+ player-settings.css.

   Desktop: centred modal.
   Mobile:  bottom sheet that sits above the mobile bottom nav (z-index 100) and
            clears env(safe-area-inset-bottom) for the home indicator.

   The dimmed + blurred backdrop is a real overlay element, NOT filter:blur() on a
   parent. A filter on an ancestor creates a containing block, which would
   re-anchor the position:fixed overlay to the wrong box *and* blur the panel
   itself - the exact failure this avoids. The panel stays sharp because it is a
   sibling of the blurred background, not a child of it. */

.legal-info-overlay {
  position: fixed;
  inset: 0;
  z-index: 620;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 2, 12, .7);
  backdrop-filter: blur(8px) saturate(1.15);
  -webkit-backdrop-filter: blur(8px) saturate(1.15);
}
.legal-info-overlay.open { display: flex; }

.legal-info-panel {
  width: min(560px, 100%);
  max-height: min(82vh, 720px);
  display: flex;
  flex-direction: column;
  /* GLASS. The panel is translucent so the blurred page behind the overlay
     reads through it instead of sitting on top of it as an opaque slab.
     backdrop-filter lives on the panel itself, never on an ancestor of the
     position:fixed overlay - a filter up there re-anchors the overlay and
     blurs the panel too. Safe here because backdrop-filter only creates a
     containing block for FIXED descendants, and this panel has none.
     The inset top highlight is what sells it as glass: a lit edge. */
  background: linear-gradient(165deg, rgba(41, 30, 68, .58), rgba(13, 8, 26, .72));
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid rgba(167, 139, 250, .3);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .62), inset 0 1px 0 rgba(255, 255, 255, .1);
  overflow: hidden;
  animation: liIn .18s ease-out;
}
@keyframes liIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.legal-info-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  flex-shrink: 0;
}
.legal-info-head h2 {
  margin: 0;
  flex: 1;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .86);
  display: flex;
  align-items: center;
  gap: 8px;
}
.legal-info-head h2 i { color: #a78bfa; font-size: 11px; }

.legal-info-close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .05);
  color: rgba(255, 255, 255, .7);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s, color .18s, border-color .18s, box-shadow .18s;
}
.legal-info-close:hover,
.legal-info-close:focus-visible {
  background: rgba(239, 68, 68, .26);
  color: #fff;
  outline: none;
  border-color: rgba(248, 113, 113, .62);
  box-shadow: 0 0 16px rgba(239, 68, 68, .28);
}

.legal-info-body {
  padding: 6px 16px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.legal-info-sec { padding-top: 14px; }
.legal-info-sec + .legal-info-sec {
  border-top: 1px solid rgba(255, 255, 255, .05);
  margin-top: 12px;
}
.legal-info-sec h3 {
  margin: 0 0 7px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgba(196, 181, 253, .7);
}

.legal-info-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  margin-bottom: 2px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  color: rgba(255, 255, 255, .74);
  font-size: 12px;
  font-weight: 500;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s;
}
/* ============================================================================
   PER-ROW HOVER ACCENTS

   Each row used to share one violet hover, so every row felt identical and the
   panel read as an undifferentiated list. Each link now carries a data-accent and
   declares --accent as space-separated RGB channels, so the single hover rule
   below can tint the wash, border, left edge, glow and icon per row.

   Chosen to stay inside the site's existing palette (violet / cyan / amber /
   emerald on a near-black glass) while remaining distinguishable from each
   other, and so a destructive-sounding action does not glow green:
     terms=amber  privacy=cyan  dmca=violet  wanted=emerald  suggestions=yellow
     discord=indigo  account=sky  deletion=rose  roadmap=pink
   ========================================================================== */
.legal-info-link[data-accent="tos"]        { --accent: 245, 158, 11; }
.legal-info-link[data-accent="privacy"]    { --accent: 34, 211, 238; }
.legal-info-link[data-accent="dmca"]       { --accent: 167, 139, 250; }
.legal-info-link[data-accent="copyright"]  { --accent: 249, 115, 22; }
.legal-info-link[data-accent="wanted"]     { --accent: 52, 211, 153; }
.legal-info-link[data-accent="suggestions"]{ --accent: 250, 204, 21; }
.legal-info-link[data-accent="discord"]    { --accent: 129, 140, 248; }
.legal-info-link[data-accent="account"]    { --accent: 56, 189, 248; }
.legal-info-link[data-accent="deletion"]   { --accent: 251, 113, 133; }
.legal-info-link[data-accent="roadmap"]    { --accent: 244, 114, 182; }
/* Rows with no data-accent keep the original violet. */
.legal-info-link { --accent: 139, 92, 246; }

.legal-info-link:hover,
.legal-info-link:focus-visible {
  background: rgba(var(--accent), .26);
  border-color: rgba(var(--accent), .6);
  color: #fff;
  outline: none;
  box-shadow: inset 3px 0 0 rgb(var(--accent)), 0 0 20px rgba(var(--accent), .22);
}
.legal-info-link > i {
  width: 16px;
  text-align: center;
  font-size: 10px;
  /* Resting icon carries a faint version of its row's accent, so the pairing is
     hinted before hover rather than arriving as a surprise. */
  color: rgba(var(--accent), .68);
  flex-shrink: 0;
  transition: color .18s;
}
.legal-info-link:hover > i,
.legal-info-link:focus-visible > i { color: rgb(var(--accent)); }
.legal-info-link .li-go {
  margin-left: auto;
  font-size: 8px;
  opacity: .4;
  flex-shrink: 0;
  transition: opacity .18s, transform .18s;
}
.legal-info-link:hover .li-go,
.legal-info-link:focus-visible .li-go { opacity: 1; transform: translateX(3px); color: rgb(var(--accent)); }

.legal-info-foot {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, .06);
  font-size: 10px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .3);
  flex-shrink: 0;
}

/* Footer trigger */
.legal-info-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, .24);
  background: rgba(167, 139, 250, .08);
  color: rgba(221, 214, 254, .9);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.legal-info-trigger:hover,
.legal-info-trigger:focus-visible {
  background: rgba(167, 139, 250, .18);
  border-color: rgba(167, 139, 250, .45);
  color: #fff;
  outline: none;
}

/* Variant for the 999 Forever footer, where the surrounding links are plain
   small grey text. Kept as a pill with a hover so it still reads as the single
   entry point without fighting that quieter visual weight. */
.legal-info-trigger--footer{padding:4px 12px;font-size:11px;font-weight:500;letter-spacing:normal;border-color:transparent;background:transparent;color:rgba(255,255,255,.42);border-radius:8px}
.legal-info-trigger--footer:hover,.legal-info-trigger--footer:focus-visible{background:rgba(167,139,250,.1);border-color:transparent;color:#fff}

/* Footer brand block */
.legal-brand { text-align: center; }
.legal-brand-name {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .82);
}
.legal-brand-motto {
  margin-top: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: rgba(167, 139, 250, .62);
}

/* Mobile: bottom sheet */
@media (max-width: 768px) {
  .legal-info-overlay { padding: 0; align-items: flex-end; }
  .legal-info-panel {
    width: 100%;
    max-width: 100%;
    max-height: 76vh;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    margin-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
    animation: liSheet .2s ease-out;
    box-shadow: 0 -18px 50px rgba(0, 0, 0, .55);
  }
  @keyframes liSheet {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: none; }
  }
  .legal-info-head { padding: 12px 14px; }
  .legal-info-body { padding: 4px 12px 14px; }
}

/* player-settings.css has a deliberate mobile kill-switch:
     @media (max-width:767px){ *,::after,::before{ backdrop-filter:none!important; ... } }
   That is a real mobile performance optimisation and stays intact - undoing it
   site-wide would undo the scroll work. This sheet is opened deliberately by the
   user rather than scrolled past, and a dim-only backdrop reads as a flat grey
   wash, so this one element opts back in. Specificity wins because the
   !important weights match and a class outranks the universal selector. */
@media (max-width:767px){
  .legal-info-overlay{
    backdrop-filter:blur(8px) saturate(1.15) !important;
    -webkit-backdrop-filter:blur(8px) saturate(1.15) !important;
  }
  /* The panel needs the same opt-in as the overlay: without it the global
     kill-switch strips its blur and it renders as a flat translucent slab,
     which is worse than the opaque version it replaced. */
  .legal-info-panel{
    backdrop-filter:blur(18px) saturate(1.45) !important;
    -webkit-backdrop-filter:blur(18px) saturate(1.45) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .legal-info-panel { animation: none; }
  @media (max-width: 768px) { .legal-info-panel { animation: none; } }
}