/* Creating a character on screen (create.js), inside the start screen
   (#start), and on /create/. One page that unfolds: the owner's chosen
   mock-up, art/mockup-create/page.html (study A). */

#create { width: min(1020px, 100%); min-width: 0; font-family: var(--chrome-font); color: var(--parchment); }
body.cc-wide #create { width: min(1020px, 100%); }
#create[hidden], #create [hidden] { display: none; }
/* (#start .pane's display wins over #start [hidden]: the list goes here) */
#start:has(#create:not([hidden])) > .pane { display: none; }
/* (on a phone the start screen's mark runs a little past #start's top padding) */
@media (max-width: 520px) { #start > #create { margin-top: 44px; } }
#create button, #create input { font: inherit; color: inherit; }
#create h2, #create h3, #create h4 { font-family: var(--chrome-font); font-weight: 400; margin: 0; }
#create .cc-title { font-size: 38px; color: var(--gilt); line-height: 1.1; }
@media (max-width: 520px) { #create .cc-title { font-size: 30px; } }
#create .cc-title:focus { outline: none; }
#create .rule { margin: 14px 0 22px; }
#create .cc-kicker { color: var(--muted); font-family: var(--prose-font); font-style: italic; font-size: 17px; margin: -10px 0 18px; }
#create .lbl { display: block; color: var(--muted); font-size: 14px; margin-bottom: 6px; letter-spacing: 0.02em; }
#create .field {
  width: 100%; min-height: 44px; background: var(--ink); border: 1px solid var(--rule-strong); border-radius: 2px;
  color: var(--parchment-bright); padding: 10px 12px; font-size: 17px; font-family: Georgia, serif;
}
#create .field:focus-visible { outline: 1px solid var(--gilt); outline-offset: 0; border-color: var(--gilt); }
#create :focus-visible { outline: 2px solid var(--gilt-bright); outline-offset: 2px; }
#create .btn, #create .ghost { min-height: 44px; }
#create .btn[aria-disabled="true"] { background: #4a4030; color: var(--muted); cursor: not-allowed; }

/* Forms */
#create .cc-stack { display: flex; flex-direction: column; gap: 18px; }
#create .cc-fieldrow { display: flex; gap: 8px; align-items: stretch; }
#create .cc-fieldrow .field { flex: 1; min-width: 0; }
#create .cc-rules { margin: 0; padding: 0; list-style: none; color: var(--muted); font-family: Georgia, serif; font-size: 15px; }
#create .cc-rules li { padding-left: 18px; position: relative; }
#create .cc-rules li::before { content: "·"; position: absolute; left: 4px; color: var(--gilt-deep); }
#create .cc-rules li.ok, #create .cc-rules li.bad { color: var(--parchment); }
#create .cc-rules li.ok::before { content: "✓"; color: var(--verdigris); left: 0; }
#create .cc-rules li.bad::before { content: "×"; color: var(--ember); left: 1px; }
#create .cc-status { min-height: 1.6em; font-family: Georgia, serif; font-size: 15px; margin: 0; }
#create .cc-status.good { color: var(--verdigris); }
#create .cc-status.bad { color: var(--combat-text); }
#create .cc-status.wait { color: var(--muted); font-style: italic; }
#create p.cc-status.bad[role="alert"] { margin: 0 0 14px; }
#create .cc-why { color: var(--muted); font-family: Georgia, serif; font-size: 15px; border-left: 1px solid var(--rule-strong); padding-left: 12px; margin: 0; }
#create .cc-quiet {
  background: none; border: 0; color: var(--gilt); padding: 4px 2px; font-family: Georgia, serif; font-size: 15px; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--gilt) 40%, transparent);
}
/* Pictures: 3:4 painted portraits */
#create .cc-pic { display: block; aspect-ratio: 3 / 4; background: var(--ink-high); overflow: hidden; line-height: 0; }
#create .cc-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
#create .cc-pic-none { background: linear-gradient(160deg, var(--ink-high), var(--ink)); }


/* The page: a title, then the sections */
#create .cc-top { display: flex; align-items: flex-end; gap: 12px; margin-top: 22px; }
#create .cc-top .cc-title { flex: 1; min-width: 0; }
#create .cc-top .cc-quiet { min-height: 44px; }
#create .cc-secs { display: grid; gap: 12px; }
#create .cc-sec { background: var(--ink-raised); border: 1px solid var(--rule); border-radius: 2px; min-width: 0; }
#create .cc-sec.open { border-color: var(--rule-strong); box-shadow: inset 2px 0 0 var(--gilt-deep); }
#create .cc-sec-h { margin: 0; font-size: inherit; }
#create .cc-sec-head {
  width: 100%; display: flex; gap: 14px; align-items: center; padding: 10px 16px; min-height: 60px;
  background: none; border: 0; text-align: left; cursor: pointer; color: inherit;
}
#create .cc-sec.open .cc-sec-head { cursor: default; }
#create .cc-sec-head:disabled { cursor: default; }
#create .cc-sec.locked { opacity: 0.45; }
#create .cc-sec-t { display: flex; flex-direction: column; min-width: 0; }
#create .cc-sec-k { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
#create .cc-sec-v { font-size: 21px; line-height: 1.25; color: var(--parchment-bright); overflow-wrap: anywhere; }
#create .cc-sec:not(.done) .cc-sec-v { color: var(--muted); font-family: var(--prose-font); font-style: italic; font-size: 17px; }
#create .cc-sec.open .cc-sec-v { color: var(--gilt); }
#create .cc-chg { margin-left: auto; color: var(--gilt); font-size: 14px; }
#create .cc-sec-head:not(:disabled):hover .cc-chg { color: var(--gilt-bright); text-decoration: underline; text-underline-offset: 3px; }
#create .cc-thumbs { display: flex; gap: 3px; flex: none; }
#create .cc-thumbs img { width: 36px; height: 48px; object-fit: cover; display: block; border-radius: 1px; }
#create .cc-sec-body { padding: 0 16px 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
#create .cc-sec-body > .cc-kicker { margin: -6px 0 0; }
#create .cc-sec-body p.cc-status.bad[role="alert"] { margin: 0; }
#create .cc-gorow { display: flex; justify-content: flex-end; margin-top: 14px; }
#create .cc-stack .cc-gorow { margin-top: 0; justify-content: flex-start; }
#create .btn:disabled { background: #4a4030; color: var(--muted); cursor: not-allowed; }
#create .cc-stack { max-width: 460px; }

/* Choice chips and the number-of-classes control */
#create .cc-chip {
  min-height: 44px; background: var(--ink); border: 1px solid var(--rule-strong); border-radius: 2px; padding: 6px 14px;
  font-family: var(--chrome-font); font-size: 15px; color: var(--parchment); cursor: pointer; text-align: left;
}
#create .cc-chip:hover { border-color: var(--gilt-deep); }
#create .cc-chip[aria-pressed="true"] { border-color: var(--gilt); color: var(--gilt-bright); background: var(--ink-high); box-shadow: inset 0 -2px 0 var(--gilt); }

#create .cc-modes { display: inline-flex; max-width: 100%; border: 1px solid var(--rule-strong); border-radius: 2px; overflow: hidden; align-self: flex-start; }
#create .cc-modes button {
  min-height: 44px; border: 0; background: none; padding: 0 14px; font-size: 15px; color: var(--parchment); cursor: pointer; white-space: nowrap;
}
#create .cc-modes button + button { border-left: 1px solid var(--rule-strong); }
#create .cc-modes .n { margin-left: 6px; color: var(--muted); font-family: var(--font); font-size: 12px; }
#create .cc-modes button[aria-pressed="true"] { background: var(--gilt); color: var(--on-accent, #0c0b14); }
#create .cc-modes button[aria-pressed="true"] .n { color: inherit; opacity: 0.75; }
#create .cc-modes button:disabled { opacity: 0.35; cursor: not-allowed; }
@media (max-width: 420px) { #create .cc-modes button { padding: 0 9px; font-size: 14px; } #create .cc-modes .n { margin-left: 4px; } }
#create .cc-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#create .cc-filters .cc-chip { min-height: 36px; padding: 3px 11px; font-size: 14px; }
#create .cc-with { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }

/* Cards */
#create .cc-pick { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 900px) { #create .cc-pick.has-detail { grid-template-columns: minmax(0, 1fr) 360px; } }
/* One card size everywhere (sex, race, class), like a deck; a combination card
   spans two or three card widths so each of its pictures is card-sized too. */
#create { --cc-card-w: 128px; }
@media (max-width: 480px) { #create { --cc-card-w: 100px; } }
#create .cc-cards { display: grid; grid-template-columns: repeat(auto-fill, var(--cc-card-w)); gap: 10px; min-width: 0; }
#create .cc-combos.n2 .cc-card { grid-column: span 2; }
#create .cc-combos.n3 .cc-card { grid-column: span 3; }
#create .cc-card {
  position: relative; display: flex; flex-direction: column; padding: 0; text-align: left; background: var(--ink);
  border: 1px solid var(--rule); border-radius: 2px; cursor: pointer; min-width: 0; overflow: hidden; color: inherit;
}
#create .cc-card:hover { border-color: var(--gilt-deep); }
#create .cc-card[aria-pressed="true"] { border-color: var(--gilt); box-shadow: inset 0 0 0 1px var(--gilt), inset 0 -3px 0 var(--gilt); background: var(--ink-high); }
#create .cc-card .nm { display: block; padding: 6px 8px 8px; font-size: 15.5px; line-height: 1.25; color: var(--parchment-bright); }
#create .cc-card[aria-pressed="true"] .nm { color: var(--gilt-bright); }
#create .cc-card .pics { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; background: var(--rule); }
#create .cc-card > .cc-tag { position: absolute; top: 6px; left: 6px; margin: 0; background: rgba(12, 11, 20, 0.85); }
#create .cc-tag {
  display: inline-block; margin-top: 5px; font-family: var(--chrome-font); font-size: 11px; letter-spacing: 0.03em;
  color: #b9a37a; border: 1px solid #4a4030; border-radius: 1px; padding: 0 5px; line-height: 1.5; white-space: nowrap;
}
/* A race card's looks cross-fade (create.js rotateLooks) */
#create .cc-rot { position: relative; }
#create .cc-rot img.in { position: absolute; inset: 0; opacity: 0; transition: opacity 1400ms ease; }
#create .cc-rot img.in.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { #create .cc-rot img.in { transition: none; } }

/* Class: the choices, and beside them (on a phone above) the guide and the panel */
#create .cc-cpick { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
#create .cc-cmain { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
#create .cc-cside { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (min-width: 900px) { #create .cc-cpick { grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; } }
@media (max-width: 899px) { #create .cc-cside { order: -1; } }
#create .cc-guide { background: var(--ink); border: 1px solid var(--rule); border-left: 2px solid var(--gilt-deep); border-radius: 2px; padding: 12px 16px 4px; min-width: 0; }
#create .cc-guide h4 { font-size: 18px; color: var(--gilt); margin: 0 0 6px; }
#create .cc-guide .cc-doc { font-size: 14.5px; }
#create .cc-guide li { color: var(--muted); }
#create .cc-guide li.now { color: var(--parchment-bright); }
#create .cc-dpics { display: flex; gap: 6px; margin-bottom: 10px; }
#create .cc-dpics .cc-pic { width: 96px; }
#create .cc-dpics.duo .cc-pic { width: 76px; }
#create .cc-shorts { margin: 6px 0 0; padding-left: 1.1em; font-family: var(--prose-font); font-size: 14.5px; display: grid; gap: 3px; }
#create .cc-shorts b { font-family: var(--chrome-font); font-weight: 400; color: var(--parchment-bright); }
#create .cc-countline { font-style: italic; }
#create .cc-hardwhy b { font-family: var(--chrome-font); font-weight: 400; color: var(--parchment); }
#create .cc-hardwhy .cc-doc p { margin: 0 0 4px; }
#create .cc-more { margin-top: 10px; }
#create .cc-more summary { cursor: pointer; color: var(--gilt); min-height: 44px; display: flex; align-items: center; }
#create .cc-multi { margin: 10px 0 0; }

/* The review line and Create */
#create .cc-review {
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center;
}
#create .cc-review > [role="alert"] { flex-basis: 100%; margin: 0; }
#create .cc-rline { display: flex; gap: 14px; align-items: center; flex: 1 1 300px; min-width: 0; }
#create .cc-rpics { display: flex; gap: 4px; flex: none; }
#create .cc-rpics .cc-pic { width: 48px; }
#create .cc-rtext { margin: 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#create .cc-pname { font-family: var(--chrome-font); font-weight: 400; font-size: 28px; line-height: 1.1; color: var(--gilt); overflow-wrap: anywhere; }
#create .cc-psub { font-family: var(--prose-font); font-size: 16px; color: var(--parchment); }
#create .cc-pal { font-family: var(--prose-font); font-size: 14px; color: var(--muted); }
#create .cc-pal .cc-tag { margin: 0; }
#create .cc-create { min-height: 52px; padding: 0 26px; font-size: 17px; }
@media (max-width: 520px) { #create .cc-create { flex: 1 1 100%; } }

/* The toast: a choice that undid another */
#create .cc-toast {
  position: fixed; left: 50%; bottom: 72px; transform: translateX(-50%); z-index: 30; margin: 0;
  width: max-content; max-width: calc(100vw - 32px); padding: 10px 16px; background: var(--ink-high);
  border: 1px solid var(--gilt-deep); border-radius: 2px; box-shadow: var(--shadow, 0 8px 40px rgba(0, 0, 0, 0.6));
  font-family: var(--prose-font); font-size: 15px; color: var(--parchment-bright); visibility: hidden; opacity: 0; transition: opacity 200ms;
}
#create .cc-toast.on { visibility: visible; opacity: 1; }

/* The panel about the chosen race or class */
#create .cc-detail { background: var(--ink); border: 1px solid var(--rule-strong); border-radius: 2px; padding: 16px 18px 18px; min-width: 0; }
#create .cc-detail.inline { grid-column: 1 / -1; position: static; }
#create .cc-empty { color: var(--muted); font-family: var(--prose-font); font-style: italic; margin: 0; }
#create .cc-head { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: end; margin-bottom: 10px; }
#create .cc-head.duo { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
#create .cc-head.duo > .cc-pic { width: 84px; }
#create .cc-head.duo > div { flex: 1 0 100%; }
#create .cc-detail .cc-dname { font-size: 26px; color: var(--gilt); line-height: 1.15; }
#create .cc-detail h5 { font-family: var(--chrome-font); font-weight: 400; font-size: 15px; color: var(--parchment-bright); margin: 10px 0 4px; }
#create .cc-short { margin: 4px 0 0; font-family: var(--prose-font); font-size: 14.5px; color: var(--parchment); }
#create .cc-hardwhy { color: var(--muted); border-left: 1px solid var(--rule-strong); padding-left: 12px; margin: 0 0 10px; }
#create .cc-hardwhy .cc-doc p { color: var(--muted); font-size: 14.5px; }
#create .cc-multi { font-family: var(--prose-font); font-size: 14.5px; color: var(--muted); margin: 0 0 10px; }
#create .cc-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; font-size: 14.5px; margin: 12px 0 0; }
#create .cc-facts dt { color: var(--muted); font-size: 13px; padding-top: 2px; margin: 0; font-family: var(--chrome-font); }
#create .cc-facts dd { margin: 0; padding: 0; font-family: var(--prose-font); }
/* Race traits (races[].traits): stat chips and relative gain meters */
#create .cc-traits { margin: 0 0 12px; }
#create .cc-stats { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
#create .cc-stat {
  font-family: var(--font); font-size: 13px; line-height: 1; padding: 5px 7px; border-radius: 2px;
  border: 1px solid var(--rule-strong); background: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums;
}
#create .cc-stat abbr { text-decoration: none; color: var(--muted); margin-right: 2px; }
#create .cc-stat.up { color: var(--verdigris); border-color: color-mix(in srgb, var(--verdigris) 45%, transparent); }
#create .cc-stat.down { color: var(--combat-text); border-color: color-mix(in srgb, var(--combat-text) 40%, transparent); }
#create .cc-nostats { margin: 0 0 10px; font-family: var(--prose-font); font-size: 14px; color: var(--muted); font-style: italic; }
#create .cc-meters { display: grid; grid-template-columns: auto minmax(36px, 1fr) auto; gap: 5px 10px; align-items: center; }
#create .cc-meter { display: contents; }
#create .cc-meter .k { color: var(--muted); font-size: 13px; }
#create .cc-meter .bar { height: 5px; background: var(--ink); border: 1px solid var(--rule); border-radius: 1px; overflow: hidden; }
#create .cc-meter .bar i { display: block; height: 100%; background: var(--gilt-deep); }
#create .cc-meter .w { font-family: var(--prose-font); font-size: 13.5px; color: var(--parchment); white-space: nowrap; }
@media (max-width: 360px) { #create .cc-meter .w { white-space: normal; } }
/* Quill text (descriptions): quill::render_html's classes */
#create .cc-doc { font-family: var(--prose-font); font-size: 15.5px; line-height: 1.55; }
#create .cc-doc p { margin: 0 0 10px; }
#create .cc-doc pre, #create .cc-doc .quill-pre, #create .cc-doc .quill-text {
  overflow-x: auto; white-space: pre; margin: 0 0 10px; padding: 6px 10px; background: var(--ink-high);
  font-family: var(--font); font-size: 12.5px; line-height: 1.45;
}
#create .cc-doc :is(kbd, code, .quill-kbd, .quill-code) { font-family: var(--font); font-size: 0.86em; color: var(--parchment-bright); }
#create .cc-doc .quill-arg { font-family: var(--font); font-style: italic; color: var(--arg); font-size: 0.9em; }
#create .cc-doc a { color: var(--gilt); }
#create .cc-doc img { max-width: 100%; height: auto; }
#create .cc-doc ul { margin: 0 0 10px; padding-left: 1.3em; }

@media (prefers-reduced-motion: reduce) {
  #create * { transition: none !important; }
}
