/* Studio (the generator app) */
.studio { width: min(1320px, 100% - 24px); margin: 22px auto 40px; display: grid; grid-template-columns: 400px 1fr; gap: 20px; align-items: start; }
@media (max-width: 980px) { .studio { grid-template-columns: 1fr; } }
.panel { background: #fff; border-radius: 28px; padding: 20px; box-shadow: var(--shadow); border: 2px solid #fff; }
.panel + .panel { margin-top: 16px; }
.panel h3 { font-size: 18px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.side { display: grid; gap: 16px; }
.studio > section, .side { min-width: 0; }
@media (max-width: 980px) { .side { position: static; } }

.types { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
@media (max-width: 420px) { .types { grid-template-columns: repeat(3, 1fr); } }
.type {
  border: 3px solid var(--line); background: var(--bg); border-radius: 16px; padding: 10px 2px; font-size: 13px; cursor: pointer; text-align: center;
  font-family: var(--fh); font-weight: 600; color: var(--ink2); transition: transform .25s cubic-bezier(.34,1.56,.64,1), border-color .2s, background .2s;
}
.type:hover { transform: translateY(-3px); }
.type.on { border-color: var(--blue); background: #edf2ff; color: var(--blue-d); }
.type .shape { margin: 0 auto 6px; background: currentColor; opacity: .25; border-radius: 6px; }
.type small { display: block; font-family: var(--fb); font-weight: 800; font-size: 11px; color: var(--muted); margin-top: 2px; }

.presets { display: flex; flex-wrap: wrap; gap: 7px; }
.uploads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.up-slot { aspect-ratio: 1; border-radius: 14px; border: 3px dashed var(--line); background: var(--bg); display: grid; place-items: center; cursor: pointer; color: var(--muted); font-size: 24px; position: relative; overflow: hidden; transition: border-color .2s, transform .25s cubic-bezier(.34,1.56,.64,1); }
.up-slot:hover { border-color: var(--blue); transform: scale(1.04); }
.up-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.up-slot .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; display: grid; place-items: center; z-index: 2; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toggle { display: flex; background: var(--bg); border-radius: 14px; padding: 4px; gap: 4px; border: 2px solid var(--line); }
.toggle button { flex: 1; border: 0; background: none; border-radius: 10px; padding: 9px 4px; font-family: var(--fh); font-weight: 600; font-size: 15px; color: var(--ink2); cursor: pointer; transition: background .2s, color .2s, transform .2s; }
.toggle button.on { background: #fff; color: var(--blue-d); box-shadow: 0 3px 0 #d7defa; }

.go { display: flex; align-items: center; gap: 12px; }
.go .cost { font-weight: 900; color: var(--ink2); white-space: nowrap; }
.go .btn { flex: 1; white-space: nowrap; }
#fixPanel .go .btn { flex: none; }
#fixPanel .go .input { flex: 1; min-width: 0; }
@media (max-width: 640px) { #fixPanel .go { flex-wrap: wrap; } }

/* results */
.stage { min-height: 520px; }
.empty { display: grid; place-items: center; text-align: center; min-height: 460px; color: var(--ink2); }
.empty h2 { font-size: 34px; margin-top: 12px; }
.empty .big { font-size: 64px; animation: floaty 4s ease-in-out infinite; }
.inspo { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; max-width: 620px; }
.results { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.results > .res { grid-column: span 2; }
.results > .res.sq { grid-column: span 1; }
.results > .res.snd { grid-column: 1 / -1; }
@media (max-width: 640px) { .results { grid-template-columns: 1fr 1fr; } }
.res { position: relative; border-radius: 20px; overflow: hidden; background: var(--bg2); aspect-ratio: 16/9; cursor: pointer; border: 4px solid #fff; box-shadow: var(--shadow); transition: transform .3s cubic-bezier(.34,1.56,.64,1); animation: popIn .55s cubic-bezier(.34,1.56,.64,1) both; }
.res.sq { aspect-ratio: 1; }
.res:hover { transform: translateY(-4px) rotate(-.6deg); }
.res img { width: 100%; height: 100%; object-fit: cover; }
.res.loading { display: grid; place-items: center; animation: none; }
.res.loading::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.7) 50%, transparent 70%); background-size: 250% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -100% 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.8) rotate(-3deg); } }
.res .acts { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity .2s; }
.res:hover .acts { opacity: 1; }

/* editor */
.editor { display: none; }
.editor.on { display: block; }
.canvas-wrap { position: relative; border-radius: 20px; overflow: hidden; background: #0e1030; box-shadow: var(--shadow-lg); touch-action: none; }
.canvas-wrap canvas { width: 100%; height: auto; display: block; }
.canvas-wrap .safe { position: absolute; inset: 8%; border: 2px dashed rgba(255,255,255,.55); border-radius: 12px; pointer-events: none; display: none; }
.canvas-wrap.show-safe .safe { display: block; }
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
@media (max-width: 640px) { .tools { grid-template-columns: 1fr; } }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.sw { width: 32px; height: 32px; border-radius: 10px; cursor: pointer; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); transition: transform .2s; }
.sw.on { box-shadow: 0 0 0 3px var(--blue); transform: scale(1.12); }
input[type=range] { width: 100%; accent-color: var(--blue); }

.history { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.history .h { flex: none; width: 96px; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; cursor: pointer; border: 3px solid #fff; box-shadow: var(--shadow); }
.history .h.sq { width: 56px; aspect-ratio: 1; }
.history .h img { width: 100%; height: 100%; object-fit: cover; }

.bill { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bill .num { font-family: var(--fh); font-size: 38px; font-weight: 700; color: var(--blue-d); line-height: 1; }

.type .ico { font-size: 22px; line-height: 26px; height: 26px; margin-bottom: 6px; }
.type small { font-size: 10px; }
.tiny { font-size: 13px; font-weight: 700; }

/* your game panel */
.gamepanel { background: linear-gradient(160deg, #fff 60%, #fff4fb); }
.gamepanel .go .input { flex: 1; min-width: 0; padding: 10px 12px; font-size: 14px; }
.kit-state { margin-left: auto; font-family: var(--fb); font-size: 12px; font-weight: 900; color: #16a34a; background: #e3f9eb; border-radius: 999px; padding: 2px 9px; }
.kit-state:empty { display: none; }
.gcard { margin-top: 12px; background: var(--bg); border-radius: 18px; padding: 12px; animation: popIn .5s cubic-bezier(.34,1.56,.64,1) both; }
.gtop { display: flex; gap: 10px; align-items: center; }
.gtop img { width: 52px; height: 52px; border-radius: 14px; box-shadow: var(--shadow); }
.gtop b { font-family: var(--fh); font-size: 17px; display: block; line-height: 1.2; }
.gtop small { color: var(--muted); font-weight: 800; font-size: 12px; }
.gbtns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.gideas { display: flex; flex-wrap: wrap; gap: 6px; }
.kitbox { margin-top: 12px; border-top: 2px dashed var(--line); padding-top: 10px; }
.kitbox summary { position: relative; padding-right: 24px; cursor: pointer; font-family: var(--fh); font-weight: 600; color: var(--ink); list-style: none; }
.kitbox summary::-webkit-details-marker { display: none; }
.kitbox summary::after { content: "▾"; color: var(--muted); position: absolute; right: 4px; top: 2px; }
.kitbox[open] summary::after { content: "▴"; }
.kitbox summary small { display: block; font-family: var(--fb); font-weight: 700; color: var(--muted); font-size: 12px; }
.kit-colors { display: flex; gap: 8px; margin: 10px 0 4px; }
.kc { width: 40px; height: 40px; border-radius: 12px; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); cursor: pointer; position: relative; overflow: hidden; transition: transform .2s; }
.kc:hover { transform: scale(1.08) rotate(-4deg); }
.kc input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.packbox { margin-top: 12px; border-top: 2px dashed var(--line); padding-top: 10px; }

/* result extras */
.res .lbl { position: absolute; left: 8px; top: 8px; z-index: 2; background: rgba(21,23,61,.75); color: #fff; font-size: 12px; font-weight: 900; padding: 3px 9px; border-radius: 999px; }
.res .acts { flex-wrap: wrap; justify-content: flex-end; left: 8px; }
.res.loading .lbl { top: 8px; }
@media (hover: none) { .res .acts { opacity: 1; } }
.res.snd { aspect-ratio: auto; display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: default; background: linear-gradient(120deg, #2a2d6e, #5b3fd1); color: #fff; }
.res.snd.loading { min-height: 86px; justify-content: center; }
.res.snd:hover { transform: none; }
.snd .play { flex: none; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--yellow); color: #4a3200; font-size: 20px; cursor: pointer; box-shadow: 0 4px 0 #d9a300; transition: transform .2s cubic-bezier(.34,1.56,.64,1); }
.snd .play:hover { transform: scale(1.08); }
.snd-body { flex: 1; min-width: 0; }
.snd-body b { display: block; font-family: var(--fh); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.snd-body small { color: #c9c4ff; font-weight: 800; font-size: 12px; }
.wave { display: flex; gap: 3px; align-items: center; height: 26px; margin: 4px 0; }
.wave i { flex: 1; max-width: 6px; border-radius: 3px; background: rgba(255,255,255,.45); height: 30%; }
.wave i:nth-child(3n) { height: 70%; } .wave i:nth-child(4n+1) { height: 50%; } .wave i:nth-child(5n) { height: 90%; }
.snd.playing .wave i { background: var(--yellow); animation: eq .5s ease-in-out infinite alternate; }
.snd.playing .wave i:nth-child(2n) { animation-delay: .15s; } .snd.playing .wave i:nth-child(3n) { animation-delay: .3s; }
@keyframes eq { from { transform: scaleY(.35); } to { transform: scaleY(1); } }
.snd .btn { flex: none; }
@media (max-width: 520px) { .res.snd { flex-wrap: wrap; } .snd-body { flex-basis: calc(100% - 70px); } .snd .btn { width: 100%; } }

/* 3D model view */
.modelview { display: none; }
.modelview.on { display: block; }
.mv-stage { position: relative; aspect-ratio: 4/3; border-radius: 22px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #fff, #e7ebff); display: grid; place-items: center; }
.mv-concept { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: saturate(.6) blur(1px); opacity: .55; animation: floaty 4s ease-in-out infinite; }
.mv-progress { position: relative; width: min(360px, 80%); text-align: center; background: rgba(255,255,255,.85); padding: 18px; border-radius: 20px; box-shadow: var(--shadow); }
.mv-bar { height: 16px; border-radius: 999px; background: var(--bg2); overflow: hidden; }
.mv-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--pink)); transition: width .8s ease; }
.mv-files { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.mv-how { margin-top: 12px; background: #eef7ff; border: 2px solid #cfe3ff; border-radius: 16px; padding: 12px 14px; font-weight: 700; color: var(--ink2); }

/* modals: feed preview + score */
.modal.wide { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.phone.flat { transform: none; width: min(340px, 100%); }
.feed.wide { grid-template-columns: 1fr; }
.feed.wide .g .pic { aspect-ratio: 16/9; }
.feed .g { text-align: left; }
.g.mine.flash { animation: findMe 1.6s ease; }
@keyframes findMe { 0%, 100% { box-shadow: none; } 20%, 60% { box-shadow: 0 0 0 4px var(--yellow), 0 0 30px var(--yellow); transform: scale(1.04); } }
.report.flat { box-shadow: none; padding: 6px 0 0; }
.history .hs { display: grid; place-items: center; background: linear-gradient(120deg, #2a2d6e, #5b3fd1); font-size: 22px; }
.history .h { position: relative; }
.history .hb { position: absolute; right: 2px; bottom: 0; font-size: 14px; }

model-viewer { display: block; }
.stage { scroll-margin-top: 96px; }
.mini-label { display: block; font-weight: 800; font-size: 14px; color: var(--ink); margin-bottom: 6px; }
.mini-label .muted { font-size: 12px; }
.looks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.look { cursor: pointer; padding: 5px 11px; border-radius: 999px; font-family: var(--fh); font-weight: 700; font-size: 13px; color: #fff; -webkit-text-stroke: 3px #1a1040; paint-order: stroke fill; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); transition: transform .2s cubic-bezier(.34,1.56,.64,1); }
.look:hover { transform: translateY(-2px) rotate(-2deg); }
.look.on { box-shadow: 0 0 0 3px var(--blue); transform: scale(1.06); }
