/* Meta deck-builder panel — based on upstream native-deck-builder, restyled for Meta glows */

.native-deck-builder-workspace {
  position: fixed;
  top: 0;
  right: calc(24% - 8px);
  left: 0;
  height: 100vh;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  z-index: 900;
  transform: translateX(calc(100% - 8px));
  transition: transform 220ms ease;
  display: flex;
  align-items: stretch;
  overflow: visible;
}
.native-deck-builder-workspace.open {
  transform: translateX(0);
}
.native-deck-builder-inner {
  position: relative;
  width: 100%;
  height: 100%;
  margin-left: 0;
  background: rgb(214, 218, 224);
  border-left: 1px solid rgba(40, 57, 124, 0.08);
  box-shadow: inset 8px 0 18px rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
}
.native-deck-builder-edge-toggle {
  display: none;
}
.native-deck-builder-edge-toggle:hover {
  background: linear-gradient(to bottom, rgba(194,199,207,0.92), rgba(176,181,189,0.92));
}
.native-deck-builder-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1vw;
  padding: 0.85vh 0.8vw;
  border-bottom: 1px solid rgba(0, 0, 0, 0.035);
  background: rgb(207, 211, 218);
}
.native-deck-builder-brand {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  min-width: 0;
}
.native-deck-builder-brand-icon {
  width: 28px;
  height: 28px;
  margin-top: 0.15vh;
  border-radius: 6px;
  flex-shrink: 0;
  image-rendering: pixelated;
  box-shadow: 0 0 0 1px rgba(176, 16, 24, 0.55);
}
.native-deck-builder-subtitle {
  font-size: 1.55vh;
  opacity: 0.62;
  margin-top: 0.2vh;
}
.native-deck-builder-actions {
  display: flex;
  gap: 0.35vw;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.native-deck-builder-actions button {
  color: white;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 1.65vh;
  padding: 0.6vh 0.7vw;
  opacity: 0.92;
}
#closeNativeDeckBuilderButton {
  background: linear-gradient(to bottom, rgba(188, 90, 113, 0.864), rgba(158, 60, 83, 0.864));
}
.native-deck-builder-inline-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6vh 0.7vw;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 1.65vh;
  opacity: 0.92;
}
.native-deck-builder-targetbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8vw;
  padding: 0.65vh 0.8vw;
  background: rgb(198, 203, 211);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.native-deck-builder-target-label {
  font-size: 1.65vh;
}
.native-deck-builder-load-status {
  display: inline-flex;
  align-items: center;
  min-height: 1.9em;
  padding: 0.12em 0.55em;
  border-radius: 999px;
  font-size: 1.18vh;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: transparent;
  background: transparent;
  border: 1px solid transparent;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}
.native-deck-builder-load-status.visible {
  color: #165f22;
  background: rgba(214, 245, 220, 0.92);
  border-color: rgba(48, 133, 69, 0.28);
}
.native-deck-builder-load-status.error {
  color: #8a1f1f;
  background: rgba(251, 225, 225, 0.95);
  border-color: rgba(163, 45, 45, 0.26);
}
.native-deck-builder-target-controls {
  display: flex;
  gap: 0.35vw;
  align-items: center;
  flex-wrap: nowrap;
}
.native-target-button {
  border: none;
  cursor: pointer;
  padding: 0.55vh 0.75vw;
  font-size: 1.6vh;
  background: rgba(170,170,170,0.95);
  color: white;
}
#nativeDeckBuilderTargetMain.native-target-selected {
  background: linear-gradient(to bottom, rgba(90, 110, 188, 0.864), rgba(60, 80, 158, 0.864));
  font-weight: bold;
}
#nativeDeckBuilderTargetAlt.native-target-selected {
  background: linear-gradient(to bottom, rgba(188, 90, 113, 0.864), rgba(158, 60, 83, 0.864));
  font-weight: bold;
}
.native-deck-builder-play-button {
  margin-left: auto;
  border: 1px solid rgba(255, 210, 60, 0.85);
  cursor: pointer;
  padding: 0.65vh 1.1vw;
  font-size: 1.55vh;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #1a1400;
  background: linear-gradient(180deg, #ffe566 0%, #f0c832 55%, #d4a017 100%);
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255, 220, 80, 0.35), 0 0 16px rgba(240, 200, 50, 0.35);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}
.native-deck-builder-play-button.is-ready {
  animation: load-deck-pulse 1.8s ease-in-out infinite;
}
.native-deck-builder-play-button.is-dirty {
  box-shadow: 0 0 0 1px rgba(255, 220, 80, 0.55), 0 0 22px rgba(240, 200, 50, 0.65);
}
.native-deck-builder-play-button:not(:disabled):hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 0 0 1px rgba(255, 230, 120, 0.7), 0 0 26px rgba(240, 200, 50, 0.75);
}
.native-deck-builder-play-button:disabled {
  background: rgba(170, 170, 170, 0.95);
  color: #666;
  cursor: default;
  border-color: transparent;
  box-shadow: none;
  animation: none;
}
.native-deck-builder-play-button--drawer {
  width: 100%;
  margin: 0;
  padding: 0.85vh 0.8vw;
  font-size: 1.65vh;
}
.catalog-drawer-footer {
  flex-shrink: 0;
  margin-top: 0.5rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(100, 200, 255, 0.22);
}
@keyframes load-deck-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(255, 220, 80, 0.35), 0 0 14px rgba(240, 200, 50, 0.3);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(255, 230, 120, 0.7), 0 0 26px rgba(240, 200, 50, 0.7);
  }
}
.builder-import-resolve .native-deck-builder-play-button {
  margin-left: 0;
  flex-shrink: 0;
  white-space: nowrap;
}
.native-deck-builder-body {
  display: flex;
  gap: 0.55vw;
  flex: 1;
  min-height: 0;
  padding: 0.65vh 0.65vw 0.75vh 0.65vw;
}
.native-deck-builder-pane {
  flex: 1 1 0;
  min-width: 0;
  background: rgb(243,245,247);
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.8vh 0.75vw;
  min-height: 0;
}
.native-deck-builder-pane-main {
  flex-grow: 1.55;
  flex-shrink: 1;
  flex-basis: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.native-deck-builder-pane-main-header {
  padding: 0.8vh 0.75vw;
}
.native-deck-builder-pane-side {
  flex-grow: 1.15;
  flex-shrink: 1;
  flex-basis: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65vh;
  min-width: 0;
}
.native-deck-builder-section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45vw;
  margin-bottom: 0.5vh;
}
.native-deck-builder-section-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.4vw;
  min-width: 0;
}
.native-deck-builder-section-title {
  font-size: 1.85vh;
  font-weight: 700;
  margin-bottom: 0;
}
.native-deck-builder-section-button {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 1.65vh;
  padding: 0.6vh 0.7vw;
  border: none;
  cursor: pointer;
  color: #fff;
}
.native-deck-builder-deck-status {
  font-size: 1.65vh;
  color: rgba(120, 120, 120, 0.9);
  white-space: nowrap;
  transition: color 0.6s ease;
}
.native-deck-builder-deck-status.flash {
  color: rgba(30, 30, 30, 1);
  transition: none;
}
.native-deck-builder-validation-dot {
  width: 0.9vh;
  height: 0.9vh;
  min-width: 0.9vh;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.34);
  background: #c63b3b;
}
.native-deck-builder-validation-dot.valid {
  background: #2d9b48;
}
.native-deck-builder-validation-dot.invalid {
  background: #c63b3b;
}
.native-deck-builder-search-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4vw;
  margin-bottom: 0.6vh;
}
.native-deck-builder-search-input {
  flex: 1 1 auto;
  min-width: 4vw;
  font-size: 1.7vh;
  padding: 0.65vh 0.7vw;
  border: 1px solid rgba(0,0,0,0.1);
  background: rgb(255,255,255);
}
.native-deck-builder-search-select {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 1.6vh;
  padding: 0.6vh 0.5vw;
  border: 1px solid rgba(0,0,0,0.1);
  background: rgb(255,255,255);
}
.native-deck-builder-search-status {
  font-size: 1.5vh;
  opacity: 0.75;
  margin-bottom: 0.6vh;
}
#nativeDeckBuilderSearchButton {
  flex: 0 0 auto;
  white-space: nowrap;
  min-width: fit-content;
  font-size: 1.65vh;
  padding: 0.6vh 0.7vw;
  border: none;
  cursor: pointer;
  color: white;
  background: linear-gradient(to bottom, #95c6b4, #72ab97);
}
#nativeDeckBuilderLoadCurrentTarget {
  font-size: 1.35vh;
  padding: 0.48vh 0.58vw;
  border: none;
  cursor: pointer;
  color: white;
}
#nativeDeckBuilderLoadCurrentTarget.load-success {
  box-shadow: 0 0 0 2px rgba(55, 160, 84, 0.22), 0 10px 24px rgba(34, 125, 63, 0.22);
  filter: saturate(1.08) brightness(1.03);
}
.native-deck-builder-results-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.native-deck-builder-search-results {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.65rem;
  width: 100%;
  min-height: 0;
  padding: 0;
  overflow: visible;
  align-content: start;
}
.native-deck-builder-search-results > .catalog-loading,
.native-deck-builder-search-results > .catalog-empty {
  grid-column: 1 / -1;
}
.native-deck-builder-search-results::-webkit-scrollbar {
  width: 6px;
}
.native-deck-builder-search-results::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}
.native-deck-builder-search-results::-webkit-scrollbar-track {
  background: transparent;
}
.native-deck-builder-result {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  width: 100%;
  min-width: 80px;
  border: 1px solid rgba(0,0,0,0.06);
  background: rgb(248,249,250);
  padding: 0.25vw;
  border-radius: 0.3vw;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
  gap: 0.3vh;
}
.native-deck-builder-result:hover {
  background: rgba(233,237,244,0.94);
  border-color: rgba(65, 91, 168, 0.28);
  box-shadow: 0 6px 18px rgba(38, 49, 84, 0.18);
  transform: translateY(-2px);
}
.native-deck-builder-result-image {
  width: 100%;
  aspect-ratio: 63 / 88;
  object-fit: cover;
  border-radius: 0.2vw;
  display: block;
}
.native-deck-builder-result-text {
  display: flex;
  flex-direction: column;
  gap: 0.1vh;
  font-size: 1.3vh;
  color: inherit;
  padding: 0 0.1vw 0.15vw;
  overflow: hidden;
}
.native-deck-builder-result-text strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  font-size: 1.35vh;
}
.native-deck-builder-result-text span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  opacity: 0.7;
}
.native-deck-builder-summary,
.native-deck-builder-cards {
  font-size: 1.75vh;
}
.native-deck-builder-summary {
  padding: 0.2vh 0;
}
.native-deck-builder-cards {
  flex: 1;
  overflow: auto;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 0;
  padding: 0.7vh;
  background: rgb(238,240,243);
}
.native-deck-builder-deck-row {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 0.55vw;
  min-height: 6.6vh;
  padding: 0.75vh 0.55vw;
  margin-bottom: 0.45vh;
  border: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
  isolation: isolate;
  background: rgb(255,255,255);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.native-deck-builder-deck-row:hover {
  transform: translateY(-1px);
  border-color: rgba(65, 91, 168, 0.22);
  box-shadow: 0 12px 28px rgba(38, 49, 84, 0.12);
}
.native-deck-builder-deck-art {
  position: absolute;
  inset: 0;
  left: auto;
  width: 58%;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center 16%;
  opacity: 0.62;
  transform: translateX(30%) scale(1.08);
  transform-origin: center right;
  pointer-events: none;
  z-index: 0;
}
.native-deck-builder-deck-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(244,247,250,0.985) 0%, rgba(244,247,250,0.955) 40%, rgba(244,247,250,0.82) 66%, rgba(244,247,250,0.42) 84%, rgba(244,247,250,0.14) 100%);
  pointer-events: none;
  z-index: 0;
}
.native-deck-builder-deck-buttons {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
}
.native-deck-builder-deck-btn {
  width: 1.4vw;
  height: 1.4vw;
  min-width: 18px;
  min-height: 18px;
  border: none;
  cursor: pointer;
  color: white;
  font-size: 1.6vh;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.native-deck-builder-deck-plus {
  background: linear-gradient(to bottom, rgba(80, 160, 100, 0.9), rgba(55, 130, 75, 0.9));
}
.native-deck-builder-deck-minus {
  background: linear-gradient(to bottom, rgba(188, 90, 113, 0.9), rgba(158, 60, 83, 0.9));
}
.native-deck-builder-deck-text {
  position: relative;
  z-index: 1;
  min-width: 0;
  font-size: 1.75vh;
  font-weight: 600;
  color: rgba(27, 33, 39, 0.96);
  text-shadow: 0 1px 0 rgba(255,255,255,0.22);
}
.native-deck-builder-deck-type {
  opacity: 0.72;
  font-weight: 500;
}
.native-deck-builder-card-preview-scrim {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  cursor: pointer;
}
.native-deck-builder-card-preview-scrim[hidden] {
  display: none;
}
.native-deck-builder-card-preview-image {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Custom card modal */
.native-deck-builder-modal {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 40, 60, 0.45);
  backdrop-filter: blur(2px);
}
.native-deck-builder-modal[hidden] {
  display: none;
}
.native-deck-builder-modal-box {
  background: #f0f2f7;
  border-radius: 0.7vw;
  border: 1px solid rgba(40, 57, 124, 0.14);
  box-shadow: 0 4px 24px rgba(20, 30, 80, 0.22);
  padding: 2vh 1.8vw;
  min-width: 22vw;
  max-width: 30vw;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.1vh;
}
.native-deck-builder-modal-title {
  font-size: 2vh;
  font-weight: 700;
  color: #1a2560;
}
.native-deck-builder-modal-body {
  display: flex;
  gap: 1.2vw;
  align-items: flex-start;
}
.native-deck-builder-modal-fields {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 0.85vh;
}
.native-deck-builder-modal-preview {
  flex: 0 0 auto;
  width: 8.5vw;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
}
.native-deck-builder-modal-preview-image {
  width: 100%;
  height: auto;
  border-radius: 0.3vw;
  object-fit: contain;
}
.native-deck-builder-modal-preview-placeholder {
  width: 100%;
  height: 100%;
  min-height: 10vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35vh;
  color: #8898bb;
  background: rgba(40, 57, 124, 0.06);
  border: 1px dashed rgba(40, 57, 124, 0.2);
  border-radius: 0.3vw;
  text-align: center;
}
.native-deck-builder-modal-label {
  display: flex;
  flex-direction: column;
  gap: 0.25vh;
  font-size: 1.5vh;
  color: #3b4a7a;
}
.native-deck-builder-modal-input {
  font-size: 1.6vh;
  padding: 0.55vh 0.55vw;
  border: 1px solid rgba(40, 57, 124, 0.22);
  border-radius: 0.35vw;
  background: #fff;
  color: #1a2560;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.native-deck-builder-modal-error {
  font-size: 1.4vh;
  color: #c0392b;
  min-height: 1.8vh;
}
.native-deck-builder-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6vw;
}
.native-deck-builder-modal-actions button {
  font-size: 1.65vh;
  padding: 0.6vh 0.9vw;
  border: none;
  cursor: pointer;
  color: white;
}

body.dark-mode-1 .native-deck-builder-inner {
  background: rgba(20, 24, 29, 0.94);
  border-left-color: rgba(120, 144, 214, 0.16);
  box-shadow: inset 8px 0 18px rgba(255,255,255,0.02);
  color: #eef3ff;
}
body.dark-mode-1 .native-deck-builder-modal-box {
  background: rgba(20, 24, 38, 0.98);
  border-color: rgba(120, 144, 214, 0.2);
  color: #eef3ff;
}
body.dark-mode-1 .native-deck-builder-modal-title {
  color: #c5d0ff;
}
body.dark-mode-1 .native-deck-builder-modal-label {
  color: #a0b0e0;
}
body.dark-mode-1 .native-deck-builder-modal-input {
  background: rgba(40, 50, 80, 0.7);
  border-color: rgba(120, 144, 214, 0.25);
  color: #eef3ff;
}
body.dark-mode-1 .native-deck-builder-modal-preview-placeholder {
  color: #5a6a9a;
  background: rgba(40, 57, 124, 0.12);
  border-color: rgba(120, 144, 214, 0.2);
}
body.dark-mode-1 .native-deck-builder-header,
body.dark-mode-1 .native-deck-builder-targetbar,
body.dark-mode-1 .native-deck-builder-pane {
  background: rgba(31, 36, 43, 0.9);
  border-color: rgba(126, 145, 199, 0.14);
  color: #eef3ff;
}
body.dark-mode-1 .native-deck-builder-section-title,
body.dark-mode-1 .native-deck-builder-summary,
body.dark-mode-1 .native-deck-builder-target-label,
body.dark-mode-1 .native-deck-builder-search-status,
body.dark-mode-1 .native-deck-builder-deck-text,
body.dark-mode-1 .native-deck-builder-result-text {
  color: #eef3ff;
  text-shadow: none;
}
body.dark-mode-1 .native-deck-builder-search-input,
body.dark-mode-1 .native-deck-builder-search-select {
  background: rgba(15, 19, 24, 0.92);
  border-color: rgba(115, 132, 182, 0.22);
  color: #f4f7ff;
}
body.dark-mode-1 .native-deck-builder-search-input::placeholder {
  color: rgba(218, 226, 248, 0.5);
}
body.dark-mode-1 .native-deck-builder-search-status {
  opacity: 0.88;
}
body.dark-mode-1 .native-deck-builder-result {
  background: rgba(16, 21, 27, 0.9);
  border-color: rgba(119, 137, 191, 0.18);
  color: #eef3ff;
}
body.dark-mode-1 .native-deck-builder-result:hover {
  background: rgba(28, 36, 48, 0.96);
  border-color: rgba(121, 151, 236, 0.34);
  box-shadow: 0 10px 24px rgba(5, 10, 22, 0.35);
}
body.dark-mode-1 .native-deck-builder-cards {
  background: rgba(11, 15, 20, 0.55);
  border-color: rgba(116, 132, 179, 0.14);
}
body.dark-mode-1 .native-deck-builder-deck-row {
  background: rgba(17, 23, 30, 0.7);
  border-color: rgba(117, 132, 181, 0.14);
}
body.dark-mode-1 .native-deck-builder-deck-row:hover {
  border-color: rgba(121, 151, 236, 0.28);
  box-shadow: 0 12px 28px rgba(4, 8, 20, 0.34);
}
body.dark-mode-1 .native-deck-builder-deck-overlay {
  background: linear-gradient(to right, rgba(11, 14, 18, 0.97) 0%, rgba(11, 14, 18, 0.92) 40%, rgba(11, 14, 18, 0.7) 66%, rgba(11, 14, 18, 0.26) 84%, rgba(11, 14, 18, 0.08) 100%);
}
body.dark-mode-1 .native-deck-builder-deck-type {
  color: rgba(214, 224, 247, 0.72);
}
body.dark-mode-1 .native-deck-builder-deck-status {
  color: rgba(170, 180, 210, 0.7);
}
body.dark-mode-1 .native-deck-builder-deck-status.flash {
  color: rgba(240, 245, 255, 1);
}
body.dark-mode-1 .native-deck-builder-load-status.visible {
  color: #dff7e5;
  background: rgba(28, 90, 49, 0.95);
  border-color: rgba(89, 177, 109, 0.35);
}
body.dark-mode-1 .native-deck-builder-load-status.error {
  color: #ffdcdc;
  background: rgba(106, 31, 31, 0.95);
  border-color: rgba(209, 102, 102, 0.28);
}
body.dark-mode-1 .native-deck-builder-validation-dot {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
}
body.dark-mode-1 .native-deck-builder-edge-toggle {
  background: linear-gradient(to bottom, rgba(55, 63, 78, 0.96), rgba(39, 46, 58, 0.96));
  border-color: rgba(117, 132, 181, 0.22);
  color: #d7e2ff;
}
body.dark-mode-1 .native-deck-builder-edge-toggle:hover {
  background: linear-gradient(to bottom, rgba(66, 75, 92, 0.98), rgba(46, 54, 68, 0.98));
}


/* --- Meta overrides: style the INNER panel; keep workspace shell transparent --- */
.native-deck-builder-workspace {
  /* Overlay the LEFT board only (stops before right 24% sidebox). Below sidebox z-index. */
  pointer-events: none;
}
.native-deck-builder-workspace.open {
  pointer-events: auto;
}
.native-deck-builder-workspace:not(.open) .native-deck-builder-inner {
  visibility: hidden;
}
.native-deck-builder-inner {
  pointer-events: auto;
  border: 1px solid rgba(176, 16, 24, 0.42);
  box-shadow: 0 0 18px rgba(176, 16, 24, 0.18), 0 8px 24px rgba(0, 0, 0, 0.45);
  background: linear-gradient(160deg, rgba(18, 14, 16, 0.97), rgba(10, 10, 12, 0.98));
  color: #f0ecec;
}
.native-deck-builder-header,
.native-deck-builder-targetbar {
  border-bottom: 1px solid rgba(176, 16, 24, 0.28);
  background: rgba(14, 12, 14, 0.94);
}
.native-deck-builder-subtitle {
  color: rgba(180, 210, 235, 0.85);
}
.native-deck-builder-edge-toggle {
  display: none; /* open/close via Deck Builder / Load Deck / tab switches */
}
#nativeDeckBuilderTargetMain.native-target-selected {
  box-shadow: 0 0 10px rgba(0, 123, 255, 0.55);
}
#nativeDeckBuilderTargetAlt.native-target-selected {
  box-shadow: 0 0 10px rgba(255, 85, 100, 0.55);
}
.native-deck-builder-result:hover,
.native-deck-builder-card-row:hover {
  box-shadow: 0 0 12px rgba(100, 200, 255, 0.35);
}
.native-deck-builder-validation-dot.valid {
  box-shadow: 0 0 8px rgba(45, 155, 72, 0.7);
}
.native-deck-builder-validation-dot.invalid {
  box-shadow: 0 0 8px rgba(198, 59, 59, 0.7);
}

/* --- Catalog-mirrored layout: tabs + gallery + deck drawer --- */
.native-deck-builder-body.catalog-main {
  flex-direction: column;
  gap: 0;
  padding: 0;
  min-height: 0;
}
.catalog-tabs-bar {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  padding: 0.35rem 0.65rem 0;
  border-bottom: 1px solid rgba(100, 200, 255, 0.22);
  flex-shrink: 0;
  background: rgba(10, 14, 22, 0.95);
}
.catalog-tabs-scroll {
  display: flex;
  align-items: stretch;
  gap: 0.2rem;
  overflow-x: auto;
  min-width: 0;
  flex: 1;
  scrollbar-width: none;
}
.catalog-tabs-scroll::-webkit-scrollbar { height: 0; }
.catalog-tab {
  border: none;
  background: transparent;
  color: rgba(220, 235, 255, 0.78);
  padding: 0.55rem 0.8rem;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  font-size: 1.45vh;
  cursor: pointer;
}
.catalog-tab:hover,
.catalog-tab.active {
  color: #fff;
}
.catalog-tab.active {
  border-bottom-color: rgba(100, 200, 255, 0.95);
  font-weight: 600;
  text-shadow: 0 0 8px rgba(100, 200, 255, 0.45);
}
.catalog-tab.pinned { font-weight: 600; }
.catalog-more-dropdown { flex-shrink: 0; }
.catalog-more summary {
  list-style: none;
  cursor: pointer;
  padding: 0.55rem 0.8rem;
  color: rgba(220, 235, 255, 0.85);
  font-size: 1.45vh;
}
.catalog-more summary::-webkit-details-marker { display: none; }
.catalog-more-menu {
  position: absolute;
  right: 0.5rem;
  z-index: 80;
  max-height: min(50vh, 360px);
  overflow: auto;
  background: rgba(12, 16, 26, 0.98);
  border: 1px solid rgba(100, 200, 255, 0.35);
  border-radius: 8px;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.catalog-more-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: #e8f4ff;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  font-size: 1.4vh;
}
.catalog-more-item:hover,
.catalog-more-item.active {
  background: rgba(100, 200, 255, 0.15);
}
.official-catalog-toolbar,
.custom-catalog-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid rgba(100, 200, 255, 0.15);
  background: rgba(8, 12, 20, 0.88);
  flex-shrink: 0;
}
.official-catalog-toolbar[hidden],
.custom-catalog-toolbar[hidden] {
  display: none !important;
}
.official-mode-slider {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.official-mode-label {
  border: none;
  background: transparent;
  color: rgba(220, 235, 255, 0.5);
  font-size: 1.35vh;
  font-weight: 600;
  cursor: pointer;
}
.official-mode-label.active {
  color: #7dd3fc;
  text-shadow: 0 0 8px rgba(125, 211, 252, 0.5);
}
.official-mode-range {
  width: 52px;
  accent-color: #7dd3fc;
}
.official-set-select,
.official-search,
.custom-catalog-toolbar {
  min-width: 0;
}
.official-set-select {
  max-width: 220px;
  background: rgba(20, 28, 42, 0.95);
  color: #e8f4ff;
  border: 1px solid rgba(100, 200, 255, 0.3);
  border-radius: 6px;
  padding: 0.35rem 0.45rem;
}
.official-search {
  display: flex;
  gap: 0.35rem;
  flex: 1;
  min-width: 180px;
}
.catalog-gallery-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}
.catalog-gallery-pane--full .catalog-gallery {
  flex: 1 1 100%;
}
.catalog-gallery {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.catalog-gallery-toolbar {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  padding: 0.5rem 0.75rem;
  flex-shrink: 0;
}
.catalog-gallery-status {
  font-size: 1.3vh;
  opacity: 0.75;
  white-space: nowrap;
}
.catalog-gallery-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.65rem 0.75rem 0.9rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 200, 255, 0.45) rgba(255, 255, 255, 0.04);
}
.catalog-gallery-scroll::-webkit-scrollbar {
  width: 8px;
}
.catalog-gallery-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}
.catalog-gallery-scroll::-webkit-scrollbar-thumb {
  background: rgba(100, 200, 255, 0.45);
  border-radius: 8px;
}
.catalog-gallery-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 200, 255, 0.7);
}
.catalog-card-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.65rem;
  width: 100%;
  align-content: start;
}
.catalog-thumb {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border: 1px solid rgba(100, 200, 255, 0.18);
  border-radius: 10px;
  background: rgba(16, 22, 34, 0.92);
  color: inherit;
  padding: 0.35rem;
  cursor: grab;
  text-align: left;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: element;
  touch-action: none;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.catalog-thumb:active {
  cursor: grabbing;
}
.catalog-thumb.is-dragging {
  opacity: 0.55;
}
.catalog-thumb img,
.catalog-thumb .catalog-thumb-meta,
.catalog-thumb .catalog-thumb-placeholder {
  pointer-events: none;
  -webkit-user-drag: none;
}
.catalog-thumb:hover {
  transform: translateY(-2px);
  border-color: rgba(100, 200, 255, 0.55);
  box-shadow: 0 0 14px rgba(100, 200, 255, 0.28);
}
.catalog-thumb img,
.catalog-thumb .catalog-thumb-placeholder {
  width: 100%;
  aspect-ratio: 63 / 88;
  object-fit: cover;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}
.catalog-thumb-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-size: 1.1vh;
  padding: 0.35rem;
  text-align: center;
}
.catalog-thumb-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.catalog-thumb-meta strong,
.catalog-thumb-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.catalog-thumb-meta small {
  opacity: 0.65;
  font-size: 1.15vh;
}
.catalog-loading,
.catalog-empty {
  padding: 1.2rem;
  opacity: 0.8;
  font-size: 1.45vh;
}
.catalog-empty.text-danger { color: #fca5a5; opacity: 1; }
.catalog-drawer.split {
  width: min(34%, 340px);
  flex-shrink: 0;
  border-left: 1px solid rgba(100, 200, 255, 0.22);
  background: rgba(8, 12, 20, 0.96);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.catalog-drawer-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 0.7rem;
  overflow: hidden;
}
.catalog-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.catalog-count {
  text-align: center;
  padding: 0.55rem;
  border-radius: 10px;
  background: rgba(100, 200, 255, 0.1);
  border: 1px solid rgba(100, 200, 255, 0.22);
  margin-bottom: 0.45rem;
}
.catalog-count-number {
  font-size: 1.7rem;
  font-weight: 700;
  color: #7dd3fc;
  text-shadow: 0 0 10px rgba(125, 211, 252, 0.35);
}
.catalog-count-breakdown {
  text-align: center;
  font-size: 1.25vh;
  opacity: 0.75;
  margin-bottom: 0.55rem;
}
.catalog-deck-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 200, 255, 0.45) rgba(255, 255, 255, 0.04);
}
.catalog-deck-list::-webkit-scrollbar {
  width: 8px;
}
.catalog-deck-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}
.catalog-deck-list::-webkit-scrollbar-thumb {
  background: rgba(100, 200, 255, 0.45);
  border-radius: 8px;
}
.catalog-deck-list::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 200, 255, 0.7);
}
.catalog-deck-list.is-empty,
.catalog-deck-list.is-drop-target {
  outline: 2px dashed rgba(100, 200, 255, 0.45);
  outline-offset: -4px;
  border-radius: 10px;
}
.catalog-deck-list.is-drop-target,
.catalog-drawer.is-drop-target {
  background: rgba(100, 200, 255, 0.08);
}
.catalog-drawer.is-drop-target {
  outline: 2px dashed rgba(100, 200, 255, 0.55);
  outline-offset: -6px;
}
.catalog-deck-list.is-empty {
  justify-content: center;
}
.catalog-deck-empty {
  text-align: center;
  opacity: 0.65;
  font-size: 1.35vh;
  padding: 1rem;
}
.catalog-deck-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem;
  border-radius: 8px;
  background: rgba(100, 200, 255, 0.08);
  border: 1px solid rgba(100, 200, 255, 0.12);
}
.catalog-deck-item img,
.catalog-deck-item .catalog-thumb-placeholder {
  width: 42px;
  height: 58px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.catalog-deck-item-info {
  flex: 1;
  min-width: 0;
  font-size: 1.3vh;
}
.catalog-deck-item-info .name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.catalog-qty {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}
.catalog-qty button {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 6px;
  border: 1px solid rgba(100, 200, 255, 0.35);
  background: rgba(20, 28, 42, 0.95);
  color: #e8f4ff;
  cursor: pointer;
}
.catalog-qty span {
  min-width: 1.2rem;
  text-align: center;
  font-weight: 600;
}
.native-deck-builder-inner .native-deck-builder-search-input {
  background: rgba(20, 28, 42, 0.95);
  color: #e8f4ff;
  border: 1px solid rgba(100, 200, 255, 0.3);
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
  min-width: 0;
  flex: 1;
}
.native-deck-builder-cards {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Paste / Recent / sample Decks / shortcode import into builder */
.builder-import-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  align-items: center;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid rgba(100, 200, 255, 0.22);
  background: rgba(10, 14, 22, 0.92);
  flex-shrink: 0;
}
.builder-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.builder-import-actions button,
.builder-import-resolve button {
  border-radius: 8px;
  border: 1px solid rgba(100, 200, 255, 0.35);
  padding: 0.35rem 0.65rem;
  font-size: 1.3vh;
  font-weight: 600;
  cursor: pointer;
  color: #e8f4ff;
  background: rgba(28, 36, 52, 0.95);
}
.builder-import-resolve {
  display: flex;
  flex: 1;
  min-width: 220px;
  gap: 0.35rem;
  align-items: center;
}
.builder-import-menu-wrap {
  position: relative;
}
.builder-import-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 40;
  min-width: 260px;
  max-width: min(420px, 70vw);
  max-height: 48vh;
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid rgba(100, 200, 255, 0.4);
  background: linear-gradient(160deg, rgba(16, 22, 34, 0.98), rgba(8, 12, 20, 0.99));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 14px rgba(100, 200, 255, 0.12);
  padding: 0.3rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 200, 255, 0.45) rgba(255, 255, 255, 0.04);
}
.builder-import-menu::-webkit-scrollbar {
  width: 8px;
}
.builder-import-menu::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}
.builder-import-menu::-webkit-scrollbar-thumb {
  background: rgba(100, 200, 255, 0.4);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.builder-import-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 200, 255, 0.65);
  background-clip: padding-box;
}
.builder-import-menu--decks {
  min-width: 280px;
}
.builder-import-year-block {
  border-bottom: 1px solid rgba(100, 200, 255, 0.1);
}
.builder-import-year-block:last-child {
  border-bottom: none;
}
.builder-import-menu-item,
.builder-import-year {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: left;
  border: none;
  background: transparent;
  color: #e8f4ff;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  font-size: 1.25vh;
  cursor: pointer;
}
.builder-import-menu-item:hover,
.builder-import-year:hover,
.builder-import-year.is-open {
  background: rgba(100, 200, 255, 0.14);
  color: #fff;
}
.builder-import-year-chevron {
  color: rgba(100, 200, 255, 0.85);
  transition: transform 120ms ease;
  font-size: 1.1em;
  line-height: 1;
}
.builder-import-year.is-open .builder-import-year-chevron {
  transform: rotate(90deg);
}
.builder-import-year-sub {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.15rem 0.25rem 0.45rem 0.65rem;
  margin: 0 0.2rem 0.35rem;
  border-left: 2px solid rgba(100, 200, 255, 0.35);
  background: rgba(100, 200, 255, 0.05);
  border-radius: 0 8px 8px 0;
}
.builder-import-year-sub[hidden] {
  display: none !important;
}
.builder-import-year-sub .builder-import-menu-item {
  font-size: 1.2vh;
  padding: 0.35rem 0.5rem;
  opacity: 0.92;
}
.builder-import-menu-empty {
  padding: 0.6rem;
  opacity: 0.7;
  font-size: 1.25vh;
}

