/* Style the Drop — page + game styles. All colours come from CSS variables set
   from the brand config at runtime, so the same stylesheet serves every brand. */

:root {
  --bg: #fbf6ee; --surface: #fff; --ink: #2b2622; --muted: #7d746c;
  --accent: #e2593f; --accent-ink: #fff; --stage: #f3e6d3; --stage-alt: #f9d9c4;
  --font-display: "Iowan Old Style", Palatino, Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(0,0,0,0.08);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid rgba(0,0,0,0.18); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 10px 18px; font-size: 0.92rem; text-decoration: none; transition: transform .12s ease, box-shadow .12s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.big { padding: 14px 26px; font-size: 1.02rem; }
.btn.ghost { background: transparent; }

/* ---------- switcher (sample only) ---------- */
.switcher { position: absolute; top: 12px; right: 16px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 0.72rem; color: var(--muted); z-index: 5; }
.switcher a { text-decoration: none; padding: 3px 9px; border-radius: 999px; border: 1px solid rgba(0,0,0,0.12); background: var(--surface); }
.switcher a[aria-current] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- hero ---------- */
.hero { max-width: 1120px; margin: 0 auto; padding: 56px 24px 24px; }
.hero-top { display: flex; align-items: baseline; gap: 16px; margin-bottom: 44px; }
.logo { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: 0.18em; text-transform: uppercase; }
.logo img { height: 34px; display: block; }
.tagline { font-size: 0.85rem; color: var(--muted); }
.kicker { font-size: 0.74rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
.title { font-size: clamp(2.6rem, 7vw, 5.4rem); line-height: 1.02; max-width: 12ch; }
.subtitle { max-width: 44ch; font-size: 1.08rem; color: var(--muted); margin: 18px 0 26px; }
.footnote { font-size: 0.76rem; color: var(--muted); margin: 12px 0 0; }

/* ---------- game ---------- */
.game-section { max-width: 1120px; margin: 24px auto 0; padding: 0 16px; }
.std-game { position: relative; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.std-main { display: grid; grid-template-columns: minmax(230px, 36%) 1fr; gap: 14px; align-items: stretch; min-width: 0; }
.std-main > * { min-width: 0; }
.std-stage { position: relative; background: var(--stage); border-radius: 12px; overflow: hidden; height: min(78vh, 760px); display: flex; justify-content: center; touch-action: none; user-select: none; -webkit-user-select: none; transition: box-shadow .15s ease; }
.std-stage svg { height: 100%; width: auto; max-width: 100%; display: block; }
.std-stage.is-target { box-shadow: inset 0 0 0 3px var(--accent); }
.std-stage.is-removing { box-shadow: inset 0 0 0 3px #d33; }
.std-stage.pulse { animation: std-pulse .35s ease; }
@keyframes std-pulse { 0% { transform: scale(1); } 40% { transform: scale(1.012); } 100% { transform: scale(1); } }
.std-stage [data-slot] { cursor: grab; }
.std-stage-hint { position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 6px); background: var(--accent); color: var(--accent-ink); font-size: 0.78rem; padding: 6px 12px; border-radius: 999px; opacity: 0; transition: all .15s; pointer-events: none; }
.std-stage-hint.show { opacity: 1; transform: translate(-50%, 0); }

.std-rack { display: flex; flex-direction: column; min-width: 0; height: min(78vh, 760px); }
.std-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 10px; }
.std-tab { border: 1px solid rgba(0,0,0,0.14); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 0.8rem; position: relative; }
.std-tab.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.std-tab.worn::after { content: ''; position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.std-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; overflow-y: auto; padding: 2px 2px 8px; align-content: start; flex: 1; }
.std-note { grid-column: 1 / -1; font-size: 0.8rem; color: var(--muted); margin: 0; }
.std-card { position: relative; background: var(--bg); border: 1px solid rgba(0,0,0,0.08); border-radius: 12px; padding: 8px; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; transition: transform .12s ease, box-shadow .12s ease, border-color .12s; }
.std-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.08); }
.std-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.std-card.worn { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.std-thumb { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.std-thumb svg { width: 100%; height: 100%; }
.std-card-meta { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; pointer-events: none; }
.std-card-name { font-size: 0.8rem; line-height: 1.2; }
.std-card-price { font-size: 0.74rem; color: var(--muted); }
.std-swatches { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.std-swatches.big { gap: 7px; }
.std-swatch { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px rgba(0,0,0,0.2); padding: 0; }
.std-swatches.big .std-swatch { width: 24px; height: 24px; }
.std-swatch.on { box-shadow: 0 0 0 2px var(--accent); }
.std-remove { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; border: none; background: var(--ink); color: var(--bg); font-size: 0.95rem; line-height: 1; }
.std-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.std-chip { border: 1px solid rgba(0,0,0,0.14); background: var(--surface); border-radius: 999px; padding: 4px 10px; font-size: 0.78rem; }
.std-chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.std-you { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 14px; }
.std-you-row { display: flex; flex-direction: column; gap: 6px; }
.std-you-row > span { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.std-bar { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.std-total { margin-right: auto; font-size: 0.9rem; }
.std-btn { border: 1px solid rgba(0,0,0,0.18); background: var(--surface); border-radius: 999px; padding: 9px 16px; font-size: 0.86rem; text-decoration: none; display: inline-flex; align-items: center; }
.std-btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.std-btn.ghost { background: transparent; }
.std-link { border: none; background: none; text-decoration: underline; font-size: 0.82rem; color: var(--muted); padding: 0; margin-top: 8px; }

.std-lookcard { display: grid; grid-template-columns: 180px 1fr; gap: 16px; margin-top: 14px; padding: 14px; background: var(--bg); border-radius: 12px; }
.std-lc-figure { border-radius: 10px; overflow: hidden; }
.std-lc-figure svg { display: block; width: 100%; height: auto; }
.std-lc-kicker { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin: 0 0 4px; }
.std-lc-body h3 { font-size: 1.4rem; margin-bottom: 8px; }
.std-lc-list { list-style: none; margin: 0 0 12px; padding: 0; font-size: 0.85rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 14px; }
.std-lc-list li { display: flex; align-items: center; gap: 7px; }
.std-lc-list em { margin-left: auto; font-style: normal; color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.std-dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.15); flex: none; }
.std-lc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.std-capture label { display: block; font-size: 0.86rem; margin-bottom: 6px; }
.std-capture-row { display: flex; gap: 6px; }
.std-capture-row input { flex: 1; min-width: 0; border: 1px solid rgba(0,0,0,0.2); border-radius: 999px; padding: 8px 14px; background: var(--surface); }
.std-capture small { display: block; font-size: 0.7rem; color: var(--muted); margin-top: 6px; }
.std-code { font-size: 0.9rem; margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--surface); border: 1px dashed var(--accent); }
.std-toast { position: absolute; left: 50%; bottom: 16px; transform: translate(-50%, 8px); background: var(--ink); color: var(--bg); font-size: 0.8rem; padding: 7px 14px; border-radius: 999px; opacity: 0; transition: all .2s; pointer-events: none; z-index: 3; max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.std-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* drag ghost */
.std-ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 4px; will-change: transform; }
.std-ghost-thumb { width: 96px; height: 96px; background: var(--surface); border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,0.22); padding: 6px; transform: rotate(-3deg) scale(1.04); }
.std-ghost-thumb svg { width: 100%; height: 100%; }
.std-ghost span { font-size: 0.72rem; background: var(--ink); color: var(--bg); padding: 3px 8px; border-radius: 999px; }
body.std-dragging { cursor: grabbing; }
body.std-dragging * { cursor: grabbing !important; }

/* ---------- how / pitch ---------- */
.how { max-width: 1120px; margin: 40px auto 0; padding: 0 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.how-step { border-top: 1px solid rgba(0,0,0,0.12); padding-top: 14px; }
.how-n { display: inline-block; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 0.8rem; text-align: center; line-height: 26px; margin-bottom: 8px; }
.how-step h3 { font-size: 1.2rem; margin-bottom: 4px; }
.how-step p { margin: 0; font-size: 0.9rem; color: var(--muted); }
.pitch { margin-top: 64px; border-top: 1px solid rgba(0,0,0,0.1); background: var(--surface); }
.pitch-inner { max-width: 1120px; margin: 0 auto; padding: 32px 24px 48px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.pitch-kicker { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin: 0; }
.pitch-line { font-family: var(--font-display); font-size: 1.4rem; margin: 0 0 8px; max-width: 30ch; }

/* ---------- editor drawer ---------- */
.editor { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: #fff; color: #222; border-left: 1px solid #ddd; box-shadow: -10px 0 30px rgba(0,0,0,0.08); overflow-y: auto; z-index: 50; font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; font-size: 0.82rem; }
body.has-editor { padding-right: min(440px, 100vw); }
.editor-head { padding: 14px 16px; border-bottom: 1px solid #eee; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; background: #fff; z-index: 1; }
.editor-head span { color: #777; font-size: 0.75rem; }
.editor-body { padding: 8px 16px 40px; }
.ed-section { padding: 12px 0; border-bottom: 1px solid #eee; }
.ed-section h4 { margin: 0 0 8px; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: #777; }
.ed-field { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.ed-field span { font-size: 0.72rem; color: #555; }
.ed-field span em { color: #999; font-style: normal; margin-left: 6px; }
.ed-field input, .ed-field textarea, .ed-field select { border: 1px solid #ccc; border-radius: 6px; padding: 6px 8px; font-size: 0.82rem; background: #fff; }
.ed-colours { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ed-colour { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 0.66rem; color: #666; }
.ed-colour input { width: 100%; height: 30px; border: 1px solid #ccc; border-radius: 6px; padding: 0; background: none; }
.ed-catalog { display: flex; flex-direction: column; gap: 8px; }
.ed-row { display: grid; grid-template-columns: 1fr 1fr 70px; gap: 4px; padding: 6px; border: 1px solid #eee; border-radius: 8px; background: #fafafa; }
.ed-row input, .ed-row select { border: 1px solid #ccc; border-radius: 5px; padding: 4px 6px; font-size: 0.76rem; min-width: 0; }
.ed-cols { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 3px; }
.ed-col { display: flex; gap: 3px; align-items: center; }
.ed-col input[type=color] { width: 26px; height: 22px; padding: 0; border: 1px solid #ccc; }
.ed-col select { font-size: 0.7rem; }
.ed-col button, .ed-row button, .ed-add, .ed-actions button { border: 1px solid #ccc; background: #fff; border-radius: 6px; padding: 3px 8px; font-size: 0.72rem; }
.ed-actions { display: flex; gap: 6px; margin: 6px 0 10px; }
.ed-help { color: #666; font-size: 0.74rem; margin: 0 0 8px; }
.ed-help code { font-size: 0.7rem; }

/* ---------- ticker (debug) ---------- */
.ticker { position: fixed; left: 12px; bottom: 12px; width: min(420px, 60vw); max-height: 110px; overflow: auto; background: #111; color: #cfe; font-family: "SF Mono", Menlo, monospace; font-size: 0.66rem; padding: 8px 10px; border-radius: 8px; z-index: 40; opacity: 0.92; line-height: 1.45; white-space: pre; }
.ticker div { white-space: nowrap; }

/* ---------- embed mode ---------- */
body.embed { background: transparent; }
body.embed .hero, body.embed .how, body.embed .pitch, body.embed .switcher { display: none; }
body.embed .game-section { margin: 0; padding: 0; max-width: none; }
body.embed .std-game { box-shadow: none; border-radius: 0; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .hero { padding-top: 40px; }
  .switcher { position: static; padding: 10px 16px 0; }
  .std-main { grid-template-columns: 1fr; }
  .std-stage { height: min(52vh, 560px); min-height: 360px; }
  .std-rack { height: auto; }
  .std-items { max-height: 44vh; }
  .how { grid-template-columns: 1fr; gap: 14px; }
  .std-lookcard { grid-template-columns: 1fr; }
  .std-lc-figure { max-width: 200px; }
  body.has-editor { padding-right: 0; }
  .editor { width: 100vw; top: auto; height: 55vh; border-left: none; border-top: 1px solid #ddd; }
}
@media (prefers-reduced-motion: reduce) {
  .std-stage.pulse { animation: none; }
  .btn, .std-card { transition: none; }
}

.sample-notice { padding: 12px 5%; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; border-bottom: 1px solid #d9cfc2; font: 12px/1.5 -apple-system, sans-serif; }
.sample-notice a { color: inherit; }
.embed .sample-notice { display: none; }
