/* ========================================================================== */
/* NEXUS                                                                      */
/* Dedicated final-pass styles loaded after the legacy UI sheets.             */
/* ========================================================================== */

#talentModal {
  --nexus-cyan: #35e8ff;
  --nexus-cyan-soft: rgba(53, 232, 255, 0.16);
  --nexus-violet: #c45cff;
  --nexus-violet-soft: rgba(196, 92, 255, 0.16);
  --nexus-gold: #ffd34e;
  --nexus-surface: rgba(4, 12, 25, 0.88);
  --nexus-surface-strong: rgba(3, 9, 20, 0.97);
  --nexus-line: rgba(101, 220, 255, 0.18);
  --nexus-text: #e9f8ff;
  --nexus-muted: #7f9eb2;
}

#talentModal.talent-modal-full {
  z-index: 1000;
  padding: clamp(6px, 1.5vw, 22px);
  background:
    radial-gradient(circle at 18% 16%, rgba(24, 145, 190, 0.13), transparent 32%),
    radial-gradient(circle at 82% 82%, rgba(173, 65, 255, 0.11), transparent 34%),
    rgba(1, 6, 13, 0.94);
  backdrop-filter: blur(14px) saturate(125%);
}

/* The global music widget deliberately sits above normal game UI. While the
   full-screen nexus is open it would cover the purchase footer, so its compact
   controls yield until the dialog closes. */
body:has(#talentModal:not(.hidden)) .yt-music-widget {
  display: none !important;
}

#talentModal .talent-modal-panel {
  width: min(1480px, calc(100vw - clamp(12px, 3vw, 44px)));
  max-width: 1480px;
  height: min(94svh, 1040px);
  max-height: calc(100svh - clamp(12px, 3vw, 44px));
  padding: clamp(12px, 1.25vw, 20px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(66, 225, 255, 0.3) !important;
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(6, 20, 38, 0.93), rgba(2, 8, 18, 0.97) 58%, rgba(12, 5, 26, 0.93)) !important;
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.72),
    0 0 54px rgba(30, 206, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 80px rgba(29, 163, 217, 0.035);
}

#talentModal .talent-modal-panel::before {
  height: 1px;
  background: linear-gradient(90deg, transparent 2%, var(--nexus-cyan) 28%, #ffffff 50%, var(--nexus-violet) 72%, transparent 98%);
  box-shadow: 0 0 18px rgba(53, 232, 255, 0.8);
  opacity: 0.82;
}

#talentModal .talent-modal-panel::after {
  content: '';
  position: absolute;
  inset: 6px;
  z-index: -1;
  pointer-events: none;
  border: 1px solid rgba(111, 220, 255, 0.055);
  border-radius: 17px;
  clip-path: polygon(0 0, 28% 0, 28% 1px, 72% 1px, 72% 0, 100% 0, 100% 100%, 0 100%);
}

#talentModal .nexus-ambient {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

#talentModal .nexus-ambient::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(53, 232, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 232, 255, 0.022) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black, transparent 90%);
}

#talentModal .nexus-orbit {
  position: absolute;
  width: 420px;
  aspect-ratio: 1;
  border: 1px solid rgba(53, 232, 255, 0.075);
  border-radius: 50%;
  box-shadow: inset 0 0 45px rgba(53, 232, 255, 0.025);
}

#talentModal .nexus-orbit::before,
#talentModal .nexus-orbit::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: var(--nexus-cyan);
  box-shadow: 0 0 12px var(--nexus-cyan);
}

#talentModal .nexus-orbit::before { width: 4px; height: 4px; left: 13%; top: 17%; }
#talentModal .nexus-orbit::after { width: 2px; height: 2px; right: 8%; bottom: 25%; }
#talentModal .nexus-orbit-a { left: -250px; top: 90px; animation: nexusOrbit 28s linear infinite; }
#talentModal .nexus-orbit-b { right: -280px; bottom: -160px; border-color: rgba(196, 92, 255, 0.08); animation: nexusOrbit 36s linear infinite reverse; }

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

#talentModal .nexus-close {
  top: 13px;
  right: 15px;
  width: 34px;
  height: 34px;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 0 0 2px;
  border: 1px solid rgba(114, 210, 234, 0.22);
  border-radius: 10px;
  background: rgba(3, 13, 25, 0.8);
  color: #7fa2b7;
  font-size: 1.5rem;
  line-height: 1;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

#talentModal .nexus-close:hover,
#talentModal .nexus-close:focus-visible {
  color: #fff;
  border-color: rgba(255, 93, 123, 0.62);
  background: rgba(255, 68, 103, 0.11);
  box-shadow: 0 0 18px rgba(255, 68, 103, 0.2);
  transform: rotate(4deg);
  outline: none;
}

/* Header and wallet -------------------------------------------------------- */

#talentModal .nexus-header {
  position: relative;
  z-index: 2;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 2px 48px 2px 5px;
}

#talentModal .nexus-identity,
#talentModal .nexus-title-row,
#talentModal .nexus-wallet,
#talentModal .nexus-resource {
  display: flex;
  align-items: center;
}

#talentModal .nexus-identity { min-width: 0; gap: 14px; }

#talentModal .nexus-emblem {
  position: relative;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 14px rgba(53, 232, 255, 0.28));
}

#talentModal .nexus-emblem::before,
#talentModal .nexus-emblem::after,
#talentModal .nexus-emblem-ring {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(53, 232, 255, 0.5);
  transform: rotate(45deg);
  border-radius: 9px;
}

#talentModal .nexus-emblem::after {
  inset: 13px;
  border-color: rgba(196, 92, 255, 0.65);
  animation: nexusEmblemPulse 3s ease-in-out infinite;
}

#talentModal .nexus-emblem-ring {
  inset: 2px;
  border-style: dashed;
  border-color: rgba(53, 232, 255, 0.15);
  border-radius: 50%;
  animation: nexusOrbit 12s linear infinite;
}

#talentModal .nexus-emblem-core {
  width: 8px;
  height: 8px;
  z-index: 1;
  border-radius: 2px;
  background: #f6feff;
  box-shadow: 0 0 9px var(--nexus-cyan), 0 0 24px var(--nexus-violet);
  transform: rotate(45deg);
}

@keyframes nexusEmblemPulse {
  0%, 100% { opacity: 0.52; transform: rotate(45deg) scale(0.92); }
  50% { opacity: 1; transform: rotate(45deg) scale(1.04); }
}

#talentModal .nexus-copy { min-width: 0; }

#talentModal .nexus-kicker,
#talentModal .talent-section-kicker {
  display: block;
  color: #6f9cb2;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.55rem;
  font-weight: 650;
  letter-spacing: 0.18em;
}

#talentModal .nexus-live-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: #69f2a0;
  box-shadow: 0 0 8px rgba(105, 242, 160, 0.8);
  animation: nexusLive 2s ease-in-out infinite;
}

@keyframes nexusLive { 50% { opacity: 0.35; } }

#talentModal .nexus-title-row { gap: 10px; margin-top: 3px; }

#talentModal .nexus-title-row h2,
#talentModal .talent-tree-title h3,
#talentModal .market-hero h3 {
  margin: 0;
  color: var(--nexus-text);
  font-family: 'Orbitron', sans-serif;
  font-weight: 780;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#talentModal .nexus-title-row h2 {
  font-size: clamp(1.15rem, 2vw, 1.7rem);
  background: linear-gradient(90deg, #f4fdff 0%, #8beeff 48%, #deb4ff 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 12px rgba(53, 232, 255, 0.16));
}

#talentModal .nexus-version {
  padding: 3px 6px;
  border: 1px solid rgba(196, 92, 255, 0.35);
  border-radius: 4px;
  color: #ce89ff;
  font: 600 0.46rem/1 'Orbitron', sans-serif;
  letter-spacing: 0.1em;
}

#talentModal .nexus-copy p,
#talentModal .talent-tree-title p,
#talentModal .market-hero p {
  margin: 5px 0 0;
  color: var(--nexus-muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

#talentModal .nexus-wallet {
  flex: 0 0 auto;
  gap: 8px;
}

#talentModal .nexus-resource {
  position: relative;
  min-width: 132px;
  gap: 9px;
  padding: 8px 13px 8px 9px;
  border: 1px solid rgba(104, 211, 238, 0.17);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(9, 30, 50, 0.74), rgba(3, 11, 23, 0.86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 8px 24px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

#talentModal .nexus-resource::after {
  content: '';
  position: absolute;
  top: 0;
  left: -80%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transform: skewX(-22deg);
  animation: nexusWalletScan 7s ease-in-out infinite;
}

#talentModal .nexus-resource-credits {
  border-color: rgba(255, 211, 78, 0.2);
  background: linear-gradient(135deg, rgba(45, 35, 9, 0.34), rgba(3, 11, 23, 0.88));
}

@keyframes nexusWalletScan {
  0%, 72% { left: -80%; }
  100% { left: 135%; }
}

#talentModal .nexus-resource-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(196, 92, 255, 0.32);
  border-radius: 9px;
  background: rgba(196, 92, 255, 0.08);
  color: #d793ff;
  text-shadow: 0 0 10px rgba(196, 92, 255, 0.7);
}

#talentModal .nexus-credit-mark {
  border-color: rgba(255, 211, 78, 0.4);
  background: rgba(255, 211, 78, 0.08);
  color: var(--nexus-gold);
  font: 800 0.72rem/1 'Orbitron', sans-serif;
  text-shadow: 0 0 9px rgba(255, 211, 78, 0.55);
}

#talentModal .nexus-resource-level {
  border-color: rgba(53, 232, 255, 0.18);
  background: linear-gradient(135deg, rgba(9, 40, 55, 0.34), rgba(3, 11, 23, 0.88));
}

#talentModal .nexus-level-mark {
  border-color: rgba(53, 232, 255, 0.35);
  background: rgba(53, 232, 255, 0.08);
  color: #6eeaff;
  font: 800 0.68rem/1 'Orbitron', sans-serif;
  text-shadow: 0 0 9px rgba(53, 232, 255, 0.55);
}

#talentModal .nexus-level-mark + .nexus-resource-copy strong {
  color: #6eeaff;
  text-shadow: 0 0 9px rgba(53, 232, 255, 0.25);
}

#talentModal .nexus-resource-cards {
  border-color: rgba(198, 92, 255, 0.18);
  background: linear-gradient(135deg, rgba(45, 15, 65, 0.34), rgba(3, 11, 23, 0.88));
}

#talentModal .nexus-cards-mark {
  border-color: rgba(198, 92, 255, 0.4);
  background: rgba(198, 92, 255, 0.08);
  color: #d793ff;
  font: 800 0.72rem/1 'Orbitron', sans-serif;
  text-shadow: 0 0 9px rgba(198, 92, 255, 0.55);
}

#talentModal .nexus-cards-mark + .nexus-resource-copy strong {
  color: #d793ff;
  text-shadow: 0 0 9px rgba(198, 92, 255, 0.25);
}

#talentModal .nexus-resource-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1;
}

#talentModal .nexus-resource-copy small {
  color: #66899e;
  font: 600 0.46rem/1 'Orbitron', sans-serif;
  letter-spacing: 0.12em;
}

#talentModal .nexus-resource-copy strong {
  margin-top: 5px;
  color: #e6a4ff;
  font: 750 0.91rem/1 'Orbitron', sans-serif;
  letter-spacing: 0.06em;
  text-shadow: 0 0 10px rgba(196, 92, 255, 0.28);
}

#talentModal .nexus-resource-credits strong {
  color: var(--nexus-gold);
  text-shadow: 0 0 9px rgba(255, 211, 78, 0.25);
}

#talentModal .nexus-resource-copy strong.resource-value-updated {
  animation: nexusResourceBump 380ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes nexusResourceBump {
  0% { transform: translateY(2px) scale(0.86); filter: brightness(1.8); }
  65% { transform: translateY(-1px) scale(1.12); }
  100% { transform: none; }
}

/* Nexus tabs --------------------------------------------------------------- */

#talentModal .talent-subnav {
  position: relative;
  z-index: 2;
  min-height: 52px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 5px;
  border: 1px solid rgba(85, 197, 226, 0.15);
  border-radius: 14px;
  background: rgba(1, 8, 18, 0.66);
  box-shadow: inset 0 0 22px rgba(24, 137, 174, 0.025);
}

#talentModal .talent-subnav-btn {
  position: relative;
  min-width: 0;
  min-height: 42px;
  padding: 5px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #66869a;
  opacity: 1;
  text-align: left;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

#talentModal .talent-subnav-btn::after {
  content: '';
  position: absolute;
  right: 13px;
  bottom: -1px;
  left: 13px;
  width: auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--nexus-cyan), transparent);
  box-shadow: 0 0 10px var(--nexus-cyan);
  opacity: 0;
  transform: scaleX(0.5);
  transition: opacity 180ms ease, transform 180ms ease;
  animation: none;
}

#talentModal .talent-subnav-btn:hover {
  color: #bfefff;
  border-color: rgba(53, 232, 255, 0.13);
  background: rgba(53, 232, 255, 0.035);
  transform: translateY(-1px);
}

#talentModal .talent-subnav-btn.active {
  color: #fff;
  border-color: rgba(53, 232, 255, 0.31);
  background: linear-gradient(100deg, rgba(53, 232, 255, 0.12), rgba(53, 232, 255, 0.025) 58%, rgba(196, 92, 255, 0.07));
  box-shadow: inset 0 0 18px rgba(53, 232, 255, 0.035), 0 0 15px rgba(53, 232, 255, 0.05);
  text-shadow: none;
}

#talentModal .talent-subnav-btn.active::after { opacity: 1; transform: scaleX(1); }

#talentModal .talent-subnav-btn:focus-visible {
  outline: 2px solid rgba(53, 232, 255, 0.8);
  outline-offset: 2px;
}

#talentModal .talent-subnav-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(109, 164, 188, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  font-size: 0.82rem;
  transition: border-color 180ms ease, color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

#talentModal .active .talent-subnav-icon-matrix {
  border-color: rgba(196, 92, 255, 0.45);
  background: rgba(196, 92, 255, 0.08);
  color: #dd9cff;
  box-shadow: 0 0 12px rgba(196, 92, 255, 0.12);
}

#talentModal .active .talent-subnav-icon-market {
  border-color: rgba(53, 232, 255, 0.45);
  background: rgba(53, 232, 255, 0.08);
  color: #8bf3ff;
  box-shadow: 0 0 12px rgba(53, 232, 255, 0.12);
}

#talentModal .talent-subnav-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
#talentModal .talent-subnav-copy strong { font: 680 0.66rem/1 'Orbitron', sans-serif; letter-spacing: 0.13em; }
#talentModal .talent-subnav-copy small { color: #607b8d; font: 500 0.54rem/1 'Outfit', sans-serif; letter-spacing: 0.035em; text-transform: none; }
#talentModal .active .talent-subnav-copy small { color: #87a9bc; }

/* Shared content ---------------------------------------------------------- */

#talentModal .nexus-main {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#talentModal .tab-content.hidden { display: none !important; }

#talentModal #talentTab,
#talentModal #accountTab,
#talentModal #deckTab {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  animation: nexusTabIn 230ms cubic-bezier(0.16, 1, 0.3, 1);
}

#talentModal #talentTab { display: flex; flex-direction: column; }
#talentModal #accountTab { display: flex; flex-direction: column; gap: 10px; }
#talentModal #deckTab { display: flex; flex-direction: column; }

@keyframes nexusTabIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Talent matrix ----------------------------------------------------------- */

#talentModal .talent-tree-header {
  min-height: 56px;
  margin: 0;
  padding: 1px 3px 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

#talentModal .talent-tree-title { min-width: 0; }
#talentModal .talent-tree-title::after { display: none; }
#talentModal .talent-tree-title h3 { margin-top: 4px; color: #bdf7ff; font-size: clamp(0.85rem, 1.4vw, 1.08rem); text-shadow: 0 0 15px rgba(53, 232, 255, 0.18); }
#talentModal .tt-title-icon { display: inline-block; margin-right: 8px; color: var(--nexus-cyan); animation: nexusStarPulse 3.2s ease-in-out infinite; }

@keyframes nexusStarPulse {
  0%, 100% { transform: rotate(0) scale(1); filter: drop-shadow(0 0 5px rgba(53, 232, 255, 0.35)); }
  50% { transform: rotate(45deg) scale(1.12); filter: drop-shadow(0 0 11px rgba(53, 232, 255, 0.7)); }
}

#talentModal .talent-branch-legend {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

#talentModal .talent-legend-chip {
  --legend-color: #8ba8b8;
  position: relative;
  padding: 5px 8px 5px 14px;
  border: 1px solid color-mix(in srgb, var(--legend-color) 24%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--legend-color) 5%, transparent);
  color: color-mix(in srgb, var(--legend-color) 78%, #fff 22%);
  font: 600 0.44rem/1 'Orbitron', sans-serif;
  letter-spacing: 0.08em;
}

#talentModal .talent-legend-chip::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--legend-color);
  box-shadow: 0 0 6px var(--legend-color);
  transform: translateY(-50%);
}

#talentModal .legend-license { --legend-color: #ffd93d; }
#talentModal .legend-tech { --legend-color: #38d8ff; }
#talentModal .legend-heal { --legend-color: #65e68a; }
#talentModal .legend-survival { --legend-color: #ff5f76; }
#talentModal .legend-cards { --legend-color: #c65cff; }

#talentModal .talent-tree-layout {
  flex: 1;
  min-height: 350px;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(278px, 24vw, 340px);
  gap: 12px;
  overflow: hidden !important;
}

#talentModal .talent-tree-stage,
#talentModal .talent-detail-panel,
#talentModal .nexus-card-section {
  border: 1px solid var(--nexus-line);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(5, 19, 35, 0.74), rgba(2, 8, 18, 0.85));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025), inset 0 0 34px rgba(53, 232, 255, 0.018);
}

#talentModal .talent-tree-stage {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#talentModal .talent-stage-toolbar {
  min-height: 34px;
  flex: 0 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(53, 232, 255, 0.09);
  background: rgba(2, 9, 19, 0.58);
}

#talentModal .talent-stage-status,
#talentModal .talent-stage-hint {
  color: #5f879b;
  font: 600 0.45rem/1 'Orbitron', sans-serif;
  letter-spacing: 0.09em;
}

#talentModal .talent-stage-status i {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 6px;
  border-radius: 50%;
  background: #63e99b;
  box-shadow: 0 0 7px rgba(99, 233, 155, 0.75);
}

#talentModal .talent-stage-hint { color: #526d7e; letter-spacing: 0.03em; text-transform: none; }

#talentModal #talentTreeContainer,
#talentModal .talent-tree-canvas {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden !important;
  isolation: isolate;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 9%, rgba(255, 217, 61, 0.065), transparent 24%),
    radial-gradient(circle at 14% 64%, rgba(56, 216, 255, 0.055), transparent 28%),
    radial-gradient(circle at 84% 60%, rgba(198, 92, 255, 0.055), transparent 29%),
    rgba(0, 4, 11, 0.32);
  box-shadow: none;
}

#talentModal #talentTreeContainer::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(53, 232, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 232, 255, 0.025) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse, black 35%, transparent 88%);
}

#talentModal #talentTreeContainer::after {
  content: '';
  position: absolute;
  z-index: -1;
  top: -1px;
  right: 0;
  left: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(53, 232, 255, 0.32), transparent);
  box-shadow: 0 0 12px rgba(53, 232, 255, 0.22);
  animation: nexusMatrixScan 8s linear infinite;
}

@keyframes nexusMatrixScan {
  from { transform: translateY(0); opacity: 0; }
  8%, 90% { opacity: 0.65; }
  to { transform: translateY(560px); opacity: 0; }
}

#talentModal #talentTreeContainer > svg { overflow: visible; }
#talentModal .tt-path { transition: stroke 180ms ease, stroke-width 180ms ease, filter 180ms ease; }

#talentModal .tt-node {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0;
  border-width: 1px;
  border-color: color-mix(in srgb, var(--node-color) 22%, rgba(112, 145, 163, 0.2));
  border-radius: 11px;
  background:
    linear-gradient(135deg, rgba(13, 34, 53, 0.92), rgba(2, 10, 22, 0.97)),
    var(--node-dim);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.42), inset 0 0 14px rgba(255, 255, 255, 0.016);
  color: var(--node-color);
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

#talentModal .tt-node::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid color-mix(in srgb, var(--node-color) 11%, transparent);
  border-radius: 6px;
  pointer-events: none;
}

#talentModal .tt-node:hover,
#talentModal .tt-node:focus-visible,
#talentModal .tt-node--path-highlight {
  z-index: 8;
  border-color: var(--node-color);
  background: linear-gradient(135deg, rgba(18, 42, 61, 0.98), rgba(4, 12, 27, 0.98));
  box-shadow: 0 0 22px var(--node-glow), 0 8px 20px rgba(0, 0, 0, 0.5), inset 0 0 12px var(--node-dim) !important;
  transform: rotate(45deg) scale(1.09);
  outline: none;
}

#talentModal .tt-node--selected,
#talentModal .tt-node--selected:hover,
#talentModal .tt-node--selected:focus-visible {
  z-index: 9;
  border-color: #eefeff !important;
  box-shadow: 0 0 0 2px rgba(238, 254, 255, 0.1), 0 0 24px var(--node-glow), inset 0 0 14px var(--node-dim) !important;
  transform: rotate(45deg) scale(1.11) !important;
}

#talentModal .tt-node--active {
  border-color: color-mix(in srgb, var(--node-color) 72%, #fff 8%);
  background: linear-gradient(135deg, color-mix(in srgb, var(--node-dim) 38%, rgba(14, 35, 55, 0.94)), rgba(3, 11, 25, 0.97));
  box-shadow: 0 0 13px color-mix(in srgb, var(--node-glow) 58%, transparent), 0 7px 16px rgba(0, 0, 0, 0.4), inset 0 0 10px var(--node-dim);
}

#talentModal .tt-node--unlockable:not(.tt-node--selected) { animation: nexusNodeReady 2.8s ease-in-out infinite; }

@keyframes nexusNodeReady {
  0%, 100% { box-shadow: 0 0 6px var(--node-dim), 0 7px 16px rgba(0, 0, 0, 0.42); }
  50% { box-shadow: 0 0 18px var(--node-glow), 0 7px 16px rgba(0, 0, 0, 0.42); }
}

#talentModal .tt-node-content { gap: 3px; }
#talentModal .tt-node-icon { display: grid; place-items: center; font-size: clamp(0.72rem, 1.2vw, 1rem); }
#talentModal .tt-node-icon svg { width: clamp(15px, 1.55vw, 21px); height: clamp(15px, 1.55vw, 21px); }
#talentModal .tt-node-level { margin: 0; color: #597487; font-size: clamp(0.34rem, 0.55vw, 0.46rem); }
#talentModal .tt-node--active .tt-node-level,
#talentModal .tt-node--maxed .tt-node-level { color: color-mix(in srgb, var(--node-color) 76%, #fff 24%); }

#talentModal .tt-node-caption {
  position: absolute;
  z-index: 5;
  box-sizing: border-box;
  overflow: hidden;
  width: max-content;
  width: fit-content;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--node-color) 26%, transparent);
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(3, 14, 28, 0.96), rgba(2, 8, 17, 0.94));
  backdrop-filter: blur(4px);
  color: #648196;
  font: 600 clamp(0.6rem, 0.7vw, 0.72rem)/1.15 'Orbitron', sans-serif;
  letter-spacing: 0.038em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
  transform: translateX(-50%);
  transition: color 160ms ease, border-color 160ms ease, text-shadow 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

#talentModal .tt-node-caption--side-right {
  transform: translateY(-50%);
  text-align: left;
}

#talentModal .tt-node-caption--side-left {
  transform: translate(-100%, -50%);
  text-align: right;
  background: linear-gradient(225deg, rgba(3, 14, 28, 0.94), rgba(2, 8, 17, 0.88));
}

#talentModal .tt-node-caption--above {
  transform: translate(-50%, -100%);
  text-align: center;
}

#talentModal .tt-node-caption--active {
  color: color-mix(in srgb, var(--node-color) 82%, #fff 18%);
  border-color: color-mix(in srgb, var(--node-color) 45%, transparent);
  box-shadow: 0 0 10px var(--node-dim), 0 3px 10px rgba(0, 0, 0, 0.5);
}

#talentModal .tt-node-caption--selected {
  color: #ffffff;
  border-color: color-mix(in srgb, var(--node-color) 70%, #fff 30%);
  background: linear-gradient(135deg, rgba(8, 28, 48, 0.96), rgba(3, 14, 28, 0.96));
  box-shadow: 0 0 14px var(--node-glow), 0 4px 12px rgba(0, 0, 0, 0.6);
  text-shadow: 0 0 8px var(--node-glow);
}

#talentModal .tt-branch-label {
  z-index: 4;
  padding: 3px 7px;
  border: 1px solid currentColor;
  border-radius: 5px;
  background: rgba(2, 9, 19, 0.76);
  font-size: clamp(0.36rem, 0.5vw, 0.48rem);
  letter-spacing: 0.1em;
  opacity: 0.72;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}

/* The matrix is also used on 1080p desktops. Node geometry and caption offsets
   grow together in talent-tree.js; these desktop floors keep their contents
   and branch labels readable without affecting compact/mobile layout. */
@media (min-width: 901px) {
  #talentModal .tt-node-icon {
    font-size: clamp(0.9rem, 0.7vw, 1.25rem);
  }

  #talentModal .tt-node-icon svg {
    width: clamp(18px, 1.15vw, 28px);
    height: clamp(18px, 1.15vw, 28px);
  }

  #talentModal .tt-node-level {
    font-size: clamp(0.5rem, 0.32vw, 0.62rem);
  }

  #talentModal .tt-node-caption {
    font-size: clamp(0.625rem, 0.36vw, 0.72rem);
    line-height: 1.15;
    padding: 4px 7px;
  }

  #talentModal .tt-branch-label {
    padding: 4px 8px;
    font-size: clamp(0.58rem, 0.34vw, 0.68rem);
  }
}

/* The legacy floating tooltip caused the viewport clipping shown in the bug
   report. Node information now lives exclusively in the stable detail rail. */
#talentModal .tt-tooltip { display: none !important; }

/* Talent detail rail ------------------------------------------------------ */

#talentModal .talent-detail-panel {
  min-width: 0;
  max-width: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: none !important;
}

#talentModal .talent-detail-panel::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  z-index: 3;
  background: linear-gradient(transparent, var(--node-color, var(--nexus-cyan)) 24%, var(--node-color, var(--nexus-cyan)) 76%, transparent);
  box-shadow: 0 0 10px var(--node-glow, rgba(53, 232, 255, 0.5));
}

#talentModal .tt-detail-content-wrap {
  position: relative;
  z-index: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 14px;
}

#talentModal .tt-detail-eyebrow {
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: #607e91;
  font: 600 0.44rem/1 'Orbitron', sans-serif;
  letter-spacing: 0.12em;
}

#talentModal .tt-detail-status {
  padding: 4px 6px;
  border: 1px solid rgba(112, 139, 153, 0.25);
  border-radius: 5px;
  color: #7896a7;
  font-size: 0.4rem;
}

#talentModal .tt-detail-status.ready { border-color: rgba(101, 230, 138, 0.35); color: #76eca0; background: rgba(101, 230, 138, 0.055); }
#talentModal .tt-detail-status.maxed { border-color: color-mix(in srgb, var(--node-color) 42%, transparent); color: var(--node-color); background: var(--node-dim); }
#talentModal .tt-detail-status.locked { border-color: rgba(255, 95, 118, 0.27); color: #d67587; background: rgba(255, 95, 118, 0.045); }

#talentModal .tt-detail-header {
  flex: 0 0 auto;
  gap: 11px;
  margin: 0 0 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--node-color);
}

#talentModal .tt-detail-icon-wrap {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(14, 37, 57, 0.94), rgba(3, 10, 22, 0.96));
}

#talentModal .tt-detail-icon svg { width: 23px; height: 23px; }
#talentModal .tt-detail-name { color: #f0fbff; font-size: clamp(0.73rem, 1.05vw, 0.88rem); line-height: 1.25; }
#talentModal .tt-detail-branch { display: block; margin-top: 5px; font-size: 0.49rem; }

#talentModal .tt-detail-body {
  min-height: 0;
  gap: 11px;
  padding-right: 3px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(53, 232, 255, 0.24) transparent;
}

#talentModal .tt-detail-desc { color: #aac3d1; font-size: 0.68rem; line-height: 1.5; }
#talentModal .tt-detail-effect-section,
#talentModal .tt-detail-level-section { gap: 5px; }
#talentModal .effect-title,
#talentModal .level-title { color: #5f7c8e; font-size: 0.48rem; }

#talentModal .effect-value {
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, var(--node-color) 18%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--node-dim) 42%, rgba(1, 8, 18, 0.62));
  color: color-mix(in srgb, var(--node-color) 76%, white 24%);
  font-size: 0.61rem;
  line-height: 1.35;
  text-shadow: 0 0 7px var(--node-glow);
}

#talentModal .tt-stat-bar-outer {
  height: 5px;
  margin-top: 2px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

#talentModal .tt-stat-bar-fill { height: 100%; border-radius: inherit; transition: width 280ms ease; }
#talentModal .level-pips { gap: 4px; }
#talentModal .tt-pip { height: 4px; border-radius: 999px; }
#talentModal .tt-pip.filled { background: var(--node-color); box-shadow: 0 0 7px var(--node-glow); }
#talentModal .tt-detail-req { padding: 7px 8px; border-radius: 7px; font-size: 0.58rem; line-height: 1.35; }

#talentModal .tt-detail-footer {
  flex: 0 0 auto;
  margin: 12px 0 0;
  padding: 11px 0 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

#talentModal .tt-detail-cost-info {
  min-width: 50px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

#talentModal .tt-detail-cost-info span { color: #5d7789; font: 600 0.4rem/1 'Orbitron', sans-serif; letter-spacing: 0.09em; }
#talentModal .tt-detail-cost-info strong { color: #df9bff; font: 750 0.7rem/1 'Orbitron', sans-serif; text-shadow: 0 0 9px rgba(196, 92, 255, 0.3); }

#talentModal .tt-detail-upgrade-btn {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px !important;
  border: 1px solid color-mix(in srgb, var(--node-color) 48%, transparent) !important;
  border-radius: 9px !important;
  background: linear-gradient(110deg, color-mix(in srgb, var(--node-dim) 55%, transparent), rgba(53, 232, 255, 0.045)) !important;
  color: color-mix(in srgb, var(--node-color) 78%, #fff 22%) !important;
  font-size: 0.57rem !important;
  letter-spacing: 0.08em;
  box-shadow: inset 0 0 14px color-mix(in srgb, var(--node-dim) 42%, transparent);
}

#talentModal .tt-detail-upgrade-btn:not(:disabled):hover,
#talentModal .tt-detail-upgrade-btn:not(:disabled):focus-visible {
  border-color: var(--node-color) !important;
  box-shadow: 0 0 17px color-mix(in srgb, var(--node-glow) 58%, transparent), inset 0 0 14px var(--node-dim);
  transform: translateY(-1px);
  outline: none;
}

#talentModal .tt-detail-upgrade-btn:disabled { opacity: 0.4; filter: grayscale(0.5); cursor: not-allowed; }

#talentModal .tt-detail-bg-effect { opacity: 0.11; animation-duration: 6s; }
#talentModal .tt-detail-particle { width: 2px; height: 2px; opacity: 0; }

/* Talent footer ----------------------------------------------------------- */

#talentModal .talent-message {
  flex: 0 0 auto;
  min-height: 13px;
  margin: 3px 0 1px;
  font-size: 0.52rem;
  line-height: 13px;
}

#talentModal .talent-actions {
  flex: 0 0 auto;
  min-height: 52px;
  margin: 0;
  padding: 6px 7px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(93, 190, 216, 0.11);
  border-radius: 12px;
  background: rgba(1, 8, 17, 0.58);
}

#talentModal .talent-buy-group { min-width: 0; display: flex; align-items: center; gap: 6px; }

#talentModal .talent-buy-label {
  min-width: 138px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #9ab6c5;
  font-size: 0.52rem;
  line-height: 1;
}

#talentModal .talent-buy-label small { color: #557485; font-size: 0.4rem; letter-spacing: 0.11em; }

#talentModal .btn-talent-buy,
#talentModal .btn-talent-reset {
  min-height: 36px;
  border-radius: 8px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

#talentModal .btn-talent-buy {
  min-width: 78px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(196, 92, 255, 0.29);
  background: linear-gradient(130deg, rgba(196, 92, 255, 0.1), rgba(53, 232, 255, 0.04));
  color: #d98fff;
  box-shadow: inset 0 0 10px rgba(196, 92, 255, 0.035);
}

#talentModal .btn-talent-buy strong { font: 800 0.68rem/1 'Orbitron', sans-serif; }
#talentModal .btn-talent-buy span { color: #849ead; font: 600 0.42rem/1 'Orbitron', sans-serif; }

#talentModal .btn-talent-buy:not(:disabled):hover,
#talentModal .btn-talent-buy:not(:disabled):focus-visible {
  border-color: rgba(213, 120, 255, 0.7);
  background: linear-gradient(130deg, rgba(196, 92, 255, 0.19), rgba(53, 232, 255, 0.08));
  box-shadow: 0 0 16px rgba(196, 92, 255, 0.14), inset 0 0 10px rgba(196, 92, 255, 0.07);
  transform: translateY(-1px);
  outline: none;
}

#talentModal .btn-talent-buy:disabled { opacity: 0.34; cursor: not-allowed; filter: grayscale(0.5); }

#talentModal .talent-bonus-summary {
  min-width: 0;
  max-width: none;
  margin: 0;
  overflow: hidden;
  color: #668496;
  font-size: 0.43rem;
  line-height: 1.35;
  text-align: center;
  text-overflow: ellipsis;
}

#talentModal .btn-talent-reset {
  min-width: 138px;
  padding: 5px 11px;
  border-color: rgba(255, 95, 118, 0.22);
  background: rgba(255, 95, 118, 0.035);
  color: #d16f83;
  font-size: 0.47rem;
  letter-spacing: 0.055em;
}

#talentModal .btn-talent-reset span { margin-right: 4px; font-size: 0.76rem; }
#talentModal .btn-talent-reset small { margin-left: 3px; color: #895463; font-size: 0.39rem; }

#talentModal .btn-talent-reset:hover,
#talentModal .btn-talent-reset:focus-visible {
  border-color: rgba(255, 95, 118, 0.52);
  background: rgba(255, 95, 118, 0.09);
  color: #ff879d;
  box-shadow: 0 0 14px rgba(255, 95, 118, 0.1);
  transform: translateY(-1px);
  outline: none;
}

/* Card market ------------------------------------------------------------- */

#talentModal .market-hero {
  min-height: 62px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 3px 5px 7px;
}

#talentModal .market-hero h3 { margin-top: 4px; color: #c7f8ff; font-size: clamp(0.86rem, 1.5vw, 1.1rem); text-shadow: 0 0 14px rgba(53, 232, 255, 0.16); }

#talentModal .market-signal {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(101, 230, 138, 0.18);
  border-radius: 9px;
  background: rgba(101, 230, 138, 0.035);
  color: #6e9b7d;
  font: 600 0.42rem/1.25 'Orbitron', sans-serif;
  letter-spacing: 0.09em;
}

#talentModal .market-signal i {
  width: 8px;
  height: 8px;
  border: 1px solid #65e68a;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(101, 230, 138, 0.45);
  animation: nexusLive 2s ease-in-out infinite;
}

#talentModal .nexus-card-section {
  flex: 1;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
}

#talentModal .nexus-card-header {
  min-height: 30px;
  flex: 0 0 auto;
  margin: 0 0 7px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#talentModal .card-section-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(53, 232, 255, 0.22);
  border-radius: 7px;
  background: rgba(53, 232, 255, 0.045);
  color: #75efff;
  font-size: 0.75rem;
  text-shadow: 0 0 7px rgba(53, 232, 255, 0.5);
}

#talentModal .card-section-title { color: #b9dbe7; font-size: 0.57rem; letter-spacing: 0.12em; }

#talentModal .market-card-count {
  margin-left: auto;
  color: #5d7b8c;
  font: 600 0.43rem/1 'Orbitron', sans-serif;
  letter-spacing: 0.07em;
}

#talentModal .nexus-filter-bar {
  min-height: 43px;
  flex: 0 0 auto;
  margin: 0 0 8px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.4vw, 18px);
  border: 1px solid rgba(84, 183, 211, 0.1);
  border-radius: 10px;
  background: rgba(1, 7, 15, 0.52);
}

#talentModal .filter-group { gap: 6px; padding-right: clamp(7px, 1.2vw, 15px); border-right-color: rgba(80, 175, 202, 0.1); }
#talentModal .filter-label { color: #5a7789; font-size: 0.43rem; }
#talentModal .filter-rarities,
#talentModal .filter-status { gap: 4px; }

#talentModal .filter-rarity-btn,
#talentModal .filter-status-btn {
  border-color: rgba(117, 170, 191, 0.15);
  background: rgba(255, 255, 255, 0.018);
  color: #668496;
  box-shadow: none;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

#talentModal .filter-rarity-btn { width: 23px; height: 23px; }
#talentModal .filter-status-btn { min-height: 26px; padding: 4px 8px; border-radius: 6px; font-size: 0.43rem; }

#talentModal .filter-rarity-btn:hover,
#talentModal .filter-status-btn:hover,
#talentModal .filter-rarity-btn:focus-visible,
#talentModal .filter-status-btn:focus-visible {
  border-color: rgba(53, 232, 255, 0.38);
  background: rgba(53, 232, 255, 0.065);
  color: #a5f6ff;
  box-shadow: 0 0 10px rgba(53, 232, 255, 0.08);
  transform: translateY(-1px);
  outline: none;
}

#talentModal .filter-rarity-btn[data-rarity="all"].active,
#talentModal .filter-status-btn.active {
  border-color: rgba(53, 232, 255, 0.5);
  background: rgba(53, 232, 255, 0.1);
  color: #b5f9ff;
  box-shadow: inset 0 0 9px rgba(53, 232, 255, 0.055), 0 0 8px rgba(53, 232, 255, 0.08);
}

#talentModal .filter-rarity-btn:not([data-rarity="all"]).active {
  background: color-mix(in srgb, var(--rarity-color) 75%, transparent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--rarity-color) 50%, transparent);
}

#talentModal .nexus-cards-grid {
  flex: 1;
  min-height: 0;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  align-content: start;
  gap: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(75, 164, 191, 0.07);
  border-radius: 10px;
  background:
    linear-gradient(rgba(53, 232, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 232, 255, 0.015) 1px, transparent 1px),
    rgba(0, 4, 11, 0.42);
  background-size: 24px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(53, 232, 255, 0.25) transparent;
}

#talentModal .nexus-card-entry { min-width: 0; width: 100%; display: block; }

#talentModal .nexus-card-entry .tcg-card--nexus {
  width: 100%;
  height: auto;
  min-height: 232px;
  aspect-ratio: 3 / 4;
  margin: 0;
  padding: 8px;
  animation: none;
  transform: none;
  border-radius: 12px;
  background: linear-gradient(155deg, rgba(7, 24, 39, 0.97), rgba(1, 7, 16, 0.98));
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 180ms ease, border-color 180ms ease;
}

#talentModal .nexus-card-entry .tcg-card--nexus:hover {
  z-index: 99;
  transform: translateY(-4px) scale(1.018) !important;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.48), 0 0 18px rgba(53, 232, 255, 0.12), inset 0 0 18px rgba(53, 232, 255, 0.045);
}

#talentModal .nexus-card-entry .tcg-card--nexus .tcg-image { min-height: 72px; margin: 12px 3px 6px; }
#talentModal .nexus-card-entry .tcg-card--nexus .tcg-image-icon { font-size: 2.25rem; }
#talentModal .nexus-card-entry .tcg-card--nexus .tcg-name { font-size: 0.66rem; }
#talentModal .nexus-card-entry .tcg-card--nexus .tcg-desc { font-size: 0.51rem; line-height: 1.35; }
#talentModal .nexus-card-entry .tcg-card--nexus .tcg-footer { min-height: 38px; }
#talentModal .nexus-card-entry .tcg-buy-btn { min-width: 92px; padding: 6px 9px; border-radius: 7px; font-size: 0.52rem; }
#talentModal .nexus-card-entry .tcg-buy-btn:disabled {
  border-color: rgba(111, 137, 149, 0.2);
  background: rgba(111, 137, 149, 0.035);
  color: #526b78;
  box-shadow: none;
  cursor: not-allowed;
  filter: grayscale(0.7);
}

#talentModal .tcg-preview-trigger,
#talentModal .tcg-preview-close {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 8;
  width: 28px;
  height: 28px;
  display: none;
  place-items: center;
  padding: 0 0 2px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(2, 9, 18, 0.85);
  color: #9ab4c1;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

#talentModal .tcg-preview-trigger {
  top: 31px;
  width: 24px;
  height: 24px;
  display: grid;
  opacity: 0;
  border-color: rgba(53, 232, 255, 0.22);
  color: #7bcbd8;
  font-size: 0.72rem;
  transition: opacity 150ms ease, color 150ms ease, border-color 150ms ease, background 150ms ease;
}

#talentModal .tcg-card--nexus:hover .tcg-preview-trigger,
#talentModal .tcg-preview-trigger:focus-visible { opacity: 1; }
#talentModal .tcg-preview-trigger:hover,
#talentModal .tcg-preview-trigger:focus-visible {
  border-color: rgba(53, 232, 255, 0.58);
  background: rgba(53, 232, 255, 0.09);
  color: #b6f9ff;
  outline: none;
}

#talentModal .nexus-card-preview .tcg-preview-close { display: grid; }
#talentModal .nexus-card-preview .tcg-preview-close:hover,
#talentModal .nexus-card-preview .tcg-preview-close:focus-visible {
  border-color: rgba(255, 95, 118, 0.5);
  color: #ff8ca1;
  outline: none;
}

#talentModal .nexus-card-preview-overlay {
  position: absolute;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: inherit;
  background: rgba(0, 5, 12, 0.76);
  backdrop-filter: blur(9px) saturate(115%);
  opacity: 0;
  transition: opacity 170ms ease;
}

#talentModal .nexus-card-preview-overlay.visible { opacity: 1; }

#talentModal .nexus-card-preview {
  position: relative;
  z-index: 1;
  width: min(292px, calc(100% - 8px));
  height: min(424px, calc(100% - 8px));
  min-height: 0;
  animation: nexusCardPreviewIn 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes nexusCardPreviewIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

#talentModal .nexus-card-preview .tcg-card--nexus {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  margin: 0;
  padding: 12px;
  overflow: auto;
  transform: none !important;
  animation: none;
  background: linear-gradient(155deg, rgba(7, 24, 39, 0.99), rgba(1, 7, 16, 0.995));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.85), 0 0 35px rgba(53, 232, 255, 0.25), inset 0 0 28px rgba(255, 255, 255, 0.035);
}

#talentModal .nexus-card-preview .tcg-card--nexus:hover { transform: none !important; }
#talentModal .nexus-card-preview .tcg-image { min-height: 90px; }
#talentModal .nexus-card-preview .tcg-image-icon { font-size: 2.8rem; }
#talentModal .nexus-card-preview .tcg-name { font-size: 0.78rem; }
#talentModal .nexus-card-preview .tcg-type { font-size: 0.56rem; }
#talentModal .nexus-card-preview .tcg-desc { overflow: auto; font-size: 0.63rem; line-height: 1.42; }

#talentModal .nexus-no-cards {
  min-height: 210px;
  padding: 28px;
  flex-direction: column;
  gap: 9px;
  border: 1px dashed rgba(53, 232, 255, 0.12);
  border-radius: 10px;
  color: #68899b;
  font-size: 0.62rem;
  letter-spacing: 0.07em;
}

#talentModal .nexus-no-cards::before {
  content: '◇';
  display: block;
  color: rgba(53, 232, 255, 0.34);
  font-size: 1.8rem;
  text-shadow: 0 0 14px rgba(53, 232, 255, 0.18);
}

#talentModal .deck-preview-overlay {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  background: rgba(1, 6, 14, 0.92);
  backdrop-filter: blur(14px) saturate(130%);
}

#talentModal .deck-preview-modal-stage {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: hidden;
}

/* Main area (counter + carousel + bottom bar) */
#talentModal .deck-preview-main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 28px 32px 24px 32px;
  min-width: 0;
  gap: 0;
}

/* 3D Carousel & Neighbor Cards */
#talentModal .deck-preview-carousel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  perspective: 1200px;
  position: relative;
  width: 100%;
  overflow: hidden;
  /* Smooth transition for in-place carousel navigation */
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
              opacity 180ms ease;
}

/* ── Carousel slide animations ───────────────────────────────────────────── */

@keyframes carouselSlideOutLeft {
  from { transform: translateX(0);     opacity: 1; }
  to   { transform: translateX(-12%);  opacity: 0; }
}
@keyframes carouselSlideOutRight {
  from { transform: translateX(0);     opacity: 1; }
  to   { transform: translateX(12%);   opacity: 0; }
}
@keyframes carouselSlideInFromRight {
  from { transform: translateX(12%);   opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}
@keyframes carouselSlideInFromLeft {
  from { transform: translateX(-12%);  opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

#talentModal .deck-preview-carousel.carousel-slide-out-left {
  animation: carouselSlideOutLeft 220ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
#talentModal .deck-preview-carousel.carousel-slide-out-right {
  animation: carouselSlideOutRight 220ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
#talentModal .deck-preview-carousel.carousel-slide-in-right {
  animation: carouselSlideInFromRight 280ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
#talentModal .deck-preview-carousel.carousel-slide-in-left {
  animation: carouselSlideInFromLeft 280ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
#talentModal .deck-preview-carousel.carousel-settled {
  animation: none;
  transform: translateX(0);
  opacity: 1;
}



#talentModal .deck-preview-side-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  opacity: 0.6;
  filter: brightness(0.7) saturate(90%);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), opacity 220ms ease, filter 220ms ease;
  user-select: none;
}

#talentModal .deck-side-prev {
  transform: scale(0.82) rotateY(12deg) translateX(12px);
}

#talentModal .deck-side-next {
  transform: scale(0.82) rotateY(-12deg) translateX(-12px);
}

#talentModal .deck-preview-side-container:hover {
  opacity: 0.95;
  filter: brightness(1.0) saturate(115%);
}

#talentModal .deck-side-prev:hover {
  transform: scale(0.86) rotateY(4deg) translateX(4px);
}

#talentModal .deck-side-next:hover {
  transform: scale(0.86) rotateY(-4deg) translateX(-4px);
}

#talentModal .deck-side-overlay-btn {
  position: absolute;
  top: -12px;
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid rgba(53, 232, 255, 0.4);
  border-radius: 20px;
  background: rgba(2, 10, 22, 0.88);
  backdrop-filter: blur(6px);
  color: var(--nexus-cyan);
  font-family: 'Orbitron', sans-serif;
  box-shadow: 0 0 14px rgba(53, 232, 255, 0.25);
  pointer-events: none;
}

#talentModal .deck-side-arrow {
  font-size: 0.85rem;
  line-height: 1;
}

#talentModal .deck-side-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  text-transform: uppercase;
}

#talentModal .deck-side-card-wrapper {
  width: 220px;
  height: 305px;
  pointer-events: none;
  flex-shrink: 0;
}

#talentModal .deck-side-card-wrapper .tcg-card--nexus {
  width: 100%;
  height: 100%;
  transform: none !important;
}

#talentModal .deck-preview-side-spacer {
  width: 220px;
  flex-shrink: 0;
}

/* Centered Main Card */
#talentModal .deck-center-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 10;
  cursor: grab;
}

#talentModal .deck-center-wrapper:active {
  cursor: grabbing;
}

#talentModal .deck-center-wrapper .nexus-card-preview {
  width: 320px;
  height: 460px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.95), 0 0 50px rgba(53, 232, 255, 0.32);
  border-radius: 16px;
}

/* Side Deck Quick-View Panel — full height left column */
#talentModal .deck-preview-deck-panel {
  width: 280px;
  min-width: 240px;
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  border: none;
  border-right: 1.5px solid rgba(53, 232, 255, 0.2);
  border-radius: 0;
  background: rgba(2, 8, 18, 0.96);
  backdrop-filter: blur(14px);
  padding: 20px 14px 20px 16px;
  box-shadow: inset -12px 0 28px rgba(0, 0, 0, 0.5);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

#talentModal .deck-preview-deck-panel.drag-over {
  border-right-color: var(--nexus-cyan);
  background: rgba(53, 232, 255, 0.08);
  box-shadow: inset 0 0 30px rgba(53, 232, 255, 0.12);
}

#talentModal .deck-mini-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(53, 232, 255, 0.2);
  margin-bottom: 12px;
}

#talentModal .deck-mini-header-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#talentModal .deck-mini-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #c4ecf5;
  text-transform: uppercase;
}

#talentModal .deck-mini-drop-hint {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.48rem;
  color: rgba(53, 232, 255, 0.6);
  letter-spacing: 0.05em;
}

#talentModal .deck-mini-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--nexus-cyan);
  background: rgba(53, 232, 255, 0.12);
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid rgba(53, 232, 255, 0.3);
  text-shadow: 0 0 8px rgba(53, 232, 255, 0.5);
}

#talentModal .deck-mini-list {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}

#talentModal .deck-mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: grab;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  user-select: none;
}

#talentModal .deck-mini-row:hover {
  background: rgba(53, 232, 255, 0.1);
  border-color: rgba(53, 232, 255, 0.4);
  transform: translateX(2px);
}

#talentModal .deck-mini-row:active,
#talentModal .deck-mini-row.dragging {
  cursor: grabbing;
  opacity: 0.5;
}

#talentModal .deck-mini-row.active {
  background: rgba(53, 232, 255, 0.16);
  border-color: var(--nexus-cyan);
  box-shadow: 0 0 14px rgba(53, 232, 255, 0.3);
}

#talentModal .deck-mini-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#talentModal .deck-mini-drag-handle {
  font-size: 0.75rem;
  color: rgba(53, 232, 255, 0.4);
  letter-spacing: -2px;
}

#talentModal .deck-mini-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

#talentModal .deck-mini-count {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
}

#talentModal .deck-mini-empty {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  padding: 24px 10px;
  border: 1px dashed rgba(53, 232, 255, 0.2);
  border-radius: 8px;
}

/* Bottom Bar — centered at bottom of main area */
#talentModal .deck-preview-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 16px;
}

/* Counter — above carousel */
#talentModal .deck-preview-counter {
  padding: 8px 24px;
  border: 1px solid rgba(52, 245, 255, 0.3);
  border-radius: 10px;
  background: rgba(3, 13, 25, 0.85);
  backdrop-filter: blur(6px);
  color: var(--nexus-cyan);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(53, 232, 255, 0.55);
  align-self: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}

#talentModal .deck-hotkey-hints {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 12px 28px;
  border: 1px solid rgba(53, 232, 255, 0.18);
  border-radius: 12px;
  background: rgba(2, 10, 22, 0.65);
  backdrop-filter: blur(6px);
}

#talentModal .deck-hotkey-hint {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

#talentModal .deck-hotkey-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid rgba(53, 232, 255, 0.4);
  border-radius: 5px;
  background: rgba(53, 232, 255, 0.1);
  color: var(--nexus-cyan);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(53, 232, 255, 0.6);
}

@media (max-height: 600px), (max-width: 600px) {
  #talentModal .deck-preview-overlay {
    padding: 0;
  }
  #talentModal .deck-preview-main-area {
    padding: 12px 16px;
  }
  #talentModal .deck-hotkey-hints {
    padding: 8px 12px;
    gap: 12px;
  }
  #talentModal .deck-hotkey-hint {
    font-size: 0.58rem;
  }
  #talentModal .deck-preview-counter {
    font-size: 0.68rem;
    padding: 6px 14px;
  }
}

/* Responsive layout ------------------------------------------------------- */

@media (max-width: 1120px) {
  #talentModal .nexus-header { gap: 12px; }
  #talentModal .nexus-resource { min-width: 116px; }
  #talentModal .talent-tree-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  #talentModal .talent-legend-chip { padding-right: 6px; padding-left: 12px; }
  #talentModal .talent-actions { gap: 8px; }
  #talentModal .talent-buy-label { min-width: 118px; }
  #talentModal .btn-talent-reset { min-width: 124px; }
}

@media (max-width: 900px) {
  #talentModal.talent-modal-full { padding: 5px; }
  #talentModal .talent-modal-panel {
    width: calc(100vw - 10px);
    height: calc(100svh - 10px);
    max-height: calc(100svh - 10px);
    padding: 10px;
    gap: 8px;
    border-radius: 15px;
  }
  #talentModal .nexus-header { min-height: 58px; padding-right: 39px; }
  #talentModal .nexus-emblem { width: 42px; height: 42px; flex-basis: 42px; }
  #talentModal .nexus-copy p { display: none; }
  #talentModal .nexus-title-row h2 { font-size: 1rem; }
  #talentModal .nexus-resource { min-width: 96px; padding: 6px 8px; }
  #talentModal .nexus-resource-icon { width: 25px; height: 25px; flex-basis: 25px; }
  #talentModal .nexus-resource-copy small { font-size: 0.38rem; }
  #talentModal .nexus-resource-copy strong { font-size: 0.73rem; }
  #talentModal .talent-subnav { min-height: 45px; }
  #talentModal .talent-subnav-btn { min-height: 35px; padding: 4px 10px; }
  #talentModal .talent-subnav-icon { width: 24px; height: 24px; flex-basis: 24px; }
  #talentModal .talent-subnav-copy small { display: none; }
  #talentModal .nexus-main { overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(53, 232, 255, 0.24) transparent; }
  #talentModal #talentTab,
  #talentModal #accountTab { height: auto; min-height: 100%; overflow: visible; }
  #talentModal .talent-tree-header { min-height: 48px; }
  #talentModal .talent-tree-title p { display: none; }
  #talentModal .talent-branch-legend { display: none; }
  #talentModal .talent-tree-layout {
    flex: 0 0 auto;
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: 470px minmax(280px, auto);
    overflow: visible !important;
  }
  #talentModal .talent-detail-panel { min-height: 280px; }
  #talentModal .talent-message { min-height: 11px; }
  #talentModal .talent-actions {
    grid-template-columns: 1fr auto;
    margin-bottom: 2px;
  }
  #talentModal .talent-buy-group { flex-wrap: wrap; }
  #talentModal .talent-bonus-summary { display: none; }
  #talentModal .nexus-filter-bar { flex-wrap: wrap; }
  #talentModal .nexus-card-section { min-height: 430px; }
  #talentModal .nexus-cards-grid { min-height: 330px; }
}

@media (max-width: 620px) {
  #talentModal .nexus-header { align-items: flex-start; }
  #talentModal .nexus-emblem { display: none; }
  #talentModal .nexus-kicker { font-size: 0.42rem; }
  #talentModal .nexus-version { display: none; }
  #talentModal .nexus-wallet { gap: 4px; }
  #talentModal .nexus-resource { min-width: 0; padding: 5px 7px; }
  #talentModal .nexus-resource-icon { display: none; }
  #talentModal .talent-subnav-copy strong { font-size: 0.54rem; }
  #talentModal .talent-tree-layout { grid-template-rows: 430px minmax(270px, auto); }
  #talentModal .talent-stage-hint { display: none; }
  #talentModal .tt-node-caption { display: none; }
  #talentModal .talent-actions { grid-template-columns: 1fr; }
  #talentModal .btn-talent-reset { width: 100%; }
  #talentModal .market-signal { display: none; }
  #talentModal .market-hero p { font-size: 0.62rem; }
  #talentModal .filter-group { border-right: 0; }
  #talentModal .nexus-cards-grid { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); }
}

@media (max-height: 760px) and (min-width: 901px) {
  #talentModal .talent-modal-panel { gap: 7px; padding-top: 10px; padding-bottom: 10px; }
  #talentModal .nexus-header { min-height: 54px; }
  #talentModal .nexus-emblem { width: 42px; height: 42px; flex-basis: 42px; }
  #talentModal .nexus-copy p { display: none; }
  #talentModal .talent-subnav { min-height: 44px; }
  #talentModal .talent-subnav-btn { min-height: 34px; }
  #talentModal .talent-tree-header { min-height: 43px; padding-bottom: 5px; }
  #talentModal .talent-tree-title p { display: none; }
  #talentModal .talent-tree-layout { min-height: 300px; }
  #talentModal .talent-message { min-height: 9px; line-height: 9px; margin: 1px 0; }
  #talentModal .talent-actions { min-height: 43px; padding-top: 3px; padding-bottom: 3px; }
  #talentModal .btn-talent-buy,
  #talentModal .btn-talent-reset { min-height: 32px; }
  #talentModal .market-hero { min-height: 45px; }
  #talentModal .market-hero p { display: none; }
}

/* Motion and input preferences ------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  #talentModal,
  #talentModal *,
  #talentModal *::before,
  #talentModal *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
  #talentModal .tt-flow-particle { display: none; }
}

@media (hover: none) {
  #talentModal .tt-node:hover { transform: rotate(45deg); }
  #talentModal .tt-node--selected:hover { transform: rotate(45deg) scale(1.11) !important; }
  #talentModal .nexus-card-entry .tcg-card--nexus:hover { transform: none !important; }
}

/* Deck Builder Styles */
.deck-builder-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-top: 24px;
  height: calc(100% - 150px);
  min-height: 400px;
}
.deck-pool-section, .deck-current-section {
  display: flex;
  flex-direction: column;
  background: var(--nexus-surface-strong);
  border: 1px solid var(--nexus-line);
  border-radius: 6px;
  padding: 16px;
}
.deck-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--nexus-line);
}
.deck-section-header h4 {
  margin: 0;
  color: var(--nexus-text);
  font-size: 1.1rem;
}
.deck-section-header p {
  margin: 0;
  color: var(--nexus-muted);
  font-size: 0.85rem;
}
.deck-pool-grid {
  overflow-y: auto;
  flex-grow: 1;
  /* Redefine grid for smaller cards */
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  padding-right: 8px;
}
#talentModal .deck-pool-grid {
  padding-top: 20px;
}

/* Deck Builder — hover animation abgestimmt auf Kartenmarkt (subtil, hochwertig) */
.deck-pool-grid .tcg-card--nexus {
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 180ms ease, border-color 180ms ease;
}
#talentModal .deck-pool-grid .tcg-card--nexus:hover,
.deck-pool-grid .tcg-card--nexus:hover {
  z-index: 99;
  transform: translateY(-4px) scale(1.018) !important;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.48), 0 0 18px rgba(53, 232, 255, 0.12), inset 0 0 18px rgba(53, 232, 255, 0.045);
}

.deck-pool-grid::-webkit-scrollbar {
  width: 6px;
}
.deck-pool-grid::-webkit-scrollbar-thumb {
  background: var(--nexus-cyan);
  border-radius: 3px;
}
.deck-current-list {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 8px;
}
.deck-current-list::-webkit-scrollbar {
  width: 6px;
}
.deck-current-list::-webkit-scrollbar-thumb {
  background: var(--nexus-cyan);
  border-radius: 3px;
}
.deck-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.deck-card-row:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.3);
}
.deck-card-row-name {
  font-size: 0.9rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}
.deck-card-row-count {
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--nexus-cyan);
  background: rgba(53, 232, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 12px;
}
.deck-message {
  margin-top: 12px;
  font-size: 0.85rem;
  color: #ff5c5c;
  text-align: center;
  min-height: 1.2em;
}
.deck-status {
  font-family: 'Courier New', monospace;
  font-size: 1.5rem;
  color: var(--nexus-cyan);
  font-weight: bold;
}

/* --- Drag & Drop Styling --- */
[draggable="true"] {
  cursor: grab;
}

[draggable="true"]:active {
  cursor: grabbing;
}

.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.drag-over {
  outline: 2px dashed var(--nexus-cyan);
  background: rgba(0, 255, 255, 0.05);
}

/* Deck action buttons in card preview modal */
#talentModal .nexus-card-preview .tcg-deck-add-btn,
#talentModal .nexus-card-preview .tcg-deck-remove-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.6rem;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  border: 1.5px solid var(--nexus-line);
  text-transform: uppercase;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
}
#talentModal .nexus-card-preview .tcg-deck-add-btn {
  background: rgba(53, 232, 255, 0.12);
  color: var(--nexus-cyan);
  text-shadow: 0 0 8px rgba(53, 232, 255, 0.4);
  border-color: rgba(53, 232, 255, 0.3);
}
#talentModal .nexus-card-preview .tcg-deck-add-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
#talentModal .nexus-card-preview .tcg-deck-add-btn:hover:not(:disabled) {
  background: rgba(53, 232, 255, 0.25);
  border-color: var(--nexus-cyan);
}
#talentModal .nexus-card-preview .tcg-deck-remove-btn {
  background: rgba(255, 92, 92, 0.12);
  color: #ff5c5c;
  text-shadow: 0 0 8px rgba(255, 92, 92, 0.4);
  border-color: rgba(255, 92, 92, 0.3);
}
#talentModal .nexus-card-preview .tcg-deck-remove-btn:hover {
  background: rgba(255, 92, 92, 0.25);
  border-color: #ff5c5c;
}

/* Stack badge and action button vertically in the deck builder preview */
#talentModal .nexus-card-preview .tcg-footer {
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Deck Builder Card limit badge */
.tcg-deck-badge {
  font-size: 0.6rem;
  color: var(--nexus-cyan);
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.1em;
  text-shadow: 0 0 8px rgba(53, 232, 255, 0.6);
  border: 1px solid var(--nexus-line);
  background: rgba(53, 232, 255, 0.05);
  border-radius: 6px;
  padding: 4px 10px;
  display: inline-block;
  text-align: center;
  min-width: 70px;
  box-shadow: inset 0 0 5px rgba(53, 232, 255, 0.1);
}

/* Custom Scrollbar for Deck Builder */
.deck-pool-grid::-webkit-scrollbar,
.deck-current-list::-webkit-scrollbar {
  width: 6px;
}
.deck-pool-grid::-webkit-scrollbar-thumb,
.deck-current-list::-webkit-scrollbar-thumb {
  background: var(--nexus-cyan);
  border-radius: 3px;
  box-shadow: 0 0 6px rgba(53, 232, 255, 0.4);
}
.deck-pool-grid::-webkit-scrollbar-track,
.deck-current-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

/* Firefox custom scrollbars */
.deck-pool-grid,
.deck-current-list {
  scrollbar-width: thin;
  scrollbar-color: var(--nexus-cyan) rgba(0, 0, 0, 0.2);
}

/* Wide workstations -------------------------------------------------------
   Keep the regular/FHD geometry above unchanged, but let native QHD and UHD
   displays use their available area. These selectors deliberately match the
   specificity of the base Nexus rules; the former unscoped rules were unable
   to override the 1480px panel cap. */
@media (min-width: 2400px) and (min-height: 1200px) {
  #talentModal .talent-modal-panel {
    width: min(calc(100vw - 48px), 2200px);
    max-width: 2200px;
    height: min(calc(100svh - 48px), 1240px);
    max-height: calc(100svh - 48px);
    padding: 22px;
    gap: 14px;
  }

  #talentModal .nexus-header {
    min-height: 88px;
    gap: 30px;
  }

  #talentModal .nexus-emblem {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
  }

  #talentModal .nexus-kicker,
  #talentModal .talent-section-kicker {
    font-size: 0.62rem;
  }

  #talentModal .nexus-copy p,
  #talentModal .talent-tree-title p,
  #talentModal .market-hero p {
    font-size: 0.78rem;
  }

  #talentModal .nexus-wallet {
    gap: 10px;
  }

  #talentModal .nexus-resource {
    min-width: 148px;
    padding: 10px 15px 10px 11px;
  }

  #talentModal .nexus-resource-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  #talentModal .nexus-resource-copy small {
    font-size: 0.52rem;
  }

  #talentModal .nexus-resource-copy strong {
    font-size: 1rem;
  }

  #talentModal .talent-subnav {
    min-height: 60px;
    gap: 8px;
    padding: 6px;
  }

  #talentModal .talent-subnav-btn {
    min-height: 48px;
    padding: 6px 18px;
  }

  #talentModal .talent-subnav-icon {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  #talentModal .talent-subnav-copy strong {
    font-size: 0.74rem;
  }

  #talentModal .talent-subnav-copy small {
    font-size: 0.62rem;
  }

  #talentModal .talent-tree-header {
    min-height: 68px;
    padding-bottom: 10px;
  }

  #talentModal .talent-tree-title h3,
  #talentModal .market-hero h3 {
    font-size: 1.25rem;
  }

  #talentModal .talent-legend-chip {
    padding: 6px 10px 6px 16px;
    font-size: 0.52rem;
  }

  #talentModal .talent-tree-layout {
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 16px;
  }

  #talentModal .talent-stage-toolbar {
    min-height: 40px;
    flex-basis: 40px;
    padding: 0 15px;
  }

  #talentModal .talent-stage-status,
  #talentModal .talent-stage-hint {
    font-size: 0.53rem;
  }

  #talentModal .tt-detail-name {
    font-size: 0.96rem;
  }

  #talentModal .tt-detail-desc {
    font-size: 0.76rem;
  }

  #talentModal .effect-title,
  #talentModal .level-title {
    font-size: 0.56rem;
  }

  #talentModal .tt-detail-req {
    font-size: 0.64rem;
  }

  #talentModal .market-hero {
    min-height: 72px;
  }

  #talentModal .nexus-card-section {
    padding: 14px;
  }

  #talentModal .nexus-card-header {
    min-height: 36px;
    margin-bottom: 9px;
  }

  #talentModal .card-section-icon {
    width: 29px;
    height: 29px;
    font-size: 0.88rem;
  }

  #talentModal .card-section-title {
    font-size: 0.66rem;
  }

  #talentModal .market-card-count {
    font-size: 0.54rem;
  }

  #talentModal .nexus-filter-bar {
    min-height: 50px;
    margin-bottom: 10px;
    padding: 8px 10px;
  }

  #talentModal .filter-label,
  #talentModal .filter-status-btn {
    font-size: 0.52rem;
  }

  #talentModal .filter-rarity-btn {
    width: 28px;
    height: 28px;
  }

  #talentModal .filter-status-btn {
    min-height: 30px;
    padding: 5px 10px;
  }

  #talentModal .nexus-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    padding: 14px;
  }

  #talentModal .nexus-card-entry .tcg-card--nexus {
    min-height: 294px;
    padding: 12px;
    border-radius: 14px;
  }

  #talentModal .nexus-card-entry .tcg-card--nexus .tcg-cost {
    width: 32px;
    height: 32px;
    font-size: 0.96rem;
  }

  #talentModal .nexus-card-entry .tcg-card--nexus .tcg-id {
    font-size: 0.62rem;
  }

  #talentModal .nexus-card-entry .tcg-card--nexus .tcg-image {
    min-height: 105px;
    margin: 16px 4px 8px;
  }

  #talentModal .nexus-card-entry .tcg-card--nexus .tcg-image-icon {
    font-size: 3rem;
  }

  #talentModal .nexus-card-entry .tcg-card--nexus .tcg-type {
    font-size: 0.61rem;
  }

  #talentModal .nexus-card-entry .tcg-card--nexus .tcg-name {
    font-size: 0.8rem;
  }

  #talentModal .nexus-card-entry .tcg-card--nexus .tcg-desc {
    font-size: 0.64rem;
    line-height: 1.42;
  }

  #talentModal .nexus-card-entry .tcg-card--nexus .tcg-charges,
  #talentModal .nexus-card-entry .tcg-card--nexus .tcg-owned-badge {
    font-size: 0.62rem;
  }

  #talentModal .nexus-card-entry .tcg-card--nexus .tcg-footer {
    min-height: 46px;
  }

  #talentModal .nexus-card-entry .tcg-buy-btn {
    min-width: 112px;
    padding: 8px 11px;
    font-size: 0.62rem;
  }

  #talentModal .deck-builder-layout {
    height: calc(100% - 132px);
    min-height: 0;
    margin-top: 16px;
    grid-template-columns: minmax(0, 1.75fr) minmax(420px, 0.9fr);
    gap: 20px;
  }

  #talentModal .deck-pool-section,
  #talentModal .deck-current-section {
    min-height: 0;
    padding: 20px;
  }

  #talentModal .deck-section-header {
    min-height: 52px;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  #talentModal .deck-section-header h4 {
    font-size: 1rem;
  }

  #talentModal .deck-section-header p {
    font-size: 0.78rem;
  }

  #talentModal .deck-pool-grid,
  #talentModal .deck-current-list {
    max-height: none !important;
  }

  #talentModal .deck-pool-grid {
    align-content: start;
  }

  #talentModal .deck-pool-grid > .tcg-card--nexus {
    min-height: 320px;
    padding: 12px;
    border-radius: 14px;
  }

  #talentModal .deck-pool-grid > .tcg-card--nexus .tcg-cost {
    width: 32px;
    height: 32px;
    font-size: 0.96rem;
  }

  #talentModal .deck-pool-grid > .tcg-card--nexus .tcg-image {
    min-height: 112px;
    margin: 16px 4px 8px;
  }

  #talentModal .deck-pool-grid > .tcg-card--nexus .tcg-image-icon {
    font-size: 3rem;
  }

  #talentModal .deck-pool-grid > .tcg-card--nexus .tcg-type {
    font-size: 0.61rem;
  }

  #talentModal .deck-pool-grid > .tcg-card--nexus .tcg-name {
    font-size: 0.8rem;
  }

  #talentModal .deck-pool-grid > .tcg-card--nexus .tcg-desc {
    font-size: 0.64rem;
    line-height: 1.42;
  }

  #talentModal .deck-pool-grid > .tcg-card--nexus .tcg-charges,
  #talentModal .deck-pool-grid > .tcg-card--nexus .tcg-deck-badge {
    font-size: 0.62rem;
  }

  #talentModal .deck-card-row {
    min-height: 48px;
    padding: 8px 14px;
  }

  #talentModal .deck-card-row-name,
  #talentModal .deck-card-row-count,
  #talentModal .deck-message {
    font-size: 0.92rem;
  }

  /* casino.css is loaded after this sheet. The html prefix gives these
     workstation-only dimensions enough specificity without !important. */
  html #talentModal #casinoTab {
    gap: 14px;
  }

  html #talentModal .casino-hero {
    min-height: 84px;
    padding: 11px 18px;
  }

  html #talentModal .casino-kicker {
    font-size: 0.58rem;
  }

  html #talentModal .casino-hero h3 {
    font-size: 1.55rem;
  }

  html #talentModal .casino-hero p {
    font-size: 0.76rem;
  }

  html #talentModal .casino-hero-metrics > span {
    min-width: 124px;
    padding: 9px 13px;
  }

  html #talentModal .casino-hero-metrics strong {
    font-size: 0.9rem;
  }

  html #talentModal .casino-hero-metrics small {
    font-size: 0.49rem;
  }

  html #talentModal .casino-dashboard {
    grid-template-columns: minmax(280px, 0.7fr) minmax(900px, 1.85fr) minmax(320px, 0.82fr);
    gap: 14px;
  }

  html #talentModal .casino-side {
    padding: 17px;
    gap: 14px;
  }

  html #talentModal .casino-panel-index {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    font-size: 0.52rem;
  }

  html #talentModal .casino-panel-heading small {
    font-size: 0.5rem;
  }

  html #talentModal .casino-panel-heading h4 {
    font-size: 0.78rem;
  }

  html #talentModal .casino-balance-row {
    min-height: 68px;
    padding: 10px 12px;
  }

  html #talentModal .casino-balance-icon {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    font-size: 0.78rem;
  }

  html #talentModal .casino-balance-row small {
    font-size: 0.5rem;
  }

  html #talentModal .casino-balance-row strong {
    font-size: 1.15rem;
  }

  html #talentModal .casino-exchange-button {
    min-height: 56px;
    padding: 10px 11px;
  }

  html #talentModal .casino-exchange-button strong,
  html #talentModal .casino-security-note strong {
    font-size: 0.58rem;
  }

  html #talentModal .casino-exchange-button small,
  html #talentModal .casino-security-note small {
    font-size: 0.62rem;
  }

  html #talentModal .casino-feature-status dt {
    font-size: 0.46rem;
  }

  html #talentModal .casino-feature-status dd {
    font-size: 0.58rem;
  }

  html #talentModal .casino-machine {
    padding: 17px 20px 18px;
  }

  html #talentModal .casino-machine-status,
  html #talentModal .casino-spin-id {
    font-size: 0.5rem;
  }

  html #talentModal .casino-machine-crown h4 {
    font-size: 1rem;
  }

  html #talentModal .casino-reels {
    width: min(94%, 1100px);
    height: min(480px, calc(100% - 28px));
    min-height: 360px;
    gap: 12px;
  }

  html #talentModal .casino-reel-column {
    gap: 9px;
  }

  html #talentModal .casino-symbol-cell {
    padding: 7px 4px;
    border-radius: 10px;
  }

  html #talentModal .casino-symbol-cell .casino-reel-glyph {
    font-size: 3rem;
  }

  html #talentModal .casino-symbol-cell small {
    font-size: 0.56rem;
  }

  html #talentModal .casino-result {
    min-height: 62px;
    padding: 9px 14px;
  }

  html #talentModal .casino-result-kicker,
  html #talentModal .casino-win-breakdown li {
    font-size: 0.46rem;
  }

  html #talentModal .casino-result strong {
    font-size: 0.76rem;
  }

  html #talentModal .casino-result small {
    font-size: 0.64rem;
  }

  html #talentModal .casino-controls {
    min-height: 94px;
    gap: 14px;
  }

  html #talentModal .casino-bet-selector legend,
  html #talentModal .casino-autoplay-selector legend {
    font-size: 0.5rem;
  }

  html #talentModal .casino-bet,
  html #talentModal .casino-autoplay-options button {
    min-height: 48px;
    font-size: 0.64rem;
  }

  html #talentModal .casino-spin-button {
    width: 122px;
    height: 72px;
  }

  html #talentModal .casino-spin-copy small {
    font-size: 0.45rem;
  }

  html #talentModal .casino-spin-copy strong {
    font-size: 1.08rem;
  }

  html #talentModal table.casino-paytable th,
  html #talentModal table.casino-paytable td,
  html #talentModal .casino-paylines li {
    font-size: 0.48rem;
  }

  html #talentModal table.casino-paytable th,
  html #talentModal table.casino-paytable td {
    padding: 7px 5px;
  }

  html #talentModal .casino-card-drop small,
  html #talentModal .casino-card-drop > div:last-child > span {
    font-size: 0.48rem;
  }

  html #talentModal .casino-card-drop strong {
    font-size: 0.64rem;
  }

  html #talentModal .casino-card-drop p {
    font-size: 0.58rem;
  }
}

@media (min-width: 3200px) and (min-height: 1600px) {
  #talentModal .talent-modal-panel {
    width: min(calc(100vw - 96px), 3200px);
    max-width: 3200px;
    height: min(calc(100svh - 96px), 1800px);
    max-height: calc(100svh - 96px);
    padding: 28px;
    gap: 18px;
    border-radius: 26px;
  }

  #talentModal .nexus-header {
    min-height: 102px;
  }

  #talentModal .nexus-emblem {
    width: 72px;
    height: 72px;
    flex-basis: 72px;
  }

  #talentModal .nexus-title-row h2 {
    font-size: 2rem;
  }

  #talentModal .nexus-resource {
    min-width: 172px;
    padding: 12px 17px 12px 13px;
  }

  #talentModal .nexus-resource-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  #talentModal .talent-subnav {
    min-height: 68px;
    gap: 10px;
    padding: 7px;
  }

  #talentModal .talent-subnav-btn {
    min-height: 54px;
    padding: 7px 22px;
    gap: 13px;
  }

  #talentModal .talent-subnav-icon {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  #talentModal .talent-tree-header {
    min-height: 78px;
    padding-bottom: 13px;
  }

  #talentModal .talent-tree-layout {
    grid-template-columns: minmax(0, 1fr) 500px;
    gap: 20px;
  }

  #talentModal .talent-stage-toolbar {
    min-height: 46px;
    flex-basis: 46px;
    padding: 0 18px;
  }

  #talentModal .market-hero {
    min-height: 82px;
  }

  #talentModal .nexus-card-section {
    padding: 18px;
  }

  #talentModal .nexus-filter-bar {
    min-height: 56px;
    margin-bottom: 13px;
    padding: 10px 12px;
  }

  #talentModal .nexus-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    padding: 18px;
  }

  #talentModal .nexus-card-entry .tcg-card--nexus {
    min-height: 374px;
    padding: 15px;
    border-radius: 16px;
  }

  #talentModal .nexus-card-entry .tcg-card--nexus .tcg-image {
    min-height: 138px;
    margin-top: 20px;
  }

  #talentModal .nexus-card-entry .tcg-card--nexus .tcg-image-icon {
    font-size: 3.4rem;
  }

  #talentModal .nexus-card-entry .tcg-card--nexus .tcg-name {
    font-size: 0.86rem;
  }

  #talentModal .nexus-card-entry .tcg-card--nexus .tcg-desc {
    font-size: 0.68rem;
  }

  #talentModal .nexus-card-preview {
    width: min(390px, calc(100% - 16px));
    height: min(560px, calc(100% - 16px));
  }

  #talentModal .deck-builder-layout {
    grid-template-columns: minmax(0, 1.85fr) minmax(560px, 0.9fr);
    gap: 26px;
  }

  #talentModal .deck-pool-section,
  #talentModal .deck-current-section {
    padding: 24px;
  }

  #talentModal .deck-pool-grid > .tcg-card--nexus {
    min-height: 430px;
    padding: 15px;
    border-radius: 16px;
  }

  #talentModal .deck-pool-grid > .tcg-card--nexus .tcg-image {
    min-height: 150px;
    margin-top: 20px;
  }

  #talentModal .deck-pool-grid > .tcg-card--nexus .tcg-image-icon {
    font-size: 3.4rem;
  }

  #talentModal .deck-pool-grid > .tcg-card--nexus .tcg-name {
    font-size: 0.86rem;
  }

  #talentModal .deck-pool-grid > .tcg-card--nexus .tcg-desc {
    font-size: 0.68rem;
  }

  html #talentModal .casino-hero {
    min-height: 98px;
    padding: 13px 22px;
  }

  html #talentModal .casino-dashboard {
    grid-template-columns: minmax(480px, 0.74fr) minmax(1500px, 1.95fr) minmax(520px, 0.86fr);
    gap: 18px;
  }

  html #talentModal .casino-side {
    padding: 20px;
    gap: 17px;
  }

  html #talentModal .casino-reels {
    width: min(94%, 1320px);
    height: min(720px, calc(100% - 36px));
    min-height: 580px;
    gap: 16px;
  }

  html #talentModal .casino-reel-column {
    gap: 12px;
  }

  html #talentModal .casino-symbol-cell .casino-reel-glyph {
    font-size: 3.8rem;
  }

  html #talentModal .casino-symbol-cell small {
    font-size: 0.6rem;
  }

  html #talentModal .casino-controls {
    min-height: 108px;
  }

  html #talentModal .casino-bet,
  html #talentModal .casino-autoplay-options button {
    min-height: 54px;
  }

  html #talentModal .casino-spin-button {
    width: 138px;
    height: 82px;
  }
}

/* Unsaved Deck Changes Confirmation Dialog */
.unsaved-deck-dialog-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(1, 6, 14, 0.85);
  backdrop-filter: blur(14px) saturate(120%);
  opacity: 0;
  transition: opacity 200ms ease;
}

.unsaved-deck-dialog-overlay.visible {
  opacity: 1;
}

.unsaved-deck-dialog {
  width: min(440px, calc(100% - 32px));
  padding: 24px 28px;
  border: 1.5px solid rgba(53, 232, 255, 0.4);
  border-radius: 16px;
  background: rgba(3, 15, 30, 0.95);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(53, 232, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.unsaved-dialog-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.unsaved-dialog-icon {
  font-size: 1.5rem;
}

.unsaved-dialog-header h4 {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffb830;
  text-shadow: 0 0 10px rgba(255, 184, 48, 0.4);
  margin: 0;
}

.unsaved-dialog-body {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: #c4ecf5;
  line-height: 1.45;
  margin: 0;
}

.unsaved-dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.btn-unsaved-action {
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-save-close {
  background: linear-gradient(135deg, rgba(53, 232, 255, 0.25), rgba(0, 150, 200, 0.4));
  border: 1.5px solid var(--nexus-cyan);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(53, 232, 255, 0.3);
}

.btn-save-close:hover {
  background: linear-gradient(135deg, rgba(53, 232, 255, 0.4), rgba(0, 180, 230, 0.6));
  box-shadow: 0 0 26px rgba(53, 232, 255, 0.5);
  transform: translateY(-1px);
}

.btn-discard-close {
  background: rgba(255, 60, 60, 0.12);
  border: 1.5px solid rgba(255, 92, 92, 0.4);
  color: #ff9999;
}

.btn-discard-close:hover {
  background: rgba(255, 60, 60, 0.22);
  border-color: #ff5c5c;
  color: #ffffff;
  box-shadow: 0 0 18px rgba(255, 92, 92, 0.3);
  transform: translateY(-1px);
}

.btn-cancel-close {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  color: #9ab4c1;
}

.btn-cancel-close:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}
