/* Alien Rockstar Studio — styles specific to the character-creator page.
   Reuses shared tokens/classes from styles.css (pill-button, mode-button,
   brush-size-row, toolbar, palette, crayon, canvas-card) for visual parity
   with the coloring app. */

.studio-logo {
  width: 100%;
  max-width: 22rem;
  height: auto;
  filter: drop-shadow(0 0 8px rgba(255, 46, 136, 0.35));
}

.app-switcher {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.app-switcher .switch-link {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  background: #221F3D;
  color: #B7B6D6;
  border: 1px solid #3A3760;
  border-radius: 9999px;
  padding: 0.4rem 0.9rem;
}

.app-switcher .switch-link.active {
  background: #FF2E88;
  color: #FFFFFF;
  border-color: transparent;
}

.studio-stage-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  width: 100%;
  max-width: 25rem;
  margin: 0 auto;
}

.studio-canvas-card {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  margin-bottom: 0;
  background: rgba(22, 19, 41, 0.78);
  border: 1px solid #3A3760;
}

#stage {
  width: 100%;
  height: auto;
  aspect-ratio: 1000 / 1648;
  border-radius: 0.75rem;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

.tool-rail {
  flex: 0 0 68px;
  width: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(22, 19, 41, 0.78);
  border: 1px solid #3A3760;
  border-radius: 1rem;
  overflow: hidden;
}

.tool-rail-scroll {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 4px 0 6px;
  box-sizing: border-box;
  scrollbar-width: none;
}

.tool-rail-scroll::-webkit-scrollbar {
  display: none;
}

.tool-rail .rail-title {
  margin: 0 0 2px;
  width: 100%;
}

.tool-rail .mode-toggle-vertical {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 0 6px;
  box-sizing: border-box;
}

.tool-rail .mode-button {
  width: 100%;
  min-width: 0;
  display: block;
  background: none;
  border: none;
  border-radius: 0.6rem;
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s ease;
}

.tool-rail .mode-button img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.6rem;
}

.tool-rail .mode-button:active {
  transform: scale(0.92);
}

.tool-rail .mode-button.active {
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.95))
          drop-shadow(0 0 9px rgba(255, 46, 136, 0.75));
  transform: scale(1.08);
}

.tool-rail .brush-size-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 0 0;
  border-left: none;
  border-top: 1px solid #3A3760;
}

.tool-rail .brush-size-row[hidden] {
  display: none;
}

.tool-rail .brush-size-btn {
  width: 26px;
  height: 26px;
}

.tool-rail .rail-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 0;
  border-top: 1px solid #3A3760;
  width: 100%;
  box-sizing: border-box;
}

.tool-rail .rail-action-btn {
  width: 100%;
  display: block;
  background: none;
  border: none;
  border-radius: 0.55rem;
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s ease;
}

.tool-rail .rail-action-btn img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.55rem;
}

.tool-rail .rail-action-btn:active {
  transform: scale(0.92);
}

.picker-sidebar {
  flex: 0 0 64px;
  width: 64px;
  display: flex;
  flex-direction: column;
  background: rgba(22, 19, 41, 0.78);
  border: 1px solid #3A3760;
  border-radius: 1rem;
  overflow: hidden;
}

.scroll-hint {
  flex: 0 0 auto;
  background: none;
  border: none;
  color: #3FE1D0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0;
  cursor: pointer;
}

.picker-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 0.4rem;
  scrollbar-width: thin;
}

.category {
  margin-bottom: 0.75rem;
}

.section-title {
  font-weight: 700;
  font-size: 0.75rem;
  color: #3FE1D0;
  margin: 0.5rem 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.opt-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: block;
  transition: transform 0.12s ease, filter 0.15s ease;
}

.opt-btn img {
  width: 100%;
  height: auto;
  display: block;
}

.opt-btn.selected {
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.95))
          drop-shadow(0 0 10px rgba(255, 46, 136, 0.7));
  transform: scale(1.06);
}

.opt-btn:active {
  transform: scale(0.96);
}

/* 4-color cycle applied per option via JS (chip-0..chip-3) */
.chip-0 { --chip-color: #FF2E88; --chip-glow: rgba(255, 46, 136, 0.55); --chip-fill: rgba(255, 46, 136, 0.3); }
.chip-1 { --chip-color: #3FEBD8; --chip-glow: rgba(63, 235, 216, 0.5); --chip-fill: rgba(63, 235, 216, 0.28); }
.chip-2 { --chip-color: #1092FD; --chip-glow: rgba(16, 146, 253, 0.5); --chip-fill: rgba(16, 146, 253, 0.3); }
.chip-3 { --chip-color: #7831FD; --chip-glow: rgba(120, 49, 253, 0.5); --chip-fill: rgba(120, 49, 253, 0.32); }

@media (min-width: 640px) {
  .studio-stage-row {
    max-width: 30rem;
  }
  .picker-sidebar {
    flex-basis: 80px;
    width: 80px;
  }
}


/* ---- Share window ---- */
.share-preview {
  display: block;
  width: 100%;
  max-width: 220px;
  margin: 0 auto 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid #3A3760;
  background: #16132a;
}

.share-native-btn {
  width: 100%;
  margin-bottom: 0.5rem;
}

.share-download-btn {
  width: 100%;
  margin-bottom: 0.9rem;
  background: #221F3D;
  color: #EDEBFF;
  border: 1px solid #3A3760;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.6rem 1rem;
  cursor: pointer;
}
.share-download-btn:active { transform: scale(0.98); }

.share-section-label {
  font-size: 0.75rem;
  color: #9B98C4;
  text-align: center;
  margin: 0 0 0.6rem;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.share-btn {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: #FFFFFF;
  border: none;
  border-radius: 0.6rem;
  padding: 0.6rem 0.5rem;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease;
}
.share-btn:active { transform: scale(0.96); }
.share-btn:hover { filter: brightness(1.1); }
.share-facebook { background: #1877F2; }
.share-x        { background: #000000; border: 1px solid #3A3760; }
.share-reddit   { background: #FF4500; }
.share-threads  { background: #101010; border: 1px solid #3A3760; }
.share-instagram { background: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF, #515BD4); }
.share-pinterest{ background: #E60023; }

/* ---- Coloring Book: reuse the Studio tool rail beside the white coloring canvas ---- */
.studio-stage-row .canvas-card {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  margin-bottom: 0;
}
.cb-stage-row {
  flex-direction: row-reverse;
  margin-bottom: 0.65rem;
}

/* ---- Canvas zoom viewport (magnifies only the canvas) ---- */
.canvas-viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  border-radius: 0.75rem;
  line-height: 0;
  touch-action: none;
}
.canvas-viewport canvas {
  display: block;
  width: 100%;
}
.zoom-reset-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #3A3760;
  background: rgba(22, 19, 41, 0.85);
  color: #7EE9D0;
  font-size: 18px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  padding: 0;
}
.zoom-reset-btn:active { transform: scale(0.92); }

/* ---- Locked (Backstage) option styling ---- */
.opt-btn.locked { position: relative; }
.opt-btn.locked img { opacity: 0.4; filter: grayscale(0.5); }
.opt-btn .opt-lock {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.72rem;
  line-height: 1;
  filter: drop-shadow(0 0 2px #000);
  pointer-events: none;
}
.scene-toggle.locked { opacity: 0.7; }
