:root {
  --bg: #0b0d10;
  --panel: #15181d;
  --panel2: #1b1f26;
  --line: #2c323b;
  --text: #e9edf4;
  --muted: #8d98a8;
  --red: #e84040;
  --red2: #ff6464;
  --good: #53d18a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: radial-gradient(circle at top, #201014, var(--bg) 42%); color: var(--text); font-family: Inter, Segoe UI, Arial, sans-serif; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 22px 26px; border-bottom: 1px solid var(--line); background: rgba(10,12,15,.82); position: sticky; top: 0; z-index: 3; backdrop-filter: blur(10px); }
h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
h2 { margin: 0 0 12px; font-size: 16px; }
h3 { margin: 0 0 10px; font-size: 14px; }
p { margin: 6px 0 0; color: var(--muted); }
code { background: #101319; border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; color: #ffd1d1; }
.layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; padding: 16px; }
.panel { background: rgba(21,24,29,.95); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.sidebar { padding: 16px; height: calc(100vh - 104px); overflow: auto; }
.workspace { min-height: calc(100vh - 104px); padding: 18px; overflow: hidden; }
label { display: block; margin: 12px 0 6px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; background: #0f1217; color: var(--text); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 2px rgba(232,64,64,.18); }
button, .button { border: 0; border-radius: 10px; padding: 10px 13px; background: linear-gradient(180deg, var(--red2), var(--red)); color: white; text-decoration: none; cursor: pointer; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
button:hover, .button:hover { filter: brightness(1.06); }
button:disabled { opacity: .55; cursor: not-allowed; }
.secondary { background: #2a3039; }
.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); padding: 7px 10px; }
form button { width: 100%; margin-top: 14px; }
.pill { padding: 8px 12px; border-radius: 999px; background: #211519; color: var(--red2); border: 1px solid rgba(232,64,64,.35); font-size: 12px; }
.pill.ok { color: var(--good); border-color: rgba(83,209,138,.35); background: rgba(83,209,138,.08); }
.row-title { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; }
.row-title.compact { margin-top: 0; }
.muted { color: var(--muted); font-size: 12px; }
.projects { display: grid; gap: 8px; }
.project { border: 1px solid var(--line); background: var(--panel2); padding: 11px; border-radius: 12px; cursor: pointer; }
.project:hover, .project.active { border-color: rgba(232,64,64,.8); }
.project strong { display: block; font-size: 13px; }
.project span { color: var(--muted); font-size: 12px; }
.empty { display: grid; place-items: center; min-height: 440px; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; }
.preview-panel { border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg, rgba(27,31,38,.88), rgba(13,16,20,.92)); overflow: hidden; margin-bottom: 16px; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.preview-toolbar h2 { margin: 0; }
.preview-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.preview-controls select { width: 210px; }
.preview-controls button { min-width: 42px; }
.mini-label { display: flex; align-items: center; gap: 8px; margin: 0; text-transform: none; letter-spacing: 0; font-size: 12px; }
.mini-label input { width: 95px; padding: 0; accent-color: var(--red); }
.preview-stage { position: relative; height: 430px; display: grid; place-items: center; overflow: auto; background:
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.025) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(232,64,64,.10), transparent 38%),
    #101319;
  background-size: 34px 34px, 34px 34px, auto, auto;
}
.preview-stage::after { content: ""; position: absolute; width: 220px; height: 110px; left: 50%; top: 68%; transform: translate(-50%, -50%) rotate(45deg) skew(-10deg, -10deg); border: 1px solid rgba(232,64,64,.22); background: rgba(255,255,255,.025); pointer-events: none; }
#previewCanvas { position: relative; z-index: 1; image-rendering: pixelated; max-width: 100%; }
.preview-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); z-index: 2; }
.project-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
.actions.left { justify-content: flex-start; margin-top: 10px; }
.tabs { display: flex; gap: 8px; margin: 14px 0; }
.tabs button { background: #20252c; color: var(--muted); }
.tabs button.active { background: linear-gradient(180deg, var(--red2), var(--red)); color: white; }
.tab { display: none; }
.tab.active { display: block; }
.split { display: grid; grid-template-columns: 1fr 320px; gap: 14px; }
.search { margin-bottom: 10px; }
.frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; max-height: calc(100vh - 245px); overflow: auto; padding-right: 4px; }
.frame { background: #101319; border: 1px solid var(--line); border-radius: 12px; min-height: 116px; padding: 8px; cursor: pointer; display: grid; align-content: space-between; }
.frame:hover, .frame.active { border-color: var(--red); }
.frame .thumb { display: grid; place-items: center; min-height: 72px; background-image: linear-gradient(45deg, #222 25%, transparent 25%), linear-gradient(-45deg, #222 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #222 75%), linear-gradient(-45deg, transparent 75%, #222 75%); background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0px; border-radius: 8px; overflow: hidden; }
.frame img { max-width: 100%; max-height: 74px; image-rendering: pixelated; }
.frame span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: var(--muted); margin-top: 7px; }
.editor-card { background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; position: sticky; top: 105px; height: fit-content; }
.selected { border: 1px dashed var(--line); border-radius: 12px; min-height: 148px; display: grid; place-items: center; color: var(--muted); text-align: center; overflow-wrap: anywhere; padding: 10px; }
.selected img { max-width: 180px; max-height: 110px; image-rendering: pixelated; margin-bottom: 8px; }
.hint { font-size: 12px; line-height: 1.45; }
.animation-layout { display: grid; grid-template-columns: 310px 1fr; gap: 14px; }
.animation-groups { background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; max-height: calc(100vh - 260px); overflow: auto; }
.animation-group { width: 100%; display: grid; justify-items: start; text-align: left; gap: 2px; background: #101319; border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 10px; margin-bottom: 8px; }
.animation-group.active, .animation-group:hover { border-color: var(--red); background: rgba(232,64,64,.08); }
.animation-group span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.animation-group em { color: var(--red2); font-style: normal; font-size: 11px; }
.animation-steps { min-width: 0; }
.animation-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; max-height: calc(100vh - 300px); overflow: auto; padding-right: 4px; margin-top: 10px; }
.anim-step { background: #101319; border: 1px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; }
.anim-step:hover, .anim-step.active { border-color: var(--red); }
.anim-step strong { display: block; font-size: 13px; }
.anim-step span { color: var(--muted); font-size: 12px; }
.anim-layer-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 74px; margin-top: 8px; padding: 7px; border-radius: 8px; background-image: linear-gradient(45deg, #222 25%, transparent 25%), linear-gradient(-45deg, #222 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #222 75%), linear-gradient(-45deg, transparent 75%, #222 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0px; }
.anim-layer-row img { max-width: 48px; max-height: 48px; image-rendering: pixelated; object-fit: contain; }
#jsonEditor { min-height: calc(100vh - 260px); font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 1.45; white-space: pre; }
.sheetWrap { overflow: auto; max-height: calc(100vh - 220px); background: #0b0d10; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
#sheetImage { max-width: none; image-rendering: pixelated; }
#toast { position: fixed; right: 16px; bottom: 16px; background: #161a20; border: 1px solid var(--line); border-left: 4px solid var(--red); color: var(--text); padding: 12px 14px; border-radius: 12px; max-width: 520px; display: none; box-shadow: 0 12px 40px rgba(0,0,0,.35); white-space: pre-wrap; z-index: 20; }
@media (max-width: 980px) { .layout, .split, .animation-layout { grid-template-columns: 1fr; } .sidebar { height: auto; } .preview-toolbar { align-items: stretch; flex-direction: column; } .preview-controls { justify-content: flex-start; } }

/* Fixed live-preview viewport: animation changes no longer resize the panel. */
.preview-stage {
  height: 430px;
  min-height: 430px;
  max-height: 430px;
  overflow: hidden;
}
#previewCanvas {
  width: 100%;
  height: 100%;
  display: block;
}
.anim-composite {
  width: 100%;
  height: 115px;
  margin-top: 8px;
  border-radius: 8px;
  background:
    radial-gradient(circle at center, rgba(232,64,64,.09), transparent 55%),
    #0b0d10;
  image-rendering: pixelated;
}
.anim-step details { margin-top: 8px; }
.anim-step summary { color: var(--muted); font-size: 12px; cursor: pointer; }


.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.checkline { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; color: var(--muted); font-size: 12px; text-transform: none; letter-spacing: 0; }
.checkline input { width: auto; accent-color: var(--red); }
.editor-card h3 + form, .editor-card form + .hint { margin-top: 8px; }
@media (max-width: 980px) { .grid2 { grid-template-columns: 1fr; } }

/* =========================
   COMPACT ONE-SCREEN LAYOUT
   Keep this block at the very bottom.
   ========================= */

.topbar,
.app-header,
.header,
.site-header {
  display: none !important;
}

html,
body {
  height: 100vh !important;
  overflow: hidden !important;
}

body {
  padding-top: 0 !important;
}

.layout {
  height: 100vh !important;
  grid-template-columns: 300px 1fr !important;
  gap: 8px !important;
  padding: 8px !important;
  margin: 0 !important;
}

.sidebar {
  height: calc(100vh - 16px) !important;
  padding: 10px !important;
  overflow: auto !important;
}

.workspace {
  height: calc(100vh - 16px) !important;
  min-height: 0 !important;
  padding: 10px !important;
  overflow: hidden !important;
}

.panel {
  border-radius: 12px !important;
}

.preview-panel {
  margin-bottom: 8px !important;
  border-radius: 12px !important;
}

.preview-toolbar {
  padding: 8px 12px !important;
  gap: 8px !important;
}

.preview-toolbar h2 {
  font-size: 14px !important;
}

.preview-toolbar p {
  font-size: 12px !important;
  margin-top: 2px !important;
}

.preview-controls {
  gap: 6px !important;
}

.preview-controls select {
  width: 185px !important;
  padding: 7px 8px !important;
  font-size: 12px !important;
}

.preview-controls button {
  padding: 7px 10px !important;
  min-width: 36px !important;
  font-size: 12px !important;
}

.mini-label {
  font-size: 11px !important;
  gap: 5px !important;
}

.mini-label input {
  width: 70px !important;
}

.preview-stage {
  height: 250px !important;
  min-height: 250px !important;
  max-height: 250px !important;
  overflow: hidden !important;
  display: grid !important;
  place-items: center !important;
}

#previewCanvas {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: contain !important;
  image-rendering: pixelated !important;
  image-rendering: crisp-edges !important;
}

.project-head {
  padding-bottom: 8px !important;
  margin-bottom: 0 !important;
}

.project-head h2 {
  font-size: 15px !important;
}

.project-head p {
  font-size: 12px !important;
}

.actions {
  gap: 6px !important;
}

.actions .button,
.actions button {
  padding: 8px 12px !important;
  font-size: 12px !important;
}

.tabs {
  margin: 8px 0 !important;
  gap: 6px !important;
}

.tabs button {
  padding: 8px 12px !important;
  font-size: 12px !important;
}

.split {
  grid-template-columns: 1fr 290px !important;
  gap: 10px !important;
}

.search {
  margin-bottom: 6px !important;
  padding: 8px 10px !important;
}

.frames {
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)) !important;
  gap: 7px !important;
  max-height: calc(100vh - 505px) !important;
  overflow: auto !important;
  padding-right: 4px !important;
}

.frame {
  min-height: 88px !important;
  padding: 6px !important;
  border-radius: 10px !important;
}

.frame .thumb {
  min-height: 54px !important;
}

.frame img {
  max-height: 58px !important;
}

.frame span {
  font-size: 11px !important;
  margin-top: 4px !important;
}

.editor-card {
  top: 8px !important;
  padding: 10px !important;
  max-height: calc(100vh - 390px) !important;
  overflow: auto !important;
}

.editor-card h3 {
  margin-bottom: 6px !important;
}

.selected {
  min-height: 95px !important;
  padding: 8px !important;
}

.selected img {
  max-width: 140px !important;
  max-height: 80px !important;
}

label {
  margin: 8px 0 4px !important;
  font-size: 10px !important;
}

input,
select,
textarea {
  padding: 8px 9px !important;
  font-size: 12px !important;
}

button,
.button {
  padding: 8px 11px !important;
  font-size: 12px !important;
}

form button {
  margin-top: 10px !important;
}

.row-title {
  margin-top: 14px !important;
}

.project {
  padding: 8px !important;
}

.project strong {
  font-size: 12px !important;
}

.project span {
  font-size: 11px !important;
}

.animation-layout {
  grid-template-columns: 260px 1fr !important;
  gap: 10px !important;
}

.animation-groups {
  max-height: calc(100vh - 170px) !important;
  padding: 10px !important;
}

.animation-strip {
  max-height: calc(100vh - 190px) !important;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
}

#jsonEditor {
  min-height: calc(100vh - 165px) !important;
}

.sheetWrap {
  max-height: calc(100vh - 150px) !important;
}

.grid2 {
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
}


/* =========================
   Pixel editor + drag animation additions
   ========================= */

.frame-actions { display: flex; gap: 8px; margin: 8px 0 10px; }
.frame-actions .button { width: 100%; }

.anim-drop-zone {
  border: 1px dashed rgba(255, 100, 100, .55);
  background: rgba(232, 64, 64, .06);
  color: var(--muted);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 8px 0 10px;
  text-align: center;
  font-size: 12px;
}

.anim-drop-zone.drag-over {
  border-color: var(--red2);
  background: rgba(232, 64, 64, .16);
  color: var(--text);
}

.frame[draggable="true"] { user-select: none; }
.frame.dragging { opacity: .45; }

.pe-modal.hidden { display: none !important; }
.pe-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, .72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.pe-window {
  width: min(1080px, 96vw);
  height: min(760px, 94vh);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #11161f;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .58);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pe-header,
.pe-toolbar,
.pe-footer {
  padding: 10px 12px;
  border-color: var(--line);
  background: rgba(21, 24, 29, .98);
}

.pe-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.pe-title { color: var(--text); font-size: 16px; font-weight: 800; }
.pe-subtitle { color: var(--muted); font-size: 12px; margin-top: 3px; overflow-wrap: anywhere; }
.pe-close { width: 34px; height: 34px; padding: 0; background: #232933; border: 1px solid var(--line); }

.pe-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  border-bottom: 1px solid var(--line);
}

.pe-tool {
  background: #20252c;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 7px 9px;
  font-size: 12px;
}

.pe-tool.active {
  background: linear-gradient(180deg, var(--red2), var(--red));
  border-color: var(--red2);
  color: #fff;
}

.pe-tool.danger {
  border-color: rgba(232,64,64,.45);
  color: #ffd6d6;
}

.pe-inline {
  margin: 0 !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  font-size: 11px !important;
}

.pe-inline input[type="range"] {
  width: 76px !important;
  padding: 0 !important;
  accent-color: var(--red);
}

.pe-inline input[type="color"] {
  width: 34px !important;
  height: 30px;
  padding: 3px !important;
  border-radius: 8px;
}

.pe-check input {
  width: auto !important;
  accent-color: var(--red);
}

.pe-body {
  flex: 1;
  overflow: auto;
  background:
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.03) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(232,64,64,.08), transparent 42%),
    #0c1017;
  background-size: 32px 32px, 32px 32px, auto, auto;
}

.pe-canvas-wrap {
  min-width: 100%;
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 18px;
}

#peCanvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: crosshair;
  border: 1px solid #394252;
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  background:
    linear-gradient(45deg, #2b3140 25%, transparent 25%),
    linear-gradient(-45deg, #2b3140 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2b3140 75%),
    linear-gradient(-45deg, transparent 75%, #2b3140 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.pe-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
}

.pe-status {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

#addFrameImageInfo {
  margin: 4px 0 8px !important;
}



/* New furniture modal */
.new-furni-btn {
  width: 100%;
  margin-top: 10px;
}

.nf-modal.hidden { display: none !important; }

.nf-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.nf-window {
  width: min(520px, 94vw);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #11161f;
  box-shadow: 0 28px 90px rgba(0,0,0,.58);
  overflow: hidden;
}

.nf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(21,24,29,.98);
}

.nf-title {
  font-weight: 800;
  font-size: 16px;
}

.nf-subtitle {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.nf-close {
  width: 34px;
  height: 34px;
  padding: 0;
  background: #232933;
  border: 1px solid var(--line);
}

.nf-body {
  padding: 14px;
}

.nf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.nf-clone.hidden { display: none !important; }

.nf-check {
  display: flex;
  gap: 8px;
  align-items: center;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.nf-check input {
  width: auto !important;
  accent-color: var(--red);
}

.nf-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

/* Final compact guardrails */
.preview-stage {
  height: 250px !important;
  min-height: 250px !important;
  max-height: 250px !important;
}
.layout {
  grid-template-columns: 300px 1fr !important;
  gap: 8px !important;
  padding: 8px !important;
}
.frames {
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)) !important;
}


/* Preview centering + fitted animation thumbnails */
.anim-composite {
  width: 100% !important;
  height: 92px !important;
  object-fit: contain !important;
  image-rendering: pixelated !important;
  image-rendering: crisp-edges !important;
}

.anim-step {
  overflow: hidden !important;
}

.preview-stage {
  display: grid !important;
  place-items: center !important;
}

#previewCanvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}


/* Frame position editor */
#positionForm {
  margin-top: 8px;
}

#positionForm h3 {
  margin: 0 0 8px !important;
}

#positionForm button {
  width: 100%;
  margin-top: 10px !important;
}


/* =========================
   Preview-side frame settings + add-frame modal
   ========================= */

.preview-stage {
  position: relative !important;
}

.preview-frame-panel {
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 258px;
  z-index: 6;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  background: rgba(14,17,23,.92);
  box-shadow: 0 12px 36px rgba(0,0,0,.35);
  backdrop-filter: blur(8px);
}

.quick-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.quick-panel-head strong {
  font-size: 13px;
}

.compact-selected {
  min-height: 58px !important;
  padding: 7px !important;
  display: grid !important;
  place-items: center !important;
  font-size: 11px !important;
  background: rgba(255,255,255,.025);
}

.compact-selected img {
  max-width: 54px !important;
  max-height: 44px !important;
  margin: 0 0 4px !important;
}

.compact-selected strong {
  display: block;
  font-size: 11px;
  line-height: 1.1;
  max-width: 218px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-selected p {
  font-size: 10px !important;
  margin-top: 2px !important;
}

.compact-actions {
  margin: 6px 0 8px !important;
}

.compact-actions .button {
  width: 100%;
}

.preview-frame-panel label {
  margin: 6px 0 3px !important;
  font-size: 9px !important;
}

.preview-frame-panel input,
.preview-frame-panel select {
  padding: 6px 7px !important;
  font-size: 11px !important;
  border-radius: 8px !important;
}

.preview-frame-panel button {
  padding: 7px 9px !important;
  font-size: 11px !important;
  border-radius: 8px !important;
}

.preview-frame-panel .mini-grid {
  gap: 6px !important;
}

.preview-frame-panel .checkline {
  font-size: 10px !important;
  line-height: 1.15;
}

.quick-details {
  margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 8px;
}

.quick-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.editor-card-hidden {
  display: none !important;
}

.split {
  grid-template-columns: 1fr !important;
}

.frames {
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)) !important;
}

/* Add frame placeholder tile inside the frame grid */
.add-frame-tile {
  border: 1px dashed rgba(0, 245, 255, .95) !important;
  background: rgba(0, 245, 255, .045) !important;
  color: #b9fbff !important;
}

.add-frame-tile:hover {
  background: rgba(0, 245, 255, .12) !important;
  filter: none !important;
}

.add-frame-plus {
  min-height: 54px !important;
  display: grid !important;
  place-items: center !important;
  color: #12f6ff;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  background: rgba(0, 245, 255, .035) !important;
  border-radius: 8px;
}

/* Add frame modal */
.af-modal.hidden {
  display: none !important;
}

.af-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.af-window {
  width: min(560px, 94vw);
  max-height: 94vh;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #11161f;
  box-shadow: 0 28px 90px rgba(0,0,0,.58);
  display: flex;
  flex-direction: column;
}

.af-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(21,24,29,.98);
}

.af-title {
  font-size: 16px;
  font-weight: 800;
}

.af-subtitle {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.af-close {
  width: 34px;
  height: 34px;
  padding: 0;
  background: #232933;
  border: 1px solid var(--line);
}

.af-body {
  padding: 14px;
  overflow: auto;
}

.af-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* Keep preview object visible around the left control panel */
#previewCanvas {
  position: relative;
  z-index: 1;
}


/* =========================
   Taller clean preview stage
   ========================= */

/* Increase the live preview area by 250px. Previous compact height was 250px. */
.preview-stage {
  height: 500px !important;
  min-height: 500px !important;
  max-height: 500px !important;
  overflow: hidden !important;

  /* Remove the red radial glow from the background, keep only the grid. */
  background:
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.025) 1px, transparent 1px),
    #101319 !important;
  background-size: 34px 34px, 34px 34px, auto !important;
}

/* Remove the red diamond/square room tile overlay. */
.preview-stage::after {
  display: none !important;
  content: none !important;
}

/* Give the preview panel enough room for the taller stage. */
.workspace {
  overflow: auto !important;
}

.frames {
  max-height: calc(100vh - 755px) !important;
  min-height: 110px !important;
}


/* =========================
   Auth / public / admin UI
   ========================= */
.panel-lite {
  background: rgba(11,13,16,.55);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 12px;
}

.auth-tabs,
.auth-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.auth-tabs button {
  flex: 1;
  padding: 7px 9px !important;
}

.auth-tabs button.active {
  border-color: var(--red);
  color: #fff;
}

.auth-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.auth-form input {
  padding: 7px 9px !important;
}

.auth-form button {
  margin-top: 0 !important;
}

.auth-user {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
}

.auth-actions .button,
.auth-actions button {
  flex: 1;
  padding: 7px 9px !important;
  font-size: 11px !important;
}

.danger-btn {
  background: #2a3039 !important;
  border: 1px solid rgba(232,64,64,.45) !important;
  color: #ffd6d6 !important;
}

.preview-frame-panel .frame-actions.compact-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

#togglePublic {
  white-space: nowrap;
}


/* =========================
   Showcase / Admin pages
   ========================= */
.page-body {
  min-height: 100vh !important;
  height: auto !important;
  overflow: auto !important;
  background: radial-gradient(circle at top, #201014, var(--bg) 42%) !important;
}

.public-page {
  padding: 18px;
  max-width: 1380px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(21,24,29,.92);
}

.page-actions {
  display: flex;
  gap: 8px;
}

.page-status {
  padding: 12px;
  margin-bottom: 14px;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.showcase-card {
  background: rgba(21,24,29,.95);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.showcase-thumb {
  min-height: 122px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background-image: linear-gradient(45deg, #222 25%, transparent 25%), linear-gradient(-45deg, #222 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #222 75%), linear-gradient(-45deg, transparent 75%, #222 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0px;
}

.showcase-thumb img {
  max-width: 160px;
  max-height: 110px;
  image-rendering: pixelated;
}

.showcase-meta {
  display: grid;
  gap: 3px;
}

.showcase-meta span {
  color: var(--muted);
  font-size: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 14px;
  display: grid;
  gap: 4px;
}

.stat-card strong {
  font-size: 24px;
}

.stat-card span {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .06em;
}

.admin-table {
  overflow: auto;
  margin-bottom: 18px;
}

.admin-table table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 12px;
}

.admin-preview {
  max-width: 54px;
  max-height: 54px;
  image-rendering: pixelated;
}


/* =========================
   Fancy modern showcase page
   ========================= */

.page-body {
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 75, 86, .18), transparent 26%),
    radial-gradient(circle at 86% 12%, rgba(0, 245, 255, .08), transparent 28%),
    linear-gradient(180deg, #090b0f 0%, #0d1118 55%, #090b0f 100%) !important;
}

.public-page {
  max-width: 1480px !important;
  padding: 22px !important;
}

.page-header {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10) !important;
  background:
    linear-gradient(135deg, rgba(255, 75, 86, .10), rgba(16, 21, 30, .96) 38%, rgba(0, 245, 255, .055)) !important;
  box-shadow: 0 24px 80px rgba(0,0,0,.34);
}

.page-header::before {
  content: "";
  position: absolute;
  inset: -60% -20% auto auto;
  width: 440px;
  height: 220px;
  transform: rotate(22deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
  pointer-events: none;
}

.page-header h1 {
  font-size: clamp(24px, 3vw, 38px);
  letter-spacing: -.03em;
  margin-bottom: 5px;
}

.page-header p {
  max-width: 720px;
  color: #aeb7c8;
}

.page-status {
  border: 1px solid rgba(255,255,255,.09) !important;
  background: rgba(13, 17, 24, .72) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.showcase-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)) !important;
  gap: 16px !important;
  align-items: stretch;
}

.showcase-card {
  position: relative;
  overflow: hidden !important;
  min-width: 0;
  border-radius: 18px !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.018)),
    rgba(18, 23, 32, .92) !important;
  box-shadow:
    0 18px 55px rgba(0,0,0,.34),
    inset 0 1px 0 rgba(255,255,255,.06);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.showcase-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 82, 92, .48) !important;
  box-shadow:
    0 26px 70px rgba(0,0,0,.42),
    0 0 0 1px rgba(255, 82, 92, .10),
    inset 0 1px 0 rgba(255,255,255,.08);
}

.showcase-thumb {
  position: relative;
  overflow: hidden !important;
  height: 150px !important;
  min-height: 150px !important;
  width: 100%;
  display: grid !important;
  place-items: center !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255,255,255,.075);
  background:
    linear-gradient(45deg, rgba(255,255,255,.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.035) 75%),
    radial-gradient(circle at center, rgba(255, 70, 90, .10), rgba(0,0,0,.04) 54%, rgba(0,0,0,.18)) !important;
  background-size: 18px 18px, 18px 18px, 18px 18px, 18px 18px, auto !important;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0, center !important;
}

.showcase-glow {
  position: absolute;
  width: 120px;
  height: 70px;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 77, 88, .22), transparent 68%);
  filter: blur(10px);
  pointer-events: none;
}

.showcase-thumb img {
  position: relative;
  z-index: 1;
  max-width: 92% !important;
  max-height: 132px !important;
  object-fit: contain !important;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}

.showcase-meta {
  min-width: 0;
  display: grid !important;
  gap: 6px !important;
}

.showcase-meta strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f6f7fb;
  font-size: 15px;
  line-height: 1.2;
}

.creator-pill {
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255,255,255,.045);
  color: #c5ccda !important;
}

.showcase-date {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #8f98aa !important;
}

.duplicate-btn {
  width: 100%;
  min-height: 38px;
  border-radius: 11px !important;
  font-weight: 800 !important;
  letter-spacing: .01em;
}

/* Better containment on narrow screens */
@media (max-width: 620px) {
  .public-page {
    padding: 12px !important;
  }

  .page-header {
    display: grid !important;
  }

  .showcase-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
    gap: 10px !important;
  }

  .showcase-thumb {
    height: 130px !important;
    min-height: 130px !important;
  }

  .showcase-thumb img {
    max-height: 112px !important;
  }
}


/* =========================================================
   Habba Component Showcase Theme
   Inspired by uploaded hb-* component showcase:
   blue fansite panels, yellow hotel buttons, green CTAs,
   pixel-style cards, glow components, and compact dashboard UI.
   ========================================================= */

:root {
  --hb-bg-top: #0a3559;
  --hb-bg-mid: #104e81;
  --hb-bg-bottom: #1a5789;
  --hb-header: #08263c;
  --hb-tab-dark: #001b2d;
  --hb-panel: #15689c;
  --hb-panel-dark: #0d466d;
  --hb-panel-deep: #0b638f;
  --hb-blue: #25b8ee;
  --hb-blue-soft: #9fe0ff;
  --hb-yellow: #ffb900;
  --hb-yellow-border: #ffea00;
  --hb-green: #00813e;
  --hb-green-hover: #00ab54;
  --hb-green-border: #8eda55;
  --hb-red: #cc0000;
  --hb-text: #c9def0;
  --hb-muted: rgba(255,255,255,.72);
  --hb-shadow-drop: 0 3px 0 1px rgba(0,0,0,.28);
  --hb-shadow-panel: inset 0 1px 0 rgba(255,255,255,.10), 0 2px 0 rgba(0,0,0,.18);
  --bg: #08263c;
  --panel: #15689c;
  --panel2: #0d466d;
  --line: rgba(159,224,255,.24);
  --text: #ffffff;
  --muted: rgba(255,255,255,.72);
  --red: #cc0000;
  --red2: #ffb900;
  --good: #8eda55;
}

html,
body {
  background:
    radial-gradient(circle at 10% 0%, rgba(255,234,0,.18), transparent 24%),
    radial-gradient(circle at 85% 6%, rgba(37,184,238,.20), transparent 30%),
    linear-gradient(var(--hb-bg-top) 0%, var(--hb-bg-mid) 44%, var(--hb-bg-bottom) 100%) !important;
  color: var(--hb-text) !important;
  font-family: Ubuntu, "Trebuchet MS", Tahoma, Segoe UI, Arial, sans-serif !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.32), transparent 70%);
  z-index: -1;
}

h1, h2, h3,
.project strong,
.page-header h1,
.showcase-meta strong,
.auth-user strong,
.hb-studio-brand strong {
  font-family: "Ubuntu Condensed", Ubuntu, "Trebuchet MS", Tahoma, sans-serif !important;
  letter-spacing: .01em;
}

/* Fansite shell/panels */
.panel,
.preview-panel,
.project,
.frame,
.editor-card,
.animation-group,
.anim-step,
.page-header,
.page-status,
.showcase-card,
.admin-table,
.stat-card,
.nf-window,
.af-window,
.pe-window,
.hb-modal,
.panel-lite,
.auth-box,
.preview-frame-panel {
  border-color: rgba(159,224,255,.24) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.015)),
    linear-gradient(180deg, var(--hb-panel), var(--hb-panel-dark)) !important;
  box-shadow: var(--hb-shadow-panel), 0 14px 34px rgba(0,0,0,.26) !important;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(8,38,60,.96), rgba(13,70,109,.94)),
    var(--hb-header) !important;
  border: 2px solid rgba(159,224,255,.22) !important;
  box-shadow: inset 0 1px rgba(255,255,255,.10), 0 10px 0 rgba(0,0,0,.10) !important;
}

.workspace {
  background:
    linear-gradient(180deg, rgba(8,38,60,.46), rgba(6,22,34,.28)) !important;
}

/* Brand block from the showcase-style header/logo components */
.hb-studio-brand {
  display: grid;
  grid-template-columns: 48px minmax(0,1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 12px;
  background: linear-gradient(#0d6ea5, #07517c);
  border: 3px solid rgba(126,202,238,.34);
  box-shadow: inset 0 1px rgba(255,255,255,.15), 0 3px 0 rgba(0,0,0,.30);
  color: #fff;
}

.hb-studio-brand__mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #02353c;
  border: 2px solid #267b91;
  color: var(--hb-yellow-border);
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 1px 0 2px rgba(0,0,0,.22);
}

.hb-studio-brand strong {
  display: block;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  text-transform: uppercase;
}

.hb-studio-brand span {
  display: block;
  margin-top: 3px;
  color: var(--hb-blue-soft);
  font-size: 12px;
  font-weight: 700;
}

/* Buttons based on hb-cta / hb-btn-hotel / hb-btn-secondary */
button,
.button,
.showcase-btn,
.duplicate-btn {
  min-height: 38px !important;
  border-radius: 6px !important;
  border: 2px solid var(--hb-green-border) !important;
  background: linear-gradient(#00ab54, #00813e) !important;
  color: #fff !important;
  box-shadow: var(--hb-shadow-drop) !important;
  font-family: "Ubuntu Condensed", Ubuntu, "Trebuchet MS", sans-serif !important;
  font-weight: 900 !important;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0,0,0,.24);
}

button:hover,
.button:hover,
.duplicate-btn:hover {
  background: linear-gradient(#20c76d, #00ab54) !important;
  border-color: #b9f373 !important;
  filter: none !important;
  transform: translateY(-1px);
}

button:active,
.button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 1px rgba(0,0,0,.28) !important;
}

.secondary,
.ghost,
.preview-controls .ghost,
.auth-tabs button,
.quick-details summary {
  background: rgba(0,0,0,.20) !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  color: var(--hb-blue-soft) !important;
  box-shadow: 0 2px 0 rgba(0,0,0,.16) !important;
  text-transform: none !important;
  text-shadow: none;
}

.secondary:hover,
.ghost:hover,
.auth-tabs button.active {
  background: rgba(255,255,255,.12) !important;
  color: #fff !important;
}

#togglePublic,
#exportNitro,
#exportZip,
.hb-btn-hotel,
.duplicate-btn {
  background: linear-gradient(#ffea00, #ffb900) !important;
  border-color: var(--hb-yellow-border) !important;
  color: #1b1b1b !important;
  text-shadow: none !important;
}

.danger-btn,
#deleteFrameBtn,
.hb-btn-danger {
  background: linear-gradient(#dc2626, #9f1515) !important;
  border-color: #f87171 !important;
  color: #fff !important;
}

/* Inputs */
input,
select,
textarea {
  background: #d3dde4 !important;
  color: #1d2b35 !important;
  border: 2px solid rgba(39,93,142,.95) !important;
  border-radius: 6px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45) !important;
}

input::placeholder,
textarea::placeholder {
  color: rgba(0,0,0,.48) !important;
}

input:focus,
select:focus,
textarea:focus {
  background: #fff !important;
  border-color: #ffea00 !important;
  box-shadow: 0 0 0 3px rgba(255,234,0,.18), inset 0 1px rgba(255,255,255,.6) !important;
}

label {
  color: #bfe7fb !important;
  font-weight: 800 !important;
}

/* Auth card uses animated-login-panel feel */
.auth-box {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.auth-box::before,
.auth-box::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  filter: blur(16px);
  opacity: .35;
  animation: hb-auth-orb 7s ease-in-out infinite;
}

.auth-box::before {
  right: -46px;
  top: -48px;
  background: var(--hb-blue);
}

.auth-box::after {
  left: -52px;
  bottom: -62px;
  background: var(--hb-yellow);
  animation-delay: -3s;
}

@keyframes hb-auth-orb {
  50% { transform: translate(18px, 12px) scale(1.12); }
}

/* Project list cards */
.project {
  position: relative;
  overflow: hidden;
  border-radius: 10px !important;
  border-width: 1px !important;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.project::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--hb-blue);
  opacity: .75;
}

.project:hover,
.project.active {
  transform: translateY(-1px);
  border-color: var(--hb-yellow-border) !important;
  background:
    linear-gradient(180deg, rgba(255,234,0,.10), rgba(255,255,255,.025)),
    linear-gradient(180deg, #176fa7, #135f91) !important;
}

.project.active::before {
  background: var(--hb-yellow-border);
}

/* Preview/editor */
.preview-toolbar,
.hb-panel__head {
  background: linear-gradient(180deg, #0d466d, #08263c) !important;
  border-bottom: 1px solid rgba(255,255,255,.12) !important;
}

.preview-toolbar h2 {
  color: #fff !important;
  font-size: 18px !important;
}

.preview-stage {
  background:
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.03) 1px, transparent 1px),
    radial-gradient(circle at 58% 45%, rgba(255,234,0,.10), transparent 28%),
    #0b1420 !important;
  background-size: 34px 34px, 34px 34px, auto, auto !important;
  border-top: 1px solid rgba(255,255,255,.12) !important;
}

.preview-frame-panel {
  background:
    linear-gradient(180deg, rgba(8,38,60,.94), rgba(13,70,109,.92)) !important;
  border: 2px solid rgba(159,224,255,.30) !important;
}

.tabs {
  background: var(--hb-tab-dark);
  border-radius: 10px;
  padding: 6px;
  width: fit-content;
}

.tabs button {
  min-height: 36px !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #fff !important;
  background: transparent !important;
}

.tabs button.active {
  color: #08263c !important;
  background: linear-gradient(#ffea00, #ffb900) !important;
  border: 0 !important;
}

.frames {
  padding: 10px !important;
  border-radius: 12px;
  background: rgba(0,0,0,.14);
  border: 1px solid rgba(255,255,255,.08);
}

.frame {
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.018)),
    #0d466d !important;
  border-color: rgba(159,224,255,.18) !important;
}

.frame.active,
.frame:hover {
  border-color: var(--hb-yellow-border) !important;
  box-shadow: 0 0 0 2px rgba(255,234,0,.15), var(--hb-shadow-panel) !important;
}

.add-frame-tile {
  border-color: var(--hb-yellow-border) !important;
  background:
    radial-gradient(circle at center, rgba(255,234,0,.22), transparent 58%),
    #0d466d !important;
  color: var(--hb-yellow-border) !important;
}

.add-frame-plus {
  color: var(--hb-yellow-border) !important;
}

/* Project title chip */
.project-title-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.hb-mini-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.18);
  color: var(--hb-blue-soft);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.hb-mini-chip.is-public {
  background: rgba(0,171,84,.22);
  border-color: var(--hb-green-border);
  color: #caffbc;
}

/* Animation tab / JSON / sheets */
.animation-group,
.anim-step {
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.01)),
    #0d466d !important;
}

.animation-group.active,
.animation-group:hover,
.anim-step:hover,
.anim-step.active {
  border-color: var(--hb-yellow-border) !important;
}

.animation-group em {
  color: var(--hb-yellow-border) !important;
}

#jsonEditor,
.sheetWrap {
  background: rgba(0,0,0,.26) !important;
  border-color: rgba(159,224,255,.20) !important;
}

/* Modals */
.nf-header,
.af-header,
.pe-header,
.pe-toolbar,
.pe-footer {
  background: linear-gradient(180deg, #0d466d, #08263c) !important;
}

.pe-body {
  background:
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.03) 1px, transparent 1px),
    #0b1420 !important;
  background-size: 32px 32px, 32px 32px, auto !important;
}

/* Showcase page uses glow-card / flexible-grid ideas */
.page-body {
  background:
    radial-gradient(circle at 10% 0%, rgba(255,234,0,.24), transparent 26%),
    radial-gradient(circle at 86% 10%, rgba(37,184,238,.24), transparent 32%),
    linear-gradient(var(--hb-bg-top), var(--hb-bg-mid) 45%, var(--hb-bg-bottom)) !important;
}

.habba-showcase-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.showcase-hero-orb {
  position: absolute;
  z-index: -1;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  filter: blur(30px);
  opacity: .42;
  animation: hb-hero-orb 8s ease-in-out infinite alternate;
}

.showcase-hero-orb.orb-one {
  background: var(--hb-blue);
  right: 10%;
  top: -95px;
}

.showcase-hero-orb.orb-two {
  background: var(--hb-yellow);
  left: -70px;
  bottom: -115px;
  animation-delay: -3s;
}

@keyframes hb-hero-orb {
  to { transform: translate(40px, 22px) scale(1.10); }
}

.showcase-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)) !important;
}

.showcase-card {
  border-radius: 10px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.018)),
    linear-gradient(180deg, #176fa7, #0d466d) !important;
  border: 2px solid rgba(159,224,255,.22) !important;
}

.showcase-card:hover {
  border-color: var(--hb-yellow-border) !important;
  box-shadow:
    0 22px 58px rgba(0,0,0,.34),
    0 0 0 3px rgba(255,234,0,.12),
    inset 0 1px rgba(255,255,255,.12) !important;
}

.showcase-thumb {
  border: 2px solid rgba(255,255,255,.11) !important;
  background:
    linear-gradient(45deg, rgba(0,0,0,.18) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0,0,0,.18) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(0,0,0,.18) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(0,0,0,.18) 75%),
    radial-gradient(circle at center, rgba(255,234,0,.18), transparent 58%),
    #08263c !important;
  background-size: 18px 18px, 18px 18px, 18px 18px, 18px 18px, auto, auto !important;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0, center, center !important;
}

.creator-pill {
  background: rgba(0,0,0,.22) !important;
  border-color: rgba(255,255,255,.16) !important;
  color: var(--hb-blue-soft) !important;
}

/* Admin cards */
.stat-card {
  background: linear-gradient(#176fa7, #135f91) !important;
  padding-left: 58px !important;
  position: relative;
}

.stat-card::before {
  content: "★";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(0,0,0,.18);
  color: var(--hb-yellow-border);
  border: 1px solid rgba(255,255,255,.08);
}

.admin-table table {
  color: #fff;
}

.admin-table th {
  background: rgba(0,0,0,.20);
  color: var(--hb-blue-soft);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .06em;
}

/* Toast based on hb-toast */
#toast {
  background: rgba(15,125,188,.96) !important;
  border: 2px solid #2a9cde !important;
  border-left: 6px solid var(--hb-yellow-border) !important;
  color: #fff !important;
  box-shadow: 0 3px 12px rgba(0,0,0,.25), 0 16px 38px rgba(0,0,0,.28) !important;
}

/* Scrollbars */
.sidebar::-webkit-scrollbar,
.frames::-webkit-scrollbar,
.preview-frame-panel::-webkit-scrollbar,
.animation-groups::-webkit-scrollbar,
.animation-strip::-webkit-scrollbar,
.sheetWrap::-webkit-scrollbar,
textarea::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.sidebar::-webkit-scrollbar-track,
.frames::-webkit-scrollbar-track,
.preview-frame-panel::-webkit-scrollbar-track,
.animation-groups::-webkit-scrollbar-track,
.animation-strip::-webkit-scrollbar-track,
.sheetWrap::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track {
  background: rgba(0,0,0,.22);
  border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb,
.frames::-webkit-scrollbar-thumb,
.preview-frame-panel::-webkit-scrollbar-thumb,
.animation-groups::-webkit-scrollbar-thumb,
.animation-strip::-webkit-scrollbar-thumb,
.sheetWrap::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb {
  background: linear-gradient(#25b8ee, #0d466d);
  border: 2px solid rgba(0,0,0,.22);
  border-radius: 999px;
}

@media (max-width: 860px) {
  .hb-studio-brand {
    grid-template-columns: 42px 1fr;
  }

  .tabs {
    width: 100%;
  }

  .tabs button {
    flex: 1 1 auto;
  }

  .preview-frame-panel {
    position: static !important;
    width: auto !important;
    margin: 8px !important;
  }
}


/* =========================================================
   Dark Red / Grey Theme Override
   Keeps the component layout, changes the palette to charcoal,
   graphite, dark red, and soft grey.
   ========================================================= */

:root {
  --hb-bg-top: #08090c;
  --hb-bg-mid: #111318;
  --hb-bg-bottom: #181b22;
  --hb-header: #0b0d11;
  --hb-tab-dark: #090a0d;
  --hb-panel: #1b1f27;
  --hb-panel-dark: #12151b;
  --hb-panel-deep: #20252f;
  --hb-blue: #ef4444;
  --hb-blue-soft: #fca5a5;
  --hb-yellow: #ef4444;
  --hb-yellow-border: #ff6b6b;
  --hb-green: #991b1b;
  --hb-green-hover: #b91c1c;
  --hb-green-border: #ef4444;
  --hb-red: #ef4444;
  --hb-text: #d7dbe3;
  --hb-muted: rgba(215,219,227,.70);

  --bg: #08090c;
  --panel: #1b1f27;
  --panel2: #12151b;
  --line: rgba(255,255,255,.10);
  --text: #f2f4f8;
  --muted: rgba(215,219,227,.70);
  --red: #b91c1c;
  --red2: #ef4444;
  --good: #ef4444;
}

html,
body {
  background:
    radial-gradient(circle at 12% 0%, rgba(239, 68, 68, .16), transparent 28%),
    radial-gradient(circle at 86% 8%, rgba(255, 255, 255, .045), transparent 30%),
    linear-gradient(180deg, #07080a 0%, #101217 42%, #191d25 100%) !important;
  color: #d7dbe3 !important;
}

body::before {
  background:
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.014) 1px, transparent 1px) !important;
}

/* Panels */
.panel,
.preview-panel,
.project,
.frame,
.editor-card,
.animation-group,
.anim-step,
.page-header,
.page-status,
.showcase-card,
.admin-table,
.stat-card,
.nf-window,
.af-window,
.pe-window,
.hb-modal,
.panel-lite,
.auth-box,
.preview-frame-panel {
  border-color: rgba(255,255,255,.10) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.014)),
    linear-gradient(180deg, #20242d, #12151b) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 14px 34px rgba(0,0,0,.38) !important;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(18,21,27,.98), rgba(11,13,17,.96)),
    #0b0d11 !important;
  border-color: rgba(255,255,255,.11) !important;
}

/* Brand */
.hb-studio-brand {
  background: linear-gradient(180deg, #20242d, #12151b) !important;
  border-color: rgba(239,68,68,.42) !important;
  box-shadow:
    inset 0 1px rgba(255,255,255,.08),
    0 3px 0 rgba(0,0,0,.38),
    0 0 28px rgba(239,68,68,.10) !important;
}

.hb-studio-brand__mark {
  background: #0b0d11 !important;
  border-color: rgba(239,68,68,.55) !important;
  color: #ff6b6b !important;
}

.hb-studio-brand span,
label,
.auth-user span,
.project span,
#projectMeta,
.muted {
  color: rgba(215,219,227,.70) !important;
}

/* Buttons */
button,
.button,
.showcase-btn,
.duplicate-btn {
  background: linear-gradient(180deg, #ef4444, #991b1b) !important;
  border-color: #ff6b6b !important;
  color: #fff !important;
  box-shadow: 0 3px 0 1px rgba(0,0,0,.34) !important;
  text-shadow: 0 1px 0 rgba(0,0,0,.28) !important;
}

button:hover,
.button:hover,
.duplicate-btn:hover {
  background: linear-gradient(180deg, #ff5b5b, #b91c1c) !important;
  border-color: #ff8a8a !important;
}

.secondary,
.ghost,
.preview-controls .ghost,
.auth-tabs button,
.quick-details summary {
  background: rgba(255,255,255,.055) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  color: #d7dbe3 !important;
  box-shadow: 0 2px 0 rgba(0,0,0,.22) !important;
}

.secondary:hover,
.ghost:hover,
.auth-tabs button.active {
  background: rgba(239,68,68,.16) !important;
  border-color: rgba(239,68,68,.45) !important;
  color: #fff !important;
}

#togglePublic,
#exportNitro,
#exportZip,
.duplicate-btn {
  background: linear-gradient(180deg, #2b303b, #191d25) !important;
  border-color: rgba(239,68,68,.65) !important;
  color: #f2f4f8 !important;
}

#togglePublic:hover,
#exportNitro:hover,
#exportZip:hover,
.duplicate-btn:hover {
  background: linear-gradient(180deg, #ef4444, #991b1b) !important;
  border-color: #ff6b6b !important;
}

/* Inputs */
input,
select,
textarea {
  background: #0c0e12 !important;
  color: #f2f4f8 !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04) !important;
}

input::placeholder,
textarea::placeholder {
  color: rgba(215,219,227,.42) !important;
}

input:focus,
select:focus,
textarea:focus {
  background: #11141a !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,.17), inset 0 1px rgba(255,255,255,.05) !important;
}

/* Auth glow */
.auth-box::before {
  background: #ef4444 !important;
}

.auth-box::after {
  background: #6b7280 !important;
}

/* Project and frame states */
.project::before {
  background: #ef4444 !important;
}

.project:hover,
.project.active {
  border-color: rgba(239,68,68,.70) !important;
  background:
    linear-gradient(180deg, rgba(239,68,68,.12), rgba(255,255,255,.02)),
    linear-gradient(180deg, #242933, #151922) !important;
}

.project.active::before {
  background: #ff6b6b !important;
}

.frame {
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012)),
    #151922 !important;
  border-color: rgba(255,255,255,.10) !important;
}

.frame.active,
.frame:hover {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239,68,68,.16), inset 0 1px rgba(255,255,255,.06), 0 14px 34px rgba(0,0,0,.34) !important;
}

.add-frame-tile {
  border-color: #ef4444 !important;
  background:
    radial-gradient(circle at center, rgba(239,68,68,.20), transparent 58%),
    #151922 !important;
  color: #ff8a8a !important;
}

.add-frame-plus {
  color: #ff6b6b !important;
}

/* Preview */
.preview-toolbar,
.nf-header,
.af-header,
.pe-header,
.pe-toolbar,
.pe-footer {
  background: linear-gradient(180deg, #1f242d, #0c0e12) !important;
  border-color: rgba(255,255,255,.10) !important;
}

.preview-stage,
.pe-body {
  background:
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.02) 1px, transparent 1px),
    radial-gradient(circle at 58% 45%, rgba(239,68,68,.10), transparent 28%),
    #090b0f !important;
  background-size: 34px 34px, 34px 34px, auto, auto !important;
}

.preview-frame-panel {
  background:
    linear-gradient(180deg, rgba(25,29,37,.94), rgba(10,12,16,.94)) !important;
  border-color: rgba(239,68,68,.36) !important;
}

/* Tabs */
.tabs {
  background: #090a0d !important;
  border: 1px solid rgba(255,255,255,.08);
}

.tabs button {
  background: transparent !important;
  color: #d7dbe3 !important;
}

.tabs button.active {
  background: linear-gradient(180deg, #ef4444, #991b1b) !important;
  color: #fff !important;
}

/* Chips */
.hb-mini-chip {
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.12) !important;
  color: #d7dbe3 !important;
}

.hb-mini-chip.is-public {
  background: rgba(239,68,68,.16) !important;
  border-color: rgba(239,68,68,.55) !important;
  color: #ffb4b4 !important;
}

/* Showcase / admin */
.page-body {
  background:
    radial-gradient(circle at 10% 0%, rgba(239,68,68,.18), transparent 26%),
    radial-gradient(circle at 86% 10%, rgba(255,255,255,.05), transparent 32%),
    linear-gradient(180deg, #07080a, #101217 45%, #191d25) !important;
}

.showcase-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.014)),
    linear-gradient(180deg, #222732, #12151b) !important;
  border-color: rgba(255,255,255,.10) !important;
}

.showcase-card:hover {
  border-color: rgba(239,68,68,.72) !important;
  box-shadow:
    0 22px 58px rgba(0,0,0,.44),
    0 0 0 3px rgba(239,68,68,.12),
    inset 0 1px rgba(255,255,255,.08) !important;
}

.showcase-thumb {
  background:
    linear-gradient(45deg, rgba(255,255,255,.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.035) 75%),
    radial-gradient(circle at center, rgba(239,68,68,.15), transparent 58%),
    #0c0e12 !important;
  background-size: 18px 18px, 18px 18px, 18px 18px, 18px 18px, auto, auto !important;
}

.showcase-hero-orb.orb-one {
  background: #ef4444 !important;
}

.showcase-hero-orb.orb-two {
  background: #6b7280 !important;
}

.creator-pill {
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.12) !important;
  color: #ffb4b4 !important;
}

.stat-card {
  background: linear-gradient(180deg, #242933, #151922) !important;
}

.stat-card::before {
  color: #ff6b6b !important;
}

.admin-table th {
  background: rgba(239,68,68,.10) !important;
  color: #ffb4b4 !important;
}

/* Pixel editor */
#peCanvas {
  border-color: rgba(239,68,68,.55) !important;
}

.pe-tool.active {
  background: linear-gradient(180deg, #ef4444, #991b1b) !important;
  border-color: #ff6b6b !important;
}

/* Toast */
#toast {
  background: rgba(20,23,30,.96) !important;
  border: 1px solid rgba(239,68,68,.60) !important;
  border-left: 6px solid #ef4444 !important;
  color: #f2f4f8 !important;
}

/* Scrollbars */
.sidebar::-webkit-scrollbar-thumb,
.frames::-webkit-scrollbar-thumb,
.preview-frame-panel::-webkit-scrollbar-thumb,
.animation-groups::-webkit-scrollbar-thumb,
.animation-strip::-webkit-scrollbar-thumb,
.sheetWrap::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb {
  background: linear-gradient(#ef4444, #3b3f4a) !important;
}


/* Preview interaction affordance */
.preview-stage {
  cursor: crosshair;
  user-select: none;
}

.preview-frame-panel {
  cursor: default;
}


/* Fixed-origin preview note:
   The renderer now uses one shared bound per furniture size so states/rotations
   do not jump around when toggled in the live preview. */


/* =========================================================
   Strong Nitro type identifiers + Guided Pet Creator
   ========================================================= */

.nitro-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .045em;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: #d7dbe3;
  white-space: nowrap;
}

.nitro-type-badge span {
  line-height: 1;
}

.nitro-type-furniture {
  color: #fca5a5 !important;
  border-color: rgba(239,68,68,.50) !important;
  background: rgba(239,68,68,.14) !important;
}

.nitro-type-pet {
  color: #fcd34d !important;
  border-color: rgba(252,211,77,.55) !important;
  background: rgba(252,211,77,.13) !important;
}

.nitro-type-figure {
  color: #93c5fd !important;
  border-color: rgba(147,197,253,.45) !important;
  background: rgba(147,197,253,.13) !important;
}

.nitro-type-effect {
  color: #c084fc !important;
  border-color: rgba(192,132,252,.45) !important;
  background: rgba(192,132,252,.13) !important;
}

.nitro-type-generic {
  color: #d1d5db !important;
  border-color: rgba(209,213,219,.35) !important;
  background: rgba(209,213,219,.10) !important;
}

.project-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.project-public-dot {
  display: inline-flex;
  min-height: 20px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.40);
  color: #ffb4b4;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.showcase-type-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.showcase-type-line .showcase-date {
  min-width: 0;
}

.guided-pet-btn {
  width: 100%;
  margin-top: 8px;
  background: linear-gradient(180deg, #3a2f18, #1d1710) !important;
  border-color: rgba(252,211,77,.62) !important;
  color: #fcd34d !important;
}

.guided-pet-btn:hover {
  background: linear-gradient(180deg, #5a421a, #2b2114) !important;
  border-color: #fcd34d !important;
}

/* Guided Pet Creator Modal */
.gp-modal.hidden {
  display: none !important;
}

.gp-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,.76);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.gp-window {
  width: min(980px, 96vw);
  max-height: 94vh;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.014)),
    linear-gradient(180deg, #20242d, #12151b);
  box-shadow: 0 30px 100px rgba(0,0,0,.62);
  display: flex;
  flex-direction: column;
}

.gp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, #1f242d, #0c0e12);
}

.gp-title {
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.gp-subtitle {
  color: rgba(215,219,227,.70);
  margin-top: 3px;
  font-size: 12px;
}

.gp-close {
  width: 36px;
  height: 36px;
  padding: 0 !important;
}

.gp-body {
  padding: 14px;
  overflow: auto;
}

.gp-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.gp-step {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: rgba(215,219,227,.70);
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.10);
  font-size: 12px;
  font-weight: 900;
}

.gp-step.is-active {
  color: #fff;
  background: linear-gradient(180deg, #ef4444, #991b1b);
  border-color: #ff6b6b;
}

.gp-page {
  display: none;
}

.gp-page.is-active {
  display: block;
}

.gp-page h3 {
  margin: 0 0 8px;
  color: #fff;
}

.gp-type-card,
.gp-review-card,
.gp-slot-section {
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  border-radius: 14px;
  padding: 12px;
}

.gp-type-card p,
.gp-review-card p {
  color: rgba(215,219,227,.72);
  margin: 8px 0 0;
}

.gp-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.gp-check-grid label {
  display: grid;
  gap: 2px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  text-transform: none !important;
  letter-spacing: 0 !important;
  cursor: pointer;
}

.gp-check-grid input {
  width: auto !important;
  margin-right: 8px;
  accent-color: #ef4444;
}

.gp-check-grid small {
  color: rgba(215,219,227,.55);
  margin-left: 23px;
}

.gp-slot-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  color: #fff;
  font-weight: 900;
}

.gp-slot-summary span {
  color: rgba(215,219,227,.62);
  font-weight: 700;
}

.gp-slots {
  display: grid;
  gap: 12px;
}

.gp-slot-section h4 {
  margin: 0 0 10px;
  color: #fcd34d;
}

.gp-slot-section h4 small {
  color: rgba(215,219,227,.58);
}

.gp-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 8px;
}

.gp-slot {
  display: grid;
  gap: 6px;
  padding: 9px;
  border-radius: 10px;
  background: rgba(0,0,0,.18);
  border: 1px dashed rgba(255,255,255,.13);
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.gp-slot span {
  color: rgba(215,219,227,.78);
  font-size: 11px;
  font-weight: 900;
}

.gp-slot input[type="file"] {
  width: 100%;
  font-size: 11px !important;
}

.gp-review {
  display: grid;
  gap: 10px;
}

.gp-review-card strong {
  display: block;
  margin-top: 10px;
  font-size: 18px;
  color: #fff;
}

.gp-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.10);
}

@media (max-width: 760px) {
  .gp-steps {
    grid-template-columns: 1fr 1fr;
  }

  .gp-footer {
    display: grid;
  }
}


/* =========================================================
   User rank effects + Achievement leaderboard
   ========================================================= */

.username-admin-sparkle {
  position: relative;
  display: inline-block;
  color: #ff5b5b !important;
  font-weight: 900;
  text-shadow:
    0 0 4px rgba(255, 91, 91, .8),
    0 0 10px rgba(239, 68, 68, .55),
    0 0 18px rgba(239, 68, 68, .35);
  animation: admin-red-sparkle 1.8s ease-in-out infinite;
}

.username-admin-sparkle::after {
  content: "✦";
  position: absolute;
  right: -12px;
  top: -8px;
  color: #ffd1d1;
  font-size: 10px;
  animation: admin-sparkle-star 1.2s ease-in-out infinite;
}

@keyframes admin-red-sparkle {
  0%, 100% {
    filter: brightness(1);
    text-shadow:
      0 0 4px rgba(255, 91, 91, .8),
      0 0 10px rgba(239, 68, 68, .55),
      0 0 18px rgba(239, 68, 68, .35);
  }
  50% {
    filter: brightness(1.32);
    text-shadow:
      0 0 8px rgba(255, 130, 130, .95),
      0 0 16px rgba(239, 68, 68, .78),
      0 0 28px rgba(239, 68, 68, .50);
  }
}

@keyframes admin-sparkle-star {
  0%, 100% { opacity: .35; transform: scale(.75) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.25) rotate(16deg); }
}

.username-normal-dull {
  color: #8f96a3 !important;
  font-weight: 700;
  text-shadow: none !important;
}

.creator-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  color: #8f96a3;
  font-size: 12px;
}

.rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  white-space: nowrap;
}

.rank-bronze { color: #d08b57; border-color: rgba(208,139,87,.45); background: rgba(208,139,87,.13); }
.rank-silver { color: #d1d5db; border-color: rgba(209,213,219,.45); background: rgba(209,213,219,.12); }
.rank-gold { color: #facc15; border-color: rgba(250,204,21,.48); background: rgba(250,204,21,.13); }
.rank-platinum { color: #a5f3fc; border-color: rgba(165,243,252,.45); background: rgba(165,243,252,.12); }
.rank-diamond { color: #93c5fd; border-color: rgba(147,197,253,.52); background: rgba(147,197,253,.14); }
.rank-pearlescent {
  color: #fff;
  border-color: rgba(255,255,255,.55);
  background:
    linear-gradient(90deg, rgba(255,255,255,.14), rgba(192,132,252,.14), rgba(125,211,252,.14), rgba(255,255,255,.14));
  box-shadow: 0 0 18px rgba(192,132,252,.18);
}

.leaderboard-hero {
  background:
    radial-gradient(circle at 12% 20%, rgba(239,68,68,.16), transparent 30%),
    radial-gradient(circle at 84% 14%, rgba(255,255,255,.07), transparent 32%),
    linear-gradient(180deg, #20242d, #12151b) !important;
}

.leaderboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
}

.leaderboard-panel,
.achievements-panel {
  padding: 14px;
}

.leaderboard-panel h2,
.achievements-panel h2 {
  margin: 0 0 12px;
}

.leaderboard-rows {
  display: grid;
  gap: 10px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012)),
    #141820;
  box-shadow: inset 0 1px rgba(255,255,255,.05);
}

.leaderboard-place {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(239,68,68,.14);
  border: 1px solid rgba(239,68,68,.38);
  color: #ffb4b4;
  font-weight: 900;
}

.leaderboard-user {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.leaderboard-user strong {
  font-size: 17px;
  width: fit-content;
}

.leaderboard-badges {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  color: #8f96a3;
  font-size: 12px;
}

.leaderboard-user small {
  color: #8f96a3;
}

.leaderboard-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(58px, auto));
  gap: 6px;
}

.leaderboard-stats span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.08);
  color: #d7dbe3;
  font-weight: 800;
  font-size: 12px;
}

.mini-progress {
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.08);
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #991b1b, #ef4444, #ff8a8a);
}

.rank-track {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.rank-track-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.045);
}

.rank-track-item strong {
  font-size: 12px;
}

.rank-track-item span {
  color: #8f96a3;
  font-size: 12px;
  font-weight: 800;
}

.achievement-list {
  display: grid;
  gap: 8px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.achievement-card {
  display: grid;
  grid-template-columns: 38px minmax(0,1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}

.achievement-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(239,68,68,.13);
  border: 1px solid rgba(239,68,68,.32);
}

.achievement-card strong {
  display: block;
  color: #f2f4f8;
  font-size: 13px;
}

.achievement-card p {
  margin: 3px 0;
  color: #8f96a3;
  font-size: 12px;
}

.achievement-card span {
  color: #ffb4b4;
  font-weight: 900;
  font-size: 12px;
}

@media (max-width: 980px) {
  .leaderboard-layout {
    grid-template-columns: 1fr;
  }

  .leaderboard-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .leaderboard-stats {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, 1fr);
  }
}


/* =========================================================
   Rank-based showcase username effects
   Admin override always uses username-admin-sparkle from JS.
   ========================================================= */

.username-rank {
  position: relative;
  display: inline-block;
  font-weight: 900;
  letter-spacing: .01em;
}

/* Bronze: warm low glow */
.username-rank-bronze {
  color: #c98752 !important;
  text-shadow:
    0 1px 0 rgba(0,0,0,.45),
    0 0 6px rgba(201,135,82,.22);
}

/* Silver: clean metallic shimmer */
.username-rank-silver {
  color: #cfd4dc !important;
  text-shadow:
    0 1px 0 rgba(0,0,0,.45),
    0 0 8px rgba(207,212,220,.24);
}

.username-rank-silver::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,.75) 48%, transparent 58%);
  transform: translateX(-140%);
  animation: rank-text-shine 3.8s ease-in-out infinite;
  mix-blend-mode: screen;
  pointer-events: none;
}

/* Gold: animated gold shine */
.username-rank-gold {
  color: #ffd25a !important;
  text-shadow:
    0 1px 0 rgba(0,0,0,.48),
    0 0 7px rgba(250,204,21,.35),
    0 0 14px rgba(250,204,21,.18);
}

.username-rank-gold::after {
  content: "✦";
  position: absolute;
  right: -12px;
  top: -9px;
  font-size: 9px;
  color: #fff3b0;
  animation: rank-spark 1.9s ease-in-out infinite;
}

/* Platinum: icy glow */
.username-rank-platinum {
  color: #a5f3fc !important;
  text-shadow:
    0 1px 0 rgba(0,0,0,.45),
    0 0 8px rgba(165,243,252,.34),
    0 0 16px rgba(147,197,253,.18);
}

.username-rank-platinum::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(165,243,252,.9), transparent);
  animation: rank-underline-pulse 2.6s ease-in-out infinite;
}

/* Diamond: blue crystalline pulse */
.username-rank-diamond {
  color: #93c5fd !important;
  text-shadow:
    0 0 6px rgba(147,197,253,.55),
    0 0 16px rgba(59,130,246,.34),
    0 0 26px rgba(59,130,246,.18);
  animation: rank-diamond-pulse 2.2s ease-in-out infinite;
}

.username-rank-diamond::after {
  content: "◆";
  position: absolute;
  right: -14px;
  top: -7px;
  font-size: 9px;
  color: #bfdbfe;
  animation: rank-spark 1.4s ease-in-out infinite;
}

/* Pearlescent: rainbow pearl text */
.username-rank-pearlescent {
  color: transparent !important;
  background: linear-gradient(90deg, #fff, #f0abfc, #93c5fd, #a7f3d0, #fff);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow:
    0 0 7px rgba(255,255,255,.32),
    0 0 18px rgba(192,132,252,.26);
  animation: rank-pearl-flow 3.2s linear infinite;
}

.username-rank-pearlescent::before,
.username-rank-pearlescent::after {
  content: "✧";
  position: absolute;
  top: -10px;
  font-size: 10px;
  color: #fff;
  text-shadow: 0 0 10px rgba(255,255,255,.9);
  animation: rank-spark 1.5s ease-in-out infinite;
}

.username-rank-pearlescent::before {
  left: -13px;
  animation-delay: -.35s;
}

.username-rank-pearlescent::after {
  right: -13px;
}

/* Fallback for unknown future ranks */
.username-rank:not([class*="username-rank-bronze"]):not([class*="username-rank-silver"]):not([class*="username-rank-gold"]):not([class*="username-rank-platinum"]):not([class*="username-rank-diamond"]):not([class*="username-rank-pearlescent"]) {
  color: #8f96a3 !important;
}

@keyframes rank-text-shine {
  0%, 68% { transform: translateX(-140%); opacity: 0; }
  74% { opacity: .62; }
  86% { transform: translateX(140%); opacity: 0; }
  100% { transform: translateX(140%); opacity: 0; }
}

@keyframes rank-spark {
  0%, 100% { opacity: .30; transform: scale(.72) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.22) rotate(18deg); }
}

@keyframes rank-underline-pulse {
  0%, 100% { opacity: .32; transform: scaleX(.55); }
  50% { opacity: 1; transform: scaleX(1); }
}

@keyframes rank-diamond-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.28); }
}

@keyframes rank-pearl-flow {
  from { background-position: 0% 50%; }
  to { background-position: 240% 50%; }
}


/* =========================================================
   Achievements page + multi-leaderboard refinements
   ========================================================= */

/* Smaller showcase rank pills */
.showcase-card .rank-pill,
.creator-line .rank-pill {
  min-height: 17px !important;
  padding: 2px 5px !important;
  font-size: 8px !important;
  gap: 3px !important;
  border-radius: 999px !important;
  letter-spacing: .025em !important;
  transform: translateY(-1px);
}

/* Make rank username text easier to read */
.creator-line .username-rank,
.showcase-card .username-rank,
.leaderboard-user .username-rank,
.admin-table .username-rank {
  font-size: 13px;
  font-weight: 950;
  letter-spacing: .01em;
  -webkit-text-stroke: .18px rgba(0,0,0,.35);
  text-shadow:
    0 1px 0 rgba(0,0,0,.72),
    0 0 5px currentColor !important;
}

.creator-line .username-admin-sparkle,
.showcase-card .username-admin-sparkle {
  font-size: 13px;
  font-weight: 950;
  -webkit-text-stroke: .18px rgba(0,0,0,.35);
  text-shadow:
    0 1px 0 rgba(0,0,0,.75),
    0 0 7px rgba(255, 91, 91, .78),
    0 0 15px rgba(239, 68, 68, .44) !important;
}

/* Pearlescent readability */
.creator-line .username-rank-pearlescent,
.showcase-card .username-rank-pearlescent {
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.72)) drop-shadow(0 0 5px rgba(255,255,255,.34));
}

/* Multi leaderboard tabs */
.leaderboard-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.leaderboard-tab {
  width: auto !important;
  min-height: 34px !important;
  padding: 7px 11px !important;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px !important;
  background: rgba(255,255,255,.055) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  color: #d7dbe3 !important;
  box-shadow: 0 2px 0 rgba(0,0,0,.22) !important;
  text-transform: none !important;
}

.leaderboard-tab.active,
.leaderboard-tab:hover {
  background: linear-gradient(180deg, #ef4444, #991b1b) !important;
  border-color: #ff6b6b !important;
  color: #fff !important;
}

.leaderboard-layout-wide {
  grid-template-columns: minmax(0, 1fr) 310px !important;
}

.leaderboard-row {
  grid-template-columns: 58px minmax(0, 1fr) 110px auto !important;
}

.leaderboard-main-score {
  display: grid;
  place-items: center;
  min-width: 88px;
  padding: 8px;
  border-radius: 13px;
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.36);
}

.leaderboard-main-score strong {
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.leaderboard-main-score span {
  color: #ffb4b4;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

/* Achievements page */
.achievements-hero {
  background:
    radial-gradient(circle at 14% 16%, rgba(239,68,68,.18), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(255,255,255,.065), transparent 34%),
    linear-gradient(180deg, #20242d, #12151b) !important;
}

.achievement-summary {
  padding: 14px;
  margin-bottom: 14px;
}

.achievement-summary-main {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
}

.achievement-summary-main > div {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}

.achievement-summary-main h2 {
  margin: 6px 0 0;
}

.achievement-summary-progress {
  margin-top: 12px;
  display: grid;
  gap: 7px;
}

.achievement-summary-progress > span {
  color: #8f96a3;
  font-weight: 800;
}

.achievement-categories {
  display: grid;
  gap: 14px;
}

.achievement-category {
  padding: 14px;
}

.achievement-category-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.achievement-category-head h2 {
  margin: 0;
}

.achievement-category-head p {
  margin: 3px 0 0;
  color: #8f96a3;
}

.category-count {
  display: grid;
  place-items: center;
  min-width: 54px;
  height: 38px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.40);
  color: #ffb4b4;
  font-weight: 900;
}

.achievement-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.achievement-progress-card {
  display: grid;
  grid-template-columns: 42px minmax(0,1fr);
  gap: 10px;
  padding: 11px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.achievement-progress-card:hover {
  transform: translateY(-2px);
  border-color: rgba(239,68,68,.42);
}

.achievement-progress-card.is-earned {
  border-color: rgba(239,68,68,.55);
  background:
    radial-gradient(circle at top right, rgba(239,68,68,.18), transparent 36%),
    rgba(255,255,255,.045);
}

.achievement-progress-card.is-earned .achievement-icon {
  background: rgba(239,68,68,.20);
  border-color: rgba(239,68,68,.55);
  box-shadow: 0 0 18px rgba(239,68,68,.16);
}

.achievement-info {
  min-width: 0;
}

.achievement-info strong {
  display: block;
  color: #f2f4f8;
  font-size: 13px;
}

.achievement-info p {
  margin: 4px 0;
  color: #8f96a3;
  font-size: 12px;
}

.achievement-info > span {
  display: inline-flex;
  color: #ffb4b4;
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 7px;
}

.achievement-progress {
  display: grid;
  gap: 5px;
}

.achievement-progress-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #8f96a3;
  font-size: 11px;
  font-weight: 800;
}

.achievement-progress-top strong {
  color: #d7dbe3;
  font-size: 11px;
}

.animated-progress {
  position: relative;
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.09);
}

.animated-progress span {
  position: relative;
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7f1d1d, #ef4444, #ff8a8a);
  min-width: 0;
  overflow: hidden;
}

.animated-progress span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,.34) 48%, transparent 62%);
  transform: translateX(-120%);
  animation: achievement-bar-shine 2.4s ease-in-out infinite;
}

.animated-progress.is-earned span,
.animated-progress.is-rank span {
  background: linear-gradient(90deg, #ef4444, #ff6b6b, #ffb4b4);
}

@keyframes achievement-bar-shine {
  0%, 35% { transform: translateX(-120%); }
  72% { transform: translateX(140%); }
  100% { transform: translateX(140%); }
}

@media (max-width: 980px) {
  .leaderboard-layout-wide {
    grid-template-columns: 1fr !important;
  }

  .leaderboard-row {
    grid-template-columns: 44px minmax(0, 1fr) !important;
  }

  .leaderboard-main-score,
  .leaderboard-stats {
    grid-column: 1 / -1;
  }

  .achievement-summary-main {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   Showcase filters
   ========================================================= */

.showcase-filter-panel {
  padding: 12px !important;
  margin-bottom: 14px;
  display: grid;
  gap: 10px;
  background:
    radial-gradient(circle at top left, rgba(239,68,68,.10), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.014)),
    linear-gradient(180deg, #20242d, #12151b) !important;
}

.showcase-filter-main {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr minmax(130px, .7fr) minmax(130px, .7fr) minmax(130px, .7fr);
  gap: 10px;
  align-items: end;
}

.showcase-filter-main label {
  display: grid;
  gap: 5px;
  margin: 0 !important;
}

.showcase-filter-main label span {
  color: #8f96a3;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.showcase-filter-main input,
.showcase-filter-main select {
  min-height: 36px;
}

.showcase-filter-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.showcase-filter-count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.35);
  color: #ffb4b4;
  font-weight: 900;
  font-size: 12px;
}

.showcase-empty {
  grid-column: 1 / -1;
  padding: 22px !important;
  text-align: center;
}

.showcase-empty h2 {
  margin: 0 0 6px;
}

.showcase-empty p {
  margin: 0;
  color: #8f96a3;
}

@media (max-width: 1100px) {
  .showcase-filter-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .showcase-filter-main {
    grid-template-columns: 1fr;
  }

  .showcase-filter-actions {
    display: grid;
  }

  #clearShowcaseFilters {
    width: 100%;
  }
}


/* =========================================================
   User profile sticker board + achievement badges
   ========================================================= */

.profile-page-header {
  background:
    radial-gradient(circle at 14% 16%, rgba(239,68,68,.20), transparent 32%),
    radial-gradient(circle at 86% 18%, rgba(255,255,255,.065), transparent 34%),
    linear-gradient(180deg, #20242d, #12151b) !important;
}

.profile-owner-tools {
  padding: 14px !important;
  margin-bottom: 14px;
}

.profile-owner-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 12px;
}

.profile-owner-head h2 {
  margin: 0 0 4px;
}

.profile-edit-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.profile-edit-grid label {
  display: grid;
  gap: 5px;
  margin: 0 !important;
}

.profile-component-editor {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.component-editor-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 110px 42px 42px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.10);
}

.component-editor-row.dragging {
  opacity: .5;
  border-color: rgba(239,68,68,.55);
}

.component-editor-row label {
  margin: 0 !important;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.component-drag {
  cursor: grab;
  color: #8f96a3;
  font-weight: 900;
}

.profile-sticker-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-sticker-choice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 !important;
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  text-transform: none !important;
  letter-spacing: 0 !important;
  cursor: pointer;
}

.profile-board {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.profile-component-wrap {
  min-width: 0;
}

.component-size-wide {
  grid-column: span 12;
}

.component-size-half {
  grid-column: span 6;
}

.component-size-small {
  grid-column: span 4;
}

.profile-card {
  position: relative;
  overflow: hidden;
  min-height: 100%;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(circle at top right, rgba(239,68,68,.10), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.014)),
    linear-gradient(180deg, #20242d, #12151b);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 18px 55px rgba(0,0,0,.36);
}

.profile-card h3 {
  margin: 0 0 12px;
}

.profile-hero-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.profile-avatar {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.20), transparent 32%),
    linear-gradient(180deg, #ef4444, #6f1010);
  border: 1px solid rgba(255,255,255,.14);
  color: #fff;
  font-size: 40px;
  font-weight: 900;
  box-shadow: 0 0 40px rgba(239,68,68,.22);
}

.profile-overline {
  color: #ffb4b4;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
}

.profile-hero-info h2 {
  margin: 4px 0 8px;
  font-size: clamp(28px, 4vw, 46px);
  width: fit-content;
}

.profile-hero-info p {
  max-width: 820px;
  color: #c6cad3;
  margin: 10px 0 0;
}

.profile-hero-row,
.profile-rank-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.profile-point-pill {
  display: inline-flex;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  color: #d7dbe3;
  font-size: 11px;
  font-weight: 900;
}

.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.profile-stat {
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.10);
}

.profile-stat span {
  font-size: 22px;
}

.profile-stat strong {
  color: #fff;
  font-size: 24px;
  line-height: 1;
}

.profile-stat em {
  color: #8f96a3;
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
}

.profile-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.achievement-badge {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.10);
  min-width: 0;
}

.achievement-badge > span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(239,68,68,.14);
  border: 1px solid rgba(239,68,68,.34);
  font-size: 20px;
}

.achievement-badge strong {
  min-width: 0;
  color: #f2f4f8;
  font-size: 12px;
  line-height: 1.15;
}

.achievement-badge em {
  display: block;
  margin-top: 3px;
  color: #8f96a3;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.badge-rare {
  border-color: rgba(147,197,253,.32);
}

.badge-epic {
  border-color: rgba(192,132,252,.42);
  box-shadow: 0 0 22px rgba(192,132,252,.10);
}

.badge-legendary {
  border-color: rgba(250,204,21,.42);
  box-shadow: 0 0 24px rgba(250,204,21,.12);
}

.badge-mythic {
  border-color: rgba(255,255,255,.55);
  background:
    linear-gradient(90deg, rgba(255,255,255,.05), rgba(192,132,252,.08), rgba(147,197,253,.07)),
    rgba(255,255,255,.04);
  box-shadow: 0 0 30px rgba(255,255,255,.10);
}

.profile-achievement-list {
  display: grid;
  gap: 9px;
}

.profile-achievement-progress {
  padding: 10px;
  border-radius: 13px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}

.profile-achievement-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: #8f96a3;
  font-size: 12px;
}

.profile-achievement-progress strong {
  color: #d7dbe3;
}

.profile-sticker-board {
  position: relative;
  min-height: 220px;
  border-radius: 18px;
  background:
    linear-gradient(45deg, rgba(255,255,255,.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,.035) 25%, transparent 25%),
    rgba(0,0,0,.12);
  background-size: 20px 20px;
  border: 1px dashed rgba(255,255,255,.12);
  padding: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
}

.profile-sticker {
  display: inline-grid;
  place-items: center;
  min-width: 76px;
  min-height: 64px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.11);
  font-size: 26px;
  transform: rotate(var(--r));
  box-shadow: 0 10px 22px rgba(0,0,0,.25);
}

.profile-sticker small {
  display: block;
  margin-top: 4px;
  color: #d7dbe3;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.profile-project-card {
  display: grid;
  gap: 7px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.10);
  text-decoration: none;
  color: #d7dbe3;
}

.profile-project-card div {
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(0,0,0,.18);
  overflow: hidden;
}

.profile-project-card img {
  max-width: 100%;
  max-height: 82px;
  object-fit: contain;
  image-rendering: pixelated;
}

.profile-project-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f2f4f8;
}

.profile-project-card span {
  color: #8f96a3;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-username-link {
  text-decoration: none;
}

.profile-username-link:hover {
  text-decoration: underline;
}

@media (max-width: 920px) {
  .profile-edit-grid,
  .profile-hero-card {
    grid-template-columns: 1fr;
  }

  .profile-board {
    grid-template-columns: 1fr;
  }

  .component-size-wide,
  .component-size-half,
  .component-size-small {
    grid-column: span 1;
  }

  .component-editor-row {
    grid-template-columns: 22px minmax(0,1fr);
  }

  .component-editor-row select,
  .component-editor-row button {
    grid-column: 2;
  }
}


/* =========================================================
   Full public-page scroll fix
   Earlier compact editor CSS forced html/body to 100vh + overflow hidden.
   Public pages need normal document scrolling.
   ========================================================= */

html:has(body.page-body) {
  height: auto !important;
  min-height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

body.page-body {
  height: auto !important;
  min-height: 100vh !important;
  overflow-y: visible !important;
  overflow-x: hidden !important;
  padding-bottom: 80px !important;
}

body.page-body .public-page {
  min-height: 100vh !important;
  padding-bottom: 120px !important;
}

body.page-body .profile-page,
body.page-body .achievement-categories,
body.page-body .profile-board {
  overflow: visible !important;
}

/* Make long public pages easier to browse */
.achievement-category,
.profile-owner-tools,
.profile-card,
.leaderboard-panel,
.achievements-panel {
  scroll-margin-top: 18px;
}

/* Fix checkbox/radio controls inside profile and achievement editors.
   Global input styles made checkboxes stretch, causing row labels to split apart. */
.profile-owner-tools input[type="checkbox"],
.profile-owner-tools input[type="radio"],
.achievement-category input[type="checkbox"],
.achievement-category input[type="radio"],
.gp-check-grid input[type="checkbox"],
.profile-sticker-choice input[type="checkbox"],
.component-editor-row input[type="checkbox"] {
  width: auto !important;
  min-width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  padding: 0 !important;
  margin: 0 !important;
  flex: 0 0 auto !important;
  box-shadow: none !important;
  accent-color: #ef4444;
}

.component-editor-row {
  grid-template-columns: 26px minmax(220px, 1fr) 120px 42px 42px !important;
}

.component-editor-row label {
  justify-content: flex-start !important;
  justify-self: start !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.component-editor-row select {
  width: 100% !important;
  min-width: 0 !important;
}

/* Profile editor is more compact/readable */
.profile-owner-tools h3 {
  margin-top: 14px !important;
}

.profile-component-editor {
  max-height: none !important;
  overflow: visible !important;
}

.profile-sticker-editor {
  max-height: none !important;
  overflow: visible !important;
}

/* Achievements page: add breathing room so the last category is reachable */
.achievement-categories {
  padding-bottom: 80px;
}

.achievement-card-grid {
  align-items: stretch;
}

/* Smaller achievement cards on large pages so more fits on screen */
.achievement-progress-card {
  min-height: 118px;
}

@media (max-width: 920px) {
  .component-editor-row {
    grid-template-columns: 24px minmax(0,1fr) !important;
  }

  .component-editor-row select,
  .component-editor-row button {
    grid-column: 2 !important;
  }
}


/* =========================================================
   Habbo-style compact profile editor
   ========================================================= */

.profile-habbo-tools {
  padding: 0 !important;
  margin-bottom: 12px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.profile-habbo-nav {
  min-height: 54px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: #071923;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 8px 24px rgba(0,0,0,.28);
}

.profile-home-tab {
  flex: 1 1 auto;
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(255,255,255,.045);
  color: #d7dbe3;
  font-weight: 900;
}

.profile-habbo-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.profile-habbo-actions button {
  min-height: 34px !important;
  padding: 6px 12px !important;
  border-radius: 7px !important;
  font-size: 12px !important;
  text-transform: none !important;
  box-shadow: 0 2px 0 rgba(0,0,0,.28) !important;
}

.profile-action-finish {
  background: linear-gradient(#2f7c46, #1f5f34) !important;
  border-color: #77d572 !important;
}

.profile-action-inventory,
.profile-action-share {
  background: linear-gradient(#2d536e, #1d3548) !important;
  border-color: #6e9dbd !important;
}

.profile-inventory-window {
  width: min(560px, calc(100vw - 34px));
  max-height: 520px;
  overflow: hidden;
  margin: 12px auto 0;
  border-radius: 0;
  border: 2px solid #a9cce0;
  background: #d6e5ee;
  box-shadow: 0 18px 44px rgba(0,0,0,.42);
  color: #1b3142;
}

.profile-inventory-window.is-collapsed {
  display: none;
}

.profile-inventory-titlebar {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: linear-gradient(#6fa6c8, #4d88ad);
  color: #fff;
  border-bottom: 1px solid #3e789c;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(0,0,0,.28);
}

.profile-inventory-titlebar button {
  width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: rgba(255,255,255,.14) !important;
  border: 1px solid rgba(255,255,255,.35) !important;
  box-shadow: none !important;
}

.profile-inventory-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  border-bottom: 1px solid #aac4d3;
  background: #c7dbe7;
}

.profile-inventory-tabs button {
  min-height: 40px !important;
  padding: 8px 6px !important;
  border: 0 !important;
  border-right: 1px solid #aac4d3 !important;
  border-radius: 0 !important;
  background: #c9dce8 !important;
  color: #163047 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  font-size: 12px !important;
  text-transform: none !important;
}

.profile-inventory-tabs button.active {
  background: #eef6fb !important;
  color: #071923 !important;
}

.profile-inventory-body {
  max-height: 434px;
  overflow: auto;
  padding: 12px;
  background: #d6e5ee;
  scrollbar-width: thin;
}

.profile-editor-pane {
  display: none;
}

.profile-editor-pane.active {
  display: block;
}

.profile-editor-hint,
.profile-tips-box p {
  color: #526f83 !important;
  font-size: 12px;
  margin: 0 0 10px;
}

.profile-tips-box {
  border: 1px solid #aac4d3;
  background: rgba(255,255,255,.36);
  padding: 12px;
}

.profile-tips-box h3 {
  color: #163047;
  margin: 0 0 8px;
}

.profile-inventory-window .profile-edit-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
}

.profile-inventory-window label span {
  color: #163047 !important;
}

.profile-inventory-window input,
.profile-inventory-window textarea,
.profile-inventory-window select {
  background: #fff !important;
  color: #1b3142 !important;
  border: 1px solid #9db9ca !important;
  border-radius: 3px !important;
  box-shadow: inset 0 1px 0 rgba(0,0,0,.08) !important;
}

/* Compact widget inventory rows */
.profile-inventory-window .profile-component-editor {
  display: grid;
  gap: 7px;
}

.profile-inventory-window .component-editor-row {
  grid-template-columns: 24px 42px minmax(0,1fr) 104px 52px 34px 34px !important;
  gap: 7px !important;
  align-items: center !important;
  min-height: 54px;
  padding: 8px !important;
  border-radius: 0 !important;
  background: #cfe0ea !important;
  border: 1px solid #a8c1d0 !important;
  color: #163047 !important;
  box-shadow: none !important;
}

.profile-inventory-window .component-editor-row.is-hidden-widget {
  opacity: .62;
  filter: grayscale(.45);
}

.widget-mini-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #9db9ca;
  background: rgba(255,255,255,.45);
  font-size: 20px;
}

.widget-row-main {
  min-width: 0;
}

.widget-row-main strong {
  display: block;
  color: #163047;
  font-size: 12px;
  line-height: 1.15;
}

.widget-row-main small {
  display: block;
  color: #526f83;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-inventory-window .component-drag {
  color: #55758a;
  cursor: grab;
  font-size: 18px;
}

.profile-inventory-window .widget-hide-toggle,
.profile-inventory-window .move-up,
.profile-inventory-window .move-down {
  min-height: 32px !important;
  height: 32px !important;
  padding: 0 8px !important;
  border-radius: 3px !important;
  font-size: 11px !important;
  text-transform: none !important;
  color: #fff !important;
  box-shadow: none !important;
}

.profile-inventory-window .widget-hide-toggle {
  background: linear-gradient(#ee7777, #d95050) !important;
  border-color: #c34444 !important;
}

.profile-inventory-window .widget-hide-toggle.is-hidden {
  background: linear-gradient(#61a8d1, #3d83ab) !important;
  border-color: #34749a !important;
}

.profile-inventory-window .move-up,
.profile-inventory-window .move-down {
  background: linear-gradient(#6f7783, #4b5563) !important;
  border-color: #3f4752 !important;
}

.profile-inventory-window .profile-sticker-editor {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}

.profile-inventory-window .profile-sticker-choice {
  min-height: 80px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 8px;
  border-radius: 0;
  background: #cfe0ea;
  border: 1px solid #a8c1d0;
  color: #163047;
  cursor: pointer;
  text-align: center;
  position: relative;
}

.profile-inventory-window .profile-sticker-choice input {
  position: absolute;
  top: 6px;
  left: 6px;
}

.profile-inventory-window .profile-sticker-choice span {
  font-size: 28px;
}

.profile-inventory-window .profile-sticker-choice strong {
  font-size: 10px;
  line-height: 1.1;
}

/* Editable board draggable blocks */
.profile-board.is-editable-board {
  padding-top: 4px;
}

.profile-component-wrap.is-editable-board {
  position: relative;
}

.profile-board-dragbar {
  min-height: 26px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(#414953, #29313a);
  border: 1px solid rgba(255,255,255,.10);
  border-bottom: 0;
  color: #d7dbe3;
  font-size: 11px;
  font-weight: 900;
  cursor: grab;
}

.profile-board-dragbar small {
  color: #8f96a3;
  font-weight: 700;
}

.profile-component-wrap.is-editable-board .profile-card {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.profile-component-wrap.dragging-board-card {
  opacity: .48;
  transform: scale(.985);
}

.profile-component-wrap.drag-over-board-card {
  outline: 2px dashed #ff6b6b;
  outline-offset: 4px;
}

/* Profile page gets a Habbo room-ish board background while editing */
.profile-board.is-editable-board::before {
  content: "Drag blocks around your profile board";
  grid-column: 1 / -1;
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(239,68,68,.10);
  border: 1px dashed rgba(239,68,68,.34);
  color: #ffb4b4;
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 760px) {
  .profile-habbo-nav {
    display: grid;
  }

  .profile-habbo-actions {
    justify-content: stretch;
  }

  .profile-habbo-actions button {
    flex: 1 1 auto;
  }

  .profile-inventory-window .component-editor-row {
    grid-template-columns: 22px 36px minmax(0,1fr) !important;
  }

  .profile-inventory-window .component-editor-row select,
  .profile-inventory-window .component-editor-row button {
    grid-column: 3 !important;
    width: 100% !important;
  }

  .profile-inventory-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* =========================================================
   Toggleable freeform profile editor
   Public view = clean preview. Edit mode = top overlay + drag/resize.
   ========================================================= */

.profile-page {
  position: relative;
}

.profile-habbo-tools {
  position: sticky;
  top: 8px;
  z-index: 100;
  margin-bottom: 12px !important;
  pointer-events: none;
}

.profile-habbo-nav,
.profile-inventory-window {
  pointer-events: auto;
}

.profile-habbo-nav {
  position: relative;
  z-index: 3;
}

.profile-action-edit {
  background: linear-gradient(#6f7783, #4b5563) !important;
  border-color: #87909b !important;
}

.profile-edit-mode-active .profile-action-edit {
  background: linear-gradient(#ef4444, #991b1b) !important;
  border-color: #ff6b6b !important;
}

.profile-snap-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  color: #d7dbe3 !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  margin: 0 !important;
}

.profile-snap-toggle input {
  width: 16px !important;
  min-width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  accent-color: #ef4444;
  box-shadow: none !important;
}

.profile-inventory-window {
  position: absolute;
  right: 0;
  top: 62px;
  margin: 0;
  z-index: 5;
}

.profile-inventory-window.is-collapsed {
  display: none !important;
}

/* Freeform board */
.profile-board {
  position: relative !important;
  display: block !important;
  min-height: 680px;
  border-radius: 18px;
}

.profile-board.is-editable-board {
  padding: 0 !important;
  background:
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.024) 1px, transparent 1px),
    radial-gradient(circle at 8% 5%, rgba(239,68,68,.10), transparent 28%),
    rgba(0,0,0,.10);
  background-size: 8.333% 44px, 8.333% 44px, auto, auto;
  border: 1px dashed rgba(239,68,68,.32);
}

.profile-board.is-editable-board.is-snap-grid {
  box-shadow: inset 0 0 0 1px rgba(239,68,68,.16), 0 0 34px rgba(239,68,68,.08);
}

.profile-board.is-editable-board::before {
  content: "Edit Mode: drag blocks anywhere, resize from the lower-right corner, use Snap to Grid for tidy placement.";
  position: sticky;
  top: 72px;
  z-index: 2;
  display: block;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(15,18,24,.88);
  border: 1px solid rgba(239,68,68,.34);
  color: #ffb4b4;
  font-size: 12px;
  font-weight: 900;
  pointer-events: none;
}

/* Absolute freeform components */
.profile-component-wrap.freeform-component {
  position: absolute !important;
  box-sizing: border-box;
  min-width: 120px;
  transition: box-shadow .15s ease, outline-color .15s ease, opacity .15s ease;
}

.profile-component-wrap.freeform-component .profile-card {
  min-height: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow: auto;
}

.profile-component-wrap.freeform-component:not(.is-editable-board) .profile-card {
  overflow: hidden;
}

.profile-component-wrap.is-editable-board {
  z-index: 1;
}

.profile-component-wrap.is-editable-board:hover {
  z-index: 4;
  outline: 2px solid rgba(255,107,107,.36);
  outline-offset: 3px;
}

.profile-board-dragbar {
  min-height: 28px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(#414953, #29313a);
  border: 1px solid rgba(255,255,255,.12);
  border-bottom: 0;
  color: #d7dbe3;
  font-size: 11px;
  font-weight: 900;
  cursor: grab;
  user-select: none;
}

.profile-board-dragbar small {
  color: #8f96a3;
  font-weight: 800;
}

.profile-component-wrap.is-editable-board .profile-card {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.profile-resize-handle {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 18px;
  height: 18px;
  z-index: 10;
  cursor: nwse-resize;
  border-radius: 5px;
  background:
    linear-gradient(135deg, transparent 0 45%, rgba(255,255,255,.78) 46% 54%, transparent 55%),
    linear-gradient(135deg, transparent 0 62%, rgba(255,255,255,.50) 63% 70%, transparent 71%),
    linear-gradient(#ef4444, #991b1b);
  border: 1px solid #ff8a8a;
  box-shadow: 0 3px 10px rgba(0,0,0,.35);
}

.profile-component-wrap.dragging-board-card,
.profile-component-wrap.resizing-board-card {
  opacity: .82;
  z-index: 20;
  outline: 2px solid #ff6b6b;
  outline-offset: 4px;
}

/* Widget inventory expanded rows with resize fields */
.profile-inventory-window .component-editor-row {
  grid-template-columns: 24px 38px minmax(150px,1fr) 96px 58px 58px 52px 34px 34px !important;
}

.widget-dim-field {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  margin: 0 !important;
  color: #163047 !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: 0 !important;
}

.widget-dim-field input {
  width: 44px !important;
  min-height: 30px !important;
  height: 30px !important;
  padding: 0 5px !important;
  text-align: center;
}

/* Board card scrollbars are tiny so resized widgets still usable */
.profile-component-wrap .profile-card::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.profile-component-wrap .profile-card::-webkit-scrollbar-thumb {
  background: linear-gradient(#ef4444, #3b3f4a);
  border-radius: 999px;
}

/* In public preview mode remove editor feel entirely */
body:not(.profile-edit-mode-active) .profile-board {
  background: transparent !important;
  border: 0 !important;
}

body:not(.profile-edit-mode-active) .profile-board-dragbar,
body:not(.profile-edit-mode-active) .profile-resize-handle {
  display: none !important;
}

@media (max-width: 900px) {
  .profile-component-wrap.freeform-component {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    min-height: auto !important;
    margin-bottom: 12px;
  }

  .profile-board {
    display: grid !important;
    min-height: 0 !important;
  }

  .profile-inventory-window {
    position: static;
    width: 100%;
    margin-top: 10px;
  }

  .profile-inventory-window .component-editor-row {
    grid-template-columns: 24px 38px minmax(0,1fr) !important;
  }

  .profile-inventory-window .component-editor-row select,
  .profile-inventory-window .component-editor-row button,
  .profile-inventory-window .widget-dim-field {
    grid-column: 3 !important;
    width: 100% !important;
  }
}


/* =========================================================
   Rank-unlocked profile cosmetics: backgrounds, frames, animated borders
   ========================================================= */

.profile-inventory-tabs {
  grid-template-columns: repeat(5, minmax(0,1fr)) !important;
}

.profile-cosmetic-editor {
  display: grid;
  gap: 10px;
}

.profile-unlock-note {
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(239,68,68,.10);
  border: 1px solid rgba(239,68,68,.30);
  color: #6f1820;
  font-size: 12px;
  font-weight: 900;
}

.profile-cosmetic-field {
  display: grid !important;
  gap: 5px;
  margin: 0 !important;
}

.profile-cosmetic-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
}

.profile-bg-choice {
  min-height: 82px !important;
  display: grid !important;
  place-items: center !important;
  gap: 3px !important;
  padding: 8px !important;
  border-radius: 0 !important;
  background: #cfe0ea !important;
  color: #163047 !important;
  border: 1px solid #a8c1d0 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  text-transform: none !important;
}

.profile-bg-choice span {
  font-size: 24px;
}

.profile-bg-choice strong {
  font-size: 11px;
  line-height: 1.1;
}

.profile-bg-choice em {
  color: #526f83;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-bg-choice.active {
  outline: 2px solid #ef4444;
  outline-offset: 1px;
}

.profile-bg-choice:disabled {
  opacity: .44;
  filter: grayscale(.8);
  cursor: not-allowed;
}

/* Wider widget rows now include frame + animation selects */
.profile-inventory-window .component-editor-row {
  grid-template-columns: 24px 38px minmax(150px,1fr) 86px 50px 50px 98px 98px 52px 34px 34px !important;
}

.profile-inventory-window .component-editor-row [data-field="frame"],
.profile-inventory-window .component-editor-row [data-field="borderAnim"] {
  min-height: 30px !important;
  height: 30px !important;
  font-size: 10px !important;
  padding: 0 6px !important;
}

/* Profile board backgrounds */
.profile-board {
  border-radius: 18px;
}

.profile-bg-dark-red-grid {
  background:
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.024) 1px, transparent 1px),
    radial-gradient(circle at 10% 8%, rgba(239,68,68,.13), transparent 32%),
    #0b0d11 !important;
  background-size: 8.333% 44px, 8.333% 44px, auto, auto !important;
}

.profile-bg-habbo-orange {
  background:
    radial-gradient(circle at 18% 10%, rgba(255,255,255,.08), transparent 18%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.15) 0 2px, transparent 2px 6px),
    linear-gradient(135deg, #b85000, #7a2e00 48%, #4f1d00) !important;
}

.profile-bg-metal-room {
  background:
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(#2b3038, #161a20) !important;
  background-size: 36px 36px, auto !important;
}

.profile-bg-midnight {
  background:
    radial-gradient(circle at 18% 18%, rgba(147,197,253,.18), transparent 24%),
    radial-gradient(circle at 88% 20%, rgba(239,68,68,.10), transparent 26%),
    linear-gradient(180deg, #070b16, #111827) !important;
}

.profile-bg-ruby {
  background:
    radial-gradient(circle at 30% 20%, rgba(255,130,130,.22), transparent 28%),
    linear-gradient(135deg, #2a0810, #14080d 55%, #09080b) !important;
}

.profile-bg-diamond {
  background:
    linear-gradient(135deg, rgba(147,197,253,.16), transparent 24%),
    linear-gradient(45deg, rgba(255,255,255,.05) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.05) 75%),
    linear-gradient(180deg, #06111e, #0b1420) !important;
  background-size: auto, 44px 44px, auto !important;
}

.profile-bg-pearlescent {
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.30), transparent 22%),
    radial-gradient(circle at 82% 20%, rgba(192,132,252,.22), transparent 24%),
    radial-gradient(circle at 54% 86%, rgba(125,211,252,.20), transparent 28%),
    linear-gradient(135deg, #171827, #101421) !important;
}

.profile-bg-admin-studio {
  background:
    radial-gradient(circle at 8% 10%, rgba(239,68,68,.28), transparent 22%),
    repeating-linear-gradient(90deg, rgba(255,0,0,.08) 0 1px, transparent 1px 24px),
    linear-gradient(180deg, #16070a, #08090c) !important;
}

/* Component frame styles */
.component-frame-plain .profile-card {
  border: 1px solid rgba(255,255,255,.10) !important;
}

.component-frame-metal .profile-card {
  border: 2px solid #4b5563 !important;
  box-shadow: inset 0 1px rgba(255,255,255,.12), 0 18px 50px rgba(0,0,0,.35) !important;
}

.component-frame-bronze .profile-card {
  border: 2px solid #b8753a !important;
  box-shadow: inset 0 1px rgba(255,213,168,.20), 0 0 18px rgba(184,117,58,.14), 0 18px 50px rgba(0,0,0,.35) !important;
}

.component-frame-silver .profile-card {
  border: 2px solid #cbd5e1 !important;
  box-shadow: inset 0 1px rgba(255,255,255,.35), 0 0 20px rgba(203,213,225,.16), 0 18px 50px rgba(0,0,0,.35) !important;
}

.component-frame-gold .profile-card {
  border: 2px solid #facc15 !important;
  box-shadow: inset 0 1px rgba(255,255,255,.35), 0 0 22px rgba(250,204,21,.18), 0 18px 50px rgba(0,0,0,.35) !important;
}

.component-frame-platinum .profile-card {
  border: 2px solid #a5f3fc !important;
  box-shadow: inset 0 1px rgba(255,255,255,.38), 0 0 22px rgba(165,243,252,.18), 0 18px 50px rgba(0,0,0,.35) !important;
}

.component-frame-diamond .profile-card {
  border: 2px solid #93c5fd !important;
  box-shadow: inset 0 1px rgba(255,255,255,.42), 0 0 28px rgba(147,197,253,.25), 0 18px 50px rgba(0,0,0,.35) !important;
}

.component-frame-pearlescent .profile-card {
  border: 2px solid rgba(255,255,255,.78) !important;
  box-shadow: inset 0 1px rgba(255,255,255,.45), 0 0 34px rgba(192,132,252,.25), 0 18px 50px rgba(0,0,0,.35) !important;
}

.component-frame-admin-red .profile-card {
  border: 2px solid #ff4d4d !important;
  box-shadow: inset 0 1px rgba(255,255,255,.18), 0 0 30px rgba(239,68,68,.35), 0 18px 50px rgba(0,0,0,.35) !important;
}

/* Animated component borders */
.profile-component-wrap {
  isolation: isolate;
}

.profile-component-wrap[class*="component-border-"] .profile-card {
  position: relative;
}

.component-border-pulse .profile-card {
  animation: profile-border-pulse 2.2s ease-in-out infinite;
}

.component-border-shine .profile-card::before,
.component-border-scanline .profile-card::before,
.component-border-sparkle .profile-card::before,
.component-border-rainbow .profile-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  z-index: 2;
}

.component-border-shine .profile-card::before {
  background: linear-gradient(110deg, transparent 0 42%, rgba(255,255,255,.28) 49%, transparent 58% 100%);
  transform: translateX(-120%);
  animation: profile-border-shine 3.2s ease-in-out infinite;
}

.component-border-scanline .profile-card::before {
  background: repeating-linear-gradient(0deg, transparent 0 7px, rgba(255,255,255,.08) 7px 8px);
  animation: profile-scanline 4s linear infinite;
}

.component-border-sparkle .profile-card::before {
  background:
    radial-gradient(circle at 14% 22%, rgba(255,255,255,.80) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 18%, rgba(255,180,180,.70) 0 2px, transparent 3px),
    radial-gradient(circle at 76% 82%, rgba(255,255,255,.55) 0 2px, transparent 3px);
  animation: profile-sparkle 1.8s ease-in-out infinite;
}

.component-border-rainbow .profile-card {
  border-color: transparent !important;
  background:
    linear-gradient(#141820, #141820) padding-box,
    linear-gradient(120deg, #fff, #f0abfc, #93c5fd, #a7f3d0, #fff) border-box !important;
  border: 2px solid transparent !important;
  animation: profile-rainbow-border 4s linear infinite;
}

@keyframes profile-border-pulse {
  50% { filter: brightness(1.14); box-shadow: 0 0 28px rgba(239,68,68,.20), 0 18px 50px rgba(0,0,0,.35); }
}

@keyframes profile-border-shine {
  0%, 45% { transform: translateX(-120%); opacity: 0; }
  60% { opacity: .9; }
  78% { transform: translateX(120%); opacity: 0; }
  100% { transform: translateX(120%); opacity: 0; }
}

@keyframes profile-scanline {
  to { background-position: 0 120px; }
}

@keyframes profile-sparkle {
  0%, 100% { opacity: .28; filter: brightness(.8); }
  50% { opacity: 1; filter: brightness(1.4); }
}

@keyframes profile-rainbow-border {
  50% { filter: hue-rotate(80deg) brightness(1.1); }
}

/* Public mode keeps selected background but removes grid helper text */
body:not(.profile-edit-mode-active) .profile-board.profile-bg-dark-red-grid,
body:not(.profile-edit-mode-active) .profile-board.profile-bg-habbo-orange,
body:not(.profile-edit-mode-active) .profile-board.profile-bg-metal-room,
body:not(.profile-edit-mode-active) .profile-board.profile-bg-midnight,
body:not(.profile-edit-mode-active) .profile-board.profile-bg-ruby,
body:not(.profile-edit-mode-active) .profile-board.profile-bg-diamond,
body:not(.profile-edit-mode-active) .profile-board.profile-bg-pearlescent,
body:not(.profile-edit-mode-active) .profile-board.profile-bg-admin-studio {
  padding: 14px !important;
  border: 1px solid rgba(255,255,255,.08) !important;
}

@media (max-width: 980px) {
  .profile-inventory-window .component-editor-row {
    grid-template-columns: 24px 38px minmax(0,1fr) !important;
  }

  .profile-inventory-window .component-editor-row select,
  .profile-inventory-window .component-editor-row button,
  .profile-inventory-window .widget-dim-field {
    grid-column: 3 !important;
    width: 100% !important;
  }
}


/* =========================================================
   Profile editor button + compact bounds fix
   ========================================================= */

.profile-action-reset {
  background: linear-gradient(#6f7783, #4b5563) !important;
  border-color: #9ca3af !important;
}

.profile-action-reset:hover {
  background: linear-gradient(#818b99, #596371) !important;
}

.profile-board {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.profile-component-wrap.freeform-component {
  max-width: calc(100% - 4px) !important;
  box-sizing: border-box !important;
}

.profile-component-wrap.freeform-component .profile-card {
  max-width: 100%;
  box-sizing: border-box;
}

.profile-board.is-editable-board {
  overflow: visible !important;
}

/* tighter compact public profile so widgets don't look out of bounds */
body:not(.profile-edit-mode-active) .profile-board {
  margin-top: 0 !important;
  padding: 12px !important;
}

body:not(.profile-edit-mode-active) .profile-component-wrap.freeform-component .profile-card {
  overflow: hidden auto;
}

/* keep the top edit bar usable without covering the whole profile */
.profile-habbo-tools {
  max-width: 100%;
}

.profile-habbo-actions {
  align-items: center;
}

.profile-habbo-actions button,
.profile-habbo-actions label {
  white-space: nowrap;
}

/* smaller status/header spacing on profile page */
.profile-page .page-header {
  margin-bottom: 10px !important;
}

.profile-page .page-status {
  margin-bottom: 10px !important;
}

/* layout reset helper should stay visible above profile content in edit mode */
.profile-board.is-editable-board::before {
  max-width: calc(100% - 24px);
  box-sizing: border-box;
}

/* public view: make absolute board feel like a profile canvas but not oversized */
body:not(.profile-edit-mode-active) .profile-board.profile-bg-dark-red-grid,
body:not(.profile-edit-mode-active) .profile-board.profile-bg-habbo-orange,
body:not(.profile-edit-mode-active) .profile-board.profile-bg-metal-room,
body:not(.profile-edit-mode-active) .profile-board.profile-bg-midnight,
body:not(.profile-edit-mode-active) .profile-board.profile-bg-ruby,
body:not(.profile-edit-mode-active) .profile-board.profile-bg-diamond,
body:not(.profile-edit-mode-active) .profile-board.profile-bg-pearlescent,
body:not(.profile-edit-mode-active) .profile-board.profile-bg-admin-studio {
  border-radius: 18px;
}


/* =========================================================
   Organized profile board layout
   Converts the profile editor from messy absolute positioning
   into a clean snap-grid layout with reorder + resize.
   ========================================================= */

.profile-board {
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  grid-auto-flow: row dense !important;
  grid-auto-rows: minmax(28px, auto) !important;
  gap: 12px !important;
  align-items: stretch !important;
  min-height: 0 !important;
  height: auto !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

.profile-component-wrap.freeform-component {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.profile-component-wrap.freeform-component .profile-card {
  min-height: 100% !important;
  height: 100% !important;
  max-height: none !important;
  overflow: hidden auto !important;
  box-sizing: border-box !important;
}

body:not(.profile-edit-mode-active) .profile-board {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}

body.profile-edit-mode-active .profile-board {
  padding: 12px !important;
  border: 1px dashed rgba(239,68,68,.35) !important;
  background:
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.024) 1px, transparent 1px),
    rgba(0,0,0,.10) !important;
  background-size: 8.333% 44px, 8.333% 44px, auto !important;
}

body.profile-edit-mode-active .profile-board::before {
  grid-column: 1 / -1;
  content: "Organized Edit Mode: drag the title bars to reorder blocks, resize from the corner, or use Auto Arrange.";
  display: block;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(15,18,24,.88);
  border: 1px solid rgba(239,68,68,.34);
  color: #ffb4b4;
  font-size: 12px;
  font-weight: 900;
}

.profile-board-dragbar {
  cursor: grab !important;
}

.profile-component-wrap.dragging-board-card {
  opacity: .45;
}

.profile-component-wrap.drag-over-board-card {
  outline: 2px dashed #ff6b6b !important;
  outline-offset: 4px !important;
}

.profile-component-wrap.resizing-board-card {
  outline: 2px solid #ff6b6b !important;
  outline-offset: 4px !important;
}

/* Inventory should not hide the whole profile */
.profile-inventory-window {
  width: min(620px, calc(100vw - 34px)) !important;
  max-height: 470px !important;
}

.profile-inventory-body {
  max-height: 384px !important;
}

/* Cleaner widget rows */
.profile-inventory-window .component-editor-row {
  grid-template-columns: 24px 38px minmax(150px,1fr) 82px 46px 46px 92px 92px 52px 34px 34px !important;
  min-height: 48px !important;
}

.widget-row-main small {
  max-width: 190px;
}

/* Hide old absolute helper if present */
.profile-board.is-editable-board::before {
  position: static !important;
  top: auto !important;
}

/* Public view spacing */
.profile-page .profile-board {
  margin-top: 12px;
}

.profile-page .profile-card {
  border-radius: 14px !important;
}

@media (max-width: 980px) {
  .profile-board {
    grid-template-columns: 1fr !important;
  }

  .profile-component-wrap.freeform-component {
    grid-column: 1 / -1 !important;
  }
}


/* =========================================================
   Sidebar profile editor + independent sticker components
   ========================================================= */

/* Replace the old inventory overlay with a real editor sidebar. */
.profile-sidebar-tools {
  position: sticky;
  top: 8px;
  z-index: 90;
  margin-bottom: 12px !important;
  pointer-events: auto !important;
}

.profile-sidebar-tools .profile-habbo-nav {
  min-height: 52px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: #071923;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 8px 24px rgba(0,0,0,.28);
}

.profile-edit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

body.profile-editor-sidebar-open .profile-edit-layout {
  grid-template-columns: 390px minmax(0, 1fr);
}

.profile-editor-sidebar {
  display: block;
  position: sticky;
  top: 76px;
  z-index: 60;
  max-height: calc(100vh - 92px);
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.014)),
    linear-gradient(180deg, #20242d, #12151b);
  box-shadow: 0 18px 55px rgba(0,0,0,.42);
}

.profile-editor-sidebar.is-collapsed {
  display: none !important;
}

.profile-editor-sidebar .profile-inventory-titlebar {
  background: linear-gradient(180deg, #2b303a, #151922) !important;
  border-bottom: 1px solid rgba(255,255,255,.10) !important;
}

.profile-editor-sidebar .profile-inventory-tabs {
  grid-template-columns: repeat(5, minmax(0,1fr)) !important;
  background: #151922 !important;
  border-bottom: 1px solid rgba(255,255,255,.10) !important;
}

.profile-editor-sidebar .profile-inventory-tabs button {
  min-height: 38px !important;
  background: rgba(255,255,255,.04) !important;
  color: #cbd5e1 !important;
  border-color: rgba(255,255,255,.10) !important;
}

.profile-editor-sidebar .profile-inventory-tabs button.active {
  background: linear-gradient(#ef4444, #991b1b) !important;
  color: #fff !important;
}

.profile-editor-sidebar .profile-inventory-body {
  max-height: calc(100vh - 190px) !important;
  overflow: auto !important;
  padding: 10px !important;
  background: rgba(7,9,13,.46) !important;
}

.profile-editor-sidebar .profile-editor-hint,
.profile-editor-sidebar .profile-tips-box p {
  color: #9ca3af !important;
}

.profile-editor-sidebar .profile-component-editor {
  display: grid;
  gap: 8px;
}

.profile-editor-sidebar .component-editor-row {
  grid-template-columns: 22px 34px minmax(0,1fr) !important;
  gap: 7px !important;
  min-height: 0 !important;
  padding: 8px !important;
  border-radius: 10px !important;
  background: rgba(255,255,255,.045) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  color: #d7dbe3 !important;
}

.profile-editor-sidebar .component-editor-row select,
.profile-editor-sidebar .component-editor-row button,
.profile-editor-sidebar .component-editor-row .widget-dim-field {
  grid-column: 3 !important;
  width: 100% !important;
}

.profile-editor-sidebar .widget-row-main strong {
  color: #fff !important;
}

.profile-editor-sidebar .widget-row-main small {
  color: #9ca3af !important;
  white-space: normal !important;
  max-width: none !important;
}

.profile-editor-sidebar .widget-mini-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.10);
}

.profile-editor-sidebar input,
.profile-editor-sidebar textarea,
.profile-editor-sidebar select {
  background: #0c0e12 !important;
  color: #f2f4f8 !important;
  border: 1px solid rgba(255,255,255,.13) !important;
}

.profile-action-inventory {
  background: linear-gradient(#2d536e, #1d3548) !important;
  border-color: #6e9dbd !important;
}

body.profile-editor-sidebar-open #toggleProfileInventory {
  background: linear-gradient(#ef4444, #991b1b) !important;
  border-color: #ff6b6b !important;
}

/* Board stays organized next to sidebar. */
body.profile-editor-sidebar-open .profile-board {
  min-width: 0;
}

.profile-board {
  position: relative !important;
}

/* Independent sticker components */
.profile-floating-sticker {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
  pointer-events: auto;
  transform: rotate(var(--rot, 0deg));
  transform-origin: center;
}

.floating-sticker-inner {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 12px 24px rgba(0,0,0,.32);
  font-size: clamp(18px, 4vw, 34px);
  box-sizing: border-box;
}

.floating-sticker-inner small {
  display: block;
  max-width: 100%;
  color: #d7dbe3;
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-floating-sticker.is-editable-sticker {
  cursor: grab;
  outline: 1px dashed rgba(255,255,255,.18);
  outline-offset: 2px;
}

.profile-floating-sticker.is-editable-sticker:hover {
  outline-color: rgba(255,107,107,.70);
}

.profile-floating-sticker.dragging-sticker,
.profile-floating-sticker.resizing-sticker {
  opacity: .82;
  outline: 2px solid #ff6b6b;
  outline-offset: 4px;
}

.sticker-delete {
  position: absolute;
  right: -8px;
  top: -8px;
  width: 20px !important;
  height: 20px !important;
  min-height: 20px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  line-height: 1 !important;
  z-index: 3;
}

.sticker-resize-handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  cursor: nwse-resize;
  background: linear-gradient(#ef4444, #991b1b);
  border: 1px solid #ff8a8a;
  box-shadow: 0 3px 10px rgba(0,0,0,.35);
  z-index: 3;
}

.sticker-z-label {
  position: absolute;
  left: -4px;
  bottom: -16px;
  padding: 1px 4px;
  border-radius: 999px;
  background: rgba(0,0,0,.72);
  border: 1px solid rgba(255,255,255,.16);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  pointer-events: none;
}

/* Sticker sidebar */
.sticker-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
}

.sticker-add-choice {
  min-height: 78px !important;
  display: grid !important;
  place-items: center !important;
  gap: 3px !important;
  padding: 8px !important;
  border-radius: 10px !important;
  background: rgba(255,255,255,.045) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  color: #d7dbe3 !important;
  box-shadow: none !important;
  text-transform: none !important;
}

.sticker-add-choice span {
  font-size: 24px;
}

.sticker-add-choice strong {
  font-size: 10px;
  line-height: 1.1;
}

.sticker-add-choice em {
  color: #9ca3af;
  font-style: normal;
  font-size: 9px;
}

.placed-stickers-title {
  margin: 14px 0 8px !important;
}

.placed-sticker-list {
  display: grid;
  gap: 7px;
}

.placed-sticker-row {
  display: grid;
  grid-template-columns: 30px minmax(0,1fr) 56px 56px 44px 30px;
  gap: 5px;
  align-items: center;
  padding: 7px;
  border-radius: 10px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.10);
}

.placed-sticker-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,.07);
}

.placed-sticker-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.placed-sticker-row label {
  display: grid !important;
  grid-template-columns: 12px 1fr;
  gap: 3px;
  align-items: center;
  margin: 0 !important;
  color: #9ca3af !important;
  font-size: 9px !important;
}

.placed-sticker-row input {
  min-height: 24px !important;
  height: 24px !important;
  padding: 0 4px !important;
  font-size: 10px !important;
}

.placed-sticker-row button {
  min-height: 26px !important;
  height: 26px !important;
  padding: 0 6px !important;
  border-radius: 6px !important;
  font-size: 10px !important;
}

/* Old sticker board component is deprecated. Hide it if an old profile still has it. */
.profile-component-wrap[data-component="stickers"] {
  display: none !important;
}

@media (max-width: 1100px) {
  body.profile-editor-sidebar-open .profile-edit-layout {
    grid-template-columns: 1fr;
  }

  .profile-editor-sidebar {
    position: static;
    max-height: none;
  }

  .profile-editor-sidebar .profile-inventory-body {
    max-height: none !important;
  }
}


/* =========================================================
   Smooth preview rotation swap
   Shift-click rotation now crossfades/slides the old rotation
   over the newly rendered one so it does not blink/disappear.
   ========================================================= */

.preview-stage {
  position: relative;
  overflow: hidden;
}

#previewCanvas {
  transition: transform .22s ease, opacity .22s ease, filter .22s ease;
  transform-origin: center center;
}

.preview-swap-ghost {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
  z-index: 25;
  opacity: 1;
  transform: translateX(0) scale(1);
  filter: drop-shadow(0 10px 22px rgba(0,0,0,.32));
  transition:
    opacity .30s ease,
    transform .30s cubic-bezier(.2,.85,.2,1),
    filter .30s ease;
}

.preview-swap-ghost.is-animating.is-next {
  opacity: 0;
  transform: translateX(-26px) scale(.96) rotate(-1deg);
  filter: blur(.3px) drop-shadow(0 4px 12px rgba(0,0,0,.22));
}

.preview-swap-ghost.is-animating.is-back {
  opacity: 0;
  transform: translateX(26px) scale(.96) rotate(1deg);
  filter: blur(.3px) drop-shadow(0 4px 12px rgba(0,0,0,.22));
}

.preview-rotating #previewCanvas {
  opacity: .25;
  transform: translateX(18px) scale(.985);
}

.preview-rotating.preview-rotate-back #previewCanvas {
  transform: translateX(-18px) scale(.985);
}

.preview-rotating.preview-rotate-ready #previewCanvas,
#previewCanvas.preview-canvas-pop {
  opacity: 1;
  transform: translateX(0) scale(1);
  animation: preview-rotation-pop .26s cubic-bezier(.2,.85,.2,1);
}

@keyframes preview-rotation-pop {
  0% { opacity: .35; transform: translateX(18px) scale(.985); filter: brightness(.88); }
  72% { opacity: 1; transform: translateX(0) scale(1.015); filter: brightness(1.08); }
  100% { opacity: 1; transform: translateX(0) scale(1); filter: brightness(1); }
}

.preview-rotating.preview-rotate-back #previewCanvas.preview-canvas-pop {
  animation-name: preview-rotation-pop-back;
}

@keyframes preview-rotation-pop-back {
  0% { opacity: .35; transform: translateX(-18px) scale(.985); filter: brightness(.88); }
  72% { opacity: 1; transform: translateX(0) scale(1.015); filter: brightness(1.08); }
  100% { opacity: 1; transform: translateX(0) scale(1); filter: brightness(1); }
}


/* Bulk Nitro/SWF upload queue */
.upload-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}
.upload-section-head h2 { margin-bottom: 0; }
.upload-limit-chip {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  color: var(--muted);
  border-radius: 8px;
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
}
.upload-field-hint { margin-top: 6px; }
#uploadAssetInput { padding: 8px; }
#uploadAssetInput::file-selector-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 9px;
  margin-right: 8px;
  background: #252b33;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}
.upload-queue-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(9,11,15,.56);
  overflow: hidden;
}
.upload-queue-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
.upload-queue-head > div:first-child { min-width: 0; }
.upload-queue-head strong {
  display: block;
  font-size: 12px;
}
.upload-queue-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 178px;
}
.upload-queue-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}
.upload-queue-actions button {
  width: auto;
  margin: 0;
  padding: 5px 7px;
  border-radius: 7px;
  font-size: 9px;
  white-space: nowrap;
}
.upload-overall-progress {
  height: 8px;
  margin: 10px 10px 0;
  background: #0d1014;
  border: 1px solid #272e37;
  border-radius: 999px;
  overflow: hidden;
}
.upload-overall-progress > span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--red), #ff8b5c);
  transition: width .25s ease;
}
.upload-queue-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 10px 10px;
}
.upload-queue-stats > div {
  border: 1px solid #282e36;
  background: rgba(255,255,255,.025);
  border-radius: 8px;
  padding: 6px 7px;
  min-width: 0;
}
.upload-queue-stats span,
.upload-queue-stats strong { display: block; }
.upload-queue-stats span {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.upload-queue-stats strong {
  margin-top: 2px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-queue-list {
  max-height: 310px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}
.upload-queue-item {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(44,50,59,.7);
}
.upload-queue-item:last-child { border-bottom: 0; }
.upload-queue-item-main {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
}
.upload-queue-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #59616d;
  box-shadow: 0 0 0 2px rgba(89,97,109,.12);
}
.upload-queue-item.is-uploading .upload-queue-status-dot,
.upload-queue-item.is-processing .upload-queue-status-dot {
  background: #f4b54a;
  box-shadow: 0 0 0 2px rgba(244,181,74,.13);
}
.upload-queue-item.is-complete .upload-queue-status-dot {
  background: var(--good);
  box-shadow: 0 0 0 2px rgba(83,209,138,.13);
}
.upload-queue-item.is-error .upload-queue-status-dot {
  background: var(--red2);
  box-shadow: 0 0 0 2px rgba(255,100,100,.13);
}
.upload-queue-item.is-cancelled .upload-queue-status-dot { background: #707986; }
.upload-queue-file,
.upload-queue-item-meta { min-width: 0; }
.upload-queue-file strong,
.upload-queue-item-meta strong,
.upload-queue-file span,
.upload-queue-item-meta span { display: block; }
.upload-queue-file strong {
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-queue-file span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-queue-item-meta {
  max-width: 105px;
  text-align: right;
}
.upload-queue-item-meta strong {
  color: #cbd3df;
  font-size: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-queue-item.is-error .upload-queue-item-meta strong { color: #ff9494; }
.upload-queue-item.is-complete .upload-queue-item-meta strong { color: #7ee0aa; }
.upload-queue-item-meta span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}
.upload-file-progress {
  height: 3px;
  margin-top: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: #11151a;
}
.upload-file-progress > span {
  display: block;
  height: 100%;
  background: #697482;
  transition: width .2s ease;
}
.upload-queue-item.is-uploading .upload-file-progress > span,
.upload-queue-item.is-processing .upload-file-progress > span { background: #f4b54a; }
.upload-queue-item.is-complete .upload-file-progress > span { background: var(--good); }
.upload-queue-item.is-error .upload-file-progress > span { background: var(--red2); }
.upload-file-progress.is-processing > span {
  background-image: linear-gradient(110deg, rgba(255,255,255,.06) 20%, rgba(255,255,255,.34) 42%, rgba(255,255,255,.06) 64%);
  background-size: 180% 100%;
  animation: upload-processing-shimmer 1.05s linear infinite;
}
@keyframes upload-processing-shimmer {
  from { background-position: 160% 0; }
  to { background-position: -80% 0; }
}


/* Bulk upload queue pause/resume control */
.upload-queue-actions .upload-resume-btn {
  border-color: rgba(126, 224, 170, .55);
  color: #9beabb;
  background: rgba(126, 224, 170, .08);
}
.upload-queue-actions .upload-resume-btn:hover:not(:disabled) {
  border-color: rgba(126, 224, 170, .85);
  background: rgba(126, 224, 170, .14);
}
