:root {
  color-scheme: dark;
  --base: #211510;
  --panel: #2e1e17;
  --line: #5a3c2c;
  --ink: #fff2dc;
  --muted: #dfc0a5;
  --red: #ffad52;
  --red-dark: #983719;
  font: 16px/1.5 system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(ellipse at 74% 0%, #472717, transparent 36rem), var(--base);
}
.shell { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.bar { border-bottom: 1px solid var(--line); background: #211510d9; }
.brand { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wordmark, .dromfit { display: block; height: auto; filter: brightness(0) invert(1); }
.wordmark { width: 44px; opacity: .85; }
.dromfit { width: clamp(64px, 12vw, 110px); }
.studio, .edition, .start, .preview-head h2, .editor h2 {
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.studio { color: var(--ink); font-size: clamp(.75rem, 2.5vw, 1rem); text-align: center; }
.intro {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 345px;
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid #ffb751;
  background:
    repeating-radial-gradient(ellipse at 90% 150%, transparent 0 28px, #ffd67a42 30px 36px, transparent 39px 54px),
    linear-gradient(112deg, #a4331c, #e85822 52%, #ffbe36);
}
.hero-nine {
  position: absolute;
  z-index: -1;
  right: 6%;
  bottom: -.32em;
  font-size: clamp(15rem, 44vw, 34rem);
  font-weight: 950;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px #fff2cb95;
  transform: skewX(-10deg);
  user-select: none;
}
.intro-content { padding: 38px clamp(22px, 5vw, 64px); }
.edition { margin: 0 0 15px; color: #fff5e3; font-size: .875rem; }
.edition span { margin-right: .65rem; }
.intro h1 {
  margin: 0;
  color: #fff5e3;
  font-size: clamp(1.42rem, 6vw, 4.4rem);
  line-height: .87;
  font-weight: 950;
  letter-spacing: -.075em;
  text-transform: uppercase;
}
.intro h1 span { display: block; margin-bottom: .35em; font-size: .32em; letter-spacing: .08em; }
.intro-content > p:not(.edition) { max-width: 37ch; color: #fff6e6; margin: 17px 0 20px; }
.start {
  display: inline-block;
  padding: 10px 15px;
  border: 1px solid #fff0d0;
  color: #34180e;
  background: #fff0d0;
  font-size: .875rem;
  text-decoration: none;
}
.start:hover { background: #ffce73; }
.workspace {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 20px;
  align-items: start;
  padding: 24px 0 55px;
}
.card { min-width: 0; padding: 22px; border: 1px solid var(--line); background: var(--panel); }
.card h2 { margin: 0; font-size: 1.05rem; }
.editor h2 { border-left: 3px solid var(--red); padding-left: 10px; margin-bottom: 16px; }
.editor label:not(.drop) { display: block; font-weight: 650; margin: 12px 0 6px; font-size: .94rem; }
.fields { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: 10px; }
.editor select, .editor input[type=text] {
  width: 100%; min-height: 44px; padding: 9px 11px;
  border: 1px solid #75513c;
  border-radius: 2px;
  background: #211510;
  color: var(--ink);
  font: inherit;
}
.editor select {
  appearance: none;
  padding-right: 30px;
  background: linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 15px center / 5px 5px no-repeat,
              linear-gradient(135deg, var(--muted) 50%, transparent 50%) right 10px center / 5px 5px no-repeat,
              #211510;
}
.athlete { min-width: 0; margin: 18px 0 0; padding: 12px; border: 1px solid var(--line); }
.athlete legend { padding: 0 7px; font-weight: 750; color: var(--ink); }
.drop {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 15px 8px;
  border: 1px dashed #b2784e;
  background: #271910;
  text-align: center;
  cursor: pointer;
}
.drop:hover, .drop.dragging, .drop:has(+ input:focus-visible) { border-color: var(--red); background: #422619; }
.hint, .drop span { color: var(--muted); font-size: .875rem; }
.hint { margin: 10px 0 0; }
.editor input[type=range] { width: 100%; accent-color: var(--red); }
.preview { position: sticky; top: 14px; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.switch { display: flex; }
button { min-height: 40px; padding: 8px 12px; border: 1px solid #74513c; color: var(--ink); background: #3b251a; font: inherit; font-weight: 700; cursor: pointer; }
button:hover:enabled { border-color: var(--red); }
button:disabled { opacity: .57; cursor: default; }
.switch button { min-width: 62px; font-size: .9rem; }
.switch [aria-pressed=true] { background: var(--ink); color: #171416; border-color: var(--ink); }
.stage {
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 12px;
  background: repeating-linear-gradient(135deg, #291b14 0 1px, #23160f 1px 8px);
  border: 1px solid #62432f;
  min-height: 280px;
}
canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: min(56vh, 550px); box-shadow: 0 8px 24px #000a; }
.dimensions { text-align: center; }
.export { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.export button { display: flex; align-items: center; justify-content: space-between; gap: 6px; text-align: left; font-size: .9rem; }
.export button:first-child { background: #883317; border-color: #bd6033; }
.export small { font-size: .8rem; white-space: nowrap; }
.share-actions { margin-top: 8px; }
.export.share-actions button:first-child { background: #3b251a; border-color: #74513c; }
.export.share-actions button:hover:enabled { border-color: var(--red); }
#share-continue { margin-top: 10px; }
.photo-status:empty, #export-status:empty, #share-status:empty { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
@media (max-width: 760px) {
  .shell { width: calc(100% - 30px); }
  .intro { min-height: 325px; }
  .workspace { grid-template-columns: 1fr; }
  .preview { position: static; }
}
@media (max-width: 385px) {
  .card { padding: 14px; }
  .export { grid-template-columns: 1fr; }
}

.correct-subject, .subject-picker { margin-top: 10px; }
.subject-picker .hint { margin-bottom: 8px; }
.subject-target { position: relative; display: block; width: fit-content; max-width: 100%; padding: 0; border: 0; cursor: crosshair; }
.subject-target canvas { max-height: 280px; box-shadow: none; }
.subject-marker { position: absolute; width: 16px; height: 16px; border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 2px #111; transform: translate(-50%, -50%); pointer-events: none; }
