:root {
  --bg: #090b14;
  --surface: #111424;
  --line: #373151;
  --ink: #f4f2fa;
  --muted: #b5afc9;
  --lavender: #c8b6ff;
  --gold: #e5c478;
  --display: "Noto Serif KR", "Batang", "AppleMyungjo", Georgia, serif;
}
body { background: var(--bg); color: var(--ink); }
.topbar { background: #090b14f5; }
.top-inner { max-width: 1180px; }
.brand-word, .hero h1, .page-intro h1, .result-panel h2, .article-title {
  font-family: var(--display);
  letter-spacing: -.035em;
}
.brand-word { color: var(--gold); }
.navigation a[aria-current=page] { color: var(--lavender); background: #251c40; }
.home { background: radial-gradient(ellipse at 50% 5%, #22163e, transparent 45%); }
.hero-art {
  height: 30rem;
  background: linear-gradient(0deg,var(--bg),#090b1480 65%,#090b1440),
              url("/dream-sky.webp") center 45%/cover no-repeat;
  mask-image: linear-gradient(#000 55%,transparent);
}
.hero {
  display: grid;
  justify-items: center;
  text-align: center;
  padding: clamp(2rem,6vw,4rem) 0 1.65rem;
}
.hero-mascot {
  position: relative;
  inset: auto;
  width: clamp(7rem,16vw,11rem);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 0 25px #a487f976);
}
.hero h1 {
  font-size: clamp(2.1rem,5vw,4rem);
  line-height: 1.23;
  margin: .6rem 0 1rem;
}
.hero h1 em, .page-intro .section-icon { color: var(--gold); }
.hero p { max-width: 44ch; color: var(--muted); }
.home-content { max-width: 740px; }
.kicker { color: var(--gold); border-color: #e5c4784d; background: #171224; }
.panel {
  background: linear-gradient(145deg,#181c32,#111424 70%);
  border-color: var(--line);
  border-radius: 18px;
}
.composer { border-color: #8e75e670; box-shadow: 0 0 40px #6e40c426; }
.textarea-wrap, .search { background: #0c0e1a; }
.textarea-wrap textarea { min-height: 8rem; }
.primary {
  color: #170c32;
  background: linear-gradient(110deg,#c8b6ff,#ab90ff);
}
.secondary, .chip { background: #211a36; border-color: #41355e; }
.popular { padding: 1rem 0; }
.inner { max-width: 1060px; }
.page-intro {
  display: grid;
  justify-items: center;
  gap: .55rem;
  text-align: center;
  padding: clamp(1.5rem,4vw,3rem) 1rem;
  background: radial-gradient(ellipse at 50% 5%,#322150b3,transparent 72%);
}
.page-intro h1 { margin: 0; }
.page-intro p { max-width: 68ch; }
.view-dictionary .search { margin: 0 auto 1.25rem; max-width: 46rem; }
.dictionary-popular { margin: 1.5rem 0; }
.dictionary-popular h2 { font-family: var(--display); margin-bottom: .75rem; }
.dictionary-popular ul { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .75rem; list-style: none; padding: 0; }
.dictionary-popular a { display: grid; gap: .5rem; min-height: 100%; padding: 1rem; color: var(--lavender); }
.dictionary .result-panel h2 { color: var(--lavender); }
.view-result .result-grid > .result-panel:first-child { border-color: #a787d58c; }
.view-result .details { display: grid; gap: .65rem; }
.view-result .details > div { display: block; padding: .8rem 1rem; background: #0d1020; border: 1px solid var(--line); border-radius: .75rem; }
.view-result .details dt { margin-bottom: .35rem; }
.view-result .result-panel p { white-space: pre-wrap; }
.lucky-panel { text-align: center; border-color: #e5c47866; background: radial-gradient(ellipse at top,#35234e,#14162a 70%); }
.lucky-panel h2, .lucky-panel .lotto-numbers { justify-content: center; }
.lucky-panel h2, .hall-stats dd { color: var(--gold); }
.lucky-panel details { text-align: start; width: min(100%,44rem); margin-inline: auto; }
.lucky-panel > button, .lucky-panel > select { justify-self: center; }
.lotto-numbers li { background: radial-gradient(circle at 35% 25%,#563d82,#231838 80%); }
.lotto-numbers [class*="lotto-range-"] {
  background: var(--ball-color);
  border-color: transparent;
  color: var(--ball-text, #fff);
}
.lotto-numbers .lotto-range-1 { --ball-color: #e59400; --ball-text: #211400; }
.lotto-numbers .lotto-range-2 { --ball-color: #0064c9; }
.lotto-numbers .lotto-range-3 { --ball-color: #d7254b; }
.lotto-numbers .lotto-range-4 { --ball-color: #6d7282; }
.lotto-numbers .lotto-range-5 { --ball-color: #22863f; }
.lotto-numbers .lotto-plus { font-size: 1.25rem; }

.hall-stats > div, .hall-record-meta > div { border-color: var(--line); background: #101323; }
.hall-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
.hall-stats dd { font-size: clamp(1.1rem,2.5vw,1.65rem); }
.hall-card { padding: 1rem; border: 1px solid var(--line); border-radius: 1rem; background: #121426; }
.hall-card h3 { color: var(--lavender); margin: 0 0 .5rem; }
.hall-card .lotto-numbers { flex-wrap: wrap; margin: .65rem 0; }
.hall-fixtures { margin-top: 1rem; padding: .85rem; border: 1px dashed var(--line); border-radius: 1rem; }
.ritual {
  position: fixed;
  z-index: 12;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  padding: 1rem;
  pointer-events: none;
  background: #090b14ef;
}
.ritual-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(16rem,75vw);
  aspect-ratio: 1;
  background: radial-gradient(circle,#8952de6b,transparent 67%);
}
.ritual-stage img {
  width: 64%;
  filter: drop-shadow(0 0 24px #be8fff);
  animation: mascot-float 3s ease-in-out infinite;
}
.ritual-stage span { position: absolute; color: var(--gold); font-size: 1.5rem; animation: starlight 2s ease-in-out infinite alternate; }
.ritual-stage span:nth-of-type(1) { inset: 12% auto auto 15%; }
.ritual-stage span:nth-of-type(2) { inset: 28% 10% auto auto; animation-delay: -.6s; }
.ritual-stage span:nth-of-type(3) { inset: auto auto 11% 27%; animation-delay: -1.3s; }
.ritual strong { font: 700 1.6rem var(--display); color: var(--lavender); }
.ritual p { margin-top: .5rem; color: var(--muted); }
@keyframes starlight { from { opacity: .35; } to { opacity: 1; } }
@media (max-width: 580px) {
  .hero-art { height: 24rem; }
  .dictionary-popular ul { grid-template-columns: 1fr; }
  .hall-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .footer .spread { display: grid; }
  .footer-right { justify-items: start; text-align: start; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-mascot, .ritual-stage img, .ritual-stage span { animation: none; }
}
.official-draw { padding: 1rem; border: 1px solid #e5c47855; border-radius: 1rem; background: #1d182b; }
.official-draw .global-controls { display: grid; justify-items: start; margin: 0; }
.official-draw h3 { margin: 0; color: var(--gold); }
.service-intro {
  display: grid;
  grid-template-columns: minmax(0,7fr) minmax(0,5fr);
  align-items: center;
  gap: clamp(1.5rem,4vw,3.5rem);
  padding-block: clamp(2rem,5vw,3.75rem);
  border-top: 1px solid var(--line);
}
.service-overview > h2, .service-mascot h3 {
  font-family: var(--display);
  line-height: 1.35;
}
.service-overview > h2 { font-size: clamp(1.45rem,3vw,2rem); }
.service-overview > p { margin-top: .55rem; }
.service-intro p, .service-mascot blockquote { color: var(--muted); }
.service-cards {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: clamp(.75rem,2vw,1.2rem);
  margin-top: 1.5rem;
}
.service-card {
  padding: clamp(.9rem,2vw,1.25rem);
  transition: border-color .25s, box-shadow .25s;
}
.service-card > span { color: var(--gold); font-size: 1.2rem; }
.service-card:nth-child(even) > span { color: var(--lavender); }
.service-card h3 { font-size: 1rem; margin: .5rem 0 .3rem; }
.service-card p { font-size: .875rem; }
@media (hover:hover) {
  .service-card:hover {
    border-color: #9979e3;
    box-shadow: 0 0 22px #9f78ed38;
  }
}
.service-mascot {
  padding: clamp(1.2rem,3vw,1.75rem);
  text-align: center;
}
.service-mascot-art { position: relative; width: min(100%,17.5rem); margin-inline: auto; }
.service-mascot-art img { display: block; width: 100%; height: auto; border-radius: .9rem; }
.service-mascot-art span {
  position: absolute;
  color: var(--gold);
  text-shadow: 0 0 .6rem var(--lavender);
  animation: starlight 3s ease-in-out infinite alternate;
}
.service-mascot-art span:nth-of-type(1) { top: 16%; right: 13%; }
.service-mascot-art span:nth-of-type(2) { bottom: 13%; left: 15%; animation-delay: -1s; }
.service-mascot-art span:nth-of-type(3) { bottom: 20%; right: 13%; animation-delay: -2s; }
.service-mascot h3 { margin: 1.15rem 0 .5rem; color: var(--gold); }
.service-mascot blockquote { max-width: 33ch; margin: 0 auto; font-size: .9rem; }
@media (max-width: 760px) {
  .service-intro { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .service-cards { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .service-mascot-art span { animation: none; }
}
.startup-splash {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: .45rem;
  padding: 1.5rem;
  background: radial-gradient(ellipse at center,#251743,var(--bg) 68%);
  text-align: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease-out, visibility 0s linear .2s;
}
[data-startup="loading"] .startup-splash {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0s;
}
[data-startup="redirect"] .shell { visibility: hidden; }
.startup-art { position: relative; width: clamp(7.5rem,28vw,12rem); }
.startup-art img { display: block; width: 100%; height: auto; filter: drop-shadow(0 0 20px #b595ed80); }
.startup-art span { position: absolute; color: var(--gold); animation: starlight 2.4s ease-in-out infinite alternate; }
.startup-art span:nth-of-type(1) { top: 10%; left: 8%; }
.startup-art span:nth-of-type(2) { top: 34%; right: 5%; animation-delay: -.8s; }
.startup-art span:nth-of-type(3) { bottom: 14%; left: 6%; animation-delay: -1.6s; }
.startup-splash strong { color: var(--gold); font: 700 clamp(1.75rem,6vw,2.5rem)/1.2 var(--display); }
.startup-wordmark { color: var(--gold); font-size: .72rem; letter-spacing: .24em; }
.startup-splash p { margin-top: .65rem; font: 600 1.1rem/1.4 var(--display); }
.startup-splash small { color: var(--muted); }
.static-composer > p { color: var(--muted); }
#dictionary details a { color: var(--lavender); }
#dictionary summary { cursor: pointer; }
@starting-style {
  [data-startup="loading"] .startup-splash { opacity: 0; }
}
@media (max-width: 850px) {
  .top-inner:has(.menu-toggle[hidden]) .navigation { display: flex; position: static; padding: 0; background: none; border: 0; box-shadow: none; }
  .top-inner:has(.menu-toggle[hidden]) { height: auto; min-height: 62px; flex-wrap: wrap; gap: .4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .startup-splash { transition: none; }
  .startup-art span { animation: none; }
}
