/* ROBLIX Creativity: the 2D paint editor (js/platform/ugcpaint.js). Always dark. */
.ugcp {
  --ub: #111216; --up1: #1c1d22; --up2: #24262c; --up3: #2c2f37; --uline: #2d2f36; --ut: #f7f7f8; --um: #a6a9b2; --ublue: #335fff; --ugreen: #00b06f; --ur: 8px;
  position: fixed; inset: 0; z-index: 800; display: flex; flex-direction: column; background: var(--ub); color: var(--ut);
  font: 14px/1.4 "Figtree", system-ui, sans-serif; color-scheme: dark; overscroll-behavior: contain; outline: none;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased;
}
.ugcp *, .ugcp *::before, .ugcp *::after { box-sizing: border-box; }
:where(.ugcp) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
:where(.ugcp) button:disabled { cursor: default; opacity: .38; }
.ugcp button:focus-visible, .ugcp select:focus-visible { outline: 2px solid #6f8dff; outline-offset: 1px; }
.ugcp svg { width: 20px; height: 20px; display: block; flex: none; }
.ugcp h4 { margin: 0 0 10px; font: 800 11px/1 "Figtree", system-ui, sans-serif; letter-spacing: .09em; text-transform: uppercase; color: var(--um); }
.ugcp h5 { margin: 12px 0 8px; font: 700 11.5px/1 "Figtree", system-ui, sans-serif; color: var(--um); }
.ugcp-note { margin: 6px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--um); }

/* top bar */
.ugcp-top { height: 56px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 12px 0 8px; background: var(--up1); border-bottom: 1px solid var(--uline); }
.ugcp-ib { height: 40px; min-width: 40px; border-radius: var(--ur); display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: #d7d9df; transition: background .12s, color .12s; }
.ugcp-ib:not(:disabled):hover { background: var(--up2); color: var(--ut); }
.ugcp-tg { padding: 0 12px 0 10px; font-weight: 700; font-size: 13.5px; }
.ugcp-tg.on { color: var(--ut); background: var(--up2); box-shadow: inset 0 0 0 1px var(--uline); }
.ugcp-tg:not(.on) { color: var(--um); }
.ugcp-kind { flex: none; margin-left: 4px; padding: 6px 9px; border-radius: 6px; background: rgba(51, 95, 255, .16); color: #a9bcff; font: 800 11px/1 "Figtree", system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.ugcp-name { min-width: 0; width: 300px; flex: 0 1 300px; height: 40px; padding: 0 10px; border: 1px solid transparent; border-radius: var(--ur); background: transparent; color: var(--ut); font: 700 16px "Figtree", system-ui, sans-serif; -webkit-user-select: text; user-select: text; transition: border-color .12s, background .12s; }
.ugcp-name::placeholder { color: #6e727c; }
@supports (field-sizing: content) { .ugcp-name { field-sizing: content; width: auto; flex: 0 1 auto; min-width: 150px; max-width: 340px; } }
.ugcp-name:hover { border-color: var(--uline); }
.ugcp-name:focus { outline: none; border-color: var(--ublue); background: var(--ub); }
.ugcp-state { flex: none; font-size: 12.5px; color: var(--um); white-space: nowrap; }
.ugcp-state.ok { color: #35d48f; }
.ugcp-sp { flex: 1; }
.ugcp-div { width: 1px; height: 24px; background: var(--uline); margin: 0 4px; }
.ugcp-zoom { display: flex; align-items: center; gap: 2px; padding: 0 2px; border-radius: var(--ur); }
.ugcp-zoom .ugcp-ib { min-width: 34px; height: 34px; }
.ugcp-zoom .ugcp-ib svg { width: 18px; height: 18px; }
.ugcp-zoom select { height: 34px; min-width: 84px; padding: 0 8px; border: 1px solid var(--uline); border-radius: var(--ur); background: var(--ub); color: var(--ut); font: 700 13px "Figtree", system-ui, sans-serif; cursor: pointer; }
.ugcp-zoom select:focus { outline: none; border-color: var(--ublue); }
.ugcp-save { height: 40px; margin-left: 6px; padding: 0 20px; border-radius: var(--ur); display: inline-flex; align-items: center; gap: 7px; background: var(--ublue); color: #fff; font-weight: 800; font-size: 14.5px; box-shadow: 0 2px 12px rgba(51, 95, 255, .35); transition: background .15s, box-shadow .15s, filter .12s; }
.ugcp-save:not(:disabled):hover { filter: brightness(1.1); }
.ugcp-save svg { display: none; width: 18px; height: 18px; stroke-width: 2.6; }
.ugcp-save.ok { background: var(--ugreen); box-shadow: 0 2px 12px rgba(0, 176, 111, .3); }
.ugcp-save.ok svg { display: block; }
.ugcp-save:disabled { opacity: .7; cursor: progress; }

/* layout */
.ugcp-main { flex: 1; min-height: 0; display: flex; position: relative; }
.ugcp-side { order: 0; width: 256px; flex: none; display: flex; flex-direction: column; gap: 18px; padding: 14px 14px 24px; background: var(--up1); border-right: 1px solid var(--uline); overflow-y: auto; }
.ugcp-stage { order: 1; flex: 1; min-width: 0; position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 40%, #16171c 0%, var(--ub) 70%); }
.ugcp-right { order: 2; width: 300px; flex: none; display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--up1); border-left: 1px solid var(--uline); overflow-y: auto; }
.ugcp-row { display: contents; }
.ugcp-tools { order: 0; }
.ugcp-opts { order: 1; }
.ugcp-colors { order: 2; }
.ugcp-part { order: 3; }

/* canvas */
.ugcp-view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.ugcp-float { position: absolute; z-index: 2; border: 1.5px dashed #fff; outline: 1px solid rgba(0, 0, 0, .55); cursor: move; touch-action: none; }
.ugcp-float.txt { border-color: #9db4ff; }
.ugcp-float[hidden] { display: none; }
.ugcp-float i { position: absolute; width: 14px; height: 14px; border-radius: 4px; background: #fff; border: 2.5px solid var(--ublue); box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.ugcp-float i::before { content: ""; position: absolute; inset: -13px; }
.ugcp-float [data-h=nw] { left: -8px; top: -8px; cursor: nwse-resize; }
.ugcp-float [data-h=ne] { right: -8px; top: -8px; cursor: nesw-resize; }
.ugcp-float [data-h=sw] { left: -8px; bottom: -8px; cursor: nesw-resize; }
.ugcp-float [data-h=se] { right: -8px; bottom: -8px; cursor: nwse-resize; }
.ugcp-hint { position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 1; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; pointer-events: none; font-size: 12px; color: var(--um); }
.ugcp-hint span:not(:empty) { padding: 5px 9px; border-radius: 6px; background: rgba(17, 18, 22, .78); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); }
.ugcp-hint span.ugcp-hint-t.flash { color: var(--ut); background: rgba(51, 95, 255, .85); }
.ugcp-hint-p { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ugcp-fitb { display: none; }
.ugcp-busy { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; background: rgba(17, 18, 22, .6); font-weight: 700; }
.ugcp-busy[hidden] { display: none; }
.ugcp-busy span { padding: 10px 16px; border-radius: 10px; background: var(--up2); }

/* tools */
.ugcp-tgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ugcp-tool { height: 54px; border-radius: var(--ur); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #cfd2d9; font-size: 11px; font-weight: 700; transition: background .12s, color .12s, box-shadow .12s; }
.ugcp-tool svg { width: 21px; height: 21px; }
.ugcp-tool:hover { background: var(--up2); color: var(--ut); }
.ugcp-tool.on { background: var(--ublue); color: #fff; box-shadow: 0 3px 12px rgba(51, 95, 255, .4); }
.ugcp-tool.tg.on { background: rgba(0, 176, 111, .16); color: #5be0a8; box-shadow: inset 0 0 0 1.5px var(--ugreen); }

/* tool settings */
.ugcp-f { display: grid; grid-template-columns: 70px 1fr 44px; align-items: center; gap: 8px; min-height: 36px; font-size: 13px; color: var(--um); }
.ugcp-f > span { font-weight: 600; }
.ugcp-f > b { color: var(--ut); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.ugcp-fs { grid-template-columns: 70px 1fr; }
.ugcp-fw { grid-template-columns: 1fr; }
.ugcp-f + .ugcp-f { margin-top: 4px; }
.ugcp input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
.ugcp input[type=range]:focus { outline: none; }
.ugcp input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--ublue) var(--p, 50%), #3a3d46 var(--p, 50%)); }
.ugcp input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: #3a3d46; }
.ugcp input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--ublue); }
.ugcp input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .55); }
.ugcp input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .55); }
.ugcp input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(51, 95, 255, .55); }
.ugcp-in { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--uline); border-radius: var(--ur); background: var(--ub); color: var(--ut); font: 600 14px "Figtree", system-ui, sans-serif; -webkit-user-select: text; user-select: text; }
.ugcp-in:focus { outline: none; border-color: var(--ublue); }
select.ugcp-in { cursor: pointer; padding-right: 4px; }
.ugcp-seg { display: flex; gap: 3px; padding: 3px; border-radius: var(--ur); background: var(--ub); border: 1px solid var(--uline); }
.ugcp-seg button { flex: 1; min-height: 30px; padding: 0 8px; border-radius: 6px; color: var(--um); font-weight: 700; font-size: 12.5px; white-space: nowrap; transition: background .12s, color .12s; }
.ugcp-seg button:not(:disabled):hover { color: var(--ut); }
.ugcp-seg button.on { background: var(--up3); color: var(--ut); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.ugcp-btn { height: 36px; padding: 0 12px; border-radius: var(--ur); display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--up2); color: var(--ut); font-weight: 700; font-size: 13px; white-space: nowrap; transition: background .12s, color .12s; }
.ugcp-btn svg { width: 17px; height: 17px; }
.ugcp-btn:hover { background: var(--up3); }
.ugcp-btn.pri { background: var(--ublue); color: #fff; }
.ugcp-btn.pri:hover { filter: brightness(1.1); background: var(--ublue); }
.ugcp-btn.dng { color: #ff8f86; }
.ugcp-btn.dng:hover { background: rgba(255, 75, 62, .16); }
.ugcp-wide { width: 100%; height: 40px; }
.ugcp-fbtns { display: flex; gap: 6px; margin-top: 8px; }
.ugcp-fbtns .ugcp-btn { flex: 1; }

/* colours */
.ugcp-cur { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.ugcp-cw { position: relative; flex: none; width: 52px; height: 40px; border-radius: var(--ur); overflow: hidden; cursor: pointer; background: repeating-conic-gradient(#3a3d46 0 25%, #2a2c33 0 50%) 0 0 / 10px 10px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.ugcp-cw::after { content: ""; position: absolute; inset: 0; background: var(--c, #fff); opacity: var(--a, 1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); border-radius: inherit; }
.ugcp-cw input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.ugcp-hex { font: 700 14px "JetBrains Mono", ui-monospace, Consolas, monospace; letter-spacing: .03em; text-transform: uppercase; }
.ugcp-pal, .ugcp-recent { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 10px; }
.ugcp-recent .ugcp-note { grid-column: 1 / -1; margin: 0; }
.ugcp-recent { margin-top: 0; }
.ugcp-sw { aspect-ratio: 1; border-radius: 7px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); transition: transform .1s; }
.ugcp-sw:hover { transform: scale(1.08); }
.ugcp-sw.on { box-shadow: 0 0 0 2px var(--up1), 0 0 0 4px #fff; }

/* part */
.ugcp-parts { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; border-radius: var(--ur); background: var(--ub); border: 1px solid var(--uline); margin-bottom: 8px; }
.ugcp-parts button { min-height: 32px; border-radius: 6px; color: var(--um); font-weight: 700; font-size: 12.5px; }
.ugcp-parts button:hover { color: var(--ut); }
.ugcp-parts button.on { background: rgba(51, 95, 255, .2); color: #c4d1ff; box-shadow: inset 0 0 0 1.5px #5b84ff; }
.ugcp-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ugcp-acts .dng { grid-column: 1 / -1; }
.ugcp[data-kind=tshirt] .ugcp-acts .dng { grid-column: auto; }

/* preview */
.ugcp-pv { position: relative; flex: none; height: 360px; border-radius: 12px; overflow: hidden; background: radial-gradient(ellipse at 50% 38%, #2b2e38 0%, #1a1b21 62%, #15161a 100%); box-shadow: inset 0 0 0 1px var(--uline); }
.ugcp-pvc { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.ugcp-pvc:active { cursor: grabbing; }
.ugcp-pv.off::after { content: "3D preview is not available here"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--um); font-size: 13px; }
.ugcp-pvnote { position: absolute; top: 10px; left: 0; right: 0; text-align: center; font-size: 11.5px; color: rgba(247, 247, 248, .45); pointer-events: none; }
.ugcp-pvbar { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; gap: 3px; padding: 3px; border-radius: 9px; background: rgba(17, 18, 22, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.ugcp-pvbar button { flex: 1; height: 32px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; color: var(--um); font-weight: 700; font-size: 12.5px; }
.ugcp-pvbar button svg { width: 15px; height: 15px; }
.ugcp-pvbar button:hover { color: var(--ut); }
.ugcp-pvbar button.on { background: var(--up3); color: var(--ut); }
.ugcp-pvmini, .ugcp-pvopen { display: none; }
.ugcp-who button { min-height: 34px; }
.ugcp-tips { padding: 14px 16px; border-radius: 12px; background: var(--up2); box-shadow: inset 0 0 0 1px var(--uline); }
.ugcp-tips h4 { color: #c9ccd4; margin-bottom: 10px; }
.ugcp-tips ul { margin: 0; padding: 0 0 0 16px; color: var(--um); font-size: 13px; line-height: 1.5; }
.ugcp-tips li + li { margin-top: 7px; }
.ugcp-tips li::marker { color: #5b84ff; }

/* medium screens: a narrower preview */
@media (max-width: 1180px) {
  .ugcp-right { width: 240px; }
  .ugcp-pv { height: 290px; }
  .ugcp-name { width: 220px; }
  .ugcp-tg span { display: none; }
  .ugcp-tg { padding: 0 10px; }
}
@media (max-width: 960px) {
  .ugcp-state { display: none; }
  .ugcp-right { width: 200px; padding: 10px; }
  .ugcp-pv { height: 250px; }
  .ugcp-side { width: 232px; }
}

/* phones: tools in scrolling rows at the bottom, the preview a small corner panel */
@media (max-width: 760px) {
  .ugcp-top { height: 52px; gap: 2px; padding: 0 6px 0 4px; }
  .ugcp-kind, .ugcp-zoom, .ugcp-state, .ugcp-div, .ugcp-hint { display: none; }
  .ugcp-name { flex: 1 1 auto; width: auto; font-size: 15px; padding: 0 8px; }
  .ugcp-save { padding: 0 14px; margin-left: 4px; }
  .ugcp-main { flex-direction: column; }
  .ugcp-stage { order: 0; flex: 1; min-height: 0; }
  .ugcp-side { order: 1; width: auto; flex: none; gap: 2px; padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px)); border-right: 0; border-top: 1px solid var(--uline); overflow: visible; }
  .ugcp-side h4, .ugcp-side h5, .ugcp-side .ugcp-note { display: none; }
  .ugcp-sec, .ugcp-row { display: flex; align-items: center; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 3px 8px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .ugcp-sec::-webkit-scrollbar, .ugcp-row::-webkit-scrollbar { display: none; }
  .ugcp-row { order: 2; padding: 0; }
  .ugcp-row > .ugcp-sec { overflow: visible; padding: 3px 0 3px 8px; flex: none; }
  .ugcp-row > .ugcp-part { padding-right: 8px; }
  .ugcp-opts { order: 0; min-height: 46px; }
  .ugcp-opts:empty, .ugcp-opts:not(:has(.ugcp-f, .ugcp-btn)) { display: none; }
  .ugcp-colors { order: 1; }
  .ugcp-tgrid { display: flex; gap: 4px; }
  .ugcp-tool { flex: none; width: 54px; height: 50px; font-size: 10.5px; }
  .ugcp-f { display: flex; flex: none; min-height: 40px; gap: 8px; margin: 0 !important; }
  .ugcp-f > span { white-space: nowrap; font-size: 12px; }
  .ugcp-opts > :not(h4):not(h4 + *) { margin-left: 8px !important; }
  .ugcp-f input[type=range] { width: 108px; height: 40px; }
  .ugcp-f > b { min-width: 36px; }
  .ugcp-fw .ugcp-in { width: 150px; }
  .ugcp-fs select.ugcp-in { width: 140px; }
  .ugcp-in { height: 40px; }
  .ugcp-seg button { min-height: 34px; }
  .ugcp-fbtns { margin: 0; flex: none; }
  .ugcp-fbtns .ugcp-btn, .ugcp-btn { height: 40px; }
  .ugcp-wide { width: auto; }
  .ugcp-cur { margin: 0; flex: none; }
  .ugcp-cw { width: 44px; height: 40px; }
  .ugcp-hex { display: none; }
  .ugcp-colors > .ugcp-f { order: 0; }
  .ugcp-pal, .ugcp-recent { display: contents; }
  .ugcp-recent { order: 1; }
  .ugcp-pal { order: 2; }
  .ugcp-recent .ugcp-note { display: none; }
  .ugcp-sw { flex: none; width: 36px; height: 36px; }
  .ugcp-colors .ugcp-sw { order: 2; }
  .ugcp-recent .ugcp-sw { order: 1; }
  .ugcp-recent .ugcp-sw:last-child { margin-right: 8px; }
  .ugcp-part { display: flex; align-items: center; gap: 6px; }
  .ugcp-parts { display: flex; margin: 0; flex: none; }
  .ugcp-parts button { min-height: 36px; padding: 0 9px; white-space: nowrap; }
  .ugcp-acts { display: flex; gap: 6px; }
  .ugcp-part::before { content: ""; width: 1px; height: 30px; background: var(--uline); margin: 0 4px 0 2px; flex: none; }
  .ugcp-fitb:not([hidden]) { display: inline-flex; position: absolute; left: 10px; bottom: 10px; z-index: 2; height: 40px; padding: 0 14px 0 10px; border-radius: 20px; align-items: center; gap: 6px; background: rgba(36, 38, 44, .92); box-shadow: 0 4px 14px rgba(0, 0, 0, .45), inset 0 0 0 1px var(--uline); font-weight: 700; font-size: 13px; }
  .ugcp-fitb svg { width: 18px; height: 18px; }
  .ugcp-right { position: absolute; top: 8px; right: 8px; z-index: 3; width: 108px; padding: 0; gap: 0; background: none; border: 0; overflow: visible; }
  .ugcp-right.dock { right: auto; }
  .ugcp-right.dock .ugcp-pv { height: 100%; }
  .ugcp-pv { height: 136px; border-radius: 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, .5), inset 0 0 0 1px var(--uline); }
  .ugcp-pvbar, .ugcp-pvnote, .ugcp-who, .ugcp-tips { display: none; }
  .ugcp-pvmini { display: flex; position: absolute; left: 4px; right: 4px; bottom: 4px; gap: 2px; padding: 2px; border-radius: 8px; background: rgba(17, 18, 22, .72); }
  .ugcp-pvmini button { flex: 1; height: 30px; border-radius: 6px; display: grid; place-items: center; color: var(--um); }
  .ugcp-pvmini button svg { width: 16px; height: 16px; }
  .ugcp-pvmini button.on { color: var(--ut); background: var(--up3); }
  .ugcp-right.min { width: auto; }
  .ugcp-right.min .ugcp-pv { display: none; }
  .ugcp-right.min .ugcp-pvopen { display: inline-flex; height: 40px; padding: 0 14px 0 10px; border-radius: 20px; align-items: center; gap: 6px; background: rgba(36, 38, 44, .92); box-shadow: 0 4px 14px rgba(0, 0, 0, .45), inset 0 0 0 1px var(--uline); font-weight: 700; font-size: 13px; }
  .ugcp-right.min .ugcp-pvopen svg { width: 18px; height: 18px; }
}
@media (max-width: 380px) {
  .ugcp-tg { display: none; }
}
