/* ============================================================
   CREATE BUILD — create-build.styles.css
   Two-column layout, slot cards, key item, stats panel,
   mod preview, selection modal
   Inherits CSS variables from builds.styles.css
   ============================================================ */

/* ─── Header Spacer ─────────────────────────────────────────── */
.header-spacer {
  min-width: 90px;
  flex-shrink: 0;
}

/* ─── Page Title ────────────────────────────────────────────── */
.create-page-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-primary);
  text-shadow: 0 0 20px rgba(9, 153, 178, 0.5);
  text-align: center;
  margin: 0 0 0.75rem;
}

.version-badge {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  vertical-align: middle;
  opacity: 0.7;
}

/* ─── Build Name Input ──────────────────────────────────────── */
.build-name-input {
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 0 auto 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.build-name-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.build-name-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(9, 153, 178, 0.15);
}

/* ─── Two-Column Layout ─────────────────────────────────────── */
.create-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  align-items: start;
  gap: 2rem;
  max-width: 1280px;
  margin: 2rem auto 4rem;
  padding: 0 2rem;
}

/* ─── Equipment Panel (left column) ────────────────────────── */
.equipment-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.slot-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

.section-note {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--accent-primary);
  opacity: 0.8;
}

.slot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ─── Standard Slot Card ────────────────────────────────────── */
.slot-card {
  background: var(--bg-card);
  border: 1px solid var(--accent-primary);
  box-shadow: 0 0 8px rgba(9, 153, 178, 0.18);
  border-radius: var(--radius-card);
  width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── Key Item — gold border when a key item is equipped ────── */
.slot-card--key-item {
  border-color: #d97706 !important;
  box-shadow: 0 0 12px rgba(217, 119, 6, 0.35) !important;
}

.slot-card--key-item .slot-label {
  color: #fbbf24;
}

/* ─── Slot Header ───────────────────────────────────────────── */
.slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem 0.4rem;
  border-bottom: 1px solid var(--border);
}

.slot-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-primary);
}

.slot-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0 0.15rem;
  line-height: 1;
  transition: color var(--transition);
}

.slot-clear-btn:hover { color: #ef4444; }

/* ─── Item Image Area ───────────────────────────────────────── */
.slot-item-area {
  width: 100%;
  aspect-ratio: 16 / 9;
  cursor: pointer;
  background: var(--bg-surface);
  overflow: hidden;
  transition: background var(--transition);
  position: relative;
}

.slot-item-area:hover { background: var(--bg-card-hover); }
.slot-item-area:hover .slot-placeholder-text { color: var(--accent-primary); }

.slot-item-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.slot-item-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.slot-item-placeholder-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  display: block;
  transition: opacity var(--transition);
}

.slot-item-area:hover .slot-item-placeholder-img { opacity: 0.75; }

.slot-placeholder-icon {
  font-size: 1.8rem;
  opacity: 0.3;
}

.slot-placeholder-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.slot-item-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0.4rem 0.75rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.3rem 0.75rem 0;
}

/* ─── Mod Area ──────────────────────────────────────────────── */
.slot-mod-area {
  margin-top: auto;
  padding: 0.45rem 0.75rem;
  border-top: 1px solid var(--border);
  cursor: pointer;
  min-height: 34px;
  display: flex;
  align-items: center;
  transition: background var(--transition);
}

.slot-mod-area:not(.slot-mod-locked):hover {
  background: rgba(9, 153, 178, 0.07);
}

.slot-mod-locked {
  cursor: default;
  opacity: 0.4;
  pointer-events: none;
}

.slot-mod-empty {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.slot-mod-placeholder-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  opacity: 0.55;
  flex-shrink: 0;
}

.slot-mod-area:not(.slot-mod-locked):hover .slot-mod-placeholder-img {
  opacity: 0.85;
}

.slot-mod-add {
  font-size: 0.74rem;
  color: var(--accent-primary);
  font-weight: 600;
}

.slot-mod-placeholder {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.slot-mod-content {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
}

.slot-mod-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

.slot-mod-icon { font-size: 1rem; flex-shrink: 0; }

.slot-mod-name {
  font-size: 0.74rem;
  color: var(--text-label);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-clear-mod { margin-left: auto; flex-shrink: 0; }

/* ─── Build Footer ──────────────────────────────────────────── */
.build-footer {
  display: flex;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.btn-footer {
  padding: 0.55rem 1.4rem;
  border-radius: var(--radius-btn);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), box-shadow var(--transition),
              border-color var(--transition), color var(--transition);
}

.btn-copy {
  background: rgba(9, 153, 178, 0.12);
  border-color: var(--accent-primary);
  color: var(--accent-bright);
}

.btn-copy:hover {
  background: rgba(9, 153, 178, 0.22);
  box-shadow: 0 0 14px rgba(9, 153, 178, 0.3);
}

.btn-clear {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}

.btn-clear:hover {
  border-color: #ef4444;
  color: #ef4444;
}

/* ─── Stats Panel (right column) ────────────────────────────── */
.stats-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.1rem 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 80px; /* below the sticky header */
}

.stats-title {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-primary);
  text-shadow: 0 0 12px rgba(9, 153, 178, 0.4);
}

.stats-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

.stats-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stats-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stats-empty-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Key item in stats */
.stats-keyitem-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #c084fc;
}

.stats-keyitem-effect {
  font-size: 0.8rem;
  color: var(--text-label);
  line-height: 1.6;
}

/* Set bonus blocks */
.stats-set-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stats-set-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stats-set-count {
  font-weight: 500;
  color: var(--accent-primary);
}

.stats-set-bonus {
  display: flex;
  gap: 0.5rem;
  font-size: 0.77rem;
  line-height: 1.5;
}

.stats-set-bonus-pc {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 28px;
}

.stats-set-bonus-text { color: var(--text-label); }

/* Unlocked tiers — fully visible */
.stats-set-bonus-active .stats-set-bonus-pc   { color: var(--accent-bright); }
.stats-set-bonus-active .stats-set-bonus-text  { color: var(--text-primary); }

/* Locked tiers — dimmed and crossed style */
.stats-set-bonus-locked { opacity: 0.35; }

/* ─── Stats: Deviation Block ────────────────────────────────── */
.stats-dev-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #c084fc;
}

.stats-dev-block {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.stats-dev-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-primary);
}

.stats-dev-text {
  font-size: 0.78rem;
  color: var(--text-label);
  line-height: 1.5;
}

/* ─── Stats: Cradle Override Block ──────────────────────────── */
.stats-cradle-perk {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.stats-cradle-perk:last-child { border-bottom: none; }

.stats-cradle-perk-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-bright);
}

.stats-cradle-perk-effect {
  font-size: 0.75rem;
  color: var(--text-label);
  line-height: 1.5;
}

/* ─── Modal Overlay ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  z-index: 200;
  overflow-y: auto;
  padding: 2rem 1rem 4rem;
  backdrop-filter: blur(4px);
}

/* ─── Modal Box ─────────────────────────────────────────────── */
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--accent-primary);
  box-shadow: 0 0 40px rgba(9, 153, 178, 0.22);
  border-radius: 16px;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-surface);
  border-radius: 16px 16px 0 0;
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-primary);
  letter-spacing: 0.04em;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem 0.3rem;
  line-height: 1;
  transition: color var(--transition);
}

.modal-close:hover { color: var(--text-primary); }

.modal-search-wrap {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 52px;
  z-index: 10;
  background: var(--bg-surface);
}

.modal-search-input {
  width: 100%;
  padding: 0.55rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.modal-search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(9, 153, 178, 0.12);
}

/* ─── Mod Preview Panel ─────────────────────────────────────── */
/* ─── Hover Tooltip (replaces in-flow preview panel) ───────── */
.modal-preview {
  position: fixed;
  z-index: 400;
  max-width: 300px;
  background: #0d1a24;
  border: 1px solid var(--accent-primary);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.65), 0 0 12px rgba(9, 153, 178, 0.2);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  pointer-events: none; /* never blocks mouse events */
}

.modal-preview-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-bright);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
  margin-bottom: 0.1rem;
}

.modal-preview-attrs {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.preview-attr {
  font-size: 0.78rem;
  line-height: 1.5;
}

.preview-attr-name {
  font-weight: 600;
  color: var(--accent-primary);
}

.preview-attr-value { color: #fbbf24; }

.preview-keyword {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fbbf24;
  line-height: 1.5;
  padding-left: 0.6rem;
  border-left: 2px solid #d97706;
  margin-bottom: 0.15rem;
}

.preview-single-desc {
  font-size: 0.78rem;
  color: var(--text-label);
  line-height: 1.6;
  padding-left: 0.6rem;
  border-left: 2px solid var(--border);
}

/* ─── Modal Item Grid ───────────────────────────────────────── */
.modal-grid {
  padding: 1.25rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.modal-grid--wide {
  grid-template-columns: repeat(4, 1fr);
}

.modal-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem 0;
  font-size: 0.9rem;
  line-height: 1.7;
}

.modal-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), transform var(--transition),
              box-shadow var(--transition);
}

.modal-item:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(9, 153, 178, 0.2);
}

/* Key item badge inside modal card */
.modal-item-ki-badge {
  position: absolute;
  top: 0.3rem;
  left: 0.3rem;
  z-index: 2;
  background: rgba(217, 119, 6, 0.9);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  pointer-events: none;
  text-transform: uppercase;
}

/* Key item modal cards get a subtle gold tint */
.modal-item--key-item {
  border-color: rgba(217, 119, 6, 0.5);
}

.modal-item--key-item:hover {
  border-color: #d97706;
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.25);
}

/* Blocked key items (another key item already equipped) */
.modal-item--ki-blocked {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

/* Weapon type section header — spans full grid width */
.modal-weapon-type-header {
  grid-column: 1 / -1;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b7280;
  padding: 0.6rem 0.25rem 0.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 0.25rem;
}

/* Key item conflict notice — spans full grid width */
.modal-ki-notice {
  grid-column: 1 / -1;
  background: rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(217, 119, 6, 0.4);
  border-radius: 8px;
  color: #fbbf24;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.6rem 0.9rem;
  line-height: 1.5;
  margin-bottom: 0.25rem;
}

.modal-ki-notice strong { font-weight: 700; }

/* Mod variant picker — back button and heading */
.modal-back-btn {
  grid-column: 1 / -1;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent-primary);
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  width: fit-content;
  margin-bottom: 0.25rem;
  transition: background 0.15s;
}
.modal-back-btn:hover { background: rgba(56,189,248,0.1); }

.modal-variant-heading {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 0 0.25rem;
}
.modal-variant-heading strong { color: var(--text-primary); }

/* ▸ indicator for mods that have variants */
.modal-item-info-dot--variants {
  background: rgba(251,191,36,0.15);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.3);
}

/* Gold label for key item effects in preview */
.preview-attr-ki {
  color: #fbbf24 !important;
}

/* Info dot on items that have a preview */
.modal-item-info-dot {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  z-index: 2;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(9, 153, 178, 0.85);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Image area — no fixed height, image defines its own height (same as .card-image) */
.modal-item-img-wrap {
  width: 100%;
  background: linear-gradient(135deg, #0d1a2a 0%, #0a111a 100%);
  position: relative;
  overflow: hidden;
}

.modal-item-img-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 40%, rgba(6,182,212,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.modal-item-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
  position: relative;
  z-index: 1;
}

.suffix-variant-wrap {
  position: relative;
}

.suffix-variant-wrap .suffix-frame-bg {
  width: 100%;
  height: auto;
  display: block;
}

.suffix-variant-wrap .suffix-variant-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 62%;
  height: auto;
  object-fit: contain;
  z-index: 1;
}

/* Placeholder when image is missing/broken — gives the box a visible size */
.modal-item-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  opacity: 0.4;
}

/* Card body — matches .card-body from builds.styles.css */
.modal-item-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 0.6rem 0.75rem 0.3rem;
  line-height: 1.4;
}

.modal-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.25rem 0.75rem 0.6rem;
  background: var(--bg-card);
}

/* Key item effect shown directly on modal card */
.modal-item-effect {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 0 0.75rem 0.5rem;
  line-height: 1.5;
  background: var(--bg-card);
  border-top: 1px dashed var(--border);
  padding-top: 0.35rem;
}

/* ─── Toast Notification ────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: #1a1a2a;
  border: 1px solid #d97706;
  color: #fbbf24;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  z-index: 300;
  max-width: 480px;
  text-align: center;
  pointer-events: none;
}

.toast-show {
  animation: toastIn 0.25s ease forwards;
}

.toast-hide {
  animation: toastOut 0.4s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0);    }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0);    }
  to   { opacity: 0; transform: translateX(-50%) translateY(12px); }
}

/* ─── Deviation Slot ────────────────────────────────────────── */
.deviation-card {
  width: auto;
}

.slot-dev-skills {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.4rem 0.75rem 0.6rem;
  border-top: 1px solid var(--border);
}

.slot-dev-skill {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.slot-dev-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-primary);
}

.slot-dev-text {
  font-size: 0.72rem;
  color: var(--text-label);
  line-height: 1.4;
  font-style: italic;
}

/* ─── Calibration Sub-Area ──────────────────────────────────── */
.slot-cal-area {
  padding: 0.35rem 0.75rem;
  border-top: 1px solid var(--border);
  cursor: pointer;
  min-height: 28px;
  display: flex;
  align-items: center;
  transition: background var(--transition);
}

.slot-cal-area:not(.slot-cal-locked):hover {
  background: rgba(251, 191, 36, 0.06);
}

.slot-cal-locked {
  cursor: default;
  opacity: 0.35;
  pointer-events: none;
}

.slot-cal-content {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  width: 100%;
}

.slot-cal-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
}

.slot-cal-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fbbf24;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-cal-dmg {
  font-size: 0.63rem;
  color: var(--text-muted);
}

.slot-cal-trait {
  font-size: 0.63rem;
  color: var(--accent-bright);
  font-weight: 600;
}

.slot-cal-add {
  font-size: 0.72rem;
  color: #d97706;
  font-weight: 600;
}

.slot-cal-placeholder {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ─── Fur Sub-Area ──────────────────────────────────────────── */
.slot-fur-area {
  padding: 0.35rem 0.75rem;
  border-top: 1px solid var(--border);
  cursor: pointer;
  min-height: 28px;
  display: flex;
  align-items: center;
  transition: background var(--transition);
}

.slot-fur-area:not(.slot-fur-locked):hover {
  background: rgba(74, 222, 128, 0.06);
}

.slot-fur-locked {
  cursor: default;
  opacity: 0.35;
  pointer-events: none;
}

.slot-fur-content {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
}

.slot-fur-animal {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Per-animal colours — slot card label */
.slot-fur-animal[data-animal="deer"]      { color: #d4a574; }
.slot-fur-animal[data-animal="rabbit"]    { color: #7dd3fc; }
.slot-fur-animal[data-animal="wolf"]      { color: #94a3b8; }
.slot-fur-animal[data-animal="sheep"]     { color: #fde68a; }
.slot-fur-animal[data-animal="crocodile"] { color: #86efac; }
.slot-fur-animal[data-animal="bear"]      { color: #c2814a; }
.slot-fur-animal[data-animal="fox"]       { color: #fb923c; }
.slot-fur-animal[data-animal="cow"]       { color: #e7c6a5; }

.slot-fur-name {
  font-size: 0.72rem;
  color: var(--text-label);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-fur-add {
  font-size: 0.72rem;
  color: #4ade80;
  font-weight: 600;
}

.slot-fur-placeholder {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ─── Bottom Row (Deviation + Cradle Overrides) ─────────────── */
.slot-section--bottom-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1rem;
  align-items: start;
}

.bottom-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ─── Cradle Overrides Panel ─────────────────────────────────── */
.cradle-overrides-panel {
  background: var(--bg-card);
  border: 1px solid var(--accent-primary);
  box-shadow: 0 0 8px rgba(9, 153, 178, 0.18);
  border-radius: var(--radius-card);
  padding: 0.75rem;
}

.cradle-slots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.cradle-slot {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  min-height: 54px;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
}

.cradle-slot:hover {
  border-color: var(--accent-primary);
  background: rgba(9, 153, 178, 0.07);
}

.cradle-slot--filled {
  border-color: rgba(9, 153, 178, 0.5);
  background: rgba(9, 153, 178, 0.09);
}

.cradle-slot-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.cradle-slot-empty-icon {
  font-size: 1.1rem;
  color: var(--text-muted);
  opacity: 0.3;
  line-height: 1;
}

.cradle-slot-clear {
  position: absolute;
  top: 2px;
  right: 3px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.6rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.1rem;
}

.cradle-slot-clear:hover { color: #ef4444; }

/* ─── Modal: Calibration Cards ──────────────────────────────── */
.modal-item--cal {
  padding: 0.75rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.modal-item--cal .modal-item-name {
  border-top: none;
  padding: 0;
  color: #fbbf24;
  font-size: 0.88rem;
}

.modal-cal-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 0;
  background: transparent;
}

.modal-cal-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0;
  background: transparent;
}

.modal-cal-stat {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-bright);
  background: rgba(9, 153, 178, 0.1);
  border: 1px solid rgba(9, 153, 178, 0.25);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
}

.modal-cal-compat {
  font-size: 0.68rem;
  color: var(--text-muted);
  padding: 0;
  background: transparent;
  font-style: italic;
}

/* "Choose 2nd stat" hint badge on calibration style cards */
.modal-cal-stat--choose {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fbbf24;
  font-style: italic;
}

/* Weapon DMG badge on the trait picker step */
.modal-cal-stat--weap {
  background: rgba(9, 153, 178, 0.08);
  color: var(--text-muted);
  font-weight: 500;
}

/* Trait picker cards — larger, no image wrap needed */
.modal-item--trait {
  min-height: 80px;
  justify-content: center;
}

.modal-item--trait .modal-item-name {
  font-size: 1rem;
  padding-top: 0.75rem;
}

/* No compatible weapon notice */
.modal-cal-no-match {
  color: #fbbf24;
  font-style: normal;
}

.modal-cal-no-match strong { font-weight: 700; }

/* ─── Modal: Fur Cards ──────────────────────────────────────── */
.modal-item--fur {
  padding: 0.75rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.modal-item--fur .modal-item-name {
  border-top: none;
  padding: 0;
}

.modal-fur-animal {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0;
  background: transparent;
}

/* Per-animal colours — modal card label */
.modal-fur-animal[data-animal="deer"]      { color: #d4a574; }
.modal-fur-animal[data-animal="rabbit"]    { color: #7dd3fc; }
.modal-fur-animal[data-animal="wolf"]      { color: #94a3b8; }
.modal-fur-animal[data-animal="sheep"]     { color: #fde68a; }
.modal-fur-animal[data-animal="crocodile"] { color: #86efac; }
.modal-fur-animal[data-animal="bear"]      { color: #c2814a; }
.modal-fur-animal[data-animal="fox"]       { color: #fb923c; }
.modal-fur-animal[data-animal="cow"]       { color: #e7c6a5; }

.modal-fur-effect {
  font-size: 0.73rem;
  color: var(--text-label);
  line-height: 1.5;
  padding: 0;
  background: transparent;
}

/* ─── Weapon Grid ───────────────────────────────────────────── */
/* Primary + Secondary stack in left column; Melee spans both rows on right */
#group-weapons {
  display: grid;
  grid-template-columns: 1fr 310px;
  grid-template-rows: auto auto;
  gap: 0.75rem;
}

#group-weapons .slot-card { width: auto; }

/* Primary + Secondary stacked left, Melee spans full height on right */
.slot-card[data-slot-id="primary"]   { grid-column: 1; grid-row: 1; }
.slot-card[data-slot-id="secondary"] { grid-column: 1; grid-row: 2; }
.slot-card[data-slot-id="melee"]     { grid-column: 2; grid-row: 1 / 3; display: flex; flex-direction: column; }

/* Guns — landscape, capped so they don't get too tall on wide screens */
#group-weapons .slot-item-area { aspect-ratio: 2 / 1; max-height: 220px; }

/* Melee image area — #group-weapons prefix needed to beat the ID-selector rule above */
#group-weapons .slot-card[data-slot-id="melee"] .slot-item-area {
  aspect-ratio: unset;
  flex: 1;
  min-height: 90px;
  max-height: none;
  background: var(--bg-card);
}

/* Melee weapon image — cover fills the tall card, cropping transparent frame edges */
#group-weapons .slot-card[data-slot-id="melee"] .slot-item-img,
#group-weapons .slot-card[data-slot-id="melee"] .slot-item-placeholder-img {
  object-fit: cover;
  object-position: center;
}


/* ─── Armor Inventory Grid ──────────────────────────────────── */
/* 3 columns × 2 rows — all slots equal size                   */
#group-armor {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

#group-armor .slot-card { width: auto; }

#group-armor .slot-item-area { aspect-ratio: 1 / 1; }

/* ─── Modal: Cradle Override Cards ──────────────────────────── */
.modal-item--cradle {
  padding: 0.75rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.modal-item--cradle .modal-item-name {
  border-top: none;
  padding: 0;
  font-size: 0.88rem;
}

.modal-cradle-tier-header {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
  margin-top: 0.5rem;
}

.modal-cradle-tier-header:first-child { margin-top: 0; }

.modal-cradle-effect {
  font-size: 0.75rem;
  color: var(--text-label);
  line-height: 1.6;
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .create-layout {
    grid-template-columns: 1fr 260px;
  }

  .cradle-slots-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .create-layout {
    grid-template-columns: 1fr;
  }

  .stats-panel {
    position: static;
  }

  .slot-section--bottom-row {
    grid-template-columns: 180px 1fr;
  }
}

@media (max-width: 640px) {
  #group-weapons {
    grid-template-columns: 1fr 150px;
  }

  #group-armor {
    grid-template-columns: repeat(2, 1fr);
  }

  .slot-section--bottom-row {
    grid-template-columns: 1fr;
  }

  .cradle-slots-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-grid,
  .modal-grid--wide {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    padding: 0.6rem;
  }
}
