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

.cm {
  position: relative;
  width: 100%;
  height: 100%;
}

.cm__field {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: 168px;
  height: 108px;
  border-radius: 16px;
  background: #17141a;
  color: #fff7e6;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 12px;
  box-sizing: border-box;
  font: 600 13px/1.3 -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  user-select: none;
}

.cm__field--alt {
  right: auto;
  left: 16px;
  top: 16px;
  bottom: auto;
  width: 120px;
  height: 84px;
}

.cm__hint {
  opacity: 0.75;
  font-weight: 500;
  font-size: 11px;
}

.cm__menu {
  position: fixed;
  top: 0;
  left: 0;
  min-width: 172px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  padding: 4px;
  display: grid;
  gap: 4px;
  opacity: 0;
  transform: scale(0.94);
  transform-origin: top left;
  pointer-events: none;
  transition: opacity 220ms ease-out, transform 220ms ease-out;
  z-index: 5;
}
.cm__menu.is-open {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.cm__menu.flip-x {
  transform-origin: top right;
}
.cm__menu.flip-y {
  transform-origin: bottom left;
}
.cm__menu.flip-x.flip-y {
  transform-origin: bottom right;
}

.cm__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 0;
  background: none;
  border-radius: 4px;
  font: 500 13px/1.2 -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  color: #17141a;
  cursor: pointer;
  text-align: left;
}
.cm__item:hover, .cm__item:focus-visible {
  background: rgba(23, 20, 26, 0.08);
}
.cm__item--danger {
  color: #c2361a;
}

.cm__ic {
  width: 16px;
  height: 16px;
  flex: none;
  color: #2f6df6;
}
.cm__ic svg {
  display: block;
  width: 100%;
  height: 100%;
}

.cm__item--danger .cm__ic {
  color: #c2361a;
}

@media (max-width: 340px) {
  .cm__field {
    width: 140px;
    height: 96px;
    right: 12px;
    bottom: 12px;
    font-size: 11px;
  }
  .cm__field--alt {
    width: 104px;
    height: 76px;
    left: 8px;
    top: 8px;
  }
  .cm__menu {
    min-width: 144px;
  }
  .cm__item {
    padding: 4px 8px;
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cm__menu {
    transition: none;
  }
}
