/* Gift-making and the order view use the same palette as the storefront.
   The preview itself continues to use the chosen world's artwork. */
:is(#create, #done, #buy-bar) {
  --ink: #fff1dc;
  --muted: #f0cbba;
  --accent: #efc28b;
  --accent-2: #ffe5b8;
  --on-accent: #501423;
  --theme-text: #fff1dc;
  --line: #d58c684e;
  --editor-border: #d58c6859;
  --editor-surface: #3b2430;
  --editor-field: #321d28;
}

:is(#create, #done) {
  background: linear-gradient(170deg, #572135 0, #3b2630 330px, #2c2028 780px);
  color: var(--ink);
}

:is(#create, #done) .page-heading {
  padding-top: 22px;
  padding-bottom: 18px;
  background: transparent;
}

:is(#create, #done) .page-heading h1 {
  margin-bottom: 9px;
  color: var(--holiday-paper, #fff1d3);
  font: 700 clamp(30px, 9.1vw, 42px)/1.03 Georgia, 'Times New Roman', serif;
  letter-spacing: -.047em;
  text-transform: none;
  text-wrap: balance;
}

:is(#create, #done) .page-heading :is(.eyebrow, p) {
  color: var(--muted);
}

#create .editor { background: transparent; }

:is(#create, #done) .live-preview {
  border-color: var(--editor-border);
  background: var(--editor-surface);
  box-shadow: 0 12px 22px #2c071e54;
}

:is(#create, #done) :is(.preview-head, .preview-foot, .owner-count) {
  background: #4b2637;
  background: linear-gradient(130deg, color-mix(in srgb, var(--surface-2) 64%, #753748), color-mix(in srgb, var(--surface) 64%, #572739));
  color: var(--ink);
  border-color: var(--editor-border);
}

:is(#create, #done) .preview-scene {
  height: clamp(220px, 38svh, 290px);
  background:
    linear-gradient(180deg, transparent 58%, #11101919 79%, #11101962 100%),
    var(--active-world) center 46% / cover no-repeat var(--surface);
}
:is(#create, #done) .preview-scene .gift-photo { height: 85%; top: 3%; }
#create .preview-name { text-shadow: 0 1px 4px #190b17, 0 2px 10px #190b17; }
#create .world-art {
  background-image: linear-gradient(180deg, transparent 62%, #160f1d45 100%), var(--world-art);
}

#create .preview-inside {
  background: linear-gradient(130deg, #73263c, #4c1524);
  border-color: var(--editor-border);
}
/* The "inside" chip sits in the scene's top corner: a long name on two lines never runs under it (18.11.). */
:is(#create, #done) .preview-scene .preview-inside { top: 10px; bottom: auto; right: 10px; max-width: 44%; min-height: 0; gap: 5px; padding: 4px 9px 4px 5px; }
:is(#create, #done) .preview-scene .preview-inside-art { width: 26px; height: 26px; }
:is(#create, #done) .preview-scene .preview-inside-art :is(img, svg) { width: 29px; height: 29px; }
:is(#create, #done) .preview-scene .preview-inside-name { font-size: 13px; max-width: none; }

:is(#create, #done, #buy-bar) .btn.primary,
:is(#create, #done) .btn.light {
  background: linear-gradient(#fff1d4, #f6d69b);
  color: #611825;
  border-color: #ffe1ab;
  box-shadow: inset 0 1px #fff4, 0 3px 0 #30091466, 0 6px 14px #2b081936;
  text-shadow: none;
}

:is(#create, #done) .btn.ghost {
  background: linear-gradient(#763047, #551727);
  color: var(--ink);
  border-color: var(--editor-border);
  box-shadow: inset 0 1px #ffe5ba15, 0 3px 0 #2c081849;
}

:is(#create, #done) :is(.btn, .chip, .segmented button, .text-btn, .swatch):focus-visible {
  outline-color: #ffcb80;
}

#create .segmented {
  border-color: var(--editor-border);
  background: #471221;
}

#create .segmented button { color: var(--ink); }
#create .segmented button[aria-pressed="true"] {
  color: #611825;
  background: linear-gradient(#fff1d4, #f4d59b);
}

#create .step { border-color: var(--editor-border); }
#create .step h2, #create .step summary {
  font: 700 21px/1.1 Georgia, 'Times New Roman', serif;
  letter-spacing: -.029em;
  text-transform: none;
}

#create .step h2 span {
  color: #ffdfaa;
  border-color: var(--editor-border);
  background: #772f40;
}

#create #message-step {
  --ink: #411321;
  --muted: #704751;
  --accent: #8c2540;
  --accent-2: #812139;
  --editor-border: #af775877;
  --editor-field: #fff8e9;
  background: linear-gradient(125deg, #fff1d9, #fae6c8);
  color: var(--ink);
  border: 1px solid #ffe2b4;
  border-radius: 16px;
  padding: 17px 15px;
  margin: 16px 0 5px;
  box-shadow: 0 9px 18px #2b071e42;
}

#create #message-step h2 span { color: #681830; background: #f2cb9e; }
#create #message-step .text-btn { color: #7a1937; }
#create #message-step .text-btn:focus-visible { outline-color: #8c2540; }
#create #message-step .btn.ghost { box-shadow: none; }

:is(#create, #done) :is(.help, .count, .surprise-note, .picker-copy, .field em) { color: var(--muted); }
:is(#create, #done) :is(.field, .picker-current, .surprise-copy small) { color: var(--ink); }
:is(#create, #done) :is(.field input, .field textarea, .field select, .linkbox input) {
  background: var(--editor-field);
  border-color: var(--editor-border);
  color: var(--ink);
}

#create #message-step :is(input, textarea)::placeholder { color: #75515b; }
#create :is(.field input, .field textarea, .field select):focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 23%, transparent);
}

#create :is(.chip, .surprise-card, .world-card) {
  background: linear-gradient(140deg, #703146, #4d1427);
  border-color: var(--editor-border);
  color: var(--ink);
  box-shadow: inset 0 1px #ffe5ba1c, 0 3px 0 #30091669;
}

#create .chip[aria-pressed="true"] {
  background: linear-gradient(#fff1d4, #f2ca93);
  border-color: #ffe1ab;
  color: #611825;
}

#create .opening-hints-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 11px 12px;
  border: 1px solid var(--editor-border);
  border-radius: 13px;
  background: #762c3e3b;
  cursor: pointer;
}
#create .opening-hints-choice strong { display: block; color: var(--ink); font: 700 14px/1.3 Arial, sans-serif; }
#create .opening-hints-choice small { display: block; margin-top: 3px; color: var(--muted); font: 12px/1.38 Arial, sans-serif; }
#create #opening-hints {
  appearance: none;
  display: grid;
  place-items: center start;
  width: 44px;
  height: 26px;
  margin: 0;
  padding: 3px;
  border: 1px solid #dba878aa;
  border-radius: 20px;
  background: #391824;
  color: #ffedcd;
  cursor: pointer;
}
#create #opening-hints::before { content: ''; width: 14px; height: 14px; border-radius: 50%; background: currentColor; }
#create #opening-hints:checked { justify-items: end; background: #f2ca93; border-color: #ffe1ab; color: #611825; }
#create #opening-hints:focus-visible { outline: 2px solid #ffe1ab; outline-offset: 4px; }

#create .surprise-card[aria-pressed="true"] {
  background: linear-gradient(140deg, #8e3c50, #5c192e);
  border-color: var(--accent);
}

#create .surprise-card[aria-pressed="true"] .surprise-check { color: #531627; }
#create .world-card[aria-pressed="true"] { border-color: var(--world-card-accent); }
#create .swatch { color: var(--muted); }
#create .swatch[aria-pressed="true"] { color: var(--accent-2); }
#create .sent, #create .sent li { border-color: var(--editor-border); }
#create .note-bar { color: var(--ink); border-color: var(--editor-border); background: #531829; }
#create .upload-row .thumb:not(.on) { border-color: var(--editor-border); background-color: #f4dbc0; }

#done .name-list { background: #521726; border-color: var(--editor-border); }
#done #names-list li { border-color: var(--editor-border); }
#done :is(.owner-state, #done-fine) { color: var(--ink); }

#create .mini-preview, #buy-bar {
  background: linear-gradient(105deg, #741b32f5, #501323fa);
  border-color: var(--editor-border);
}

#create .mini-copy strong { color: var(--ink); }
#create .mini-copy small { color: var(--muted); }
#buy-bar .buy-bar-price strong { color: #ffe5b8; }

@media (max-width: 360px) {
  #done .owner { padding-inline: 20px; }
  #create #message-step { padding-inline: 13px; }
}
