/* =========================================================
   GLOBAL VARIABLES & RESET
========================================================= */

:root {
  --bg-dark: #1b1b1b;
  --bg-darker: #151515;
  --bg-black: #0f0f0f;

  --panel: #1a1a1a;

  --accent: #7c5cff; /* Morphara accent */
  --accent-app: #4aa3ff;

  --text: #ffffff;
  --text-dim: #b0b0b0;
  --muted: #999;
}

* {
  box-sizing: border-box;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  margin: 0;
  background: var(--bg-black);
  color: var(--text);
}

/* =========================================================
   ===================== LANDING PAGE ======================
========================================================= */

/* ---------- HERO ---------- */

.hero {
  position: relative;
  height: 85vh;
  overflow: hidden;
}

.hero img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.hero img.active {
  opacity: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}

.hero-content {
  max-width: 800px;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero h1 span {
  color: var(--accent);
}

.hero p {
  font-size: 1.2rem;
  color: #ccc;
  margin-bottom: 28px;
}

.hero button {
  background: var(--accent);
  border: none;
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  color: white;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.hero button:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}
/* ---------- top bar ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.brand img {
  width: 28px;
  height: 28px;
}
/* ---------- SECTIONS ---------- */

section {
  padding: 80px 20px;
  max-width: 1100px;
  margin: auto;
}

h2 {
  font-size: 2rem;
  margin-bottom: 24px;
}

/* ---------- CHANGELOG ---------- */

.changelog {
  background: var(--panel);
  border-radius: 12px;
  padding: 30px;
}

.version {
  margin-bottom: 20px;
}

.version ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}
/* ---------- FOOTER ---------- */

footer {
  text-align: center;
  padding: 30px;
  color: #666;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.2rem;
  }
}
/* =========== Features ========== */
.feature {
  display: flex;
  align-items: center;
  gap: 60px;
  padding: 100px 20px;
  max-width: 1200px;
  margin: auto;
}
.feature div h2{
  color: var(--accent);
}
.feature-media video {
  width: 100%;
  max-width: 520px;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  pointer-events: none; /* 🔒 no interaction */
}

.feature-text {
  max-width: 500px;
}

.feature-text h2 {
  font-size: 2rem;
  margin-bottom: 16px;
}

.feature-text p {
  color: #bbb;
  line-height: 1.6;
}
.feature-reverse {
  flex-direction: row-reverse;
}

/* ===============================
   CHANGELOG ACCORDION
================================ */

.changelog {
  max-width: 900px;
  margin: 0 auto;
}

.version {
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 10px 0;
}

.version-header {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.version-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--accent);
}

.version .arrow {
  display: inline-block;
  transition: transform 0.25s ease;
  color: #aaa;
}

/* Collapsed */
.version ul {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin: 0;
  padding-left: 28px;
  transition: max-height 0.35s ease, opacity 0.25s ease;
}

/* Expanded */
.version.open ul {
  max-height: 500px; /* plenty for changelog */
  opacity: 1;
  margin-top: 8px;
}

.version.open .arrow {
  transform: rotate(90deg);
}

.version ul li {
  font-size: 14px;
  color: #bbb;
  margin-bottom: 6px;
}
/* ================= Behind the Scenes ================= */

.behind-scenes {
  padding: 80px 6%;
  background: radial-gradient(
    circle at top,
    rgba(102,204,255,0.08),
    transparent 60%
  );
}

.behind-scenes-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 50px;
  align-items: center;
}

.behind-text h2 {
  font-size: 32px;
  margin-bottom: 14px;
}

.behind-text p {
  color: #bbb;
  line-height: 1.6;
  margin-bottom: 16px;
}

.behind-text ul {
  list-style: none;
  padding: 0;
}

.behind-text li {
  color: #9fe;
  margin-bottom: 6px;
  font-size: 14px;
}

.behind-media {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}

.behind-media video {
  width: 100%;
  display: block;
}

.behind-caption {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 12px;
  color: #ccc;
  background: rgba(0,0,0,0.55);
  padding: 4px 8px;
  border-radius: 6px;
}

/* Responsive */
@media (max-width: 900px) {
  .behind-scenes-inner {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   ====================== APP (EDITOR) =====================
========================================================= */

body.app {
  background: #111;
  overflow: hidden;
}

/* ---------- TOP PANEL ---------- */
.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 20px;
}

.app-icon {
  width: 28px;
  height: 28px;
}

.app-title {
  font-weight: 600;
  font-size: 18px;
}

.app-version {
  font-size: 12px;
  color: #777;
  margin-left: 6px;
}

#top-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-darker);
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.top-section {
  display: flex;
  align-items: center;
}

.top-left {
  display: flex;
  gap: 8px;
}

.top-center {
  flex: 1;
  justify-content: center;
  font-weight: 600;
  pointer-events: none;
}

.top-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.top-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.top-btn.active {
  color: var(--accent-app);
}

/* ---------- PANELS ---------- */

.panel {
  position: absolute;
  left: 0;
  top: 56px;
  width: 260px;
  height: calc(100vh - 56px);
  background: var(--bg-dark);
  padding: 12px;
  overflow-y: auto;
  box-shadow: 2px 0 8px rgba(0,0,0,0.4);
  display: none;
  z-index: 5;
}

.panel.active {
  display: block;
}


/* ---------- BLEND SHAPES ---------- */

.blend-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.blend-row label {
  width: 110px;
  font-size: 13px;
  color: #ddd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blend-row input[type="range"] {
  flex: 1;
}

/* ---------- MATERIAL ---------- */
#material-panel {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.material-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 10px;
}
.section-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #aaa;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
#material-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.material-target-btn {
  padding: 6px 10px;
  font-size: 12px;
  background: #1f1f1f;
  border: 1px solid #333;
  border-radius: 6px;
  color: #ccc;
  cursor: pointer;
}

.material-target-btn:hover {
  border-color: #6cf;
  color: #fff;
}

.material-target-btn.active {
  background: #2a4cff;
  border-color: #2a4cff;
  color: #fff;
}

#material-panel label {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  color: #ddd;
}

#material-panel input[type="color"] {
  width: 100%;
  height: 36px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid #333;
  background: #111;
  cursor: pointer;
}

#texture-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.texture-item {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  border: 1px solid #333;
  cursor: pointer;
}

.texture-item:hover {
  border-color: #6cf;
}

.texture-item.active {
  outline: 2px solid #6cf;
}
/* cards ui */
.preview-canvas {
  width: 100%;
  height: 120px;
  border-radius: 6px;
  background: #111;
  overflow: hidden;
}


/* ---------- Base Meshes ---------- */
.base-mesh-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #222;
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 12px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border 0.2s, transform 0.2s;
  height: 200px;
  max-height: 200px;
}

.base-mesh-card:hover {
  background: #2d2d2d;
}

.base-mesh-card.active {
  border-color: var(--accent-app);
}

.base-mesh-card img {
  width: 100%;
  border-radius: 6px;
  display: block;
  margin-bottom: 6px;
}

.base-mesh-card .preview-canvas {
  flex: 1;
  min-height: 0;
  height: 140px;
  max-height: 140px;
  overflow: hidden;
}

.base-mesh-name {
  font-size: 13px;
  text-align: center;
  color: #ddd;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#basemesh-panel,
#blendshape-panel,
#clothes-panel,
#clothes-items-panel,
#material-panel {
  display: none;
}

#basemesh-panel.active,
#blendshape-panel.active,
#clothes-panel.active,
#clothes-items-panel.active,
#material-panel.active {
  display: block;
}

/* ---------- CLOTHES ---------- */

.clothes-category {
  width: 100%;
  margin-bottom: 8px;
  padding: 8px;
  background: #2a2a2a;
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  text-align: left;
}

.clothes-category:hover {
  background: #333;
}

#clothes-items-panel.active {
  display: block;
}
.panel-right {
  left: auto;
  right: 0;
  box-shadow: -2px 0 8px rgba(0,0,0,0.4);
}
.clothes-placeholder {
  background: #222;
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  color: #888;
  font-size: 13px;
}
#viewport {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}
.clothes-items-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
  width: 100%;
}
.clothing-card {
  background: #222;
  border-radius: 10px;
  padding: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border 0.2s ease, transform 0.15s ease;

  display: flex;
  flex-direction: column;
  align-items: center;

  height: 140px;
  width: 100%;
}

.clothing-card:hover {
  background: #2d2d2d;
  transform: translateY(-1px);
}
.none-card {
  border: 1px dashed #555;
  color: #aaa;

  display: flex;
  flex-direction: column;
  justify-content: center;
}

.clothing-preview {
  width: 100%;
  height: 90px;
  min-height: 90px;
  max-height: 90px;

  border-radius: 6px;
  background: #111;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;
}

.clothing-label {
  font-size: 12px;
  color: #ddd;
  text-align: center;
  margin-top: 6px;
  line-height: 1.2;

  height: 28px;       /* 🔑 same label height */
  overflow: hidden;
}


/* ---------- EXPORT MENU ---------- */
#export-menu {
  position: fixed;
  top: 70px;
  right: 16px;
  background: #1a1a1a;
  padding: 14px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: none;
  z-index: 20;
  width: 200px;
}

#export-menu.active {
  display: block;
}

.export-option {
  width: 100%;
  padding: 10px;
  margin-bottom: 8px;
  background: #2a2a2a;
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
}

.export-option:hover {
  background: var(--accent-app);
}
/* ================= RANDOMIZER PANEL ================= */

.rand-title {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.rand-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.rand-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1f1f1f;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.2s ease, border 0.2s ease;
}

.rand-toggle:hover {
  background: #262626;
  border-color: #3a3a3a;
}

.rand-toggle input {
  accent-color: var(--accent-app);
  cursor: pointer;
}

.rand-toggle span {
  font-size: 13px;
  color: #ddd;
  user-select: none;
}

/* ---------- ACTION BUTTONS ---------- */

.rand-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.rand-actions button {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

#randomize-btn {
  background: var(--accent-app);
  color: #fff;
}

#randomize-btn:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

#reset-btn {
  background: #2a2a2a;
  color: #ccc;
}

#reset-btn:hover:not(:disabled) {
  background: #333;
}

#reset-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
/* ---------- TEXTURE PAINTER ---------- */
.paint-btn {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: none;
  background: #2a4cff;
  color: #fff;
  cursor: pointer;
}
.hidden {
  display: none !important;
}
/* ================= TEXTURE PAINTER ================= */

#texture-painter-mode {
  position: absolute;
  inset: 0;
  display: flex;
  background: #0e0e0e;
  z-index: 1000;
}

/* LEFT PREVIEW */
#painter-viewport {
  width: 20%;
  background: #000;
  border-right: 1px solid #222;
}

/* RIGHT UI */
#painter-ui {
  width: 80%;
  display: flex;
  flex-direction: column;
  background: #141414;
}

/* TOP BAR */
.painter-top-bar {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid #222;
  background: #181818;
}

.painter-top-bar button {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
}

.painter-top-bar button:hover {
  color: #fff;
}

.painter-title {
  margin-left: 12px;
  font-weight: 600;
  color: #fff;
}

/* CONTENT */
.painter-content {
  flex: 1;
  display: flex;
}

/* PANELS */
.painter-panel {
  padding: 12px;
  border-right: 1px solid #222;
  background: #151515;
}
.texture-view canvas {
  flex: 1;
  background: #fff;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
}

/* TOOLS */
.tools-panel {
  flex: 1;
}

.tool-btn {
  width: 100%;
  padding: 8px;
  margin-bottom: 6px;
  background: #1f1f1f;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  color: #ccc;
  cursor: pointer;
}
.tool-btn.active {
  background: #2a4cff;
  color: white;
  border-color: #2a4cff;
}

.tool-btn:hover {
  background: #262626;
}

.tool-subpanel {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.texture-view {
  overflow: hidden;
  position: relative;
}

#texture-canvas {
  transform-origin: center center;
  cursor: grab;
  background-color: #444;
  background-image:
    linear-gradient(45deg, #555 25%, transparent 25%),
    linear-gradient(-45deg, #555 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #555 75%),
    linear-gradient(-45deg, transparent 75%, #555 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}
/* TOAST NOTIFICATION */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 20, 0.9);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}

.toast.hidden {
  display: none;
}
/* ================= UV TOGGLE BUTTON ================= */

#toggle-uv {
  background: #2a2a2a;
  color: #bbb;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: 
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

#toggle-uv:hover {
  background: #333;
  color: #fff;
}

/* ACTIVE STATE (UV ON) */
#toggle-uv.active {
  background: #4a6cff;
  color: #fff;
  border-color: #4a6cff;
  box-shadow: 0 0 0 1px rgba(74,108,255,0.35);
}
/* ================= UV TOOL CONTROLS ================= */

.uv-panel {
  border-top: 1px solid #2a2a2a;
  margin-top: 8px;
  padding-top: 8px;
}

.uv-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Eye button */
.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #333;
  background: #222;
  color: #aaa;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: #2d2d2d;
  color: #fff;
}

.icon-btn.active {
  background: #4a6cff;
  border-color: #4a6cff;
  color: #fff;
}

/* UV opacity slider */
#uv-opacity {
  flex: 1;
  height: 4px;
  accent-color: #4a6cff;
}

/* =================== User and Plans STYLES ================== */
.site-topbar {
  position: fixed;
  top: 0;
  width: 100%;
  height: 56px;
  background: #111;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  z-index: 100;
}
.top-right {
  margin-left: auto;     /* 🔥 THIS pushes it to the edge */
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.icon-btn {
  background: #1b1b1b;
  border: 1px solid #333;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.credits-menu,
.user-menu {
  position: relative;
}

.dropdown {
  position: absolute;
  right: 0;
  top: 110%;
  background: #1b1b1b;
  border: 1px solid #333;
  border-radius: 6px;
  display: none;
  min-width: 160px;
  z-index: 200;
}

.credits-menu:hover .dropdown,
.user-menu:hover .dropdown {
  display: block;
}

.credits-count {
  margin-left: 4px;
  font-weight: bold;
}
.credits-btn,
.credits-menu .icon-btn {
  display: flex;
  align-items: center;
  gap: 6px;

  min-width: 80px;          /* 👈 THIS is the key */
  justify-content: center;

  font-weight: 600;
}
.top-actions {
  position: relative; /* 🔑 THIS IS THE KEY */
  display: flex;
  align-items: center;
  gap: 8px;
}
/* ================= TOP DROPDOWNS ================= */

.top-dropdown {
  position: absolute;
  top: 100%;          /* directly under buttons */
  right: 0;           /* align to right edge */
  margin-top: 6px;

  background: #1c1c1c;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 6px;
  min-width: 160px;

  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 1000;
}

.top-dropdown.hidden {
  display: none;
}

.dropdown-item {
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.dropdown-item:hover {
  background: rgba(255,255,255,0.08);
}
/* ================= Plans and Credit OVERLAY ================= */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
}

.overlay.hidden {
  display: none;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
}
.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  overflow: hidden;
}

/* Animated gradient layer */
.overlay-backdrop::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: linear-gradient(
    120deg,
    #1a2a3a,
    #1a1f2e,
    #1e3a4a,
    #1a2a3a
  );
  background-size: 300% 300%;
  animation: gradientMove 40s ease infinite;
  filter: blur(80px);
  opacity: 0.45;
}
@keyframes gradientMove {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.overlay-panel {
  position: relative;
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  margin: 5vh auto;
  background: #121212;
  border-radius: 14px;
  padding: 20px;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}

/* HEADER */
.overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* TABS */
.overlay-tabs {
  display: flex;
  gap: 10px;
  margin: 16px 0;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  background: #1e1e1e;
  border: none;
  color: #ccc;
  border-radius: 8px;
  cursor: pointer;
}

.tab-btn.active {
  background: #2a2a2a;
  color: #fff;
}

/* CONTENT */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* PLANS */
.plans-grid,
.credits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.credit-pack {
  background: #1a1a1a;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.price {
  font-size: 22px;
  margin: 8px 0;
}
.plan-card {
  background: linear-gradient(180deg, #1a1a1a, #141414);
  border-radius: 12px;
  padding: 16px;
  text-align: center;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  transition: transform 0.25s ease, box-shadow 0.25s ease;
}


.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.plan-card.highlight {
  border: 2px solid #6cf;
  box-shadow: 0 0 30px rgba(102,204,255,0.25);
}

.plan-btn {
  margin-top: 16px;
  width: 100%;
  padding: 12px;

  border-radius: 10px;
  border: none;

  background: #2a2a2a;
  color: #fff;

  font-weight: 600;
  font-size: 14px;

  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.plan-btn:hover:not(.disabled) {
  transform: translateY(-1px);
  background: #333;
}


.plan-card.highlight .plan-btn {
  background: linear-gradient(135deg, #6cf, #4af);
  color: #000;
}


.plan-btn.disabled {
  opacity: 0.5;
  cursor: default;
}
.overlay-panel {
  animation: panelIn 0.35s ease;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.billing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}

.billing-label {
  color: #aaa;
  cursor: pointer;
  font-size: 14px;
}

.billing-label.active {
  color: #fff;
}

.billing-label em {
  color: #6cf;
  font-style: normal;
  margin-left: 4px;
}

.toggle-switch {
  width: 46px;
  height: 24px;
  background: #2a2a2a;
  border-radius: 20px;
  position: relative;
  cursor: pointer;
}

.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #6cf;
  border-radius: 50%;
  transition: transform 0.25s ease;
}

.yearly .toggle-knob {
  transform: translateX(22px);
}
.price-yearly {
  display: none;
  color: #6cf;
}

.yearly .price-monthly {
  display: none;
}

.yearly .price-yearly {
  display: inline;
}
/* ================= Character Preview ================= */

.plans-visual {
  margin: 16px 0 24px;
}

.visual-frame {
  position: relative;
  height: 180px;
  border-radius: 14px;
  overflow: hidden;

  background: radial-gradient(
    circle at top,
    #1f2a3a,
    #0f141a
  );

  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.05),
    0 20px 50px rgba(0,0,0,0.5);
}

.character-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Soft vignette + depth */
.visual-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(0,0,0,0) 40%, rgba(0,0,0,0.45)),
    linear-gradient(to top, rgba(0,0,0,0.4), transparent 40%);
  pointer-events: none;
}
/* ================= Newsletter ================= */

.newsletter {
  padding: 70px 6%;
  background: linear-gradient(
    180deg,
    rgba(102,204,255,0.08),
    rgba(0,0,0,0)
  );
  text-align: center;
}

.newsletter-inner {
  max-width: 600px;
  margin: 0 auto;
}

.newsletter h2 {
  font-size: 30px;
  margin-bottom: 12px;
}

.newsletter p {
  color: #bbb;
  margin-bottom: 20px;
}

#newsletter-form {
  display: flex;
  gap: 10px;
}

#newsletter-email {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  border: none;
  outline: none;
  background: #1c1c1c;
  color: #fff;
}

#newsletter-form button {
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #6cf, #4af);
  font-weight: 600;
  cursor: pointer;
}

#newsletter-status {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  color: #9fe;
}

/* Mobile */
@media (max-width: 600px) {
  #newsletter-form {
    flex-direction: column;
  }
}
/* ================= LAUNCH OVERLAY ================= */

.launch-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.launch-panel {
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg,#141414,#0e0e0e);
  border-radius: 18px;
  padding: 30px;
  position: relative;
  box-shadow: 0 40px 100px rgba(0,0,0,0.7);
  animation: fadeInPanel 0.4s ease;
}

@keyframes fadeInPanel {
  from { opacity:0; transform: translateY(20px) scale(0.98); }
  to { opacity:1; transform:none; }
}

.launch-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 18px;
  color: #aaa;
  cursor: pointer;
}

.launch-hero {
  text-align: center;
  margin-bottom: 25px;
  padding: 20px;
  border-radius: 14px;
  background: linear-gradient(135deg,#6cf,#4af);
  color: #000;
}

.launch-hero h1 {
  margin: 0;
  font-size: 26px;
}

.launch-content h2 {
  margin-top: 10px;
}

.launch-content ul {
  padding-left: 18px;
  color: #ccc;
}

.launch-cta {
  margin-top: 20px;
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg,#6cf,#4af);
  color: #000;
  font-weight: 600;
  cursor: pointer;
}
/* ================= AUTH OVERLAY ================= */

.auth-panel {
  width: 420px;
  max-width: 95%;
}

.auth-tabs {
  display: flex;
  margin-bottom: 20px;
  gap: 6px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  background: #1f1f1f;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  color: #bbb;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--accent-app);
  color: white;
  border-color: var(--accent-app);
}

.auth-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-content input {
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #333;
  background: #111;
  color: white;
}

.auth-main-btn {
  padding: 12px;
  border-radius: 6px;
  border: none;
  background: var(--accent-app);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

.auth-main-btn:hover {
  opacity: 0.9;
}

.auth-divider {
  text-align: center;
  color: #777;
  font-size: 12px;
  margin: 6px 0;
}

.auth-oauth-btn {
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #333;
  background: #1c1c1c;
  color: white;
  cursor: pointer;
}

.auth-oauth-btn:hover {
  background: #262626;
}

.auth-error {
  font-size: 13px;
  color: #ff6b6b;
  text-align: center;
}

/* =========================================================
   EXPORT & RANDOMIZER OVERLAYS
========================================================= */

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid rgba(255,255,255,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

#randomizer-loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

#export-panel-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
}

.export-panel-content {
  background: #1e1e1e;
  border-radius: 12px;
  padding: 30px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.export-type-card {
  background: #2a2a2a;
  border-radius: 8px;
  padding: 20px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.export-type-card:hover {
  background: #333 !important;
}

.format-btn {
  background: #2a2a2a;
  border: 2px solid transparent;
  color: #fff;
  padding: 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.format-btn:hover {
  background: #3a3a3a !important;
}

#final-export-btn:not(:disabled):hover {
  background: #5a53df;
}


/* ============================================================================
   RESPONSIVE DESIGN - MEDIA QUERIES
   Mobile First Approach: Tablets → Mobile → Small Mobile
   ============================================================================ */

/* ========================================
   TABLETS (768px - 1024px)
   ======================================== */
@media (max-width: 1024px) {
  
  /* Landing Page Hero */
  .hero {
    height: 70vh;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  /* Features Section */
  .feature {
    flex-direction: column;
    gap: 40px;
    padding: 60px 20px;
  }
  
  .feature-reverse {
    flex-direction: column;
  }
  
  .feature-media video {
    max-width: 100%;
  }
  
  /* Morphara App - Top Bar */
  .app-brand .app-title {
    font-size: 18px;
  }
  
  .app-version {
    font-size: 10px;
  }
  
  /* Morphara App - Main Layout */
  .top-section {
    width: 100% !important;
    max-width: none !important;
  }
  
  /* Base Mesh/Clothing Cards - Reduce to 3 columns */
  .basemesh-cards,
  .clothing-cards {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px;
  }
  
  /* Right Panel - Reduce width */
  .top-right {
    width: 280px !important;
  }
  
  /* Material Cards */
  .material-card {
    padding: 12px;
  }
  
  /* Blend Shape Sliders */
  .blend-shape-item {
    padding: 10px 12px;
  }
  
  /* Animation Cards */
  .animation-cards {
    gap: 10px;
  }
  
  
.animation-card {
  background: #1a1a1a;
  border: 2px solid #2a2a2a;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.animation-card:hover {
  background: #252525;
  border-color: #3a3a3a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.animation-card.active {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.15), rgba(74, 163, 255, 0.1));
  border-color: #7c5cff;
  box-shadow: 0 0 20px rgba(124, 92, 255, 0.3);
}

.animation-card.active::before {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: #7c5cff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: bold;
  z-index: 10;
}

.animation-card {
    min-width: 140px;
  }
}

/* ========================================
   MOBILE (320px - 768px)
   ======================================== */
@media (max-width: 768px) {
  
  /* ========== LANDING PAGE ========== */
  
  /* Top Bar */
  .site-topbar {
    padding: 12px 16px;
  }
  
  .site-topbar .brand img {
    width: 28px;
    height: 28px;
  }
  
  .site-topbar .brand span {
    font-size: 16px;
  }
  
  /* Hero */
  .hero {
    height: 60vh;
  }
  
  .hero h1 {
    font-size: 2rem;
    padding: 0 20px;
  }
  
  .hero p {
    font-size: 0.95rem;
    padding: 0 20px;
  }
  
  .hero button {
    padding: 12px 28px;
    font-size: 14px;
  }
  
  /* Features */
  .feature {
    padding: 40px 16px;
    gap: 30px;
  }
  
  .feature h2 {
    font-size: 1.5rem;
  }
  
  /* Behind the Scenes */
  .behind-scenes-inner {
    flex-direction: column;
    gap: 30px;
  }
  
  /* Changelog */
  .changelog .version {
    padding: 16px;
  }
  
  .version h3 {
    font-size: 1rem;
  }
  
  /* Newsletter */
  .newsletter-inner {
    padding: 0 20px;
  }
  
  .newsletter-inner h2 {
    font-size: 1.5rem;
  }
  
  #newsletter-form {
    flex-direction: column;
  }
  
  #newsletter-form input {
    width: 100%;
  }
  
  #newsletter-form button {
    width: 100%;
  }
  
  /* Footer */
  footer > div {
    padding: 0 20px;
  }
  
  footer a {
    display: block;
    margin: 8px 0;
  }
  
  /* ========== MORPHARA APP ========== */
  
  /* Top Bar */
  .app-brand {
    gap: 8px;
  }
  
  .app-icon {
    width: 28px !important;
    height: 28px !important;
  }
  
  .app-title {
    font-size: 16px !important;
  }
  
  .app-version {
    font-size: 9px !important;
  }
  
  .user-info {
    gap: 8px;
  }
  
  .user-email {
    display: none; /* Hide email on mobile */
  }
  
  .credits-badge {
    font-size: 12px;
    padding: 4px 10px;
  }
  
  .top-right-controls {
    gap: 6px;
  }
  
  .top-right-controls button {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  /* Main Layout - Stack Vertically */
  .workspace {
    flex-direction: column !important;
    height: auto !important;
  }
  
  .top-section {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
  }
  
  .top-left {
    height: auto !important;
    border-right: none !important;
    border-bottom: 1px solid #2a2a2a;
  }
  
  .top-right {
    width: 100% !important;
    height: auto !important;
    max-height: 400px;
    overflow-y: auto;
  }
  
  /* Canvas - Full Width, Smaller Height */
  .canvas-wrapper {
    height: 50vh !important;
    min-height: 300px;
  }
  
  canvas {
    width: 100% !important;
    height: 100% !important;
  }
  
  /* Base Mesh Cards - 2 Columns */
  .basemesh-cards {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
    padding: 12px;
  }
  
  .basemesh-card {
    padding: 10px;
  }
  
  .basemesh-card h3 {
    font-size: 12px;
  }
  
  /* Clothing Cards - 2 Columns */
  .clothing-cards {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
    padding: 12px;
  }
  
  .clothing-card {
    padding: 10px;
  }
  
  .clothing-card h4 {
    font-size: 11px;
  }
  
  .clothing-header {
    padding: 12px;
  }
  
  .category-tabs {
    gap: 6px;
    padding: 0 12px;
  }
  
  .category-tab {
    padding: 6px 12px;
    font-size: 11px;
  }
  
  /* Materials Panel */
  .materials-panel {
    padding: 12px;
  }
  
  .material-card {
    padding: 10px;
  }
  
  .material-label {
    font-size: 11px;
  }
  
  .color-picker {
    width: 100%;
  }
  
  /* Blend Shapes Panel */
  .blend-shapes-panel {
    padding: 12px;
  }
  
  .blend-shape-item {
    padding: 8px 10px;
  }
  
  .blend-shape-label {
    font-size: 11px;
  }
  
  .blend-shape-slider {
    width: 100%;
  }
  
  /* Bottom Panel - Animations */
  .bottom-panel {
    padding: 12px;
  }
  
  .animation-cards {
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .animation-card {
    min-width: 120px;
    padding: 8px;
  }
  
  .animation-card h4 {
    font-size: 11px;
  }
  
  /* ========== MODALS / OVERLAYS ========== */
  
  /* Export Panel */
  .export-panel-overlay {
    padding: 20px;
  }
  
  .export-panel-content {
    width: 95% !important;
    max-width: none;
    padding: 20px;
  }
  
  .export-panel-header h2 {
    font-size: 1.3rem;
  }
  
  .export-type-cards {
    flex-direction: column;
    gap: 12px;
  }
  
  .export-type-card {
    width: 100%;
  }
  
  .format-options {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }
  
  .format-btn {
    padding: 12px;
  }
  
  .export-actions {
    flex-direction: column;
    gap: 10px;
  }
  
  .export-actions button {
    width: 100%;
  }
  
  /* Plans Overlay */
  .plans-overlay .overlay-panel {
    width: 95% !important;
    max-width: none;
    padding: 20px;
  }
  
  .overlay-header h2 {
    font-size: 1.3rem;
  }
  
  .plan-toggle {
    transform: scale(0.9);
  }
  
  .pricing-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  
  .plan-card {
    padding: 20px;
  }
  
  .plan-card h3 {
    font-size: 1.2rem;
  }
  
  .price {
    font-size: 1.8rem;
  }
  
  .credit-packs {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  
  /* Texture Painter */
  #texture-painter-mode {
    flex-direction: column;
  }
  
  .painter-sidebar {
    width: 100% !important;
    height: auto;
    max-height: 200px;
    overflow-y: auto;
    border-right: none !important;
    border-bottom: 1px solid #333;
  }
  
  #painter-viewport {
    width: 100% !important;
    height: 60vh;
  }
  
  .tool-btn {
    padding: 10px;
    font-size: 12px;
  }
  
  .painter-control {
    padding: 10px;
  }
  
  .painter-control label {
    font-size: 11px;
  }
  
  /* Randomizer Loading */
  #randomizer-loading .spinner {
    width: 50px;
    height: 50px;
  }
  
  /* Legal Pages */
  .legal-container {
    margin: 40px auto;
    padding: 20px;
  }
  
  .legal-container h1 {
    font-size: 1.5rem;
  }
  
  .legal-container h2 {
    font-size: 1.1rem;
  }
  
  .legal-container p,
  .legal-container li {
    font-size: 14px;
  }
}

/* ========================================
   SMALL MOBILE (320px - 480px)
   ======================================== */
@media (max-width: 480px) {
  
  /* Landing Page */
  .hero h1 {
    font-size: 1.6rem;
  }
  
  .hero p {
    font-size: 0.9rem;
  }
  
  .feature h2 {
    font-size: 1.3rem;
  }
  
  .feature p {
    font-size: 0.9rem;
  }
  
  /* App Cards - Single Column */
  .basemesh-cards,
  .clothing-cards {
    grid-template-columns: 1fr !important;
  }
  
  /* Smaller Touch Targets */
  button {
    min-height: 44px; /* iOS recommended touch target */
  }
  
  /* Canvas - Smaller on tiny screens */
  .canvas-wrapper {
    height: 40vh !important;
    min-height: 250px;
  }
  
  /* Export Panel */
  .export-panel-content {
    padding: 16px;
  }
  
  /* Plans */
  .plan-card {
    padding: 16px;
  }
  
  .price {
    font-size: 1.5rem;
  }
}

/* ========================================
   LANDSCAPE ORIENTATION (Mobile)
   ======================================== */
@media (max-width: 768px) and (orientation: landscape) {
  
  /* Make canvas larger in landscape */
  .canvas-wrapper {
    height: 70vh !important;
  }
  
  /* Hide some UI elements to maximize canvas space */
  .top-left {
    max-height: 30vh;
    overflow-y: auto;
  }
  
  .top-right {
    max-height: 30vh;
  }
  
  .bottom-panel {
    max-height: 25vh;
  }
}

/* ========================================
   TOUCH DEVICE OPTIMIZATIONS
   ======================================== */
@media (hover: none) and (pointer: coarse) {
  
  /* Larger touch targets */
  .basemesh-card,
  .clothing-card,
  .animation-card,
  .material-card {
    min-height: 44px;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(124, 92, 255, 0.2);
  }
  
  /* Better slider touch targets */
  input[type="range"] {
    height: 30px;
  }
  
  input[type="range"]::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }
  
  input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }
  
  /* Remove hover effects on touch devices */
  .basemesh-card:hover,
  .clothing-card:hover,
  .animation-card:hover {
    transform: none;
  }
  
  /* Prevent text selection during touch interactions */
  .basemesh-cards,
  .clothing-cards,
  .animation-cards {
    -webkit-user-select: none;
    user-select: none;
  }
}

/* ========================================
   PRINT STYLES (Bonus)
   ======================================== */
@media print {
  .site-topbar,
  .top-right-controls,
  .bottom-panel,
  button {
    display: none;
  }
  
  .canvas-wrapper {
    height: auto;
    page-break-inside: avoid;
  }
}
/* ============================================================================
   v0.1.1 UI OVERHAUL - ADD TO style.css
   ============================================================================ */

/* ========================================
   BLEND SHAPE CATEGORIZED PANELS
   ======================================== */

.blend-category {
  background: #1f1f1f;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.blend-category-header {
  display: flex;
  align-items: center;
  padding: 12px;
  cursor: pointer;
  background: #252525;
  transition: background 0.2s;
  user-select: none;
}

.blend-category-header:hover {
  background: #2a2a2a;
}

.blend-category-icon {
  width: 24px;
  height: 24px;
  margin-right: 12px;
  object-fit: contain;
}

.blend-category-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-transform: capitalize;
}

.blend-category-chevron {
  font-size: 14px;
  color: #888;
  transition: transform 0.3s ease;
  font-weight: bold;
}

.blend-category.collapsed .blend-category-chevron {
  transform: rotate(-90deg);
}

.blend-category-content {
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 8px 12px 12px 12px;
}

.blend-category.collapsed .blend-category-content {
  max-height: 0;
  padding: 0 12px;
}

/* Special category (Gender) - highlighted */
.blend-category.special {
  border-color: #7c5cff;
  box-shadow: 0 0 20px rgba(124, 92, 255, 0.2);
}

.blend-category.special .blend-category-header {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.15), rgba(74, 163, 255, 0.08));
}

.blend-category.special .blend-category-name {
  color: #7c5cff;
}

/* ========================================
   BASE MESH CARDS - 2 COLUMN GRID
   ======================================== */

.basemesh-cards {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 12px;
  padding: 12px;
}

/* Animation Cards - Proper Heights */
.animation-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 180px !important;
  max-height: 180px !important;
}

.animation-card .preview-canvas {
  flex: 1;
  min-height: 0;
  height: 130px !important;
  max-height: 130px !important;
  overflow: hidden;
}

.animation-card .animation-name,
.animation-card .base-mesh-name {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.credit-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #7c5cff, #6a4fd9);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(124, 92, 255, 0.5);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 3px;
  pointer-events: none; /* Don't block card clicks */
}

.credit-badge::before {
  content: "💎";
  font-size: 10px;
}

/* ========================================
   ANIMATION CARDS - 2 COLUMN GRID
   ======================================== */

.animation-cards {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 10px;
  padding: 12px;
  max-height: 350px;
  overflow-y: auto;
}

.animation-card {
  min-width: auto !important; /* Remove horizontal scroll min-width */
}

/* ========================================
   CLOTHING CATEGORY BUTTONS WITH ICONS
   ======================================== */

.clothes-category {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  position: relative;
}

.clothes-category .category-name {
  font-weight: 500;
}

.clothes-category .item-count {
  color: #888;
  font-size: 11px;
  font-weight: 400;
  margin-left: -2px;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.clothes-category:hover .item-count {
  opacity: 1;
  color: #aaa;
}

.clothes-category.active .item-count {
  color: #4a9eff;
  opacity: 1;
}

.clothes-category-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: brightness(0.7) grayscale(0.3);
  transition: all 0.3s ease;
}

.clothes-category.active .clothes-category-icon {
  filter: brightness(1) grayscale(0);
}

.clothes-category:hover .clothes-category-icon {
  filter: brightness(1) grayscale(0);
  transform: scale(1.1);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
  .basemesh-cards {
    grid-template-columns: 1fr !important; /* Single column on mobile */
  }
  
  .animation-cards {
    grid-template-columns: 1fr !important;
  }
  
  .blend-category-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
  }
  
  .blend-category-name {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  
.animation-card {
  max-height: 160px !important;
}

.animation-card .preview-canvas {
  height: 120px !important;
  max-height: 120px !important;
}

.credit-badge {
    font-size: 10px;
    padding: 3px 8px;
  }
  
  .clothes-category-icon {
    width: 16px;
    height: 16px;
  }
}

/* Fix: Prevent preview models from rendering outside panel bounds */
#animations-panel {
  overflow: hidden !important;
  position: relative;
}

#basemesh-panel {
  overflow-y: auto;
  overflow-x: hidden;
}

#clothes-items-panel {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  /* position: relative removed - let .panel-right handle positioning */
}

/* Allow scrolling inside panel content, but clip previews */
.basemesh-cards,
.clothes-items,
#animations-list {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-height: 100%;
}


/* Fix: Top bar above preview canvas */
#top-panel {
  z-index: 1000 !important;
}


/* ============================================================================
   ANIMATION CARD STYLES - FINAL (Override all previous rules)
   ============================================================================ */

.animation-card {
  background: #1a1a1a !important;
  border: 2px solid #2a2a2a !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  position: relative !important;
  overflow: hidden !important;
}

.animation-card:hover {
  background: #252525 !important;
  border-color: #3a3a3a !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

.animation-card.active {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.2), rgba(74, 163, 255, 0.15)) !important;
  border-color: #7c5cff !important;
  box-shadow: 0 0 20px rgba(124, 92, 255, 0.4) !important;
}

.animation-card.active::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: #7c5cff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: bold;
  z-index: 100;
}

/* ============================================================================
   MOVED FROM HTML <style> BLOCK
   ============================================================================ */

/* Active card states */
.clothing-card.active,
.clothing-card-none.active {
  border: 2px solid #6c63ff !important;
  box-shadow: 0 0 8px rgba(108, 99, 255, 0.4);
}

.base-mesh-card.active {
  border: 2px solid #6c63ff !important;
  box-shadow: 0 0 8px rgba(108, 99, 255, 0.4);
}

/* Active plan card */
.plan-card.active-plan {
  border: 2px solid #6c63ff !important;
  position: relative;
}

.plan-card.active-plan::before {
  content: "✓ Active";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #6c63ff;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
}

.plan-card.active-plan .plan-btn.disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
}

/* Plan badge next to user button */
#plan-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
  background: #444;
  color: #fff;
}

/* Export panel hover states */
.export-type-card:hover {
  background: #333 !important;
}

.format-btn:hover {
  background: #3a3a3a !important;
}

#final-export-btn:not(:disabled):hover {
  background: #5a53df;
}


/* ============================================================================
   SETTINGS OVERLAY — Centered modal (moved from inline HTML styles)
   ============================================================================ */

#settings-overlay {
  display: none;              /* hidden by default; JS sets display:flex to open */
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  position: fixed;
  inset: 0;
  z-index: 5000;
}

.settings-panel {
  position: relative;
  width: 90%;
  max-width: 520px;
  background: #121212;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  max-height: 90vh;
  overflow-y: auto;
  animation: panelIn 0.3s ease;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #2a2a2a;
}

.settings-header h2 {
  margin: 0;
  font-size: 18px;
  color: #fff;
  font-weight: 600;
}

.settings-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-section {
  padding: 20px;
  background: #1e1e1e;
  border-radius: 8px;
  border: 1px solid #2a2a2a;
}

.settings-section h3 {
  color: #aaa;
  font-size: 11px;
  font-weight: 700;
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.settings-section p {
  color: #888;
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 14px;
}

#settings-email {
  color: #ccc;
  font-size: 14px;
}

#settings-plan {
  color: #6c63ff;
  font-weight: 600;
  font-size: 14px;
}

.settings-btn-danger {
  width: 100%;
  padding: 11px;
  background: #c62828;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.settings-btn-danger:hover {
  background: #e53935;
}

.settings-btn-secondary {
  width: 100%;
  padding: 11px;
  background: #2a2a2a;
  color: #fff;
  border: 1px solid #444;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.settings-btn-secondary:hover {
  background: #333;
}


/* ============================================================================
   EXPORT PANEL — Inline styles promoted to classes
   ============================================================================ */

.export-panel-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: #999;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  line-height: 1;
}

.export-panel-close-btn:hover {
  color: #fff;
}

.export-panel-title {
  color: #fff;
  margin: 0 0 20px;
  font-size: 24px;
}

.export-preview-wrap {
  margin-bottom: 30px;
}

#export-preview-container {
  width: 400px;
  height: 400px;
  border-radius: 8px;
  background: #000;
  margin: 0 auto;
}

.export-section-title {
  color: #fff;
  font-size: 16px;
  margin: 0 0 12px;
}

.export-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.export-type-icon {
  font-size: 18px;
  margin-bottom: 8px;
}

.export-type-name {
  color: #fff;
  font-size: 14px;
  margin: 0 0 8px;
}

.export-type-desc {
  color: #888;
  font-size: 12px;
  margin: 0 0 10px;
}

.export-type-cost-paid {
  color: #6c63ff;
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}

.export-type-cost-free {
  color: #0f0;
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}

.export-format-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.export-format-note {
  color: #888;
  font-size: 12px;
  margin-top: 10px;
  text-align: center;
}

.format-label-sub {
  font-size: 11px;
  color: #888;
}

/* Randomizer loading overlay content */
.randomizer-loading-content {
  text-align: center;
}

.randomizer-loading-content h2 {
  color: #fff;
  font-size: 24px;
  margin: 0 0 10px;
}

.randomizer-loading-content p {
  color: #aaa;
  font-size: 14px;
}

.spinner-wrap {
  margin: 0 auto 20px;
}

/* Material panel inline selects/labels */
.material-select {
  width: 100%;
  padding: 8px;
  background: #2a2a2a;
  color: #fff;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.create-texture-btn {
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  background: #3a3a3a;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
}

.create-texture-btn:hover {
  background: #4a4a4a;
}

#resolution-upgrade-hint {
  font-size: 11px;
  color: #888;
  margin: 6px 0 0 0;
  display: none;
}

.material-prop-label {
  font-size: 12px;
  color: #aaa;
  display: block;
  margin-bottom: 4px;
}

.material-prop-row {
  margin-bottom: 12px;
}

.material-prop-range {
  width: 100%;
  cursor: pointer;
}

/* Clothes panel heading */
.panel-heading {
  margin-top: 0;
  color: #fff;
  font-size: 14px;
}

/* Reset texture button in painter */
#reset-texture-btn {
  background: #ff5555;
  margin-top: 12px;
}

/* App brand clickable */
.app-brand-link {
  cursor: pointer;
}

/* Launch list color override for unavailable feature */
.launch-feature-unavailable {
  color: #888;
}


/* Export section spacing */
.export-section {
  margin-bottom: 25px;
}

/* Final export button base styles */
.final-export-btn {
  width: 100%;
  padding: 15px;
  background: #6c63ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0.5;
  cursor: not-allowed;
}

.final-export-btn:not(:disabled) {
  opacity: 1;
  cursor: pointer;
}

/* Panel loading/placeholder text */
.panel-loading-text {
  color: #bbb;
  font-size: 13px;
  padding: 16px;
}

/* Preset Overlay - Full Screen */
.preset-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  overflow-y: auto;
}

.preset-overlay.hidden {
  display: none;
}

/* Preset Panel */
.preset-panel {
  background: #1a1a1a;
  border-radius: 16px;
  width: 100%;
  max-width: 1400px;
  padding: 40px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Close Button */
.preset-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: #999;
  font-size: 32px;
  cursor: pointer;
  padding: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
  z-index: 10;
}

.preset-close:hover {
  background: #333;
  color: #fff;
}

/* Header */
.preset-header {
  text-align: center;
  margin-bottom: 40px;
}

.preset-header h1 {
  font-size: 36px;
  margin: 0 0 12px 0;
  color: #fff;
  font-weight: 600;
}

.preset-header p {
  font-size: 16px;
  color: #999;
  margin: 0;
}

/* Carousel Container */
.preset-carousel-container {
  position: relative;
  margin-bottom: 30px;
}

/* Carousel */
.preset-carousel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  padding: 20px 60px;
  min-height: 400px;
}

/* Preset Card - Matches existing card style */
.preset-card {
  background: #222;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  height: 280px;
}

.preset-card:hover {
  transform: translateY(-4px);
  border-color: #6c63ff;
  box-shadow: 0 8px 24px rgba(108, 99, 255, 0.3);
}

.preset-card.active {
  border-color: #6c63ff;
  background: #2a2a2a;
}

.preset-thumbnail {
  width: 100%;
  height: 180px;
  background: #1a1a1a;
  border-radius: 8px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.preset-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preset-thumbnail .preview-canvas {
  width: 100%;
  height: 100%;
}

.preset-no-preview {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 14px;
}

/* Premium Badge */
.preset-premium-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #000;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

/* Preset Info */
.preset-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preset-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  line-height: 1.3;
}

.preset-description {
  font-size: 12px;
  color: #999;
  text-align: center;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.preset-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-top: 4px;
}

.preset-tag {
  padding: 2px 8px;
  background: #333;
  border-radius: 10px;
  font-size: 10px;
  color: #aaa;
}

/* Navigation Arrows */
.preset-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #2a2a2a;
  border: 2px solid #444;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
  color: #fff;
}

.preset-arrow:hover:not(:disabled) {
  background: #6c63ff;
  border-color: #6c63ff;
  transform: translateY(-50%) scale(1.1);
}

.preset-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.preset-arrow-left {
  left: 0;
}

.preset-arrow-right {
  right: 0;
}

/* Page Indicators */
.preset-indicators {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 30px;
}

.preset-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #444;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-indicator.active {
  background: #6c63ff;
  width: 24px;
  border-radius: 4px;
}

.preset-indicator:hover {
  background: #666;
}

/* Actions */
.preset-actions {
  text-align: center;
  margin-bottom: 20px;
}

.preset-scratch-btn {
  padding: 14px 40px;
  background: linear-gradient(135deg, #6c63ff, #5a52d5);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-scratch-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4);
}

/* Footer */
.preset-footer {
  text-align: center;
}

.preset-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #999;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.preset-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #6c63ff;
}

.preset-checkbox:hover {
  color: #fff;
}

/* Loading State */
.preset-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 16px;
}

/* Empty State */
.preset-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.preset-empty p {
  margin: 8px 0;
  font-size: 14px;
}

/* Preset Button in Top Panel */
.preset-top-btn {
  /* Inherits from .top-btn - no extra styles needed */
}

/* Responsive */
@media (max-width: 1200px) {
  .preset-carousel {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .preset-panel {
    padding: 30px 20px;
  }

  .preset-header h1 {
    font-size: 28px;
  }

  .preset-carousel {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    padding: 20px 40px;
    gap: 15px;
  }

  .preset-card {
    height: 240px;
  }

  .preset-thumbnail {
    height: 140px;
  }

  .preset-arrow {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .preset-carousel {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .preset-arrow {
    display: none;
  }
}

/* Animation for card entrance */
@keyframes preset-fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.preset-card {
  animation: preset-fade-in 0.3s ease-out;
}

/* Scrollbar styling */
.preset-overlay::-webkit-scrollbar {
  width: 10px;
}

.preset-overlay::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.preset-overlay::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 5px;
}

.preset-overlay::-webkit-scrollbar-thumb:hover {
  background: #555;
}