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

.pl {
  position: relative;
  box-sizing: border-box;
  width: min(392px, 92vw);
  margin: 0;
  border-radius: 16px;
  background: #fff7e6;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  overflow: hidden;
  transform: scale(1);
  transform-origin: center center;
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pl.is-full {
  transform: scale(1.06);
}

.pl__screen {
  position: relative;
  height: clamp(124px, 34vw, 142px);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(47, 109, 246, 0.32), rgba(255, 247, 230, 0.96));
}

.pl__stripes {
  position: absolute;
  inset: 0 -72px;
  background: repeating-linear-gradient(90deg, rgba(23, 20, 26, 0.14) 0 12px, transparent 12px 32px);
  animation-name: pl-pan;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes pl-pan {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-64px);
  }
}
.pl__world {
  position: absolute;
  inset: 0;
}

.pl__sun {
  position: absolute;
  right: 18%;
  top: 12%;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 210, 63, 0.95);
  box-shadow: 0 0 0 8px rgba(255, 210, 63, 0.25);
}

.pl__hill {
  position: absolute;
  bottom: -46%;
  height: 78%;
  border-radius: 50%;
}

.pl__hill--a {
  left: -14%;
  width: 72%;
  background: rgba(23, 20, 26, 0.15);
}

.pl__hill--b {
  right: -18%;
  width: 62%;
  background: rgba(23, 20, 26, 0.09);
}

.pl__clock {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  display: inline-grid;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(23, 20, 26, 0.62);
  color: #fff;
  font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 14px;
  font-weight: 700;
}

.clk {
  grid-area: 1/1;
}

.clk--b {
  opacity: 0;
}

.pl.is-paused .pl__clock {
  background: #ffd23f;
  color: #17141a;
}

.pl__mute {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 2;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(194, 54, 26, 0.94);
  color: #fff;
  font-size: 10px;
  line-height: 18px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  transform: scale(0.7);
  transform-origin: right center;
  transition: opacity 220ms cubic-bezier(0.2, 1.4, 0.4, 1), transform 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.pl.is-mute .pl__mute {
  opacity: 1;
  transform: none;
}

.pl__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px 12px;
}

.pl__time {
  color: #17141a;
  font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(255, 247, 230, 0.6);
}

.pl__time b {
  font-weight: 700;
}

.qb {
  position: relative;
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #2f6df6;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(47, 109, 246, 0.45);
  transition: transform 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.qb:hover {
  transform: scale(1.08);
}

.qb:active {
  transform: scale(0.92);
}

.qb:focus-visible {
  outline: 2px solid #ffd23f;
  outline-offset: 2px;
}

.pl__fillwrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: rgba(255, 255, 255, 0.28);
}

.pl__fill {
  display: block;
  height: 100%;
  background: #2f6df6;
  transform-origin: left center;
  transform: scaleX(0.08);
}

.ovl {
  position: absolute;
  inset: 0;
  background: rgba(23, 20, 26, 0.84);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.pl.is-open .ovl, .pl.is-demo .ovl {
  visibility: visible;
}

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

.ovl__panel {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 32px 12px 12px;
  transform: translateY(10px) scale(0.94);
  transition: transform 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.pl.is-open .ovl__panel {
  transform: none;
}

.ovl__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.ovl__title {
  margin: 0;
  color: #ffd23f;
  font-size: 10px;
  line-height: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.ovl__x {
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  transition: background 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

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

.ovl__x:focus-visible {
  outline: 2px solid #ffd23f;
  outline-offset: 2px;
}

.ovl__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ovl__row {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: 8px;
}

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

.ovl__what {
  color: rgba(255, 255, 255, 0.88);
  font-size: 10px;
  line-height: 16px;
  font-weight: 600;
}

.ovl kbd {
  box-sizing: border-box;
  min-width: 22px;
  padding: 0 4px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 9px;
  line-height: 14px;
  font-weight: 700;
  text-align: center;
}

.ovl kbd.is-hit {
  animation-name: kbd-hit;
  animation-duration: 300ms;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: 1;
}

@keyframes kbd-hit {
  0% {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.28);
  }
  30%, 60% {
    transform: translateY(2px);
    background: #ffd23f;
    color: #17141a;
    border-color: #ffd23f;
  }
  100% {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.28);
  }
}
.pl.is-demo {
  animation-name: sc-full;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

.pl.is-demo .ovl {
  animation-name: sc-dim;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

.pl.is-demo .ovl__panel {
  animation-name: sc-rise;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

.pl.is-demo .pl__clock {
  animation-name: sc-clock;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.pl.is-demo .clk {
  animation-name: sc-clk-a;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.pl.is-demo .clk--b {
  animation-name: sc-clk-b;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.pl.is-demo .pl__mute {
  animation-name: sc-mute;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

.pl.is-demo .pl__fill {
  animation-name: sc-fill;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.pl.is-demo .ovl kbd {
  animation-name: kbd-cycle;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes kbd-cycle {
  0%, 10% {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.28);
  }
  11%, 20% {
    transform: translateY(2px);
    background: #ffd23f;
    color: #17141a;
    border-color: #ffd23f;
  }
  21%, 100% {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.28);
  }
}
.pl.is-demo .ovl .k-space {
  animation-delay: -1980ms;
}

.pl.is-demo .ovl .k-left {
  animation-delay: -1700ms;
}

.pl.is-demo .ovl .k-right {
  animation-delay: -1420ms;
}

.pl.is-demo .ovl .k-m {
  animation-delay: -1180ms;
}

.pl.is-demo .ovl .k-f {
  animation-delay: -940ms;
}

@keyframes sc-dim {
  0%, 9% {
    opacity: 0;
  }
  10%, 84% {
    opacity: 1;
  }
  85%, 100% {
    opacity: 0;
  }
}
@keyframes sc-rise {
  0%, 9% {
    transform: translateY(10px) scale(0.94);
  }
  16%, 84% {
    transform: none;
  }
  85%, 100% {
    transform: translateY(10px) scale(0.94);
  }
}
@keyframes sc-clock {
  0%, 21% {
    background: rgba(23, 20, 26, 0.62);
    color: #fff;
  }
  22%, 73% {
    background: #ffd23f;
    color: #17141a;
  }
  74%, 100% {
    background: rgba(23, 20, 26, 0.62);
    color: #fff;
  }
}
@keyframes sc-clk-a {
  0%, 34% {
    opacity: 1;
  }
  35%, 49% {
    opacity: 0;
  }
  50%, 100% {
    opacity: 1;
  }
}
@keyframes sc-clk-b {
  0%, 34% {
    opacity: 0;
  }
  35%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0;
  }
}
@keyframes sc-mute {
  0%, 53% {
    opacity: 0;
    transform: scale(0.7);
  }
  58%, 73% {
    opacity: 1;
    transform: none;
  }
  74%, 100% {
    opacity: 0;
    transform: scale(0.7);
  }
}
@keyframes sc-full {
  0%, 63% {
    transform: scale(1);
  }
  69%, 73% {
    transform: scale(1.06);
  }
  78%, 100% {
    transform: scale(1);
  }
}
@keyframes sc-fill {
  0% {
    transform: scaleX(0.08);
  }
  22%, 34% {
    transform: scaleX(0.2);
  }
  35%, 49% {
    transform: scaleX(0.14);
  }
  50%, 73% {
    transform: scaleX(0.2);
  }
  78%, 100% {
    transform: scaleX(0.08);
  }
}
@media (max-width: 340px) {
  .ovl__panel {
    padding: 24px 8px 8px;
  }
  .ovl__list {
    gap: 0 4px;
  }
  .ovl__row {
    grid-template-columns: 52px 1fr;
    gap: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pl.is-demo, .pl.is-demo .ovl, .pl.is-demo .ovl__panel, .pl.is-demo .pl__clock,
  .pl.is-demo .clk, .pl.is-demo .clk--b, .pl.is-demo .pl__mute, .pl.is-demo .pl__fill,
  .pl.is-demo .ovl kbd, .ovl kbd.is-hit, .pl__stripes {
    animation: none !important;
  }
  .pl, .ovl, .ovl__panel, .pl__mute, .qb, .ovl__x {
    transition: none;
  }
  .pl.is-demo .ovl {
    opacity: 1;
  }
}
