/* ==========================================================================
   Chaos Lunia — Motion & FX layer
   Composes with site.css: existing animations own `transform`, so this layer
   moves elements only through the standalone translate / rotate / scale
   properties (plus opacity, clip-path, box-shadow) to avoid clashes.
   Everything is prefixed fx- and safe to delete wholesale.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Scroll progress bar
   -------------------------------------------------------------------------- */
.fx-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 100%;
  height: 3px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--gold), #ff9d39 38%, var(--coral) 66%, var(--violet));
  box-shadow: 0 0 12px rgba(255, 200, 87, 0.55), 0 0 4px rgba(255, 91, 106, 0.6);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* --------------------------------------------------------------------------
   2. Scrollbar + selection flourish
   -------------------------------------------------------------------------- */
html {
  scrollbar-color: #b9791d var(--bg);
  scrollbar-width: thin;
}
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ffd77e, var(--gold));
}
::selection {
  background: var(--gold);
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   3. Reveal-on-scroll system
   JS tags elements with .fx-reveal (+ optional data-fx variant) while motion
   is allowed; .fx-in settles them. Standalone translate/scale compose with
   the theme's transform: rotate(...) rest tilts.
   -------------------------------------------------------------------------- */
.fx-reveal {
  opacity: 0.001;
  translate: 0 34px;
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    translate 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    scale 0.7s cubic-bezier(0.34, 1.45, 0.64, 1);
  transition-delay: var(--fx-d, 0ms);
}
.fx-reveal[data-fx="pop"] {
  translate: 0 0;
  scale: 0.62;
}
.fx-reveal[data-fx="slap"] {
  translate: 0 18px;
  scale: 1.1;
}
.fx-reveal[data-fx="left"] { translate: -44px 0; }
.fx-reveal[data-fx="right"] { translate: 44px 0; }
.fx-reveal.fx-in {
  opacity: 1;
  translate: 0 0;
  scale: 1;
}
/* headline ink wipe */
.fx-reveal[data-fx="wipe"] {
  translate: 0 12px;
  clip-path: inset(-8% 102% -12% -2%);
  transition:
    opacity 0.55s ease,
    translate 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    clip-path 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--fx-d, 0ms);
}
.fx-reveal[data-fx="wipe"].fx-in {
  clip-path: inset(-8% -2% -12% -2%);
}
/* cascade for cards injected after load (news, rankings, suggestions...) */
.fx-dyn {
  opacity: 0.001;
  translate: 0 26px;
  scale: 0.94;
  transition:
    opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    translate 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    scale 0.6s cubic-bezier(0.34, 1.5, 0.64, 1);
  transition-delay: var(--fx-d, 0ms);
}
.fx-dyn.fx-in {
  opacity: 1;
  translate: 0 0;
  scale: 1;
}

/* --------------------------------------------------------------------------
   4. Topbar: compact-on-scroll + nav indicator
   -------------------------------------------------------------------------- */
.topbar {
  transition:
    background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease,
    box-shadow 0.3s ease, min-height 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.22s ease;
}
.topbar .brand {
  transition: scale 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.topbar.fx-scrolled {
  min-height: 86px;
  border-color: rgba(255, 200, 87, 0.3);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.5),
    0 1px 0 rgba(255, 200, 87, 0.18) inset;
}
.topbar.fx-scrolled .brand {
  scale: 0.88;
}
[data-theme="light"] .topbar.fx-scrolled {
  border-color: rgba(185, 121, 29, 0.4);
  box-shadow: 0 20px 44px rgba(63, 45, 16, 0.28);
}
.desktop-nav {
  position: relative;
}
.fx-nav-glider {
  position: absolute;
  bottom: 2px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  box-shadow: 0 0 10px rgba(67, 199, 255, 0.65);
  opacity: 0;
  pointer-events: none;
  transition:
    left 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease;
}
.fx-nav-glider.fx-on { opacity: 1; }

/* --------------------------------------------------------------------------
   5. Hero diorama: mouse parallax + holo glare + logo ignition
   -------------------------------------------------------------------------- */
.hero-grid {
  perspective: 1400px;
}
.fx-tilt-target {
  will-change: transform;
}
.hero-copy {
  will-change: translate;
}
.fx-glare {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(
      105deg,
      transparent 32%,
      rgba(255, 255, 255, 0.16) 43%,
      rgba(103, 227, 255, 0.22) 49%,
      rgba(255, 200, 87, 0.16) 55%,
      transparent 66%
    );
  background-size: 300% 100%;
  background-position: 120% 0;
  mix-blend-mode: screen;
  animation: fxHoloSweep 7.2s ease-in-out 2.2s infinite;
}
@keyframes fxHoloSweep {
  0% { background-position: 120% 0; }
  34% { background-position: -80% 0; }
  100% { background-position: -80% 0; }
}
/* logo ignition on first load */
.fx-boot .logo-sigil {
  animation: fxLogoIgnite 1.15s cubic-bezier(0.26, 1.36, 0.44, 1) 0.12s backwards;
}
@keyframes fxLogoIgnite {
  0% {
    opacity: 0;
    scale: 0.62;
    filter: brightness(2.4) saturate(0.2) drop-shadow(0 0 0 rgba(255, 200, 87, 0));
  }
  55% {
    opacity: 1;
    scale: 1.06;
    filter: brightness(1.5) saturate(1.25) drop-shadow(0 0 42px rgba(255, 140, 60, 0.85));
  }
  100% {
    opacity: 1;
    scale: 1;
    filter: brightness(1) saturate(1) drop-shadow(0 0 0 rgba(255, 140, 60, 0));
  }
}
/* slow ember pulse behind the logo, forever after ignition */
.fx-boot .logo-sigil img {
  animation: fxEmberPulse 4.6s ease-in-out 1.4s infinite;
}
@keyframes fxEmberPulse {
  0%, 100% { filter: drop-shadow(0 6px 18px rgba(255, 96, 40, 0.22)); }
  50% { filter: drop-shadow(0 10px 34px rgba(255, 140, 60, 0.5)) saturate(1.12); }
}

/* --------------------------------------------------------------------------
   6. Ambient sky: aurora ribbons + shooting stars
   -------------------------------------------------------------------------- */
.fx-aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  mix-blend-mode: screen;
}
.fx-aurora i {
  position: absolute;
  display: block;
  width: 56vmax;
  height: 56vmax;
  border-radius: 50%;
  opacity: 0.17;
  will-change: transform;
}
.fx-aurora i:first-child {
  top: -22vmax;
  left: -14vmax;
  background: radial-gradient(circle at 50% 50%, rgba(67, 199, 255, 0.7), rgba(140, 108, 255, 0.28) 44%, transparent 68%);
  animation: fxAuroraA 46s ease-in-out infinite;
}
.fx-aurora i:last-child {
  right: -18vmax;
  bottom: -26vmax;
  background: radial-gradient(circle at 50% 50%, rgba(255, 200, 87, 0.55), rgba(255, 91, 106, 0.24) 46%, transparent 70%);
  animation: fxAuroraB 58s ease-in-out infinite;
}
@keyframes fxAuroraA {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(9vw, 7vh, 0) scale(1.22); }
}
@keyframes fxAuroraB {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.12); }
  50% { transform: translate3d(-8vw, -9vh, 0) scale(0.94); }
}
[data-theme="light"] .fx-aurora {
  mix-blend-mode: multiply;
}
[data-theme="light"] .fx-aurora i {
  opacity: 0.07;
}

.fx-star {
  position: fixed;
  top: var(--fx-sy, 12vh);
  left: var(--fx-sx, 8vw);
  z-index: 0;
  width: 150px;
  height: 2px;
  pointer-events: none;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(103, 227, 255, 0.65) 30%, transparent);
  box-shadow: 0 0 10px rgba(150, 220, 255, 0.8);
  rotate: var(--fx-sr, -26deg);
  transform-origin: 0 50%;
  animation: fxShoot var(--fx-sd, 1.1s) cubic-bezier(0.16, 0.84, 0.44, 1) forwards;
}
.fx-star::before {
  content: "";
  position: absolute;
  left: -3px;
  top: -2.5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 14px 3px rgba(170, 225, 255, 0.95);
}
@keyframes fxShoot {
  0% { transform: translateX(0) scaleX(0.3); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateX(var(--fx-sl, 46vw)) scaleX(1); opacity: 0; }
}

/* --------------------------------------------------------------------------
   7. Click bursts (confetti sparks on buttons / cards)
   -------------------------------------------------------------------------- */
.fx-burst {
  position: fixed;
  z-index: 140;
  width: var(--fx-bs, 6px);
  height: var(--fx-bs, 6px);
  border-radius: 50%;
  pointer-events: none;
  background: var(--fx-bc, var(--gold));
  box-shadow: 0 0 8px var(--fx-bc, var(--gold));
}
.fx-burst.fx-burst-star {
  border-radius: 0;
  clip-path: polygon(50% 0%, 63% 34%, 100% 38%, 72% 61%, 82% 100%, 50% 76%, 18% 100%, 28% 61%, 0% 38%, 37% 34%);
}

/* --------------------------------------------------------------------------
   8. Hero CTA heartbeat + badge wiggle
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-actions .button.primary {
    animation: fxCtaPulse 2.7s ease-in-out 1.6s infinite;
  }
  .hero-actions .button.primary:is(:hover, :focus-visible) {
    animation: controlHoverFloat 1.65s ease-in-out infinite;
  }
}
@keyframes fxCtaPulse {
  0%, 100% {
    box-shadow:
      0 5px 0 #a73742, 0 13px 22px rgba(0, 0, 0, 0.22),
      0 0 0 0 rgba(255, 200, 87, 0.55);
  }
  50% {
    box-shadow:
      0 5px 0 #a73742, 0 13px 26px rgba(0, 0, 0, 0.26),
      0 0 0 12px rgba(255, 200, 87, 0);
  }
}
.fx-wiggle {
  animation: fxWiggle 0.62s ease-in-out both;
}
@keyframes fxWiggle {
  0%, 100% { rotate: 0deg; scale: 1; }
  25% { rotate: -4deg; scale: 1.09; }
  55% { rotate: 3.4deg; scale: 1.05; }
  80% { rotate: -1.6deg; scale: 1.02; }
}

/* --------------------------------------------------------------------------
   9. Character strip: spotlight + class-colored glow
   -------------------------------------------------------------------------- */
.class-strip:hover .class-card:not(:hover) {
  filter: saturate(0.72) brightness(0.9);
  opacity: 0.78;
}
.class-card {
  transition: filter 0.22s ease, opacity 0.22s ease, box-shadow 0.24s ease;
}
.class-card:is(:hover, :focus-visible) {
  z-index: 2;
  box-shadow:
    var(--paper-shadow),
    0 0 0 3px var(--class-color, var(--gold)),
    0 0 30px 2px var(--class-color, var(--gold));
}
.class-card:is(:hover, :focus-visible) h3 {
  color: var(--class-color, inherit);
  filter: saturate(1.4) brightness(0.86);
}
.class-card:is(:hover, :focus-visible) .class-token {
  box-shadow: 0 6px 0 rgba(22, 25, 40, 0.18), 0 0 22px var(--class-color, var(--gold));
}
.class-card:is(:hover, :focus-visible) .class-token img {
  transform: translate3d(0, -4px, 0) scale(1.24);
}

/* --------------------------------------------------------------------------
   10. Leaderboard podium: gold / silver / bronze
   -------------------------------------------------------------------------- */
.leaderboard li:not(.empty-row) {
  transition: translate 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, background-color 0.25s ease;
}
.leaderboard li:not(.empty-row):hover {
  translate: 4px 0;
  background: rgba(22, 25, 40, 0.14);
}
.leaderboard li:nth-child(1):not(.empty-row) {
  background: linear-gradient(90deg, rgba(255, 200, 87, 0.3), rgba(255, 200, 87, 0.08) 62%, transparent);
  box-shadow: inset 2px 0 0 var(--gold);
}
.leaderboard li:nth-child(2):not(.empty-row) {
  background: linear-gradient(90deg, rgba(198, 210, 230, 0.3), rgba(198, 210, 230, 0.07) 62%, transparent);
  box-shadow: inset 2px 0 0 #b9c4d8;
}
.leaderboard li:nth-child(3):not(.empty-row) {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.28), rgba(205, 127, 50, 0.07) 62%, transparent);
  box-shadow: inset 2px 0 0 #cd7f32;
}
.leaderboard li:nth-child(2):not(.empty-row) span { background: #cdd6e4; }
.leaderboard li:nth-child(3):not(.empty-row) span { background: #d99a5b; }
.leaderboard li:nth-child(1):not(.empty-row) span {
  position: relative;
  overflow: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  .leaderboard li:nth-child(1):not(.empty-row) span::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.85) 50%, transparent 70%);
    background-size: 250% 100%;
    animation: fxChampShine 3.4s ease-in-out infinite;
  }
}
@keyframes fxChampShine {
  0% { background-position: 130% 0; }
  45% { background-position: -60% 0; }
  100% { background-position: -60% 0; }
}

/* --------------------------------------------------------------------------
   11. Stat count-up pop
   -------------------------------------------------------------------------- */
[data-stat] {
  transition: scale 0.28s cubic-bezier(0.34, 1.6, 0.64, 1), color 0.28s ease;
}
[data-stat].fx-tick {
  scale: 1.18;
  color: var(--gold);
}

/* --------------------------------------------------------------------------
   12. Theme switch circle wipe (View Transitions API)
   -------------------------------------------------------------------------- */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

/* --------------------------------------------------------------------------
   13. Reduced motion / small screens
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .fx-progress,
  .fx-aurora,
  .fx-star,
  .fx-burst,
  .fx-nav-glider,
  .fx-glare {
    display: none !important;
  }
  .fx-reveal,
  .fx-dyn {
    opacity: 1 !important;
    translate: 0 0 !important;
    scale: 1 !important;
    clip-path: none !important;
    transition: none !important;
  }
}
@media (max-width: 760px) {
  .fx-aurora i { opacity: 0.12; }
}

/* Support nav entries stay collapsed until the worker enables donations */
[data-support-nav][hidden] {
  display: none !important;
}

/* ==========================================================================
   FX v2 — account panel redesign + modern main-page layer
   ========================================================================== */

@property --fx-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

/* --------------------------------------------------------------------------
   14. Cursor spotlight on paper cards (desktop pointers)
   -------------------------------------------------------------------------- */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .paper-card:not(.alpha-card):not(.panel-hero-card)::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(
      260px circle at var(--fx-mx, 50%) var(--fx-my, 50%),
      rgba(255, 214, 120, 0.28),
      rgba(103, 227, 255, 0.09) 46%,
      transparent 68%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  .paper-card:not(.alpha-card):not(.panel-hero-card):hover::before {
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   15. Typographic ink shimmer on section headlines
   -------------------------------------------------------------------------- */
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .section-heading h2 {
    background: linear-gradient(
      115deg,
      var(--text) 0%,
      var(--text) 40%,
      var(--gold) 50%,
      var(--text) 60%,
      var(--text) 100%
    );
    background-size: 260% 100%;
    background-position: 96% 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  @media (prefers-reduced-motion: no-preference) {
    .section-heading h2 {
      animation: fxInkShimmer 8.5s ease-in-out 2.4s infinite;
    }
  }
}
@keyframes fxInkShimmer {
  0%, 64%, 100% { background-position: 96% 0; }
  78%, 86% { background-position: 2% 0; }
}

/* --------------------------------------------------------------------------
   16. Layout symmetry + tactile micro-interactions
   -------------------------------------------------------------------------- */
.alpha-points {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 760px) {
  .alpha-points { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .alpha-points { grid-template-columns: 1fr; }
}
.button,
.icon-button,
.menu-button {
  transition-property: box-shadow, filter, translate, scale;
  transition-duration: 0.18s, 0.18s, 0.12s, 0.12s;
  transition-timing-function: ease;
}
.button:active,
.icon-button:active,
.menu-button:active,
.panel-char-chip:active {
  translate: 0 2px;
  scale: 0.97;
}
.topbar {
  backdrop-filter: blur(20px) saturate(1.4);
}
.paper-card input:focus-visible,
.paper-card select:focus-visible,
.paper-card textarea:focus-visible {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(67, 199, 255, 0.32);
}
@media (prefers-reduced-motion: no-preference) {
  .eyebrow {
    background: linear-gradient(
      120deg,
      rgba(67, 199, 255, 0.1) 0%,
      rgba(67, 199, 255, 0.3) 50%,
      rgba(67, 199, 255, 0.1) 100%
    );
    background-size: 230% 100%;
    animation: fxEyebrowDrift 6.5s ease-in-out infinite;
  }
}
@keyframes fxEyebrowDrift {
  0%, 100% { background-position: 98% 0; }
  50% { background-position: 2% 0; }
}
.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  translate: -50% 0;
  width: min(720px, 82%);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--gold) 32%, var(--cyan) 68%, transparent);
  box-shadow: 0 0 16px rgba(255, 200, 87, 0.42);
  opacity: 0.6;
}

/* Scroll-driven hero exit (progressive enhancement) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero .hero-grid {
      animation: fxHeroExit linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 92%;
    }
  }
}
@keyframes fxHeroExit {
  to {
    opacity: 0.28;
    translate: 0 -46px;
    scale: 0.965;
  }
}

/* --------------------------------------------------------------------------
   17. Account drawer: entrance + hero card v2
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .account-overlay:not([hidden]) {
    animation: fxOverlayFade 0.32s ease both;
  }
  .account-overlay:not([hidden]) .account-drawer {
    animation: fxDrawerIn 0.55s cubic-bezier(0.22, 1.36, 0.36, 1) both;
  }
}
@keyframes fxOverlayFade {
  from { opacity: 0; }
}
@keyframes fxDrawerIn {
  from {
    opacity: 0;
    translate: 0 48px;
    scale: 0.965;
  }
}

.panel-avatar-wrap {
  position: relative;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.9), transparent 26%),
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--class-color, #ffc857) 55%, #ffffff),
      var(--class-color, #ffc857) 58%,
      color-mix(in srgb, var(--class-color, #ffc857) 62%, #14172a)
    );
}
@media (prefers-reduced-motion: no-preference) {
  .panel-avatar-wrap::before {
    content: "";
    position: absolute;
    inset: -9px;
    border-radius: 50%;
    background: conic-gradient(
      from var(--fx-angle),
      transparent 10%,
      var(--class-color, #ffc857) 28%,
      transparent 46%,
      transparent 58%,
      var(--class-color, #ffc857) 78%,
      transparent 94%
    );
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
    animation: fxRingSpin 7s linear infinite;
    opacity: 0.95;
  }
}
@keyframes fxRingSpin {
  to { --fx-angle: 360deg; }
}

.wallet-token {
  position: relative;
  overflow: hidden;
  border-radius: 13px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.34));
  transition: translate 0.22s cubic-bezier(0.34, 1.5, 0.64, 1), box-shadow 0.22s ease;
}
.wallet-token:hover {
  translate: 0 -3px;
  box-shadow: inset 0 0 0 2px rgba(22, 25, 40, 0.1), 0 7px 0 rgba(0, 0, 0, 0.12);
}
.gold-token span {
  background: linear-gradient(145deg, #ffe9ad, #ffc857 56%, #e2a136);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.14), 0 0 12px rgba(255, 200, 87, 0.45);
}
.lc-token span {
  background: linear-gradient(145deg, #8fe1ff, #43c7ff 54%, #8c6cff);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.14), 0 0 12px rgba(67, 199, 255, 0.45);
}
.wallet-token strong {
  font-size: 1.04rem;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}
.panel-stats span {
  transition: translate 0.2s cubic-bezier(0.34, 1.5, 0.64, 1), background-color 0.2s ease;
}
.panel-stats span:hover {
  translate: 0 -2px;
  background: rgba(255, 200, 87, 0.2);
}
.panel-stats strong {
  font-size: 1.12rem;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   18. Character strip (switch the featured character)
   -------------------------------------------------------------------------- */
.panel-character-strip {
  width: 100%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.panel-character-strip[hidden] {
  display: none;
}
.panel-char-chip {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 66px;
  padding: 7px 4px 6px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: rgba(22, 25, 40, 0.07);
  cursor: pointer;
  transition:
    translate 0.2s cubic-bezier(0.34, 1.5, 0.64, 1),
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}
.panel-char-chip img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid color-mix(in srgb, var(--class-color, #ffc857) 78%, rgba(17, 20, 34, 0.55));
  background: var(--class-color, #ffc857);
}
.panel-char-chip span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #454c60;
  font-size: 0.64rem;
  font-weight: 900;
}
.panel-char-chip:is(:hover, :focus-visible) {
  translate: 0 -3px;
  background: rgba(22, 25, 40, 0.12);
}
.panel-char-chip.active {
  border-color: var(--class-color, #ffc857);
  background: color-mix(in srgb, var(--class-color, #ffc857) 16%, transparent);
  box-shadow:
    0 4px 0 rgba(0, 0, 0, 0.12),
    0 0 16px color-mix(in srgb, var(--class-color, #ffc857) 52%, transparent);
}

/* --------------------------------------------------------------------------
   19. Panel workbench alignment
   -------------------------------------------------------------------------- */
.panel-security-grid {
  align-items: stretch;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.panel-security-form {
  align-content: start;
}
#panelLogoutButton {
  width: 100%;
  justify-self: stretch;
}

/* --------------------------------------------------------------------------
   20. Panel quick actions
   -------------------------------------------------------------------------- */
.panel-quick-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
}
.panel-quick-link {
  display: grid;
  gap: 2px;
  padding: 10px 8px;
  border-radius: 12px;
  text-align: center;
  background: rgba(22, 25, 40, 0.07);
  box-shadow: inset 0 0 0 2px rgba(22, 25, 40, 0.06);
  transition:
    translate 0.2s cubic-bezier(0.34, 1.5, 0.64, 1),
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}
.panel-quick-link strong {
  color: var(--ink);
  font-size: 0.82rem;
}
.panel-quick-link small {
  color: #62697a;
  font-size: 0.66rem;
  font-weight: 900;
}
.panel-quick-link:is(:hover, :focus-visible) {
  translate: 0 -3px;
  background: rgba(255, 200, 87, 0.22);
  box-shadow: inset 0 0 0 2px rgba(255, 200, 87, 0.55), 0 6px 0 rgba(0, 0, 0, 0.1);
}
.panel-quick-link[hidden] {
  display: none;
}

/* --------------------------------------------------------------------------
   21. Staff tools card
   -------------------------------------------------------------------------- */
.panel-staff-tabs {
  margin-bottom: 14px;
}
.panel-staff-panel {
  display: grid;
  gap: 12px;
}
.staff-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.staff-toolbar input,
.staff-toolbar select,
.staff-action-form input,
.staff-action-form select,
.staff-user-row select,
.staff-user-row input {
  min-height: 40px;
  padding: 8px 12px;
  border: 2px solid rgba(22, 25, 40, 0.16);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  font-weight: 700;
}
.staff-toolbar input {
  flex: 1;
  min-width: 140px;
}
.staff-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
}
.staff-metric {
  display: grid;
  gap: 2px;
  padding: 12px 8px;
  border-radius: 12px;
  text-align: center;
  background: rgba(22, 25, 40, 0.07);
}
.staff-metric strong {
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}
.staff-metric small {
  color: #62697a;
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.staff-metric.warn {
  background: rgba(255, 200, 87, 0.24);
}
.staff-metric.bad {
  background: rgba(255, 91, 106, 0.2);
}
.staff-empty {
  padding: 12px;
  border-radius: 10px;
  background: rgba(22, 25, 40, 0.06);
  color: #62697a;
  font-size: 0.82rem;
  font-weight: 800;
}
.staff-log-list,
.staff-action-list,
.staff-user-list {
  display: grid;
  gap: 6px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}
.staff-log-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(22, 25, 40, 0.06);
}
.staff-log-level {
  display: inline-grid;
  place-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: rgba(67, 199, 255, 0.3);
  color: var(--ink);
  font-size: 0.62rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.staff-log-row.warning .staff-log-level {
  background: rgba(255, 200, 87, 0.5);
}
.staff-log-row.error .staff-log-level {
  background: rgba(255, 91, 106, 0.5);
}
.staff-log-body {
  display: grid;
  min-width: 0;
}
.staff-log-body strong {
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.staff-log-body small {
  color: #62697a;
  font-size: 0.68rem;
  font-weight: 800;
}
.staff-action-form {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr) minmax(0, 0.9fr);
  gap: 8px;
}
.staff-action-form input[name="reason"] {
  grid-column: 1 / -1;
}
.staff-action-form .button {
  grid-column: 1 / -1;
}
.staff-action-row {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(22, 25, 40, 0.06);
}
.staff-action-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.staff-action-head strong {
  font-size: 0.86rem;
}
.staff-action-head small {
  color: #62697a;
  font-size: 0.68rem;
  font-weight: 800;
}
.staff-action-reason {
  color: #454c60;
  font-size: 0.78rem;
  font-weight: 700;
}
.staff-action-row select {
  justify-self: start;
  min-height: 34px;
  padding: 4px 10px;
  border: 2px solid rgba(22, 25, 40, 0.16);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.62);
  font-weight: 800;
}
.staff-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr) 72px auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(22, 25, 40, 0.06);
}
.staff-user-row strong {
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.staff-user-row .button {
  min-height: 38px;
  padding: 6px 14px;
}
@media (max-width: 640px) {
  .staff-action-form {
    grid-template-columns: 1fr;
  }
  .staff-user-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .staff-user-row strong {
    grid-column: 1 / -1;
  }
}
