:root {
  --primary: #0052ff;
  --primary-active: #003ecc;
  --violet: #6b4eff;
  --cyan: #00b4ff;
  --ink: #0a0b0d;
  --body: #5b616e;
  --muted: #7c828a;
  --hairline: #dee1e6;
  --hairline-soft: #eef0f3;
  --canvas: #ffffff;
  --surface-soft: #f7f7f7;
  --surface-strong: #eef0f3;
  --surface-dark: #0a0b0d;
  --surface-dark-elevated: #16181c;
  --on-primary: #ffffff;
  --on-dark: #ffffff;
  --on-dark-soft: #a8acb3;
  --semantic-up: #05b169;
  --warning: #f4b000;
  --grad-primary: linear-gradient(135deg, #0052ff 0%, #6b4eff 100%);
  --grad-cta: linear-gradient(135deg, #0052ff 0%, #3f6bff 45%, #6b4eff 100%);
  --grad-hot: linear-gradient(135deg, #f4b000 0%, #ff7a3c 100%);
  --shadow-card: 0 18px 48px -24px rgba(16, 24, 64, 0.28);
  --shadow-glow: 0 22px 48px -18px rgba(0, 82, 255, 0.5);
  --radius-card: 24px;
  --radius-input: 12px;
  --radius-pill: 999px;
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 20;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--on-primary);
  padding: 10px 16px;
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 16px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--hairline-soft);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1200px, calc(100% - 40px));
  min-height: 64px;
  margin: 0 auto;
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--grad-primary);
  color: var(--on-primary);
  font-weight: 700;
  box-shadow: 0 6px 16px -6px rgba(0, 82, 255, 0.7);
}

.nav-links {
  gap: 24px;
  color: var(--body);
  font-size: 14px;
  font-weight: 600;
}

.nav-links a {
  position: relative;
  padding: 4px 0;
  transition: color 160ms ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms ease;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

/* ---------- Hero ---------- */
.hero-aurora {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  will-change: transform;
}

.aurora-1 {
  top: -120px;
  left: -80px;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(0, 82, 255, 0.55), transparent 70%);
  animation: drift1 16s ease-in-out infinite;
}

.aurora-2 {
  top: 40px;
  right: -120px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(107, 78, 255, 0.45), transparent 70%);
  animation: drift2 20s ease-in-out infinite;
}

.aurora-3 {
  bottom: -160px;
  left: 30%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(0, 180, 255, 0.4), transparent 70%);
  animation: drift3 18s ease-in-out infinite;
}

@keyframes drift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.12); }
}

@keyframes drift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, 60px) scale(1.08); }
}

@keyframes drift3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -50px) scale(1.15); }
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1.15fr);
  gap: 48px;
  align-items: center;
  width: min(1200px, calc(100% - 40px));
  min-height: calc(100vh - 110px);
  margin: 0 auto;
  padding: 64px 0 48px;
}

.hero-copy {
  position: relative;
  max-width: 560px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: rgba(0, 82, 255, 0.08);
  border: 1px solid rgba(0, 82, 255, 0.16);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--semantic-up);
  box-shadow: 0 0 0 0 rgba(5, 177, 105, 0.6);
  animation: livePulse 1.8s ease-out infinite;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(5, 177, 105, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(5, 177, 105, 0); }
  100% { box-shadow: 0 0 0 0 rgba(5, 177, 105, 0); }
}

.eyebrow,
.panel-kicker {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 24px;
  font-size: clamp(44px, 7vw, 80px);
  font-weight: 400;
  line-height: 1;
}

.grad-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 로또 추첨기 사진 + 드럼 공 오버레이 (히어로 상단) */
.lotto-machine {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 0 24px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 42px -22px rgba(16, 24, 64, 0.5);
}

.machine-photo,
.machine-video {
  display: block;
  width: 100%;
  height: auto;
}

/* 히어로 제목: 항상 한 줄 */
.hero-copy h1 {
  font-size: clamp(38px, 5.2vw, 62px);
  white-space: nowrap;
}

/* 히어로 설명: 항상 두 줄 (<br>로 고정) */
.hero-description {
  text-wrap: balance;
}

.hero-description br {
  display: block;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 400;
  line-height: 1.08;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.hero-description,
.section-copy p {
  color: var(--body);
  font-size: 18px;
}

.hero-orbits {
  position: absolute;
  inset: -40px -20px auto auto;
  right: -10px;
  top: 0;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}

.orbit-ball {
  position: absolute;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 12px 24px -10px rgba(16, 24, 64, 0.5);
}

.orbit-ball:nth-child(1) { top: -30px; right: -30px; animation: bob 5s ease-in-out infinite; }
.orbit-ball:nth-child(2) { top: 70px; right: -70px; animation: bob 6.5s ease-in-out infinite 0.4s; }
.orbit-ball:nth-child(3) { top: 180px; right: -10px; animation: bob 5.8s ease-in-out infinite 0.8s; }
.orbit-ball:nth-child(4) { top: 280px; right: -60px; animation: bob 7s ease-in-out infinite 0.2s; }

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-16px) rotate(4deg); }
}

/* ---------- Generator panel ---------- */
.generator-panel {
  position: relative;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 32px;
  box-shadow: var(--shadow-card);
}

.panel-header,
.selector-header,
.button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-header {
  margin-bottom: 24px;
}

.panel-header h2 {
  margin-bottom: 0;
  font-size: 32px;
}

.ghost-button,
.primary-button,
.secondary-button {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-weight: 700;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease,
    box-shadow 200ms ease;
}

.ghost-button {
  background: var(--surface-strong);
  color: var(--ink);
  padding: 10px 16px;
}

.primary-button {
  position: relative;
  flex: 1 1 220px;
  background: var(--grad-cta);
  background-size: 180% 180%;
  color: var(--on-primary);
  padding: 16px 28px;
  box-shadow: var(--shadow-glow);
  overflow: hidden;
  animation: ctaShift 6s ease infinite;
}

@keyframes ctaShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.primary-button::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-18deg);
}

.primary-button:hover::after {
  animation: shine 900ms ease;
}

@keyframes shine {
  to { left: 130%; }
}

.secondary-button {
  flex: 1 1 260px;
  background: var(--surface-strong);
  color: var(--ink);
  padding: 16px 24px;
}

.primary-button:hover,
.primary-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 26px 54px -16px rgba(0, 82, 255, 0.6);
}

.ghost-button:hover,
.secondary-button:hover,
.ghost-button:focus-visible,
.secondary-button:focus-visible {
  background: #dfe4ec;
}

.ghost-button:active,
.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.primary-button.is-loading {
  opacity: 0.85;
  cursor: progress;
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
}

/* ---------- Result card ---------- */
.result-card {
  position: relative;
  margin-bottom: 24px;
  border-radius: var(--radius-card);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(0, 82, 255, 0.28), transparent 55%),
    radial-gradient(120% 140% at 100% 0%, rgba(107, 78, 255, 0.26), transparent 55%),
    var(--surface-dark);
  color: var(--on-dark);
  padding: 28px;
  overflow: hidden;
}

.result-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--on-dark-soft);
  font-size: 13px;
  font-weight: 700;
}

.result-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px 1px var(--cyan);
}

.result-balls,
.number-grid {
  display: grid;
  gap: 10px;
}

.result-balls {
  grid-template-columns: repeat(6, minmax(44px, 1fr));
  min-height: 56px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.ball,
.number-button {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.ball {
  background: var(--canvas);
  color: var(--ink);
  font-size: 20px;
}

.ball.tier-1,
.number-button.tier-1.is-selected {
  background: #f4b000;
  color: #0a0b0d;
}

.ball.tier-2,
.number-button.tier-2.is-selected {
  background: #0052ff;
  color: #ffffff;
}

.ball.tier-3,
.number-button.tier-3.is-selected {
  background: #cf202f;
  color: #ffffff;
}

.ball.tier-4,
.number-button.tier-4.is-selected {
  background: #5b616e;
  color: #ffffff;
}

.ball.tier-5,
.number-button.tier-5.is-selected {
  background: #05b169;
  color: #ffffff;
}

/* 추첨 챔버에서 빈 공이 섞이는 단계 */
.ball-empty {
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.22);
  color: transparent;
}

.ball.is-mixing {
  animation: chamberJitter 0.5s ease-in-out infinite;
}

@keyframes chamberJitter {
  0%, 100% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(-5px) translateX(2px); }
  50% { transform: translateY(4px) translateX(-2px); }
  75% { transform: translateY(-2px) translateX(1px); }
}

/* 당첨 공이 아래에서 위로 솟아오르는 단계 */
.ball.is-rising {
  animation: ballRise 560ms cubic-bezier(0.18, 0.9, 0.3, 1.45) both;
}

@keyframes ballRise {
  0% { transform: translateY(48px) scale(0.4); opacity: 0; }
  55% { transform: translateY(-9px) scale(1.12); opacity: 1; }
  78% { transform: translateY(3px) scale(0.97); }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.ball.is-hot {
  box-shadow: 0 0 18px -2px rgba(244, 176, 0, 0.6);
}

.ball.is-hot::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(244, 176, 0, 0.65);
  animation: hotPing 1.9s ease-out infinite;
}

@keyframes hotPing {
  0% { transform: scale(0.85); opacity: 0.85; }
  100% { transform: scale(1.3); opacity: 0; }
}

.result-note {
  margin: 0;
  color: var(--on-dark-soft);
  font-size: 14px;
}

.button-row {
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.selector-header {
  margin-bottom: 16px;
}

.selector-header h3,
.selector-header .panel-kicker {
  margin-bottom: 0;
}

.selected-count {
  margin: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  padding: 6px 12px;
  color: var(--body);
  font-size: 13px;
  font-weight: 700;
}

.selected-count #selectedCount {
  color: var(--primary);
}

.number-grid {
  grid-template-columns: repeat(9, 1fr);
  margin-bottom: 24px;
}

.number-button {
  border: 1px solid var(--hairline);
  background: var(--canvas);
  color: var(--ink);
  cursor: pointer;
  min-width: 0;
  transition: border-color 150ms ease, background-color 150ms ease,
    transform 150ms ease, box-shadow 150ms ease;
}

.number-button.is-hot-number::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warning);
}

.number-button:hover,
.number-button:focus-visible {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 10px 18px -10px rgba(0, 82, 255, 0.55);
}

.number-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
  transform: none;
  box-shadow: none;
}

.number-button.is-selected {
  border-color: transparent;
  animation: pickPop 280ms cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

.number-button.is-selected.is-hot-number::after {
  background: rgba(255, 255, 255, 0.9);
}

@keyframes pickPop {
  0% { transform: scale(0.8); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ---------- Insights ---------- */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.insight-grid > div {
  border: 1px solid var(--hairline-soft);
  border-radius: 16px;
  background: var(--surface-soft);
  padding: 16px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.insight-grid > div:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 82, 255, 0.3);
  box-shadow: 0 12px 24px -16px rgba(0, 82, 255, 0.5);
}

.insight-hot {
  background: linear-gradient(135deg, rgba(244, 176, 0, 0.12), rgba(255, 122, 60, 0.12)) !important;
  border-color: rgba(244, 176, 0, 0.3) !important;
}

.insight-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.insight-grid strong {
  font-size: 15px;
}

/* ---------- Content bands ---------- */
.content-band,
.seo-band,
.faq-band,
.data-band {
  padding: 96px 0;
}

.content-band,
.faq-band {
  background: var(--surface-soft);
}

.data-band {
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(107, 78, 255, 0.08), transparent 60%),
    radial-gradient(70% 110% at 0% 100%, rgba(0, 82, 255, 0.07), transparent 60%),
    var(--canvas);
}

.content-band > *,
.seo-band > *,
.faq-band > *,
.data-band > * {
  width: min(1200px, calc(100% - 40px));
  margin-right: auto;
  margin-left: auto;
}

.section-copy {
  max-width: 760px;
  margin-bottom: 40px;
}

.method-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.method-list article {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--canvas);
  padding: 32px;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.method-list article:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 82, 255, 0.25);
  box-shadow: var(--shadow-card);
}

.method-list span {
  display: inline-grid;
  width: 36px;
  height: 36px;
  margin-bottom: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.method-list p,
.faq-list p {
  margin-bottom: 0;
  color: var(--body);
}

/* ---------- Data band ---------- */
.data-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.data-card {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--canvas);
  padding: 28px;
  box-shadow: 0 10px 30px -22px rgba(16, 24, 64, 0.4);
}

.data-card header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.data-card h3 {
  margin-bottom: 0;
  font-size: 17px;
}

.data-pill {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
}

.data-pill--hot {
  background: var(--grad-hot);
}

.data-pill--cold {
  background: linear-gradient(135deg, #0052ff, #00b4ff);
}

.freq-list {
  display: grid;
  gap: 14px;
}

.freq-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
}

.freq-ball {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.freq-ball.tier-1 { background: #f4b000; color: #0a0b0d; }
.freq-ball.tier-2 { background: #0052ff; }
.freq-ball.tier-3 { background: #cf202f; }
.freq-ball.tier-4 { background: #5b616e; }
.freq-ball.tier-5 { background: #05b169; }

.freq-bar {
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  overflow: hidden;
}

.freq-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--grad-primary);
  transform: scaleX(var(--ratio, 1));
  transform-origin: left;
}

.data-card--hot .freq-fill {
  background: var(--grad-hot);
}

.freq-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- FAQ ---------- */
.faq-list {
  display: grid;
  gap: 12px;
}

.faq-list details {
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--canvas);
  padding: 20px 24px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.faq-list details[open] {
  border-color: rgba(0, 82, 255, 0.3);
  box-shadow: 0 12px 28px -20px rgba(0, 82, 255, 0.5);
}

.faq-list summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
}

.faq-list p {
  padding-top: 14px;
}

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  border-top: 1px solid var(--hairline-soft);
  padding: 32px 0;
  color: var(--muted);
  font-size: 13px;
}

.site-footer p {
  margin-bottom: 0;
}

/* ---------- Live ticker ---------- */
.ticker {
  position: sticky;
  top: 64px;
  z-index: 9;
  display: flex;
  align-items: center;
  height: 44px;
  background: var(--ink);
  color: #fff;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ticker-tag {
  position: relative;
  z-index: 2;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 100%;
  padding: 0 16px 0 20px;
  background: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ff5a5c;
}

.ticker-tag::after {
  content: "";
  position: absolute;
  right: -26px;
  top: 0;
  bottom: 0;
  width: 26px;
  background: linear-gradient(90deg, var(--ink), transparent);
}

.ticker-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff5a5c;
  box-shadow: 0 0 0 0 rgba(255, 90, 92, 0.6);
  animation: tickerPulse 1.6s ease-out infinite;
}

@keyframes tickerPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 90, 92, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(255, 90, 92, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 90, 92, 0); }
}

.ticker-viewport {
  position: relative;
  flex: 1 1 auto;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
  animation: tickerScroll 52s linear infinite;
}

.ticker:hover .ticker-track {
  animation-play-state: paused;
}

@keyframes tickerScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
}

.ticker-item b {
  color: #fff;
  font-weight: 800;
}

.ticker-item em {
  font-style: normal;
  font-weight: 800;
  color: #ffd34d;
}

.ticker-sep {
  color: rgba(255, 255, 255, 0.22);
  font-size: 8px;
}

/* ---------- Recent results ---------- */
.recent-band {
  padding: 96px 0;
  background:
    radial-gradient(70% 120% at 0% 0%, rgba(0, 82, 255, 0.06), transparent 60%),
    var(--canvas);
}

.recent-band > * {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

.draw-list {
  display: grid;
  gap: 14px;
}

.draw-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 18px 24px;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background: var(--canvas);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.draw-row:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 82, 255, 0.2);
  box-shadow: var(--shadow-card);
}

.draw-row.is-latest {
  border-color: rgba(0, 82, 255, 0.35);
  background: linear-gradient(120deg, rgba(0, 82, 255, 0.06), rgba(107, 78, 255, 0.05));
  box-shadow: 0 16px 40px -26px rgba(0, 82, 255, 0.6);
}

.draw-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.draw-no {
  font-size: 16px;
  font-weight: 800;
}

.draw-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.draw-flag {
  align-self: flex-start;
  margin-top: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--grad-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.draw-balls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.draw-ball {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.draw-ball.tier-1 { background: #f4b000; color: #0a0b0d; }
.draw-ball.tier-2 { background: #0052ff; }
.draw-ball.tier-3 { background: #cf202f; }
.draw-ball.tier-4 { background: #5b616e; }
.draw-ball.tier-5 { background: #05b169; }

.draw-plus {
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  padding: 0 2px;
}

.draw-bonus {
  box-shadow: 0 0 0 2px var(--canvas), 0 0 0 4px var(--warning);
}

.draw-prize {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}

.draw-prize span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.draw-prize strong {
  font-size: 16px;
}

[id] {
  scroll-margin-top: 118px;
}

/* ---------- Scroll reveal (only when JS active) ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 620ms ease, transform 620ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

.js .method-list article[data-reveal]:nth-child(2) { transition-delay: 90ms; }
.js .method-list article[data-reveal]:nth-child(3) { transition-delay: 180ms; }
.js .data-card[data-reveal]:nth-child(2) { transition-delay: 110ms; }

.freq-fill {
  transition: transform 950ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.js [data-reveal] .freq-fill {
  transform: scaleX(0);
}

.js [data-reveal].is-visible .freq-fill {
  transform: scaleX(var(--ratio, 1));
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-copy {
    max-width: 720px;
  }

  .hero-orbits {
    display: none;
  }

  .method-list {
    grid-template-columns: 1fr;
  }

  .insight-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .nav {
    width: min(100% - 28px, 1200px);
  }

  .nav-links {
    display: none;
  }

  .hero,
  .content-band > *,
  .seo-band > *,
  .faq-band > *,
  .data-band > *,
  .site-footer {
    width: min(100% - 28px, 1200px);
  }

  .hero {
    padding-top: 40px;
  }

  .content-band,
  .seo-band,
  .faq-band,
  .data-band {
    padding: 64px 0;
  }

  h1 {
    font-size: clamp(40px, 12vw, 56px);
  }

  .hero-description,
  .section-copy p {
    font-size: 16px;
  }

  .generator-panel {
    padding: 20px;
  }

  .panel-header {
    align-items: flex-start;
  }

  .panel-header h2 {
    font-size: 26px;
  }

  .result-card {
    padding: 20px;
  }

  .result-balls {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .number-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .data-grid {
    grid-template-columns: 1fr;
  }

  .recent-band > * {
    width: min(100% - 28px, 1200px);
  }

  .recent-band {
    padding: 64px 0;
  }

  .draw-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px 18px;
  }

  .draw-prize {
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    text-align: left;
  }

  .draw-ball {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .draw-balls {
    gap: 6px;
  }

  .ticker-tag {
    padding-left: 14px;
    font-size: 11px;
  }

  .ticker-item {
    font-size: 12px;
    padding: 0 14px;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .ball {
    font-size: 18px;
  }

  .button-row {
    gap: 10px;
  }

  .primary-button,
  .secondary-button {
    flex: 1 1 100%;
  }

  .insight-grid {
    grid-template-columns: 1fr 1fr;
  }

  .number-grid {
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .freq-fill,
  .js [data-reveal] .freq-fill,
  .js [data-reveal].is-visible .freq-fill {
    transform: scaleX(var(--ratio, 1));
  }
}
