/* The artwork is the preview. Editing fields sit on the renderer's exact boxes. */
#card {
  aspect-ratio: 1600 / 1900;
  padding: 0;
  isolation: isolate;
}
.card-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.card-art > svg {
  display: block;
  width: 100%;
  height: 100%;
}
#card > .card-rule,
#card > .card-kicker,
#card > .card-bottom {
  display: none;
}
#card #card-title {
  position: absolute;
  z-index: 2;
  margin: 0;
  padding: 5px;
  min-height: 0;
  border-radius: 3px;
  background: transparent;
  color: transparent;
  caret-color: var(--card-ink);
  line-height: 1.15;
  overflow: hidden;
  text-align: center;
}
#card #card-title::placeholder {
  color: transparent;
  font-size: inherit;
}
#card #card-title:hover {
  box-shadow: inset 0 0 0 1px
    color-mix(in srgb, var(--card-ink), transparent 65%);
}
#card #card-title:focus {
  color: var(--card-ink);
  background: var(--edit-paper, var(--paper));
  overflow: auto;
  outline: 2px solid #d78b50;
  outline-offset: 1px;
}
#card #card-title:focus::placeholder {
  color: var(--card-ink);
  opacity: 0.45;
  font-size: 16px;
}
#card #grid {
  position: absolute;
  z-index: 1;
  aspect-ratio: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}
#card .cell {
  background: transparent;
  border: 0;
  border-radius: 0;
  outline: 0;
  margin: 0;
}
#card .cell:not(.free):hover {
  background: transparent;
  box-shadow: inset 0 0 0 1px
    color-mix(in srgb, var(--card-ink), transparent 55%);
}
#card .cell:has(textarea:focus) {
  background: var(--edit-paper, var(--paper));
  box-shadow: inset 0 0 0 2px #d78b50;
}
#card .cell textarea {
  color: transparent;
  caret-color: var(--card-ink);
  font-family: var(--edit-font, Arial), sans-serif;
}
#card .cell textarea:focus {
  color: var(--card-ink);
}
#card .cell textarea::placeholder {
  color: var(--card-ink);
  opacity: 0.23;
}
#card .cell-number {
  display: none;
}
#card .free-inner {
  visibility: hidden;
}
#card.theme-neon {
  --paper: #101022;
  --edit-paper: #17172d;
  --card-ink: #f2efff;
  --edit-font: "Bingo Sans";
}
#card.theme-manga {
  --paper: #fff9e9;
  --edit-paper: #fffdf5;
  --card-ink: #201f24;
  --edit-font: "Bingo Sans";
}
#card.theme-afterhours {
  --paper: #4c233e;
  --edit-paper: #fff1dd;
  --card-ink: #492c42;
  --edit-font: "Bingo Sans";
}
#card.theme-blueprint {
  --paper: #2449d8;
  --edit-paper: #2449d8;
  --card-ink: #f8f9ff;
  --edit-font: "Bingo Sans";
}
#card.theme-neon #card-title {
  font-family: "Bingo Arcade", Arial, sans-serif;
  font-weight: 900;
  font-style: italic;
  text-align: left;
}
#card.theme-manga #card-title,
#card.theme-blueprint #card-title {
  font-family: "Bingo Display", Arial, sans-serif;
  font-weight: 900;
  text-align: left;
}
#card.theme-afterhours #card-title {
  font-family: "Bingo Serif", Georgia, serif;
  font-weight: 700;
  color: transparent;
  text-align: left;
}
#card.theme-afterhours #card-title:focus {
  color: #fff0d8;
  background: #3e203c;
}
.theme-trigger {
  width: 100%;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid #cbd2c1;
  border-radius: 8px;
  padding: 9px 11px;
  text-align: left;
  background: #fffdf7;
}
.theme-trigger:hover {
  border-color: #7b9271;
  background: #fafbf2;
}
.theme-trigger > .icon {
  margin-left: auto;
  width: 17px;
  transform: rotate(90deg);
}
.theme-trigger-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.theme-trigger-copy strong {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.theme-trigger-copy small {
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
}
.theme-trigger-swatch {
  display: block;
  width: 34px;
  height: 40px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid #0001;
  background-size: cover;
  background-position: center;
}
.swatch-ink {
  background-color: #f8f5ee;
  background-image:
    linear-gradient(90deg, transparent 48%, #28564450 49% 51%, transparent 52%),
    linear-gradient(transparent 48%, #28564450 49% 51%, transparent 52%);
  background-size: 12px 12px;
}
.swatch-sea {
  background-color: #e3f1f8;
  background-image:
    linear-gradient(90deg, transparent 48%, #6392ab70 49% 51%, transparent 52%),
    linear-gradient(transparent 48%, #6392ab70 49% 51%, transparent 52%);
  background-size: 12px 12px;
}
.swatch-rose {
  background-color: #fcf3f1;
  background-image:
    linear-gradient(90deg, transparent 48%, #b26c7f70 49% 51%, transparent 52%),
    linear-gradient(transparent 48%, #b26c7f70 49% 51%, transparent 52%);
  background-size: 12px 12px;
}
.swatch-neon {
  background-image: url("./theme-thumbnails/neon.webp");
}
.swatch-manga {
  background-image: url("./theme-thumbnails/manga.webp");
}
.swatch-afterhours {
  background-image: url("./theme-thumbnails/afterhours.webp");
}
.swatch-blueprint {
  background-image: url("./theme-thumbnails/blueprint.webp");
}
#theme-dialog {
  width: 760px;
  max-width: calc(100vw - 30px);
  max-height: calc(100dvh - 30px);
  overflow: auto;
  padding: 27px;
}
#theme-dialog .dialog-copy {
  max-width: 580px;
  margin-top: 13px;
}
.art-theme-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}
.theme-choice {
  text-align: left;
  padding: 0 0 7px;
  min-width: 0;
  border-radius: 8px;
}
.theme-thumbnail {
  display: block;
  position: relative;
  border: 2px solid transparent;
  border-radius: 7px;
  padding: 3px;
  background: #e3e5da;
  transition:
    border-color 0.15s,
    transform 0.15s;
}
.theme-thumbnail img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1600/1900;
  border-radius: 3px;
  object-fit: cover;
}
.theme-choice:hover .theme-thumbnail {
  transform: translateY(-2px);
  border-color: #a7b59d;
}
.theme-choice[aria-pressed="true"] .theme-thumbnail {
  border-color: #285644;
  background: #d9e5cd;
}
.theme-selected {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f9fff0;
  color: #234c36;
  box-shadow: 0 2px 7px #0002;
  visibility: hidden;
}
.theme-selected .icon {
  width: 16px;
}
.theme-choice[aria-pressed="true"] .theme-selected {
  visibility: visible;
}
.theme-choice strong,
.theme-choice small {
  display: block;
  padding: 0 3px;
}
.theme-choice strong {
  font-size: 12px;
  margin-top: 8px;
  font-weight: 700;
}
.theme-choice small {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 3px;
}
.classic-theme-options {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 19px;
}
.classic-theme-options .eyebrow {
  font-size: 9px;
}
.classic-theme-buttons {
  display: flex;
  gap: 9px;
  margin-top: 12px;
}
.classic-theme {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 43px;
  padding: 9px 14px;
  border: 1px solid #d5dacc;
  border-radius: 7px;
  font-size: 12px;
  background: #fffdf6;
}
.classic-theme[aria-pressed="true"] {
  border-color: #285644;
  box-shadow: inset 0 0 0 1px #285644;
}
.classic-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
}
.forest-dot {
  background: #285644;
}
.sea-dot {
  background: #6392ab;
}
.rose-dot {
  background: #b26c7f;
}
@media (max-width: 740px) {
  .theme-trigger {
    min-height: 46px;
    padding: 6px 8px;
    gap: 7px;
  }
  .theme-trigger-swatch {
    width: 24px;
    height: 31px;
  }
  .theme-trigger-copy strong {
    font-size: 10px;
  }
  .theme-trigger-copy small {
    font-size: 9px;
  }
  .theme-trigger > .icon {
    width: 13px;
  }
  #theme-dialog {
    padding: 21px;
  }
  #theme-dialog h2 {
    font-size: 29px;
  }
  #theme-dialog .dialog-copy {
    font-size: 12px;
    margin-bottom: 15px;
  }
  .art-theme-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
  }
  .theme-thumbnail img {
    max-height: 170px;
    object-fit: contain;
  }
  .theme-choice strong {
    font-size: 12px;
    margin-top: 5px;
  }
  .theme-choice small {
    font-size: 9px;
  }
  .classic-theme-options {
    margin-top: 15px;
    padding-top: 14px;
  }
  .classic-theme-buttons {
    gap: 6px;
  }
  .classic-theme {
    flex: 1;
    min-width: 0;
    justify-content: center;
    padding: 8px 7px;
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .theme-thumbnail {
    transition: none;
  }
}
