/* The character creator (make.html): one screen like a game's, with the character on a platform in the middle, the
   sections down the left and the chosen section's parts on the right, on frosted glass over a soft lit stage. */
body.making { overflow: hidden; }
.cc { position: relative; height: calc(100vh - 68px); height: calc(100dvh - 68px); min-height: 620px; overflow: hidden;
  background: radial-gradient(50% 62% at 42% 50%, #fffaf3 0%, #f6ebdf 52%, #ead8c8 100%); }
/* a faint dot grid that fades out toward the edges */
.cc::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(118, 52, 47, 0.13) 1px, transparent 1.4px); background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(46% 58% at 42% 52%, #000 0%, transparent 100%); mask-image: radial-gradient(46% 58% at 42% 52%, #000 0%, transparent 100%); }
.glass { background: rgba(255, 251, 246, 0.74); -webkit-backdrop-filter: blur(18px) saturate(1.15); backdrop-filter: blur(18px) saturate(1.15);
  border: 1px solid rgba(221, 201, 182, 0.75); border-radius: 22px; box-shadow: 0 1px 2px rgba(42, 24, 20, 0.05), 0 18px 48px rgba(42, 24, 20, 0.09); }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
svg .fill { fill: currentColor; stroke: none; }

/* ---------- the stage ---------- */
.stage { position: absolute; top: 0; bottom: 0; left: 128px; right: 448px; }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity 0.35s; }
.stage.live iframe { opacity: 1; }
.wait { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); font-size: 15px; pointer-events: none; transition: opacity 0.3s; }
.wait i { width: 56px; height: 56px; border-radius: 14px; border: 2px solid var(--line-2); border-top-color: var(--maroon); animation: turn 0.9s linear infinite; }
.stage.live .wait:not(.busy) { opacity: 0; }
/* while Claude looks at a photo, over the character */
.wait.busy { background: rgba(247, 241, 234, 0.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); color: var(--ink); }
@keyframes turn { to { transform: rotate(360deg); } }
/* said once, then it goes */
.stage .hint { position: absolute; top: 22px; left: 0; right: 0; text-align: center; font-size: 13px; color: var(--muted); pointer-events: none; animation: say 7s forwards; }
@keyframes say { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
.tools { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; gap: 2px; padding: 5px; border-radius: 18px; }
.tools button, .tools label { display: flex; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--ink); font: 600 14px/1 var(--sans);
  padding: 10px 13px; border-radius: 13px; cursor: pointer; white-space: nowrap; }
.tools svg { width: 19px; height: 19px; }
.tools button:hover, .tools label:hover { background: rgba(42, 24, 20, 0.06); }
.tools button:disabled { opacity: 0.35; pointer-events: none; }

/* ---------- the sections ---------- */
.rail { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 2px; padding: 7px; }
.rail button { position: relative; width: 86px; height: 64px; display: grid; place-content: center; justify-items: center; gap: 6px; border: 0; border-radius: 15px;
  background: transparent; color: var(--muted); font: 600 12px/1 var(--sans); cursor: pointer; transition: background 0.12s, color 0.12s; }
.rail svg { width: 23px; height: 23px; }
.rail button:hover { background: rgba(42, 24, 20, 0.05); color: var(--ink); }
.rail button.on { background: var(--maroon); color: #fff7f2; box-shadow: 0 6px 16px rgba(118, 52, 47, 0.28); }
/* how many things are worn in a section of accessories */
.rail .n { position: absolute; top: 7px; right: 14px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--maroon); color: #fff7f2;
  font: 700 10px/17px var(--sans); text-align: center; }
.rail button.on .n { background: #fff7f2; color: var(--maroon); }

/* ---------- the parts ---------- */
.panel { position: absolute; right: 20px; top: 20px; bottom: 20px; width: 408px; display: flex; flex-direction: column; overflow: hidden; }
.panel header { padding: 24px 24px 10px; }
.panel h2 { font-size: 30px; letter-spacing: -0.03em; }
.panel header .caption { font-size: 14px; margin-top: 6px; }
.slots { flex: 1; overflow-y: auto; padding: 4px 12px 12px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
/* the name and Save, always at hand */
.panel footer { display: flex; gap: 10px; padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.panel footer .field { flex: 1; min-width: 0; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; padding: 14px 15px; }
.panel footer .field::placeholder { text-transform: none; letter-spacing: 0; font-weight: 400; }
.panel footer .btn { flex: none; padding-left: 28px; padding-right: 28px; }

/* a slot: its name and its arrows, then only the details it has right now */
.slot { padding: 14px 12px; border-radius: 16px; transition: background 0.15s; }
.slot + .slot { border-top: 1px solid rgba(221, 201, 182, 0.6); }
.slot.hot { background: rgba(255, 251, 246, 0.85); }
.slot-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; }
.slot-name { font: 600 15.5px/1.2 var(--sans); }
.slot.off .slot-name { color: var(--muted); font-weight: 500; }
.slot-body { display: grid; gap: 12px; margin-top: 12px; }
.slot-body:empty { display: none; }

/* the arrows: step through every choice (hold to keep going); the middle opens them all */
.step { display: flex; align-items: center; width: 214px; flex: none; background: var(--card); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; }
.step.small { width: 190px; }
.step .arr { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; touch-action: manipulation; }
.step .arr svg { width: 17px; height: 17px; stroke-width: 2; }
.step .arr:hover { background: var(--bg-2); }
.step .arr:active, .step .arr.held { background: var(--blush); }
.step .val { flex: 1; min-width: 0; border: 0; background: none; cursor: pointer; display: grid; gap: 3px; justify-items: center; padding: 2px 4px; border-radius: 10px; color: var(--ink); }
.step .val b { font: 600 14.5px/1.1 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.step .val small { font: 500 11px/1 var(--sans); color: var(--dim); letter-spacing: 0.03em; }
.step .val:focus-visible, .step .arr:focus-visible, .dot:focus-visible { outline: 2px solid var(--maroon); outline-offset: 2px; }
/* every choice at once */
.all { display: flex; flex-wrap: wrap; gap: 6px; }
.all button { font: 500 13.5px/1 var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 11px; cursor: pointer; }
.all button:hover { border-color: var(--muted); }
.all button.on { background: var(--maroon); border-color: var(--maroon); color: #fff7f2; }

/* a detail: a small name over its control */
.sub { display: grid; gap: 8px; }
.sub.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sub-name { font: 500 13px/1.2 var(--sans); color: var(--muted); }
.sub input.txt { font: 500 15px/1.2 var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; width: 100%; outline: none; text-transform: uppercase; }
.sub input.txt::placeholder { color: var(--dim); text-transform: none; }
.sub input.txt:focus { border-color: var(--maroon); box-shadow: 0 0 0 3px rgba(118, 52, 47, 0.12); }

/* colours: block-shaped swatches, then automatic and any colour */
.sw { display: flex; flex-wrap: wrap; gap: 4px; }
.dot { width: 23px; height: 23px; flex: none; padding: 0; border-radius: 7px; background: var(--c); border: 1px solid rgba(42, 24, 20, 0.14); cursor: pointer; position: relative; transition: transform 0.1s; }
.dot:hover { transform: translateY(-1px); }
.dot.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--maroon); }
.dot.auto { background: var(--card); color: var(--muted); font: 700 10px/1 var(--sans); display: grid; place-items: center; }
.dot.pick { background: conic-gradient(#e2504a, #eec44a, #6fc36a, #4aa8e2, #8a5ae2, #e24ab0, #e2504a); overflow: hidden; }
.dot.pick.set { background: var(--c); }
.dot.pick.set::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 3px 0 6px 0; background: conic-gradient(#e2504a, #eec44a, #6fc36a, #4aa8e2, #8a5ae2, #e2504a); }
.dot.pick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }

/* ---------- smaller screens ---------- */
@media (max-width: 1180px) {
  .stage { left: 112px; right: 392px; }
  .rail button { width: 72px; height: 60px; font-size: 11.5px; }
  .panel { width: 360px; }
  .step { width: 190px; }
  .step.small { width: 170px; }
  .dot { width: 20px; height: 20px; border-radius: 6px; }
  .tools span { display: none; }
  .tools button, .tools label { padding: 10px 12px; }
}
/* phones and tablets: the character pinned on top (so every change shows), the sections as a row pinned under it, the
   parts scrolling below, the name and Save always in reach */
@media (max-width: 820px) {
  body.making { overflow: auto; }
  body.making .top { position: static; }
  .cc { height: auto; min-height: 0; overflow: visible; padding-bottom: 92px; background: radial-gradient(90% 40% at 50% 22%, #fffaf3 0%, #f6ebdf 60%, #ecdccd 100%); }
  .cc::before { -webkit-mask-image: radial-gradient(80% 30% at 50% 22%, #000 0%, transparent 100%); mask-image: radial-gradient(80% 30% at 50% 22%, #000 0%, transparent 100%); }
  .stage { position: sticky; top: 0; z-index: 6; left: auto; right: auto; height: 42vh; min-height: 290px;
    background: radial-gradient(90% 85% at 50% 45%, #fffaf3 0%, #f6ebdf 60%, #ecdccd 100%); }
  .stage .hint { display: none; }
  .tools { bottom: 10px; }
  .rail { position: sticky; top: max(42vh, 290px); z-index: 6; left: auto; transform: none; flex-direction: row; overflow-x: auto; margin: 0; padding: 6px 10px;
    border-radius: 0; border-width: 1px 0; scrollbar-width: none; background: rgba(255, 251, 246, 0.94); }
  .rail::-webkit-scrollbar { display: none; }
  .rail button { width: 66px; height: 54px; flex: none; }
  .panel { position: relative; inset: auto; width: auto; margin: 10px 12px 0; overflow: visible; -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(255, 251, 246, 0.9); }
  .panel header { padding: 18px 18px 6px; }
  .slots { overflow: visible; padding: 2px 6px 8px; }
  .panel footer { position: fixed; z-index: 15; left: 12px; right: 12px; bottom: 12px; padding: 8px; border: 1px solid rgba(221, 201, 182, 0.75); border-radius: 18px;
    background: rgba(255, 251, 246, 0.86); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 10px 30px rgba(42, 24, 20, 0.14); }
  .step { width: 180px; }
  .step.small { width: 168px; }
  .step .arr { width: 38px; height: 38px; }
  .dot { width: 34px; height: 34px; border-radius: 9px; }
  .sw { gap: 8px; }
}
@media (max-width: 380px) { .step { width: 160px; } .step.small { width: 150px; } .slot-head { gap: 8px; } }

/* a photo being dragged over the page: drop it anywhere */
.cc.dropping::after { content: 'Drop the photo to make them from it'; position: fixed; inset: 12px; z-index: 60; display: grid; place-items: center; pointer-events: none;
  border: 3px dashed var(--maroon); border-radius: 26px; background: rgba(255, 250, 243, 0.86); font: 600 26px/1.2 var(--sans); color: var(--maroon); text-align: center; padding: 24px; }
/* while dragging, the 3D lets the drop through to the page */
.cc.dropping #view { pointer-events: none; }

/* ---------- from a photo (js/photo.js): the drawing big, the three answers beside it, earlier drawings under it ---------- */
.pc { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; background: rgba(42, 24, 20, 0.34);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.pc[hidden] { display: none; }
.pc-card { position: relative; max-width: 100%; max-height: 100%; overflow: auto; background: var(--card); border-radius: 26px; box-shadow: var(--lift); padding: 26px 30px 28px; }
.pc-card header { padding-right: 52px; }
.pc-card h2 { font-size: 30px; letter-spacing: -0.03em; }
.pc-card header .caption { margin-top: 6px; font-size: 15.5px; }
.pc-x { position: absolute; top: 18px; right: 18px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--bg-2); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.pc-x svg { width: 20px; height: 20px; stroke-width: 2; }
.pc-x:hover { background: var(--line); }
.pc-main { display: grid; grid-template-columns: auto 300px; gap: 30px; margin-top: 20px; align-items: start; }
/* the drawing: as big as the screen allows, 4:5 like the sheets */
.pc-pic { position: relative; height: min(560px, calc(100vh - 290px)); height: min(560px, calc(100dvh - 290px)); min-height: 300px; aspect-ratio: 4 / 5;
  border-radius: 18px; overflow: hidden; background: #e2dbd3; }
.pc-pic img { display: block; width: 100%; height: 100%; object-fit: contain; }
.pc-pic.busy img { filter: blur(4px) saturate(0.7); opacity: 0.5; }
.pc-blank { width: 100%; height: 100%; background: linear-gradient(110deg, #e2dbd3 30%, #ece6df 50%, #e2dbd3 70%); background-size: 250% 100%; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.pc-cover { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 20px; }
.pc-cover b { font: 600 21px/1.2 var(--sans); }
.pc-cover small { font: 500 14px/1 var(--sans); color: var(--muted); }
.pc-bar { width: 220px; height: 8px; border-radius: 99px; background: rgba(42, 24, 20, 0.1); overflow: hidden; }
.pc-bar i { display: block; height: 100%; border-radius: inherit; background: var(--maroon); transition: width 2s linear; }
.pc-bar.big { width: 100%; height: 10px; margin-top: 6px; }
.pc-note { margin-top: 12px; max-width: 448px; font: 500 14.5px/1.4 var(--sans); color: #a3332b; }
/* every drawing so far, small: a worse new one never loses a good one */
.pc-tries { display: flex; gap: 8px; margin-top: 14px; max-width: 448px; overflow-x: auto; scrollbar-width: thin; }
.pc-tries:empty { display: none; }
.pc-tries button { flex: none; width: 92px; display: grid; gap: 3px; justify-items: center; padding: 6px 6px 7px; border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--card); color: var(--ink); font: 600 12px/1.2 var(--sans); cursor: pointer; }
.pc-tries button.on { border-color: var(--maroon); box-shadow: 0 0 0 1px var(--maroon); }
.pc-tries img { width: 78px; height: 98px; object-fit: cover; object-position: top; border-radius: 9px; background: #e2dbd3; }
.pc-tries span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-tries small { font: 500 11px/1 var(--sans); color: var(--dim); }
/* the three answers, or the build's progress */
.pc-side { display: grid; gap: 12px; }
.pc-side .btn.big { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; }
.pc-side .btn span { font-weight: 500; font-size: 14px; opacity: 0.8; white-space: nowrap; }
.pc-small { font: 400 13.5px/1.5 var(--sans); color: var(--muted); margin-top: 2px; }
.link { border: 0; background: none; padding: 0; font: inherit; color: var(--maroon); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.pc-change { display: grid; gap: 12px; }
.pc-change label { font: 600 17px/1.2 var(--sans); }
.pc-change textarea { font: 500 16px/1.4 var(--sans); color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 14px; padding: 13px 14px; resize: none; outline: none; }
.pc-change textarea:focus { border-color: var(--maroon); box-shadow: 0 0 0 3px rgba(118, 52, 47, 0.12); }
.pc-steps { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 16px; }
.pc-steps li { display: flex; align-items: center; gap: 12px; font: 500 16px/1.25 var(--sans); color: var(--dim); }
.pc-steps i { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); }
.pc-steps .done { color: var(--ink); }
.pc-steps .done i { border-color: var(--maroon); background: var(--maroon) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff7f2' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 16px no-repeat; }
.pc-steps .now { color: var(--ink); font-weight: 600; }
.pc-steps .now i { border-color: var(--maroon); border-right-color: transparent; animation: turn 0.9s linear infinite; }
/* the photo head, in the creator's Body section */
.headcard .tag { font: 600 12px/1 var(--sans); color: var(--maroon); background: rgba(118, 52, 47, 0.09); padding: 7px 10px; border-radius: 99px; }
.headcard .caption { margin-top: 8px; font-size: 14px; line-height: 1.45; }
.headcard .link { display: block; margin-top: 8px; font-size: 14px; }
/* a whole body from a photo: nothing to randomise or reset */
.cc.whole .tools [data-act="random"], .cc.whole .tools [data-act="reset"] { display: none; }
body.pc-open { overflow: hidden; }
@media (max-width: 820px) {
  .pc { padding: 0; place-items: stretch; }
  .pc-card { border-radius: 0; padding: 20px 16px 28px; }
  .pc-card h2 { font-size: 25px; }
  .pc-x { top: 14px; right: 12px; }
  /* one column: the drawing, the answers right under it, then the earlier drawings */
  .pc-main { display: flex; flex-direction: column; align-items: stretch; gap: 16px; margin-top: 16px; }
  .pc-left { display: contents; }
  .pc-pic { order: 1; height: auto; width: 100%; min-height: 0; max-width: 460px; margin: 0 auto; }
  .pc-note { order: 2; margin: 0; max-width: none; }
  .pc-side { order: 3; }
  .pc-tries { order: 4; margin: 0; max-width: none; }
}
