body {
  background: #f4f4f5;
}

main {
  width: min(1180px, 100% - clamp(32px, 6vw, 80px));
  margin: 0 auto;
}

.muted {
  color: var(--muted);
}

/* ───────── Gate (코드 입력) ───────── */
.gate {
  min-height: calc(100vh - 72px);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 48px 0 24px;
}

.gate-card {
  --mx: 50%;
  --my: 0%;
  position: relative;
  width: min(480px, calc(100vw - 32px));
  display: grid;
  justify-items: start;
  padding: clamp(28px, 5vw, 44px);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, var(--shadow-lg), 0 50px 80px -40px rgba(10, 10, 10, 0.25);
  backdrop-filter: blur(14px);
  isolation: isolate;
  overflow: hidden;
  animation: card-in 0.9s var(--ease) both;
}
.gate-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(520px circle at var(--mx) var(--my), rgba(10, 10, 10, 0.045), transparent 45%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.gate-card:hover::before {
  opacity: 1;
}
.gate-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(10, 10, 10, 0.35), transparent);
  transform: translateX(-100%);
  animation: top-sweep 3.6s 1s var(--ease) infinite;
}
@keyframes top-sweep {
  60%,
  100% {
    transform: translateX(100%);
  }
}
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
    filter: blur(8px);
  }
}

.gate-card > * {
  animation: rise 0.7s var(--ease) both;
}
.gate-card > :nth-child(1) {
  animation-delay: 0.15s;
}
.gate-card > :nth-child(2) {
  animation-delay: 0.22s;
}
.gate-card > :nth-child(3) {
  animation-delay: 0.28s;
}
.gate-card > :nth-child(4) {
  animation-delay: 0.34s;
}
.gate-card > :nth-child(5) {
  animation-delay: 0.4s;
}
.gate-card > :nth-child(6) {
  animation-delay: 0.46s;
}

.gate-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 34px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.logo-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 8px 18px -8px rgba(10, 10, 10, 0.6);
  transition: transform 0.6s var(--ease-spring);
}
.logo:hover .logo-mark {
  transform: rotate(-10deg) scale(1.06);
}
.logo-mark svg.lucide {
  width: 19px;
  height: 19px;
  stroke-width: 2;
}
.logo-word {
  max-width: 7.5em;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.secure {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.gate-title {
  margin: 0 0 12px;
  font-size: clamp(26px, 4.4vw, 32px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.2;
}

.product-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.product-chip svg.lucide {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}
.product-chip.expired {
  color: var(--danger);
  background: #fef2f2;
  border-color: #fecaca;
}

.gate-sub {
  margin: 16px 0 18px;
  font-size: 14px;
  color: var(--muted);
}
.gate-sub b {
  color: var(--ink);
}

#redeem-form {
  width: 100%;
  display: grid;
  gap: 12px;
}

.code-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 58px;
  padding: 0 8px 0 16px;
  border-radius: 15px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.code-box:hover {
  border-color: #a1a1aa;
}
.code-box:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 5px rgba(10, 10, 10, 0.07);
}
.code-box .lead {
  color: var(--subtle);
  transition: color 0.25s, transform 0.4s var(--ease-spring);
}
.code-box:focus-within .lead {
  color: var(--ink);
}
.code-box.complete {
  border-color: var(--ink);
}
.code-box.complete .lead {
  color: var(--success);
  transform: scale(1.12);
}
.code-box.error {
  border-color: var(--danger);
  background: #fffafa;
  box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.08);
}
.code-box.error .lead {
  color: var(--danger);
}
.code-box input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 8px;
  border: 0;
  outline: none;
  background: transparent;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.22em;
}
.code-box input[type="password"] {
  letter-spacing: 0.3em;
}
.code-box input::placeholder {
  color: #d4d4d8;
  letter-spacing: 0.3em;
}
.code-tool {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease-spring);
}
.code-tool:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.code-tool:active {
  transform: scale(0.88);
}

.code-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 2px 6px;
}
.progress {
  position: relative;
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: var(--ink);
  transition: width 0.35s var(--ease), background 0.3s;
}
.code-box.complete ~ .code-meta .progress span,
.progress.done span {
  background: var(--success);
}
.count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--subtle);
}
.count b {
  color: var(--ink);
}

.btn-block {
  width: 100%;
}
#redeem-btn:disabled {
  opacity: 0.88;
}

.gate-foot {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.gate-foot span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.gate-foot svg.lucide {
  width: 14px;
  height: 14px;
}

.gate-note {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
  animation: rise 0.7s 0.6s var(--ease) both;
}
.gate-note svg.lucide {
  width: 15px;
  height: 15px;
}
.gate.leaving .gate-card {
  animation: card-out 0.45s var(--ease) forwards;
}
.gate.leaving .gate-note {
  animation: card-out 0.3s var(--ease) forwards;
}
@keyframes card-out {
  to {
    opacity: 0;
    transform: translateY(-14px) scale(0.97);
    filter: blur(6px);
  }
}

.result-chips {
  display: flex;
  gap: 8px;
}

/* ───────── Result view ───────── */
#result-view {
  padding: 28px 0 80px;
}
.result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  animation: rise 0.6s var(--ease) both;
}
.account-shell {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 18px;
  padding: 14px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  animation: shell-in 0.9s var(--ease) both;
}
@keyframes shell-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
    filter: blur(8px);
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.skin-panel {
  position: sticky;
  top: 84px;
  align-self: start;
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--surface-2), #ececee);
  border: 1px solid var(--line);
}
.skin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand-sm {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.skin-stage {
  position: relative;
  height: 360px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #ffffff 0%, transparent 70%);
}
.stage-floor {
  position: absolute;
  left: 50%;
  bottom: 30px;
  width: 160px;
  height: 22px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(10, 10, 10, 0.22), transparent 70%);
  filter: blur(2px);
}
#skin-canvas {
  position: relative;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.8s var(--ease);
}
#skin-canvas:active {
  cursor: grabbing;
}
#skin-canvas.ready {
  opacity: 1;
}
#skin-fallback {
  position: relative;
  max-height: 300px;
  image-rendering: pixelated;
  animation: rise 0.6s var(--ease) both;
}
.stage-loader {
  position: absolute;
  width: 120px;
  height: 260px;
  border-radius: 16px;
}

.anim-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  width: fit-content;
  margin: 0 auto;
}
.anim-switch button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease-spring);
}
.anim-switch button:hover {
  color: var(--ink);
  background: var(--surface-2);
}
.anim-switch button.active {
  background: var(--ink);
  color: #fff;
}
.anim-switch button:active {
  transform: scale(0.9);
}
.anim-switch svg.lucide {
  width: 16px;
  height: 16px;
}
.anim-switch .divider {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 4px;
}

.identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.identity-name {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.identity-name img {
  border-radius: 10px;
  image-rendering: pixelated;
  background: var(--surface-2);
  flex-shrink: 0;
}
.identity h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.uuid {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 10.5px;
  cursor: pointer;
  max-width: 180px;
}
.uuid span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uuid svg.lucide {
  width: 12px;
  height: 12px;
}
.uuid:hover {
  color: var(--ink);
}
.skin-caption {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.skin-caption svg.lucide {
  width: 14px;
  height: 14px;
}

.info-panel {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: clamp(18px, 2.4vw, 28px);
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.info-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.info-head h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.04em;
}
.info-head p {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.fields {
  display: grid;
  gap: 10px;
}
.acc-field {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 14px 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s var(--ease);
  animation: rise 0.6s var(--ease) both;
  animation-delay: calc(0.25s + var(--i) * 70ms);
}
.acc-field:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.acc-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink-2);
}
.acc-field:hover .acc-icon {
  background: var(--ink);
  color: #fff;
}
.acc-icon svg.lucide {
  transition: transform 0.4s var(--ease-spring);
}
.acc-field:hover .acc-icon svg.lucide {
  transform: scale(1.1);
}
.acc-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.acc-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.acc-value {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  word-break: break-all;
  line-height: 1.45;
}
.acc-value.masked {
  letter-spacing: 0.12em;
  color: var(--ink-2);
}
.acc-value.reveal-anim {
  animation: unblur 0.45s var(--ease);
}
@keyframes unblur {
  from {
    filter: blur(6px);
    opacity: 0.3;
  }
}
.acc-actions {
  display: flex;
  gap: 6px;
}

.memo {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface-2);
  animation: rise 0.6s 0.7s var(--ease) both;
}
.memo-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.memo-title svg.lucide {
  width: 14px;
  height: 14px;
}
.memo p {
  margin: 6px 0 0;
  font-size: 14px;
  white-space: pre-wrap;
}

.notice {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
  animation: rise 0.6s 0.8s var(--ease) both;
}
.notice-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}
.notice-icon svg.lucide {
  width: 16px;
  height: 16px;
}
.notice b {
  font-size: 14px;
}
.notice p {
  margin: 2px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
}

.quick-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  animation: rise 0.6s 0.9s var(--ease) both;
}
.quick {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  transition: border-color 0.2s, background 0.2s, transform 0.3s var(--ease);
}
.quick:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}
.quick > span:nth-child(2) {
  display: grid;
  flex: 1;
  min-width: 0;
}
.quick b {
  font-size: 13.5px;
}
.quick small {
  font-size: 12px;
  color: var(--muted);
}
.q-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-2);
}
.q-arrow {
  color: var(--subtle);
  transition: transform 0.3s var(--ease), color 0.2s;
}
.quick:hover .q-arrow {
  transform: translate(2px, -2px);
  color: var(--ink);
}


/* ───────── Footer ───────── */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 20px 16px 32px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.footer .muted {
  font-weight: 500;
}

/* ───────── Responsive ───────── */
@media (max-width: 980px) {
  .account-shell {
    grid-template-columns: 1fr;
  }
  .skin-panel {
    position: static;
  }
}
@media (max-width: 640px) {
  .gate {
    place-content: start center;
    padding-top: 20px;
  }
  .gate-foot {
    flex-wrap: wrap;
    justify-content: center;
  }
  .acc-field {
    grid-template-columns: 1fr auto;
  }
  .acc-icon {
    display: none;
  }
  .quick-links {
    grid-template-columns: 1fr;
  }
  .info-head {
    flex-direction: column;
  }
  .skin-stage {
    height: 300px;
  }
  .result-top {
    flex-wrap: wrap;
    gap: 8px;
  }
}
