:root { color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, sans-serif; background: #020521; color: #d8d9e4; overflow: hidden; }
#twinkle, #starsLayer, .bg-glow, #shootingStars { position: fixed; inset: 0; }
.bg-glow { background: radial-gradient(circle at center, #27275a 0%, #04052f 40%, #020321 70%, #020214 100%); animation: drift 26s ease-in-out infinite; }
#starsLayer { pointer-events: auto; }
body.aiming #starsLayer { pointer-events: none; }
#shootingStars { pointer-events: none; }
.star { position: absolute; border: 0; background: transparent; opacity: .95; padding: 0; pointer-events: auto; transform: translate(-50%, -50%); animation: float var(--float-dur, 14s) ease-in-out infinite; }
.star img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 0 8px var(--glow, #b6bad1)) drop-shadow(0 0 16px var(--glow, #b6bad1)); }
.top-actions { position: fixed; top: 16px; left: 16px; z-index: 3; display: flex; gap: 10px; align-items: center; }
.glass-btn { border: 1px solid #ffffff22; background: #1a1b31aa; color: #ddd; border-radius: 8px; padding: 8px 12px; font-size: 22px; line-height: 1; cursor: pointer; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; font-size: 16px; padding: 0; }
#loadingHint { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); color: #aaabc3; opacity: .8; }
#starCount { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); color: #8f90b0; }
#modalBackdrop { position: fixed; inset: 0; background: #0008; backdrop-filter: blur(4px); z-index: 9; }
body.aiming #modalBackdrop { pointer-events: none; }
#modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); width: min(92vw, 460px); background: #05060ede; border: 1px solid #ffffff1c; border-radius: 22px; padding: 28px; z-index: 10; }
.aiming #modal { box-shadow: 0 0 0 1px #78b1ff55, 0 0 24px #4e5cff22; }
#aimIndicator { position: fixed; width: 18px; height: 18px; border-radius: 999px; border: 1px solid #dbe8ff; box-shadow: 0 0 12px #7db7ffcc, 0 0 30px #4d65ff88; pointer-events: none; z-index: 5; transform: translate(-50%, -50%); }
.hidden { display: none !important; }
.close { position: absolute; right: 16px; top: 14px; border: 0; background: transparent; color: #9899ad; font-size: 28px; cursor: pointer; }
.steps { display: flex; gap: 10px; justify-content: center; margin-bottom: 12px; }
.steps span { width: 10px; height: 10px; border-radius: 999px; background: #6f7282; }
.steps span.on { background: #e5e7f5; }
h2 { text-align: center; margin: 8px 0 20px; }
.tool-row { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; }
.tool { padding: 6px 12px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; border-radius: 999px; background: #0f1321; }
.tool.on { border-color: #9fc5ff; color: #f0f3ff; box-shadow: 0 0 12px #6aa2ff55; }
#drawCanvas { width: 100%; border: 1px solid #ffffff22; border-radius: 16px; background: #02030a; background-image: linear-gradient(#10142755 1px, transparent 1px), linear-gradient(90deg, #10142755 1px, transparent 1px); background-size: 22px 22px; box-shadow: inset 0 0 12px #060915; }
.palette { margin: 14px 0; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.color { width: 28px; height: 28px; border-radius: 50%; background: var(--c); border: 2px solid transparent; box-shadow: 0 0 8px var(--c); padding: 0; }
.color.on { border-color: #fff; }
.color-picker { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; color: #a7abc8; padding: 4px 8px; border-radius: 999px; border: 1px solid #ffffff1f; background: #0f1321; }
.color-picker input { width: 28px; height: 28px; border: 0; padding: 0; background: transparent; }
label { display: block; color: #a7abc8; font-size: 13px; }
input[type=range] { width: 100%; margin-top: 8px; accent-color: #b739ff; }
.actions { margin-top: 14px; display: flex; justify-content: space-between; }
button { cursor: pointer; background: #141724; border: 1px solid #ffffff1e; color: #b6bad1; border-radius: 8px; padding: 8px 14px; }
button.primary { background: #1f2234; color: #f6f7ff; }
.step { display: none; }
.step.on { display: block; }
textarea { margin-top: 8px; width: 100%; min-height: 130px; border-radius: 12px; background: #0a0d19; color: #eff0ff; border: 1px solid #ffffff25; padding: 10px; }
input[type=text], #nameInput { margin-top: 8px; width: 100%; border-radius: 12px; background: #0a0d19; color: #eff0ff; border: 1px solid #ffffff25; padding: 10px; }
.wish-preview, .launch-preview { display: grid; place-items: center; margin: 6px 0 16px; padding: 16px; border-radius: 18px; border: 1px solid #ffffff1a; background: #070913; text-align: center; }
.wish-preview img, .launch-preview img { width: 120px; height: 120px; object-fit: contain; filter: drop-shadow(0 0 10px #ffffff55) drop-shadow(0 0 20px #5da3ff66); }
.wish-preview img[src=\"\"], .launch-preview img[src=\"\"], .detail-art img[src=\"\"] { display: none; }
.launch-preview p { margin: 14px 0 0; font-size: 13px; color: #b5bbd4; }

#detailBackdrop { position: fixed; inset: 0; background: #0008; backdrop-filter: blur(6px); z-index: 11; }
#detailModal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(88vw, 420px); background: #06070fef; border: 1px solid #ffffff1a; border-radius: 26px; padding: 30px; z-index: 12; text-align: center; }
.detail-art { display: grid; place-items: center; margin-bottom: 16px; }
.detail-art img { width: 120px; height: 120px; object-fit: contain; filter: drop-shadow(0 0 12px #ffffff66) drop-shadow(0 0 26px #67c3ff66); }
#detailWish { font-size: 18px; line-height: 1.5; color: #f1f2ff; margin: 8px 0 18px; }
.detail-meta { display: flex; justify-content: center; gap: 12px; font-size: 12px; color: #9aa2bd; }
.detail-status { margin-top: 8px; font-size: 12px; color: #aab3cf; text-transform: uppercase; letter-spacing: 0.14em; }
.detail-actions { margin-top: 16px; display: flex; justify-content: center; gap: 10px; }
.note-area { margin-top: 18px; text-align: left; }
.note-area textarea { min-height: 90px; }

#archiveBackdrop { position: fixed; inset: 0; background: #0008; backdrop-filter: blur(6px); z-index: 11; }
#archiveModal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(92vw, 520px); max-height: min(80vh, 560px); overflow: hidden; background: #06070ff2; border: 1px solid #ffffff1a; border-radius: 26px; padding: 28px; z-index: 12; }
.archive-sub { font-size: 12px; color: #9aa2bd; margin-top: -8px; }
.archive-list { margin-top: 16px; display: grid; gap: 12px; max-height: min(60vh, 420px); overflow: auto; padding-right: 6px; }
.archive-card { display: grid; grid-template-columns: 60px 1fr; gap: 12px; padding: 12px; border-radius: 16px; border: 1px solid #ffffff1c; background: #0b0d1d; }
.archive-card img { width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 0 10px #6aa2ff55); }
.archive-title { font-weight: 600; font-size: 14px; color: #f1f2ff; }
.archive-meta { font-size: 11px; color: #98a1ba; margin-top: 4px; }
.archive-note { font-size: 12px; color: #c2c8dd; margin-top: 8px; line-height: 1.4; }

.shooting-star { position: fixed; width: 140px; height: 2px; background: linear-gradient(90deg, #ffffff00, #ffffffcc, #ffffff00); filter: drop-shadow(0 0 12px #e8f2ff); opacity: 0; z-index: 2; animation: shoot 1.4s ease-out forwards; }
.launch-ghost { position: fixed; pointer-events: none; z-index: 20; filter: drop-shadow(0 0 12px #ffffff88) drop-shadow(0 0 26px #63c6ff88); }

@keyframes float {
  0% { transform: translate(-50%, -50%) translate(0, 0); }
  50% { transform: translate(-50%, -50%) translate(var(--float-x, 0px), var(--float-y, 0px)); }
  100% { transform: translate(-50%, -50%) translate(0, 0); }
}

@keyframes drift {
  0% { transform: scale(1) translate(-1%, -1%); }
  50% { transform: scale(1.03) translate(1%, 1%); }
  100% { transform: scale(1) translate(-1%, -1%); }
}

@keyframes shoot {
  0% { opacity: 0; transform: translate(0, 0) rotate(35deg); }
  10% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--shoot-x, 240px), var(--shoot-y, 120px)) rotate(35deg); }
}
