/* The character creator window (src/ui/creator.js): a mirror with the face and a panel of option rows,
   dressed in the game's Stone theme (charcoal glass, aged brass, the --surface / --action tokens from
   src/ui/theme.css). Self-contained: the swatch (.look-swatch) and the picker are styled here too, so
   the workshop page can use it; the fallbacks are the Stone values. */
#modalCard > h2 { margin: 0 0 12px; font: 400 26px/1.2 var(--font-display, 'Bree Serif', Georgia, serif); color: var(--title, #e9d6a6); text-shadow: 0 2px 0 #0008; text-align: center; letter-spacing: .01em; }
/* the game's dialog is narrow: give the creator room, and let its columns shrink instead of overflowing */
#modalCard:has(.creator:not(.is-name-only)), .welcoming #modalCard:has(.creator:not(.is-name-only)) {
  width: min(820px, 100%); max-width: 820px; max-height: calc(100svh - 40px); overflow-y: auto; overflow-x: hidden;
}
.creator { display: grid; grid-template-columns: minmax(200px, 290px) minmax(0, 1fr); gap: 18px; align-items: start; text-align: left; }
.creator.is-name-only { grid-template-columns: minmax(240px, 380px); justify-content: center; }
.creator-left { display: flex; flex-direction: column; gap: 10px; }
.creator-mirror { width: 100%; position: relative; border: 4px solid #14120e; outline: 2px solid var(--metal, #a58b5a); border-radius: 46% 46% 8px 8px; background: var(--surface-3, #454035); box-shadow: inset 0 0 0 3px #2c2922, 0 6px 0 #0c0b08, 0 14px 26px #0008; }
.creator-mirror-inner { overflow: hidden; border: 2px solid #14120e; border-radius: 47% 47% 3px 3px; background: radial-gradient(ellipse at 55% 38%, #8fa0a4, #46555b 78%); aspect-ratio: 1 / 1.05; }
.creator-stage { width: 100%; height: 100%; cursor: pointer; }
.creator-stage canvas { display: block; width: 100%; height: 100%; }
.creator-namebox { display: flex; flex-direction: column; gap: 6px; }
.creator-name { width: 100%; }
.creator-name-status { margin: 0; font-size: 12px; min-height: 16px; color: var(--muted, #c2b8a4); }
.creator-name-status.is-taken, .creator-name-status.is-invalid { color: #e49a86; }
.creator-name-status.is-available { color: #b9cf9a; }
.creator-panel { min-width: 0; padding: 16px; border: 1px solid #a58b5a99; border-radius: 7px; background: linear-gradient(var(--surface-2, #34312b), var(--surface, #292723)); box-shadow: inset 0 0 0 3px #191814aa, inset 0 0 0 4px #ad936340, 0 8px 22px #0006; }
.creator-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.creator-row { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 8px; align-items: center; }
.creator-label { font: 700 11px/1.3 'Cinzel', Georgia, serif; letter-spacing: .08em; text-transform: uppercase; color: var(--accent, #d2b67d); }
.creator-group { display: flex; gap: 6px; }
.creator-group .creator-opt { flex: 1; }
.creator-scroller { display: grid; grid-template-columns: 28px minmax(0, 1fr) 28px; align-items: center; gap: 4px; }
.creator-scroll { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; padding: 3px 1px 7px; scrollbar-width: thin; scrollbar-color: #756a55 #1d1c18; }
.creator-scroll .creator-opt { flex: 0 0 auto; scroll-snap-align: start; white-space: nowrap; }
.creator-opt, .creator-arrow { height: 34px; padding: 0 12px; border: 1px solid #ab946466; background: linear-gradient(var(--surface-3, #454035), #38342b); color: var(--ink, #eee5d2); box-shadow: inset 0 1px #dfc78d26, inset 0 -2px #15140f66, 0 2px 3px #0003; border-radius: 5px; font: 700 12px 'Nunito Sans', system-ui, sans-serif; cursor: pointer; }
.creator-opt:hover:not(:disabled), .creator-arrow:hover { background: linear-gradient(#52493a, #433d31); border-color: var(--metal, #a58b5a); }
.creator-opt:active:not(:disabled), .creator-arrow:active { transform: translateY(1px); }
.creator-opt.is-on { background: linear-gradient(#8b7a55, var(--action, #655b45)); color: var(--on-action, #fff5df); border-color: var(--accent, #d2b67d); box-shadow: inset 0 1px #fff4, inset 0 -2px #2a2418aa, 0 0 12px #d2b67d40; }
.creator-opt:disabled { background: #2d2b26; color: #8d8573; box-shadow: none; cursor: not-allowed; opacity: .7; }
.creator-arrow { width: 28px; padding: 0; font-size: 20px; line-height: 1; }
.creator-colours { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.creator-colours.is-off { opacity: .45; }
.creator-colours .look-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #14120e; background: var(--swatch); cursor: pointer; box-shadow: inset 0 2px 4px #0005; padding: 0; }
.creator-colours .look-swatch.is-on { border-color: #14120e; box-shadow: 0 0 0 2px #292723, 0 0 0 4px var(--accent, #d2b67d); }
.creator-colours .look-swatch:disabled, .creator-picker:disabled { cursor: not-allowed; }
.creator-picker-wrap { display: inline-flex; padding: 3px; border-radius: 50%; background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red); cursor: pointer; }
.creator-picker { width: 26px; height: 26px; padding: 0; border: 2px solid #292723; border-radius: 50%; background: none; cursor: pointer; overflow: hidden; }
.creator-picker::-webkit-color-swatch-wrapper { padding: 0; }
.creator-picker::-webkit-color-swatch { border: 0; border-radius: 50%; }
.creator-picker::-moz-color-swatch { border: 0; border-radius: 50%; }
.creator-note { margin: 2px 0 0; font-size: 11px; color: var(--muted, #c2b8a4); }
.creator-next { width: 100%; padding: 12px; border: 1px solid var(--accent, #d2b67d); border-radius: 5px; background: linear-gradient(#8b7a55, var(--action, #655b45)); color: var(--on-action, #fff5df); box-shadow: inset 0 1px #fff4, inset 0 -2px #2a2418aa, 0 3px 0 #14120e, 0 8px 16px #0005; font: 800 14px 'Nunito Sans', system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; transition: transform .12s, filter .12s; }
.creator-next:hover:not(:disabled) { filter: brightness(1.12); transform: translateY(-1px); }
.creator-next:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 1px #fff4, 0 1px 0 #14120e; }
.creator-next:disabled { background: #2d2b26; border-color: #5a5242; color: #8d8573; box-shadow: none; cursor: not-allowed; }
.creator-cancel { width: 100%; margin-top: 8px; padding: 9px; border: 1px solid #ab946466; border-radius: 5px; background: transparent; color: var(--muted, #c2b8a4); font: 700 12px 'Nunito Sans', system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.creator-cancel:hover { background: #ffffff0d; color: var(--ink, #eee5d2); }
.creator-name[readonly] { opacity: .75; cursor: not-allowed; }
.creator-name-status.is-locked { color: var(--muted, #c2b8a4); }
.creator button:focus-visible, .creator input:focus-visible { outline: 3px solid var(--focus, #c9d4bc); outline-offset: 2px; }
@media (max-width: 700px) {
  .creator { grid-template-columns: 1fr; }
  .creator-left { max-width: 280px; margin: 0 auto; width: 100%; }
  .creator-row { grid-template-columns: 1fr; gap: 4px; }
}
