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

.cardgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: clamp(240px, 84vw, 340px);
}

.cardgrid__card {
  position: relative;
  box-sizing: border-box;
  padding: 8px;
  border-radius: 16px;
  background: #17141a;
  box-shadow: 0 0 0 1px rgba(255, 210, 63, 0.4), 0 0 24px rgba(255, 210, 63, 0.16);
  overflow: hidden;
}

.cardgrid__card:nth-child(1) .cardgrid__scan {
  animation-delay: 0s;
}

.cardgrid__card:nth-child(2) .cardgrid__scan {
  animation-delay: -0.5s;
}

.cardgrid__card:nth-child(3) .cardgrid__scan {
  animation-delay: -1s;
}

.cardgrid__card:nth-child(4) .cardgrid__scan {
  animation-delay: -1.5s;
}

.cardgrid__scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 210, 63, 0) 0%, rgba(255, 210, 63, 0.3) 48%, rgba(255, 210, 63, 0) 100%);
  background-size: 100% 240%;
  background-position: 0 -140%;
  animation: cardScan 2s linear infinite;
}

@keyframes cardScan {
  0% {
    background-position: 0 -140%;
  }
  100% {
    background-position: 0 140%;
  }
}
.cardgrid__corner {
  position: absolute;
  width: 12px;
  height: 12px;
  pointer-events: none;
  border-color: #ffd23f;
  border-style: solid;
  border-width: 0;
  animation: cornerPulse 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.cardgrid__corner--tl {
  top: 8px;
  left: 8px;
  border-top-width: 2px;
  border-left-width: 2px;
  transform-origin: top left;
}

.cardgrid__corner--tr {
  top: 8px;
  right: 8px;
  border-top-width: 2px;
  border-right-width: 2px;
  transform-origin: top right;
  animation-delay: -0.15s;
}

.cardgrid__corner--bl {
  bottom: 8px;
  left: 8px;
  border-bottom-width: 2px;
  border-left-width: 2px;
  transform-origin: bottom left;
  animation-delay: -0.3s;
}

.cardgrid__corner--br {
  bottom: 8px;
  right: 8px;
  border-bottom-width: 2px;
  border-right-width: 2px;
  transform-origin: bottom right;
  animation-delay: -0.45s;
}

@keyframes cornerPulse {
  0%, 100% {
    transform: scale(0.55);
    opacity: 0.35;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}
.cardgrid__coord {
  position: relative;
  display: block;
  margin: 0 0 4px;
  color: rgba(255, 210, 63, 0.85);
  font-family: "Courier New", monospace;
  font-weight: 700;
  font-size: clamp(9px, 2.2vw, 10px);
  line-height: 1;
  letter-spacing: 0.04em;
  text-align: right;
}

.cardgrid__coord--alt {
  color: #6ec8ff;
}

.cardgrid__icon {
  position: relative;
  display: block;
  width: 20px;
  height: 20px;
  margin: 0 0 8px;
  border: 1px solid #ffd23f;
  border-radius: 4px;
  background: rgba(255, 210, 63, 0.18);
}

.cardgrid__label {
  position: relative;
  margin: 0;
  color: #fff7e6;
  font-weight: 700;
  font-size: clamp(12px, 2.8vw, 13px);
  line-height: 1.3;
  font-family: inherit;
}

@media (prefers-reduced-motion: reduce) {
  .cardgrid__scan, .cardgrid__corner {
    animation: none !important;
  }
  .cardgrid__corner {
    transform: scale(1);
    opacity: 1;
  }
}
