:root {
  --bg: #0b0912;
  --panel: #15121f;
  --line: #2a2438;
  --text: #ece8f6;
  --muted: #a49cb8;
  --accent: #ff3fa4;
  --accent2: #22e6ff;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -10%, #2a1340 0, transparent 60%), var(--bg);
  color: var(--text);
  font-family: "M PLUS Rounded 1c", "Hiragino Sans", system-ui, sans-serif;
  font-weight: 500;
  line-height: 1.7;
}
a { color: var(--accent2); }
button, textarea, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent2); outline-offset: 2px; }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px max(16px, env(safe-area-inset-left)); }
.home { color: var(--muted); text-decoration: none; font-size: 14px; }
.home:hover { color: var(--text); }
.brand { font-family: "Tilt Neon", sans-serif; font-size: 14px; letter-spacing: .2em; color: #ffd6ee; text-shadow: 0 0 6px var(--accent), 0 0 18px var(--accent); }

main { width: min(1120px, 100%); margin: 0 auto; padding: 8px 16px 48px; }
.title { margin: 18px 0 4px; font-size: clamp(30px, 6vw, 52px); font-weight: 800; line-height: 1.2; letter-spacing: .02em; color: #fff0f8;
  text-shadow: 0 0 4px #fff, 0 0 12px var(--accent), 0 0 32px var(--accent); }
.title span { color: #e6fdff; text-shadow: 0 0 4px #fff, 0 0 12px var(--accent2), 0 0 32px var(--accent2); }
.lead { margin: 0 0 22px; color: var(--muted); }

.maker { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.stage { position: sticky; top: 12px; margin: 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #000; aspect-ratio: 16 / 9; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.stage[data-size="square"] { aspect-ratio: 1; }
.stage[data-size="tall"] { aspect-ratio: 9 / 16; max-height: 78vh; margin-inline: auto; }
.stage[data-bg="clear"] { background: repeating-conic-gradient(#2a2733 0 25%, #1c1a23 0 50%) 0 0 / 24px 24px; }
.stage canvas { display: block; width: 100%; height: 100%; }
.power { position: absolute; top: 10px; right: 10px; display: flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(10,8,16,.6); backdrop-filter: blur(6px); font-size: 12px; font-weight: 800; letter-spacing: .1em; cursor: pointer; }
.power__dot { width: 9px; height: 9px; border-radius: 50%; background: #39ff6a; box-shadow: 0 0 8px #39ff6a; }
.is-off .power__dot { background: #555; box-shadow: none; }

.panel { display: grid; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.field { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 8px; align-content: start; }
.field__label { padding: 0; font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
textarea { width: 100%; resize: vertical; min-height: 76px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #0e0c16; font-size: 18px; line-height: 1.5; }
textarea:focus { border-color: #5c4d80; outline: none; box-shadow: 0 0 0 3px rgba(255,63,164,.25); }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; background: var(--c); box-shadow: 0 0 10px var(--c); cursor: pointer; padding: 0; }
.swatch--rainbow { background: conic-gradient(#ff3b3b, #ffe23d, #39ff6a, #22e6ff, #3d7bff, #b44dff, #ff3fa4, #ff3b3b); box-shadow: 0 0 10px #b44dff; }
.swatch[aria-pressed="true"] { border-color: #fff; outline: 2px solid rgba(255,255,255,.35); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 38px; padding: 6px 13px; border: 1px solid var(--line); border-radius: 10px; background: #1d1929; font-size: 14px; cursor: pointer; }
.chip:hover { border-color: #4a3f63; }
.chip[aria-pressed="true"] { border-color: var(--accent); background: #2b1530; color: #fff; box-shadow: 0 0 0 1px var(--accent) inset, 0 0 14px rgba(255,63,164,.35); }
.toggle { display: flex; align-items: center; gap: 8px; min-height: 38px; font-size: 14px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: #1d1929; font-weight: 800; font-size: 14px; text-decoration: none; color: var(--text); cursor: pointer; }
.btn--main { flex: 1 1 100%; border: 0; background: linear-gradient(135deg, #ff3fa4, #b44dff); color: #fff; box-shadow: 0 8px 26px rgba(255,63,164,.35); }
.btn:not(.btn--main) { flex: 1 1 0; }
.status { min-height: 1.5em; margin: -6px 0 0; font-size: 13px; color: var(--muted); word-break: break-all; }

.about { margin-top: 44px; padding: 26px clamp(18px, 4vw, 34px); border: 1px solid var(--line); border-radius: 16px; background: rgba(21,18,31,.7); }
.about h2 { margin: 26px 0 10px; font-size: 20px; color: #fff; }
.about h2:first-child { margin-top: 0; }
.about p, .about li, .about dd { color: #cfc8e0; font-size: 15px; }
.about ol, .about ul { padding-left: 1.4em; }
.about li { margin-bottom: 8px; }
.faq dt { margin-top: 14px; font-weight: 800; color: #fff; }
.faq dd { margin: 4px 0 0; }

.foot { padding: 24px 16px 40px; text-align: center; color: var(--muted); font-size: 13px; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-bottom: 8px; }
.foot a { color: var(--muted); }

@media (max-width: 860px) {
  .maker { grid-template-columns: minmax(0, 1fr); }
  .stage { position: relative; top: 0; }
}
@media (max-width: 520px) {
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .swatch { width: 32px; height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
