.deckbox-dialog {
  width: min(1040px, calc(100% - 24px));
  max-height: 90vh;
  overflow: auto;
  margin: auto;
  padding: 26px;
  border: 1px solid #72b9eb;
  border-radius: 14px;
  background: #081629;
  color: #e5effb;
  box-shadow: 0 25px 100px #0009;
}
.deckbox-dialog::backdrop {
  background: #020610d9;
}
.deckbox-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.deckbox-preview-actions button {
  padding: 10px 12px;
  font-size: 12px;
}
.deckbox-stock-picker {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid #5b8dbb55;
}
.deckbox-stock-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px 12px;
  margin-bottom: 10px;
}
.deckbox-stock-heading h3 {
  margin: 0;
  color: #dff2ff;
  font-size: 15px;
}
.deckbox-stock-heading span,
.deckbox-stock-help {
  margin: 0;
  color: #a7c6e5;
  font-size: 12px;
}
.deckbox-stock-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 420px);
}
.deckbox-stock-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1122 / 1402;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease;
}
.deckbox-stock-card:hover,
.deckbox-stock-card.is-selected {
  transform: translateY(-3px);
  filter: drop-shadow(0 0 8px #76c8ff88);
}
.deckbox-stock-card:focus-visible {
  outline: 2px solid #b1e2ff;
  outline-offset: 3px;
}
.deckbox-stock-art {
  position: absolute;
  inset: 8% 11% 23%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
}
.deckbox-stock-art > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.deckbox-stock-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}
.deckbox-stock-check {
  position: absolute;
  top: 5%;
  right: 5%;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 2px solid #dff5ff;
  border-radius: 50%;
  background: #0a3156;
  color: #dff5ff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  transform: scale(0.75);
  transition: opacity 160ms ease, transform 160ms ease;
}
.deckbox-stock-card.is-selected .deckbox-stock-check {
  opacity: 1;
  transform: scale(1);
}
.deckbox-stock-name {
  position: absolute;
  right: 9%;
  bottom: 8%;
  left: 9%;
  overflow: hidden;
  color: #dff2ff;
  font-size: clamp(9px, 1.1vw, 12px);
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 4px #06152a;
}
.deckbox-select-image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(100%, 320px);
  min-height: 54px;
  margin: 12px 0 0;
  padding: 10px 18px;
  overflow: hidden;
  border: 1px solid #76c8ff;
  border-radius: 7px;
  background: linear-gradient(180deg, #17416a, #0b2440);
  color: #dff2ff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  transition: background 160ms ease, box-shadow 160ms ease;
}
.deckbox-select-image:hover {
  background: linear-gradient(180deg, #20598b, #10345a);
  box-shadow: 0 0 14px #76c8ff44;
}
.deckbox-upload-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid #a8ddff;
  border-radius: 50%;
  color: #dff2ff !important;
  font-size: 20px !important;
  font-weight: 700;
  line-height: 1;
}
.deckbox-select-image input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  min-width: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}
.deckbox-select-image:focus-within {
  outline: 2px solid #b1e2ff;
  outline-offset: 3px;
}
.deckbox-stock-help {
  margin-top: 6px;
}
.deckbox-image-options > #deckbox-threshold-toggle {
  min-height: 40px;
  margin-top: 4px;
}
.deckbox-image-options #deckbox-threshold-controls[hidden] {
  display: none;
}
.deckbox-color-selectors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.deckbox-color-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #5b8dbb55;
  border-radius: 8px;
  background: #0b1b2e;
}
.deckbox-color-field > span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.deckbox-color-swatch {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 1px solid #d5e8f8;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #071222;
}
.deckbox-color-field select {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid #648eb7;
  border-radius: 6px;
  background: #081629;
  color: #e5effb;
}
.deckbox-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}
.deckbox-dialog-head h2 {
  margin: 8px 0;
}
.deckbox-dialog-head button {
  min-width: 44px;
  min-height: 44px;
}
.deckbox-designer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
}
.deckbox-preview {
  border: 1px solid #5b8dbb44;
  background: radial-gradient(ellipse at center, #183755, #071222);
  border-radius: 10px;
}
.deckbox-preview canvas {
  width: 100%;
  height: auto;
  display: block;
  touch-action: none;
  cursor: grab;
}
.deckbox-drop {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border: 2px dashed #648eb7;
  border-radius: 10px;
  background: #10243c;
}
.deckbox-drop span {
  font-size: 13px;
  color: #a7c6e5;
}
.deckbox-drop input {
  max-width: 100%;
  min-width: 0;
}
.deckbox-drop.is-dragging {
  border-color: #b1e2ff;
  background: #193e64;
}
.deckbox-image-options {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #345b80;
  border-radius: 10px;
  background: #0d1d31;
}
.deckbox-image-options[hidden] {
  display: none;
}
.deckbox-image-options .subtle {
  margin-top: 0;
}
.deckbox-invert {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #d2e8fb;
  font-size: 14px;
}
.deckbox-invert input {
  accent-color: #76c8ff;
}
.deckbox-controls .field {
  margin: 18px 0;
}
.deckbox-stock-picker .field {
  margin: 14px 0;
}
.deckbox-controls input[type="range"] {
  width: 100%;
}
.deckbox-controls output {
  font-size: 12px;
  color: #a7c6e5;
}
.deckbox-body-reference {
  margin-top: 22px;
}
.deckbox-body-reference canvas {
  display: block;
  width: min(100%, 280px);
  height: auto;
}
.deckbox-body-reference summary {
  cursor: pointer;
  padding: 12px 0;
  color: #a7d9ff;
}
.deckbox-controls #deckbox-confirm {
  width: 100%;
}
.deckbox-export-button {
  width: 100%;
  margin-top: 10px;
  border-color: #648eb7;
}
.cart-artwork {
  width: 82px;
  height: 66px;
  object-fit: contain;
  display: block;
  padding: 6px;
  background: #19324f;
  border-radius: 4px;
}
.cart-artwork-name {
  overflow-wrap: anywhere;
}
.cart-color-details {
  color: #a7c6e5;
  font-size: 13px;
}
@media (max-width: 720px) {
  .deckbox-designer-grid {
    grid-template-columns: 1fr;
  }
  .deckbox-dialog {
    padding: 18px;
  }
}
@media (max-width: 380px) {
  .deckbox-color-selectors {
    grid-template-columns: 1fr;
  }
  .deckbox-stock-grid {
    gap: 6px;
  }
  .deckbox-stock-check {
    width: 20px;
    height: 20px;
  }
}
