/*
 * Créateur de stuff — layout styles.
 *
 * Structure follows the familiar in-game equipment window (slots around a
 * figure, characteristics left, resistances right); the palette stays on
 * DPLN's gold-on-dark tokens from global.css.
 *
 * Loaded only on this page rather than sitewide.
 */

.sc-page { margin: 20px auto 48px; }

/* ------------------------------------------------------------- top bar */

.sc-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 20px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.sc-bar h1 {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 26px);
  text-transform: uppercase;
}

.sc-bar-field { display: flex; align-items: center; gap: 9px; }

.sc-bar-field label {
  font-family: var(--font-sub);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

.sc-bar-field input {
  width: 78px;
  padding: 7px 9px;
  font: inherit;
  font-size: 15px;
  text-align: center;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.sc-bar-note { font-size: 13px; color: var(--muted); }
.sc-bar-actions { margin-left: auto; display: flex; gap: 8px; }

/* -------------------------------------------------------- three columns */

.sc-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

@media (max-width: 1240px) {
  .sc-grid { grid-template-columns: 1fr 1fr; }
  .sc-col--doll { grid-column: 1 / -1; order: -1; }
}

@media (max-width: 760px) { .sc-grid { grid-template-columns: 1fr; } }

.sc-col { display: grid; gap: 16px; }

.sc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
}

.sc-card h2 {
  margin: 0 0 12px;
  font-family: var(--font-sub);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--gold-600);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.sc-note { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.sc-note--center { text-align: center; }
.sc-empty { color: var(--muted); font-style: italic; font-size: 13.5px; }

/* ----------------------------------------------------------- paper doll */

.sc-doll-card { padding: 20px; }

.sc-doll {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.sc-doll-col { display: grid; gap: 8px; }

.sc-doll-mid {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 250px;
}

.sc-figure { color: var(--ink); }

.sc-doll-bottom {
  display: grid;
  grid-template-columns: repeat(6, auto);
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

@media (max-width: 460px) {
  .sc-doll-bottom { grid-template-columns: repeat(3, auto); }
}

.sc-tile {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.14s, background-color 0.14s, transform 0.14s;
}

.sc-tile:hover { border-color: var(--gold); transform: translateY(-2px); }
.sc-tile:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sc-tile.is-filled { background: var(--surface); border-color: var(--gold-600); }
.sc-tile img { width: 44px; height: 44px; object-fit: contain; }

.sc-tile-ph {
  font-family: var(--font-sub);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}

.sc-tile-rm {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.14s;
}

.sc-tile:hover .sc-tile-rm { opacity: 1; }

/* badges floating over the figure */

.sc-badges {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  pointer-events: none;
}

.sc-badge {
  display: grid;
  place-items: center;
  min-width: 52px;
  padding: 5px 9px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  line-height: 1.15;
}

.sc-badge b {
  font-size: 15px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.sc-badge em {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
}

.sc-badge--hp { border-color: #c0504d; }
.sc-badge--pa { border-color: #4a86c8; }
.sc-badge--pm { border-color: #57a773; }
.sc-badge--po { border-color: #b07cc6; }
.sc-badge--inv { border-color: var(--gold-600); }

/* ------------------------------------------------------- stat panels */

.sc-prim, .sc-stats, .sc-sets { list-style: none; margin: 0; padding: 0; }

.sc-prim li, .sc-stats li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.8px;
}

.sc-prim li:last-child, .sc-stats li:last-child { border-bottom: 0; }

.sc-prim b, .sc-stat-v {
  color: var(--ink);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.sc-stat-l { color: var(--text); }

.sc-base { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.sc-base th, .sc-base td { padding: 5px 4px; text-align: right; }

.sc-base thead th {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.sc-base tbody th { text-align: left; font-weight: 600; color: var(--text); }
.sc-base tbody tr { border-bottom: 1px solid var(--line); }
.sc-base tbody tr:last-child { border-bottom: 0; }

.sc-total {
  color: var(--ink);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.sc-scroll {
  width: 58px;
  padding: 4px 6px;
  font: inherit;
  font-size: 13px;
  text-align: right;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

.sc-scroll:focus, .sc-bar-field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgb(243 200 0 / 0.2);
}

/* --------------------------------------------------- elements table */

.sc-elem { width: 100%; border-collapse: collapse; font-size: 13px; }
.sc-elem th, .sc-elem td { padding: 6px 4px; text-align: center; }

.sc-elem tbody th {
  text-align: left;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.sc-elem tbody tr { border-top: 1px solid var(--line); }
.sc-elem td { color: var(--muted); font-variant-numeric: tabular-nums; }
.sc-elem td.is-on { color: var(--ink); font-weight: 800; }

.sc-el {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
}

.sc-el--neutre { background: #8d8375; }
.sc-el--terre { background: #7a6a3f; }
.sc-el--feu { background: #b5543a; }
.sc-el--eau { background: #3f79a8; }
.sc-el--air { background: #5c9068; }

/* ------------------------------------------------------------ panoply */

.sc-set {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

.sc-set:last-child { border-bottom: 0; }
.sc-set strong { color: var(--ink); display: block; }
.sc-set-n, .sc-set-tier { font-size: 11.5px; color: var(--muted); }

/* the two meta labels sit on one line and would otherwise run together */
.sc-set-n + .sc-set-tier::before {
  content: '·';
  margin: 0 6px;
  opacity: 0.6;
}

.sc-set > div { margin-top: 4px; }
.sc-set.is-inactive { opacity: 0.6; }

.sc-set-b {
  display: inline-block;
  margin: 3px 4px 0 0;
  padding: 2px 8px;
  background: var(--surface-3);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink);
}

.sc-foot {
  margin-top: 20px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ------------------------------------------------------------- picker */

.sc-picker {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(6 8 11 / 0.72);
  backdrop-filter: blur(3px);
}

.sc-picker[hidden] { display: none; }

.sc-picker-box {
  width: min(720px, 100%);
  max-height: min(82vh, 760px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.sc-picker-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.sc-picker-head h2 { margin: 0; font-size: 18px; flex: 1; }

.sc-picker-head button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.sc-picker-head button:hover { border-color: var(--red); color: var(--red); }

.sc-picker-search { padding: 13px 18px; border-bottom: 1px solid var(--line); }

.sc-picker-search input {
  width: 100%;
  padding: 10px 13px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.sc-picker-search input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgb(243 200 0 / 0.18);
}

.sc-picker-list {
  list-style: none;
  margin: 0;
  padding: 10px;
  overflow-y: auto;
  flex: 1;
}

.sc-pick {
  display: flex;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  margin-bottom: 4px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: inherit;
  transition: background-color 0.12s, border-color 0.12s;
}

.sc-pick:hover { background: var(--surface-3); border-color: var(--gold); }
.sc-pick-img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.sc-pick-body { flex: 1; min-width: 0; }
.sc-pick-head { display: flex; align-items: baseline; gap: 10px; }
.sc-pick-head strong { color: var(--ink); font-size: 14.5px; }
.sc-pick-lvl { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.sc-pick-set { display: block; font-size: 11.5px; color: var(--gold-600); }

.sc-pick-stats {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 3px 6px;
  font-size: 12px;
  color: var(--muted);
}

.sc-pick-stats li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 7px;
}
