/* ---------- 디자인 토큰 (남보라 밤하늘 · 단일 테마) ---------- */
:root {
  --night: #211a45;
  --night-2: #2c2358;
  --night-hi: #362b6b;
  --ink-on-dark: #f3eeff;
  --muted: #a99fd0;
  --lav: #c9b6ff;
  --pink: #ff9ecb;
  --gold: #f5c13d;
  --gold-deep: #e0a92a;
  --good: #7ee0b0;

  --radius: 24px;
  --radius-sm: 16px;

  /* 실제 로또 6/45 공 색상 (유지) */
  --b-yellow: #fbc400;
  --b-blue: #38a4e0;
  --b-red: #f0525a;
  --b-gray: #808a99;
  --b-green: #7bc043;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 44px 20px 60px;
  color: var(--ink-on-dark);
  background:
    radial-gradient(130% 80% at 50% -8%, #3a2f73 0%, transparent 55%),
    radial-gradient(90% 60% at 88% 8%, rgba(255, 158, 203, 0.16) 0%, transparent 50%),
    linear-gradient(180deg, #241c4d 0%, #1a1436 100%);
  font-family: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ---------- 배경 반짝이 ---------- */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; }

.twinkle {
  position: absolute;
  width: 16px;
  height: 16px;
  transform: scale(var(--s, 1));
  background: var(--lav);
  /* 4-point 별 모양 */
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  opacity: 0.5;
  animation: twinkle 3.4s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
.dot {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.4;
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(calc(var(--s, 1) * 0.7)); }
  50% { opacity: 0.85; transform: scale(var(--s, 1)); }
}

/* ---------- 레이아웃 ---------- */
.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* ---------- 마스코트 ---------- */
.mascot {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 6px;
}

.bubble {
  position: relative;
  font-family: "Jua", "Pretendard", sans-serif;
  font-size: 16px;
  color: #4b2e5e;
  background: #fff;
  padding: 11px 18px;
  border-radius: 20px;
  margin-bottom: 4px;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.5);
  animation: bob 3s ease-in-out infinite;
}
.bubble::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border: 9px solid transparent;
  border-top-color: #fff;
  border-bottom: 0;
}

.pig {
  filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.35));
  animation: bob 3s ease-in-out infinite 0.3s;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ---------- 인트로 ---------- */
.intro { text-align: center; margin: 4px 0 26px; }
h1 {
  font-family: "Jua", "Pretendard", sans-serif;
  margin: 0 0 10px;
  font-size: 27px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: #fff;
  text-wrap: balance;
}
.spk { display: inline-block; animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.85; }
}
.lede { margin: 0; font-size: 14.5px; color: var(--lav); }

/* ---------- 번호 줄 ---------- */
.lines {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 26px;
}

.line {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--night-2);
  border: 1px solid rgba(201, 182, 255, 0.14);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: 0 8px 22px -16px rgba(0, 0, 0, 0.6);
}

.line-tag {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--night-hi);
  color: var(--lav);
  font-family: "Jua", sans-serif;
  font-size: 15px;
}

.balls {
  display: flex;
  gap: 9px;
  flex: 1;
  justify-content: center;
}

.ball {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.22), 0 3px 8px rgba(0, 0, 0, 0.3);
  transform: scale(0.3);
  opacity: 0;
  animation: pop 0.45s cubic-bezier(0.18, 1.4, 0.4, 1) forwards;
}
.ball.y { background: var(--b-yellow); color: #6a4e00; }
.ball.b { background: var(--b-blue); }
.ball.r { background: var(--b-red); }
.ball.g { background: var(--b-gray); }
.ball.n { background: var(--b-green); color: #24500a; }
@keyframes pop { to { transform: scale(1); opacity: 1; } }

.copy-line {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.15s ease, background 0.15s ease;
}
.copy-line:hover { color: #fff; background: var(--night-hi); }

/* ---------- 액션 ---------- */
.actions { display: flex; gap: 10px; margin-bottom: 24px; }

.btn {
  font-family: "Jua", "Pretendard", sans-serif;
  font-size: 16px;
  border-radius: 18px;
  cursor: pointer;
  border: none;
  transition: transform 0.1s ease, filter 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(2px); }
.btn:focus-visible { outline: 3px solid var(--lav); outline-offset: 3px; }

.btn-primary {
  flex: 1;
  padding: 17px;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: #4a3200;
  box-shadow: 0 12px 26px -12px rgba(245, 193, 61, 0.7);
}
.btn-primary:hover { filter: brightness(1.05); }

.btn-soft {
  padding: 17px 20px;
  background: var(--night-2);
  color: var(--lav);
  border: 1px solid rgba(201, 182, 255, 0.22);
}
.btn-soft:hover { background: var(--night-hi); }

/* ---------- 안내 · 푸터 ---------- */
.note {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
.note p { margin: 0; }
.note p + p { margin-top: 10px; }
.footer-links a {
  color: var(--lav);
  text-decoration: none;
}
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-links a:focus-visible {
  outline: 3px solid var(--lav);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- 문의 · 404 ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.info-card {
  background: var(--night-2);
  border: 1px solid rgba(201, 182, 255, 0.14);
  border-radius: var(--radius);
  padding: 6px 0;
  margin-bottom: 22px;
  box-shadow: 0 8px 22px -16px rgba(0, 0, 0, 0.6);
}
.info-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  padding: 15px 20px;
  align-items: baseline;
}
.info-row + .info-row {
  border-top: 1px solid rgba(201, 182, 255, 0.12);
}
.info-label {
  font-size: 13px;
  color: var(--muted);
}
.info-value { font-size: 15.5px; color: var(--ink-on-dark); }
.mailto {
  color: var(--gold);
  text-decoration: none;
  font-size: 15.5px;
  word-break: break-all;
}
.mailto:hover { color: #ffe08a; text-decoration: underline; }
.mailto:focus-visible {
  outline: 3px solid var(--lav);
  outline-offset: 3px;
  border-radius: 6px;
}

.page-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
a.btn {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lost-code {
  margin: 0 0 4px;
  font-family: "Jua", sans-serif;
  font-size: 42px;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-shadow: 0 8px 24px rgba(245, 193, 61, 0.28);
}

/* ---------- 토스트 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(20px);
  background: #fff;
  color: #4b2e5e;
  font-family: "Jua", sans-serif;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 16px;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 접근성 · 반응형 ---------- */
@media (prefers-reduced-motion: reduce) {
  .ball { animation: none; transform: scale(1); opacity: 1; }
  .twinkle, .dot, .spk, .bubble, .pig { animation: none; }
  .btn:active { transform: none; }
}

@media (max-width: 430px) {
  h1 { font-size: 24px; }
  .line { gap: 9px; padding: 14px 14px; }
  .ball { width: 40px; height: 40px; font-size: 16px; }
  .balls { gap: 7px; }
}
