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

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

.rps {
  box-sizing: border-box;
  width: 288px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  background: #17141a;
}

.rps__head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  color: rgba(255, 247, 230, 0.72);
  background: rgba(255, 247, 230, 0.08);
}

.rps__file {
  font-size: 11px;
  font-weight: 700;
  color: #fff7e6;
}

.rps__tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.rps__tab {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 247, 230, 0.72);
  opacity: 0.55;
  cursor: pointer;
}

.rps__tab.is-on {
  opacity: 1;
  color: #fff7e6;
  background: rgba(255, 247, 230, 0.14);
}

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

.rps__stage {
  position: relative;
  box-sizing: border-box;
  height: 132px;
  padding: 12px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 18px;
}

.rps__ptr {
  position: absolute;
  top: 6px;
  right: 40px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 247, 230, 0.7);
  box-shadow: 0 0 0 4px rgba(255, 247, 230, 0.18);
  pointer-events: none;
}

.rps__face {
  box-sizing: border-box;
  position: absolute;
  inset: 12px;
  margin: 0;
  padding: 0;
  color: #fff7e6;
}

.rps__face--code {
  opacity: 1;
  visibility: visible;
}

.rps__face--result {
  opacity: 0;
  visibility: hidden;
}

.rps__face--code .n {
  color: #6ec8ff;
}

.rps__face--code .s {
  color: #ffd23f;
}

.rps__face--code .c {
  color: rgba(255, 247, 230, 0.72);
}

.ln {
  display: block;
}

.rps__face--result {
  display: grid;
  place-items: center;
}

.rps__card {
  position: relative;
  width: 160px;
  height: 84px;
  border-radius: 16px;
  background: linear-gradient(#2f6df6, #6ec8ff);
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  transform: scale(0.94);
}

.rps__badge {
  position: absolute;
  top: -8px;
  left: -8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ff4d1f;
  color: #fff7e6;
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(6px);
}

.rps.is-demo .rps__ptr {
  animation-name: rps-ptr;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.rps.is-demo #rps-code-btn {
  animation-name: rps-tab-code;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.rps.is-demo #rps-eye-btn {
  animation-name: rps-tab-eye;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.rps.is-demo #rps-code {
  animation-name: rps-code;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.rps.is-demo #rps-result {
  animation-name: rps-result;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.rps.is-demo #rps-card {
  animation-name: rps-card;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.rps.is-demo #rps-badge {
  animation-name: rps-badge;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes rps-ptr {
  0% {
    transform: translate(0, 0);
  }
  14% {
    transform: translate(24px, 0);
    animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  44% {
    transform: translate(24px, 0);
  }
  68% {
    transform: translate(0, 0);
    animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  100% {
    transform: translate(0, 0);
  }
}
@keyframes rps-tab-code {
  0% {
    opacity: 1;
  }
  16% {
    opacity: 0.55;
    animation-timing-function: steps(1, end);
  }
  70% {
    opacity: 1;
    animation-timing-function: steps(1, end);
  }
  100% {
    opacity: 1;
  }
}
@keyframes rps-tab-eye {
  0% {
    opacity: 0.55;
  }
  16% {
    opacity: 1;
    animation-timing-function: steps(1, end);
  }
  70% {
    opacity: 0.55;
    animation-timing-function: steps(1, end);
  }
  100% {
    opacity: 0.55;
  }
}
@keyframes rps-code {
  0% {
    opacity: 1;
    visibility: visible;
    animation-timing-function: steps(1, end);
  }
  16% {
    opacity: 0;
    visibility: hidden;
    animation-timing-function: steps(1, end);
  }
  70% {
    opacity: 1;
    visibility: visible;
    animation-timing-function: steps(1, end);
  }
  100% {
    opacity: 1;
    visibility: visible;
  }
}
@keyframes rps-result {
  0% {
    opacity: 0;
    visibility: hidden;
    animation-timing-function: steps(1, end);
  }
  16% {
    opacity: 1;
    visibility: visible;
    animation-timing-function: steps(1, end);
  }
  70% {
    opacity: 0;
    visibility: hidden;
    animation-timing-function: steps(1, end);
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}
@keyframes rps-card {
  0% {
    transform: scale(0.94);
  }
  18% {
    transform: scale(0.94);
    animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  40% {
    transform: scale(1);
  }
  70% {
    transform: scale(1);
  }
  100% {
    transform: scale(0.94);
  }
}
@keyframes rps-badge {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  18% {
    opacity: 0;
    transform: translateY(6px);
    animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  40% {
    opacity: 1;
    transform: translateY(0);
  }
  70% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(6px);
  }
}
@media (max-width: 340px) {
  .rps {
    width: 100%;
  }
  .rps__stage {
    font-size: 10px;
    line-height: 16px;
    padding: 8px;
    height: 124px;
  }
  .rps__face {
    inset: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rps.is-demo .rps__ptr,
  .rps.is-demo #rps-code-btn,
  .rps.is-demo #rps-eye-btn,
  .rps.is-demo #rps-code,
  .rps.is-demo #rps-result,
  .rps.is-demo #rps-card,
  .rps.is-demo #rps-badge {
    animation: none !important;
  }
  .rps.is-demo #rps-code {
    opacity: 1;
    visibility: visible;
  }
  .rps.is-demo #rps-result {
    opacity: 0;
    visibility: hidden;
  }
}
