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

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

.ss {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 400px;
}

.ss__hint {
  margin: 0;
  font-weight: 700;
  font-size: clamp(11px, 3vw, 13px);
  line-height: 1.5;
  color: #17141a;
}

.ss__scene {
  position: relative;
  width: min(336px, 92vw);
  height: clamp(104px, 30vw, 128px);
}

.ss__ground {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 0;
  height: 10px;
  border-radius: 50%;
  background: rgba(23, 20, 26, 0.16);
}

.ss__plinth {
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: clamp(52px, 16vw, 64px);
  height: clamp(34px, 10vw, 44px);
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255, 247, 230, 0.2), rgba(255, 247, 230, 0) 36%, rgba(23, 20, 26, 0.55)), #17141a;
  border-radius: 8px 8px 0 0;
  box-shadow: inset 0 2px 0 rgba(255, 247, 230, 0.14), 0 8px 14px rgba(23, 20, 26, 0.28);
}

.ss__plinth::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -8px;
  width: 18px;
  height: 18px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 247, 230, 0.4), rgba(255, 247, 230, 0.06) 60%), #17141a;
}

.ss__plank {
  position: absolute;
  left: 0;
  right: 0;
  top: clamp(20px, 6.5vw, 26px);
  height: clamp(42px, 12vw, 52px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  padding: 0 8px;
  background: linear-gradient(180deg, rgba(255, 247, 230, 0.55), rgba(255, 247, 230, 0) 32%, rgba(23, 20, 26, 0.18)), #ffffff;
  border: 1px solid rgba(23, 20, 26, 0.25);
  border-radius: 12px;
  box-shadow: 0 10px 18px rgba(23, 20, 26, 0.26), inset 0 1px 0 rgba(255, 247, 230, 0.7);
  transform: rotate(-8deg);
  transform-origin: 50% 84%;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ss[data-side=b] .ss__plank {
  transform: rotate(8deg);
}

.ss__bolt {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 247, 230, 0.55), rgba(255, 247, 230, 0.05) 62%), #17141a;
  box-shadow: 0 0 0 3px rgba(255, 247, 230, 0.4), 0 2px 4px rgba(23, 20, 26, 0.5);
}

.ss__pad {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: clamp(76px, 23vw, 96px);
  height: clamp(32px, 9vw, 40px);
  border: 1px solid rgba(23, 20, 26, 0.3);
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 247, 230, 0.65), rgba(255, 247, 230, 0) 44%, rgba(23, 20, 26, 0.14)), #ffffff;
  box-shadow: 0 6px 10px rgba(23, 20, 26, 0.3), inset 0 1px 0 rgba(255, 247, 230, 0.8);
  font-family: inherit;
  color: #17141a;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ss__key {
  font-weight: 800;
  font-size: clamp(15px, 4.6vw, 19px);
  line-height: 1.1;
}

.ss__sub {
  font-weight: 700;
  font-size: clamp(9px, 2.6vw, 10px);
  line-height: 1.3;
  color: rgba(23, 20, 26, 0.72);
}

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

.ss__pad:active {
  transform: translateY(2px);
  box-shadow: 0 2px 4px rgba(23, 20, 26, 0.3), inset 0 2px 6px rgba(23, 20, 26, 0.28);
}

.ss[data-side=a] .ss__pad--a,
.ss[data-side=b] .ss__pad--b {
  transform: translateY(3px);
  box-shadow: 0 2px 4px rgba(23, 20, 26, 0.22), inset 0 3px 8px rgba(23, 20, 26, 0.32);
}

.ss__out {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 700;
  font-size: clamp(11px, 3vw, 13px);
  line-height: 1.5;
  color: #17141a;
}

.ss__outVal {
  position: relative;
  width: 16px;
  height: 20px;
}

.ss__letter {
  position: absolute;
  inset: 0;
  font-weight: 800;
  font-size: clamp(14px, 4vw, 17px);
  line-height: 20px;
  color: #17141a;
}

.ss__letter--b {
  visibility: hidden;
}

.ss[data-side=b] .ss__letter--b {
  visibility: visible;
}

.ss[data-side=b] .ss__letter--a {
  visibility: hidden;
}

.ss.is-demo .ss__plank {
  animation-name: ssTilt;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

.ss.is-demo .ss__pad--a {
  animation-name: ssPressA;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

.ss.is-demo .ss__pad--b {
  animation-name: ssPressB;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

.ss.is-demo .ss__letter--a {
  animation-name: ssShowA;
  animation-duration: 2s;
  animation-iteration-count: infinite;
}

.ss.is-demo .ss__letter--b {
  animation-name: ssShowB;
  animation-duration: 2s;
  animation-iteration-count: infinite;
}

@keyframes ssTilt {
  0%, 10% {
    transform: rotate(-8deg);
  }
  38%, 52% {
    transform: rotate(8deg);
  }
  80%, 100% {
    transform: rotate(-8deg);
  }
}
@keyframes ssPressA {
  0%, 12% {
    transform: translateY(3px);
  }
  26%, 74% {
    transform: translateY(0);
  }
  84%, 100% {
    transform: translateY(3px);
  }
}
@keyframes ssPressB {
  0%, 26% {
    transform: translateY(0);
  }
  38%, 62% {
    transform: translateY(3px);
  }
  76%, 100% {
    transform: translateY(0);
  }
}
@keyframes ssShowA {
  0%, 23% {
    visibility: visible;
  }
  25%, 75% {
    visibility: hidden;
  }
  77%, 100% {
    visibility: visible;
  }
}
@keyframes ssShowB {
  0%, 23% {
    visibility: hidden;
  }
  25%, 75% {
    visibility: visible;
  }
  77%, 100% {
    visibility: hidden;
  }
}
@media (max-width: 340px) {
  .ss {
    gap: 4px;
  }
  .ss__scene {
    height: 102px;
  }
  .ss__plank {
    top: 20px;
    height: 38px;
  }
  .ss__outVal {
    height: 18px;
  }
  .ss__letter {
    line-height: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ss.is-demo .ss__plank,
  .ss.is-demo .ss__pad--a,
  .ss.is-demo .ss__pad--b,
  .ss.is-demo .ss__letter--a,
  .ss.is-demo .ss__letter--b {
    animation: none !important;
  }
  .ss__plank, .ss__pad {
    transition: none !important;
  }
}
