:root {
  color-scheme: light;
  --bg: #fff2f7;
  --bg-2: #ffe7f2;
  --ink: #3d2431;
  --muted: #7a5669;
  --primary: #ff5ca8;
  --primary-dark: #e84a95;
  --accent: #ff9ac7;
  --accent-strong: #ff4f9a;
  --card: #fffafb;
  --card-2: #fff1f7;
  --border: #f2cfe0;
  --shadow: 0 18px 40px rgba(255, 96, 160, 0.18);
  --shadow-soft: 0 10px 24px rgba(255, 96, 160, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Nunito", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 198, 225, 0.55), transparent 45%),
    radial-gradient(circle at 85% 10%, rgba(255, 231, 242, 0.7), transparent 40%),
    linear-gradient(180deg, var(--bg) 0%, #fff6fb 55%, #ffffff 100%);
  min-height: 100vh;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 28px 36px;
  position: relative;
  background: rgba(255, 250, 252, 0.94);
  border: 1px solid rgba(242, 207, 224, 0.8);
  border-radius: 28px;
  box-shadow: 0 28px 60px rgba(255, 120, 180, 0.18);
  backdrop-filter: blur(2px);
}

.page::before {
  content: "";
  position: absolute;
  inset: 40px 24px auto auto;
  width: 240px;
  height: 240px;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 154, 199, 0.4) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 40%, rgba(255, 214, 234, 0.55) 0 2px, transparent 3px),
    radial-gradient(circle at 40% 70%, rgba(255, 154, 199, 0.35) 0 2px, transparent 3px);
  background-size: 36px 36px;
  opacity: 0.6;
  border-radius: 50%;
  pointer-events: none;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  padding: 20px 24px;
  border: 1px solid rgba(242, 207, 224, 0.8);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 238, 246, 0.95), rgba(255, 255, 255, 0.95));
  animation: floatIn 0.7s ease both;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--accent-strong);
  background: rgba(255, 154, 199, 0.2);
  border: 1px solid rgba(255, 154, 199, 0.45);
  padding: 6px 14px;
  border-radius: 999px;
  margin: 0 0 14px;
}

.hero h1 {
  font-family: "Fredoka", "Trebuchet MS", sans-serif;
  font-size: clamp(2.6rem, 3.4vw, 3.6rem);
  color: var(--accent-strong);
  letter-spacing: 0.01em;
  margin: 0 0 8px;
}

.subhead {
  max-width: 520px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
  font-size: 1.02rem;
}

.hero-card {
  background: var(--card-2);
  border: 1px solid rgba(242, 207, 224, 0.8);
  border-radius: var(--radius);
  padding: 18px 20px;
  max-width: 300px;
  box-shadow: var(--shadow-soft);
}

.hero-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}

.closet,
.preview {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 24px;
  animation: floatIn 0.7s ease both;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.closet {
  background: linear-gradient(180deg, rgba(255, 246, 250, 0.98), rgba(255, 255, 255, 0.98));
}

.closet-title {
  margin: 0 0 16px;
  text-align: center;
  font-family: "Fredoka", "Trebuchet MS", sans-serif;
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  color: var(--accent-strong);
}

.preview-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.preview {
  background: linear-gradient(180deg, rgba(255, 244, 250, 0.95), rgba(255, 255, 255, 0.98));
}

.token-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.token-link {
  text-decoration: none;
  min-width: 140px;
  text-align: center;
  font-family: "Nunito", "Trebuchet MS", sans-serif;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  border: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.token-link:active {
  transform: translateY(1px);
}

.token-primary {
  background: linear-gradient(135deg, #ff6aa9, #ff8ec8);
  color: #fff;
  box-shadow: 0 12px 24px rgba(255, 92, 168, 0.35);
}

.token-primary:hover {
  background: linear-gradient(135deg, #ff5ca8, #ff7fbf);
}


.preview {
  animation-delay: 0.08s;
}

.closet-header,
.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.closet h2,
.preview h2 {
  margin: 0 0 6px;
  font-size: 1.4rem;
  font-family: "Fredoka", "Trebuchet MS", sans-serif;
  color: #412231;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

button {
  font-family: inherit;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

button:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

button:active {
  transform: translateY(1px);
}

button.primary {
  background: linear-gradient(135deg, #ff6aa9, #ff8ec8);
  color: #fff;
  box-shadow: 0 12px 24px rgba(255, 92, 168, 0.35);
}

button.primary:hover {
  background: linear-gradient(135deg, #ff5ca8, #ff7fbf);
}

button.ghost {
  background: #fff;
  border: 1px solid rgba(242, 207, 224, 0.9);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0;
  justify-content: center;
}

.closet-rail .tabs {
  position: relative;
  z-index: 1;
  margin-top: 6px;
}

.closet-rail {
  position: relative;
  padding: 18px 16px 14px;
  border-radius: 18px;
  border: 1px solid rgba(242, 207, 224, 0.85);
  background: linear-gradient(180deg, rgba(255, 251, 253, 0.96), rgba(255, 238, 246, 0.96));
  box-shadow: var(--shadow-soft);
  margin-bottom: 16px;
}


.closet-shelf {
  position: relative;
  padding: 18px 16px 28px;
  border-radius: 20px;
  border: 1px solid rgba(242, 207, 224, 0.85);
  background: #fff;
  box-shadow: var(--shadow-soft);
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.closet-shelf .items {
  position: relative;
  z-index: 1;
  padding-bottom: 6px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-height: 260px;
}


.tab {
  border: 1px solid rgba(242, 207, 224, 0.9);
  background: var(--card-2);
  padding: 10px 16px 9px;
  border-radius: 14px;
  font-weight: 700;
  color: var(--muted);
  appearance: none;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: 0 8px 16px rgba(255, 120, 180, 0.12);
}

.tab.active {
  border-color: var(--primary);
  color: var(--accent-strong);
  background: #fff;
  box-shadow: 0 10px 18px rgba(255, 92, 168, 0.2);
}

.rack-view {
  width: 100%;
  max-width: 520px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 18px;
}

.rack-nav {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(242, 207, 224, 0.95);
  background: #fff;
  color: var(--accent-strong);
  font-size: 1.9rem;
  line-height: 1;
  box-shadow: var(--shadow-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rack-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.rack-item {
  width: 100%;
  max-width: 340px;
  justify-self: center;
}

.rack-actions {
  width: 100%;
  display: flex;
  justify-content: center;
}

.rack-remove {
  padding: 8px 18px;
}

.item {
  border: 1px solid rgba(242, 207, 224, 0.95);
  border-radius: 18px;
  padding: 10px;
  background: #fff;
  display: grid;
  gap: 8px;
  justify-items: center;
  cursor: pointer;
  appearance: none;
  text-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border 0.18s ease;
  animation: popIn 0.3s ease both;
  position: relative;
  overflow: hidden;
}

.item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
}

.item.selected {
  border-color: var(--primary);
  box-shadow: 0 12px 24px rgba(255, 92, 168, 0.25);
}

.item img {
  width: 100%;
  height: 92px;
  object-fit: contain;
  border-radius: 12px;
}

.item.rack-item img {
  height: 220px;
}

.item-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 214, 234, 0.55);
  border: 1px solid rgba(255, 154, 199, 0.45);
}

.canvas-wrap {
  border-radius: 24px;
  border: 2px solid rgba(255, 170, 210, 0.6);
  padding: 16px;
  background: linear-gradient(135deg, rgba(255, 233, 244, 0.75), rgba(255, 255, 255, 0.98));
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.6);
  position: relative;
  overflow: hidden;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#pfpCanvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(255, 92, 168, 0.18);
  max-height: 100%;
}

code {
  font-family: "Courier New", monospace;
  font-size: 0.95em;
  background: rgba(255, 92, 168, 0.12);
  padding: 2px 6px;
  border-radius: 8px;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .page::before {
    display: none;
  }
}

@media (max-width: 600px) {
  .page {
    padding: 20px 16px 28px;
    border-radius: 20px;
  }

  button {
    flex: 1;
  }

  .rack-view {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 12px;
  }

  .rack-nav {
    width: 40px;
    height: 40px;
    font-size: 1.6rem;
  }

  .item.rack-item img {
    height: 170px;
  }
}
