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);
}

.dt {
  position: relative;
  box-sizing: border-box;
  width: min(100%, 432px);
  padding: 12px;
}

.dt__icons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: max-content;
}

.dt__ico {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 80px;
  padding: 4px 0;
  margin: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.dt__ico:focus-visible {
  outline: 2px solid #5b8cf8;
  outline-offset: 2px;
}

.dt__glyph {
  display: block;
  color: #fff7e6;
  font-size: 30px;
  line-height: 1;
  transform-origin: 50% 50%;
}

.dt__label {
  padding: 0 4px;
  border-radius: 4px;
  color: #fff7e6;
  font-weight: 700;
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
}

.dt__ico[aria-selected=true] .dt__label {
  background: #0a4fe8;
  color: #ffffff;
}

.dt__ico.is-pop .dt__glyph {
  animation-name: dtPopOnce;
  animation-duration: 300ms;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: 1;
}

.dt__win {
  position: absolute;
  top: 12px;
  right: 12px;
  width: min(58%, 236px);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms cubic-bezier(0.2, 1.4, 0.4, 1), transform 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.dt__win.is-open {
  opacity: 1;
  pointer-events: auto;
}

.dt__tbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 16px 16px 0 0;
  background: #0a4fe8;
  color: #ffffff;
}

.dt__tico {
  display: grid;
  place-items: center;
  font-size: 13px;
}

.dt__ttl {
  flex: 1 1 auto;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.4;
}

.dt__x {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-family: inherit;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.dt__x:hover {
  background: rgba(255, 255, 255, 0.32);
}

.dt__x:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 1px;
}

.dt__body {
  margin: 0;
  padding: 12px;
  color: #17141a;
  font-weight: 500;
  font-size: 12px;
  line-height: 1.6;
}

.dt__hint {
  margin: 8px 0 0;
  color: rgba(255, 247, 230, 0.72);
  font-weight: 500;
  font-size: 11px;
  line-height: 1.4;
}

.dt.is-demo .dt__ico--0 .dt__label {
  animation-name: dtSelA;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.dt.is-demo .dt__ico--1 .dt__label {
  animation-name: dtSelB;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.dt.is-demo .dt__ico--0 .dt__glyph {
  animation-name: dtPopLoop;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.dt.is-demo .dt__win {
  animation-name: dtWinO, dtWinY;
  animation-duration: 2s, 2s;
  animation-timing-function: steps(1, end), cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite, infinite;
  animation-fill-mode: backwards, backwards;
  transition: none;
}

@keyframes dtSelA {
  0%, 7.9% {
    background: transparent;
    color: #fff7e6;
  }
  8%, 59.9% {
    background: #0a4fe8;
    color: #ffffff;
  }
  60%, 100% {
    background: transparent;
    color: #fff7e6;
  }
}
@keyframes dtSelB {
  0%, 67% {
    background: transparent;
    color: #fff7e6;
  }
  68%, 83% {
    background: #0a4fe8;
    color: #ffffff;
  }
  84%, 100% {
    background: transparent;
    color: #fff7e6;
  }
}
@keyframes dtPopLoop {
  0%, 16% {
    transform: scale(1);
  }
  19% {
    transform: scale(1.16);
  }
  23%, 100% {
    transform: scale(1);
  }
}
@keyframes dtPopOnce {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.18);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes dtWinO {
  0%, 21% {
    opacity: 0;
  }
  22%, 59% {
    opacity: 1;
  }
  60%, 100% {
    opacity: 0;
  }
}
@keyframes dtWinY {
  0%, 22% {
    transform: translateY(14px);
  }
  29%, 100% {
    transform: translateY(0);
  }
}
@media (max-width: 340px) {
  .dt {
    padding: 8px;
  }
  .dt__icons {
    flex-direction: row;
    justify-content: center;
    width: 100%;
    gap: 8px;
  }
  .dt__ico {
    width: 64px;
    padding: 0;
  }
  .dt__glyph {
    font-size: 20px;
  }
  .dt__label {
    font-size: 11px;
    line-height: 13px;
  }
  .dt__win {
    top: 8px;
    right: 8px;
    left: 8px;
    width: auto;
  }
  .dt__body {
    padding: 8px;
    font-size: 11px;
  }
  .dt__hint {
    margin-top: 4px;
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dt.is-demo .dt__label, .dt.is-demo .dt__glyph, .dt.is-demo .dt__win {
    animation: none !important;
    transition: none !important;
  }
  .dt.is-demo .dt__ico--0 .dt__label {
    background: #0a4fe8 !important;
    color: #ffffff !important;
  }
  .dt.is-demo .dt__win {
    opacity: 1 !important;
    transform: none !important;
  }
}
