/* ==========================================================================
   Flagship Motion & Lighting System (`motion.css`)
   4 Cohesive GPU-Only Systems:
     1. Living Reactive Atmosphere (persistent full-viewport canvas + obsidian glass)
     2. Precision Cursor-Tracked 1.5px Metallic Border Rim-Light & Weighted Hover
     3. Post-Data Cinematic Entrance Choreography (850ms unified cascade + bar/count ignition)
     4. Liquid Persistent Navigation Indicators & Bug-Free GPU Roster Hover Bar
   ========================================================================== */

:root {
  --clan-aura: #F0B429;
  --clan-aura-secondary: #FDE68A;
  --clan-aura-glow: rgba(240, 180, 41, 0.38);
  --clan-aura-soft: rgba(240, 180, 41, 0.14);
  --clan-aura-rgb: 240, 180, 41;
  --ease-cascade: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-weighted-out: cubic-bezier(0.33, 1, 0.68, 1);
}

/* ── 0. High-FPS Full-Screen 3-Act Broadcast Intro (#abIntroStage) ───────── */
html.ab-intro-lock,
body.ab-intro-lock {
  overflow: hidden !important;
  scrollbar-width: none;
}

html.ab-intro-lock::-webkit-scrollbar,
body.ab-intro-lock::-webkit-scrollbar {
  display: none;
}

/* Skip hidden backdrop-filter blur rasterization behind the opaque Act I/II veil */
html.ab-intro-veil .sidebar,
html.ab-intro-veil .topbar,
html.ab-intro-veil .subbar,
html.ab-intro-veil .launchpad {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.ab-intro-stage {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  background: #080A0F;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  contain: strict;
}

.ab-intro-camera {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  will-change: transform;
}

.ab-intro-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

/* Sleek Dark Cinema Letterbox Bars (desktop only; retract cleanly on Act III exit) */
.ab-cinema-bar {
  position: fixed;
  left: 0;
  right: 0;
  height: 4.5vh;
  background: #040508;
  z-index: 4;
  pointer-events: none;
  will-change: transform;
  transition: transform 340ms var(--ease-cascade);
}

.ab-cinema-bar-top {
  top: 0;
  border-bottom: 1px solid rgba(255, 242, 198, 0.08);
  transform: translate3d(0, 0, 0);
}

.ab-cinema-bar-bottom {
  bottom: 0;
  border-top: 1px solid rgba(255, 242, 198, 0.08);
  transform: translate3d(0, 0, 0);
}

.ab-intro-stage.is-act3-exit .ab-cinema-bar-top {
  transform: translate3d(0, -108%, 0);
}

.ab-intro-stage.is-act3-exit .ab-cinema-bar-bottom {
  transform: translate3d(0, 108%, 0);
}

@media (max-width: 767px) {
  .ab-cinema-bar {
    display: none;
  }
}

/* Subtle 10px architectural corner framing brackets */
.ab-intro-frame {
  position: absolute;
  inset: max(20px, env(safe-area-inset-top, 20px))
         max(20px, env(safe-area-inset-right, 20px))
         max(20px, env(safe-area-inset-bottom, 20px))
         max(20px, env(safe-area-inset-left, 20px));
  z-index: 2;
  pointer-events: none;
}

@media (min-width: 768px) {
  .ab-intro-frame {
    inset: calc(4.5vh + 16px) 28px;
  }
}

.ab-corner {
  position: absolute;
  width: 10px;
  height: 10px;
  opacity: 0;
  border-color: rgba(255, 242, 198, 0.20);
  border-style: solid;
  border-width: 0;
  will-change: transform, opacity;
  transition:
    opacity 400ms var(--ease-cascade),
    transform 440ms var(--ease-cascade);
}

.ab-corner-tl {
  top: 0;
  left: 0;
  border-top-width: 1px;
  border-left-width: 1px;
  transform: translate3d(-6px, -6px, 0);
}

.ab-corner-tr {
  top: 0;
  right: 0;
  border-top-width: 1px;
  border-right-width: 1px;
  transform: translate3d(6px, -6px, 0);
}

.ab-corner-bl {
  bottom: 0;
  left: 0;
  border-bottom-width: 1px;
  border-left-width: 1px;
  transform: translate3d(-6px, 6px, 0);
}

.ab-corner-br {
  bottom: 0;
  right: 0;
  border-bottom-width: 1px;
  border-right-width: 1px;
  transform: translate3d(6px, 6px, 0);
}

.ab-intro-frame.is-drawn .ab-corner {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.ab-intro-stage.is-act3-exit .ab-corner {
  opacity: 0;
  transition-duration: 220ms;
}
.ab-intro-stage.is-act3-exit .ab-corner-tl { transform: translate3d(-12px, -12px, 0); }
.ab-intro-stage.is-act3-exit .ab-corner-tr { transform: translate3d(12px, -12px, 0); }
.ab-intro-stage.is-act3-exit .ab-corner-bl { transform: translate3d(-12px, 12px, 0); }
.ab-intro-stage.is-act3-exit .ab-corner-br { transform: translate3d(12px, 12px, 0); }

/* Full-Screen Commanding Hero Centerpiece */
.ab-intro-center {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 2.2vh, 26px);
  padding: 0 24px;
  margin-top: -3vh;
  max-width: 100vw;
  pointer-events: none;
  will-change: transform, opacity;
  transition:
    transform 320ms var(--ease-cascade),
    opacity 300ms var(--ease-cascade);
}

@media (max-width: 520px) {
  .ab-intro-center {
    padding: 0 12px;
    gap: 18px;
  }
}

.ab-intro-stage.is-act3-exit .ab-intro-center {
  transform: scale(1.14);
  opacity: 0;
}

/* Heroic Forged-Metal Crest (clamp(125px, 16vw, 200px), pure GPU transform/opacity) */
.ab-intro-crest-wrap {
  width: clamp(125px, 16vw, 200px);
  height: clamp(125px, 16vw, 200px);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.92);
  will-change: transform, opacity;
  transition:
    opacity 220ms var(--ease-cascade),
    transform 480ms var(--ease-cascade);
}

.ab-intro-crest-wrap.is-forging {
  opacity: 1;
  transform: scale(1);
}

.ab-intro-crest {
  width: 100%;
  height: 100%;
  overflow: visible;
}

@keyframes abLaserTrace {
  from {
    stroke-dashoffset: 100;
    opacity: 0.35;
  }
  to {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

@keyframes abFacetsIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes abCrestGleamSweep {
  0% {
    transform: translate3d(-55px, 0, 0) skewX(-24deg);
    opacity: 0;
  }
  16% {
    opacity: 1;
  }
  84% {
    opacity: 0.92;
  }
  100% {
    transform: translate3d(280px, 0, 0) skewX(-24deg);
    opacity: 0;
  }
}

.ab-crest-path {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  opacity: 0;
}

.ab-crest-facets {
  opacity: 0;
}

.ab-crest-gleam {
  opacity: 0;
  transform: translate3d(-55px, 0, 0) skewX(-24deg);
}

.ab-intro-crest-wrap.is-forging .ab-p1 {
  animation: abLaserTrace 400ms var(--ease-cascade) 0ms forwards;
}
.ab-intro-crest-wrap.is-forging .ab-p2 {
  animation: abLaserTrace 380ms var(--ease-cascade) 50ms forwards;
}
.ab-intro-crest-wrap.is-forging .ab-p3 {
  animation: abLaserTrace 290ms var(--ease-cascade) 105ms forwards;
}
.ab-intro-crest-wrap.is-forging .ab-p4 {
  animation: abLaserTrace 360ms var(--ease-cascade) 115ms forwards;
}
.ab-intro-crest-wrap.is-forging .ab-p5 {
  animation: abLaserTrace 280ms var(--ease-cascade) 175ms forwards;
}
.ab-intro-crest-wrap.is-forging .ab-p6 {
  animation: abLaserTrace 300ms var(--ease-cascade) 215ms forwards;
}
.ab-intro-crest-wrap.is-forging .ab-crest-facets {
  animation: abFacetsIn 340ms ease-out 210ms forwards;
}
.ab-intro-crest-wrap.is-gleaming .ab-crest-gleam {
  animation: abCrestGleamSweep 400ms var(--ease-cascade) forwards;
}

/* Authoritative Cinema Title (GPU-only transform/opacity unmask, zero S clipping!) */
.ab-intro-wordmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.1vh, 14px);
  text-align: center;
  max-width: 100%;
}

.ab-intro-title-mask {
  overflow-x: visible;
  overflow-y: clip;
  padding: 6px 0.42em 10px;
  max-width: 100%;
}

.ab-intro-sub-mask {
  overflow-x: visible;
  overflow-y: clip;
  padding: 2px 0.24em 4px;
}

.ab-intro-title {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.14;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding-left: 0.16em;
  padding-right: 0.12em;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .ab-intro-title-mask {
    padding: 4px 0.18em 8px;
  }
  .ab-intro-title {
    letter-spacing: 0.075em;
    padding-left: 0.075em;
    padding-right: 0.075em;
  }
}

.ab-intro-title .ab-ch {
  display: inline-block;
  background: linear-gradient(180deg, #FFFFFF 0%, #FAF3E3 48%, #E5B857 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  transform: translate3d(0, 108%, 0);
  will-change: transform, opacity;
  transition:
    transform 480ms var(--ease-cascade) var(--ch-delay, 0ms),
    opacity 300ms ease-out var(--ch-delay, 0ms);
}

.ab-intro-title .ab-ch-space {
  display: inline-block;
  width: 0.34em;
}

.ab-intro-wordmark.is-revealed .ab-intro-title .ab-ch {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Broadcast Sub-Label (WAR COMMAND, 0.42em tracking) */
.ab-intro-sub {
  font-family: var(--font-sans);
  font-size: clamp(0.75rem, 1.15vw, 1rem);
  font-weight: 600;
  line-height: 1.24;
  text-transform: uppercase;
  letter-spacing: 0.42em;
  padding-left: 0.42em;
  color: rgba(255, 255, 255, 0.58);
  opacity: 0;
  transform: translate3d(0, 110%, 0);
  will-change: transform, opacity;
  transition:
    transform 440ms var(--ease-cascade) 130ms,
    opacity 300ms ease-out 130ms;
}

.ab-intro-wordmark.is-revealed .ab-intro-sub {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Proportional Telemetry Bar & 4 Glowing Clan Pips (zero animated box-shadow!) */
.ab-intro-telemetry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: clamp(220px, 28vw, 380px);
  margin-top: 4px;
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  will-change: transform, opacity;
  transition:
    opacity 280ms var(--ease-cascade),
    transform 360ms var(--ease-cascade);
}

.ab-intro-telemetry.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.ab-intro-telemetry-track {
  position: relative;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  overflow: hidden;
}

.ab-intro-telemetry-fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
  background: linear-gradient(90deg, #F0B429 0%, #FFF2C6 44%, #3B82F6 74%, #22D3EE 100%);
}

.ab-intro-telemetry-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.ab-clan-pips {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

@keyframes abPipPing {
  0% {
    transform: scale(1);
    opacity: 0.85;
  }
  100% {
    transform: scale(3.1);
    opacity: 0;
  }
}

.ab-clan-pip {
  position: relative;
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  background: rgba(255, 255, 255, 0.16);
  transition: background-color 180ms ease;
}

/* Pure GPU opacity/transform halo (ZERO animated box-shadow!) */
.ab-clan-pip::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, currentColor 0%, transparent 72%);
  opacity: 0;
  transform: scale(0.5);
  pointer-events: none;
  will-change: transform, opacity;
  transition: opacity 200ms ease, transform 220ms var(--ease-cascade);
}

.ab-clan-pip::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid currentColor;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.ab-clan-pip.is-ping::after {
  animation: abPipPing 380ms var(--ease-cascade) forwards;
}

.ab-pip-gold { color: #F0B429; }
.ab-pip-blue { color: #3B82F6; }
.ab-pip-violet { color: #A78BFA; }
.ab-pip-cyan { color: #22D3EE; }

.ab-clan-pip.is-lit {
  background: currentColor;
}

.ab-clan-pip.is-lit::before {
  opacity: 0.65;
  transform: scale(1);
}

.ab-telemetry-status {
  font-family: var(--font-mono);
  font-size: clamp(10px, 0.9vw, 11px);
  font-weight: 600;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
  transition: color 220ms ease;
}

.ab-telemetry-status.is-ready {
  color: rgba(255, 242, 198, 0.84);
}

/* Quiet Responsive Skip Hint ("TAP TO SKIP" on mobile, "CLICK OR PRESS ESC" on desktop) */
.ab-intro-skip-hint {
  position: absolute;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.34);
  pointer-events: none;
  opacity: 0;
  will-change: opacity;
  transition: opacity 260ms ease;
}

@media (min-width: 768px) {
  .ab-intro-skip-hint {
    bottom: calc(4.5vh + 14px);
  }
}

.ab-intro-skip-hint.is-visible {
  opacity: 1;
}

.ab-intro-stage.is-act3-exit .ab-intro-skip-hint {
  opacity: 0;
  transition-duration: 140ms;
}

/* ── 1. Living Reactive Atmosphere & Obsidian Translucency ───────────────── */
.war-ambient-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 1;
}

.app-shell {
  position: relative;
  z-index: 1;
}

/* Subtle dark translucency so the live volumetric atmosphere breathes through
   obsidian surfaces naturally without sacrificing ivory text contrast */
.theme-dark .sidebar {
  background: rgba(14, 16, 23, 0.80);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
}

.theme-dark .topbar {
  background: rgba(14, 16, 23, 0.76);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
}

.theme-dark .subbar {
  background: rgba(16, 19, 27, 0.68);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.theme-dark .launchpad {
  background:
    radial-gradient(ellipse 68% 72% at 14% 0%, rgba(var(--clan-aura-rgb), 0.11) 0%, transparent 66%),
    rgba(16, 18, 26, 0.76);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.theme-dark .card,
.theme-dark .overview-clan-card {
  background-color: rgba(17, 20, 28, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.theme-dark .lp-tile {
  background-color: rgba(22, 26, 37, 0.78);
}

.theme-dark .table-shell {
  background: rgba(16, 19, 27, 0.80);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.theme-dark .table th {
  background: rgba(22, 26, 36, 0.96);
}

.theme-dark .table .sticky-col {
  background: rgba(17, 20, 28, 0.96);
}

.theme-dark .table tbody tr.row:nth-child(even) .sticky-col {
  background: rgba(20, 24, 34, 0.96);
}

/* ── Topbar Aura Accent & Header Light Sweep ─────────────────────────────── */
.topbar {
  position: sticky;
  overflow: visible;
  border-bottom-color: color-mix(in srgb, var(--clan-aura) 30%, var(--line));
  box-shadow: 0 2px 22px -8px var(--clan-aura-glow), var(--shadow-topbar);
  transition: border-color 260ms var(--ease-cascade), box-shadow 260ms var(--ease-cascade);
}

/* Keep topbar controls comfortably unclipped on 1280-1520px desktop screens */
@media (min-width: 961px) and (max-width: 1520px) {
  .topbar-row {
    gap: 6px;
    padding-inline: 12px;
  }
  .cmd-search-trigger {
    min-width: 180px;
    max-width: 340px;
  }
  .rapi-input {
    width: 96px;
  }
  .topbar-actions {
    gap: 3px;
  }
}

@keyframes headerSweepBeam {
  0% {
    transform: translate3d(-115%, 0, 0);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 0.85;
  }
  100% {
    transform: translate3d(115%, 0, 0);
    opacity: 0;
  }
}

.header-light-sweep {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 5;
}

.header-light-sweep::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    95deg,
    transparent 0%,
    rgba(var(--clan-aura-rgb), 0.08) 30%,
    rgba(var(--clan-aura-rgb), 0.34) 50%,
    rgba(255, 255, 255, 0.22) 56%,
    transparent 76%
  );
  transform: translate3d(-115%, 0, 0);
  opacity: 0;
  will-change: transform, opacity;
}

.header-light-sweep.is-sweeping::after {
  animation: headerSweepBeam 460ms var(--ease-cascade) both;
}

/* Launchpad 1px ignition laser line */
@keyframes lpLaserIgnition {
  0% {
    transform: translate3d(-105%, 0, 0);
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  82% {
    opacity: 1;
  }
  100% {
    transform: translate3d(105%, 0, 0);
    opacity: 0;
  }
}

.launchpad {
  position: relative;
  overflow: hidden;
}

.lp-laser-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  pointer-events: none;
  z-index: 6;
  overflow: hidden;
}

.lp-laser-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(240, 180, 41, 0.35) 16%,
    #F0B429 44%,
    #FFFBEB 56%,
    #FDE68A 66%,
    rgba(34, 211, 238, 0.55) 78%,
    transparent 100%
  );
  transform: translate3d(-105%, 0, 0);
  opacity: 0;
  will-change: transform, opacity;
}

.launchpad.is-laser-igniting .lp-laser-line::after {
  animation: lpLaserIgnition 620ms var(--ease-cascade) both;
}

/* Replay Intro button in sidebar footer */
.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.replay-intro-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 180ms var(--ease-cascade);
}

.replay-intro-btn:hover {
  color: var(--clan-aura);
  border-color: color-mix(in srgb, var(--clan-aura) 52%, var(--line));
  background: var(--clan-aura-soft);
  transform: translate3d(0, -1px, 0);
}

.replay-intro-btn:active {
  transform: scale(0.985);
}

/* Onboarding Banner Shimmer Sweep */
@keyframes bannerShimmerSweep {
  0% {
    transform: translate3d(-120%, 0, 0);
    opacity: 0;
  }
  25% {
    opacity: 0.72;
  }
  100% {
    transform: translate3d(120%, 0, 0);
    opacity: 0;
  }
}

.my-standing-bar {
  position: relative;
  overflow: hidden;
}

.my-standing-bar.is-pulse-nudge::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(240, 180, 41, 0.24) 50%,
    transparent 100%
  );
  animation: bannerShimmerSweep 740ms var(--ease-cascade) both;
}

/* ── 2. Precision Cursor-Tracked 1.5px Metallic Rim Light & Weighted Hover ─ */
.lp-tile {
  --card-accent: var(--tile-accent, var(--clan-aura));
  background-image: linear-gradient(90deg, color-mix(in srgb, var(--card-accent) 88%, transparent), transparent 78%);
  background-size: 100% 2px;
  background-repeat: no-repeat;
  background-position: top left;
}

.overview-clan-card {
  --card-accent: var(--clan-aura);
  background-image:
    linear-gradient(90deg, color-mix(in srgb, var(--card-accent) 82%, transparent), transparent 68%),
    var(--card-matte-depth);
  background-size: 100% 2px, 100% 100%;
  background-repeat: no-repeat, no-repeat;
  background-position: top left, top left;
}

.lp-tile,
.overview-clan-card {
  position: relative;
  overflow: hidden;
  --rim-x: 50%;
  --rim-y: 50%;
  --rim-opacity: 0;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --hover-lift: 0px;
  --press-scale: 1;
  transition: border-color 180ms ease, box-shadow 220ms var(--ease-cascade);
}

/* Dynamic rAF-owned 3D tilt, -3px lift, and 0.985 click press feedback */
.lp-tile.is-rim-active,
.overview-clan-card.is-rim-active {
  transform:
    perspective(950px)
    translate3d(0, var(--hover-lift), 0)
    rotateX(var(--tilt-x))
    rotateY(var(--tilt-y))
    scale(var(--press-scale));
  will-change: transform;
}

/* Crisp deepening outer shadow on hover (zero muddy interior wash) */
.lp-tile.is-rim-hovered,
.overview-clan-card.is-rim-hovered {
  border-color: color-mix(in srgb, var(--card-accent) 36%, var(--line-strong));
  box-shadow:
    0 20px 44px -12px rgba(0, 0, 0, 0.68),
    0 8px 22px -8px color-mix(in srgb, var(--card-accent) 28%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Razor-sharp 1.5px BORDER-ONLY specular metallic beam (80-95% peak opacity on border mask) */
.lp-tile::before,
.overview-clan-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1.5px;
  border-radius: inherit;
  pointer-events: none;
  z-index: 6;
  opacity: var(--rim-opacity, 0);
  background: radial-gradient(
    260px circle at var(--rim-x) var(--rim-y),
    color-mix(in srgb, #ffffff 55%, var(--card-accent)) 0%,
    color-mix(in srgb, var(--card-accent) 95%, #ffffff) 22%,
    color-mix(in srgb, var(--card-accent) 78%, transparent) 46%,
    color-mix(in srgb, var(--card-accent) 20%, transparent) 72%,
    transparent 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

/* Ensure NO interior wash blob ever muddies text on cards */
.lp-tile::after,
.overview-clan-card::after {
  content: none;
  display: none;
}

.lp-tile > *,
.overview-clan-card > * {
  position: relative;
  z-index: 1;
}

/* Crisp press feedback on interactive controls */
.sidebar-link:active,
.btn:active:not(:disabled),
.filter-btn:active,
.seg button:active,
.lp-chip:active,
.lp-more-pill:active {
  transform: scale(0.985);
}

/* ── 3. Post-Data Cinematic Entrance Choreography ────────────────────────── */
.is-entrance-staged {
  opacity: 0 !important;
  transform: translate3d(0, 26px, 0) scale(0.96) !important;
  pointer-events: none;
}

.ov-cap-fill {
  position: relative;
  transform-origin: left center;
  will-change: transform;
}

.ov-cap-fill.is-bar-staged {
  transform: scaleX(0) !important;
}

/* Tabular numbers guarantee zero horizontal jitter during rAF count-up */
[data-ov-count],
.tch-stats-strip,
.ov-cap-meta,
.ov-stats-grid .kpi-value {
  font-variant-numeric: tabular-nums;
}

@keyframes barTipFlare {
  0% {
    opacity: 0.95;
    transform: translate3d(0, 0, 0) scale(1);
  }
  65% {
    opacity: 0.85;
    transform: translate3d(0, 0, 0) scale(1.22);
  }
  100% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.7);
  }
}

.ov-cap-fill.is-bar-shooting::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -4px;
  width: 12px;
  height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, var(--card-accent, #F0B429) 48%, transparent 100%);
  pointer-events: none;
  will-change: transform, opacity;
  animation: barTipFlare 680ms var(--ease-cascade) both;
}

@keyframes tileDeltaPop {
  0% {
    transform: scale(1.045);
    border-color: color-mix(in srgb, var(--clan-aura) 72%, var(--line));
  }
  100% {
    transform: scale(1);
    border-color: var(--line);
  }
}

.ov-stats-grid .kpi {
  transition: transform 180ms var(--ease-cascade), border-color 160ms ease, background 160ms ease;
}

.ov-stats-grid .kpi:active {
  transform: scale(0.985);
}

.ov-stats-grid .kpi[data-ov-status="promote"]:hover {
  border-color: rgba(56, 189, 248, 0.62);
  transform: translate3d(0, -2px, 0);
}

.ov-stats-grid .kpi[data-ov-status="soon"]:hover,
.ov-stats-grid .kpi[data-ov-status="demote"]:hover {
  border-color: rgba(245, 158, 11, 0.64);
  transform: translate3d(0, -2px, 0);
}

.ov-stats-grid .kpi[data-ov-status="kick"]:hover {
  border-color: rgba(239, 68, 68, 0.68);
  transform: translate3d(0, -2px, 0);
}

.ov-stats-grid .kpi.tile-delta-flash,
.ov-ppg-badge.tile-delta-flash {
  animation: tileDeltaPop 480ms var(--ease-cascade) both;
}

/* ── 4. Liquid Navigation Indicators & Bug-Free Roster ───────────────────── */

/* 4A. Persistent Sidebar Sliding Indicator with Illuminated Left Accent Bar */
.sidebar-primary-track {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-active-glide {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 33px;
  z-index: 0;
  border-radius: var(--radius);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--clan-aura) 22%, transparent) 0%,
    color-mix(in srgb, var(--clan-aura) 6%, transparent) 100%
  );
  border: 1px solid color-mix(in srgb, var(--clan-aura) 46%, transparent);
  box-shadow: 0 2px 18px -6px var(--clan-aura-glow);
  pointer-events: none;
  opacity: 0;
  transform-origin: top left;
  will-change: transform, opacity;
  transition: opacity 160ms ease, border-color 240ms var(--ease-cascade), box-shadow 240ms var(--ease-cascade);
}

/* Crisp illuminated left accent bar on the persistent sliding indicator */
.nav-active-glide::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--clan-aura);
  box-shadow: 0 0 10px var(--clan-aura), 0 0 4px #ffffff;
}

.sidebar-primary-track > .sidebar-link {
  position: relative;
  z-index: 1;
  transition: color 180ms var(--ease-weighted-out), background 160ms ease, transform 140ms var(--ease-cascade);
}

/* Remove static left pseudo-bar on primary track items so only .nav-active-glide::before renders it */
.sidebar-primary-track > .sidebar-link::before {
  display: none;
}

.sidebar-primary-track > .sidebar-link.is-active {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--clan-aura);
}

/* 4B. Persistent Mobile Bottom Nav Sliding Pill */
.mobile-nav {
  position: fixed;
}

.mobile-active-thumb {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: 12px;
  background: color-mix(in srgb, var(--clan-aura) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--clan-aura) 48%, transparent);
  box-shadow: 0 -2px 14px -4px var(--clan-aura-glow);
  pointer-events: none;
  opacity: 0;
  transform-origin: top left;
  will-change: transform, opacity;
  transition: opacity 160ms ease;
}

.mobile-nav > .mobile-nav-item {
  position: relative;
  z-index: 1;
  transition: color 180ms var(--ease-cascade);
}

/* 4C. Persistent Clan Switcher Sliding Indicator (AB1–AB4, never destroyed) */
.clan-switch {
  position: relative;
}

.clan-switch-thumb {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: var(--r-pill, 999px);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--clan-aura) 26%, var(--surface-1)) 0%,
    color-mix(in srgb, var(--clan-aura-secondary) 12%, var(--surface-2)) 100%
  );
  border: 1px solid color-mix(in srgb, var(--clan-aura) 76%, transparent);
  box-shadow:
    0 0 18px -4px var(--clan-aura-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  pointer-events: none;
  opacity: 0;
  transform-origin: top left;
  will-change: transform, opacity;
  transition: opacity 160ms ease, border-color 240ms var(--ease-cascade), box-shadow 240ms var(--ease-cascade);
}

.clan-switch > button {
  position: relative;
  z-index: 1;
  transition: color 160ms ease, border-color 160ms ease, transform 140ms var(--ease-cascade);
}

.clan-switch > button:active {
  transform: scale(0.96);
}

.clan-switch > button[aria-selected="true"],
.clan-switch > button.is-current-aura {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: var(--text-1);
}

.clan-switch > button[aria-selected="true"] .count,
.clan-switch > button.is-current-aura .count {
  color: var(--clan-aura);
  background: color-mix(in srgb, var(--clan-aura) 16%, transparent);
  padding: 1px 6px;
  border-radius: var(--r-pill, 999px);
}

/* 4D. Persistent Time-Window Capsule Indicator (2w / 4w / 8w / 10w) */
.week-quick-btns {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: var(--r-pill, 999px);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.week-quick-thumb {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: var(--r-pill, 999px);
  background: linear-gradient(135deg, var(--clan-aura) 0%, color-mix(in srgb, var(--clan-aura) 76%, var(--clan-aura-secondary)) 100%);
  box-shadow: 0 2px 12px -2px var(--clan-aura-glow);
  pointer-events: none;
  opacity: 0;
  transform-origin: top left;
  will-change: transform, opacity;
  transition: opacity 160ms ease;
}

.week-quick-btns > .week-quick-btn {
  position: relative;
  z-index: 1;
  border-radius: var(--r-pill, 999px);
  border-color: transparent;
  background: transparent;
  transition: color 160ms ease, transform 140ms var(--ease-cascade);
}

.week-quick-btns > .week-quick-btn:active {
  transform: scale(0.96);
}

.week-quick-btns > .week-quick-btn[aria-pressed="true"] {
  color: #0A0B0E !important;
  font-weight: 800;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* 4E. Bug-Free Roster: ZERO per-<tr> staggers + Silky GPU-Gliding Row-Hover Bar */
.table-shell {
  position: relative;
}

.table tbody tr.row {
  opacity: 1 !important;
  animation: none !important;
}

/* Suppress jarring cell-by-cell background snap in favor of the silky GPU-gliding band */
.table-shell .table tbody tr.row:hover td {
  background: transparent;
}

.table-shell .table tbody tr.row:hover .sticky-col {
  background: var(--surface-1);
}

.theme-dark .table-shell .table tbody tr.row:hover .sticky-col {
  background: rgba(20, 24, 34, 0.96);
}

.roster-hover-band {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 44px;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  background: linear-gradient(
    90deg,
    rgba(var(--clan-aura-rgb), 0.14) 0%,
    rgba(var(--clan-aura-rgb), 0.065) 45%,
    rgba(var(--clan-aura-rgb), 0.03) 100%
  );
  border-top: 1px solid rgba(var(--clan-aura-rgb), 0.24);
  border-bottom: 1px solid rgba(var(--clan-aura-rgb), 0.14);
  transform-origin: top left;
  transform: translate3d(0, var(--band-y, 0px), 0) scaleY(var(--band-sy, 1));
  will-change: transform, opacity;
  transition:
    transform 130ms var(--ease-cascade),
    opacity 130ms ease;
}

.roster-hover-band.is-visible {
  opacity: 1;
}

.roster-hover-rail {
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 40px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--clan-aura), var(--clan-aura-secondary));
  box-shadow: 0 0 12px var(--clan-aura-glow);
  pointer-events: none;
  z-index: 8;
  opacity: 0;
  transform-origin: top left;
  transform: translate3d(0, var(--rail-y, 0px), 0) scaleY(var(--rail-sy, 1));
  will-change: transform, opacity;
  transition:
    transform 130ms var(--ease-cascade),
    opacity 130ms ease;
}

.roster-hover-rail.is-visible {
  opacity: 1;
}

/* ── Smooth Sidebar Submenu Drawers ─────────────────────────────────────── */
.sidebar-submenu-wrap {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 240ms var(--ease-cascade),
    opacity 180ms var(--ease-cascade);
}

.sidebar-submenu-wrap.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.sidebar-submenu-inner {
  overflow: hidden;
  min-height: 0;
}

/* ── Top-Layer Modal Scale + Backdrop Blur Bloom (@starting-style) ──────── */
dialog.modal {
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 240ms;
  transition-timing-function: var(--ease-cascade);
  transition-behavior: allow-discrete;

  @media (prefers-reduced-motion: no-preference) {
    transform: translate3d(0, 10px, 0) scale(0.95);
  }
}

dialog.modal::backdrop {
  background-color: rgba(5, 7, 12, 0);
  backdrop-filter: blur(0px);
  transition-property: background-color, backdrop-filter, display, overlay;
  transition-duration: 240ms;
  transition-timing-function: var(--ease-cascade);
  transition-behavior: allow-discrete;
}

:is(dialog.modal[open]):where(:not([data-closing])) {
  opacity: 1;

  @starting-style {
    opacity: 0;
  }

  @media (prefers-reduced-motion: no-preference) {
    transform: translate3d(0, 0, 0) scale(1);

    @starting-style {
      transform: translate3d(0, 10px, 0) scale(0.94);
    }
  }

  &::backdrop {
    background-color: rgba(5, 8, 16, 0.62);
    backdrop-filter: blur(8px);

    @starting-style {
      background-color: rgba(5, 7, 12, 0);
      backdrop-filter: blur(0px);
    }
  }
}

/* ── Onboarding Modal 2-Step Directional Slide Wizard ───────────────────── */
.ob-wizard-viewport {
  overflow: hidden;
  position: relative;
}

.ob-wizard-track {
  display: flex;
  width: 200%;
  transition: transform 260ms var(--ease-cascade);
  will-change: transform;
}

.ob-wizard-track[data-step="2"] {
  transform: translate3d(-50%, 0, 0);
}

.ob-wizard-pane {
  width: 50%;
  flex: 0 0 50%;
  padding: 2px 1px;
  transition: opacity 200ms var(--ease-cascade);
}

.ob-wizard-track[data-step="1"] .ob-wizard-pane[data-pane="2"],
.ob-wizard-track[data-step="2"] .ob-wizard-pane[data-pane="1"] {
  opacity: 0.2;
  pointer-events: none;
}

.ob-step-pill {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  padding: 4px 10px;
  border-radius: var(--r-pill, 999px);
  font-size: 11.5px;
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 180ms var(--ease-cascade);
}

.ob-step-pill.is-active {
  background: var(--clan-aura-soft);
  border-color: color-mix(in srgb, var(--clan-aura) 55%, var(--line));
  color: var(--clan-aura);
}

/* ── Reduced Motion Compliance ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ab-intro-canvas,
  .ab-intro-skip-hint {
    display: none !important;
  }

  .ab-intro-crest-wrap {
    opacity: 1 !important;
    transform: none !important;
  }

  .ab-crest-path {
    stroke-dashoffset: 0 !important;
    opacity: 1 !important;
  }

  .ab-crest-facets,
  .ab-intro-title .ab-ch,
  .ab-intro-sub,
  .ab-intro-telemetry,
  .ab-corner {
    opacity: 1 !important;
    transform: none !important;
  }

  .header-light-sweep,
  .lp-laser-line,
  .roster-hover-band,
  .roster-hover-rail {
    display: none !important;
  }

  .is-entrance-staged {
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
  }

  .ov-cap-fill.is-bar-staged {
    transform: scaleX(1) !important;
  }

  dialog.modal,
  dialog.modal::backdrop {
    transition-duration: 100ms;
  }

  .nav-active-glide,
  .clan-switch-thumb,
  .week-quick-thumb,
  .mobile-active-thumb,
  .ob-wizard-track,
  .sidebar-submenu-wrap,
  .toast {
    transition-duration: 0ms;
  }

  .overview-clan-card,
  .lp-tile {
    transform: none !important;
  }

  .overview-clan-card::before,
  .lp-tile::before,
  .ov-cap-fill::after {
    display: none;
  }
}
