html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ffd23f;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.sg__defs {
  position: absolute;
  width: 0;
  height: 0;
}

.sg {
  box-sizing: border-box;
  width: 100%;
  align-self: stretch;
  align-content: start;
  padding-top: 32px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.sg__card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(23, 20, 26, 0.16);
  border-radius: 16px;
  background: #ffffff;
}

.sg__thumb {
  display: block;
  height: 48px;
  border-radius: 8px;
}

.sg__thumb--a {
  background: linear-gradient(150deg, #0a4fe8, #6ec8ff);
}

.sg__thumb--b {
  background: linear-gradient(150deg, #c93000, #ffd23f);
}

.sg__thumb--c {
  background: linear-gradient(150deg, #b9a0ff, #4cd4a6);
}

.sg__name {
  margin: 0;
  color: #17141a;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.3;
}

.sg__price {
  margin: 0;
  color: #0a4fe8;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
}

.sg__more {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid #2f6df6;
  border-radius: 12px;
  background: #ffffff;
  color: #17141a;
  cursor: pointer;
}

.sg__more:focus-visible {
  outline: 2px solid #17141a;
  outline-offset: 2px;
}

.sg__label {
  font-weight: 700;
  font-size: 10px;
  line-height: 1.4;
}

.sg__caret {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  color: #2f6df6;
  rotate: 0deg;
  transition: rotate 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sg__grow {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sg__inner {
  overflow: hidden;
  min-height: 0;
}

.sg__card.is-open .sg__grow {
  grid-template-rows: 1fr;
}

.sg__card.is-open .sg__caret {
  rotate: 180deg;
}

.sg__spec {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding-top: 4px;
}

.sg__pair {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
}

.sg__key {
  color: rgba(23, 20, 26, 0.72);
  font-weight: 500;
  font-size: 10px;
  line-height: 1.3;
}

.sg__val {
  margin: 0;
  color: #17141a;
  font-weight: 700;
  font-size: 10px;
  line-height: 1.3;
}

.sg.is-demo .sg__card--pick .sg__grow,
.sg.is-demo .sg__card--pick .sg__caret {
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

.sg.is-demo .sg__card--pick .sg__grow {
  animation-name: sgGrow;
}

.sg.is-demo .sg__card--pick .sg__caret {
  animation-name: sgTurn;
}

@keyframes sgGrow {
  0%, 13% {
    grid-template-rows: 0fr;
  }
  16%, 58% {
    grid-template-rows: 1fr;
  }
  90%, 100% {
    grid-template-rows: 0fr;
  }
}
@keyframes sgTurn {
  0%, 13% {
    rotate: 0deg;
  }
  16%, 58% {
    rotate: 180deg;
  }
  90%, 100% {
    rotate: 0deg;
  }
}
@media (max-width: 340px) {
  .sg {
    gap: 8px;
    padding-top: 0;
  }
  .sg__card {
    gap: 4px;
    padding: 4px;
  }
  .sg__thumb {
    height: 32px;
  }
  .sg__name {
    font-size: 10px;
  }
  .sg__price {
    font-size: 11px;
  }
  .sg__more {
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 4px;
    padding-right: 4px;
  }
  .sg__label {
    font-size: 9px;
  }
  .sg__caret {
    width: 10px;
    height: 10px;
  }
  .sg__key, .sg__val {
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sg.is-demo .sg__card--pick .sg__grow,
  .sg.is-demo .sg__card--pick .sg__caret {
    animation: none !important;
  }
  .sg__grow, .sg__caret {
    transition: none !important;
  }
}
