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

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

.cg {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 424px;
}

.cg__hint {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-weight: 700;
  font-size: clamp(10px, 2.8vw, 12px);
  color: #fff7e6;
}

.cg__ico {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: #ffd23f;
}

.cg__wrap {
  position: relative;
  padding-top: 20px;
}

.cg__tip {
  position: absolute;
  left: 0;
  top: 0;
  height: 16px;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  padding: 0 8px;
  background: rgba(255, 247, 230, 0.12);
  color: #fff7e6;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 11px);
  white-space: nowrap;
}

.cg__grid {
  display: flex;
  flex-direction: column;
}

.cg__row {
  display: flex;
}

.cg__cell {
  box-sizing: border-box;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 50%;
  background: rgba(255, 247, 230, 0.1);
  background-clip: padding-box;
}

.cg__cell--l1 {
  background: rgba(255, 210, 63, 0.3);
}

.cg__cell--l2 {
  background: rgba(255, 210, 63, 0.52);
}

.cg__cell--l3 {
  background: rgba(255, 210, 63, 0.76);
}

.cg__cell--l4 {
  background: #ffd23f;
  box-shadow: inset 0 0 0 1px rgba(23, 20, 26, 0.55);
}

.cg__cell.is-today {
  box-shadow: 0 0 0 2px rgba(255, 247, 230, 0.9);
}

.cg__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.cg__legend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.cg__legendLabel {
  margin-right: 4px;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 11px);
  color: rgba(255, 247, 230, 0.72);
}

.cg__keyItem {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cg__key {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.cg__keyNum {
  font-weight: 800;
  font-size: 9px;
  line-height: 1;
  color: #fff7e6;
}

.cg__key--l0 {
  background: rgba(255, 247, 230, 0.1);
}

.cg__key--l1 {
  background: rgba(255, 210, 63, 0.3);
}

.cg__key--l2 {
  background: rgba(255, 210, 63, 0.52);
}

.cg__key--l3 {
  background: rgba(255, 210, 63, 0.76);
}

.cg__key--l4 {
  background: #ffd23f;
  box-shadow: inset 0 0 0 1px rgba(23, 20, 26, 0.55);
}

.cg__add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: 999px;
  padding: 4px 12px;
  background: #ffd23f;
  color: #17141a;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(10px, 2.6vw, 11px);
  line-height: 1.6;
}

.cg__add .cg__ico {
  color: #17141a;
}

.cg__add:focus-visible {
  outline: 2px solid #fff7e6;
  outline-offset: 2px;
}

.cg.is-demo .cg__cell {
  animation-name: cgWave;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
  animation-delay: calc(var(--c) * 12ms);
}

@keyframes cgWave {
  0% {
    transform: scale(0.15);
    opacity: 0.3;
  }
  14% {
    transform: scale(1);
    opacity: 1;
  }
  86% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(0.15);
    opacity: 0.3;
  }
}
@media (max-width: 340px) {
  .cg {
    gap: 8px;
  }
  .cg__wrap {
    padding-top: 16px;
  }
  .cg__cell {
    width: 5px;
    height: 5px;
  }
  .cg__key {
    width: 8px;
    height: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cg.is-demo .cg__cell {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
