:root {
  color-scheme: dark;
  --paper: #fff4ff;
  --muted: #cbb9e8;
  --ink: #090313;
  --panel: #1b093d;
  --panel2: #2c125d;
  --line: #a15cff;
  --pink: #ff67c0;
  --green: #79ffc3;
  --yellow: #eaff67;
  font-family: Verdana, Tahoma, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  min-width: 320px;
  background: #080315;
  background-image:
    radial-gradient(circle at 8% 12%, rgba(114,255,195,.19) 0 1px, transparent 2px),
    radial-gradient(circle at 78% 10%, rgba(255,118,200,.20) 0 1px, transparent 2px),
    linear-gradient(135deg, rgba(65,17,112,.34) 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(315deg, #0a0417, #16062f 58%, #210949);
  color: var(--paper);
}
button, input { font: inherit; }
button { touch-action: manipulation; }

.kiosk-shell { width: min(1500px, calc(100% - 1rem)); margin: 0 auto; padding: .75rem 0 1rem; }
.masthead {
  margin: 0 0 .65rem;
  padding: .55rem .8rem .65rem;
  text-align: center;
  border: 3px ridge #d58aff;
  background: linear-gradient(#411379, #1a083c 57%, #0e0524);
  box-shadow: 0 0 0 1px #090313, 0 0 14px rgba(255,55,183,.34);
}
.eyebrow { margin: 0; color: #a9ffda; font: 700 .65rem/1.2 Verdana, sans-serif; letter-spacing: .15em; text-shadow: 1px 1px #370667; }
h1 { margin: .02rem 0 .1rem; color: #ff8bd0; font: 700 clamp(1.85rem, 4vw, 3.15rem)/.95 "Trebuchet MS", Verdana, sans-serif; letter-spacing: .02em; text-shadow: 2px 2px 0 #2c0756, 0 0 9px #ff4fb8; }
.deck { margin: 0; color: #b8ffe2; font-size: .76rem; }
.title-row { display: flex; align-items: center; justify-content: center; gap: .7rem; min-height: 4rem; }
.title-dancer { width: 54px; height: auto; flex: 0 0 auto; filter: drop-shadow(0 0 5px rgba(255,159,70,.45)); }
.title-dancer-right { transform: scaleX(-1); }

.preflight { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: .65rem; align-items: center; margin: 0 0 .65rem; padding: .48rem .6rem; border: 3px outset #e9df65; background: linear-gradient(90deg, #392009, #27103c 48%, #122c25); box-shadow: 0 0 0 1px #090313; }
.preflight-badge { padding: .26rem .38rem; border: 2px outset #ff8b62; background: #8b1f47; color: #fff49a; font: 900 .64rem/1 Verdana, sans-serif; animation: kiosk-blink 1.25s steps(2,end) infinite; }
.preflight-copy strong { display: block; color: #fff49a; font: 900 .72rem/1.15 Verdana, sans-serif; letter-spacing: .03em; }
.preflight-copy p { margin: .12rem 0 0; color: #e6d9ff; font: .63rem/1.35 Verdana, sans-serif; }
.preflight a { padding: .38rem .5rem; border: 2px outset #8dffc9; background: linear-gradient(#67eeb2,#23815f); color: #071c14; font: 900 .61rem/1 Verdana, sans-serif; text-decoration: none; white-space: nowrap; }
.preflight.is-verified { border-color: #82ffbd; background: linear-gradient(90deg, #123c2d, #211044 55%, #113528); }
.preflight.is-verified .preflight-badge { animation: none; background: #1a6a4c; border-color: #82ffbd; }
@keyframes kiosk-blink { 50% { opacity: .55; } }

.maker { display: grid; grid-template-columns: minmax(310px, 360px) minmax(420px, 1fr) minmax(285px, 325px); gap: .65rem; align-items: start; }
.controls, .claim-panel {
  border: 3px ridge #ad69f4;
  background: linear-gradient(135deg, rgba(45,20,94,.97), rgba(21,7,47,.97) 72%);
  box-shadow: 0 0 0 1px #080314, 0 0 10px rgba(124,79,255,.24);
}
.controls { padding: .35rem; }

.control-group { margin: 0; border: 0; border-bottom: 1px dotted rgba(121,255,195,.52); }
.control-group:last-child { border-bottom: 0; }
.control-group > summary { list-style: none; }
.control-group > summary::-webkit-details-marker { display: none; }
.section-title {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: .42rem;
  align-items: center;
  min-height: 2.2rem;
  margin: 0;
  padding: .3rem .42rem;
  border: 2px outset #8345c8;
  background: linear-gradient(90deg, #351173, #642676);
  cursor: pointer;
  user-select: none;
}
.static-title { grid-template-columns: auto 1fr; cursor: default; }
.section-title span { color: #98ffd4; font: 700 .61rem/1 Verdana, sans-serif; text-shadow: 1px 1px #120422; }
.section-title h2 { margin: 0; color: #fff3fd; font: 700 .9rem/1.1 "Trebuchet MS", Verdana, sans-serif; text-shadow: 1px 1px #17032c; }
.selection-summary { justify-self: end; min-width: 0; max-width: 9rem; overflow: hidden; color: #ffd0ec; font: 700 .58rem/1 Verdana, sans-serif; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; }
.control-group > .section-title::after { content: "+"; color: #a9ffda; font: 700 .9rem/1 monospace; }
.control-group[open] > .section-title::after { content: "−"; }
.control-content { padding: .45rem .12rem .55rem; }

.option-grid { display: grid; gap: .28rem; }
.body-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.head-grid, .hair-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.shirt-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.legwear-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.footwear-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.option-button {
  min-width: 0;
  min-height: 2.38rem;
  padding: .34rem .4rem;
  border: 2px outset #9c61e4;
  border-radius: 0;
  color: #fff8ff;
  background: linear-gradient(#4a2181, #26104d);
  cursor: pointer;
  text-align: left;
  text-shadow: 1px 1px #160629;
}
.option-button:hover { border-color: #9dffcf; background: linear-gradient(#67319a, #341464); }
.option-button:active { border-style: inset; }
.option-button[aria-checked="true"] { border: 2px inset #ff77c5; background: linear-gradient(#8a1f76, #3d0d55); box-shadow: 0 0 6px rgba(255,79,184,.58), inset 0 0 6px rgba(255,235,250,.18); }
.option-button.is-locked { border-color: #d8b24e; background: repeating-linear-gradient(135deg, #3a234f 0 7px, #251632 7px 14px); }
.option-button.is-locked:hover { border-color: #fff08a; background: repeating-linear-gradient(135deg, #503168 0 7px, #301c42 7px 14px); }
.option-button.is-locked small { color: #ffe982; }
.option-button.is-locked[aria-checked="true"] { border-color: #ffd15a; background: repeating-linear-gradient(135deg, #6a2d68 0 7px, #3b1c4c 7px 14px); box-shadow: 0 0 7px rgba(255,210,90,.52), inset 0 0 6px rgba(255,235,250,.14); }
.option-button strong { display: block; overflow: hidden; font-size: .78rem; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.option-button small { display: block; margin-top: .08rem; color: #a8ffe1; font-size: .52rem; line-height: 1; letter-spacing: .02em; text-transform: uppercase; }
.compatibility-note { min-height: 0; margin: .35rem 0 0; padding: .28rem .34rem; color: var(--yellow); background: #25113d; border: 1px dashed #c7e958; font: .61rem/1.3 Verdana, sans-serif; }
.compatibility-note:empty { display: none; }

.color-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .25rem .4rem; }
/* v19.1: author CSS must not override the HTML hidden attribute. */
.color-row[hidden],
#horn-row[hidden],
#fang-row[hidden],
#shirt-color-row[hidden],
#shoe-color-row[hidden] {
  display: none !important;
}

.color-row { display: grid; grid-template-columns: minmax(0,1fr) 2.1rem; grid-template-areas: "label swatch" "hex swatch"; gap: .05rem .28rem; align-items: center; min-width: 0; padding: .24rem .3rem; border: 1px solid rgba(185,151,255,.34); background: rgba(12,3,27,.42); }
.color-row span { grid-area: label; overflow: hidden; color: #f1eaff; font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.color-row input { grid-area: swatch; width: 2.05rem; height: 1.7rem; padding: .04rem; border: 2px inset #5e307f; border-radius: 0; background: #090313; cursor: pointer; }
.color-row output { grid-area: hex; color: #8dffcb; font: .49rem/1 Verdana, sans-serif; letter-spacing: .02em; }
.fine-print { margin: .38rem 0 0; padding: .3rem .35rem; border: 1px dashed rgba(255,114,193,.65); color: #c7b3ff; background: rgba(17,4,38,.56); font: .56rem/1.35 Verdana, sans-serif; }

.stage { min-width: 0; overflow: hidden; border: 4px ridge #d184ff; background: #1b093d; box-shadow: 0 0 0 1px #090313, 0 0 14px rgba(255,83,185,.30); }
.stage-topline, .stage-footer { display: flex; justify-content: space-between; gap: .6rem; padding: .42rem .55rem; background: linear-gradient(#461776, #190736); color: #e6dcff; font: 700 .54rem/1.2 Verdana, sans-serif; letter-spacing: .07em; }
.stage-topline span:first-child { color: #8affcc; }
#preview-status { color: #a9ffda; }
#preview-status.is-busy { color: var(--yellow); }
.stage-footer { border-top: 1px solid rgba(255,255,255,.12); }

.randomize-row { padding: .34rem .45rem .38rem; border-top: 1px solid rgba(255,255,255,.10); background: linear-gradient(#2b0d50, #180630); }
.randomize-button { width: 100%; padding: .56rem .55rem; border: 2px outset #ff8bd1; border-radius: 0; cursor: pointer; color: #16051c; background: linear-gradient(90deg, #ff80ca, #b7ff9a, #8effea, #d78dff, #ff80ca); background-size: 240% 100%; box-shadow: 0 0 9px rgba(255,82,185,.34); font: 900 .66rem/1.1 Verdana, sans-serif; letter-spacing: .05em; text-transform: uppercase; }
.randomize-button:hover { background-position: 100% 0; box-shadow: 0 0 13px rgba(129,255,205,.45); }
.randomize-button:active { border-style: inset; transform: translateY(1px); }
.stage-footer span:last-child { color: #ff7fc7; }
.canvas-wrap {
  display: grid;
  place-items: center;
  min-height: min(72vh, 760px);
  padding: .4rem;
  overflow: hidden;
  background-color: #14062d;
  background-image:
    linear-gradient(45deg, rgba(255,79,184,.12) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(103,255,174,.11) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,79,184,.12) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(103,255,174,.11) 75%);
  background-size: 22px 22px;
}
#monster-canvas { display: block; width: min(100%, 500px); height: auto; transform: scale(1.28); transform-origin: 50% 39%; image-rendering: auto; filter: drop-shadow(0 .7rem .75rem rgba(5,0,20,.58)); }

.claim-panel { position: sticky; top: .55rem; padding: .42rem; }
.auth-card { margin: .42rem 0; padding: .48rem; border: 2px inset #61378c; background: linear-gradient(135deg, rgba(12,3,27,.94), rgba(41,12,67,.94)); }
.auth-card-top { display: grid; grid-template-columns: .72rem 1fr; gap: .4rem; align-items: start; }
.auth-card-top strong { display: block; color: #fff3fd; font: 700 .64rem/1.2 Verdana, sans-serif; text-transform: uppercase; }
.auth-card-top p { margin: .1rem 0 0; color: #cfc2ec; font: .57rem/1.3 Verdana, sans-serif; }
.auth-dot { width: .58rem; height: .58rem; margin-top: .08rem; border: 1px solid #c7b3ff; border-radius: 50%; background: #5a5367; }
.auth-dot.is-good { border-color: #9dffcf; background: #67ffae; box-shadow: 0 0 7px rgba(103,255,174,.65); }
.auth-dot.is-bad { border-color: #ff92c9; background: #ff4f78; }
.auth-dot.is-waiting { border-color: #d2b0ff; background: #8057b9; }
.auth-button { width: 100%; margin-top: .38rem; padding: .42rem .45rem; border-radius: 0; cursor: pointer; color: #fff; font: 700 .58rem Verdana, sans-serif; text-transform: uppercase; }
.auth-button:disabled { cursor: not-allowed; opacity: .42; }
.twitch-button { border: 2px outset #b49aff; background: linear-gradient(#7347bd, #3b2071); }
.patreon-button { border: 2px outset #ff9d85; background: linear-gradient(#c75745, #6f241f); }
.claim-panel label { display: block; margin: .5rem 0 .2rem; color: #aaffd9; font: 700 .58rem Verdana, sans-serif; text-transform: uppercase; }
em { color: #aaa2b3; font-size: .54rem; font-weight: normal; text-transform: none; }
.claim-panel input[type="text"] { width: 100%; padding: .48rem .5rem; border: 2px inset #61378c; border-radius: 0; background: #0c031b; color: #fff; font: .7rem Verdana, sans-serif; }
.tier-card { margin: .55rem 0; padding: .55rem; border: 2px outset #ff6abc; border-left-width: 4px; background: linear-gradient(135deg, #3d135d, #160527); }
.tier-card span { color: #84ffbd; font: 700 .53rem Verdana, sans-serif; }
.tier-card strong { display: block; margin: .15rem 0; color: #ffd2ec; font: 700 .78rem "Trebuchet MS", Verdana, sans-serif; }
.tier-card p { margin: 0; color: #ddcffd; font: .59rem/1.35 Verdana, sans-serif; }
.save-button { width: 100%; margin-top: .38rem; padding: .56rem .5rem; border: 2px outset #a9ffda; border-radius: 0; background: linear-gradient(#70ffc0, #20a66f); color: #091510; cursor: pointer; font: 900 .62rem Verdana, sans-serif; letter-spacing: .035em; text-transform: uppercase; }
.save-button:disabled { cursor: not-allowed; opacity: .38; filter: grayscale(.25); }
.save-message { min-height: 1.7em; margin: .22rem 0 .4rem; color: #bcefd8; font: .54rem/1.3 Verdana, sans-serif; }
.download-row { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
.primary-button, .secondary-button { width: 100%; margin: 0; padding: .45rem .35rem; border-radius: 0; cursor: pointer; font: 700 .57rem Verdana, sans-serif; text-transform: uppercase; }
.primary-button { border: 2px outset #79ffc1; color: #062114; background: linear-gradient(#a2ffd2, #50da97); }
.secondary-button { border: 2px outset #cc86ff; background: linear-gradient(#5a2588, #260d50); color: #fff0fb; }
.download-message { min-height: 1em; margin: .28rem 0 0; color: #eaff67; font: .53rem/1.25 Verdana, sans-serif; }
footer { display: flex; justify-content: space-between; gap: 1rem; margin: .55rem 0 0; padding: .38rem .5rem; border: 1px solid #843fd0; background: rgba(23,6,52,.82); color: #d0bfff; font: .54rem/1.25 Verdana, sans-serif; }

@media (min-width: 1001px) { .stage { position: sticky; top: .55rem; } }
@media (max-width: 1000px) {
  .maker { grid-template-columns: minmax(280px, .9fr) minmax(360px, 1.1fr); }
  .claim-panel { grid-column: 1 / -1; position: static; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .3rem .55rem; }
  .claim-panel .static-title, .claim-panel .tier-card, .claim-panel .save-button, .claim-panel .save-message, .claim-panel .download-row, .claim-panel .download-message { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .kiosk-shell { width: min(100% - .5rem, 1500px); padding-top: .3rem; }
  .masthead { margin-bottom: .35rem; padding: .4rem .55rem .45rem; }
  .title-row { min-height: 3rem; gap: .4rem; }
  .title-dancer { width: 38px; }
  .eyebrow { font-size: .52rem; }
  h1 { font-size: 2rem; }
  .deck { font-size: .66rem; }
  .preflight { grid-template-columns: auto 1fr; gap: .4rem; padding: .4rem; }
  .preflight a { grid-column: 1 / -1; text-align: center; }
  .maker { grid-template-columns: 1fr; gap: .42rem; }
  .claim-panel { order: -3; display: block; }
  .stage { order: -2; }
  .controls { order: 0; }
  .controls, .claim-panel { padding: .34rem; border-width: 2px; }
  .canvas-wrap { min-height: 48vh; max-height: 58vh; }
  #monster-canvas { width: min(90vw, 420px); transform: scale(1.12); transform-origin: 50% 39%; filter: drop-shadow(0 .5rem .55rem rgba(5,0,20,.5)); }
  .head-grid, .hair-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .option-button { min-height: 2rem; }
  .color-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  footer { display: block; }
  footer span { display: block; }
  footer span + span { margin-top: .18rem; }
}
@media (max-width: 420px) {
  .head-grid, .hair-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .selection-summary { max-width: 7rem; }
  .color-row output { display: none; }
  .color-row { grid-template-areas: "label swatch"; grid-template-columns: minmax(0,1fr) 2rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
