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

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

.ad__frame {
  position: relative;
  height: clamp(76px, 38vh, 132px);
  aspect-ratio: 16/10;
  max-width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.ad__view {
  display: block;
  width: 100%;
  height: 100%;
}

.ad__ghost, .ad__orig {
  display: none;
  position: absolute;
  inset: 0;
  background-image: var(--photo);
  background-size: cover;
}

.ad__tag {
  position: absolute;
  left: 4px;
  top: 4px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(23, 20, 26, 0.72);
  color: #fff7e6;
  font-weight: 800;
  font-size: clamp(8px, 2.1vw, 10px);
  line-height: 2;
}

.ad__tagDemo {
  display: none;
  position: absolute;
  left: 4px;
  top: 0;
}

.ad__ctl {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.ad__s {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 88px;
}

.ad__lab {
  font-weight: 800;
  font-size: clamp(8px, 2.1vw, 10px);
  color: #17141a;
}

.ad__track {
  position: relative;
  width: 100%;
  height: 6px;
  cursor: pointer;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.18);
}

.ad__track:focus-visible {
  outline: 3px solid #2f6df6;
  outline-offset: 4px;
}

.ad__thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #2f6df6;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  transform: translate(-50%, -50%);
}

.ad__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.ad__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: 1px solid rgba(23, 20, 26, 0.24);
  background: #ffffff;
  color: #17141a;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  line-height: 1.3;
  font-size: clamp(8px, 2.2vw, 10px);
  padding: 4px 8px;
}

.ad__btn--ab {
  background: #2f6df6;
  border-color: #2f6df6;
  color: #ffffff;
}

.ad__btn:focus-visible {
  outline: 3px solid #2f6df6;
  outline-offset: 2px;
}

.ad__ico {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.ad__codes {
  position: relative;
  display: inline-block;
  min-width: 200px;
  height: 14px;
  font-family: ui-monospace, "Consolas", monospace;
  font-size: clamp(8px, 2.1vw, 10px);
  color: rgba(23, 20, 26, 0.7);
}

.ad__demoCode {
  display: none;
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
}

.ad.is-demo .ad__view {
  visibility: hidden;
}

.ad.is-demo .ad__ghost {
  display: block;
  animation-name: adTone;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes adTone {
  0%, 8% {
    filter: brightness(1) contrast(1) saturate(1);
  }
  12%, 82% {
    filter: brightness(1.18) contrast(1.22) saturate(1.3);
  }
  86%, 100% {
    filter: brightness(1) contrast(1) saturate(1);
  }
}
.ad.is-demo .ad__orig {
  display: block;
  animation-name: adCompare;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes adCompare {
  0%, 46% {
    opacity: 0;
  }
  47%, 66% {
    opacity: 1;
  }
  67%, 100% {
    opacity: 0;
  }
}
.ad.is-demo .ad__real {
  color: transparent;
}

.ad.is-demo .ad__tagDemo {
  display: block;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.ad.is-demo .ad__tagDemo--edit {
  animation-name: adTagEdit;
}

.ad.is-demo .ad__tagDemo--orig {
  animation-name: adTagOrig;
}

@keyframes adTagEdit {
  0%, 46% {
    opacity: 1;
  }
  47%, 66% {
    opacity: 0;
  }
  67%, 100% {
    opacity: 1;
  }
}
@keyframes adTagOrig {
  0%, 46% {
    opacity: 0;
  }
  47%, 66% {
    opacity: 1;
  }
  67%, 100% {
    opacity: 0;
  }
}
.ad.is-demo .ad__thumb {
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

.ad.is-demo #thB {
  animation-name: adThumbB;
}

.ad.is-demo #thC {
  animation-name: adThumbC;
}

.ad.is-demo #thS {
  animation-name: adThumbS;
}

@keyframes adThumbB {
  0%, 8% {
    transform: translate(-50%, -50%);
  }
  12%, 82% {
    transform: translate(-50%, -50%) translateX(16px);
  }
  86%, 100% {
    transform: translate(-50%, -50%);
  }
}
@keyframes adThumbC {
  0%, 8% {
    transform: translate(-50%, -50%);
  }
  12%, 82% {
    transform: translate(-50%, -50%) translateX(19px);
  }
  86%, 100% {
    transform: translate(-50%, -50%);
  }
}
@keyframes adThumbS {
  0%, 8% {
    transform: translate(-50%, -50%);
  }
  12%, 82% {
    transform: translate(-50%, -50%) translateX(26px);
  }
  86%, 100% {
    transform: translate(-50%, -50%);
  }
}
.ad.is-demo .ad__btn--ab {
  animation-name: adPress;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

@keyframes adPress {
  0%, 42% {
    transform: scale(1);
  }
  47% {
    transform: scale(0.88);
  }
  54%, 62% {
    transform: scale(1);
  }
  67% {
    transform: scale(0.88);
  }
  74%, 100% {
    transform: scale(1);
  }
}
.ad.is-demo .ad__realCode {
  color: transparent;
}

.ad.is-demo .ad__demoCode {
  display: block;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.ad.is-demo .ad__demoCode--a {
  animation-name: adCodeA;
}

.ad.is-demo .ad__demoCode--b {
  animation-name: adCodeB;
}

@keyframes adCodeA {
  0%, 9% {
    opacity: 1;
  }
  10%, 83% {
    opacity: 0;
  }
  84%, 100% {
    opacity: 1;
  }
}
@keyframes adCodeB {
  0%, 9% {
    opacity: 0;
  }
  10%, 83% {
    opacity: 1;
  }
  84%, 100% {
    opacity: 0;
  }
}
@media (max-width: 340px) {
  .ad {
    gap: 4px;
  }
  .ad__ctl {
    gap: 4px;
  }
  .ad__s {
    width: 88px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ad.is-demo .ad__ghost,
  .ad.is-demo .ad__orig,
  .ad.is-demo .ad__tagDemo,
  .ad.is-demo .ad__thumb,
  .ad.is-demo .ad__btn--ab,
  .ad.is-demo .ad__demoCode {
    animation: none !important;
  }
  .ad.is-demo .ad__ghost {
    filter: brightness(1.18) contrast(1.22) saturate(1.3) !important;
  }
  .ad.is-demo .ad__orig {
    opacity: 0 !important;
  }
  .ad.is-demo .ad__tagDemo--edit {
    opacity: 1 !important;
  }
  .ad.is-demo .ad__tagDemo--orig {
    opacity: 0 !important;
  }
  .ad.is-demo #thB {
    transform: translate(-50%, -50%) translateX(16px) !important;
  }
  .ad.is-demo #thC {
    transform: translate(-50%, -50%) translateX(19px) !important;
  }
  .ad.is-demo #thS {
    transform: translate(-50%, -50%) translateX(26px) !important;
  }
  .ad.is-demo .ad__demoCode--a {
    opacity: 0 !important;
  }
  .ad.is-demo .ad__demoCode--b {
    opacity: 1 !important;
  }
}
