@charset "UTF-8";
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);
}

@property --w {
  syntax: "<length>";
  inherits: true;
  initial-value: 176px;
}
@property --h {
  syntax: "<length>";
  inherits: true;
  initial-value: 96px;
}
@property --wn {
  syntax: "<integer>";
  inherits: true;
  initial-value: 176;
}
@property --hn {
  syntax: "<integer>";
  inherits: true;
  initial-value: 96;
}
.cg {
  --w: 176px;
  --h: 96px;
  --wn: 176;
  --hn: 96;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.cg__field {
  display: grid;
  place-items: start center;
  width: 228px;
  max-width: 92vw;
  height: 124px;
}

.cg__card {
  position: relative;
  box-sizing: border-box;
  width: min(var(--w), 100%);
  height: var(--h);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: #17141a;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  overflow: hidden;
}

.cg__row {
  flex: 0 0 auto;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 247, 230, 0.32);
}

.cg__row--short {
  width: 56%;
  background: #2f6df6;
}

.cg__size {
  margin-top: auto;
  counter-reset: wn var(--wn) hn var(--hn);
  color: #fff7e6;
  font-size: 11px;
  line-height: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cg__size::after {
  content: counter(wn) " × " counter(hn);
}

.cg__grip {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  touch-action: none;
  background: linear-gradient(135deg, transparent 48%, #fff7e6 48%, #fff7e6 58%, transparent 58%), linear-gradient(135deg, transparent 70%, #fff7e6 70%, #fff7e6 80%, transparent 80%);
}

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

.cg__lock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 24px;
  padding: 0 12px;
  border: 1px solid rgba(23, 20, 26, 0.28);
  border-radius: 999px;
  background: transparent;
  color: rgba(23, 20, 26, 0.8);
  font-family: inherit;
  font-size: 11px;
  line-height: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: background 220ms cubic-bezier(0.2, 0.8, 0.2, 1), color 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cg__lock.is-on {
  background: #17141a;
  border-color: #17141a;
  color: #fff7e6;
}

.cg__ico {
  display: block;
  width: 14px;
  height: 14px;
}

.cg__ico svg {
  display: block;
  width: 14px;
  height: 14px;
}

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

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

@keyframes cg-size {
  0%, 8% {
    --w: 176px;
    --h: 96px;
    --wn: 176;
    --hn: 96;
  }
  40% {
    --w: 220px;
    --h: 120px;
    --wn: 220;
    --hn: 120;
  }
  68% {
    --w: 124px;
    --h: 68px;
    --wn: 124;
    --hn: 68;
  }
  88%, 100% {
    --w: 176px;
    --h: 96px;
    --wn: 176;
    --hn: 96;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cg.is-demo {
    animation: none !important;
  }
  .cg__lock {
    transition: none;
  }
}
@media (max-width: 340px) {
  .cg__card {
    padding: 8px;
  }
}
