:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #faf5ff;
  background: #160d27;
  font-synthesis: none;
  --muted: #b9aaca;
  --line: #ffffff16;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; background: radial-gradient(ellipse at 95% 5%, #7b258a26, transparent 45%), radial-gradient(ellipse at 0% 80%, #5632a524, transparent 55%); }
main { max-width: 1140px; margin: auto; padding: 24px 44px 28px; }
.festival-header { display: flex; gap: 18px; align-items: center; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.festival-logo { width: 74px; height: 74px; object-fit: contain; flex-shrink: 0; }
h1 { font-size: 16px; font-weight: 650; letter-spacing: .025em; line-height: 1.8; margin: 0; }
.festival-details { font-weight: 400; color: #c9b8da; white-space: nowrap; }
.workspace { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); align-items: center; gap: 70px; padding-top: 32px; }
.controls { width: 100%; }
h2 { font-size: 32px; font-weight: 600; line-height: 1.2; letter-spacing: -.035em; margin: 0 0 28px; max-width: 310px; }
.upload { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px; min-height: 170px; padding: 24px 16px; border: 1px dashed #ba8bdc75; border-radius: 16px; background: linear-gradient(140deg, #bc76f015, #e369ec07); cursor: pointer; transition: background .2s, border-color .2s; }
.upload:hover { background: #bb73ed1c; border-color: #e8a9ff; }
.upload-icon { width: 34px; height: 34px; stroke: #e4a6fa; stroke-width: 1.5; }
#upload-label { font-size: 15px; font-weight: 600; }
.file-formats { font-size: 11px; color: var(--muted); }
input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload:has(+ input:focus-visible), button:focus-visible, input:focus-visible { outline: 2px solid #e7a2ff; outline-offset: 5px; }
.adjust-panel { margin-top: 30px; }
fieldset { border: 0; padding: 0; margin: 0 0 26px; min-width: 0; transition: opacity .2s; }
fieldset:disabled { opacity: .35; }
.scale-label { display: flex; align-items: center; justify-content: space-between; font-size: 14px; margin-bottom: 16px; }
output { font-variant-numeric: tabular-nums; color: #e6c4f6; font-size: 12px; background: #ffffff09; border: 1px solid #ffffff0d; border-radius: 6px; padding: 5px 8px; }
.slider-row { display: flex; align-items: center; gap: 13px; }
.slider-row > span { width: 12px; color: #d6c4e6; text-align: center; font-size: 18px; }
input[type=range] { appearance: none; -webkit-appearance: none; width: 100%; margin: 0; height: 5px; border-radius: 9px; background: linear-gradient(90deg, #da83f5 0%, #ae88f0 11.111%, #ffffff20 11.111%, #ffffff20 100%); cursor: pointer; }
input[type=range]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 17px; height: 17px; border-radius: 50%; background: #f6d7ff; box-shadow: 0 0 0 4px #d68af01a; }
input[type=range]::-moz-range-thumb { width: 17px; height: 17px; border: 0; border-radius: 50%; background: #f6d7ff; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 15px 0 14px; }
button { font: inherit; cursor: pointer; }
.secondary { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #e0c9ef; padding: 7px 0; background: transparent; border: 0; }
.secondary:hover { color: #fff; }
button svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
#download { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; border: 1px solid #efb3ff50; border-radius: 11px; padding: 16px 18px; background: linear-gradient(105deg, #c94bd5, #8c52df); color: #fff; font-size: 14px; font-weight: 650; box-shadow: 0 8px 30px #b64be221; transition: filter .2s, transform .2s; }
#download:hover:enabled { filter: brightness(1.12); transform: translateY(-1px); }
#download:disabled { background: #ffffff09; border-color: #ffffff10; color: #8f7d9e; box-shadow: none; cursor: default; }
.privacy { display: flex; align-items: center; justify-content: center; gap: 7px; color: #9e8dac; font-size: 10px; line-height: 1.6; margin: 16px 0 0; }
.privacy svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 1.2; flex-shrink: 0; }
.preview { position: relative; min-width: 0; }
.preview::before { content: ""; position: absolute; inset: 8% 0; z-index: -1; background: radial-gradient(ellipse, #b33ce727, transparent 68%); pointer-events: none; }
.canvas-wrap { position: relative; width: min(100%, 355px); margin: 0 auto; background: #211035; border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 1px #ffffff14, 0 24px 70px #00000050; }
canvas { display: block; width: 100%; height: auto; touch-action: none; }
canvas[data-loaded=true] { cursor: grab; }
canvas[data-loaded=true]:active { cursor: grabbing; }
#empty { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); width: 75%; display: flex; flex-direction: column; gap: 13px; align-items: center; color: #dcc7e9; font-size: 12px; pointer-events: none; }
#empty svg { width: 40px; height: 40px; stroke: #b99ad1; stroke-width: 1.2; }
[hidden] { display: none !important; }
.caption { display: flex; justify-content: center; gap: 9px; color: #a28cb4; font-size: 10px; letter-spacing: .07em; margin: 15px 0 0; }
.caption span { color: #6a4f7e; }
#error { color: #f8b5cf; font-size: 12px; line-height: 1.6; margin: 12px 0 0; }
noscript { display: block; margin: 24px 0; color: #f8b5cf; }
@media (min-width: 721px) and (max-height: 820px) { .canvas-wrap { width: min(100%, 305px); } .workspace { padding-top: 24px; } }
@media (max-width: 850px) { main { padding-inline: 28px; } .workspace { gap: 35px; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); } h1 { font-size: 13px; } }
@media (max-width: 720px) {
  main { max-width: 480px; padding: 18px 22px 30px; }
  .festival-header { gap: 11px; padding-bottom: 18px; }
  .festival-logo { width: 58px; height: 58px; }
  h1 { font-size: 12px; line-height: 1.7; letter-spacing: .015em; }
  .festival-details { display: block; font-size: 11px; }
  .workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 25px; padding-top: 28px; }
  .controls { display: contents; }
  .upload-panel { grid-row: 1; }
  h2 { font-size: 26px; max-width: none; margin-bottom: 20px; }
  .upload { min-height: 115px; padding: 18px 12px; gap: 10px; border-radius: 12px; }
  .upload-icon { width: 26px; height: 26px; }
  #upload-label { font-size: 14px; }
  .file-formats { font-size: 10px; }
  .preview { grid-row: 2; }
  .canvas-wrap { width: min(100%, 300px); }
  .adjust-panel { grid-row: 3; margin: 0; }
  fieldset { margin-bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { transition: none !important; } }
