* {
  box-sizing: border-box;
}

:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  --lit-dark-green: #00a359;
  --lit-mid-green: #00b764;
  --lit-light-mid: #00e17b;
  --lit-light-green: #00ff8b;
  --lit-bg-dark: #0b0f0e;
  --lit-bg-panel: #111614;
  --lit-neon-accent: #00ff8b;
  --lit-text-main: #d9f7e8;
  --lit-shadow: 0 40px 60px rgba(0, 163, 89, 0.45);
  --overdrive-glow: 0, 255, 139;
  --overdrive-accent: 0, 255, 139;
  --vh: 1vh;
}

html {
  width: 100%;
  overflow-x: hidden;
  height: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  height: auto;
  display: flex !important;
  visibility: visible;
  opacity: 1;
  background: linear-gradient(180deg, #050806, #0b0f0e 35%, #060a08 100%);
  color: var(--lit-text-main);
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1.25rem;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  width: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 30% 18%, rgba(0, 255, 139, 0.18), rgba(0, 0, 0, 0) 40%),
    radial-gradient(circle at 70% 62%, rgba(0, 183, 100, 0.16), rgba(0, 0, 0, 0) 46%),
    radial-gradient(circle at 48% 88%, rgba(0, 143, 80, 0.12), rgba(0, 0, 0, 0) 50%);
  opacity: 0.82;
  filter: blur(26px);
  transform: scale(1);
  transform-origin: 50% 50%;
  mix-blend-mode: lighten;
  pointer-events: none;
  z-index: -1;
  animation: bg-glow 6s ease-in-out infinite;
}

.overdrive-glow {
  position: fixed;
  inset: -6%;
  background:
    radial-gradient(circle at 18% 12%, rgba(var(--overdrive-glow), 0.28), rgba(0, 0, 0, 0) 40%),
    radial-gradient(circle at 82% 16%, rgba(var(--overdrive-glow), 0.22), rgba(0, 0, 0, 0) 46%),
    radial-gradient(circle at 12% 88%, rgba(var(--overdrive-glow), 0.24), rgba(0, 0, 0, 0) 42%),
    radial-gradient(circle at 88% 86%, rgba(var(--overdrive-glow), 0.24), rgba(0, 0, 0, 0) 48%);
  opacity: 0;
  filter: blur(18px);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.4s ease;
}

.overdrive-vignette {
  position: fixed;
  inset: -8%;
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 48%, rgba(0, 0, 0, 0.65) 78%),
    radial-gradient(circle at 50% 50%, rgba(var(--overdrive-glow), 0.2), rgba(0, 0, 0, 0) 62%);
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.4s ease;
}

.overdrive-scanlines {
  position: fixed;
  inset: -10%;
  background: repeating-linear-gradient(
    0deg,
    rgba(var(--overdrive-accent), 0.12),
    rgba(var(--overdrive-accent), 0.12) 1px,
    rgba(0, 0, 0, 0) 3px,
    rgba(0, 0, 0, 0) 6px
  );
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.4s ease;
}

body.max-level-overdrive .overdrive-glow {
  opacity: 0.75;
  animation: overdrive-edge 2.8s ease-in-out infinite;
}

body.max-level-overdrive .overdrive-vignette {
  opacity: 0.9;
  animation: overdrive-vignette 2.2s ease-in-out infinite;
}

body.max-level-overdrive .overdrive-scanlines {
  opacity: 0.55;
  animation: overdrive-scan 1.1s linear infinite;
}

body.fullscreen-active.max-level-overdrive .overdrive-glow {
  opacity: 1;
}

body.fullscreen-active.max-level-overdrive .overdrive-vignette {
  opacity: 1;
}

body.fullscreen-active.max-level-overdrive .overdrive-scanlines {
  opacity: 0.75;
}

body.max-level-overdrive:not(.fullscreen-active) .overdrive-glow,
body.max-level-overdrive:not(.fullscreen-active) .overdrive-vignette,
body.max-level-overdrive:not(.fullscreen-active) .overdrive-scanlines,
body.max-level-overdrive:not(.fullscreen-active) .stage,
body.max-level-overdrive:not(.fullscreen-active) .hud-card,
body.max-level-overdrive:not(.fullscreen-active) .mobile-topbar {
  animation: none;
}

body.max-level-overdrive:not(.fullscreen-active) .overdrive-glow {
  opacity: 0.9;
}

body.max-level-overdrive:not(.fullscreen-active) .overdrive-vignette {
  opacity: 0.95;
}

body.max-level-overdrive:not(.fullscreen-active) .overdrive-scanlines {
  opacity: 0.6;
}

body.max-level-overdrive:not(.fullscreen-active) .stage {
  border-color: rgba(var(--overdrive-accent), 0.9);
  box-shadow:
    var(--lit-shadow),
    0 0 48px rgba(var(--overdrive-accent), 0.55),
    0 0 74px rgba(var(--overdrive-accent), 0.3);
}

body.max-level-overdrive:not(.fullscreen-active) .hud-card,
body.max-level-overdrive:not(.fullscreen-active) .mobile-topbar {
  border-color: rgba(var(--overdrive-accent), 0.9);
  box-shadow: 0 0 28px rgba(var(--overdrive-accent), 0.6);
}

body.max-level-overdrive {
  --lit-dark-green: #7c0f0f;
  --lit-mid-green: #b31616;
  --lit-light-mid: #ff3b3b;
  --lit-light-green: #ff5a5a;
  --lit-neon-accent: #ff4d4d;
  --lit-shadow: 0 40px 60px rgba(255, 58, 58, 0.4);
  --overdrive-glow: 255, 70, 70;
  --overdrive-accent: 255, 70, 70;
}

body.max-level-flash::after {
  content: "";
  position: fixed;
  inset: -12%;
  background: radial-gradient(circle at 50% 50%, rgba(var(--overdrive-glow), 0.32), rgba(0, 0, 0, 0) 55%);
  mix-blend-mode: screen;
  filter: blur(18px) drop-shadow(0 0 28px rgba(var(--overdrive-accent), 0.45));
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  animation: max-level-flare 1.8s ease-out forwards;
}

body.rank-one-flash::after {
  content: "";
  position: fixed;
  inset: -6%;
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 255, 139, 0.32), rgba(0, 0, 0, 0) 58%),
    radial-gradient(circle at 50% 50%, rgba(0, 255, 210, 0.2), rgba(0, 0, 0, 0) 72%);
  background-repeat: no-repeat;
  background-position: center;
  mix-blend-mode: screen;
  filter: blur(22px) drop-shadow(0 0 40px rgba(0, 255, 139, 0.5));
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  animation: rank-one-flare 2s ease-out forwards;
}

body.rank-glitch .stage {
  animation: rank-glitch 0.55s steps(2, end);
}

body.line-clear-glow .stage {
  box-shadow:
    var(--lit-shadow),
    0 0 26px rgba(0, 255, 139, 0.35),
    inset 0 0 24px rgba(0, 255, 139, 0.2);
}

body.line-clear-shake .stage {
  animation: line-clear-shake 0.28s ease-in-out;
}

.stage {
  position: relative;
  z-index: 1;
  width: min(1200px, 100%);
  max-width: 100vw;
  background: linear-gradient(180deg, rgba(17, 22, 20, 0.95), var(--lit-bg-panel));
  border: 1px solid rgba(0, 163, 89, 0.4);
  border-radius: 1.75rem;
  padding: 2rem;
  box-shadow: var(--lit-shadow);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

body.max-level-overdrive .stage {
  animation: overdrive-stage 2.2s ease-in-out infinite;
}

body.max-level-overdrive .hud-card,
body.max-level-overdrive .mobile-topbar {
  animation: overdrive-hud 1.8s ease-in-out infinite;
}

.touch-capture {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  touch-action: none;
}

.overlay-active .touch-capture,
.config-open .touch-capture,
.config-deep .touch-capture {
  pointer-events: none;
}

@keyframes bg-glow {
  0% {
    opacity: 0.68;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
  100% {
    opacity: 0.68;
    transform: scale(0.96);
  }
}

@keyframes max-level-flare {
  0% {
    opacity: 0.2;
    transform: scale(1);
  }
  35% {
    opacity: 1;
    transform: scale(1.14);
  }
  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}

@keyframes overdrive-edge {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

@keyframes overdrive-vignette {
  0%,
  100% {
    opacity: 0.8;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes overdrive-scan {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(6px);
  }
}

@keyframes overdrive-stage {
  0%,
  100% {
    box-shadow:
      var(--lit-shadow),
      0 0 22px rgba(var(--overdrive-accent), 0.2),
      0 0 36px rgba(var(--overdrive-accent), 0.12);
    border-color: rgba(var(--overdrive-accent), 0.55);
  }
  50% {
    box-shadow:
      var(--lit-shadow),
      0 0 48px rgba(var(--overdrive-accent), 0.55),
      0 0 74px rgba(var(--overdrive-accent), 0.3);
    border-color: rgba(var(--overdrive-accent), 0.9);
  }
}

@keyframes overdrive-hud {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(var(--overdrive-accent), 0);
    border-color: rgba(var(--overdrive-accent), 0.45);
  }
  50% {
    box-shadow: 0 0 28px rgba(var(--overdrive-accent), 0.6);
    border-color: rgba(var(--overdrive-accent), 0.9);
  }
}

@keyframes rank-one-flare {
  0% {
    opacity: 0.24;
    transform: scale(1);
  }
  35% {
    opacity: 1;
    transform: scale(1.12);
  }
  100% {
    opacity: 0;
    transform: scale(1.32);
  }
}

@keyframes rank-glitch {
  0% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(-2px, 2px);
  }
  40% {
    transform: translate(2px, -2px);
  }
  60% {
    transform: translate(-1px, -3px);
  }
  80% {
    transform: translate(3px, 1px);
  }
  100% {
    transform: translate(0, 0);
  }
}

@keyframes line-clear-shake {
  0% {
    transform: translate3d(0, 0, 0);
  }
  25% {
    transform: translate3d(-4px, 2px, 0);
  }
  55% {
    transform: translate3d(3px, -3px, 0);
  }
  80% {
    transform: translate3d(-2px, 2px, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}
@keyframes max-level-flare {
  0% {
    opacity: 0.22;
    transform: scale(1);
  }
  40% {
    opacity: 1;
    transform: scale(1.12);
  }
  100% {
    opacity: 0;
    transform: scale(1.3);
  }
}

header {
  text-align: center;
}

header h1 {
  margin-bottom: 0.35rem;
  letter-spacing: 0.08em;
  font-size: clamp(2rem, 2.8vw, 3rem);
}

header p {
  margin: 0;
  color: rgba(217, 247, 232, 0.9);
  font-size: 1rem;
}

.server-banner {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 0.4rem);
  left: 0;
  right: 0;
  z-index: 25;
  padding: 0.35rem 0.75rem;
  color: #ff6b6b;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(0, 0, 0, 0.78);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  overflow: hidden;
  --banner-accent: rgba(0, 255, 139, 0.7);
}

.server-banner--red {
  color: #ff6b6b;
  --banner-accent: rgba(255, 107, 107, 0.8);
}

.server-banner--white {
  color: #f4fff9;
  --banner-accent: rgba(244, 255, 249, 0.75);
}

.server-banner--rainbow {
  color: #f4fff9;
  background: rgba(0, 0, 0, 0.78);
  --banner-accent: rgba(0, 255, 139, 0.8);
}

.server-banner--rainbow .server-banner__text {
  background: linear-gradient(90deg, #00ff8b, #8affff, #ffd36a, #00ff8b);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: banner-rainbow 6s linear infinite;
}

.server-banner--blink {
  animation: banner-blink 1.1s steps(2, end) infinite;
}

.server-banner--rainbow.server-banner--blink {
  animation: banner-blink 1.1s steps(2, end) infinite;
}

.server-banner--rainbow.server-banner--blink .server-banner__text {
  animation: banner-rainbow 6s linear infinite, banner-blink 1.1s steps(2, end) infinite;
}

.server-banner--glitch .server-banner__text {
  animation: banner-glitch 7s steps(1, end) infinite;
}

.server-banner--rainbow.server-banner--glitch .server-banner__text {
  animation: banner-rainbow 6s linear infinite, banner-glitch 7s steps(1, end) infinite;
}

.server-banner--underline .server-banner__text::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.15rem;
  height: 2px;
  background: linear-gradient(90deg, rgba(0, 255, 139, 0.1), rgba(0, 255, 139, 0.8), rgba(0, 255, 139, 0.1));
  box-shadow: 0 0 10px rgba(0, 255, 139, 0.4);
  animation: banner-underline 2.8s ease-in-out infinite;
}

.server-banner--active {
  opacity: 1;
}

.server-banner__badge {
  display: none;
  align-items: center;
  justify-content: center;
  margin-right: 0.5rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--banner-accent);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--lit-text-main);
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.45);
  flex: 0 0 auto;
  z-index: 1;
}

.server-banner__badge--active {
  display: inline-flex;
}

.server-banner__badge--info {
  border-color: rgba(0, 255, 139, 0.8);
  color: #bfffe6;
}

.server-banner__badge--warn {
  border-color: rgba(255, 183, 70, 0.85);
  color: #ffe0a6;
}

.server-banner__badge--live {
  border-color: rgba(0, 225, 255, 0.85);
  color: #c6f7ff;
}

.server-banner__text {
  position: relative;
  flex: 1 1 auto;
  padding-right: 2rem;
  z-index: 1;
}

.server-banner__close {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: currentColor;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  z-index: 1;
}

.server-banner__close:focus-visible {
  outline: 2px solid rgba(255, 107, 107, 0.5);
  outline-offset: 2px;
}

.server-banner--white .server-banner__close:focus-visible,
.server-banner--rainbow .server-banner__close:focus-visible {
  outline-color: rgba(244, 255, 249, 0.6);
}

@media (max-width: 820px) {
  .server-banner {
    padding: 0.35rem 0.5rem;
  }

  .server-banner__close {
    right: 0.45rem;
  }
}

@keyframes banner-rainbow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

@keyframes banner-glitch {
  0%,
  94%,
  100% {
    transform: none;
    text-shadow: none;
  }
  95% {
    transform: translateX(-1px);
    text-shadow: -1px 0 rgba(0, 255, 139, 0.7), 1px 0 rgba(255, 107, 107, 0.6);
  }
  96% {
    transform: translateX(1px);
    text-shadow: 1px 0 rgba(0, 225, 255, 0.6), -1px 0 rgba(255, 213, 106, 0.6);
  }
  97% {
    transform: translateX(-1px);
    text-shadow: -1px 0 rgba(0, 255, 139, 0.6), 1px 0 rgba(255, 107, 107, 0.4);
  }
}

@keyframes banner-underline {
  0% {
    opacity: 0.3;
    transform: scaleX(0.6);
  }
  50% {
    opacity: 1;
    transform: scaleX(1);
  }
  100% {
    opacity: 0.3;
    transform: scaleX(0.6);
  }
}

@keyframes banner-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.game-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}

.canvas-wrapper {
  position: relative;
  background: radial-gradient(circle at 15% 20%, rgba(0, 255, 139, 0.08), rgba(11, 22, 20, 0.95));
  border-radius: 1.4rem;
  padding: 0.6rem;
  border: 2px solid rgba(0, 183, 100, 0.4);
  box-shadow: inset 0 0 30px rgba(0, 225, 123, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.combo-toast {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  justify-items: center;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.2s ease, transform 0.25s ease;
  font-size: clamp(1.1rem, 2.8vw, 1.8rem);
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--lit-light-green);
  text-shadow:
    0 0 10px rgba(0, 255, 139, 0.7),
    0 0 24px rgba(0, 255, 139, 0.4),
    0 0 46px rgba(0, 255, 139, 0.3);
  z-index: 6;
}

.combo-toast--visible {
  opacity: 1;
  transform: scale(1);
  animation: combo-pop 0.65s ease;
}

.combo-toast--max {
  font-size: clamp(1.5rem, 3.6vw, 2.4rem);
  letter-spacing: 0.26em;
  color: #d4fff0;
  text-shadow:
    0 0 12px rgba(0, 255, 139, 0.9),
    0 0 32px rgba(0, 255, 139, 0.6),
    0 0 52px rgba(0, 255, 139, 0.5);
  animation: combo-pop 0.65s ease, max-toast-glow 1.6s ease-in-out;
}

.combo-toast--first {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  letter-spacing: 0.3em;
  background: linear-gradient(
    120deg,
    #00ff8b,
    #00f0d0,
    #00b764,
    #00ff8b,
    #00f0d0
  );
  background-size: 240% 240%;
  background-position: 0 50%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 14px rgba(0, 255, 139, 0.95),
    0 0 34px rgba(0, 255, 139, 0.7),
    0 0 62px rgba(0, 255, 139, 0.55);
  animation: combo-pop 0.65s ease, max-toast-glow 1.8s ease-in-out, rainbow-shift 3s linear infinite;
}

.combo-toast--rank {
  font-size: clamp(1.25rem, 3vw, 2rem);
  letter-spacing: 0.24em;
  color: #ccffe5;
  text-shadow:
    0 0 10px rgba(0, 255, 139, 0.7),
    0 0 22px rgba(0, 255, 139, 0.45),
    0 0 40px rgba(0, 255, 139, 0.35);
}

.line-clear-toast {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0;
  pointer-events: none;
  font-size: clamp(1.05rem, 2.2vw, 1.5rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #b8ffe0;
  text-shadow:
    0 0 8px rgba(0, 255, 139, 0.55),
    0 0 18px rgba(0, 255, 139, 0.35);
  z-index: 6;
}

.line-clear-toast--visible {
  opacity: 1;
  animation: line-clear-pop 0.9s ease;
}

@keyframes combo-pop {
  0% {
    transform: scale(0.75);
    opacity: 0;
  }
  35% {
    transform: scale(1.08);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.92;
  }
}

@keyframes line-clear-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.82);
  }
  40% {
    opacity: 1;
    transform: translate(-50%, -54%) scale(1.05);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -70%) scale(0.96);
  }
}

@keyframes max-toast-glow {
  0% {
    text-shadow:
      0 0 10px rgba(0, 255, 139, 0.5),
      0 0 28px rgba(0, 255, 139, 0.35);
  }
  50% {
    text-shadow:
      0 0 18px rgba(0, 255, 139, 0.85),
      0 0 42px rgba(0, 255, 139, 0.6),
      0 0 62px rgba(0, 255, 139, 0.5);
  }
  100% {
    text-shadow:
      0 0 10px rgba(0, 255, 139, 0.5),
      0 0 28px rgba(0, 255, 139, 0.35);
  }
}

@keyframes rainbow-shift {
  0% {
    background-position: 0 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.mobile-topbar {
  position: fixed;
  top: 0.5rem;
  left: 0.75rem;
  right: 0.75rem;
  display: none;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.55rem;
  background: rgba(11, 22, 20, 0.94);
  border: 1px solid rgba(0, 255, 139, 0.45);
  border-radius: 0.9rem;
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.55);
  z-index: 12;
}

.overlay-active .mobile-topbar {
  display: none;
}

.config-open .canvas-wrapper {
  position: relative;
  isolation: isolate;
  border-color: rgba(0, 0, 0, 0.4);
  box-shadow: none;
  background: rgba(2, 6, 23, 0.9);
}

.config-open .canvas-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 30%, rgba(0, 255, 139, 0.08), rgba(2, 6, 23, 0.92));
  pointer-events: none;
  z-index: 1;
}

.config-open .canvas-wrapper canvas,
.config-open .canvas-wrapper .snow-canvas {
  opacity: 0.12;
}

.config-open .pause-overlay,
.config-open .game-over-overlay {
  z-index: 2;
}

.config-open .pause-overlay {
  border-color: transparent;
  background: rgba(2, 6, 23, 0.96);
  box-shadow: none;
  z-index: 3;
}

.config-open .mobile-topbar {
  opacity: 0.6;
  filter: saturate(0.7) brightness(0.7);
}

.config-open .mobile-topbar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

@media (max-width: 820px) {
  .config-open .canvas-wrapper {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
  }
.config-open .mobile-preview canvas {
  border-color: transparent;
  box-shadow: none;
}
  .config-open .game-panel {
    gap: 0.5rem;
  }
}

.config-deep .hud-panel,
.config-deep .backend-status-wrapper,
.config-deep .leaderboard-mini,
.config-deep .controls,
.config-deep footer,
.config-deep header {
  opacity: 0.2;
  filter: blur(1px);
  pointer-events: none;
}

.config-deep .stage {
  position: relative;
  overflow: hidden;
}

.config-deep .stage::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 25%, rgba(0, 255, 139, 0.04), rgba(2, 6, 23, 0.35));
  z-index: 5;
  pointer-events: none;
}

.config-deep .pause-overlay,
.config-deep .game-over-overlay {
  z-index: 6;
}

.tutorial-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 22;
  pointer-events: none;
}

.tutorial-overlay--visible {
  display: flex;
}

.tutorial-overlay__backdrop {
  display: none;
}

.tutorial-overlay__panel {
  position: relative;
  z-index: 26;
  pointer-events: auto;
  background: rgba(11, 22, 20, 0.94);
  border: 1px solid rgba(0, 225, 123, 0.8);
  border-radius: 1rem;
  box-shadow: 0 24px 46px rgba(0, 0, 0, 0.6);
  padding: 1rem 1.1rem;
  width: min(440px, 92%);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tutorial-overlay__eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: rgba(217, 247, 232, 0.7);
}

.tutorial-overlay__title {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.06em;
}

.tutorial-overlay__text {
  margin: 0;
  color: rgba(217, 247, 232, 0.86);
  line-height: 1.5;
}

.tutorial-overlay__progress {
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lit-neon-accent);
}

.tutorial-overlay__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tutorial-overlay__nav {
  display: flex;
  gap: 0.5rem;
}

.tutorial-overlay__button {
  padding: 0.5rem 0.9rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(0, 255, 139, 0.7);
  background: linear-gradient(135deg, rgba(0, 255, 139, 0.25), rgba(11, 22, 20, 0.95));
  color: var(--lit-text-main);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tutorial-overlay__button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.35);
}

.tutorial-overlay__button--ghost {
  background: rgba(11, 22, 20, 0.9);
  border-color: rgba(0, 255, 139, 0.5);
}

#tutorialHighlightOverlay {
  position: fixed;
  pointer-events: none;
  border-radius: 16px;
  border: 2px solid rgba(0, 255, 139, 0.9);
  box-shadow:
    0 0 38px rgba(0, 255, 139, 0.75),
    0 12px 38px rgba(0, 0, 0, 0.55);
  z-index: 21;
  transition: all 0.15s ease;
  animation: tutorial-pulse 1.1s ease-in-out infinite alternate;
  display: none;
}

#tutorialBackdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 30%, rgba(0, 255, 139, 0.06), rgba(2, 6, 23, 0.5));
  backdrop-filter: blur(1px);
  opacity: 1;
  z-index: 18;
  display: none;
}

@keyframes tutorial-pulse {
  from {
    box-shadow:
      0 0 38px rgba(0, 255, 139, 0.75),
      0 12px 38px rgba(0, 0, 0, 0.55);
  }
  to {
    box-shadow:
      0 0 62px rgba(0, 255, 139, 0.9),
      0 18px 52px rgba(0, 0, 0, 0.65);
  }
}

body.tutorial-active {
  overflow: hidden;
}

body.tutorial-active .mobile-topbar {
  z-index: 20;
  display: flex;
}

.mobile-ui-active .mobile-topbar,
body.fullscreen-active .mobile-topbar {
  display: flex;
}

.mobile-topbar__hud {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.45rem;
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
  overflow: hidden;
}

.mobile-topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.mobile-bossfight {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.28rem 0.48rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(0, 225, 123, 0.4);
  background: linear-gradient(180deg, rgba(0, 163, 89, 0.16), rgba(11, 22, 20, 0.92));
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
  flex: 1 1 0;
  min-width: 0;
  min-height: 40px;
}

.mobile-bossfight .mobile-stat__label {
  text-align: center;
}

.mobile-bossfight--active {
  display: flex;
}

.mobile-bossfight__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  font-size: 0.54rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(217, 247, 232, 0.85);
  white-space: nowrap;
}

.mobile-bossfight__value {
  max-width: 5ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-bossfight__label {
  font-weight: 600;
  color: rgba(0, 255, 139, 0.85);
}

.mobile-bossfight__phase {
  font-weight: 600;
  color: rgba(0, 255, 139, 0.8);
  max-width: 10ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-bossfight__bar {
  height: 1.4em;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 139, 0.35);
  background: rgba(2, 6, 23, 0.75);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(217, 247, 232, 0.95);
  letter-spacing: 0;
}

.mobile-bossfight__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(0, 255, 139, 0.6), rgba(0, 163, 89, 0.9));
  transition: width 0.2s ease;
  z-index: 0;
}

.mobile-bossfight__count {
  position: relative;
  z-index: 1;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  font-size: clamp(0.75rem, 3.4vw, 0.95rem);
  font-weight: 700;
  color: var(--lit-neon-accent);
}

.mobile-bossfight__marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(217, 247, 232, 0.6);
}

.mobile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.28rem 0.48rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(0, 225, 123, 0.4);
  background: linear-gradient(180deg, rgba(0, 163, 89, 0.16), rgba(11, 22, 20, 0.92));
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
  flex: 1 1 0;
  min-width: 0;
  min-height: 40px;
}

body.bossfight-compact .mobile-preview {
  display: none;
}

body.bossfight-compact .mobile-topbar__hud {
  gap: 0.35rem;
}

body.bossfight-compact .mobile-stat {
  padding: 0.24rem 0.38rem;
}

body.bossfight-compact .mobile-bossfight {
  padding: 0.24rem 0.38rem;
}

body.bossfight-active .hud-card--preview {
  display: none;
}

body.bossfight-active .mobile-preview {
  display: none;
}

.mobile-stat__label {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(217, 247, 232, 0.8);
  white-space: nowrap;
}

.mobile-stat__value {
  font-size: clamp(0.75rem, 3.4vw, 0.95rem);
  font-weight: 700;
  color: var(--lit-neon-accent);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  max-width: 7ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  flex: 0 0 auto;
}

.mobile-preview canvas {
  width: 42px;
  height: 42px;
  border-radius: 0.6rem;
  border: 1px dashed rgba(0, 255, 139, 0.6);
  background: rgba(2, 6, 23, 0.8);
  box-shadow: inset 0 0 16px rgba(0, 255, 139, 0.2);
}

.mobile-icon-button {
  width: 40px;
  height: 40px;
  border-radius: 0.75rem;
  border: 1px solid rgba(0, 255, 139, 0.65);
  background: linear-gradient(135deg, rgba(0, 225, 123, 0.24), rgba(11, 22, 20, 0.95));
  color: var(--lit-text-main);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  padding: 0;
}

.mobile-icon-button:hover {
  border-color: rgba(0, 255, 139, 0.9);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.mobile-icon-button:active {
  transform: translateY(1px);
}

.mobile-icon-button .icon {
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  line-height: 1;
}

.cheat-badge {
  position: absolute;
  top: 0.8rem;
  right: 0.9rem;
  padding: 0.4rem 0.85rem;
  border-radius: 0.75rem;
  background: rgba(0, 163, 89, 0.14);
  border: 1px solid rgba(0, 225, 123, 0.45);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lit-neon-accent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s ease;
}

.cheat-badge--visible {
  opacity: 1;
}

.game-canvas,
.preview-canvas {
  width: min(100%, 260px);
  height: auto;
  aspect-ratio: 1 / 2;
  background-color: var(--lit-bg-dark);
  border-radius: 1rem;
  image-rendering: pixelated;
  border: 3px solid rgba(0, 225, 123, 0.4);
  box-shadow: inset 0 -4px 25px rgba(0, 163, 89, 0.6), inset 0 0 12px rgba(0, 255, 139, 0.25);
  touch-action: none;
}

.snow-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 1rem;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: normal;
  opacity: 0.9;
}

.bossfight-fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 1rem;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s ease;
}

body.bossfight-active .bossfight-fx-canvas {
  opacity: 1;
}

.pause-overlay,
.game-over-overlay {
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8;
}

.ready-overlay {
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.6);
  border: 2px solid rgba(0, 225, 123, 0.7);
  color: var(--lit-text-main);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 8;
}

.ready-overlay--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ready-overlay__panel {
  background: rgba(11, 22, 20, 0.95);
  border: 1px solid rgba(0, 225, 123, 0.7);
  border-radius: 1rem;
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.6);
  padding: 1rem 1.1rem;
  width: min(360px, 92%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}

.ready-overlay__eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: rgba(217, 247, 232, 0.7);
}

.ready-overlay__title {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
}

.ready-overlay__text {
  margin: 0;
  color: rgba(217, 247, 232, 0.85);
  line-height: 1.5;
}

.ready-overlay__actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
}

.ready-overlay__button {
  padding: 0.55rem 0.85rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(0, 255, 139, 0.7);
  background: linear-gradient(135deg, rgba(0, 255, 139, 0.25), rgba(11, 22, 20, 0.95));
  color: var(--lit-text-main);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ready-overlay__button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.35);
}

.ready-overlay__button--ghost {
  background: rgba(0, 255, 139, 0.08);
  border-color: rgba(0, 255, 139, 0.5);
}

.pause-overlay {
  background: rgba(2, 6, 23, 0.76);
  border: 2px solid rgba(0, 225, 123, 0.8);
  flex-direction: column;
  color: var(--lit-text-main);
  font-size: 1rem;
  transition: opacity 0.2s ease, visibility 0.2s ease, background 0.2s ease;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pause-overlay--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.pause-overlay__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
  margin: 0 0 0.35rem 0;
  padding: 0 0 0.45rem 0;
  background: transparent;
  border-bottom: none;
  box-shadow: none;
}

.pause-overlay--config .pause-overlay__header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  margin: -1.1rem -1.2rem 0.55rem -1.2rem;
  padding: 0.55rem 1.2rem 0.6rem;
  background: linear-gradient(180deg, rgba(11, 22, 20, 0.95), rgba(0, 163, 89, 0.1));
  border-bottom: 1px solid rgba(0, 225, 123, 0.24);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.32);
}

.pause-overlay__panel {
  background: linear-gradient(180deg, rgba(0, 163, 89, 0.24), rgba(11, 22, 20, 0.95));
  border: 1px solid rgba(0, 225, 123, 0.65);
  box-shadow: 0 24px 42px rgba(0, 0, 0, 0.55);
  border-radius: 1rem;
  padding: 1.1rem 1.2rem;
  width: min(360px, 92%);
  max-width: calc(100vw - 2rem);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
  position: relative;
  max-height: min(82vh, 720px);
  overflow: hidden;
}

.pause-overlay__resume {
  align-self: flex-end;
  min-width: 120px;
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(0, 255, 139, 0.65);
  background: linear-gradient(135deg, rgba(0, 255, 139, 0.2), rgba(11, 22, 20, 0.95));
  color: var(--lit-text-main);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pause-overlay__resume:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.35);
}

.pause-overlay__title {
  margin: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 1.2rem;
}

.pause-overlay__main {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  padding: 0 0.1rem 0.2rem 0;
  scroll-padding-top: 0.9rem;
}

.pause-overlay__actions {
  display: grid;
  align-items: stretch;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.pause-overlay__action {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  border: 1px solid rgba(0, 255, 139, 0.65);
  background: linear-gradient(135deg, rgba(0, 255, 139, 0.22), rgba(11, 22, 20, 0.95));
  color: var(--lit-text-main);
  font-size: clamp(0.72rem, 2.4vw, 0.86rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-align: center;
  white-space: normal;
  line-height: 1.15;
}

.pause-overlay__action:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.35);
}

.pause-overlay__action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
  transform: none;
}

.pause-overlay__action--ghost {
  background: rgba(0, 255, 139, 0.08);
  border-color: rgba(0, 255, 139, 0.55);
}

.pause-overlay__settings-btn,
.pause-overlay__back {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(0, 255, 139, 0.65);
  background: linear-gradient(135deg, rgba(0, 255, 139, 0.18), rgba(11, 22, 20, 0.95));
  color: var(--lit-text-main);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-align: center;
  white-space: nowrap;
}

.pause-overlay__settings-btn:hover,
.pause-overlay__back:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.35);
}

.pause-overlay__hint {
  grid-column: 1 / -1;
  margin: 0;
  text-align: center;
}

.pause-overlay__config {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0.1rem 0.2rem 0;
  scroll-padding-top: 0.9rem;
}

.pause-config__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pause-overlay--config .pause-overlay__main {
  display: none;
}

.pause-overlay--config .pause-overlay__config {
  display: flex;
}

.pause-overlay--config .pause-overlay__panel {
  background: #0e1412;
  border-color: rgba(0, 225, 123, 0.9);
  box-shadow: 0 24px 46px rgba(0, 0, 0, 0.6);
}

.pause-overlay--config {
  background: transparent;
}

.pause-overlay__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 0.65rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(0, 255, 139, 0.35);
  background: linear-gradient(135deg, rgba(0, 255, 139, 0.08), rgba(2, 6, 23, 0.85));
}

.pause-meta__item {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.pause-meta__item--pending {
  align-items: center;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.25rem 0.45rem;
  grid-column: 1 / -1;
}

.pause-meta__item--pending .pause-meta__label,
.pause-meta__item--pending .pause-meta__value,
.pause-meta__item--pending .pause-meta__subvalue {
  font-size: 0.74rem;
}

.pause-meta__item--pending .pause-meta__value {
  font-size: 0.74rem;
  font-weight: 700;
}

.pause-meta__label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(217, 247, 232, 0.78);
}

.pause-meta__value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--lit-neon-accent);
}

.pause-meta__value--last-run {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem 0.6rem;
  font-size: 0.9rem;
  color: var(--lit-text-main);
}

.pause-last-run__cell {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.pause-last-run__label {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(217, 247, 232, 0.65);
}

.pause-last-run__value {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--lit-neon-accent);
}

.pause-last-run__value--compact {
  font-size: clamp(0.74rem, 2.6vw, 0.88rem);
  letter-spacing: 0.02em;
}

.pause-last-run__empty {
  font-size: 0.92rem;
  color: rgba(217, 247, 232, 0.6);
}

.pause-meta__item--status .pause-meta__value {
  color: var(--lit-text-main);
}

.pause-meta__item--status .pause-meta__value--online {
  color: var(--lit-light-green);
}

.pause-meta__item--status .pause-meta__value--offline {
  color: #ff8c8c;
}

.pause-meta__subvalue {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.pause-meta__item--pending .pause-meta__subvalue {
  margin-top: 0;
  color: rgba(217, 247, 232, 0.72);
}

.pause-meta__item--pending .pause-meta__subvalue.pause-meta__subvalue--good {
  color: var(--lit-light-green);
}

.pause-meta__item--pending .pause-meta__subvalue.pause-meta__subvalue--bad {
  color: #ff8c8c;
}

.pause-meta__subvalue--hidden {
  display: none;
}

.pause-rank__label {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(217, 247, 232, 0.65);
}

.pause-rank__pill {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--lit-neon-accent);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 139, 0.4);
  background: rgba(0, 255, 139, 0.08);
}

.pause-overlay__settings {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.setting-row__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.setting-row__action {
  --setting-action-width: 150px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.85rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(0, 255, 139, 0.6);
  background: linear-gradient(135deg, rgba(0, 255, 139, 0.16), rgba(11, 22, 20, 0.95));
  color: var(--lit-text-main);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-width: var(--setting-action-width);
  min-height: 36px;
  text-align: center;
}

.setting-row__action:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.35);
}

.setting-row__action--danger {
  border-color: rgba(255, 140, 140, 0.7);
  background: linear-gradient(135deg, rgba(255, 140, 140, 0.2), rgba(11, 22, 20, 0.95));
  color: #ffdede;
}

.pause-overlay__hint {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(217, 247, 232, 0.75);
  text-align: center;
  grid-column: 1 / -1;
}

.pause-overlay .setting-row {
  width: 100%;
}

.setting-row--compact .setting-row__hint {
  font-size: 0.82rem;
}

.game-over-overlay {
  padding: 1.2rem;
  border: 2px solid rgba(0, 225, 123, 0.6);
  background: rgba(2, 6, 23, 0.9);
  flex-direction: column;
  gap: 0.8rem;
  text-align: center;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--lit-text-main);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}

.game-over-overlay--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.game-over-title {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.game-over-stats {
  display: grid;
  gap: 0.35rem;
}

.game-over-stats p {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.1em;
}

.game-over-label {
  display: block;
  font-size: 0.65rem;
  opacity: 0.7;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.game-over-overlay button {
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1.5rem;
  background: linear-gradient(135deg, var(--lit-light-mid), var(--lit-light-green));
  color: var(--lit-bg-dark);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.game-over-overlay button:hover {
  transform: translateY(-1px);
}

.game-over-button--ghost {
  background: rgba(0, 255, 139, 0.08);
  border: 1px solid rgba(0, 255, 139, 0.5);
  color: var(--lit-text-main);
}

.game-over-tip {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.feedback-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 24;
}

.feedback-overlay--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.feedback-panel {
  width: min(520px, 92%);
  background: linear-gradient(180deg, rgba(0, 163, 89, 0.2), rgba(11, 22, 20, 0.96));
  border: 1px solid rgba(0, 255, 139, 0.6);
  border-radius: 1.1rem;
  padding: 1.1rem 1.3rem;
  color: var(--lit-text-main);
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.feedback-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.feedback-panel__title {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.9rem;
}

.feedback-panel__close {
  border: none;
  background: rgba(0, 255, 139, 0.12);
  color: var(--lit-text-main);
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
}

.feedback-panel__hint {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.8;
}

.feedback-panel__label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.feedback-panel__input {
  width: 100%;
  border-radius: 0.8rem;
  border: 1px solid rgba(0, 255, 139, 0.35);
  background: rgba(6, 12, 12, 0.9);
  color: var(--lit-text-main);
  padding: 0.75rem 0.85rem;
  resize: vertical;
  min-height: 110px;
  font-family: "Segoe UI", system-ui, sans-serif;
}

.feedback-panel__meta {
  border-radius: 0.8rem;
  border: 1px solid rgba(0, 255, 139, 0.25);
  background: rgba(6, 12, 12, 0.7);
  padding: 0.6rem 0.75rem;
}

.feedback-panel__meta-title {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  opacity: 0.7;
}

.feedback-panel__meta-text {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  opacity: 0.9;
}

.feedback-panel__actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}

.feedback-panel__button {
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  background: linear-gradient(135deg, var(--lit-light-mid), var(--lit-light-green));
  color: var(--lit-bg-dark);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.feedback-panel__button--ghost {
  background: rgba(0, 255, 139, 0.08);
  border: 1px solid rgba(0, 255, 139, 0.5);
  color: var(--lit-text-main);
}

.feedback-panel__status {
  margin: 0;
  min-height: 1.1rem;
  font-size: 0.8rem;
  opacity: 0.8;
}

.hud-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hud-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.hud-card {
  background: linear-gradient(180deg, rgba(0, 163, 89, 0.12), rgba(11, 22, 20, 0.9));
  border-radius: 1.2rem;
  padding: 1.2rem;
  border: 1px solid rgba(0, 163, 89, 0.45);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.hud-card--highlight {
  border-color: rgba(0, 255, 139, 0.9);
  background: linear-gradient(180deg, rgba(0, 225, 123, 0.2), rgba(11, 22, 20, 0.95));
}

.hud-card__title {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lit-text-main);
}

.hud-value {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--lit-neon-accent);
}

.hud-value--brand {
  font-size: 1.6rem;
  color: rgba(255, 255, 255, 0.92);
}

.hud-card__sub {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(217, 247, 232, 0.8);
}

.hud-input-label {
  font-size: 0.8rem;
  color: rgba(217, 247, 232, 0.85);
  margin: 0.25rem 0 0.35rem;
}

.hud-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(0, 163, 89, 0.35);
  background: rgba(11, 22, 20, 0.85);
  color: var(--lit-text-main);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hud-input:focus {
  border-color: rgba(0, 255, 139, 0.8);
  box-shadow: 0 0 0 3px rgba(0, 255, 139, 0.12);
}

.hud-card--preview canvas {
  width: 80px;
  max-width: 140px;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 0.8rem;
  border: 1px dashed rgba(0, 255, 139, 0.6);
  background-color: rgba(2, 6, 23, 0.6);
  box-shadow: inset 0 0 20px rgba(15, 23, 42, 0.9);
}

.hud-card--preview {
  grid-column: span 3;
  min-width: 0;
}

.preview-stack {
  display: flex;
  flex-direction: row;
  gap: 0.6rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.hud-card--brand,
.hud-card--compact {
  grid-row: 2;
}

.hud-card--brand {
  background: linear-gradient(180deg, rgba(0, 163, 89, 0.2), rgba(11, 22, 20, 0.95));
  border-color: rgba(0, 163, 89, 0.55);
}

.hud-card--compact {
  gap: 0.55rem;
}

.hud-edit-button {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(0, 255, 139, 0.7);
  background: linear-gradient(135deg, rgba(0, 225, 123, 0.3), rgba(11, 22, 20, 0.95));
  color: var(--lit-text-main);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hud-edit-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.35);
}

.backend-status-wrapper {
  width: 100%;
}

.status-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: stretch;
}

.status-pair .backend-status {
  flex: 1 1 260px;
  min-height: 4.1rem;
}

.status-pair .backend-status__detail {
  min-height: 1rem;
}

body.leaderboard-page .status-pair {
  gap: 0.65rem;
}

body.leaderboard-page .status-pair .backend-status {
  min-height: 3.6rem;
  padding: 0.65rem 0.9rem;
}

.backend-status {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: rgba(11, 22, 20, 0.9);
  border-radius: 1rem;
  border: 1px solid rgba(255, 89, 89, 0.45);
  padding: 0.85rem 1rem;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
}

@media (min-width: 900px) {
  .status-pair {
    flex-wrap: nowrap;
  }
}

.backend-status--online {
  border-color: rgba(0, 255, 139, 0.9);
}

.backend-status__signal {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 89, 89, 0.9);
  box-shadow: 0 0 14px rgba(255, 89, 89, 0.7);
}

.backend-status--online .backend-status__signal {
  background: var(--lit-mid-green);
  box-shadow: 0 0 18px rgba(0, 225, 123, 0.9);
}

.backend-status__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.backend-status__title {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.backend-status__detail {
  margin: 0;
  font-size: 0.7rem;
  color: rgba(217, 247, 232, 0.75);
}

.leaderboard-mini {
  margin-top: 0.8rem;
  background: var(--lit-bg-panel);
  border-radius: 1rem;
  border: 1px solid rgba(0, 163, 89, 0.35);
  box-shadow: 0 18px 35px rgba(2, 6, 23, 0.45);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.leaderboard-mini__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.leaderboard-mini__header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.leaderboard-mini__header h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lit-text-main);
}

.leaderboard-mini__list {
  margin: 0;
  padding-left: 0;
  display: grid;
  gap: 0.35rem;
  list-style: none;
}

.leaderboard-mini__item {
  list-style: none;
  padding: 0.35rem 0.5rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(0, 163, 89, 0.25);
  background: rgba(0, 163, 89, 0.08);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem;
  align-items: center;
}

.leaderboard-mini__item span {
  display: block;
}

.leaderboard-mini__name {
  font-weight: 600;
  color: var(--lit-text-main);
}

.leaderboard-name {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.title-icon {
  position: relative;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--title-radius, 0.12rem);
  border: 1px solid rgba(0, 255, 139, 0.55);
  background: rgba(0, 255, 139, 0.18);
  box-shadow: 0 0 8px rgba(0, 255, 139, var(--title-glow, 0.35));
  transform: rotate(var(--title-rotate, 45deg));
  flex: 0 0 auto;
}

.title-icon--svg {
  width: 0.8rem;
  height: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: none;
  margin-right: 0.2rem;
  border: none;
  background: transparent;
}

.title-icon--svg svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  fill-opacity: 0.14;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px var(--title-glow-color, rgba(0, 255, 139, 0.35)));
}

.title-icon__chip {
  position: absolute;
  right: -0.34rem;
  bottom: -0.1rem;
  padding: 0.02rem 0.14rem;
  border-radius: 0.14rem;
  background: rgba(11, 15, 14, 0.85);
  font-size: 0.32rem;
  font-weight: 700;
  color: rgba(217, 247, 232, 0.95);
  letter-spacing: 0.05em;
  text-shadow: 0 0 6px rgba(0, 255, 139, 0.55);
  pointer-events: none;
}

.title-icon--gold {
  border-color: rgba(0, 255, 139, 0.95);
  background: rgba(0, 255, 139, 0.5);
  box-shadow: 0 0 10px rgba(0, 255, 139, var(--title-glow, 0.6));
  color: rgba(0, 255, 139, 0.95);
  --title-glow-color: rgba(0, 255, 139, 0.6);
}

.title-icon--silver {
  border-color: rgba(0, 183, 100, 0.8);
  background: rgba(0, 183, 100, 0.3);
  box-shadow: 0 0 8px rgba(0, 183, 100, var(--title-glow, 0.45));
  color: rgba(0, 183, 100, 0.9);
  --title-glow-color: rgba(0, 183, 100, 0.5);
}

.title-icon--silver .title-icon__chip {
  text-shadow: 0 0 6px rgba(0, 183, 100, 0.45);
}

.title-icon--mint {
  border-color: rgba(0, 225, 123, 0.9);
  background: rgba(0, 225, 123, 0.35);
  box-shadow: 0 0 10px rgba(0, 225, 123, var(--title-glow, 0.55));
  color: rgba(0, 225, 123, 0.95);
  --title-glow-color: rgba(0, 225, 123, 0.6);
}

.title-icon--svg.title-icon--gold,
.title-icon--svg.title-icon--silver,
.title-icon--svg.title-icon--mint {
  background: transparent;
  border: none;
  box-shadow: none;
}

.title-icon--crown svg {
  filter: drop-shadow(0 0 4px var(--title-glow-color, rgba(0, 255, 139, 0.45)))
    drop-shadow(0 0 6px var(--title-glow-color, rgba(0, 255, 139, 0.45)));
}

.title-icon--trophy svg {
  filter: drop-shadow(0 0 4px var(--title-glow-color, rgba(0, 255, 139, 0.45)));
}

.title-icon--flame svg {
  fill-opacity: 0.38;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.title-icon--diamond-year::after {
  content: attr(data-year);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.28rem;
  font-weight: 700;
  color: rgba(217, 247, 232, 0.95);
  letter-spacing: 0.04em;
  text-shadow: 0 0 6px rgba(0, 255, 139, 0.55);
  transform: rotate(calc(-1 * var(--title-rotate, 45deg)));
  pointer-events: none;
}

.title-icon--silver.title-icon--diamond-year::after {
  text-shadow: 0 0 6px rgba(0, 183, 100, 0.45);
}

.title-legend {
  margin: 0.6rem 0 0.8rem;
  padding: 0.4rem 0.6rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(0, 255, 139, 0.18);
  background: rgba(17, 22, 20, 0.7);
  display: grid;
  gap: 0.3rem;
}

.title-legend__title {
  margin: 0;
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(0, 255, 139, 0.7);
}

.title-legend__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.7rem;
}

.title-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  line-height: 1.1;
  color: rgba(217, 247, 232, 0.78);
}

.title-legend__item .title-icon--svg {
  margin-right: 0;
}

.title-legend--compact {
  margin: 0.45rem 0 0.7rem;
  padding: 0.35rem 0.55rem;
}

.title-legend--compact .title-legend__title {
  font-size: 0.54rem;
}

.title-legend--compact .title-legend__item {
  font-size: 0.64rem;
}

.leaderboard-mini__meta {
  font-size: 0.8rem;
  color: rgba(217, 247, 232, 0.8);
}

.leaderboard-mini__badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--lit-text-main);
  border: 1px solid rgba(0, 255, 139, 0.4);
  background: rgba(0, 255, 139, 0.12);
}

.leaderboard-mini__badge--subtle {
  color: rgba(217, 247, 232, 0.7);
  border-color: rgba(0, 255, 139, 0.18);
  background: rgba(0, 255, 139, 0.06);
}

.leaderboard-mini__score {
  font-weight: 700;
  color: var(--lit-neon-accent);
  font-variant-numeric: tabular-nums;
}

.leaderboard-mini__subtle {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: none;
  color: rgba(185, 193, 189, 0.85);
  text-shadow: none;
}

.leaderboard-mini__item--empty {
  list-style: none;
  text-align: center;
  border-style: dashed;
  color: rgba(217, 247, 232, 0.75);
}

.leaderboard-mini__note {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(217, 247, 232, 0.7);
}

.leaderboard-mini__top5 {
  display: none;
}

.leaderboard-mini__divider {
  height: 1px;
  width: 100%;
  background: rgba(0, 163, 89, 0.35);
  border-radius: 999px;
}

.leaderboard-mini__block {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.leaderboard-mini__subheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.leaderboard-mini__subheader h3 {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lit-text-main);
}

.leaderboard-mini__list--compact .leaderboard-mini__item {
  padding: 0.3rem 0.45rem;
}

.company-top-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 139, 0.35);
  background: rgba(0, 163, 89, 0.12);
}

.company-top-toggle__button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  background: transparent;
  color: rgba(217, 247, 232, 0.75);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.company-top-toggle__button[aria-pressed="true"] {
  border-color: rgba(0, 255, 139, 0.5);
  background: rgba(0, 255, 139, 0.12);
  color: var(--lit-text-main);
}

.company-top-toggle__button:focus-visible {
  outline: 2px solid rgba(0, 255, 139, 0.6);
  outline-offset: 2px;
}


.ghost-button {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(0, 255, 139, 0.6);
  color: var(--lit-text-main);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.8rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  background: linear-gradient(135deg, rgba(0, 225, 123, 0.16), rgba(11, 22, 20, 0.95));
}

.ghost-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.35);
}

.ghost-button--solid {
  background: linear-gradient(135deg, var(--lit-mid-green), var(--lit-light-green));
  color: var(--lit-bg-dark);
  border-color: rgba(0, 255, 139, 0.7);
  box-shadow: 0 12px 26px rgba(0, 255, 139, 0.22);
}

.ghost-button--solid:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(0, 255, 139, 0.28);
}

.fullscreen-active {
  padding: 0;
}

body.fullscreen-active {
  overflow: hidden;
  align-items: stretch;
  justify-content: stretch;
}

body.fullscreen-active .stage {
  width: 100%;
  height: calc(var(--vh, 1vh) * 100);
  height: 100dvh;
  max-width: none;
  border: none;
  border-radius: 0;
  padding: 0;
  gap: 0.8rem;
  box-shadow: none;
}

body.fullscreen-active header,
body.fullscreen-active .hud-panel,
body.fullscreen-active .controls,
body.fullscreen-active footer {
  display: none;
}

body.fullscreen-active .game-panel {
  grid-template-columns: 1fr;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

body.fullscreen-active .touch-capture {
  pointer-events: auto;
}

body.fullscreen-active.config-open .touch-capture,
body.fullscreen-active.config-deep .touch-capture,
body.fullscreen-active.overlay-active .touch-capture {
  pointer-events: none;
}

body.fullscreen-active .canvas-wrapper {
  height: 100%;
  max-height: none;
  width: min(92vw, 460px);
  margin: 0 auto;
}

body.fullscreen-active.max-level-overdrive .canvas-wrapper {
  background: radial-gradient(circle at 20% 18%, rgba(var(--overdrive-glow), 0.18), rgba(11, 22, 20, 0.96));
  border-color: rgba(var(--overdrive-accent), 0.8);
  box-shadow:
    inset 0 0 34px rgba(var(--overdrive-accent), 0.35),
    0 0 30px rgba(var(--overdrive-accent), 0.4),
    0 0 70px rgba(var(--overdrive-accent), 0.25);
}

body.fullscreen-active .canvas-wrapper canvas {
  width: 100%;
  max-width: 420px;
}

@keyframes bossfight-impact-jolt {
  0% { transform: translate3d(0, 0, 0); }
  20% { transform: translate3d(-4px, 2px, 0); }
  40% { transform: translate3d(3px, -3px, 0); }
  60% { transform: translate3d(-2px, 3px, 0); }
  80% { transform: translate3d(2px, -2px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

body.bossfight-impact .canvas-wrapper {
  animation: bossfight-impact-jolt 0.22s ease;
}

.drop-progress {
  padding: 1.1rem 1.25rem;
  background: var(--lit-bg-panel);
  border-radius: 1rem;
  border: 1px solid rgba(0, 163, 89, 0.35);
  box-shadow: 0 15px 30px rgba(2, 6, 23, 0.45);
}

.drop-progress--inline {
  margin-top: 0.9rem;
  border-radius: 0.85rem;
  box-shadow: none;
  border-color: rgba(0, 255, 139, 0.25);
}

.drop-progress__labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(217, 247, 232, 0.75);
}

.drop-progress__labels strong {
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  color: var(--lit-neon-accent);
}

.drop-progress__bar {
  margin-top: 0.7rem;
  width: 100%;
  height: 0.65rem;
  background-color: rgba(0, 255, 139, 0.12);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(0, 163, 89, 0.45);
}

.drop-progress__bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(120deg, var(--lit-mid-green), var(--lit-light-green));
  box-shadow: 0 0 16px rgba(0, 255, 139, 0.6);
  transition: width 0.25s ease;
}

.bossfight-status {
  margin-top: 0.75rem;
}

body.fullscreen-active .bossfight-status {
  display: none;
}

body.fullscreen-active .bossfight-recap {
  display: none;
}

body.pseudo-fullscreen .bossfight-status,
body.pseudo-fullscreen .bossfight-recap {
  display: none;
}

.bossfight-status__card {
  background: var(--lit-bg-panel);
  border-radius: 0.9rem;
  padding: 0.95rem;
  border: 1px solid rgba(0, 163, 89, 0.35);
  box-shadow: 0 20px 35px rgba(2, 6, 23, 0.4);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
  overflow: hidden;
}

.bossfight-status__card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(0, 255, 139, 0.3), rgba(0, 163, 89, 0));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
}

.bossfight-status__card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 15%, rgba(0, 255, 139, 0.08), transparent 55%),
    radial-gradient(circle at 85% 0%, rgba(0, 163, 89, 0.1), transparent 45%);
  opacity: 0.7;
  pointer-events: none;
}

.bossfight-status__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.bossfight-status__portrait {
  width: min(100%, 320px);
  aspect-ratio: 3 / 2;
  height: auto;
  margin: 0 auto;
  border-radius: 0.9rem;
  border: 1px solid rgba(0, 255, 139, 0.25);
  background: radial-gradient(circle at top, rgba(0, 255, 139, 0.18), rgba(7, 12, 10, 0.9));
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.bossfight-status__portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 8, 7, 0), rgba(5, 8, 7, 0.7));
}

.bossfight-status__portrait-label {
  position: absolute;
  left: 0.7rem;
  bottom: 0.6rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(217, 247, 232, 0.8);
  z-index: 1;
}

.bossfight-status__portrait--defeated {
  background: radial-gradient(circle at top, rgba(0, 255, 139, 0.06), rgba(7, 12, 10, 0.95));
}

.bossfight-status__hint {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(217, 247, 232, 0.65);
}

.bossfight-status__active {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(0, 255, 139, 0.85);
  letter-spacing: 0.04em;
  display: none;
}

.bossfight-status__active--visible {
  display: block;
}

.bossfight-status__event,
.bossfight-status__breakpoints {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: rgba(0, 255, 139, 0.85);
  letter-spacing: 0.04em;
  display: none;
}

.bossfight-status__breakpoints {
  color: rgba(217, 247, 232, 0.75);
}

.bossfight-status__event--visible,
.bossfight-status__breakpoints--visible {
  display: block;
}

.bossfight-status__story {
  display: grid;
  gap: 0.3rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(0, 255, 139, 0.2);
  background: rgba(7, 12, 10, 0.75);
  color: rgba(217, 247, 232, 0.8);
  font-size: 0.72rem;
  line-height: 1.3;
}

.bossfight-status__story p {
  margin: 0;
}

.bossfight-status__header h2 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: var(--lit-text-main);
}

.bossfight-status__quarter {
  font-size: inherit;
  letter-spacing: 0.05em;
  color: inherit;
}

.bossfight-status__state {
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(217, 247, 232, 0.25);
  color: rgba(217, 247, 232, 0.7);
}

.bossfight-status__card--active .bossfight-status__state {
  border-color: rgba(0, 255, 139, 0.5);
  color: var(--lit-neon-accent);
  box-shadow: 0 0 12px rgba(0, 255, 139, 0.35);
}

.bossfight-status__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.bossfight-status__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.bossfight-status__bars--row {
  grid-column: 1 / -1;
}

.bossfight-status__metric {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.bossfight-status__metric--full {
  grid-column: 1 / -1;
}

.bossfight-status__label {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(217, 247, 232, 0.7);
}

.bossfight-status__value {
  font-size: clamp(0.85rem, 3vw, 0.98rem);
  font-weight: 700;
  color: var(--lit-neon-accent);
  font-variant-numeric: tabular-nums;
  max-width: 14ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bossfight-status__bars {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.bossfight-status__bar {
  height: 15px;
  border-radius: 999px;
  background: rgba(0, 255, 139, 0.12);
  overflow: hidden;
  position: relative;
}

.bossfight-status__bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(217, 247, 232, 0.85);
  pointer-events: none;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

.bossfight-status__divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(0, 255, 139, 0.3), rgba(0, 163, 89, 0));
  opacity: 0.7;
}

@media (max-width: 700px) {
  .bossfight-status__card {
    padding: 0.75rem;
    border-radius: 0.75rem;
    gap: 0.5rem;
  }

  .bossfight-status__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bossfight-status__grid {
    gap: 0.4rem;
  }

  .bossfight-status__portrait {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 3 / 2;
    height: auto;
    border-radius: 0.75rem;
  }

  .bossfight-status__story {
    font-size: 0.68rem;
    padding: 0.45rem 0.6rem;
  }

  .bossfight-status__state {
    font-size: 0.6rem;
    letter-spacing: 0.16em;
  }

  .bossfight-status__value {
    font-size: clamp(0.82rem, 4vw, 0.95rem);
  }

}

.bossfight-status__fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(0, 255, 139, 0.6), rgba(0, 163, 89, 0.9));
  transition: width 0.2s ease;
}

.bossfight-status__markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bossfight-status__marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(217, 247, 232, 0.55);
  box-shadow: 0 0 10px rgba(0, 255, 139, 0.3);
}

.bossfight-status__bar--hp {
  background: rgba(0, 255, 139, 0.08);
}

.bossfight-status__fill--hp {
  background: linear-gradient(90deg, rgba(0, 163, 89, 0.5), rgba(0, 255, 139, 0.75));
}

.bossfight-status__card--active .bossfight-status__bar--hp {
  box-shadow: 0 0 16px rgba(0, 255, 139, 0.2);
}

@keyframes bossfightPulse {
  0% {
    box-shadow: 0 0 0 rgba(0, 255, 139, 0.0);
  }
  50% {
    box-shadow: 0 0 18px rgba(0, 255, 139, 0.25);
  }
  100% {
    box-shadow: 0 0 0 rgba(0, 255, 139, 0.0);
  }
}

.bossfight-status__card--active {
  animation: bossfightPulse 2.6s ease-in-out infinite;
}

.bossfight-recap {
  margin-top: 0.75rem;
}

.bossfight-recap__card {
  background: var(--lit-bg-panel);
  border-radius: 0.9rem;
  padding: 0.9rem 0.95rem;
  border: 1px solid rgba(0, 163, 89, 0.3);
  box-shadow: 0 18px 32px rgba(2, 6, 23, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.bossfight-recap__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.bossfight-recap__header h3 {
  margin: 0;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
}

.bossfight-recap__eyebrow {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(217, 247, 232, 0.6);
}

.bossfight-recap__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.bossfight-recap__item {
  border-radius: 0.7rem;
  border: 1px solid rgba(0, 255, 139, 0.18);
  background: rgba(7, 12, 10, 0.75);
  padding: 0.55rem 0.7rem;
  display: grid;
  gap: 0.3rem;
}

.bossfight-recap__meta {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(217, 247, 232, 0.6);
}

.bossfight-recap__text {
  font-size: 0.74rem;
  color: rgba(217, 247, 232, 0.85);
  line-height: 1.35;
}

@media (max-width: 700px) {
  .bossfight-recap__card {
    padding: 0.7rem 0.75rem;
    border-radius: 0.75rem;
    gap: 0.5rem;
  }

  .bossfight-recap__header h3 {
    font-size: 0.82rem;
  }

  .bossfight-recap__text {
    font-size: 0.7rem;
  }
}

.controls {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.controls-card {
  background: var(--lit-bg-panel);
  border-radius: 1rem;
  padding: 1.2rem;
  border: 1px solid rgba(0, 163, 89, 0.35);
  box-shadow: 0 20px 35px rgba(2, 6, 23, 0.4);
}

.controls-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  letter-spacing: 0.05em;
  color: var(--lit-text-main);
}

.controls-card ul {
  padding-left: 1.2rem;
  margin: 0;
  color: var(--lit-text-main);
  line-height: 1.5;
  word-break: break-word;
}

.controls-card p {
  margin: 0;
  color: var(--lit-text-main);
  line-height: 1.5;
}

.leaderboard-page {
  background: linear-gradient(180deg, #050806, #0b0f0e 35%, #060a08 100%);
}

.leaderboard-full {
  background: linear-gradient(180deg, rgba(0, 163, 89, 0.12), rgba(11, 22, 20, 0.95));
  border-radius: 1.2rem;
  border: 1px solid rgba(0, 163, 89, 0.45);
  padding: 1.2rem;
  box-shadow: 0 18px 35px rgba(2, 6, 23, 0.45);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.leaderboard-full__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.leaderboard-full__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.leaderboard-challenge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(0, 163, 89, 0.35);
  background: rgba(6, 15, 12, 0.75);
  box-shadow: inset 0 0 0 1px rgba(0, 255, 139, 0.08);
}

.leaderboard-challenge h2 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.leaderboard-challenge p {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(217, 247, 232, 0.7);
}

.leaderboard-challenge__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.leaderboard-challenge__select {
  min-width: 200px;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 139, 0.5);
  background: rgba(6, 15, 12, 0.85);
  color: var(--lit-text-main);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.leaderboard-challenge__select:focus-visible {
  outline: 2px solid rgba(0, 255, 139, 0.6);
  outline-offset: 2px;
}

.champion-showcase {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 0.6rem;
}

.champion-card {
  border-radius: 1rem;
  border: 1px solid rgba(0, 163, 89, 0.35);
  background: rgba(8, 16, 13, 0.85);
  padding: 0.75rem 0.85rem;
  display: grid;
  gap: 0.35rem;
  overflow: visible;
}

.champion-card--current {
  border-color: rgba(0, 255, 139, 0.55);
  box-shadow: 0 0 24px rgba(0, 255, 139, 0.2);
}

.champion-card--previous {
  opacity: 0.82;
}

.champion-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem;
}

.champion-card__header > div {
  flex: 1;
  min-width: 0;
}

.champion-card__header h2 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.2;
  min-height: 1.2em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.champion-card__eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(217, 247, 232, 0.65);
  margin-bottom: 0.1rem;
}

.champion-card__badge {
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 139, 0.5);
  color: var(--lit-light-green);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.champion-card__badge--muted {
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(217, 247, 232, 0.7);
}

.champion-card__name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  min-height: 1.2em;
  overflow: visible;
}

.champion-card__name .leaderboard-name {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 0;
}

.champion-card__name .leaderboard-name__text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-width: 0;
}

.champion-card--current .champion-card__name {
  font-size: 1.3rem;
}

.champion-card--previous .champion-card__name {
  font-size: 1.05rem;
}

.champion-card__team {
  font-size: 0.85rem;
  color: rgba(217, 247, 232, 0.75);
}

.champion-card__score {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--lit-light-green);
}

.champion-card--previous .champion-card__score {
  font-size: 1.25rem;
}

.champion-card__meta {
  list-style: none;
  padding: 0;
  margin: 0.1rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.3rem 0.45rem;
  font-size: 0.75rem;
  color: rgba(217, 247, 232, 0.7);
}

.champion-card__meta li {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 0.6rem;
  padding: 0.25rem 0.45rem;
}

.champion-card--current .champion-card__meta li {
  border: 1px solid rgba(0, 255, 139, 0.45);
  box-shadow: 0 0 10px rgba(0, 255, 139, 0.22);
  background: rgba(0, 255, 139, 0.08);
}

.leaderboard-table-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.leaderboard-filter--table {
  align-self: flex-start;
}

.leaderboard-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 139, 0.35);
  background: rgba(0, 163, 89, 0.12);
}

.leaderboard-filter__button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: transparent;
  color: rgba(217, 247, 232, 0.75);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.leaderboard-filter__button[aria-pressed="true"] {
  border-color: rgba(0, 255, 139, 0.5);
  background: rgba(0, 255, 139, 0.12);
  color: var(--lit-text-main);
}

.leaderboard-filter__button:focus-visible {
  outline: 2px solid rgba(0, 255, 139, 0.6);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  body.leaderboard-page .leaderboard-full__header {
    flex-direction: column;
    align-items: stretch;
  }

  body.leaderboard-page .leaderboard-full__actions {
    order: -1;
    justify-content: flex-start;
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
  }

  .leaderboard-challenge {
    flex-direction: column;
    align-items: flex-start;
  }

  .champion-showcase {
    grid-template-columns: 1fr;
  }

  .champion-card {
    padding: 0.85rem;
  }

  .champion-card__meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem 0.5rem;
    font-size: 0.7rem;
  }

  .champion-card__meta li {
    padding: 0.3rem 0.45rem;
  }

  .leaderboard-challenge__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .leaderboard-challenge__select {
    width: 100%;
  }

  .leaderboard-filter {
    width: 100%;
    justify-content: flex-start;
  }

  .leaderboard-filter--table {
    align-self: stretch;
  }
}

.leaderboard-table {
  border: 1px solid rgba(0, 255, 139, 0.35);
  border-radius: 1rem;
  overflow: visible;
  background: var(--lit-bg-panel);
}

.leaderboard-table__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1rem 0.2rem;
}

.leaderboard-table-title {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lit-text-main);
}

.company-challenge {
  margin-top: 0;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(0, 163, 89, 0.45);
  background: linear-gradient(180deg, rgba(0, 163, 89, 0.08), rgba(11, 22, 20, 0.85));
  box-shadow: 0 18px 35px rgba(2, 6, 23, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.company-challenge__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.company-challenge__header h2 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.company-challenge__header p {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(217, 247, 232, 0.75);
}

.company-challenge__year {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(217, 247, 232, 0.75);
}

.company-challenge__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.company-challenge__panel {
  border-radius: 0.8rem;
  border: 1px solid rgba(0, 255, 139, 0.25);
  background: rgba(0, 163, 89, 0.08);
  padding: 0.8rem;
}

.company-challenge__panel h3 {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lit-text-main);
}

.company-challenge__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.company-challenge__list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgba(217, 247, 232, 0.85);
  flex-wrap: nowrap;
  min-width: 0;
}

.company-challenge__list strong {
  color: var(--lit-text-main);
  font-weight: 600;
}

.company-challenge__entry {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  overflow: visible;
  white-space: nowrap;
  padding: 0.1rem 0.35rem;
  margin: -0.1rem -0.35rem;
}

.company-challenge__name {
  display: inline-block;
  max-width: clamp(6rem, 26vw, 10.5rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.company-challenge__company {
  color: rgba(217, 247, 232, 0.75);
}

.company-challenge__company::before {
  content: "·";
  margin-right: 0.35rem;
  color: rgba(217, 247, 232, 0.6);
}

.company-challenge__score {
  margin-left: auto;
  color: rgba(217, 247, 232, 0.75);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.leaderboard-table__head,
.leaderboard-table__row {
  display: grid;
  grid-template-columns: 0.5fr 1.6fr 1.6fr 1fr 0.8fr 0.8fr;
  padding: 0.75rem 1rem;
  gap: 0.5rem;
  align-items: center;
}

.leaderboard-table__badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(217, 247, 232, 0.8);
  border: 1px solid rgba(0, 255, 139, 0.2);
  background: rgba(0, 255, 139, 0.08);
}

.leaderboard-table__score-sub {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: none;
  color: rgba(185, 193, 189, 0.85);
  text-shadow: none;
}

.leaderboard-table__head {
  background: rgba(0, 225, 123, 0.12);
  border-bottom: 1px solid rgba(0, 255, 139, 0.35);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lit-text-main);
}

.leaderboard-table__body {
  display: flex;
  flex-direction: column;
}

.leaderboard-table__row {
  border-bottom: 1px solid rgba(0, 163, 89, 0.2);
}

.leaderboard-table__row:nth-child(even) {
  background: rgba(0, 163, 89, 0.05);
}

.leaderboard-table__row:last-child {
  border-bottom: none;
}

.leaderboard-table__row > span {
  display: block;
  color: var(--lit-text-main);
  font-variant-numeric: tabular-nums;
}

.leaderboard-mini__item .leaderboard-mini__subtle {
  color: rgba(185, 193, 189, 0.85);
  text-shadow: none;
}

.leaderboard-table__row .leaderboard-table__score-sub {
  color: rgba(185, 193, 189, 0.85);
  text-shadow: none;
}

.leaderboard-table__cell--score {
  font-weight: 700;
  color: var(--lit-neon-accent);
}

.leaderboard-table__row--empty {
  justify-content: center;
}

.leaderboard-table__cell--empty {
  grid-column: 1 / -1;
  text-align: center;
  color: rgba(217, 247, 232, 0.75);
}

@media (max-width: 720px) {
  .leaderboard-full {
    padding: 1rem;
  }

  .leaderboard-full__header {
    flex-direction: column;
    align-items: stretch;
  }

  .leaderboard-table {
    border: 1px solid rgba(0, 255, 139, 0.35);
    border-radius: 1rem;
    overflow: visible;
  }

  .leaderboard-table__head {
    display: none;
  }

  .leaderboard-table__row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "rank score"
      "player score"
      "team score"
      "level lines";
    gap: 0.35rem 0.6rem;
    border: 1px solid rgba(0, 163, 89, 0.3);
    margin: 0.4rem 0.35rem;
    border-radius: 0.9rem;
    background: rgba(0, 163, 89, 0.06);
  }

  .leaderboard-table__row:nth-child(even) {
    background: rgba(0, 163, 89, 0.12);
  }

  .leaderboard-table__row:last-child {
    border-bottom: 1px solid rgba(0, 163, 89, 0.3);
  }

  .leaderboard-table__row > span {
    font-size: 0.95rem;
  }

  .leaderboard-table__row > span::before {
    content: attr(data-label);
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(217, 247, 232, 0.65);
    margin-bottom: 0.1rem;
  }

  .leaderboard-table__row span:nth-child(1) {
    grid-area: rank;
    font-weight: 700;
    color: var(--lit-neon-accent);
  }

  .leaderboard-table__row span:nth-child(4) {
    grid-area: score;
    justify-self: end;
    text-align: right;
    font-size: 1.05rem;
  }

  .company-challenge__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .company-challenge__grid {
    grid-template-columns: 1fr;
  }

  .leaderboard-table__row .leaderboard-table__score-sub {
    font-size: 0.65rem;
    color: rgba(185, 193, 189, 0.85);
    text-shadow: none;
  }

  .leaderboard-table__cell--score .leaderboard-table__score-sub {
    color: rgba(185, 193, 189, 0.85) !important;
    text-shadow: none !important;
  }

  .leaderboard-table__row span:nth-child(2) {
    grid-area: player;
  }

  .leaderboard-table__row span:nth-child(3) {
    grid-area: team;
    color: rgba(217, 247, 232, 0.85);
  }

  .leaderboard-table__row span:nth-child(5) {
    grid-area: level;
  }

  .leaderboard-table__row span:nth-child(6) {
    grid-area: lines;
    justify-self: end;
    text-align: right;
  }

  .leaderboard-table__row--empty {
    border: 1px dashed rgba(0, 163, 89, 0.4);
    margin: 0.4rem 0.35rem;
  }

  .company-top-toggle {
    width: 100%;
    justify-content: space-between;
  }

  .company-top-toggle__button {
    flex: 1;
    text-align: center;
  }
}

footer {
  margin-top: 1rem;
  text-align: center;
  color: rgba(217, 247, 232, 0.75);
  font-size: 0.9rem;
}

.alpha-note {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--lit-neon-accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(0, 255, 139, 0.45);
}

.start-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 26;
  pointer-events: auto;
}

.start-overlay--hidden {
  display: none;
}

.start-overlay__panel {
  background: linear-gradient(180deg, rgba(0, 163, 89, 0.18), rgba(11, 22, 20, 0.95));
  border: 1px solid rgba(0, 163, 89, 0.55);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.55);
  border-radius: 1.2rem;
  padding: 1.4rem 1.6rem;
  text-align: center;
  color: var(--lit-text-main);
  max-width: 420px;
  width: min(90%, 420px);
  pointer-events: auto;
}

.start-overlay__title {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.start-overlay__hint {
  margin: 0 0 1rem;
  color: rgba(217, 247, 232, 0.9);
}

.start-overlay__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

@media (min-width: 520px) {
  .start-overlay__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.start-overlay__button {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(0, 225, 123, 0.7);
  background: linear-gradient(135deg, var(--lit-mid-green), var(--lit-light-green));
  color: var(--lit-bg-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.start-overlay__button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.start-overlay__button:not(:disabled):hover {
  transform: translateY(-1px);
}

.start-overlay__button--ghost {
  background: rgba(0, 225, 123, 0.08);
  color: var(--lit-text-main);
  border: 1px solid rgba(0, 225, 123, 0.5);
}

.start-overlay__mini {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: rgba(217, 247, 232, 0.75);
}

.start-overlay__backend {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: #ff6b6b;
  display: none;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.85rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(0, 225, 123, 0.35);
  background: linear-gradient(135deg, rgba(0, 225, 123, 0.14), rgba(11, 22, 20, 0.9));
}

.setting-row__info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.setting-row__label {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.setting-row__hint {
  margin: 0;
  color: rgba(217, 247, 232, 0.75);
  font-size: 0.9rem;
}

.setting-row--slider {
  flex-direction: column;
  align-items: stretch;
}

.setting-row--stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
}

.setting-row--stacked .setting-row__action {
  width: 100%;
}

.setting-slider {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  width: 100%;
}

.setting-slider input[type="range"] {
  width: 100%;
  accent-color: var(--lit-light-green);
  background: transparent;
}

.setting-slider__value {
  align-self: flex-end;
  min-width: 46px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--lit-neon-accent);
  font-size: 0.9rem;
}

.setting-slider--disabled {
  opacity: 0.5;
  pointer-events: none;
}

.toggle-switch {
  --toggle-width: 64px;
  --toggle-height: 32px;
  --toggle-knob-size: 24px;
  --toggle-padding: 4px;
  --toggle-off-x: var(--toggle-padding);
  --toggle-on-x: calc(var(--toggle-width) - var(--toggle-padding) - var(--toggle-knob-size));
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: var(--toggle-width);
  height: var(--toggle-height);
  min-width: var(--toggle-width);
  flex: 0 0 var(--toggle-width);
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 139, 0.6);
  background: rgba(2, 6, 23, 0.92);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.38);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
  font: inherit;
  vertical-align: middle;
  white-space: nowrap;
}

.toggle-switch__track {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  text-transform: uppercase;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.07em;
}

.toggle-switch__state {
  position: absolute;
  top: 50%;
  line-height: 1;
  color: rgba(217, 247, 232, 0.7);
  font-weight: 700;
  transition: color 0.2s ease, opacity 0.2s ease;
  transform: translateY(-50%);
  z-index: 1;
}

.toggle-switch__state--on {
  left: calc(var(--toggle-padding) + 1px);
  color: rgba(0, 255, 139, 0.85);
  opacity: 0.6;
}

.toggle-switch__state--off {
  right: calc(var(--toggle-padding) + 1px);
  opacity: 0.75;
}

.toggle-switch__knob {
  position: absolute;
  top: 50%;
  left: var(--toggle-off-x);
  width: var(--toggle-knob-size);
  height: var(--toggle-knob-size);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lit-mid-green), var(--lit-light-green));
  box-shadow: 0 9px 18px rgba(0, 255, 139, 0.28);
  transform: translateY(-50%);
  transition: left 0.2s ease, box-shadow 0.2s ease;
  z-index: 2;
}

.toggle-switch[aria-checked="true"],
.toggle-switch.toggle-switch--active {
  background: rgba(0, 163, 89, 0.42);
  border-color: rgba(0, 255, 139, 0.75);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.35);
}

.toggle-switch[aria-checked="true"] .toggle-switch__state--on,
.toggle-switch.toggle-switch--active .toggle-switch__state--on {
  opacity: 1;
  color: var(--lit-light-green);
}

.toggle-switch[aria-checked="true"] .toggle-switch__state--off,
.toggle-switch.toggle-switch--active .toggle-switch__state--off {
  opacity: 0.45;
}

.toggle-switch[aria-checked="true"] .toggle-switch__knob,
.toggle-switch.toggle-switch--active .toggle-switch__knob {
  left: var(--toggle-on-x);
  box-shadow: 0 9px 18px rgba(0, 255, 139, 0.28);
}

.toggle-switch--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

.hud-toast {
  position: fixed;
  bottom: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.65rem 0.9rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(0, 255, 139, 0.55);
  background: rgba(2, 6, 23, 0.92);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.4);
  color: var(--lit-text-main);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 8;
  letter-spacing: 0.05em;
}

.hud-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

body.pseudo-fullscreen {
  overflow: hidden;
}

body.pseudo-fullscreen .stage {
  position: fixed;
  inset: 0;
  max-width: none;
  width: 100%;
  height: calc(var(--vh, 1vh) * 100);
  height: 100dvh;
  margin: 0;
  z-index: 4;
}

@media (max-width: 1024px) {
  .game-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    padding: 1.5rem 1rem;
  }

  .hud-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .hud-card--preview {
    grid-column: span 1;
    min-width: auto;
  }

  .preview-stack {
    flex-direction: column;
    gap: 0.25rem;
  }

  .hud-card--brand,
  .hud-card--compact {
    grid-row: auto;
  }
}

@media (max-width: 900px) {
  .mobile-topbar {
    display: none;
  }

  .stage {
    padding-top: 3.2rem;
  }
}
