﻿:root {
  color-scheme: dark;
  --bg-0: #07090d;
  --bg-1: #0b0f16;
  --bg-2: #0f1722;
  --felt: #0d2a20;
  --felt-bright: #145f4a;
  --gold: #009dff;
  --rose: #ff5f55;
  --cyan: #009dff;
  --violet: #6d5cf1;
  --ink: #f8f1e3;
  --muted: #d5cab6;
  --shadow: 0 20px 60px rgba(4, 6, 10, 0.6);
}

@font-face {
  font-family: "BalatroPixel";
  src: url("/fonts/m6x11plus.ttf") format("truetype");
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 95, 85, 0.28), transparent 32%),
    radial-gradient(circle at 80% 22%, rgba(0, 157, 255, 0.28), transparent 30%),
    radial-gradient(circle at 50% 82%, rgba(21, 95, 78, 0.36), transparent 40%),
    linear-gradient(180deg, #091019 0%, #0d1622 42%, #081118 100%);
  color: var(--ink);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 95, 85, 0.16), transparent 24%),
    radial-gradient(circle at 72% 26%, rgba(0, 157, 255, 0.18), transparent 24%),
    radial-gradient(circle at 54% 72%, rgba(17, 88, 71, 0.22), transparent 28%);
  filter: blur(12px) saturate(1.15);
  animation: backgroundSweep 18s ease-in-out infinite alternate;
}

body.home-shell::before {
  animation: none;
  filter: blur(10px) saturate(1.05);
}

body::after {
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(248, 241, 227, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(248, 241, 227, 0.035) 1px, transparent 1px);
  background-size: 26px 26px;
  mix-blend-mode: screen;
}

body > canvas {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 0 !important;
  opacity: 0;
  filter: saturate(1.2) contrast(1.06);
  transition: opacity 220ms ease;
  will-change: opacity;
  pointer-events: none !important;
}

body.shader-active > canvas {
  opacity: 0.9;
}

/* Match known-working shader layering behavior */
#shader-web-background,
canvas#shader-web-background,
canvas {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  z-index: 0 !important;
}

body > *:not(#shader-web-background):not(canvas):not(.leaderboard-name-tooltip-float):not(.toast-host):not(.overlay):not(.tutorial):not(.corner-overlay):not(.vm-overlay):not(.vm-loader) {
  position: relative;
  z-index: 1;
}

#err {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font: 14px/1.35 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  display: none;
  z-index: 9999;
  white-space: pre-wrap;
}

body.shader-disabled > canvas {
  display: none !important;
  opacity: 0 !important;
}

body.shader-disabled::before {
  filter: blur(16px) saturate(1.2);
  opacity: 1;
}

body.custom-cursor-enabled,
body.custom-cursor-enabled * {
  cursor: none !important;
}

.ambient {
  display: none;
}

@keyframes backgroundSweep {
  0% {
    transform: translate3d(-1.5%, -1%, 0) scale(1);
  }
  50% {
    transform: translate3d(1.5%, 1%, 0) scale(1.03);
  }
  100% {
    transform: translate3d(-1%, 1.2%, 0) scale(1.01);
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px 6px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: flex;
  gap: 16px;
  align-items: center;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 95, 85, 0.2), rgba(232, 111, 138, 0.3));
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255, 95, 85, 0.4);
}

.brand-mark img {
  width: 36px;
  height: 36px;
  object-fit: cover;
}

.brand-title {
  font-family: "BalatroPixel", "Trebuchet MS", sans-serif;
  font-size: 22px;
  letter-spacing: 0.08em;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 14px;
}

.version-note {
  margin-top: 4px;
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffe9b0;
  border: 1px solid rgba(0, 157, 255, 0.42);
  background: rgba(16, 22, 34, 0.72);
  padding: 2px 8px;
}

.status-pill {
  appearance: none;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(13, 95, 74, 0.35);
  border: 1px solid rgba(96, 212, 247, 0.35);
  color: var(--cyan);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.2em;
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
  cursor: pointer;
}

.online-pill {
  color: #79ff97;
  border-color: rgba(121, 255, 151, 0.35);
  background: rgba(16, 84, 42, 0.34);
}

.player-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  min-height: 34px;
}

.player-pill-avatar-wrap {
  --avatar-size: 28px;
  --avatar-img-size: 22px;
  --avatar-radius: 50%;
  --layer-inset-back: -4px;
  --layer-inset-ring: -3px;
  --layer-inset-front: -4px;
  --layer-inset-effect: -5px;
}

.player-pill-avatar {
  width: var(--avatar-img-size);
  height: var(--avatar-img-size);
  object-fit: cover;
  border: 1px solid rgba(0, 157, 255, 0.6);
  background: rgba(10, 15, 26, 0.9);
  position: relative;
  z-index: 3;
}

.player-pill-layer {
  inset: auto;
}

.player-pill-avatar-wrap .cosmetic-preview-back {
  inset: var(--layer-inset-back);
}

.player-pill-avatar-wrap .cosmetic-preview-ring {
  inset: var(--layer-inset-ring);
}

.player-pill-avatar-wrap .cosmetic-preview-front {
  inset: var(--layer-inset-front);
}

.player-pill-avatar-wrap .cosmetic-preview-effect {
  inset: var(--layer-inset-effect);
}

.stage {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px 60px;
}

.panel {
  background: rgba(12, 16, 24, 0.78);
  border: 1px solid rgba(255, 95, 85, 0.15);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  animation: floatIn 0.8s ease;
  position: relative;
  overflow: hidden;
}

body.home-shell .panel,
body.home-shell .auth-hero,
body.home-shell .auth-deck,
body.home-shell .public-section,
body.home-shell .public-story-card,
body.home-shell .public-feature-card,
body.home-shell .public-faq-card {
  backdrop-filter: none;
}

body.home-shell .auth-hero,
body.home-shell .auth-deck,
body.home-shell .public-section,
body.home-shell .public-story-card,
body.home-shell .public-feature-card,
body.home-shell .public-faq-card,
body.home-shell .public-guide-item,
body.docs-page .docs-nav a,
body.docs-page .footer-links a,
body.home-shell .public-link-btn {
  border-radius: 0 !important;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    130deg,
    rgba(0, 157, 255, 0.55),
    rgba(255, 95, 85, 0.48),
    rgba(0, 157, 255, 0.44)
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.65;
  pointer-events: none;
}

.panel + .panel {
  margin-top: 28px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.panel-header h1 {
  margin: 6px 0 10px;
  font-size: 32px;
  font-family: "BalatroPixel", "Trebuchet MS", sans-serif;
  letter-spacing: 0.05em;
}

.panel-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 12px;
  color: var(--gold);
  font-family: "BalatroPixel", "Trebuchet MS", sans-serif;
}

.badge {
  padding: 10px 16px;
  border-radius: 18px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  background: rgba(0, 157, 255, 0.18);
  border: 1px solid rgba(94, 164, 255, 0.45);
  color: var(--cyan);
  align-self: flex-start;
}

.auth-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.auth-shell {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.auth-hero {
  border: 1px solid rgba(255, 95, 85, 0.24);
  border-radius: 18px;
  padding: 18px;
  background: rgba(13, 17, 25, 0.86);
  display: grid;
  align-content: start;
  gap: 12px;
}

.auth-deck {
  border: 1px solid rgba(96, 212, 247, 0.25);
  border-radius: 18px;
  padding: 16px;
  background: rgba(11, 14, 21, 0.9);
}

.login-title {
  margin: 0;
  font-family: "BalatroPixel", "Trebuchet MS", sans-serif;
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: 0.08em;
  line-height: 0.95;
  color: #ffe9b0;
  text-shadow: 0 0 18px rgba(255, 95, 85, 0.28);
}

.auth-copy {
  margin: 0;
  color: #efe7d7;
  line-height: 1.5;
  font-size: 16px;
}

.public-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  justify-self: center;
  align-self: center;
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
}

.public-link-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 0;
  font-size: 17px;
  letter-spacing: 0.06em;
  box-shadow: inset 0 0 0 1px rgba(248, 195, 108, 0.08);
}

.public-home-sections {
  margin-top: 24px;
  display: grid;
  gap: 18px;
  content-visibility: auto;
  contain-intrinsic-size: 1px 1800px;
}

.public-section {
  border: 1px solid rgba(96, 212, 247, 0.18);
  border-radius: 0;
  padding: 18px;
  background: rgba(10, 14, 22, 0.82);
  content-visibility: auto;
  contain-intrinsic-size: 1px 640px;
}

.public-section h2,
.docs-hero h1,
.docs-section h2 {
  margin: 6px 0 12px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 0.98;
  letter-spacing: 0.05em;
}

.public-section p,
.public-feature-card p,
.public-faq-card p,
.docs-card p,
.docs-section p,
.docs-list-item {
  margin: 0;
  color: #efe7d7;
  line-height: 1.55;
  font-size: 15px;
}

.public-section-grid,
.public-feature-grid,
.public-faq-grid,
.docs-grid {
  display: grid;
  gap: 18px;
}

.public-section-grid,
.docs-grid.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.public-story-card,
.public-feature-card,
.public-faq-card,
.docs-card {
  border: 1px solid rgba(255, 95, 85, 0.2);
  border-radius: 0;
  padding: 18px;
  background: rgba(12, 17, 25, 0.9);
  display: grid;
  gap: 12px;
}

.public-feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.public-guide-strip {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: start;
}

.public-guide-checklist,
.docs-list {
  display: grid;
  gap: 10px;
}

.public-guide-item,
.docs-list-item {
  border: 1px solid rgba(240, 205, 115, 0.16);
  border-radius: 0;
  padding: 12px 14px;
  background: rgba(14, 19, 29, 0.86);
}

.public-guide-item strong {
  color: #ffe9b0;
  margin-right: 8px;
}

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

.public-faq-card h3,
.docs-card .card-title,
.public-feature-card .card-title {
  margin: 0;
}

.docs-page .stage {
  max-width: 1120px;
}

.docs-topbar {
  gap: 16px;
}

.docs-nav,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links {
  width: 100%;
  justify-content: center;
  justify-self: center;
}

.docs-nav a,
.footer-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  color: #ffe9b0;
  text-decoration: none;
  border: 1px solid rgba(255, 95, 85, 0.42);
  border-radius: 0;
  padding: 9px 14px;
  background: rgba(9, 14, 22, 0.78);
  box-shadow: inset 0 0 0 1px rgba(248, 195, 108, 0.08);
  font-family: "BalatroPixel", "Trebuchet MS", sans-serif;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.docs-nav a:hover,
.footer-links a:hover {
  color: #fff6e2;
  border-color: rgba(0, 157, 255, 0.46);
  background: rgba(13, 21, 34, 0.92);
  transform: translateY(-1px);
}

.docs-stage {
  display: grid;
  gap: 18px;
}

.docs-hero,
.docs-section {
  display: grid;
  gap: 12px;
}

.tab {
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 95, 85, 0.1);
  color: var(--gold);
  cursor: pointer;
  font-family: "BalatroPixel", "Trebuchet MS", sans-serif;
  letter-spacing: 0.08em;
  font-size: 18px;
}

.tab.active {
  background: linear-gradient(135deg, rgba(0, 157, 255, 0.50), rgba(0, 157, 255, 0.26));
  color: var(--ink);
  box-shadow: 0 10px 20px rgba(240, 200, 110, 0.24);
}

.tab:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.auth-forms {
  display: grid;
  grid-template-columns: 1fr;
}

.form-card {
  display: none;
  gap: 16px;
  animation: fadeIn 0.6s ease;
}

.form-card.active {
  display: grid;
}

label {
  display: grid;
  gap: 6px;
  font-size: 15px;
  color: #f3ecd9;
}

input[type="text"],
input[type="password"] {
  background: rgba(9, 12, 18, 0.8);
  border: 1px solid rgba(255, 95, 85, 0.2);
  border-radius: 12px;
  padding: 10px 12px;
  color: #fff6e2;
  font-size: 16px;
  font-family: "BalatroPixel", "Trebuchet MS", sans-serif;
}

input:focus {
  outline: 2px solid rgba(96, 212, 247, 0.5);
  border-color: rgba(96, 212, 247, 0.7);
}

.checkbox {
  grid-auto-flow: column;
  align-items: center;
  justify-content: flex-start;
}

.checkbox input {
  width: 18px;
  height: 18px;
}

.primary,
.ghost {
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 18px;
  cursor: pointer;
  font-family: "BalatroPixel", "Trebuchet MS", sans-serif;
  letter-spacing: 0.05em;
}

.status-pill[data-tip],
.ghost[data-tip],
.primary[data-tip] {
  position: relative;
}

.status-pill[data-tip]:hover::after,
.ghost[data-tip]:hover::after,
.primary[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 220px;
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(6, 10, 16, 0.96);
  border: 1px solid rgba(255, 95, 85, 0.38);
  color: #f6e9c6;
  z-index: 1300;
  pointer-events: none;
}

.shop-info-btn[data-tip]:hover::after,
.shop-combine-toggle[data-tip]:hover::after {
  left: auto;
  right: 0;
  transform: none;
  max-width: min(300px, 78vw);
}

.primary {
  background: linear-gradient(135deg, rgba(0, 157, 255, 0.98), rgba(255, 95, 85, 0.94));
  color: #1a0f08;
  font-weight: 600;
  box-shadow: 0 14px 30px rgba(255, 95, 85, 0.25);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(255, 95, 85, 0.28);
  filter: saturate(1.1);
}

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

.ghost {
  background: transparent;
  border: 1px solid rgba(255, 95, 85, 0.4);
  color: var(--gold);
}

.helper {
  margin: 0;
  color: #dccfb7;
}

/* Balatro-style inline tag fallback styling */
mult { color: #ff5f6d; font-weight: 700; }
xmult { color: #f4f4f4; font-weight: 700; }
chips { color: #55a9ff; font-weight: 700; }
xchips { color: #f4f4f4; font-weight: 700; }
orng { color: #ff7b7b; font-weight: 700; }
grn { color: #69d88c; font-weight: 700; }
purp, tarot { color: #b487ff; font-weight: 700; }
cyan, planet { color: #77e2ff; font-weight: 700; }
heart { color: #ff78b1; font-weight: 700; }
diamond { color: #ffbc73; font-weight: 700; }
spade { color: #be9cff; font-weight: 700; }
club { color: #75d485; font-weight: 700; }
ylw, cash { color: #ffe07f; font-weight: 700; }
ngtv, foil, hlgp, plcm { color: #ececec; text-shadow: 0 0 8px rgba(255, 255, 255, 0.3); }
gray, grey { color: #9ea2ac; }

.outer-desc {
  display: inline-flex;
  border-radius: 12px;
  padding: 2px;
  background: linear-gradient(135deg, rgba(255, 95, 85, 0.4), rgba(232, 111, 138, 0.35));
}

.joker-title {
  margin: 0 0 6px;
  font-family: "Cinzel", "Times New Roman", serif;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #fff3ce;
}

.inner-desc {
  display: inline-flex;
  border-radius: 10px;
  padding: 6px 10px;
  background: rgba(8, 12, 20, 0.9);
}

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

.dashboard-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 14px;
}

.dashboard-tabs .tab {
  flex: 1 1 144px;
  min-width: 0;
  justify-content: center;
}

.leaderboard-view {
  display: grid;
  gap: 14px;
}

.duels-view {
  display: grid;
  gap: 14px;
}

.duel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.duel-actions,
.duel-status {
  display: grid;
  gap: 10px;
}

.duel-selector {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 95, 85, 0.34);
  background:
    linear-gradient(180deg, rgba(18, 14, 11, 0.78), rgba(10, 14, 24, 0.9)),
    radial-gradient(circle at top right, rgba(0, 157, 255, 0.1), transparent 44%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 228, 162, 0.1),
    0 8px 18px rgba(2, 4, 10, 0.3);
  padding: 10px;
  contain: layout paint;
}

.duel-selector-title {
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 12px;
  color: #ffe2b7;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(255, 95, 85, 0.25);
}

.duel-pill-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.duel-pill,
.duel-choice-btn {
  border: 2px solid rgba(255, 95, 85, 0.5);
  background:
    linear-gradient(180deg, rgba(23, 17, 14, 0.88), rgba(13, 18, 29, 0.94)),
    radial-gradient(circle at top, rgba(0, 157, 255, 0.1), transparent 58%);
  color: #f4e9d2;
  padding: 11px 12px;
  min-height: 42px;
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    border-color 0.14s ease,
    box-shadow 0.14s ease,
    background 0.14s ease,
    transform 0.12s ease;
}

.duel-pill:hover,
.duel-choice-btn:hover {
  border-color: rgba(0, 157, 255, 0.6);
  box-shadow: 0 0 0 1px rgba(0, 157, 255, 0.22) inset;
}

.duel-pill.active,
.duel-choice-btn.active {
  border-color: #39c3b0;
  background:
    linear-gradient(180deg, rgba(0, 157, 255, 0.32), rgba(16, 24, 36, 0.96)),
    linear-gradient(90deg, rgba(255, 95, 85, 0.12), rgba(0, 157, 255, 0.16));
  box-shadow:
    inset 0 0 0 1px rgba(57, 195, 176, 0.3),
    0 0 14px rgba(0, 157, 255, 0.2);
  color: #f6fff7;
  text-shadow: 0 0 6px rgba(0, 157, 255, 0.38);
}

.duel-pill:disabled,
.duel-choice-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.duel-pill:active,
.duel-choice-btn:active {
  transform: translateY(1px);
}

.duel-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.duel-private-controls {
  display: grid;
  gap: 24px;
  margin-top: 12px;
}

.duel-private-controls .session-actions {
  margin: 0;
}

.duel-private-create-row {
  margin-bottom: 18px !important;
  display: block !important;
}

.duel-private-create-row #duel-private-create-btn {
  width: 100%;
  min-height: 48px;
}

.duel-private-join-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px !important;
  align-items: stretch;
  margin-top: 20px !important;
  padding-top: 12px !important;
  border-top: 1px solid rgba(0, 157, 255, 0.34);
}

.duel-private-join-row #duel-private-code-input {
  min-width: 0;
}

.duel-private-join-row #duel-private-join-btn {
  min-width: 132px;
}

.duel-mode-tabs {
  border: 1px solid rgba(255, 95, 85, 0.3);
  background: rgba(9, 13, 21, 0.58);
  padding: 8px;
}

.duel-mode-tabs .tab {
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 14px;
}

.duel-actions input,
.duel-actions select,
.duel-status input {
  width: 100%;
  border: 2px solid rgba(216, 184, 94, 0.78);
  background: rgba(10, 14, 20, 0.92);
  color: #f6efe2;
  padding: 10px 12px;
  border-radius: 0;
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif !important;
  font-size: 12px;
}

#duel-private-code-input,
#duel-private-join-btn,
#duel-private-create-btn {
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif !important;
}

#duel-private-code-input::placeholder {
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif !important;
  letter-spacing: 0.03em;
}

.duel-actions select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #c9f4ef 50%), linear-gradient(135deg, #c9f4ef 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(1em + 2px), calc(100% - 13px) calc(1em + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

.duel-actions input:focus,
.duel-actions select:focus,
.duel-status input:focus {
  outline: none;
  border-color: #39c3b0;
  box-shadow: 0 0 0 2px rgba(57, 195, 176, 0.22);
}

.duel-stats-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.duel-stat {
  border: 1px solid var(--line, rgba(255, 255, 255, 0.18));
  background: rgba(10, 14, 20, 0.55);
  padding: 10px 12px;
}

.duel-stat-label {
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 4px;
}

.duel-stat-value {
  font-size: 18px;
  font-weight: 700;
}

.duel-population-meta {
  margin-top: 8px;
  border: 1px solid rgba(0, 157, 255, 0.34);
  background: rgba(9, 14, 22, 0.72);
  padding: 9px 10px;
  color: #cfe9ff;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
}

.duel-recent-list {
  display: grid;
  gap: 8px;
}

/* Improve first render and low-end scrolling by skipping offscreen work. */
.leaderboard-grid,
.shop-inventory,
.quest-grid,
.duel-stats-grid,
.duel-recent-list,
.feedback-history {
  content-visibility: auto;
  contain-intrinsic-size: 1px 640px;
}

.duel-recent-row {
  border: 1px solid var(--line, rgba(255, 255, 255, 0.18));
  background: rgba(10, 14, 20, 0.48);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

@media (max-width: 900px) {
  .duel-grid {
    grid-template-columns: 1fr;
  }

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

  .duel-private-join-row {
    grid-template-columns: 1fr;
  }

  .duel-private-join-row #duel-private-join-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .duel-pill,
  .duel-choice-btn {
    transition: none;
  }
}

.leaderboard-warning-banner {
  border: 1px solid rgba(255, 104, 104, 0.46);
  background: linear-gradient(180deg, rgba(54, 16, 16, 0.64), rgba(35, 12, 12, 0.6));
  color: #ffd4d4;
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.03em;
  box-shadow: inset 0 0 0 1px rgba(255, 160, 160, 0.12);
}

.leaderboard-warning-banner strong {
  color: #ff9e9e;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.leaderboard-warning-banner span {
  color: #ffd27f;
}

.profile-view {
  display: grid;
  gap: 14px;
}

.shop-view {
  display: grid;
  gap: 14px;
}

.leaderboard-period-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}

.leaderboard-meta,
.leaderboard-facts {
  min-height: auto;
}

.profile-card {
  min-height: auto;
}

.profile-leaderboard-status {
  border: 1px solid rgba(255, 95, 85, 0.55);
  background: rgba(42, 12, 12, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 173, 109, 0.2);
  padding: 10px 12px;
  margin-bottom: 12px;
  display: grid;
  gap: 8px;
}

.profile-leaderboard-status-title {
  color: #ffd27f;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 13px;
}

.profile-leaderboard-status-text {
  color: #ffe8c4;
  font-size: 13px;
  line-height: 1.3;
}

.leaderboard-profile {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.leaderboard-profile-avatar-wrap {
  width: 88px;
  height: 88px;
  border: 2px solid rgba(0, 157, 255, 0.45);
  background: rgba(8, 12, 20, 0.85);
  display: grid;
  place-items: center;
}

.profile-view .leaderboard-profile-avatar-wrap {
  width: 108px;
  height: 108px;
}

.cosmetic-preview-wrap {
  position: relative;
  overflow: visible;
  isolation: isolate;
}

.cosmetic-preview-layer {
  position: absolute;
  inset: -10px;
  pointer-events: none;
  border-radius: 50%;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.cosmetic-preview-back {
  z-index: 1;
}

.cosmetic-preview-ring {
  z-index: 2;
}

.cosmetic-preview-front {
  z-index: 4;
}

.cosmetic-preview-effect {
  z-index: 5;
  opacity: 0.9;
}

.leaderboard-profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 3;
  border-radius: 0;
}

.leaderboard-profile-fields {
  display: grid;
  gap: 10px;
  width: min(520px, 100%);
}

.feedback-desk-fields textarea,
.feedback-desk-fields select {
  width: 100%;
}

.feedback-desk-fields textarea,
.feedback-desk-fields select {
  background:
    linear-gradient(180deg, rgba(15, 22, 34, 0.96), rgba(9, 13, 22, 0.94)),
    rgba(9, 13, 22, 0.92);
  border-color: rgba(255, 95, 85, 0.34);
  color: #f2ebde;
  box-shadow:
    inset 0 0 0 1px rgba(255, 228, 162, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.feedback-desk-fields select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(180deg, rgba(15, 22, 34, 0.96), rgba(9, 13, 22, 0.94)),
    linear-gradient(45deg, transparent 50%, #9bcfff 50%),
    linear-gradient(135deg, #9bcfff 50%, transparent 50%);
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-size: auto, 7px 7px, 7px 7px;
  background-position: 0 0, calc(100% - 18px) 18px, calc(100% - 12px) 18px;
}

.feedback-history {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(0, 157, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(10, 15, 24, 0.86), rgba(8, 12, 20, 0.8));
  padding: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 228, 162, 0.08);
}

.feedback-history-title {
  color: #f5efe4;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.feedback-history-empty {
  color: var(--muted);
  font-size: 13px;
}

.public-profile-card {
  width: min(860px, 96vw);
  max-height: min(86vh, 820px);
  overflow: auto;
}

.public-profile-top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.public-profile-avatar-wrap {
  --avatar-size: 72px;
  --avatar-img-size: 64px;
  --avatar-radius: 999px;
  border: 1px solid rgba(0, 157, 255, 0.46);
  background: rgba(11, 15, 24, 0.86);
}

.public-profile-identity {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.public-profile-name {
  font-size: 18px;
  color: #f6efe0;
  line-height: 1.2;
}

.public-profile-username {
  font-size: 12px;
  color: #8fbce6;
}

.public-profile-bio {
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid rgba(0, 157, 255, 0.24);
  background: rgba(11, 16, 24, 0.68);
  color: #ebddc7;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.35;
  min-height: 44px;
}

.public-profile-section-title {
  margin-top: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f1d49b;
}

.public-profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.public-profile-stat {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(0, 157, 255, 0.2);
  background: rgba(9, 13, 20, 0.76);
}

.public-profile-stat span {
  color: #a8c9ea;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.public-profile-stat strong {
  color: #f4ebd9;
  font-size: 14px;
}

.public-profile-placements {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.public-profile-placement-card {
  border: 1px solid rgba(0, 157, 255, 0.24);
  background: rgba(8, 12, 19, 0.78);
  padding: 9px;
  display: grid;
  gap: 5px;
}

.public-profile-placement-head {
  color: #f0d9a8;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.public-profile-placement-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
}

.public-profile-placement-row span {
  color: #d9e8f8;
  font-size: 12px;
  min-width: 0;
}

.public-profile-placement-row strong {
  color: #ffd27f;
  font-size: 12px;
}

.public-profile-placement-row em {
  grid-column: 1 / -1;
  color: #9cc2e8;
  font-style: normal;
  font-size: 11px;
}

.update-announcement-modal {
  width: min(760px, 95vw);
  max-height: min(84vh, 760px);
  overflow: auto;
}

.update-announcement-body {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid rgba(0, 157, 255, 0.22);
  background:
    radial-gradient(circle at top right, rgba(0, 157, 255, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(14, 19, 30, 0.95), rgba(10, 14, 22, 0.88));
}

.update-announcement-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: #dfe8f6;
  font-size: 14px;
  line-height: 1.5;
}

.update-announcement-actions {
  margin-top: 12px;
  gap: 18px;
}

.stale-version-modal {
  width: min(720px, 94vw);
  max-height: min(82vh, 720px);
  overflow: auto;
}

.duel-rework-modal {
  width: min(720px, 94vw);
  max-height: min(82vh, 720px);
  overflow: auto;
}

.duel-rework-body {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid rgba(148, 160, 184, 0.22);
  background:
    radial-gradient(circle at top right, rgba(148, 160, 184, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(14, 19, 30, 0.95), rgba(10, 14, 22, 0.88));
}

.duel-rework-head {
  font-size: 15px;
  letter-spacing: 0.05em;
  color: #f7edd0;
}

.duel-rework-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: #dfe8f6;
  font-size: 14px;
  line-height: 1.5;
}

.duel-rework-actions {
  margin-top: 12px;
  gap: 18px;
}

.stale-version-body {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 95, 85, 0.22);
  background:
    radial-gradient(circle at top right, rgba(255, 95, 85, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(14, 19, 30, 0.95), rgba(10, 14, 22, 0.88));
}

.stale-version-head {
  font-size: 15px;
  letter-spacing: 0.05em;
  color: #f7edd0;
}

.stale-version-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: #dfe8f6;
  font-size: 14px;
  line-height: 1.5;
}

.stale-version-actions {
  margin-top: 12px;
  gap: 18px;
}

.feedback-history-list {
  display: grid;
  gap: 8px;
}

.feedback-history-card {
  border: 1px solid rgba(255, 95, 85, 0.22);
  background:
    radial-gradient(circle at top right, rgba(0, 157, 255, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(14, 19, 30, 0.95), rgba(10, 14, 22, 0.88));
  padding: 10px;
}

.feedback-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.feedback-history-category,
.feedback-history-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.feedback-history-category.feedback-bug {
  color: #ffd9cc;
  border-color: rgba(255, 95, 85, 0.44);
  background: rgba(90, 26, 26, 0.44);
}

.feedback-history-category.feedback-feature {
  color: #d8ecff;
  border-color: rgba(0, 157, 255, 0.42);
  background: rgba(16, 36, 78, 0.4);
}

.feedback-history-category.feedback-feedback {
  color: #ffe7ad;
  border-color: rgba(246, 201, 91, 0.38);
  background: rgba(66, 48, 10, 0.34);
}

.feedback-history-status.status-open {
  color: #ffe1bf;
  border-color: rgba(255, 167, 91, 0.38);
  background: rgba(74, 44, 10, 0.34);
}

.feedback-history-status.status-reviewed {
  color: #cbffec;
  border-color: rgba(109, 227, 180, 0.38);
  background: rgba(20, 66, 49, 0.34);
}

.feedback-history-subject {
  color: #f5efe4;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.feedback-history-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.issue-card,
.update-announcement-card {
  display: grid;
  gap: 10px;
}

.update-announcement-card {
  border: 1px solid rgba(0, 157, 255, 0.28);
  background:
    radial-gradient(circle at top right, rgba(0, 157, 255, 0.08), transparent 40%),
    linear-gradient(180deg, rgba(14, 19, 30, 0.95), rgba(10, 14, 22, 0.9));
  padding: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 228, 162, 0.08);
}

.update-announcement-head {
  font-size: 15px;
  letter-spacing: 0.05em;
  color: #f7edd0;
}

.shop-wallet {
  border: 1px solid rgba(222, 178, 72, 0.35);
  background: rgba(12, 16, 28, 0.72);
  padding: 10px 12px;
}

.shop-wallet-balance {
  font-size: 1.4rem;
  font-weight: 700;
  color: #f6c95b;
}

.shop-wallet-sub {
  color: #c7cde2;
  font-size: 0.9rem;
}

#shop-daily-claim-note {
  color: #d7e8ff;
  border: 1px solid rgba(0, 157, 255, 0.24);
  background: rgba(8, 13, 22, 0.52);
  padding: 8px 10px;
}

#top-coins-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 96px;
  min-height: 44px;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0.08em;
  padding: 8px 14px;
  font-weight: 700;
  color: #f6c95b;
  border-color: rgba(246, 201, 91, 0.45);
  background: rgba(34, 26, 8, 0.7);
  box-shadow: inset 0 0 0 1px rgba(255, 216, 120, 0.26), 0 4px 14px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

#top-coins-pill:hover {
  filter: brightness(1.08);
}

.shop-crates {
  display: grid;
  gap: 10px;
}

.shop-combine {
  display: grid;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid rgba(0, 157, 255, 0.35);
  background: rgba(8, 12, 24, 0.65);
  padding: 10px;
  overflow: visible;
  position: relative;
  z-index: 4;
}

.shop-combine-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #dcecff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

.shop-info-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
}

.shop-combine-dropdown {
  position: relative;
  width: min(280px, 100%);
}

.shop-combine-toggle {
  width: 100%;
  text-align: left;
  position: relative;
  padding-right: 30px;
}

.shop-combine-toggle::after {
  content: "▼";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #9bcfff;
}

.shop-combine-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  width: 100%;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(0, 157, 255, 0.48);
  background: rgba(8, 12, 20, 0.96);
  z-index: 35;
}

.shop-combine-menu .ghost {
  justify-content: flex-start;
  text-align: left;
}

.shop-combine > #shop-combine-btn {
  width: fit-content;
}

.crate-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(80, 132, 231, 0.35);
  background: rgba(8, 12, 24, 0.65);
  padding: 10px;
}

.crate-title {
  font-weight: 700;
}

.crate-price {
  color: #9cc4ff;
}

.shop-inventory {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 14px;
  align-content: start;
  align-items: start;
}

.quests-view {
  display: grid;
  gap: 18px;
}

.quest-progress-shell {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 16px;
  align-items: center;
}

.quest-level-badge {
  min-height: 92px;
  border: 1px solid rgba(0, 157, 255, 0.4);
  background:
    linear-gradient(180deg, rgba(14, 20, 30, 0.94), rgba(10, 15, 23, 0.9)),
    linear-gradient(135deg, rgba(255, 95, 85, 0.12), rgba(0, 157, 255, 0.12));
  display: grid;
  place-items: center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 22px;
  box-shadow: inset 0 0 0 1px rgba(255, 228, 162, 0.16);
}

.quest-level-title {
  font-size: 18px;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.quest-level-sub,
.quest-xp-copy,
.quest-progress-copy {
  color: var(--muted);
  font-size: 13px;
}

.quest-xp-bar,
.quest-progress-bar {
  margin-top: 10px;
  height: 16px;
  border: 1px solid rgba(0, 157, 255, 0.4);
  background: rgba(7, 11, 18, 0.88);
  position: relative;
  overflow: hidden;
}

.quest-xp-fill,
.quest-progress-bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, rgba(255, 95, 85, 0.95), rgba(0, 157, 255, 0.92));
  box-shadow: 0 0 18px rgba(0, 157, 255, 0.28);
  transition: width 220ms ease;
}

.quest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.quest-card {
  padding: 16px;
  border: 1px solid rgba(0, 157, 255, 0.35);
  background:
    radial-gradient(circle at top right, rgba(0, 157, 255, 0.1), transparent 38%),
    radial-gradient(circle at bottom left, rgba(255, 95, 85, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(12, 18, 29, 0.94), rgba(8, 13, 22, 0.9));
  box-shadow: inset 0 0 0 1px rgba(255, 228, 162, 0.12);
  position: relative;
  overflow: hidden;
}

.quest-card.complete {
  border-color: rgba(255, 220, 120, 0.58);
  box-shadow:
    inset 0 0 0 1px rgba(255, 228, 162, 0.16),
    0 0 22px rgba(255, 220, 120, 0.08);
}

.quest-head,
.quest-meta,
.quest-rewards {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quest-head {
  margin-bottom: 8px;
}

.quest-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.quest-icon {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 95, 85, 0.35);
  background: linear-gradient(180deg, rgba(28, 17, 19, 0.95), rgba(15, 14, 24, 0.9));
  display: grid;
  place-items: center;
  font-size: 18px;
  flex: 0 0 auto;
}

.quest-tier {
  color: #ffe2aa;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.quest-title {
  font-size: 17px;
  letter-spacing: 0.06em;
}

.quest-reward-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 220, 141, 0.42);
  background: linear-gradient(180deg, rgba(59, 39, 14, 0.92), rgba(28, 21, 8, 0.9));
  color: #ffe3ab;
  padding: 6px 10px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255, 241, 195, 0.08);
}

.quest-description {
  min-height: 36px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.2;
}

.quest-progress-wrap {
  margin: 12px 0 10px;
}

.quest-progress-bar {
  height: 18px;
  border-color: rgba(0, 157, 255, 0.44);
  background:
    linear-gradient(180deg, rgba(5, 10, 18, 0.95), rgba(8, 12, 20, 0.95));
}

.quest-meta,
.quest-rewards {
  margin-top: 8px;
  flex-wrap: wrap;
}

.quest-meta {
  align-items: flex-start;
}

.quest-chip {
  border: 1px solid rgba(255, 228, 162, 0.2);
  background: rgba(9, 14, 24, 0.88);
  color: var(--ink);
  padding: 4px 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.quest-rewards .ghost,
.quest-rewards .primary {
  min-width: 116px;
}

.quest-reward-coin {
  color: #ffe2aa;
}

.quest-reward-xp {
  color: #8de0ff;
}

.quest-progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quest-progress-copy strong {
  color: var(--ink);
  font-weight: normal;
}

.shop-item {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(8, 12, 24, 0.65);
  padding: 10px;
}

.shop-item-name {
  font-weight: 700;
  margin-bottom: 6px;
}

.shop-item-name .item-icon {
  margin-right: 6px;
}

.shop-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #c7cde2;
}

.rarity-tag {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
}

.shop-meta-tag {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid rgba(0, 157, 255, 0.35);
  background: rgba(10, 16, 28, 0.9);
  color: #dcecff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
}

.slot-tag {
  border-color: rgba(255, 95, 85, 0.38);
  color: #ffd6c9;
}

.count-tag {
  border-color: rgba(246, 201, 91, 0.42);
  color: #ffe3a8;
}

.mod-tag {
  border-color: rgba(245, 206, 86, 0.5);
  color: #ffe998;
  background: rgba(35, 28, 8, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 236, 178, 0.16);
}

.shop-meta-tag.mod-tag.mod-special,
.shop-meta-tag.mod-tag.mod-foil,
.crate-mod-pill.mod-special,
.crate-mod-pill.mod-foil {
  color: #cfe9ff;
  border-color: rgba(132, 206, 255, 0.78);
  background:
    linear-gradient(132deg, rgba(190, 231, 255, 0.22), rgba(84, 164, 255, 0.16), rgba(197, 236, 255, 0.22));
  box-shadow:
    inset 0 0 0 1px rgba(220, 243, 255, 0.22),
    0 0 8px rgba(77, 160, 255, 0.24);
}

.shop-meta-tag.mod-tag.mod-prismatic,
.shop-meta-tag.mod-tag.mod-holographic,
.crate-mod-pill.mod-prismatic,
.crate-mod-pill.mod-holographic {
  color: #ffcaca;
  border-color: rgba(255, 112, 112, 0.82);
  background:
    linear-gradient(128deg, rgba(255, 205, 205, 0.2), rgba(255, 78, 78, 0.18), rgba(255, 210, 210, 0.2));
  box-shadow:
    inset 0 0 0 1px rgba(255, 226, 226, 0.2),
    0 0 8px rgba(255, 92, 92, 0.24);
}

.shop-meta-tag.mod-tag.mod-voidtouched,
.shop-meta-tag.mod-tag.mod-polychrome,
.crate-mod-pill.mod-voidtouched,
.crate-mod-pill.mod-polychrome {
  color: #ffe8ff;
  border-color: rgba(217, 149, 255, 0.86);
  background:
    conic-gradient(
      from 32deg,
      rgba(255, 119, 206, 0.2),
      rgba(255, 194, 94, 0.2),
      rgba(113, 219, 255, 0.2),
      rgba(130, 255, 176, 0.2),
      rgba(216, 137, 255, 0.2),
      rgba(255, 119, 206, 0.2)
    );
  box-shadow:
    inset 0 0 0 1px rgba(255, 219, 255, 0.2),
    0 0 10px rgba(181, 123, 255, 0.28);
}

.shop-meta-tag.mod-tag.mod-negative,
.crate-mod-pill.mod-negative {
  color: #d9ddff;
  border-color: rgba(185, 190, 255, 0.88);
  background:
    radial-gradient(circle at 50% 46%, rgba(18, 14, 46, 0.9), rgba(7, 5, 20, 0.98) 62%, rgba(3, 3, 10, 1) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(210, 213, 255, 0.2),
    0 0 12px rgba(90, 74, 182, 0.34);
}

.shop-item .session-actions {
  margin-top: 10px;
}

.rarity-common {
  color: #d7dce9;
  border-color: rgba(215, 220, 233, 0.32);
}

.rarity-rare {
  color: #8ec7ff;
  border-color: rgba(142, 199, 255, 0.42);
}

.rarity-epic {
  color: #d39cff;
  border-color: rgba(211, 156, 255, 0.45);
}

.rarity-legendary {
  color: #ffdc8d;
  border-color: rgba(255, 220, 141, 0.52);
}

.rarity-uncommon {
  color: #95e2d1;
  border-color: rgba(149, 226, 209, 0.52);
}

.rarity-mythic {
  color: #ff9de5;
  border-color: rgba(255, 157, 229, 0.55);
}

.equip-btn {
  border-color: rgba(246, 201, 91, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 226, 138, 0.18);
}

.effect-frame-neon-red {
  box-shadow: 0 0 0 3px rgba(248, 87, 87, 0.8), 0 0 24px rgba(248, 87, 87, 0.35);
}

.effect-frame-neon-blue {
  box-shadow: 0 0 0 3px rgba(99, 166, 255, 0.85), 0 0 24px rgba(99, 166, 255, 0.35);
}

.effect-frame-neon-green {
  box-shadow: 0 0 0 3px rgba(105, 225, 132, 0.85), 0 0 24px rgba(105, 225, 132, 0.35);
}

.effect-frame-amber {
  box-shadow: 0 0 0 3px rgba(255, 176, 78, 0.85), 0 0 24px rgba(255, 150, 45, 0.35);
}

.effect-frame-embers {
  box-shadow: 0 0 0 3px rgba(255, 167, 53, 0.85), 0 0 26px rgba(255, 99, 24, 0.45);
}

.effect-frame-frost {
  box-shadow: 0 0 0 3px rgba(162, 226, 255, 0.85), 0 0 26px rgba(120, 201, 255, 0.42);
}

.effect-aura-fire {
  background: radial-gradient(circle at center, rgba(255, 120, 24, 0.15), rgba(255, 30, 30, 0.2), transparent 72%);
}

.effect-aura-electric {
  background: radial-gradient(circle at center, rgba(45, 200, 255, 0.16), rgba(80, 90, 255, 0.2), transparent 72%);
}

.effect-aura-void {
  background: radial-gradient(circle at center, rgba(185, 104, 255, 0.2), rgba(45, 31, 128, 0.28), transparent 72%);
}

.effect-aura-mint {
  background: radial-gradient(circle at center, rgba(123, 255, 210, 0.2), rgba(42, 165, 126, 0.25), transparent 72%);
}

.effect-aura-cosmic {
  background: radial-gradient(circle at center, rgba(255, 150, 231, 0.2), rgba(139, 79, 255, 0.28), transparent 72%);
}

.effect-badge-joker::after,
.effect-badge-gold-chip::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  right: 4px;
  bottom: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd36b 0%, #b0761f 100%);
}

.effect-badge-royal-star::after {
  content: "★";
  position: absolute;
  right: 2px;
  bottom: 0;
  font-size: 16px;
  color: #ffd36b;
  text-shadow: 0 0 8px rgba(255, 211, 107, 0.55);
}

.effect-badge-crown-infinite::after {
  content: "∞";
  position: absolute;
  right: 3px;
  bottom: -2px;
  font-size: 15px;
  color: #ffd7ff;
  text-shadow: 0 0 10px rgba(248, 176, 255, 0.62);
}

/* Avatar Decoration / Profile Effect style sets */
.effect-frame-minimal-premium {
  box-shadow:
    0 0 0 2px rgba(151, 124, 63, 0.75),
    0 0 0 4px rgba(243, 212, 145, 0.25),
    0 0 16px rgba(234, 191, 97, 0.22);
}

.effect-deco-corner-glyphs::before {
  content: "";
  position: absolute;
  inset: -1px;
  background:
    linear-gradient(#66c0ff, #66c0ff) 0 0 / 14px 2px no-repeat,
    linear-gradient(#66c0ff, #66c0ff) 0 0 / 2px 14px no-repeat,
    linear-gradient(#66c0ff, #66c0ff) 100% 0 / 14px 2px no-repeat,
    linear-gradient(#66c0ff, #66c0ff) 100% 0 / 2px 14px no-repeat,
    linear-gradient(#66c0ff, #66c0ff) 0 100% / 14px 2px no-repeat,
    linear-gradient(#66c0ff, #66c0ff) 0 100% / 2px 14px no-repeat,
    linear-gradient(#66c0ff, #66c0ff) 100% 100% / 14px 2px no-repeat,
    linear-gradient(#66c0ff, #66c0ff) 100% 100% / 2px 14px no-repeat;
  border-radius: 50%;
  filter: drop-shadow(0 0 5px rgba(102, 192, 255, 0.45));
  animation: cornerPulse 2.3s ease-in-out infinite;
}

.effect-deco-holo-ribbon::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(255, 138, 209, 0.1),
    rgba(112, 199, 255, 0.3),
    rgba(246, 201, 91, 0.18),
    rgba(255, 138, 209, 0.1)
  );
  mask: radial-gradient(circle at center, transparent 60%, #000 61%, #000 71%, transparent 73%);
  animation: ribbonSweep 3.2s linear infinite;
}

.effect-deco-orbit-chips::after {
  content: "●  ✦  ●";
  position: absolute;
  inset: -14px;
  display: grid;
  place-items: center;
  color: rgba(246, 201, 91, 0.9);
  font-size: 12px;
  letter-spacing: 0.35em;
  text-shadow: 0 0 8px rgba(246, 201, 91, 0.35);
  animation: orbitSlow 8.8s linear infinite;
}

.effect-deco-orbit-cards::after {
  content: "♦  ♠  ♥";
  position: absolute;
  inset: -18px;
  display: grid;
  place-items: center;
  color: rgba(154, 216, 255, 0.92);
  font-size: 13px;
  letter-spacing: 0.28em;
  text-shadow: 0 0 9px rgba(122, 198, 255, 0.45);
  animation: orbitSlow 6.4s linear infinite;
}

.effect-deco-floating-stickers::after {
  content: "♛ ✦ 😺";
  position: absolute;
  inset: -8px;
  display: grid;
  place-items: center;
  color: rgba(245, 225, 175, 0.95);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-shadow: 0 0 7px rgba(255, 222, 153, 0.45);
  animation: floatStickers 2.8s ease-in-out infinite;
}

.effect-profile-burst-active {
  animation: profileBurst 1.2s ease-out 1;
}

.cosmetic-preview-wrap:hover .effect-profile-burst {
  animation: profileHoverPulse 0.95s ease-out 1;
}

/* Rarity behavior ladder */
.effect-rarity-common {
  filter: none;
}

.effect-rarity-uncommon {
  filter: drop-shadow(0 0 5px rgba(186, 224, 255, 0.2));
}

.effect-rarity-rare {
  animation-duration: 3.4s;
}

.effect-rarity-epic {
  animation-duration: 2.6s;
}

.effect-rarity-legendary {
  filter: drop-shadow(0 0 9px rgba(246, 201, 91, 0.34));
}

.effect-rarity-mythic {
  filter: drop-shadow(0 0 12px rgba(255, 164, 233, 0.45)) saturate(1.08);
}

/* Generic motion for manifest-driven static decorations. */
.cosmetic-preview-back.effect-rarity-uncommon,
.leaderboard-avatar-back.effect-rarity-uncommon {
  animation: layerBreath 3.2s ease-in-out infinite;
}

.cosmetic-preview-back.effect-rarity-rare,
.leaderboard-avatar-back.effect-rarity-rare {
  animation: layerBreath 2.8s ease-in-out infinite;
}

.cosmetic-preview-back.effect-rarity-epic,
.leaderboard-avatar-back.effect-rarity-epic {
  animation: layerBreath 2.4s ease-in-out infinite, auraDrift 6.4s ease-in-out infinite;
}

.cosmetic-preview-back.effect-rarity-legendary,
.leaderboard-avatar-back.effect-rarity-legendary {
  animation: layerBreath 2.1s ease-in-out infinite, auraDrift 5.4s ease-in-out infinite;
}

.cosmetic-preview-back.effect-rarity-mythic,
.leaderboard-avatar-back.effect-rarity-mythic {
  animation: layerBreath 1.8s ease-in-out infinite, auraDrift 4.6s ease-in-out infinite;
}

.cosmetic-preview-ring.effect-rarity-rare,
.leaderboard-avatar-ring.effect-rarity-rare {
  animation: ringRock 5.8s ease-in-out infinite;
}

.cosmetic-preview-ring.effect-rarity-epic,
.leaderboard-avatar-ring.effect-rarity-epic {
  animation: ringRock 4.8s ease-in-out infinite, ringSweepMotion 9s linear infinite;
}

.cosmetic-preview-ring.effect-rarity-legendary,
.leaderboard-avatar-ring.effect-rarity-legendary {
  animation: ringRock 4.2s ease-in-out infinite, ringSweepMotion 7.8s linear infinite;
}

.cosmetic-preview-ring.effect-rarity-mythic,
.leaderboard-avatar-ring.effect-rarity-mythic {
  animation: ringRock 3.8s ease-in-out infinite, ringSweepMotion 6.8s linear infinite;
}

.cosmetic-preview-front.effect-rarity-epic,
.leaderboard-avatar-front.effect-rarity-epic {
  animation: frontFloat 3.2s ease-in-out infinite;
}

.cosmetic-preview-front.effect-rarity-legendary,
.leaderboard-avatar-front.effect-rarity-legendary {
  animation: frontFloat 2.6s ease-in-out infinite, frontTwinkle 2.8s ease-in-out infinite;
}

.cosmetic-preview-front.effect-rarity-mythic,
.leaderboard-avatar-front.effect-rarity-mythic {
  animation: frontFloat 2.1s ease-in-out infinite, frontTwinkle 2.2s ease-in-out infinite;
}

.cosmetic-preview-effect.effect-rarity-legendary,
.leaderboard-avatar-effect.effect-rarity-legendary {
  animation: effectPulse 2.4s ease-in-out infinite;
}

.cosmetic-preview-effect.effect-rarity-mythic,
.leaderboard-avatar-effect.effect-rarity-mythic {
  animation: effectPulse 1.8s ease-in-out infinite, effectOrbit 6.2s linear infinite;
}

@keyframes orbitSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes layerBreath {
  0%, 100% { transform: scale(0.985); opacity: 0.92; }
  50% { transform: scale(1.03); opacity: 1; }
}

@keyframes auraDrift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(1px, -1px, 0); }
  50% { transform: translate3d(0, -2px, 0); }
  75% { transform: translate3d(-1px, 1px, 0); }
}

@keyframes ringRock {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(1deg) scale(1.01); }
  50% { transform: rotate(0deg) scale(1.02); }
  75% { transform: rotate(-1deg) scale(1.01); }
}

@keyframes ringSweepMotion {
  from { filter: brightness(0.98); }
  50% { filter: brightness(1.12); }
  to { filter: brightness(0.98); }
}

@keyframes frontFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes frontTwinkle {
  0%, 100% { opacity: 0.84; }
  50% { opacity: 1; }
}

@keyframes effectPulse {
  0%, 100% { transform: scale(0.98); opacity: 0.5; }
  50% { transform: scale(1.06); opacity: 0.88; }
}

@keyframes effectOrbit {
  from { transform: rotate(0deg) scale(1.02); }
  to { transform: rotate(360deg) scale(1.02); }
}

@keyframes cornerPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.95; }
}

@keyframes ribbonSweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes floatStickers {
  0%, 100% { transform: translateY(0); opacity: 0.86; }
  50% { transform: translateY(-3px); opacity: 1; }
}

@keyframes profileBurst {
  0% {
    opacity: 0;
    transform: scale(0.88);
  }
  35% {
    opacity: 0.9;
    transform: scale(1.04);
  }
  100% {
    opacity: 0;
    transform: scale(1.14);
  }
}

@keyframes profileHoverPulse {
  0% { opacity: 0.08; transform: scale(1); }
  45% { opacity: 0.48; transform: scale(1.06); }
  100% { opacity: 0.1; transform: scale(1); }
}

.effect-mod-special,
.effect-mod-foil {
  box-shadow:
    0 0 0 1px rgba(132, 206, 255, 0.62),
    0 0 24px rgba(108, 184, 255, 0.34) inset,
    0 0 18px rgba(75, 160, 255, 0.24);
  background-image:
    linear-gradient(118deg, rgba(218, 240, 255, 0.14), rgba(102, 175, 255, 0.1), rgba(218, 240, 255, 0.14));
  animation: modFoilSweep 2.8s linear infinite;
}

.effect-mod-prismatic,
.effect-mod-holographic {
  box-shadow:
    0 0 0 1px rgba(255, 150, 150, 0.58),
    0 0 24px rgba(255, 89, 89, 0.3) inset,
    0 0 18px rgba(255, 122, 122, 0.22);
  background-image:
    linear-gradient(135deg, rgba(255, 220, 220, 0.08), rgba(255, 77, 77, 0.18), rgba(255, 224, 224, 0.08));
  animation: modHoloReflect 2.6s ease-in-out infinite;
}

.effect-mod-voidtouched,
.effect-mod-polychrome {
  box-shadow:
    0 0 0 1px rgba(213, 142, 255, 0.65),
    0 0 26px rgba(176, 91, 255, 0.4) inset,
    0 0 20px rgba(89, 178, 255, 0.22);
  background-image:
    conic-gradient(
      from 0deg,
      rgba(255, 102, 196, 0.16),
      rgba(255, 189, 93, 0.16),
      rgba(112, 216, 255, 0.16),
      rgba(130, 255, 176, 0.16),
      rgba(212, 140, 255, 0.16),
      rgba(255, 102, 196, 0.16)
    );
  animation: modPolychromeShift 3.2s linear infinite;
}

.effect-mod-negative {
  box-shadow:
    0 0 0 1px rgba(227, 232, 255, 0.62),
    0 0 30px rgba(111, 88, 255, 0.32) inset,
    0 0 20px rgba(21, 13, 48, 0.52);
  background-image:
    radial-gradient(circle at center, rgba(12, 8, 32, 0.65), rgba(4, 3, 12, 0.84) 58%, rgba(2, 2, 6, 0.92) 100%);
  filter: saturate(0.78) contrast(1.16) brightness(0.94);
  animation: modNegativeVoid 3.8s ease-in-out infinite;
}

@keyframes modFoilSweep {
  0% {
    filter: brightness(0.96);
    background-position: 0% 50%;
  }
  50% {
    filter: brightness(1.12);
    background-position: 100% 50%;
  }
  100% {
    filter: brightness(0.96);
    background-position: 0% 50%;
  }
}

@keyframes modHoloReflect {
  0%, 100% {
    filter: hue-rotate(0deg) brightness(0.98);
  }
  50% {
    filter: hue-rotate(-8deg) brightness(1.14);
  }
}

@keyframes modPolychromeShift {
  from {
    filter: hue-rotate(0deg) saturate(1.02);
  }
  to {
    filter: hue-rotate(360deg) saturate(1.14);
  }
}

@keyframes modNegativeVoid {
  0%, 100% {
    transform: scale(1);
    opacity: 0.92;
  }
  50% {
    transform: scale(1.018);
    opacity: 1;
  }
}

.crate-open-card {
  max-width: 980px;
  position: relative;
  overflow: hidden;
}

.pack-open-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 120px;
  margin: 6px 0 12px;
}

.pack-open-stage.hidden {
  display: none;
}

.pack-open-pack {
  position: relative;
  width: 220px;
  height: 112px;
  transform-origin: center bottom;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.34));
  overflow: visible;
}

.pack-open-core {
  position: absolute;
  inset: 14px 0 0;
  border: 2px solid rgba(255, 95, 85, 0.3);
  background:
    linear-gradient(180deg, rgba(18, 26, 43, 0.96), rgba(10, 15, 26, 0.98)),
    linear-gradient(135deg, rgba(0, 157, 255, 0.1), rgba(255, 95, 85, 0.12));
  display: grid;
  place-items: center;
  gap: 4px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 226, 160, 0.08),
    0 0 0 1px rgba(0, 157, 255, 0.08);
}

.pack-open-flap {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 30px;
  border: 2px solid rgba(255, 95, 85, 0.34);
  border-bottom: 0;
  background: linear-gradient(180deg, rgba(24, 34, 55, 0.98), rgba(14, 20, 33, 0.98));
  transform-origin: center bottom;
  box-shadow: inset 0 0 0 1px rgba(255, 226, 160, 0.06);
}

.pack-open-sigil,
.pack-open-sub {
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.pack-open-sigil {
  color: #ffe3a0;
  font-size: 20px;
}

.pack-open-sub {
  color: #7ebdff;
  font-size: 11px;
}

.pack-open-cards {
  position: absolute;
  inset: 12px 20px 12px;
  pointer-events: none;
}

.pack-open-card {
  position: absolute;
  bottom: 10px;
  left: 50%;
  width: 54px;
  height: 72px;
  margin-left: -27px;
  border: 2px solid rgba(255, 231, 171, 0.22);
  background:
    linear-gradient(180deg, rgba(20, 30, 51, 0.96), rgba(11, 17, 28, 0.98)),
    linear-gradient(135deg, rgba(0, 157, 255, 0.09), rgba(255, 95, 85, 0.1));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.26);
  opacity: 0;
}

.pack-open-card.fan-a { transform: translateX(-26px) rotate(-13deg); }
.pack-open-card.fan-b { transform: translateY(-2px) rotate(0deg); }
.pack-open-card.fan-c { transform: translateX(26px) rotate(13deg); }

.pack-open-stage.is-opening .pack-open-pack {
  animation: packLift 0.58s ease-out 1;
}

.pack-open-stage.is-opening .pack-open-flap {
  animation: packFlapOpen 0.58s ease-out forwards;
}

.pack-open-stage.is-opening .pack-open-card {
  animation: packCardsFan 0.62s ease-out forwards;
}

.pack-open-stage.is-opening .pack-open-card.fan-a { animation-delay: 0.04s; }
.pack-open-stage.is-opening .pack-open-card.fan-b { animation-delay: 0.08s; }
.pack-open-stage.is-opening .pack-open-card.fan-c { animation-delay: 0.12s; }

.pack-open-stage.is-opening .pack-open-core::after {
  content: "";
  position: absolute;
  inset: 8px;
  background: radial-gradient(circle at center, rgba(255, 229, 148, 0.22), rgba(255, 229, 148, 0));
  animation: packCoreFlash 0.56s ease-out 1;
  pointer-events: none;
}

.crate-open-card.crate-opening {
  box-shadow:
    0 0 0 2px rgba(255, 95, 85, 0.22),
    0 0 34px rgba(0, 157, 255, 0.12),
    0 18px 48px rgba(0, 0, 0, 0.42);
}

.crate-open-wheel {
  height: 124px;
  border: 2px solid rgba(80, 132, 231, 0.45);
  background: linear-gradient(180deg, rgba(7, 10, 18, 0.92), rgba(8, 12, 24, 0.86));
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 8px 0;
  animation: crateGlow 1.2s ease-in-out infinite alternate;
  overflow: hidden;
  position: relative;
  padding-left: 0;
}

.crate-open-wheel.crate-opening-intro {
  animation:
    crateGlow 0.7s ease-in-out infinite alternate,
    crateIntroPulse 0.38s ease-out 1;
}

.crate-open-wheel.crate-opening-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 95, 85, 0) 0%, rgba(255, 95, 85, 0.18) 18%, rgba(0, 157, 255, 0.2) 52%, rgba(255, 95, 85, 0.14) 82%, rgba(255, 95, 85, 0) 100%);
  transform: translateX(-105%);
  animation: crateIntroSweep 0.44s ease-out 1;
  z-index: 3;
  pointer-events: none;
}

.crate-open-wheel::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 50%;
  width: 3px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(246, 201, 91, 0.2), rgba(246, 201, 91, 0.9), rgba(246, 201, 91, 0.2));
  box-shadow: 0 0 12px rgba(246, 201, 91, 0.5);
  z-index: 4;
  pointer-events: none;
}

.crate-wheel-strip {
  display: flex;
  gap: 10px;
  align-items: center;
  will-change: transform;
  position: relative;
  z-index: 2;
}

.crate-wheel-strip-pending {
  animation: pendingCrateScroll 1.1s linear infinite;
  filter: saturate(0.96);
}

.crate-wheel-item {
  min-width: 138px;
  max-width: 330px;
  width: auto;
  flex: 0 0 auto;
  height: 98px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(132, 161, 230, 0.35);
  background: rgba(19, 26, 45, 0.72);
  font-size: 13px;
  padding: 0 8px;
  transition: transform 0.12s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.crate-wheel-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
  align-content: center;
}

.crate-wheel-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: 18px;
}

.crate-wheel-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.03em;
  color: #d7e3ff;
  line-height: 1.2;
  word-break: normal;
  font-size: 14px;
}

.crate-wheel-mod {
  justify-self: start;
  margin: 0;
  font-size: 10px;
  padding: 1px 6px;
  line-height: 1.1;
  max-width: 100%;
}

.crate-wheel-item.rarity-common .crate-wheel-name {
  color: #d7e3ff;
}

.crate-wheel-item.rarity-uncommon .crate-wheel-name {
  color: #8beea5;
}

.crate-wheel-item.rarity-rare .crate-wheel-name {
  color: #78b8ff;
}

.crate-wheel-item.rarity-epic .crate-wheel-name {
  color: #c399ff;
}

.crate-wheel-item.rarity-legendary .crate-wheel-name {
  color: #ffc56f;
}

.crate-wheel-item.rarity-mythic .crate-wheel-name {
  color: #ff9cf4;
}

.crate-wheel-item.active {
  border-color: rgba(246, 201, 91, 0.75);
  box-shadow: 0 0 16px rgba(246, 201, 91, 0.42), inset 0 0 14px rgba(255, 207, 117, 0.16);
  transform: scale(1.06) translateY(-1px);
}

.crate-wheel-item.near-hit {
  border-color: rgba(120, 184, 255, 0.4);
  box-shadow: 0 0 12px rgba(120, 184, 255, 0.16), inset 0 0 10px rgba(120, 184, 255, 0.08);
}

.crate-wheel-item.sparkle {
  position: relative;
}

.crate-wheel-item.sparkle::after {
  content: "✦";
  position: absolute;
  top: -6px;
  right: -4px;
  font-size: 12px;
  color: #ffe899;
  text-shadow: 0 0 8px rgba(255, 232, 153, 0.6);
}

.crate-info-card {
  max-width: 520px;
}

.crate-open-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.crate-grid-item {
  border: 1px solid rgba(96, 141, 228, 0.38);
  background: rgba(13, 19, 34, 0.86);
  padding: 8px;
  display: grid;
  gap: 5px;
}

.crate-grid-icon {
  font-size: 18px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.crate-grid-name {
  font-size: 11px;
  color: #d6e6ff;
  line-height: 1.2;
  min-height: 24px;
  overflow: hidden;
}

.crate-grid-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.crate-odds,
.crate-pool {
  margin-top: 4px;
  font-size: 12px;
  color: #b8d8ff;
  letter-spacing: 0.02em;
}

.crate-pool {
  color: #d8c9a7;
}

#crate-open-result {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.crate-drop-title {
  display: inline-block;
  padding: 4px 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.crate-drop-title.rarity-common { color: #d7e3ff; border-color: rgba(170, 188, 214, 0.45); }
.crate-drop-title.rarity-uncommon { color: #8beea5; border-color: rgba(139, 238, 165, 0.45); }
.crate-drop-title.rarity-rare { color: #78b8ff; border-color: rgba(120, 184, 255, 0.5); }
.crate-drop-title.rarity-epic { color: #c399ff; border-color: rgba(195, 153, 255, 0.52); }
.crate-drop-title.rarity-legendary { color: #ffc56f; border-color: rgba(255, 197, 111, 0.58); }
.crate-drop-title.rarity-mythic { color: #ff9cf4; border-color: rgba(255, 156, 244, 0.62); }

.crate-rarity-pill,
.crate-mod-pill {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}

.crate-rarity-pill.rarity-common { color: #d7e3ff; border-color: rgba(170, 188, 214, 0.45); }
.crate-rarity-pill.rarity-uncommon { color: #8beea5; border-color: rgba(139, 238, 165, 0.45); }
.crate-rarity-pill.rarity-rare { color: #78b8ff; border-color: rgba(120, 184, 255, 0.5); }
.crate-rarity-pill.rarity-epic { color: #c399ff; border-color: rgba(195, 153, 255, 0.52); }
.crate-rarity-pill.rarity-legendary { color: #ffc56f; border-color: rgba(255, 197, 111, 0.58); }
.crate-rarity-pill.rarity-mythic { color: #ff9cf4; border-color: rgba(255, 156, 244, 0.62); }

.crate-win-name {
  color: #f2f7ff;
  font-weight: 700;
}

.crate-more-count {
  color: #9bcfff;
  font-size: 12px;
}

.crate-mod-pill.mod-special,
.crate-mod-pill.mod-foil {
  color: #cfe9ff;
  border-color: rgba(132, 206, 255, 0.78);
  background: linear-gradient(132deg, rgba(190, 231, 255, 0.22), rgba(84, 164, 255, 0.16), rgba(197, 236, 255, 0.22));
}

.crate-mod-pill.mod-prismatic,
.crate-mod-pill.mod-holographic {
  color: #dffcff;
  border-color: rgba(114, 238, 255, 0.9);
  background:
    linear-gradient(128deg, rgba(255, 124, 210, 0.18), rgba(113, 219, 255, 0.16), rgba(194, 255, 248, 0.2));
  box-shadow:
    inset 0 0 0 1px rgba(255, 200, 240, 0.18),
    0 0 10px rgba(113, 219, 255, 0.16);
}

.crate-mod-pill.mod-voidtouched,
.crate-mod-pill.mod-polychrome {
  color: #ffe8ff;
  border-color: rgba(217, 149, 255, 0.86);
  background: conic-gradient(
    from 40deg,
    rgba(255, 119, 206, 0.18),
    rgba(255, 194, 94, 0.16),
    rgba(113, 219, 255, 0.16),
    rgba(130, 255, 176, 0.16),
    rgba(216, 137, 255, 0.18),
    rgba(255, 119, 206, 0.18)
  );
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 12px rgba(179, 124, 255, 0.18);
}

.crate-mod-pill.mod-negative {
  color: #eef0ff;
  border-color: rgba(162, 173, 255, 0.9);
  background:
    radial-gradient(circle at center, rgba(25, 20, 58, 0.92), rgba(7, 6, 18, 0.98)),
    linear-gradient(135deg, rgba(84, 70, 190, 0.16), rgba(0, 0, 0, 0));
  box-shadow:
    inset 0 0 0 1px rgba(194, 202, 255, 0.14),
    0 0 12px rgba(93, 76, 213, 0.22);
}

.crate-new-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  margin-left: 6px;
  border: 1px solid rgba(255, 214, 122, 0.75);
  background: rgba(255, 214, 122, 0.18);
  color: #ffd67a;
  font-size: 11px;
  letter-spacing: 0.08em;
  vertical-align: middle;
}

.crate-open-card.result-legendary {
  box-shadow: 0 0 0 2px rgba(255, 197, 111, 0.38), 0 0 40px rgba(255, 197, 111, 0.2);
}

.crate-open-card.result-uncommon {
  box-shadow: 0 0 0 2px rgba(139, 238, 165, 0.26), 0 0 16px rgba(139, 238, 165, 0.12);
}

.crate-open-card.result-rare {
  box-shadow: 0 0 0 2px rgba(120, 184, 255, 0.32), 0 0 24px rgba(76, 152, 255, 0.16);
  animation: resultPulseRare 0.42s ease-out 1;
}

.crate-open-card.result-epic {
  box-shadow: 0 0 0 2px rgba(195, 153, 255, 0.38), 0 0 30px rgba(175, 120, 255, 0.2);
  animation: resultPulseEpic 0.5s ease-out 1;
}

.crate-open-card.result-mythic {
  box-shadow: 0 0 0 2px rgba(255, 156, 244, 0.44), 0 0 44px rgba(255, 156, 244, 0.26);
}

.crate-open-card.mythic-hit {
  animation: mythicShake 0.52s ease;
}

.crate-confetti {
  position: absolute;
  top: -16px;
  width: 8px;
  height: 14px;
  background: linear-gradient(180deg, #ffd67a, #ff7a6a);
  box-shadow: 0 0 8px rgba(255, 215, 122, 0.35);
  transform: rotate(18deg);
  animation: crateConfettiFall linear forwards;
  pointer-events: none;
  z-index: 2;
}

.crate-open-card.result-mythic .crate-confetti {
  background: linear-gradient(180deg, #ff9cf4, #7aa6ff);
  box-shadow: 0 0 8px rgba(255, 156, 244, 0.4);
}

@keyframes resultPulseRare {
  0% { transform: scale(0.995); }
  45% { transform: scale(1.004); }
  100% { transform: scale(1); }
}

@keyframes resultPulseEpic {
  0% { transform: scale(0.992); }
  40% { transform: scale(1.008); }
  100% { transform: scale(1); }
}

@keyframes crateConfettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  100% {
    transform: translateY(260px) rotate(540deg);
    opacity: 0;
  }
}

@keyframes mythicShake {
  0% {
    transform: translateX(0);
    filter: brightness(1);
  }
  20% {
    transform: translateX(-3px);
    filter: brightness(1.25);
  }
  40% {
    transform: translateX(4px);
  }
  60% {
    transform: translateX(-2px);
  }
  80% {
    transform: translateX(2px);
  }
  100% {
    transform: translateX(0);
    filter: brightness(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .crate-open-wheel {
    animation: none;
  }

  .crate-open-card.mythic-hit {
    animation: none;
  }

  .crate-confetti {
    display: none;
  }

  .cosmetic-preview-layer,
  .cosmetic-preview-wrap:hover .effect-profile-burst,
  .effect-profile-burst-active {
    animation: none !important;
  }
}

body.reduced-fx .ambient,
body.reduced-fx .crate-confetti {
  display: none !important;
}

body.reduced-fx .crate-open-wheel,
body.reduced-fx .crate-open-card,
body.reduced-fx .crate-wheel-item,
body.reduced-fx .effect-profile-burst,
body.reduced-fx .effect-profile-burst-active {
  animation: none !important;
  transition: none !important;
}

body.reduced-fx .effect-mod-foil,
body.reduced-fx .effect-mod-holographic,
body.reduced-fx .effect-mod-polychrome,
body.reduced-fx .effect-mod-negative {
  filter: none !important;
}

body.reduced-fx::before,
body.reduced-fx::after {
  animation: none !important;
}

@media (max-width: 720px) {
  .dashboard-tabs {
    gap: 8px;
  }

  .dashboard-tabs .tab {
    flex: 1 1 calc(50% - 8px);
  }

  .quest-progress-shell {
    grid-template-columns: 1fr;
  }

  .quest-level-badge {
    min-height: 72px;
  }

  .quest-grid {
    grid-template-columns: 1fr;
  }

  .quest-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .quest-reward-badge {
    width: 100%;
    text-align: center;
  }

  .quest-rewards .ghost,
  .quest-rewards .primary {
    flex: 1 1 100%;
  }

  .crate-open-wheel {
    height: 106px;
  }

  .crate-wheel-strip {
    gap: 8px;
  }

  .crate-wheel-item {
    min-width: 122px;
    max-width: 260px;
    width: auto;
    flex: 0 0 auto;
    height: 86px;
    grid-template-columns: 22px 1fr;
    gap: 7px;
    padding: 0 8px;
  }

  .crate-wheel-icon {
    font-size: 16px;
    width: 22px;
    height: 22px;
  }

  .crate-wheel-name {
    font-size: 13px;
    line-height: 1.1;
  }

  .crate-wheel-mod {
    font-size: 9px;
    padding: 1px 5px;
  }

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

.crate-detail-section {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.crate-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(0, 157, 255, 0.26);
  background: rgba(9, 13, 23, 0.7);
  padding: 6px 8px;
}

@keyframes crateGlow {
  from {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 8px rgba(80, 132, 231, 0.35);
  }
  to {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 16px rgba(246, 201, 91, 0.45);
  }
}

@keyframes pendingCrateScroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-96px);
  }
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.leaderboard-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 157, 255, 0.8) rgba(10, 14, 22, 0.8);
  position: relative;
  z-index: 15;
}

.leaderboard-list::-webkit-scrollbar {
  width: 10px;
}

.leaderboard-list::-webkit-scrollbar-track {
  background: rgba(10, 14, 22, 0.82);
  border: 1px solid rgba(0, 157, 255, 0.22);
}

.leaderboard-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 157, 255, 0.9), rgba(255, 95, 85, 0.78));
  border: 1px solid rgba(255, 230, 170, 0.45);
}

.leaderboard-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(0, 157, 255, 0.98), rgba(255, 95, 85, 0.9));
}

.leaderboard-podium {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "first first"
    "second third";
  align-items: end;
  gap: 10px 14px;
  position: relative;
  z-index: 1;
}

.podium-node {
  position: relative;
  width: min(100%, 460px);
  min-height: 110px;
  padding: 12px 12px 10px;
  border: 1px solid rgba(0, 157, 255, 0.25);
  background: rgba(10, 14, 22, 0.84);
  display: grid;
  gap: 10px;
}

.podium-first {
  grid-area: first;
  justify-self: center;
  width: min(100%, 520px);
  margin-right: 0;
  border-color: rgba(255, 212, 90, 0.72);
  box-shadow: 0 10px 20px rgba(255, 200, 55, 0.15);
}

.podium-second {
  grid-area: second;
  justify-self: start;
  width: min(100%, 460px);
  margin-left: 0;
  border-color: rgba(160, 206, 255, 0.66);
}

.podium-third {
  grid-area: third;
  justify-self: end;
  width: min(100%, 460px);
  margin-right: 0;
  border-color: rgba(205, 146, 96, 0.76);
}

.podium-rank {
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #9bcfff;
}

.podium-first .podium-rank {
  color: #ffd25a;
}

.podium-second .podium-rank {
  color: #c3ddff;
}

.podium-third .podium-rank {
  color: #d59b6c;
}

.podium-node.self-podium {
  box-shadow: 0 0 0 1px rgba(102, 215, 255, 0.45), 0 12px 24px rgba(4, 12, 20, 0.55);
}

.podium-node.self-podium.podium-first {
  box-shadow: 0 0 0 1px rgba(255, 212, 90, 0.72), 0 12px 24px rgba(255, 200, 55, 0.25);
}

.podium-node.self-podium.podium-second {
  box-shadow: 0 0 0 1px rgba(198, 218, 240, 0.72), 0 12px 24px rgba(153, 177, 204, 0.25);
}

.podium-node.self-podium.podium-third {
  box-shadow: 0 0 0 1px rgba(205, 146, 96, 0.85), 0 12px 24px rgba(144, 93, 56, 0.3);
}

.leaderboard-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(0, 157, 255, 0.25);
  background: rgba(10, 14, 22, 0.72);
}

.leaderboard-row.rank-1 {
  border-color: rgba(255, 212, 90, 0.6);
}

.leaderboard-row.rank-2 {
  border-color: rgba(198, 218, 240, 0.6);
}

.leaderboard-row.rank-3 {
  border-color: rgba(205, 146, 96, 0.66);
}

.leaderboard-row.self-row {
  border-color: rgba(102, 215, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(102, 215, 255, 0.32);
}

.leaderboard-row.self-row.rank-1 {
  border-color: rgba(255, 212, 90, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 212, 90, 0.45);
}

.leaderboard-row.self-row.rank-2 {
  border-color: rgba(198, 218, 240, 0.9);
  box-shadow: inset 0 0 0 1px rgba(198, 218, 240, 0.45);
}

.leaderboard-row.self-row.rank-3 {
  border-color: rgba(205, 146, 96, 0.9);
  box-shadow: inset 0 0 0 1px rgba(205, 146, 96, 0.45);
}

.leaderboard-row-name {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  width: 100%;
  cursor: default !important;
}

.leaderboard-row-name.leaderboard-profile-link {
  cursor: pointer !important;
}

.leaderboard-row-name * {
  cursor: inherit !important;
}

.leaderboard-row-name.has-alias {
  cursor: help !important;
}

.leaderboard-row-name.leaderboard-profile-link.has-alias {
  cursor: help !important;
}

.leaderboard-row-name img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid rgba(0, 157, 255, 0.55);
  position: relative;
  z-index: 3;
  border-radius: inherit;
}

.leaderboard-avatar-wrap {
  --avatar-size: 34px;
  --avatar-img-size: 28px;
  --avatar-radius: 50%;
  --layer-inset-back: -3px;
  --layer-inset-ring: -2px;
  --layer-inset-front: -3px;
  --layer-inset-effect: -4px;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--avatar-size);
  height: var(--avatar-size);
  min-width: var(--avatar-size);
  min-height: var(--avatar-size);
  border-radius: var(--avatar-radius);
  overflow: visible;
  isolation: isolate;
  flex: 0 0 auto;
}

.leaderboard-avatar-wrap > img {
  width: var(--avatar-img-size);
  height: var(--avatar-img-size);
  border-radius: 0;
}

.leaderboard-avatar-layer {
  position: absolute;
  pointer-events: none;
  border-radius: var(--avatar-radius);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.item-asset-thumb,
.crate-wheel-icon-img,
.crate-grid-icon-img {
  display: inline-grid;
  place-items: center;
}

.item-asset-thumb img,
.crate-wheel-icon-img img,
.crate-grid-icon-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.item-asset-thumb {
  width: 20px;
  height: 20px;
  margin-right: 6px;
  vertical-align: middle;
}

.crate-wheel-icon-img {
  width: 26px;
  height: 26px;
}

.crate-grid-icon-img {
  width: 24px;
  height: 24px;
}

.item-asset-fallback {
  width: 20px;
  height: 20px;
  margin-right: 6px;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
}

.leaderboard-avatar-back {
  inset: var(--layer-inset-back);
  z-index: 1;
}

.leaderboard-avatar-ring {
  inset: var(--layer-inset-ring);
  z-index: 2;
}

.leaderboard-avatar-front {
  inset: var(--layer-inset-front);
  z-index: 4;
}

.leaderboard-avatar-effect {
  inset: var(--layer-inset-effect);
  z-index: 5;
}

.leaderboard-row-name .leaderboard-display-name {
  display: block;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.2;
  max-height: none;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.podium-node .leaderboard-row-name .leaderboard-display-name {
  max-width: 100%;
}

.leaderboard-value {
  white-space: nowrap;
}

.name-warning {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0;
  width: fit-content;
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1.1;
  color: #ffe484;
  background: linear-gradient(180deg, rgba(49, 36, 8, 0.96), rgba(34, 24, 6, 0.96));
  border: 1px solid #ffd15a;
  box-shadow: 0 0 0 1px rgba(255, 217, 112, 0.22), 0 2px 8px rgba(0, 0, 0, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
}

.name-tooltip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  padding: 5px 8px;
  background: rgba(10, 15, 24, 0.95);
  border: 1px solid rgba(0, 157, 255, 0.55);
  color: #dff2ff;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 120;
}

.leaderboard-name-tooltip-float {
  position: fixed !important;
  left: 0;
  top: 0;
  padding: 8px 10px;
  background: linear-gradient(180deg, rgba(16, 26, 40, 0.98), rgba(10, 16, 26, 0.98));
  border: 1px solid rgba(0, 157, 255, 0.78);
  color: #eff7ff;
  white-space: normal;
  max-width: min(280px, 72vw);
  overflow-wrap: anywhere;
  pointer-events: none;
  z-index: 2147483647 !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  border-radius: 0;
  font-size: 12px;
  line-height: 1.2;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scale(0.96);
  transform-origin: left bottom;
  transition: opacity 0.14s ease-out, transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.14s linear;
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
  display: block !important;
}

.leaderboard-name-tooltip-float.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.leaderboard-row-name.has-alias:hover .name-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* In scrollable ranked rows (4th+), show tooltip below so podium never covers it. */
.leaderboard-list .leaderboard-row-name .name-tooltip {
  left: 0;
  top: auto;
  bottom: calc(100% + 6px);
  transform: translateY(4px);
  z-index: 500;
}

.leaderboard-list .leaderboard-row-name.has-alias:hover .name-tooltip {
  transform: translateY(0);
}

.leaderboard-rank {
  color: #9bcfff;
}

.leaderboard-value {
  color: #ffb2b2;
  font-weight: 700;
}

.leaderboard-facts-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.card {
  background: rgba(9, 12, 18, 0.85);
  border-radius: 18px;
  padding: 16px;
  border: 1px solid rgba(96, 212, 247, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 95, 85, 0.05);
  display: grid;
  gap: 12px;
  min-height: 160px;
  animation: fadeIn 0.8s ease;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: visible;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 95, 85, 0.3);
  box-shadow: inset 0 0 0 1px rgba(255, 95, 85, 0.08), 0 18px 30px rgba(2, 4, 8, 0.35);
}

.card.vm {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  transform: none !important;
}

.card.vm:hover {
  transform: none !important;
}

.card.status {
  background: linear-gradient(160deg, rgba(11, 20, 30, 0.92), rgba(12, 16, 24, 0.9));
}

.card-title {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 13px;
  color: #ddd2ba;
  font-family: "BalatroPixel", "Trebuchet MS", sans-serif;
}

.card-title[data-help] {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  cursor: help;
}

.card-title[data-help]::before {
  content: "?";
  width: 14px;
  height: 14px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(0, 157, 255, 0.6);
  color: #9bcfff;
  font-size: 10px;
  line-height: 1;
}

.card-title[data-help]::after {
  content: attr(data-help);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  max-width: min(360px, 75vw);
  z-index: 1200;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  padding: 8px 10px;
  background: rgba(9, 14, 22, 0.96);
  border: 1px solid rgba(0, 157, 255, 0.45);
  color: #dbefff;
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 12px;
  line-height: 1.35;
}

.card-title[data-help]:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.session-state {
  font-size: 30px;
  font-family: "BalatroPixel", "Trebuchet MS", sans-serif;
  color: var(--gold);
}

.session-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.next-action {
  padding: 10px 12px;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(18, 28, 44, 0.95), rgba(12, 18, 30, 0.95));
  border: 2px solid rgba(0, 157, 255, 0.44);
  color: #d5e8ff;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.hotkey-hint {
  color: var(--muted);
  font-size: 13px;
}

.quick-steps {
  display: grid;
  gap: 8px;
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}

.quick-steps > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-steps span {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #0f1722;
  background: var(--gold);
}

.profile-list,
.overlay-profiles {
  display: grid;
  gap: 12px;
}

.profiles-note {
  font-size: 12px;
  color: var(--muted);
}

.profile-pill {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(13, 95, 74, 0.2);
  border: 1px solid rgba(13, 95, 74, 0.5);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-pill.active {
  border-color: rgba(255, 95, 85, 0.7);
  box-shadow: inset 0 0 0 1px rgba(255, 95, 85, 0.3);
}

.profile-pill button {
  border: none;
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
}

.metric {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
  gap: 12px;
}

.metric strong {
  color: var(--ink);
}

.vm-screen {
  position: relative;
  border-radius: 0;
  background: radial-gradient(circle at top, rgba(0, 157, 255, 0.22), transparent 62%),
    linear-gradient(160deg, rgba(28, 19, 12, 0.94), rgba(10, 14, 24, 0.96));
  min-height: 220px;
  border: 2px solid rgba(0, 157, 255, 0.5);
  overflow: hidden;
}

.vm-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #050608;
  z-index: 0;
}

.vm-iframe.hidden {
  display: block !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.vm-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #f4d9a1;
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(255, 95, 85, 0.35);
  background: linear-gradient(180deg, rgba(9, 11, 18, 0.82), rgba(9, 11, 18, 0.65));
  z-index: 1;
}

.vm-loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(8, 10, 16, 0.92), rgba(12, 10, 8, 0.92)),
    repeating-linear-gradient(
      0deg,
      rgba(255, 95, 85, 0.08) 0 3px,
      rgba(0, 157, 255, 0.08) 3px 6px
    );
  border: 2px solid rgba(0, 157, 255, 0.45);
  z-index: 2;
  box-shadow: inset 0 0 0 2px rgba(0, 157, 255, 0.18);
}

.vm-loader-panel {
  position: relative;
  z-index: 1;
  width: min(480px, calc(100vw - 48px));
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 22px 24px 20px;
  background: linear-gradient(180deg, rgba(9, 15, 24, 0.96), rgba(12, 11, 16, 0.96));
  border: 2px solid rgba(0, 157, 255, 0.48);
  box-shadow:
    inset 0 0 0 1px rgba(255, 95, 85, 0.16),
    0 26px 80px rgba(0, 0, 0, 0.48);
}

.vm-loader::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 14px,
      rgba(0, 157, 255, 0.08) 14px 15px
    );
  animation: loaderSweep 1.6s linear infinite;
}

.vm-loader.hidden,
.vm-overlay.hidden {
  display: none;
}

.vm-queue-panel {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(8, 10, 16, 0.84), rgba(11, 15, 24, 0.84)),
    repeating-linear-gradient(0deg, rgba(255, 95, 85, 0.07) 0 3px, rgba(0, 157, 255, 0.07) 3px 6px);
  border: 2px solid rgba(0, 157, 255, 0.45);
}

.vm-queue-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 22%, rgba(0, 157, 255, 0.18), transparent 42%),
    radial-gradient(circle at 82% 76%, rgba(255, 95, 85, 0.2), transparent 44%),
    repeating-linear-gradient(
      90deg,
      transparent 0 16px,
      rgba(0, 157, 255, 0.08) 16px 17px
    );
  animation: loaderSweep 1.8s linear infinite;
}

.vm-queue-panel.hidden {
  display: none !important;
}

.vm-duel-prematch {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(8, 10, 16, 0.9), rgba(11, 15, 24, 0.9)),
    repeating-linear-gradient(0deg, rgba(255, 95, 85, 0.06) 0 3px, rgba(0, 157, 255, 0.06) 3px 6px);
  border: 2px solid rgba(0, 157, 255, 0.42);
}

.vm-duel-prematch.hidden {
  display: none !important;
}

.vm-duel-live-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: clamp(18px, 3vw, 30px);
  background:
    radial-gradient(circle at top, rgba(0, 157, 255, 0.18), transparent 45%),
    linear-gradient(180deg, rgba(5, 9, 16, 0.84), rgba(5, 9, 16, 0.9));
}

.vm-duel-live-overlay.hidden {
  display: none !important;
}

.vm-duel-live-card {
  width: min(620px, 100%);
  display: grid;
  gap: 12px;
  padding: clamp(18px, 3vw, 28px);
  border: 2px solid rgba(255, 95, 85, 0.48);
  background:
    linear-gradient(180deg, rgba(13, 20, 32, 0.96), rgba(8, 12, 20, 0.96)),
    radial-gradient(circle at top right, rgba(255, 95, 85, 0.1), transparent 40%);
  box-shadow:
    0 30px 65px rgba(0, 0, 0, 0.52),
    inset 0 0 0 1px rgba(255, 228, 162, 0.1);
}

.vm-duel-live-stage,
.vm-duel-live-title,
.vm-duel-live-subtitle,
.vm-duel-live-timer {
  text-align: center;
}

.vm-duel-live-stage {
  color: #ffe0b1;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
}

.vm-duel-live-title {
  color: #fff4d6;
  font-size: clamp(22px, 4vw, 34px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.vm-duel-live-subtitle {
  color: #dcecff;
  font-size: 13px;
  line-height: 1.45;
}

.vm-duel-live-timer {
  color: #9bcfff;
  font-size: clamp(24px, 4vw, 40px);
  letter-spacing: 0.08em;
}

.vm-duel-live-rules {
  padding: 12px 14px;
  border: 1px solid rgba(0, 157, 255, 0.24);
  background: rgba(10, 18, 30, 0.72);
  color: #dcecff;
  font-size: 12px;
  line-height: 1.5;
}

.vm-duel-live-stats {
  display: grid;
  gap: 8px;
}

.vm-duel-live-stat {
  display: grid;
  grid-template-columns: minmax(72px, 92px) 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 95, 85, 0.18);
  background: rgba(18, 24, 38, 0.72);
  color: #dcecff;
  font-size: 12px;
}

.vm-duel-live-stat strong {
  color: #fff4d6;
  text-align: right;
  font-size: 12.5px;
  line-height: 1.45;
}

.vm-duel-live-actions {
  justify-content: center;
}

.vm-duel-card {
  width: min(820px, calc(100% - 30px));
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 18px;
  border: 2px solid rgba(0, 157, 255, 0.46);
  background:
    linear-gradient(180deg, rgba(11, 16, 26, 0.97), rgba(9, 13, 22, 0.96)),
    linear-gradient(125deg, rgba(0, 157, 255, 0.12), rgba(255, 95, 85, 0.14));
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.52),
    inset 0 0 0 1px rgba(255, 231, 168, 0.14);
}

.vm-duel-stage,
.vm-duel-title,
.vm-duel-subtitle,
.vm-duel-timer,
.vm-duel-name,
.vm-duel-versus {
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
  text-transform: uppercase;
}

.vm-duel-stage {
  color: #9bcfff;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.vm-duel-title {
  color: #ffe2b7;
  letter-spacing: 0.1em;
  font-size: 20px;
}

.vm-duel-subtitle {
  color: #d8edff;
  letter-spacing: 0.05em;
  font-size: 12px;
  text-align: center;
  max-width: 620px;
}

.vm-duel-timer {
  border: 2px solid rgba(255, 95, 85, 0.5);
  background: rgba(8, 12, 20, 0.88);
  color: #ffd58f;
  letter-spacing: 0.08em;
  min-width: 82px;
  text-align: center;
  padding: 6px 10px;
  font-size: 16px;
}

.vm-duel-setup-signal {
  width: min(620px, calc(100% - 16px));
  display: grid;
  gap: 6px;
  justify-items: center;
}

.vm-duel-setup-progress {
  width: min(540px, 100%);
  height: 11px;
  border: 1px solid rgba(0, 157, 255, 0.42);
  background: rgba(7, 10, 16, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 231, 168, 0.1);
  overflow: hidden;
}

.vm-duel-setup-progress-fill {
  display: block;
  width: 12%;
  height: 100%;
  background: linear-gradient(90deg, rgba(0, 157, 255, 0.92), rgba(255, 95, 85, 0.88));
  box-shadow: 0 0 10px rgba(0, 157, 255, 0.33);
  transition: width 220ms ease;
}

.vm-duel-setup-hint {
  color: #c6e5ff;
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: center;
}

.vm-duel-vs {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-top: 2px;
}

.vm-duel-player {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.vm-duel-avatar-wrap {
  width: 86px;
  height: 86px;
  position: relative;
  border: 2px solid rgba(0, 157, 255, 0.48);
  background: rgba(7, 11, 18, 0.9);
}

.vm-duel-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vm-duel-avatar-wrap .leaderboard-avatar-layer {
  inset: -8%;
}

.vm-duel-name {
  color: #f0e0c2;
  letter-spacing: 0.05em;
  font-size: 12px;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.vm-duel-versus {
  color: #ffb678;
  letter-spacing: 0.12em;
  font-size: 28px;
  text-shadow: 0 0 12px rgba(255, 95, 85, 0.4);
}

.vm-duel-actions {
  justify-content: center;
  width: min(520px, 100%);
}

.vm-duel-actions .primary,
.vm-duel-actions .ghost {
  min-width: 140px;
}

.vm-duel-deck-panel {
  width: min(760px, 100%);
  display: grid;
  gap: 8px;
  padding: 8px 10px 10px;
  border: 1px solid rgba(0, 157, 255, 0.35);
  background: linear-gradient(180deg, rgba(7, 11, 18, 0.9), rgba(9, 14, 22, 0.86));
  box-shadow: inset 0 0 0 1px rgba(255, 95, 85, 0.16);
}

.vm-duel-deck-panel.hidden {
  display: none !important;
}

.vm-duel-deck-picks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.vm-duel-deck-pick {
  display: grid;
  gap: 2px;
  border: 1px solid rgba(0, 157, 255, 0.28);
  background: rgba(8, 13, 20, 0.85);
  padding: 6px 8px;
}

.vm-duel-deck-pick-label,
.vm-duel-deck-pick-value,
.vm-duel-deck-final,
.vm-duel-deck-roll-item {
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
  text-transform: uppercase;
}

.vm-duel-deck-pick-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #9ac8f6;
}

.vm-duel-deck-pick-value {
  font-size: 12px;
  letter-spacing: 0.05em;
  color: #f7debb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vm-duel-deck-roll {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 95, 85, 0.36);
  background: linear-gradient(180deg, rgba(9, 14, 24, 0.98), rgba(8, 12, 20, 0.94));
  min-height: 48px;
}

.vm-duel-deck-roll.hidden {
  display: none !important;
}

.vm-duel-deck-roll-track {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.vm-duel-deck-roll-marker {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 50%;
  width: 3px;
  margin-left: -1px;
  border-radius: 2px;
  background: linear-gradient(180deg, #ff9f62, #ff5f55);
  box-shadow: 0 0 12px rgba(255, 95, 85, 0.5);
  pointer-events: none;
}

.vm-duel-deck-roll-item {
  flex: 0 0 148px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 157, 255, 0.3);
  background: rgba(11, 18, 28, 0.95);
  color: #cde4ff;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-align: center;
  padding: 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vm-duel-deck-roll-item.is-picked {
  border-color: rgba(255, 95, 85, 0.54);
  box-shadow: 0 0 8px rgba(255, 95, 85, 0.25);
}

.vm-duel-deck-roll-item.is-landed {
  border-color: rgba(255, 205, 142, 0.82);
  color: #ffeccf;
  box-shadow: 0 0 14px rgba(255, 172, 88, 0.38);
}

.vm-duel-deck-final {
  font-size: 11px;
  letter-spacing: 0.07em;
  color: #ffe0ae;
  text-align: center;
}

.vm-duel-prematch.phase-ready .vm-duel-title {
  animation: duelPulse 1.1s ease-in-out infinite;
}

.vm-duel-prematch.phase-vs .vm-duel-versus {
  animation: duelPulseFast 0.5s ease-in-out infinite;
}

.vm-duel-prematch.phase-setup .vm-duel-card,
.vm-duel-prematch.phase-vs .vm-duel-card {
  animation: duelSetupPulse 1.2s ease-in-out infinite;
}

.vm-duel-prematch.phase-setup .vm-duel-setup-progress-fill,
.vm-duel-prematch.phase-vs .vm-duel-setup-progress-fill {
  background-size: 200% 100%;
  animation: duelSetupShimmer 1.15s linear infinite;
}

@keyframes duelPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.95;
  }
  50% {
    transform: scale(1.03);
    opacity: 1;
  }
}

@keyframes duelPulseFast {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.07);
  }
}

@keyframes duelSetupPulse {
  0%,
  100% {
    box-shadow:
      0 14px 34px rgba(0, 0, 0, 0.52),
      inset 0 0 0 1px rgba(255, 231, 168, 0.14);
  }
  50% {
    box-shadow:
      0 16px 36px rgba(0, 0, 0, 0.56),
      inset 0 0 0 1px rgba(255, 231, 168, 0.2),
      0 0 18px rgba(0, 157, 255, 0.16);
  }
}

@keyframes duelSetupShimmer {
  from {
    background-position: 0% 0;
  }
  to {
    background-position: 200% 0;
  }
}

.vm-queue-shell {
  width: min(760px, calc(100% - 40px));
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
  padding: 18px;
  position: relative;
  z-index: 1;
  text-align: center;
  justify-items: center;
  overflow: hidden;
  border: 2px solid rgba(0, 157, 255, 0.46);
  background:
    linear-gradient(180deg, rgba(11, 16, 26, 0.97), rgba(9, 13, 22, 0.96)),
    linear-gradient(125deg, rgba(0, 157, 255, 0.1), rgba(255, 95, 85, 0.12));
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 231, 168, 0.14);
}

.vm-queue-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(130deg, rgba(0, 157, 255, 0.14), rgba(255, 95, 85, 0.14), rgba(0, 157, 255, 0.1));
  opacity: 0.45;
}

.vm-queue-loader {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.vm-queue-spinner {
  width: 38px;
  height: 38px;
}

.vm-queue-progress {
  width: min(360px, 100%);
}

.vm-queue-progress-bar {
  width: 22%;
}

.vm-queue-title,
.vm-queue-status,
.vm-queue-elapsed,
.vm-queue-code-label,
.vm-queue-code {
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
}

.vm-queue-title {
  color: #ffe2b7;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 14px;
}

.vm-queue-status {
  border: 1px solid rgba(255, 95, 85, 0.32);
  background: rgba(10, 16, 25, 0.68);
  color: #d8edff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px;
  line-height: 1.45;
  min-height: 54px;
  width: min(520px, 100%);
}

.vm-queue-elapsed {
  color: #ffd58f;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 12px;
  width: min(520px, 100%);
}

.vm-queue-code-wrap {
  border: 1px solid rgba(0, 157, 255, 0.4);
  background: rgba(9, 14, 23, 0.74);
  padding: 10px;
  display: grid;
  gap: 8px;
  width: min(520px, 100%);
}

.vm-queue-code-label {
  color: #9bcfff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
}

.vm-queue-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.vm-queue-code {
  border: 2px solid rgba(255, 95, 85, 0.5);
  background: rgba(7, 11, 18, 0.9);
  min-height: 38px;
  display: grid;
  align-items: center;
  padding: 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #f6efe2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vm-queue-shell .session-actions {
  width: min(520px, 100%);
  justify-content: center;
}

#vm-queue-cancel-btn,
#vm-queue-copy-btn {
  min-height: 40px;
  min-width: 126px;
}

@media (max-width: 700px) {
  .vm-queue-shell {
    width: calc(100% - 10px);
    max-width: none;
    padding: 12px;
    gap: 10px;
  }

  .vm-queue-progress,
  .vm-queue-status,
  .vm-queue-elapsed,
  .vm-queue-code-wrap,
  .vm-queue-shell .session-actions {
    width: 100%;
  }

  .vm-duel-card {
    width: calc(100% - 10px);
    padding: 12px;
    gap: 10px;
  }

  .vm-duel-title {
    font-size: 16px;
  }

  .vm-duel-subtitle {
    font-size: 11px;
  }

  .vm-duel-vs {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .vm-duel-versus {
    order: 2;
    font-size: 20px;
  }

  #vm-duel-self {
    order: 1;
  }

  #vm-duel-opp {
    order: 3;
  }

  .vm-duel-avatar-wrap {
    width: 72px;
    height: 72px;
  }

  .vm-duel-deck-picks {
    grid-template-columns: 1fr;
  }

  .vm-duel-deck-roll-item {
    flex-basis: 128px;
  }
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 0;
  border: 4px solid rgba(0, 157, 255, 0.28);
  border-top-color: #ff5f55;
  border-right-color: #009dff;
  animation: spin 0.9s steps(8, end) infinite;
  box-shadow: 0 0 0 2px rgba(9, 11, 18, 0.7) inset;
}

.progress {
  width: min(380px, 100%);
  height: 14px;
  border-radius: 0;
  background: rgba(11, 15, 24, 0.9);
  border: 2px solid rgba(0, 157, 255, 0.45);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 95, 85, 0.16);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(0, 157, 255, 1) 0 10px,
      rgba(255, 95, 85, 1) 10px 20px,
      rgba(0, 157, 255, 1) 20px 30px
    );
  transition: width 0.2s ease;
}

.progress-label {
  color: #f4d9a1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 13px;
  text-align: center;
  max-width: 100%;
  text-shadow: 0 0 10px rgba(255, 95, 85, 0.35);
}

.progress-meta {
  color: rgba(233, 220, 188, 0.92);
  letter-spacing: 0.03em;
  text-transform: none;
  font-size: 11px;
  text-align: center;
  max-width: 420px;
  line-height: 1.45;
  text-shadow: 0 0 10px rgba(9, 13, 20, 0.45);
}

.vm-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#audio-device-select {
  min-width: 180px;
}

.stream-tip {
  font-size: 12px;
  color: #9fd9ee;
  background: rgba(96, 212, 247, 0.08);
  border: 1px solid rgba(96, 212, 247, 0.22);
  border-radius: 10px;
  padding: 8px 10px;
}

.corner-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  gap: 8px;
  z-index: 3;
  width: auto;
  pointer-events: auto;
}

.fs-duel-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: min(220px, 46vw);
  border: 1px solid rgba(0, 157, 255, 0.48);
  background: rgba(8, 12, 20, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 228, 162, 0.16);
  padding: 8px;
  display: grid;
  gap: 6px;
}

.fs-duel-copy {
  color: #9fd9ee;
  font-size: 11px;
  line-height: 1.4;
  background: rgba(10, 18, 30, 0.76);
  border: 1px solid rgba(0, 157, 255, 0.18);
  padding: 8px;
}

.fs-duel-head {
  color: #ffe0b1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.fs-duel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: #dcecff;
  font-size: 11px;
}

.fs-duel-actions {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.fs-duel-chat {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.fs-duel-chat-head {
  color: #ffe0b1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}

.fs-duel-chat-list {
  min-height: 72px;
  max-height: 132px;
  overflow-y: auto;
  display: grid;
  gap: 6px;
  padding-right: 4px;
}

.fs-duel-chat-empty,
.fs-duel-chat-item {
  background: rgba(10, 18, 30, 0.72);
  border: 1px solid rgba(0, 157, 255, 0.16);
  padding: 7px 8px;
  color: #dcecff;
  font-size: 11px;
  line-height: 1.35;
}

.fs-duel-chat-item.self {
  border-color: rgba(255, 95, 85, 0.28);
}

.fs-duel-chat-author {
  color: #ffe0b1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 9px;
  margin-bottom: 3px;
}

.fs-duel-chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.fs-duel-chat-compose input {
  min-width: 0;
  min-height: 36px;
  font-size: 11px;
}

.corner-btn {
  border: 1px solid rgba(255, 95, 85, 0.45);
  background: rgba(9, 12, 18, 0.85);
  color: var(--gold);
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s ease, background 0.15s ease;
  width: auto;
  text-align: center;
}

.corner-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 95, 85, 0.12);
}

select.corner-btn {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  padding: 7px 10px;
}

.hud-toggle-btn {
  min-width: 36px;
  padding-inline: 0;
  font-size: 16px;
  line-height: 1;
}

.corner-overlay.is-collapsed > :not(#fs-ui-toggle-btn) {
  display: none !important;
}

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

/* 8-bit UI pass: square corners and stronger pixel-like borders */
.panel,
.card,
.auth-hero,
.auth-deck,
.vm-screen,
.brand-mark,
.badge,
.status-pill,
.tab,
.primary,
.ghost,
.corner-btn,
.mobile-trackpad,
.toast,
.tutorial-card,
.overlay-card,
.outer-desc,
.inner-desc,
.progress,
input[type="text"],
input[type="password"],
textarea,
select,
button {
  border-radius: 0 !important;
}

input[type="text"],
input[type="password"],
textarea,
select,
button {
  border-width: 2px !important;
  text-transform: none;
}

/* Global themed dropdowns: prevent browser-default selects from leaking through. */
select:not(.corner-btn) {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif !important;
  font-size: 14px;
  letter-spacing: 0.02em;
  min-height: 42px;
  padding: 10px 34px 10px 12px !important;
  color: #f2ebde !important;
  border: 2px solid rgba(255, 95, 85, 0.75) !important;
  background:
    linear-gradient(180deg, rgba(14, 19, 30, 0.96), rgba(9, 13, 22, 0.92)),
    linear-gradient(45deg, transparent 50%, #9bcfff 50%),
    linear-gradient(135deg, #9bcfff 50%, transparent 50%) !important;
  background-repeat: no-repeat, no-repeat, no-repeat !important;
  background-size: auto, 7px 7px, 7px 7px !important;
  background-position: 0 0, calc(100% - 18px) 18px, calc(100% - 12px) 18px !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(150, 200, 255, 0.08) !important;
}

select:not(.corner-btn):focus {
  outline: 2px solid var(--accent-tab);
  outline-offset: 1px;
  border-color: var(--accent-tab) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 0 1px rgba(31, 216, 200, 0.18),
    0 0 0 2px rgba(31, 216, 200, 0.14) !important;
}

select:not(.corner-btn) option {
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
  background: #0b111c;
  color: #e8dcc7;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
textarea::placeholder {
  color: #d6ccb5;
  opacity: 1;
}

textarea {
  resize: vertical;
  min-height: 124px;
}

/* Keep fullscreen session controls above the stream/iframe at all times. */
body.vm-fullscreen-active .corner-overlay {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
}

body.vm-fullscreen-active .fs-duel-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10000;
}

.fs-duel-actions .corner-btn {
  width: 100%;
}

.vm-loader.queue-mode .progress {
  border-color: rgba(0, 157, 255, 0.55);
}

.vm-loader.queue-mode .progress-bar {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(0, 157, 255, 1) 0 10px,
      rgba(255, 95, 85, 1) 10px 20px
    );
}

.vm-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  border-top: 1px dashed rgba(255, 95, 85, 0.25);
  padding-top: 10px;
}

.mobile-mouse {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 95, 85, 0.2);
  background: rgba(9, 13, 20, 0.72);
  display: grid;
  gap: 8px;
}

.mobile-mouse-head {
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-trackpad {
  min-height: 80px;
  border-radius: 10px;
  border: 1px solid rgba(255, 95, 85, 0.3);
  background: radial-gradient(circle at 30% 30%, rgba(255, 95, 85, 0.12), rgba(12, 16, 24, 0.9));
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  user-select: none;
  touch-action: none;
}

.mobile-mouse-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, 0.82);
  display: grid;
  place-items: center;
  z-index: 10;
}

.overlay.hidden {
  display: none;
}

.overlay-card {
  width: min(620px, 90vw);
  background: rgba(9, 12, 18, 0.95);
  border-radius: 24px;
  border: 1px solid rgba(255, 95, 85, 0.2);
  padding: 24px;
  display: grid;
  gap: 18px;
}


.session-reward-card {
  width: min(560px, calc(100vw - 28px));
  text-align: center;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(15, 20, 31, 0.98), rgba(9, 13, 21, 0.98)),
    linear-gradient(135deg, rgba(0, 157, 255, 0.1), rgba(255, 95, 85, 0.12));
  border: 2px solid rgba(255, 95, 85, 0.28);
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 226, 160, 0.12) inset;
}

.duel-result-card {
  width: min(560px, calc(100vw - 24px));
  border: 2px solid rgba(0, 157, 255, 0.5);
  background:
    linear-gradient(180deg, rgba(8, 12, 20, 0.96), rgba(10, 14, 23, 0.96)),
    linear-gradient(125deg, rgba(0, 157, 255, 0.1), rgba(255, 95, 85, 0.12));
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 228, 162, 0.15);
  display: grid;
  gap: 12px;
}

.duel-result-badge {
  justify-self: center;
  min-width: 132px;
  text-align: center;
  border: 2px solid rgba(255, 95, 85, 0.55);
  background: rgba(7, 11, 18, 0.92);
  color: #ffe2b7;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
  padding: 6px 12px;
}

.duel-result-card.is-win .duel-result-badge {
  border-color: rgba(0, 205, 142, 0.7);
  color: #9df4d2;
}

.duel-result-card.is-loss .duel-result-badge {
  border-color: rgba(255, 106, 106, 0.7);
  color: #ffc4c4;
}

.duel-result-card.is-draw .duel-result-badge {
  border-color: rgba(255, 211, 120, 0.7);
  color: #ffe7b3;
}

.duel-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.duel-result-stat {
  border: 1px solid rgba(0, 157, 255, 0.35);
  background: rgba(8, 12, 19, 0.78);
  padding: 10px;
  display: grid;
  gap: 4px;
}

.duel-result-stat span {
  font-size: 11px;
  color: #9bcfff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.duel-result-stat strong {
  color: #f6e8cd;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.session-reward-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(130deg, rgba(0, 157, 255, 0.35), rgba(255, 95, 85, 0.32), rgba(0, 157, 255, 0.28));
  opacity: 0.34;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  padding: 1px;
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.session-reward-card h3 {
  margin: 6px 0 0;
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 30px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.session-reward-burst {
  position: relative;
  height: 28px;
  margin: -8px 0 2px;
}

.session-reward-chip {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(20, 16, 10, 0.6);
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 246, 210, 0.95), rgba(255, 214, 93, 0.82) 35%, rgba(181, 112, 27, 0.96) 100%);
  box-shadow: 0 0 0 1px rgba(255, 233, 167, 0.25), 0 8px 22px rgba(255, 176, 48, 0.16);
  animation: rewardChipBurst 1.15s ease-out infinite;
}

.session-reward-chip.chip-a { transform: translate(-84px, -8px) scale(0.9); animation-delay: 0s; }
.session-reward-chip.chip-b { transform: translate(-28px, 10px) scale(1.05); animation-delay: 0.14s; }
.session-reward-chip.chip-c { transform: translate(34px, 6px) scale(0.95); animation-delay: 0.26s; }
.session-reward-chip.chip-d { transform: translate(92px, -10px) scale(1.08); animation-delay: 0.4s; }

.session-reward-total {
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: clamp(28px, 7vw, 42px);
  line-height: 1;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #ffe39c;
  text-shadow:
    0 0 16px rgba(255, 204, 93, 0.22),
    0 1px 0 rgba(20, 12, 6, 0.9);
  animation: rewardCountPulse 780ms ease-out both;
}

.session-reward-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
}

.session-reward-lines {
  display: grid;
  gap: 8px;
}

.session-reward-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 95, 85, 0.2);
  background:
    linear-gradient(180deg, rgba(15, 21, 32, 0.95), rgba(9, 13, 21, 0.98)),
    linear-gradient(90deg, rgba(0, 157, 255, 0.06), rgba(255, 95, 85, 0.05));
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(255, 231, 171, 0.04);
}

.session-reward-line-label {
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.session-reward-line-value {
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
  color: #ffd66e;
  font-size: 14px;
  white-space: nowrap;
}

.session-reward-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.session-reward-stat-chip {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid rgba(123, 187, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(14, 20, 31, 0.95), rgba(8, 11, 18, 0.98)),
    linear-gradient(90deg, rgba(0, 157, 255, 0.05), rgba(255, 95, 85, 0.04));
  box-shadow:
    inset 0 0 0 1px rgba(255, 231, 171, 0.04),
    0 10px 22px rgba(0, 0, 0, 0.18);
  min-width: 0;
}

.session-reward-stat-chip-label {
  color: #9fb6d8;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.3;
}

.session-reward-stat-chip-value {
  color: #f7edd0;
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-reward-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.session-reward-stat {
  padding: 12px 14px;
  border: 1px solid rgba(123, 187, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(12, 18, 29, 0.92), rgba(8, 12, 19, 0.98)),
    linear-gradient(90deg, rgba(0, 157, 255, 0.05), rgba(255, 95, 85, 0.04));
  display: grid;
  gap: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 231, 171, 0.04);
}

.session-reward-label {
  color: #9fb6d8;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.session-reward-stat strong {
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 18px;
  color: #f7edd0;
}

@keyframes rewardChipBurst {
  0%,
  100% {
    opacity: 0.58;
    filter: brightness(0.95);
  }
  50% {
    opacity: 1;
    filter: brightness(1.18);
  }
}

@keyframes rewardCountPulse {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.94);
  }
  70% {
    opacity: 1;
    transform: translateY(0) scale(1.04);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes crateIntroPulse {
  0% {
    transform: scale(0.986);
    filter: brightness(0.94);
  }
  55% {
    transform: scale(1.008);
    filter: brightness(1.08);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes crateIntroSweep {
  0% {
    transform: translateX(-105%);
    opacity: 0.2;
  }
  45% {
    opacity: 0.78;
  }
  100% {
    transform: translateX(105%);
    opacity: 0;
  }
}

@keyframes packLift {
  0% { transform: translateY(8px) scale(0.96); }
  60% { transform: translateY(-2px) scale(1.01); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes packFlapOpen {
  0% { transform: rotateX(0deg); }
  100% { transform: rotateX(-112deg); }
}

@keyframes packCardsFan {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.9);
  }
  100% {
    opacity: 1;
  }
}

@keyframes packCoreFlash {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  45% {
    opacity: 1;
    transform: scale(1.02);
  }
  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

.tutorial {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(4, 6, 10, 0.72);
  z-index: 22000;
}

.tutorial.hidden {
  display: none;
}

.tutorial-card {
  width: min(780px, calc(100vw - 28px));
  max-height: min(86vh, 620px);
  overflow: auto;
  background: rgba(11, 16, 25, 0.98);
  border-radius: 20px;
  border: 1px solid rgba(255, 95, 85, 0.22);
  box-shadow: var(--shadow);
  padding: 20px;
}

.tutorial-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.tutorial-card h3 {
  margin: 10px 0 8px;
  font-family: "Cinzel", "Times New Roman", serif;
  font-size: 24px;
}

.tutorial-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  min-height: 56px;
}

.tutorial-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

.overlay-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.overlay-actions {
  display: flex;
  justify-content: flex-end;
}

#prelaunch-permission h3 {
  margin: 6px 0 0;
  font-size: 22px;
}

.toast-host {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: auto;
  max-width: calc(100vw - 24px);
  z-index: 26000;
  pointer-events: none;
  display: grid;
  place-items: center;
}

@keyframes toastPopIn {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.86);
    filter: saturate(0.88);
  }
  52% {
    opacity: 1;
    transform: translateY(-2px) scale(var(--toast-pop-scale, 1.05));
    filter: saturate(1.08);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: saturate(1);
  }
}

@keyframes toastFadeOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(10px) scale(0.94);
  }
}

@keyframes toastShake {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  18% {
    transform: translateX(calc(var(--toast-shake, 8px) * -0.8)) rotate(calc(var(--toast-tilt, 4deg) * -0.45));
  }
  40% {
    transform: translateX(var(--toast-shake, 8px)) rotate(calc(var(--toast-tilt, 4deg) * 0.72));
  }
  62% {
    transform: translateX(calc(var(--toast-shake, 8px) * -0.58)) rotate(calc(var(--toast-tilt, 4deg) * -0.28));
  }
  82% {
    transform: translateX(calc(var(--toast-shake, 8px) * 0.34)) rotate(calc(var(--toast-tilt, 4deg) * 0.12));
  }
}

.toast-item {
  display: inline-flex;
  align-items: center;
  max-width: min(560px, calc(100vw - 24px));
  width: fit-content;
  min-height: 44px;
  padding: 11px 16px;
  background:
    linear-gradient(180deg, rgba(31, 39, 58, 0.96), rgba(9, 12, 18, 0.98)),
    rgba(9, 12, 18, 0.96);
  border: 1px solid rgba(255, 178, 79, 0.34);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 219, 128, 0.08) inset,
    0 1px 0 rgba(255, 255, 255, 0.06) inset;
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  letter-spacing: 0.04em;
  transform-origin: center bottom;
  opacity: 0;
  will-change: transform, opacity, filter, box-shadow, border-color, background;
}

.toast-item.toast-visible,
.toast-item.toast-retrigger {
  animation: toastPopIn 220ms cubic-bezier(0.22, 1, 0.36, 1);
  opacity: 1;
}

.toast-item.toast-shake-1,
.toast-item.toast-shake-2,
.toast-item.toast-shake-3,
.toast-item.toast-shake-4 {
  animation:
    toastPopIn 220ms cubic-bezier(0.22, 1, 0.36, 1),
    toastShake 250ms cubic-bezier(0.2, 0.78, 0.25, 1);
}

.toast-item.toast-alert-1 {
  border-color: rgba(255, 121, 104, 0.52);
  background:
    linear-gradient(180deg, rgba(61, 32, 38, 0.96), rgba(19, 10, 14, 0.98)),
    rgba(19, 10, 14, 0.98);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 146, 126, 0.12) inset,
    0 0 18px rgba(220, 86, 62, 0.18);
}

.toast-item.toast-alert-2 {
  border-color: rgba(255, 108, 92, 0.72);
  background:
    linear-gradient(180deg, rgba(88, 26, 32, 0.98), rgba(26, 8, 12, 0.99)),
    rgba(26, 8, 12, 0.99);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.36),
    0 0 0 1px rgba(255, 149, 132, 0.16) inset,
    0 0 24px rgba(255, 88, 68, 0.28);
}

.toast-item.toast-exit {
  animation: toastFadeOut 190ms ease forwards;
}

@media (max-width: 640px) {
  .duel-queue-card {
    width: calc(100vw - 18px);
    padding: 16px;
    gap: 10px;
  }

  .duel-queue-code-row {
    grid-template-columns: 1fr;
  }

  .duel-queue-code-row .ghost {
    width: 100%;
  }

  .session-reward-meta {
    grid-template-columns: 1fr;
  }

  .toast-host {
    left: 12px;
    right: 12px;
    transform: none;
    place-items: stretch;
  }

  .toast-item {
    max-width: none;
    width: 100%;
    padding: 10px 12px;
  }
}

#top-signout-btn {
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif !important;
}

.empty-note {
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed rgba(255, 95, 85, 0.28);
  border-radius: 12px;
  padding: 10px 12px;
}

.footer {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  color: var(--muted);
  padding: 16px 32px 40px;
  font-size: 13px;
}

.hidden {
  display: none !important;
}

body.mobile-client .panel {
  padding: 18px;
}

body.mobile-client .vm-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body.mobile-client .ghost[data-tip]:hover::after,
body.mobile-client .primary[data-tip]:hover::after {
  display: none;
}

body.mobile-client .session-actions {
  flex-direction: column;
  align-items: stretch;
}

body.mobile-client.mobile-stream-active .topbar,
body.mobile-client.mobile-stream-active .footer,
body.mobile-client.mobile-stream-active .card.status {
  display: none;
}

body.mobile-client.mobile-stream-active .stage {
  padding: 0;
}

body.mobile-client.mobile-stream-active .panel.dashboard {
  border-radius: 0;
  border: none;
  padding: 0;
}

body.mobile-client.mobile-stream-active .dashboard-grid {
  display: block;
}

body.mobile-client.mobile-stream-active .card.vm {
  position: fixed;
  inset: 0;
  z-index: 1200;
  border-radius: 0;
  border: none;
  margin: 0;
  padding: 0;
  min-height: var(--mobile-fit-height, 100dvh);
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #050608;
}

body.mobile-client.mobile-stream-active .vm-screen {
  flex: 1 1 auto;
  min-height: var(--mobile-fit-height, 100dvh);
  height: var(--mobile-fit-height, 100dvh);
  max-height: none;
  border: none;
}

body.mobile-client .mobile-mouse.hidden {
  display: none;
}

body.mobile-client .mobile-mouse {
  display: none !important;
}

body.mobile-client.mobile-stream-active .vm-note {
  display: none;
}

body.mobile-client.mobile-stream-active .card.vm > .card-title {
  display: none;
}

body.mobile-client.mobile-stream-active .vm-actions {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: max(8px, env(safe-area-inset-left));
  right: max(8px, env(safe-area-inset-right));
  z-index: 1205;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

body.mobile-client.mobile-stream-active #fullscreen-btn {
  min-width: 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px !important;
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.mobile-client.mobile-stream-active #rejoin-queue-btn {
  display: none !important;
}

.balatro-cursor,
.balatro-cursor-core {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transform: translate3d(var(--cx, -100px), var(--cy, -100px), 0) scale(1);
  transition: opacity 0.16s ease, transform 0.16s ease, background-color 0.16s ease,
    border-color 0.16s ease, box-shadow 0.16s ease;
}

.balatro-cursor {
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top: -14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 95, 85, 0.75);
  background: radial-gradient(circle at 35% 35%, rgba(232, 111, 138, 0.34), rgba(96, 212, 247, 0.1));
  box-shadow: 0 0 0 1px rgba(255, 95, 85, 0.14), 0 0 26px rgba(232, 111, 138, 0.22);
}

.balatro-cursor-core {
  width: 18px;
  height: 10px;
  margin-left: -9px;
  margin-top: -5px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 95, 85, 0.85), rgba(232, 111, 138, 0.35));
  filter: blur(1.3px);
  opacity: 0.68;
  box-shadow: 0 0 18px rgba(255, 95, 85, 0.44);
}

.balatro-cursor.visible,
.balatro-cursor-core.visible {
  opacity: 1;
}

.balatro-cursor.hover {
  transform: translate3d(var(--cx, -100px), var(--cy, -100px), 0) scale(1.4);
  border-color: rgba(96, 212, 247, 0.85);
  box-shadow: 0 0 0 1px rgba(96, 212, 247, 0.24), 0 0 32px rgba(96, 212, 247, 0.32);
}

.balatro-cursor-core.hover {
  transform: translate3d(var(--cx, -100px), var(--cy, -100px), 0) scale(1.12);
  background: linear-gradient(90deg, rgba(96, 212, 247, 0.9), rgba(255, 95, 85, 0.42));
}

.balatro-cursor.click {
  transform: translate3d(var(--cx, -100px), var(--cy, -100px), 0) scale(0.84);
}

.balatro-cursor-core.click {
  transform: translate3d(var(--cx, -100px), var(--cy, -100px), 0) scale(0.72);
}

@keyframes floatIn {
  from {
    transform: translateY(14px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes loaderSweep {
  from {
    transform: translateX(-16px);
  }
  to {
    transform: translateX(16px);
  }
}

@keyframes ambientShift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.72;
  }
  to {
    transform: translate3d(0, -1.2%, 0) scale(1.04);
    opacity: 0.92;
  }
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .public-section-grid,
  .public-feature-grid,
  .public-faq-grid,
  .docs-grid.two-up,
  .public-guide-strip {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .panel-header {
    flex-direction: column;
  }

  .panel-header h1 {
    font-size: 28px;
  }

  .stage {
    padding: 16px 18px 60px;
  }

  .leaderboard-podium {
    grid-template-columns: 1fr;
    grid-template-areas:
      "first"
      "second"
      "third";
  }

  .podium-node {
    min-height: 100px;
    width: 100%;
  }

  .podium-first {
    justify-self: stretch;
    margin-right: 0;
  }

  .podium-second {
    justify-self: stretch;
    margin-left: 0;
  }

  .podium-third {
    justify-self: stretch;
    margin-right: 0;
  }

  .public-profile-top {
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  .brand-title {
    font-size: 18px;
  }

  .docs-nav,
  .footer-links,
  .public-link-row {
    width: 100%;
  }

  .auth-tabs {
    flex-direction: column;
  }

  .session-actions,
  .vm-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .ghost[data-tip]:hover::after,
  .primary[data-tip]:hover::after {
    left: 0;
    transform: none;
    max-width: 80vw;
  }
}

@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  body.custom-cursor-enabled,
  body.custom-cursor-enabled * {
    cursor: auto !important;
  }

  .balatro-cursor,
  .balatro-cursor-core {
    display: none !important;
  }

  .card-title[data-help]::after,
  .card-title[data-help]:hover::after {
    display: none !important;
  }
}

/* Shader-wide theme harmonization (matches shader colours) */
:root {
  --bg-0: #11161a;
  --bg-1: #151c22;
  --bg-2: #1f282c;
  --gold: #ff5f55;
  --rose: #ff5f55;
  --cyan: #009dff;
  --ink: #f5efe4;
  --muted: #d0c6b6;
}

.topbar,
.footer,
.panel,
.card,
.auth-hero,
.auth-deck,
.vm-screen,
.vm-loader,
.vm-overlay,
.next-action,
.vm-note,
.badge,
.toast,
.tutorial-card {
  background-color: rgba(22, 27, 31, 0.86);
  border-color: rgba(255, 95, 85, 0.45);
}

.panel::before {
  background: linear-gradient(
    135deg,
    rgba(255, 95, 85, 0.48),
    rgba(255, 95, 85, 0.58),
    rgba(0, 157, 255, 0.5)
  );
}

.status-pill,
.badge,
.next-action,
.stream-tip {
  color: #d9ecff;
  border-color: rgba(0, 157, 255, 0.52);
  background: rgba(0, 157, 255, 0.16);
}

.primary {
  color: #1e1206;
  background: linear-gradient(135deg, rgba(255, 95, 85, 0.98), rgba(255, 95, 85, 0.94));
  border-color: rgba(255, 95, 85, 0.78);
}

.ghost,
.corner-btn {
  color: #ffd59a;
  border-color: rgba(255, 95, 85, 0.55);
  background: rgba(23, 27, 36, 0.9);
}

.vm-screen {
  background:
    radial-gradient(circle at top, rgba(0, 157, 255, 0.2), transparent 62%),
    linear-gradient(160deg, rgba(39, 30, 23, 0.95), rgba(19, 24, 33, 0.97));
}

.vm-overlay {
  color: #ffd8a8;
  background: linear-gradient(180deg, rgba(12, 14, 20, 0.86), rgba(12, 14, 20, 0.68));
}

.vm-loader {
  background:
    linear-gradient(180deg, rgba(11, 14, 20, 0.92), rgba(22, 16, 12, 0.92)),
    repeating-linear-gradient(
      0deg,
      rgba(255, 95, 85, 0.07) 0 3px,
      rgba(0, 157, 255, 0.07) 3px 6px
    );
  box-shadow: inset 0 0 0 2px rgba(0, 157, 255, 0.18);
}

.progress {
  border-color: rgba(255, 95, 85, 0.62);
  background: rgba(16, 20, 28, 0.95);
}

.progress-bar {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 95, 85, 1) 0 10px,
      rgba(255, 95, 85, 1) 10px 20px,
      rgba(0, 157, 255, 1) 20px 30px
    );
}

.progress-label,
.session-state,
.card-title,
.brand-title,
.eyebrow,
.login-title {
  color: #ffe0b1;
}

/* Final polish pass: single accent + Balatro premium trim */
:root {
  --accent: #009dff;
  --accent-tab: #1fd8c8;
}

/* 1) One accent for interaction */
a,
.status-pill,
.badge,
.stream-tip,
.next-action {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

a:hover,
.ghost:hover,
.corner-btn:hover {
  color: #d9ecff;
}

.status-pill,
.player-pill,
.docs-nav a,
.footer-links a,
.public-link-btn {
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    background-color 0.16s ease,
    color 0.16s ease;
}

.status-pill:hover,
.player-pill:hover,
.docs-nav a:hover,
.footer-links a:hover,
.public-link-btn:hover {
  transform: translateY(-1px);
}

input:focus,
input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus,
a:focus-visible,
.status-pill:focus-visible,
.player-pill:focus-visible,
.tab:focus-visible,
.primary:focus-visible,
.ghost:focus-visible,
.corner-btn:focus-visible {
  outline: 2px solid var(--accent-tab);
  outline-offset: 1px;
  border-color: var(--accent-tab) !important;
  box-shadow: 0 0 0 2px rgba(31, 216, 200, 0.24);
}

.checkbox input,
input[type="checkbox"] {
  accent-color: var(--accent);
}

/* 2) Balatro button warmth (less pink, more casino) + accent glow */
.primary {
  background: linear-gradient(135deg, #2f7cff 0%, #ff5f55 62%, #1f2f7a 100%) !important;
  border: 2px solid rgba(255, 95, 85, 0.55) !important;
  color: #1a1208 !important;
  text-shadow: none !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 238, 204, 0.28),
    inset 0 -1px 0 rgba(70, 28, 14, 0.55);
}

.primary:hover {
  box-shadow:
    0 0 0 1px rgba(0, 157, 255, 0.35) inset,
    0 0 12px rgba(0, 157, 255, 0.22),
    0 8px 20px rgba(0, 0, 0, 0.38) !important;
}

.primary:active,
.ghost:active,
.tab:active,
.corner-btn:active {
  transform: translateY(1px) scale(0.99);
  filter: brightness(0.96);
}

/* 3) Active tab clarity */
.auth-tabs {
  border-bottom: 1px solid rgba(0, 157, 255, 0.22);
  padding-bottom: 4px;
}

.tab {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
}

.tab.tab-disabled-feature {
  opacity: 0.5;
  filter: saturate(0.45);
  cursor: pointer;
}

.tab.tab-disabled-feature:not(.active):hover,
.tab.tab-disabled-feature:not(.active):focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: #e9edf6;
}

.tab.active {
  background: rgba(0, 157, 255, 0.18) !important;
  color: #ffe8bf !important;
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -6px;
  height: 2px;
  background: var(--accent-tab);
}

/* Force duel mode tab typography to Balatro pixel font across all states. */
#duel-mode-random-btn,
#duel-mode-private-btn,
#duel-mode-random-btn:hover,
#duel-mode-private-btn:hover,
#duel-mode-random-btn:focus-visible,
#duel-mode-private-btn:focus-visible,
#duel-mode-random-btn.active,
#duel-mode-private-btn.active {
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif !important;
  font-size: 16px !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
}

/* Force deck selector controls to Balatro font/theme regardless of generic button/tab rules. */
#dashboard-duels-view .duel-selector-title,
#dashboard-duels-view #duel-deck-mode-group .duel-pill,
#dashboard-duels-view #duel-deck-choice-group .duel-choice-btn {
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif !important;
}

#dashboard-duels-view #duel-deck-mode-group .duel-pill,
#dashboard-duels-view #duel-deck-choice-group .duel-choice-btn {
  font-size: 14px !important;
  letter-spacing: 0.03em !important;
  text-transform: uppercase !important;
}

.balatro-font-force,
#dashboard-duels-view .balatro-font-force,
#dashboard-duels-view .balatro-font-force:hover,
#dashboard-duels-view .balatro-font-force:focus-visible,
#dashboard-duels-view .balatro-font-force.active {
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  font-style: normal !important;
  letter-spacing: 0.03em !important;
  text-transform: uppercase !important;
}

/* 4) Label readability */
label {
  color: #f7efdd !important;
}

input[type="text"],
input[type="password"] {
  background: linear-gradient(180deg, rgba(12, 15, 22, 0.94), rgba(9, 12, 18, 0.9)) !important;
  border-color: rgba(255, 95, 85, 0.75) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(150, 200, 255, 0.08);
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--accent-tab) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 0 1px rgba(31, 216, 200, 0.18),
    inset 0 1px 0 0 rgba(31, 216, 200, 0.45),
    0 0 0 2px rgba(31, 216, 200, 0.14);
}

/* Profile bio + feedback type controls: force full Balatro theme styling */
#bio-input,
#feedback-category-input {
  font-family: "BalatroPixel", "Trebuchet MS", sans-serif !important;
  color: #f2ebde !important;
  border: 2px solid rgba(255, 95, 85, 0.78) !important;
  background:
    linear-gradient(180deg, rgba(14, 19, 30, 0.96), rgba(9, 13, 22, 0.92)),
    rgba(9, 13, 22, 0.92) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(150, 200, 255, 0.08) !important;
}

#bio-input::placeholder {
  color: #d6ccb5 !important;
  opacity: 1;
}

#bio-input {
  min-height: 116px;
  line-height: 1.35;
}

#feedback-category-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 34px !important;
  background-image:
    linear-gradient(180deg, rgba(14, 19, 30, 0.96), rgba(9, 13, 22, 0.92)),
    linear-gradient(45deg, transparent 50%, #9bcfff 50%),
    linear-gradient(135deg, #9bcfff 50%, transparent 50%) !important;
  background-repeat: no-repeat, no-repeat, no-repeat !important;
  background-size: auto, 7px 7px, 7px 7px !important;
  background-position: 0 0, calc(100% - 18px) 18px, calc(100% - 12px) 18px !important;
}

#bio-input:focus,
#feedback-category-input:focus {
  border-color: var(--accent-tab) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 0 1px rgba(31, 216, 200, 0.18),
    inset 0 1px 0 0 rgba(31, 216, 200, 0.45),
    0 0 0 2px rgba(31, 216, 200, 0.14) !important;
}

.helper,
.brand-subtitle,
.footer {
  color: #e4d8c1 !important;
}

/* Themed checkbox */
input[type="checkbox"],
.checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 95, 85, 0.95) !important;
  background: rgba(11, 14, 22, 0.9);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
}

input[type="checkbox"]::before,
.checkbox input[type="checkbox"]::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  transition: transform 0.1s ease-in-out;
  background: linear-gradient(135deg, #17bcb0, #42d9cd);
}

input[type="checkbox"]:checked::before,
.checkbox input[type="checkbox"]:checked::before {
  transform: scale(1);
}

input[type="checkbox"]:checked,
.checkbox input[type="checkbox"]:checked {
  border-color: var(--accent-tab) !important;
  background: rgba(15, 33, 35, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(31, 216, 200, 0.22),
    0 0 0 1px rgba(31, 216, 200, 0.1);
}

/* 5) Brass double trim */
.panel,
.card,
.auth-hero,
.auth-deck,
.vm-screen,
.tutorial-card,
.overlay-card {
  border: 1px solid rgba(142, 96, 34, 0.88) !important; /* darker brass outer */
  box-shadow:
    0 0 0 1px rgba(248, 195, 108, 0.18) inset,
    0 0 0 2px rgba(255, 223, 154, 0.05) inset,
    var(--shadow) !important;
}

/* 6) Footer contrast */
.footer {
  position: relative;
  padding: 10px 14px 12px;
  max-width: 1200px;
  margin: 10px auto 0;
  background: rgba(8, 10, 16, 0.38);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 95, 85, 0.22);
  color: #efe4cf !important;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

/* Fullscreen overlay lock: keep controls compact top-right, duel HUD bottom-right. */
body.vm-fullscreen-active #fullscreen-overlay {
  position: fixed !important;
  top: 16px !important;
  right: 16px !important;
  left: auto !important;
  bottom: auto !important;
  display: grid !important;
  gap: 8px !important;
  justify-items: end !important;
  width: auto !important;
  z-index: 2147482000 !important;
}

body.vm-fullscreen-active #fullscreen-overlay .corner-btn {
  width: auto !important;
  min-width: 0 !important;
  max-width: max-content !important;
  padding: 6px 10px !important;
  font-size: 11px !important;
  line-height: 1.15 !important;
}

body.vm-fullscreen-active #fullscreen-overlay #fs-duel-panel {
  position: fixed !important;
  right: 16px !important;
  bottom: 16px !important;
  left: auto !important;
  top: auto !important;
  width: min(260px, 46vw) !important;
  z-index: 2147482000 !important;
}

body.vm-fullscreen-active #fullscreen-overlay #fs-duel-panel .corner-btn {
  width: 100% !important;
  max-width: none !important;
}

.economy-toolbar {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.economy-filter-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.economy-filter {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.economy-filter span {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.economy-filter input,
.economy-filter select,
.economy-filter textarea {
  width: 100%;
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
}

.market-layout,
.trades-layout,
.economy-item-card,
.trade-card,
.market-hero-card,
.trade-composer-card,
.trade-composer-target,
.item-inspect-card,
.market-list-card,
.player-link-btn,
.trade-user-result {
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
}

.economy-summary-row,
.market-activity-grid,
.item-inspect-meta {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.economy-stat-chip {
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(0, 157, 255, 0.22);
  background: linear-gradient(180deg, rgba(17, 24, 37, 0.92), rgba(12, 18, 28, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 6px;
}

.economy-stat-chip span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.economy-stat-chip strong {
  font-size: 19px;
  color: var(--ink);
}

.inspect-stat-badge-wrap {
  display: flex;
  align-items: center;
}

.inspect-stat-badge {
  width: fit-content;
  font-size: 0.66rem;
  line-height: 1;
  padding: 3px 7px;
  letter-spacing: 0.05em;
}

.inspect-stat-badge.rarity-common {
  color: #d7dce9;
  border-color: rgba(215, 220, 233, 0.32);
}

.inspect-stat-badge.rarity-uncommon {
  color: #95e2d1;
  border-color: rgba(149, 226, 209, 0.52);
}

.inspect-stat-badge.rarity-rare {
  color: #8ec7ff;
  border-color: rgba(142, 199, 255, 0.42);
}

.inspect-stat-badge.rarity-epic {
  color: #d39cff;
  border-color: rgba(211, 156, 255, 0.45);
}

.inspect-stat-badge.rarity-legendary {
  color: #ffdc8d;
  border-color: rgba(255, 220, 141, 0.52);
}

.inspect-stat-badge.rarity-mythic {
  color: #ff9de5;
  border-color: rgba(255, 157, 229, 0.55);
}

.economy-grid {
  display: grid;
  gap: 18px;
}

.market-layout {
  grid-template-columns: minmax(0, 1.9fr) minmax(260px, 0.9fr);
  align-items: start;
}

.trades-layout {
  grid-template-columns: minmax(0, 1fr);
}

.economy-grid-main,
.economy-grid-side {
  display: grid;
  gap: 18px;
}

.economy-item-card,
.trade-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(0, 157, 255, 0.18);
  background:
    radial-gradient(circle at top right, rgba(0, 157, 255, 0.08), transparent 36%),
    linear-gradient(180deg, rgba(18, 25, 38, 0.96), rgba(10, 15, 24, 0.94));
  box-shadow: var(--shadow);
}

.economy-item-card::before,
.trade-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.04), transparent 40%);
  pointer-events: none;
}

.economy-item-head {
  display: grid;
  grid-template-columns: 144px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  align-items: start;
}

.economy-item-copy,
.trade-picker-copy,
.market-list-preview-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.economy-item-stage,
.market-list-stage,
.item-inspect-stage-asset {
  position: relative;
  min-height: 160px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.12), transparent 40%),
    linear-gradient(180deg, rgba(16, 24, 36, 0.98), rgba(8, 12, 20, 0.98));
  display: grid;
  place-items: center;
  overflow: hidden;
}

.economy-item-stage-glow,
.economy-item-stage-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.economy-item-stage-glow {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.16), transparent 52%),
    radial-gradient(circle at 50% 100%, rgba(0, 157, 255, 0.18), transparent 48%);
  filter: blur(10px);
}

.economy-item-stage-frame {
  inset: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.economy-item-art {
  width: 88px;
  height: 88px;
  display: inline-grid;
  place-items: center;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.48));
}

.economy-item-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.economy-item-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.economy-item-name-row h3,
.market-list-preview-name {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.03em;
}

.economy-inline-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 157, 255, 0.14);
  border: 1px solid rgba(0, 157, 255, 0.28);
  color: #bde8ff;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.economy-item-stats,
.trade-card-columns {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.economy-item-stats > div,
.trade-card-columns > div {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: grid;
  gap: 4px;
}

.economy-item-stats span,
.trade-card-head span,
.trade-card-note,
.economy-item-market-copy span,
.trade-side-title {
  color: var(--muted);
  font-size: 12px;
}

.economy-item-stats strong,
.trade-card-head strong {
  font-size: 18px;
}

.economy-item-footer,
.trade-card-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.economy-item-market-copy {
  display: grid;
  gap: 6px;
}

.economy-mini-graph,
.item-inspect-history {
  display: grid;
  gap: 10px;
}

.economy-graph-svg {
  width: 100%;
  height: 88px;
}

.economy-graph-empty {
  min-height: 88px;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  display: grid;
  place-items: center;
}

.economy-empty {
  padding: 22px;
  border-radius: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.economy-empty.compact {
  padding: 16px;
}

.market-hero-card,
.trade-composer-card {
  display: grid;
  gap: 18px;
}

.market-hero-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 1fr);
}

.market-hero-title {
  font-size: 26px;
  letter-spacing: 0.04em;
}

.market-side-block,
.trade-picker-column {
  display: grid;
  gap: 12px;
}

.market-side-head,
.trade-picker-head,
.item-inspect-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.market-my-listings,
.trade-live-list,
.trade-offers-list,
.trade-picker-list {
  display: grid;
  gap: 12px;
}

.market-side-row,
.trade-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.trade-picker-row.static {
  grid-template-columns: minmax(0, 1fr);
}

.trade-picker-stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.trade-picker-stepper span {
  min-width: 22px;
  text-align: center;
}

.trade-picker-row .trade-preview-tile {
  width: 100%;
}

.player-link-btn,
.trade-user-result {
  appearance: none;
  border: 1px solid rgba(0, 157, 255, 0.22);
  background: rgba(0, 157, 255, 0.08);
  color: #bde8ff;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.player-link-btn {
  display: inline-grid;
  gap: 3px;
  text-align: left;
  letter-spacing: 0.04em;
}

.player-link-btn.compact {
  padding: 8px 10px;
}

.player-link-primary {
  font-size: 12px;
  color: #eef6ff;
}

.player-link-secondary {
  font-size: 9px;
  color: #96b7cf;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-2px);
  transition: opacity 140ms ease, transform 140ms ease, max-height 140ms ease;
}

.player-link-btn:hover,
.trade-user-result:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 157, 255, 0.4);
  background: rgba(0, 157, 255, 0.14);
}

.player-link-btn:hover .player-link-secondary,
.player-link-btn:focus-visible .player-link-secondary {
  max-height: 18px;
  opacity: 1;
  transform: translateY(0);
}

.trade-search-shell,
.trade-composer-grid,
.trade-search-grid,
.market-list-body,
.market-list-preview,
.item-inspect-shell {
  display: grid;
  gap: 18px;
}

.trade-user-results {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.trade-user-result {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.trade-user-result img {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  object-fit: cover;
}

.trade-user-result span {
  display: grid;
  gap: 4px;
}

.trade-user-result em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.trade-composer-target {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.trade-target-copy {
  display: grid;
  gap: 6px;
}

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

.trade-compose-controls .trade-note-field {
  grid-column: 1 / -1;
}

.trade-card {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.trade-chip-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 6px;
}

.trade-preview-tile {
  --trade-preview-accent: rgba(170, 188, 214, 0.3);
  appearance: none;
  font-family: "BalatroPixel", "Trebuchet MS", "Segoe UI", sans-serif;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(0, 157, 255, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(20, 28, 40, 0.92), rgba(10, 15, 24, 0.94));
  color: var(--text);
  border-radius: 8px;
  padding: 7px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.trade-preview-tile.rarity-common {
  --trade-preview-accent: rgba(170, 188, 214, 0.32);
  border-color: rgba(170, 188, 214, 0.26);
}

.trade-preview-tile.rarity-uncommon {
  --trade-preview-accent: rgba(139, 238, 165, 0.36);
  border-color: rgba(139, 238, 165, 0.3);
  box-shadow: inset 0 0 0 1px rgba(139, 238, 165, 0.06);
}

.trade-preview-tile.rarity-rare {
  --trade-preview-accent: rgba(120, 184, 255, 0.4);
  border-color: rgba(120, 184, 255, 0.34);
  box-shadow: inset 0 0 0 1px rgba(120, 184, 255, 0.08);
}

.trade-preview-tile.rarity-epic {
  --trade-preview-accent: rgba(195, 153, 255, 0.42);
  border-color: rgba(195, 153, 255, 0.36);
  box-shadow: inset 0 0 0 1px rgba(195, 153, 255, 0.08);
}

.trade-preview-tile.rarity-legendary {
  --trade-preview-accent: rgba(255, 197, 111, 0.44);
  border-color: rgba(255, 197, 111, 0.4);
  box-shadow: inset 0 0 0 1px rgba(255, 197, 111, 0.1);
}

.trade-preview-tile.rarity-mythic {
  --trade-preview-accent: rgba(255, 156, 244, 0.46);
  border-color: rgba(255, 156, 244, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 156, 244, 0.1);
}

.trade-preview-tile:hover,
.trade-preview-tile:focus-visible {
  transform: translateY(-1px);
  border-color: var(--trade-preview-accent);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 10px 24px rgba(0, 0, 0, 0.24),
    0 0 0 1px color-mix(in srgb, var(--trade-preview-accent) 65%, transparent);
  outline: none;
}

.trade-preview-stage-wrap {
  position: relative;
}

.trade-preview-stage {
  position: relative;
  min-height: 44px;
  min-width: 44px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.12), transparent 40%),
    linear-gradient(180deg, rgba(16, 24, 36, 0.98), rgba(8, 12, 20, 0.98));
  display: grid;
  place-items: center;
  overflow: hidden;
}

.trade-preview-stage.rarity-uncommon {
  border-color: rgba(139, 238, 165, 0.24);
}

.trade-preview-stage.rarity-rare {
  border-color: rgba(120, 184, 255, 0.28);
}

.trade-preview-stage.rarity-epic {
  border-color: rgba(195, 153, 255, 0.3);
}

.trade-preview-stage.rarity-legendary {
  border-color: rgba(255, 197, 111, 0.34);
}

.trade-preview-stage.rarity-mythic {
  border-color: rgba(255, 156, 244, 0.36);
}

.trade-preview-stage .economy-item-stage-glow,
.trade-preview-stage .economy-item-stage-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.trade-preview-stage .economy-item-stage-glow {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.16), transparent 52%),
    radial-gradient(circle at 50% 100%, rgba(0, 157, 255, 0.18), transparent 48%);
  filter: blur(8px);
}

.trade-preview-stage.rarity-uncommon .economy-item-stage-glow {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.14), transparent 52%),
    radial-gradient(circle at 50% 100%, rgba(139, 238, 165, 0.18), transparent 48%);
}

.trade-preview-stage.rarity-rare .economy-item-stage-glow {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.14), transparent 52%),
    radial-gradient(circle at 50% 100%, rgba(120, 184, 255, 0.2), transparent 48%);
}

.trade-preview-stage.rarity-epic .economy-item-stage-glow {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.14), transparent 52%),
    radial-gradient(circle at 50% 100%, rgba(195, 153, 255, 0.2), transparent 48%);
}

.trade-preview-stage.rarity-legendary .economy-item-stage-glow {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.14), transparent 52%),
    radial-gradient(circle at 50% 100%, rgba(255, 197, 111, 0.22), transparent 48%);
}

.trade-preview-stage.rarity-mythic .economy-item-stage-glow {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.14), transparent 52%),
    radial-gradient(circle at 50% 100%, rgba(255, 156, 244, 0.24), transparent 48%);
}

.trade-preview-stage .economy-item-stage-frame {
  inset: 5px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.trade-preview-stage .economy-item-art {
  width: 24px;
  height: 24px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.42));
}

.trade-preview-tile.mod-foil .trade-preview-stage,
.trade-preview-tile.mod-special .trade-preview-stage {
  box-shadow:
    0 0 0 1px rgba(132, 206, 255, 0.46),
    0 0 16px rgba(75, 160, 255, 0.16) inset;
  background-image:
    linear-gradient(118deg, rgba(218, 240, 255, 0.12), rgba(102, 175, 255, 0.08), rgba(218, 240, 255, 0.12));
}

.trade-preview-tile.mod-holographic .trade-preview-stage,
.trade-preview-tile.mod-prismatic .trade-preview-stage {
  box-shadow:
    0 0 0 1px rgba(255, 150, 150, 0.42),
    0 0 16px rgba(255, 89, 89, 0.16) inset;
  background-image:
    linear-gradient(135deg, rgba(255, 220, 220, 0.08), rgba(255, 77, 77, 0.14), rgba(255, 224, 224, 0.08));
}

.trade-preview-tile.mod-polychrome .trade-preview-stage,
.trade-preview-tile.mod-voidtouched .trade-preview-stage {
  box-shadow:
    0 0 0 1px rgba(213, 142, 255, 0.5),
    0 0 18px rgba(176, 91, 255, 0.2) inset,
    0 0 14px rgba(89, 178, 255, 0.12);
  background-image:
    conic-gradient(
      from 0deg,
      rgba(255, 102, 196, 0.14),
      rgba(255, 189, 93, 0.14),
      rgba(112, 216, 255, 0.14),
      rgba(130, 255, 176, 0.14),
      rgba(212, 140, 255, 0.14),
      rgba(255, 102, 196, 0.14)
    );
}

.trade-preview-tile.mod-negative .trade-preview-stage {
  box-shadow:
    0 0 0 1px rgba(227, 232, 255, 0.46),
    0 0 18px rgba(111, 88, 255, 0.22) inset;
  background-image:
    radial-gradient(circle at center, rgba(12, 8, 32, 0.58), rgba(4, 3, 12, 0.84) 58%, rgba(2, 2, 6, 0.92) 100%);
}

.trade-preview-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.trade-preview-copy strong {
  font-size: 10px;
  line-height: 1.1;
}

.trade-preview-meta {
  gap: 4px;
  font-size: 9px;
}

.trade-preview-meta .rarity-tag,
.trade-preview-meta .shop-meta-tag {
  padding: 1px 4px;
  font-size: 0.54rem;
}

.trade-preview-qty {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  padding: 2px 5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 214, 102, 0.28);
  background: rgba(14, 19, 30, 0.96);
  color: #ffe39c;
  font-size: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28);
}

.trade-coin-chip {
  align-self: start;
  background: rgba(255, 214, 102, 0.12);
  border-color: rgba(255, 214, 102, 0.2);
  color: #ffe39c;
}

#item-inspect-overlay:not(.hidden) {
  animation: overlay-fade-in 180ms ease;
}

#item-inspect-overlay:not(.hidden) .item-inspect-card {
  animation: inspect-pop-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: center center;
}

@keyframes overlay-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes inspect-pop-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.item-inspect-card,
.market-list-card {
  width: min(920px, calc(100vw - 28px));
}

.item-inspect-shell {
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
}

.item-inspect-stage {
  display: grid;
  place-items: center;
  min-height: 320px;
}

.item-inspect-stage-art {
  width: min(100%, 340px);
  margin: 0 auto;
  display: grid;
  place-items: center;
  min-height: 320px;
}

.item-inspect-content {
  display: grid;
  gap: 16px;
}

.item-inspect-subhead {
  display: grid;
  gap: 10px;
}

.item-inspect-badges {
  font-size: 0.76rem;
}

.item-inspect-seller {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.item-inspect-stage-asset {
  width: 100%;
  min-height: 320px;
}

.item-inspect-stage-asset.rarity-common {
  border-color: rgba(170, 188, 214, 0.26);
}

.item-inspect-stage-asset.rarity-uncommon {
  border-color: rgba(139, 238, 165, 0.3);
  box-shadow: inset 0 0 0 1px rgba(139, 238, 165, 0.06);
}

.item-inspect-stage-asset.rarity-rare {
  border-color: rgba(120, 184, 255, 0.34);
  box-shadow: inset 0 0 0 1px rgba(120, 184, 255, 0.08);
}

.item-inspect-stage-asset.rarity-epic {
  border-color: rgba(195, 153, 255, 0.36);
  box-shadow: inset 0 0 0 1px rgba(195, 153, 255, 0.08);
}

.item-inspect-stage-asset.rarity-legendary {
  border-color: rgba(255, 197, 111, 0.4);
  box-shadow: inset 0 0 0 1px rgba(255, 197, 111, 0.1);
}

.item-inspect-stage-asset.rarity-mythic {
  border-color: rgba(255, 156, 244, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 156, 244, 0.1);
}

.item-inspect-stage-asset.rarity-uncommon .economy-item-stage-glow {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.14), transparent 52%),
    radial-gradient(circle at 50% 100%, rgba(139, 238, 165, 0.18), transparent 48%);
}

.item-inspect-stage-asset.rarity-rare .economy-item-stage-glow {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.14), transparent 52%),
    radial-gradient(circle at 50% 100%, rgba(120, 184, 255, 0.2), transparent 48%);
}

.item-inspect-stage-asset.rarity-epic .economy-item-stage-glow {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.14), transparent 52%),
    radial-gradient(circle at 50% 100%, rgba(195, 153, 255, 0.2), transparent 48%);
}

.item-inspect-stage-asset.rarity-legendary .economy-item-stage-glow {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.14), transparent 52%),
    radial-gradient(circle at 50% 100%, rgba(255, 197, 111, 0.22), transparent 48%);
}

.item-inspect-stage-asset.rarity-mythic .economy-item-stage-glow {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.14), transparent 52%),
    radial-gradient(circle at 50% 100%, rgba(255, 156, 244, 0.24), transparent 48%);
}

.item-inspect-stage-asset.mod-foil,
.item-inspect-stage-asset.mod-special {
  box-shadow:
    0 0 0 1px rgba(132, 206, 255, 0.46),
    0 0 20px rgba(75, 160, 255, 0.16) inset;
  background-image:
    linear-gradient(118deg, rgba(218, 240, 255, 0.12), rgba(102, 175, 255, 0.08), rgba(218, 240, 255, 0.12));
}

.item-inspect-stage-asset.mod-holographic,
.item-inspect-stage-asset.mod-prismatic {
  box-shadow:
    0 0 0 1px rgba(255, 150, 150, 0.42),
    0 0 20px rgba(255, 89, 89, 0.16) inset;
  background-image:
    linear-gradient(135deg, rgba(255, 220, 220, 0.08), rgba(255, 77, 77, 0.14), rgba(255, 224, 224, 0.08));
}

.item-inspect-stage-asset.mod-polychrome,
.item-inspect-stage-asset.mod-voidtouched {
  box-shadow:
    0 0 0 1px rgba(213, 142, 255, 0.5),
    0 0 22px rgba(176, 91, 255, 0.2) inset,
    0 0 18px rgba(89, 178, 255, 0.12);
  background-image:
    conic-gradient(
      from 0deg,
      rgba(255, 102, 196, 0.14),
      rgba(255, 189, 93, 0.14),
      rgba(112, 216, 255, 0.14),
      rgba(130, 255, 176, 0.14),
      rgba(212, 140, 255, 0.14),
      rgba(255, 102, 196, 0.14)
    );
}

.item-inspect-stage-asset.mod-negative {
  box-shadow:
    0 0 0 1px rgba(227, 232, 255, 0.46),
    0 0 22px rgba(111, 88, 255, 0.22) inset;
  background-image:
    radial-gradient(circle at center, rgba(12, 8, 32, 0.58), rgba(4, 3, 12, 0.84) 58%, rgba(2, 2, 6, 0.92) 100%);
}

.item-inspect-stage-asset .economy-item-art {
  width: 128px;
  height: 128px;
}

.market-list-preview {
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: center;
}

.market-list-estimate {
  display: grid;
  gap: 12px;
}

.inventory-toolbar {
  margin-bottom: 12px;
}

@media (max-width: 1120px) {
  .market-layout,
  .trades-layout,
  .market-hero-grid,
  .trade-composer-grid,
  .item-inspect-shell {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .shop-inventory {
    grid-template-columns: 1fr;
  }

  .economy-item-head,
  .market-list-preview {
    grid-template-columns: minmax(0, 1fr);
  }

  .economy-item-stage,
  .market-list-stage {
    min-height: 144px;
  }

  .economy-item-art {
    width: 76px;
    height: 76px;
  }
}

@media (max-width: 720px) {
  .economy-item-stats,
  .trade-card-columns,
  .economy-summary-row,
  .market-activity-grid,
  .item-inspect-meta {
    grid-template-columns: 1fr;
  }

  .economy-item-footer,
  .trade-card-head,
  .market-side-row,
  .trade-picker-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .trade-user-results {
    grid-template-columns: 1fr;
  }

  .trade-chip-list {
    grid-template-columns: 1fr;
  }
}
