/* compact one-card-per-row deck editor */

.deck-editor-panel {
  align-items: start;
  padding-block: clamp(18px, 3vw, 34px);
}

.deck-editor-shell {
  width: min(100%, 920px);
  position: relative;
  z-index: 1;
  text-align: left;
}

.deck-editor-header {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  text-align: center;
}

.deck-editor-header .scene-title {
  font-size: clamp(1.7rem, 5vw, 2.6rem);
}

.deck-editor-rule {
  margin: 0;
  color: #bbb2a5;
  font-size: .74rem;
  line-height: 1.7;
}

.deck-editor-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 11px 14px;
  border: 1px solid rgba(231, 203, 153, .28);
  border-radius: 13px;
  background: rgba(20, 16, 12, .84);
}

.deck-editor-count-wrap {
  color: #d8d0c3;
  font-size: .75rem;
  font-weight: 850;
}

.deck-editor-count-wrap strong {
  color: var(--accent);
  font-size: 1.2rem;
}

.deck-editor-count-wrap strong.invalid {
  color: #ff9188;
}

.deck-editor-status {
  color: #d9cfbd;
  font-size: .7rem;
  font-weight: 800;
}

.deck-editor-status.complete {
  color: var(--accent);
}

.deck-editor-status.invalid {
  color: #ff9188;
}

.deck-editor-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-height: 500px;
  overflow: auto;
  border: 1px solid rgba(231, 203, 153, .22);
  border-radius: 12px;
  background: rgba(20, 16, 12, .72);
  scrollbar-width: thin;
}

.deck-editor-table-header,
.deck-editor-item {
  min-width: 660px;
  display: grid;
  grid-template-columns: 64px minmax(190px, 1fr) 110px 110px 118px;
  align-items: center;
  column-gap: 12px;
}

.deck-editor-table-header {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(231, 203, 153, .24);
  background: #211a14;
  color: #a99d8d;
  font-size: .64rem;
  font-weight: 950;
  letter-spacing: .08em;
}

.deck-editor-item {
  min-height: 52px;
  padding: 7px 12px;
  border-bottom: 1px solid rgba(231, 203, 153, .12);
  background: rgba(20, 16, 12, .36);
}

.deck-editor-item:last-child {
  border-bottom: 0;
}

.deck-editor-item:hover {
  background: rgba(255, 255, 255, .025);
}

.deck-editor-card-id {
  color: #9d9488;
  font-size: .72rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.deck-editor-name {
  min-width: 0;
  overflow: hidden;
  color: #fff0d6;
  font-size: .8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-editor-value {
  font-size: .78rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.deck-editor-attack {
  color: #ff9b93;
}

.deck-editor-defense {
  color: #8ab6ff;
}

.deck-editor-controls {
  display: grid;
  grid-template-columns: 32px 30px 32px;
  align-items: center;
  justify-content: end;
  gap: 4px;
}

.deck-count-button {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(222, 202, 166, .28);
  border-radius: 8px;
  background: #2a241e;
  color: #eee5d5;
  font: inherit;
  font-size: .95rem;
  font-weight: 950;
  cursor: pointer;
}

.deck-count-button:hover:not(:disabled),
.deck-count-button:focus-visible:not(:disabled) {
  border-color: var(--accent);
  outline: none;
  background: rgba(200, 255, 72, .08);
}

.deck-count-button:disabled {
  opacity: .28;
  cursor: default;
}

.deck-card-count {
  text-align: center;
  color: #fff3dc;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}

.deck-editor-actions {
  margin-top: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-content: stretch;
}

.deck-editor-actions .scene-primary-button,
.deck-editor-actions .scene-secondary-button {
  min-width: 0;
  width: 100%;
}

.deck-editor-actions .scene-primary-button:disabled {
  border-color: #4d4d45;
  background: #363730;
  color: #77786f;
  box-shadow: none;
  cursor: default;
  transform: none;
}

@media (max-width: 760px) {
  .deck-editor-panel {
    padding: 12px 8px 16px;
  }

  .deck-editor-list {
    max-height: 440px;
  }

  .deck-editor-table-header,
  .deck-editor-item {
    min-width: 560px;
    grid-template-columns: 52px minmax(160px, 1fr) 88px 88px 106px;
    column-gap: 8px;
  }

  .deck-editor-table-header {
    padding-inline: 9px;
  }

  .deck-editor-item {
    min-height: 48px;
    padding: 6px 9px;
  }

  .deck-editor-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .deck-editor-actions {
    grid-template-columns: 1fr;
  }
}
