/* ==========================================================================
   Card Creator — custom cards and an artwork fit check (js/card-creator.js)
   Controls on the left, the card and the two board views on the right.
   ========================================================================== */

.cc-lede {
  max-width: 46rem;
  margin: 0.75rem 0 0;
  color: var(--ac-text-2);
}

.cc-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 2rem;
  align-items: start;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

/* ─── Controls ───────────────────────────────────────────────────────── */

.cc-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cc-group {
  margin: 0;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--ac-line);
  border-radius: var(--ac-radius);
  background: linear-gradient(180deg, rgba(28, 36, 51, 0.65), rgba(16, 21, 31, 0.65));
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 0;
}
.cc-group legend {
  padding: 0 0.4rem;
  font: 600 0.75rem/1 var(--ac-font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ac-gold-1);
}

.cc-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.cc-row .cc-input { flex: 1 1 10rem; }

.cc-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font: 500 0.8rem/1.2 var(--ac-font-body);
  color: var(--ac-text-2);
}
.cc-field[hidden] { display: none; }

.cc-input {
  width: 100%;
  min-height: 38px;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--ac-line);
  border-radius: 8px;
  background: rgba(6, 8, 13, 0.6);
  color: var(--ac-text);
  font: 400 0.95rem/1.35 var(--ac-font-body);
}
textarea.cc-input { resize: vertical; min-height: 6.5rem; }
.cc-input:focus { outline: 2px solid var(--ac-gold-2); outline-offset: 1px; border-color: transparent; }

.cc-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr));
  gap: 0.6rem;
}

.cc-hint, .cc-small {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--ac-text-3);
}
#cc-art-warn { color: var(--ac-gold-1); }

.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 1rem;
  border: 1px solid var(--ac-line-strong);
  border-radius: 8px;
  background: rgba(6, 8, 13, 0.4);
  color: var(--ac-text);
  font: 600 0.85rem/1 var(--ac-font-body);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.cc-btn:hover { background: rgba(232, 162, 69, 0.14); color: var(--ac-gold-1); }
.cc-btn:focus-visible { outline: 2px solid var(--ac-gold-1); outline-offset: 2px; }
.cc-btn--gold {
  border-color: transparent;
  background: var(--ac-grad-button);
  color: #2a1505;
}
.cc-btn--gold:hover { background: var(--ac-grad-button); color: #2a1505; filter: brightness(1.06); }

.cc-drop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  padding: 0.9rem;
  border: 1px dashed var(--ac-line-strong);
  border-radius: 8px;
  background: rgba(6, 8, 13, 0.35);
}
.cc-drop.is-over { background: rgba(232, 162, 69, 0.14); border-style: solid; }
.cc-drop__hint { font-size: 0.8rem; color: var(--ac-text-3); }
.cc-drop__name {
  flex-basis: 100%;
  font-size: 0.85rem;
  color: var(--ac-text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-sliders { display: grid; gap: 0.45rem; }
.cc-sliders label {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  align-items: center;
  font-size: 0.8rem;
  color: var(--ac-text-2);
}
.cc-sliders input { accent-color: var(--ac-gold-2); width: 100%; }

/* Segmented radio control */
.cc-seg {
  display: inline-flex;
  flex-wrap: nowrap;
  padding: 3px;
  border: 1px solid var(--ac-line);
  border-radius: 999px;
  background: rgba(6, 8, 13, 0.55);
  align-self: flex-start;
}
.cc-seg label { position: relative; }
.cc-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cc-seg span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 0.62rem;
  border-radius: 999px;
  font: 600 0.72rem/1 var(--ac-font-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ac-text-2);
}
.cc-seg input:checked + span { color: #2a1505; background: var(--ac-grad-button); }
.cc-seg input:focus-visible + span { outline: 2px solid var(--ac-gold-1); outline-offset: 1px; }
.cc-seg--sm span { min-height: 26px; padding: 0 0.6rem; font-size: 0.68rem; }

.cc-icons { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.cc-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 34px;
  border: 1px solid var(--ac-line);
  border-radius: 6px;
  background: rgba(6, 8, 13, 0.4);
  cursor: pointer;
}
.cc-icon-btn:hover { background: rgba(232, 162, 69, 0.14); }
.cc-icon-btn img { height: 22px; width: auto; }

.cc-help summary { cursor: pointer; font-size: 0.85rem; color: var(--ac-gold-1); }
.cc-help ul { margin: 0.5rem 0 0; padding-left: 1.1rem; font-size: 0.8rem; line-height: 1.5; color: var(--ac-text-2); }
.cc-help code { font-size: 0.78rem; color: var(--ac-text); }

/* ─── Preview ────────────────────────────────────────────────────────── */

.cc-stage {
  position: sticky;
  top: calc(var(--ac-nav-h) + 1rem);
  display: grid;
  grid-template-columns: minmax(260px, 430px) minmax(200px, 260px);
  gap: 1.5rem;
  justify-content: center;
  align-items: start;
}
.cc-card, .cc-fig { margin: 0; }
.cc-card canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 1575;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.55));
}
.cc-side { display: flex; flex-direction: column; gap: 1.25rem; }
.cc-fig canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 8px;
}
#cc-token-canvas {
  background: radial-gradient(circle, rgba(74, 98, 74, 0.55), rgba(16, 21, 31, 0) 70%);
}
.cc-fig figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--ac-text-2);
}
.cc-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

/* ─── Notes ──────────────────────────────────────────────────────────── */

.cc-notes { padding-bottom: 4rem; }
.cc-notes__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem 2rem;
  margin: 1rem 0;
}
.cc-notes__grid p { margin: 0; color: var(--ac-text-2); line-height: 1.6; }

@media (max-width: 1100px) {
  .cc-stage { grid-template-columns: minmax(240px, 380px) minmax(180px, 220px); }
}
@media (max-width: 900px) {
  .cc-layout { grid-template-columns: 1fr; }
  .cc-stage { position: static; order: -1; grid-template-columns: 1fr; justify-items: center; }
  .cc-card { width: min(100%, 380px); }
  .cc-side { display: grid; grid-template-columns: 1fr 1fr; width: 100%; max-width: 520px; }
  .cc-side .cc-fig { min-width: 0; }
  .cc-seg--sm { flex-wrap: wrap; }
}
