#studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  height: 100vh;
  min-height: 100vh;
  background: #e7eef6;
  color: #1c1c1c;
  font-family: Inter, Arial, Helvetica, sans-serif;
}

#studio img {
  margin: 0;
}

#studio h1,
#studio h2,
#studio p {
  margin: 0;
  text-align: left;
}

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 28px 40px 24px;
  background: linear-gradient(180deg, #f7f9fc 0%, #e4edf6 55%, #d3e3f1 100%);
}

.stage::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  pointer-events: none;
  background:
    radial-gradient(300px 130px at 124px 56px, rgba(92, 136, 182, 0.62) 0%, rgba(120, 160, 198, 0.42) 60%, rgba(186, 208, 226, 0.12) 84%, transparent 100%),
    radial-gradient(170px 96px at 310px 14px, rgba(176, 202, 224, 0.45), transparent 72%),
    radial-gradient(80px 64px at 18px 96px, rgba(232, 240, 246, 0.55), transparent 74%),
    linear-gradient(180deg, rgba(176, 200, 220, 0.22) 0%, rgba(247, 249, 252, 0) 100%);
}

.stage > * {
  position: relative;
  z-index: 1;
}

.stage > img,
.stage > span {
  align-self: flex-start;
}

.stage-copy {
  margin-top: 28px;
  text-align: center;
}

#studio .stage-copy h1 {
  margin-bottom: 20px !important;
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 650;
  letter-spacing: -0.03em;
  text-align: left;
}

.stage-copy p {
  font-size: 20px;
  font-weight: 400;
  text-align: center;
  color: #3a3a3a;
}

.gem-stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  cursor: grab;
  touch-action: none;
}

.gem-stage.is-turning {
  cursor: grabbing;
}

.gem-floor {
  position: absolute;
  left: 50%;
  bottom: 16%;
  width: 220px;
  height: 36px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(42, 68, 92, 0.46) 0%, rgba(42, 68, 92, 0.16) 46%, transparent 72%);
  pointer-events: none;
}

.gem-tilt {
  width: min(430px, 88%);
  transform-origin: 50% 46%;
  animation: gem-settle 0.55s cubic-bezier(0.16, 0.84, 0.28, 1);
}

.pavilion {
  opacity: 0;
  transition: opacity 0.45s cubic-bezier(0.16, 0.84, 0.32, 1);
}

.gem-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  transform: perspective(640px) rotateX(14deg) rotateY(0deg);
  transform-origin: 50% 42%;
  filter: drop-shadow(0 22px 14px rgba(48, 74, 98, 0.28)) drop-shadow(0 8px 6px rgba(36, 58, 78, 0.18));
  transition: transform 0.45s cubic-bezier(0.16, 0.84, 0.32, 1);
}

.table-glint {
  animation: table-glint 3.4s ease-out infinite;
}

.spec-rest {
  opacity: 0.35;
}

.twinkle-late {
  animation-delay: 1.4s;
}

.facet-spark {
  animation-duration: 3.6s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}

.gleam-0 { animation-name: gleam-0; }
.gleam-1 { animation-name: gleam-1; }
.gleam-2 { animation-name: gleam-2; }
.gleam-3 { animation-name: gleam-3; }

.facet-spark.d1 { animation-delay: 0.45s; }
.facet-spark.d2 { animation-delay: 1.6s; }
.facet-spark.d3 { animation-delay: 0.2s; }
.facet-spark.d4 { animation-delay: 2.5s; }
.facet-spark.d5 { animation-delay: 1.05s; }
.facet-spark.d6 { animation-delay: 3.05s; }
.facet-spark.d7 { animation-delay: 2.05s; }

.twinkle {
  transform-box: fill-box;
  transform-origin: center;
  animation: spark 3.4s ease-out infinite;
}

.gem-shape-label {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #3b84c2;
}

.stage-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 8px 12px 4px 36px;
}

.kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.spec {
  margin-top: 4px;
  max-width: 28rem;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 560;
  line-height: 1.25;
}

.rarity {
  max-width: 240px;
  text-align: right;
}

.rarity .kicker,
.rarity .ratio,
.rarity .rarity-note {
  text-align: right;
}

.rarity-label {
  color: #3b84c2;
}

.ratio {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 700;
}

.rarity-note {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.4;
  color: #5c6570;
}

#studio .accordion {
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: 0 0 24px;
  background: #fff;
  border-left: 1px solid #e6e6e6;
  overflow: auto;
}

#studio .accordion .header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 22px 28px;
  background: #fff;
  border: 0;
  border-bottom: 1.5px solid #f2f2f2;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

#studio .accordion .content.open {
  background: #eef1f6;
}

#studio .shape-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  padding: 16px 18px 6px;
}

#studio .shape-grid button {
  height: 40px;
  border: 1.5px solid transparent;
  border-radius: 6px;
  background: #fff;
  color: #1c1c1c;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

#studio .shape-grid button.is-selected {
  border-color: #3b84c2;
  background: #f2faff;
  color: #245f91;
}

#studio .carousel-card.has-label img {
  display: none;
}

#studio .carousel-card.has-label {
  width: 72px;
  height: 44px;
  border-radius: 6px;
}

#studio .carousel-card__label {
  font-size: 12px;
}

#studio .clear-button {
  padding: 16px 22px 8px;
}

#studio .footnote {
  position: static;
  width: auto;
  box-shadow: none;
  padding: 16px 22px 8px;
  color: #888;
  font-size: 11px;
  line-height: 1.45;
}

@keyframes gleam-0 {
  0%,
  14%,
  100% { fill: #d0dbe8; }
  32% { fill: #fafbfc; }
  50% { fill: #d7e0ed; }
  70% { fill: #dfe7ee; }
}

@keyframes gleam-1 {
  0%,
  14%,
  100% { fill: #d7e0ed; }
  32% { fill: #d0dbe8; }
  50% { fill: #fafbfc; }
  70% { fill: #dfe7ee; }
}

@keyframes gleam-2 {
  0%,
  14%,
  100% { fill: #dfe7ee; }
  32% { fill: #d7e0ed; }
  50% { fill: #d0dbe8; }
  70% { fill: #fafbfc; }
}

@keyframes gleam-3 {
  0%,
  14%,
  100% { fill: #fafbfc; }
  32% { fill: #dfe7ee; }
  50% { fill: #d0dbe8; }
  70% { fill: #d7e0ed; }
}

@keyframes gem-settle {
  from {
    transform: translateY(8px) scale(0.98);
  }
  to {
    transform: none;
  }
}

@keyframes table-glint {
  0%,
  68%,
  100% {
    opacity: 0.12;
  }
  76% {
    opacity: 0.95;
  }
  84% {
    opacity: 0.15;
  }
}

@keyframes spark {
  0%,
  70%,
  100% {
    opacity: 0;
  }
  78% {
    opacity: 1;
  }
  86% {
    opacity: 0.2;
  }
  92% {
    opacity: 0.9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gem-tilt,
  .table-glint,
  .twinkle,
  .facet-spark {
    animation: none;
  }

  .gem-svg {
    transition: none;
  }

  .table-glint,
  .twinkle {
    opacity: 0.2;
  }
}

@media (max-width: 860px) {
  #studio {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  .stage {
    height: auto;
    min-height: auto;
    overflow: visible;
    padding: 20px 20px 12px;
  }

  #studio .accordion {
    height: auto;
  }

  .stage-foot {
    padding-left: 0;
    flex-direction: column;
    align-items: flex-start;
  }

  .rarity,
  .rarity .kicker,
  .rarity .ratio,
  .rarity .rarity-note {
    text-align: left;
  }
}
