/* Studio features on the storefront theme: Arcade patterns and products, Meshy characters and
   sticker sheets, the 3D twin viewer. Tokens come from theme.css. */

/* Design canvas layers */
.arcade-pattern,
.sticker-preview {
  position: absolute;
  z-index: 1;
}
.arcade-pattern {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sticker-preview {
  inset: 8%;
  width: 84%;
  height: 84%;
  object-fit: contain;
  /* A white keyline reads as a die-cut edge. */
  filter: drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff)
    drop-shadow(0 6px 10px rgba(31, 36, 64, 0.22));
}
.portrait-canvas:not(.sticker-mode) .sticker-preview,
.portrait-canvas.sticker-mode .arcade-pattern,
.portrait-canvas.lettering-mode .arcade-pattern,
.portrait-canvas.lettering-mode .sticker-preview {
  display: none;
}

.arcade-reference {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: #fff;
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
}
.arcade-reference input {
  margin-top: 2px;
  accent-color: var(--ink);
}
.arcade-reference small {
  display: block;
  color: var(--muted-2);
  font-size: 12px;
  margin-top: 2px;
}
.arcade-status.ok {
  color: var(--mint);
}
.arcade-status.warn {
  color: #8a5a00;
}
.arcade-status.error {
  color: #a84428;
}
.arcade-status a,
.arcade-shop-note a,
.cubby-note a {
  color: inherit;
  font-weight: 700;
}
.arcade-spinner {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -1px;
  animation: pa-spin 0.8s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .arcade-spinner,
  .spinner {
    animation: none;
  }
}
.saved-designs .arcade-design.failed {
  color: #a84428;
}
.pattern-reference {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1.5px dashed var(--ink);
  border-radius: 14px;
  font-size: 13px;
}
.pattern-reference img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.pattern-reference span {
  flex: 1;
}
.pattern-reference button {
  border: 0;
  background: none;
  font-size: 18px;
  cursor: pointer;
}

/* Sticker sheet options */
.sheet-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sheet-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sheet-sources button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--hair);
  background: #fff;
  border-radius: 999px;
  padding: 4px 14px 4px 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.sheet-sources button img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 50%;
  background: var(--cream);
}
.sheet-sources button.active {
  border-color: var(--ink);
}
.sheet-theme {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.sheet-theme small {
  font-weight: 400;
  color: var(--muted-2);
  letter-spacing: 0;
}
.sheet-theme input {
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  background: #fff;
}

/* Gallery: characters, sticker sheets and lettering */
.sticker-pack.empty {
  display: none;
}
.sticker-pack-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.sticker-pack-head p:not(.eyebrow) {
  max-width: 420px;
  margin: 0;
  line-height: 1.65;
  color: var(--muted);
}
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.sticker-card {
  margin: 0;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 24px;
  overflow: hidden;
}
.sticker-card.sheet {
  grid-column: span 2;
}
.sticker-art {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: repeating-conic-gradient(#fff4e6 0 25%, #fffaf2 0 50%) 0 0 / 18px 18px;
  font: 500 32px var(--serif);
  color: #a84428;
}
.sticker-card.sheet .sticker-art {
  aspect-ratio: 2 / 1;
}
.sticker-art img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff)
    drop-shadow(0 4px 6px rgba(31, 36, 64, 0.2));
}
.sticker-card figcaption {
  padding: 14px 16px 16px;
  border-top: 2px solid var(--ink);
}
.sticker-card figcaption b,
.sticker-card figcaption small {
  display: block;
}
.sticker-card figcaption b {
  font-size: 15px;
}
.sticker-card figcaption small {
  color: var(--muted-2);
  font-size: 12.5px;
  margin-top: 3px;
}
.sticker-card figcaption span {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
}
.sticker-card figcaption a,
.sticker-card figcaption button {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sticker-card figcaption a:hover,
.sticker-card figcaption button:hover {
  color: var(--tangerine);
}
.sticker-card.failed figcaption small {
  color: #a84428;
}

/* Made with Arcade panel (shop) */
.arcade-shop {
  margin-top: 72px;
  background: var(--paper);
  border-radius: 28px;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid rgba(31, 36, 64, 0.1);
}
.arcade-shop-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 26px;
}
.arcade-shop-head .eyebrow {
  margin-bottom: 12px;
}
.arcade-shop-head h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: -0.03em;
  line-height: 1;
}
.arcade-shop-note {
  margin: 0;
  color: var(--muted-2);
  max-width: 360px;
  line-height: 1.5;
  font-size: 13px;
}
.arcade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.arcade-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  border-radius: 16px;
  padding: 10px;
  border: 1px solid rgba(31, 36, 64, 0.08);
}
.arcade-card-art {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: repeating-linear-gradient(135deg, rgba(31, 36, 64, 0.05) 0 1px, transparent 1px 12px), var(--cream);
  display: grid;
  place-items: center;
}
.arcade-card-art span {
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(31, 36, 64, 0.55);
}
.arcade-card-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.arcade-card-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 4px;
  flex: 1;
}
.arcade-card-copy b {
  font-size: 14px;
}
.arcade-card-copy small {
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.4;
}
.arcade-card-copy em {
  font-style: normal;
  font-weight: 700;
  font-size: 14px;
  margin-top: 2px;
}
/* Make / making / ready buttons, shared with the Cubby. */
.arcade-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 11px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}
.arcade-btn.ink {
  background: var(--ink);
  color: #fff;
}
.arcade-btn.ink:hover {
  background: var(--tangerine);
  color: #fff;
}
.arcade-btn.soft {
  background: var(--cream);
  color: var(--ink);
}
.arcade-btn.soft:disabled {
  color: var(--muted-2);
  cursor: default;
}
.arcade-btn.ready {
  background: var(--mint);
  color: #fff;
}
.arcade-btn.ready:hover {
  background: var(--ink);
  color: #fff;
}

/* 3D twin viewer */
.twin-model {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: #bfe6ff;
}
.twin-model model-viewer {
  width: 100%;
  height: 100%;
  --poster-color: transparent;
}
.twin-model-error {
  margin: 0;
  padding: 60px 24px;
  font-size: 12px;
  color: #a84428;
}

@media (max-width: 560px) {
  .sticker-card.sheet {
    grid-column: auto;
  }
  .sticker-card.sheet .sticker-art {
    aspect-ratio: 1;
  }
}
