:root {
  color-scheme: light;
  --text: #17231e;
  --muted: #54625b;
  --line: #dce5df;
  --accent: #14664b;
  --tint: #f5faf7;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 1rem/1.65 "Malgun Gothic", system-ui, sans-serif;
}
a { color: inherit; }
header { border-bottom: 1px solid var(--line); }
.bar, main, footer { width: min(1056px, calc(100% - 32px)); margin-inline: auto; }
.bar, nav, .ticket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.bar { min-height: 68px; }
.brand, nav a, .button { text-decoration: none; }
.brand { font-size: 1.35rem; font-weight: 800; white-space: nowrap; }
.brand span, .eyebrow { color: var(--accent); }
nav a { font-size: .875rem; font-weight: 700; color: var(--muted); }
nav a:hover { color: var(--accent); }
.eyebrow { margin: 0 0 .5rem; font-size: .875rem; font-weight: 800; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.75rem, 4vw, 2.7rem); line-height: 1.15; letter-spacing: -.06em; }
h2 { font-size: clamp(1.45rem, 4vw, 2rem); letter-spacing: -.045em; }
h3 { font-size: 1rem; }
.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: .6rem;
  font: inherit;
  font-weight: 800;
  padding: .7rem 1rem;
  cursor: pointer;
}
.button:hover { background: #172642; }
.ticket, .generator, .retailers {
  padding: clamp(1rem, 3.5vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
}
.ticket { background: var(--tint); }
.ticket-head { padding-bottom: .85rem; border-bottom: 1px solid var(--line); font-weight: 800; }
#edition { color: var(--accent); font-size: .875rem; }
#teaser { margin-top: 1rem; }
.balls { display: flex; gap: clamp(.25rem, 1.2vw, .65rem); margin: .9rem 0; }
.ball {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: clamp(1.85rem, 7vw, 3.25rem);
  aspect-ratio: 1;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  font-size: clamp(1rem, 3.5vw, 1.25rem);
  font-variant-numeric: tabular-nums;
}
.ball[data-band="0"] { background-color: #e08f00; }
.ball[data-band="1"] { background-color: #0063cc; }
.ball[data-band="2"] { background-color: #d8314f; }
.ball[data-band="3"] { background-color: #6e7382; }
.ball[data-band="4"] { background-color: #2c9e44; }
.ticket-note, #teaser, .generator p, .retailers p { color: var(--muted); }
form { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; margin-top: 1.15rem; }
select {
  appearance: none;
  background: #fff;
  color: var(--text);
  border: 1px solid #9caea2;
  border-radius: .6rem;
  padding: .65rem 2rem .65rem .7rem;
  font: inherit;
}
.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute;
  top: 43%;
  right: .85rem;
  width: .42rem;
  height: .42rem;
  border: solid var(--muted);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  pointer-events: none;
}
.row { display: flex; align-items: center; gap: .5rem; border-bottom: 1px solid var(--line); }
.row .balls { margin: .6rem 0; }
.row > span { min-width: 2.5rem; color: var(--muted); font-size: .875rem; }
.note { margin-top: 1rem; font-size: .875rem; }
.retailers { margin-top: 1rem; }
.retailers ul { list-style: none; padding: 0; margin: 1rem 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: .65rem; }
.retailers li { border: 1px solid var(--line); border-radius: .65rem; padding: .85rem; }
.retailers li p { font-size: .9rem; margin: .2rem 0 .45rem; }
main a:not(.button) { color: var(--accent); text-underline-offset: .2em; }
footer { border-top: 1px solid var(--line); padding: 1rem 0; color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (max-width: 380px) {
  nav { gap: .5rem; }
  nav a { font-size: .8125rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.official-draw {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.25rem;
  padding: clamp(.85rem, 3vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
}
.draw-summary p:last-child, .draw-label, .draw-details span { color: var(--muted); font-size: .875rem; }
.draw-numbers { display: flex; align-items: center; gap: clamp(.35rem, 1.7vw, 1rem); justify-content: center; }
.draw-numbers .balls { margin: .3rem 0 0; }
.draw-numbers .ball { width: clamp(1.75rem, 6vw, 2.9rem); }
.bonus { border-left: 1px solid var(--line); padding-left: clamp(.35rem, 1.7vw, 1rem); }
.draw-details { display: grid; }
.draw-details a { margin-top: .3rem; font-size: .875rem; }
.dashboard { display: grid; grid-template-columns: 1fr 1.15fr; align-items: start; gap: 1rem; margin-top: 1rem; }
main { padding-bottom: 1.5rem; }
@media (max-width: 860px) {
  .official-draw { grid-template-columns: 1fr; gap: .65rem; }
  .draw-numbers { justify-content: flex-start; }
}
@media (max-width: 700px) { .dashboard { grid-template-columns: 1fr; } }

.account-link {
  padding: .4rem .8rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  color: var(--accent);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 800;
  white-space: nowrap;
}
.account-link:hover { background: var(--tint); }
.dashboard-heading {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 1.25rem 0 1rem;
  padding: clamp(1.25rem, 5vw, 3.25rem);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: linear-gradient(115deg, #fff 12%, #edf8f1 100%);
}
.brand-intro h1 { font-size: clamp(1.85rem, 5vw, 3.55rem); line-height: 1.12; }
.brand-intro > p:not(.eyebrow), .account-panel > p:not(.eyebrow) { margin: .75rem 0 1.1rem; color: var(--muted); }
.brand-art {
  position: absolute;
  z-index: -1;
  right: 5%;
  top: 50%;
  width: min(35vw, 19rem);
  aspect-ratio: 1;
  transform: translateY(-50%);
  color: #2e7d5a;
  display: grid;
  place-content: center;
}
.brand-art::before, .brand-art::after, .brand-art i {
  content: "";
  position: absolute;
  inset: 18%;
  border: 1px solid #82ba9e;
  border-radius: 50%;
  transform: scaleY(.52) rotate(0deg);
}
.brand-art::after { transform: rotate(60deg) scaleY(.52); }
.brand-art i { transform: rotate(-60deg) scaleY(.52); }
.brand-art b { font-size: clamp(2rem, 7vw, 6rem); line-height: 1; }
.brand-art span { position: absolute; top: 21%; right: 13%; font-size: 1.45rem; }
.account-panel { max-width: 34rem; margin: 2rem auto; padding: 1.5rem; background: var(--tint); border: 1px solid var(--line); border-radius: 1rem; }
@media (max-width: 590px) {
  .bar { display: grid; grid-template-columns: 1fr auto; gap: .5rem; padding: .7rem 0; }
  .bar nav { grid-area: 2 / 1 / 3 / 3; justify-content: flex-start; gap: 1rem; }
  .brand-art { opacity: .28; right: 1%; }
}

.fortune-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 1rem; margin-top: 1rem; }
.fortune-card { min-width: 0; border: 1px solid var(--line); border-radius: 1.1rem; padding: clamp(1rem, 3.5vw, 2rem); }
.fortune-card > p { color: var(--muted); }
.fortune-card form { align-items: end; }
.fortune-card label { font-size: .875rem; font-weight: 700; }
#fortune-form label { align-self: center; }
.birth-field { display: grid; gap: .25rem; }
.birth-field input {
  min-height: 2.75rem; max-width: 100%; background: #fff; color: var(--text);
  border: 1px solid #9caea2; border-radius: .6rem; padding: .5rem; font: inherit;
}
.reading { margin-top: 1rem; padding: .85rem; border-radius: .65rem; background: var(--tint); }
.reading p + p { margin-top: .45rem; }
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; margin: .25rem 0 .7rem; text-align: center; }
.pillars div { background: #fff; border-radius: .4rem; padding: .35rem .2rem; }
.pillars dt { color: var(--muted); font-size: .875rem; }
.pillars dd { margin: 0; font-size: 1.25rem; font-weight: 800; }
.bar nav { flex-wrap: wrap; row-gap: .3rem; }
@media (max-width: 700px) { .fortune-grid { grid-template-columns: 1fr; } }

/* Main navigation and editorial page layouts */
:root { --text: #172033; --muted: #525d70; --line: #e4e8ef; --accent: #263a62; --tint: #f4f6fa; }
body { font-family: system-ui, "Malgun Gothic", sans-serif; }
header { background: #fff; }
.bar, main, footer { width: min(1140px, calc(100% - 48px)); }
.bar { min-height: 78px; gap: clamp(.65rem, 2.5vw, 2.4rem); }
.brand { color: #172642; font-size: 1.5rem; }
.bar nav { flex: 1; justify-content: center; gap: clamp(.3rem, 1.4vw, 1.1rem); }
.bar nav a { padding: .45rem .65rem; border-radius: .65rem; white-space: nowrap; }
.bar nav a[aria-current="page"] { background: var(--tint); color: var(--accent); }
.account-link { background: #fff; cursor: pointer; line-height: 1.4; }
.home-hero, .page-banner { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: clamp(1.25rem, 5vw, 4.5rem); padding: clamp(1.65rem, 5.2vw, 4.25rem); border: 1px solid var(--line); border-radius: 1.75rem; margin-block: 1.6rem; background: #f6f7fa; }
.home-hero h1 { font-size: clamp(1.65rem, 4vw, 3.45rem); letter-spacing: -.075em; line-height: 1.17; word-break: keep-all; }
.page-banner h1 { font-size: clamp(1.95rem, 5vw, 3.45rem); line-height: 1.16; }
.home-hero p, .page-banner p { color: var(--muted); margin-top: .9rem; word-break: keep-all; }
.home-hero .button { margin-top: 1.25rem; }
.home-hero img, .page-banner img, .home-card img { width: 100%; height: auto; object-fit: cover; display: block; }
.home-hero img, .page-banner img { border-radius: 1rem; aspect-ratio: 3 / 2; }
.page-stores .page-banner { background: #f0f5fb; }
.page-fortune .page-banner { background: #fff8ee; }
.page-saju .page-banner { background: #f7f3fa; }
.home-directory { margin: 2.75rem 0 1.5rem; }
.home-directory h2 { margin-bottom: .85rem; }
.home-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: .85rem; }
.home-card { display: block; text-decoration: none; color: var(--text) !important; overflow: hidden; border: 1px solid var(--line); border-radius: 1rem; }
.home-card:hover { border-color: #8290aa; }
.home-card img { aspect-ratio: 16 / 9; }
.home-card div { padding: .9rem 1rem 1rem; }
.home-card h2 { font-size: 1.1rem; margin: 0 0 .3rem; }
.home-card p { color: var(--muted); font-size: .9rem; }
.fortune-card { max-width: 52rem; }
.fortune-card h2, .retailers h2 { margin-bottom: .25rem; }
footer a { text-decoration: none; }
@media(max-width: 760px) {
  .bar, main, footer { width: min(1140px, calc(100% - 32px)); }
  .bar { display: grid; grid-template-columns: 1fr auto; gap: .5rem; padding: .6rem 0; }
  .bar nav { grid-area: 2 / 1 / 3 / 3; justify-content: flex-start; gap: .15rem; }
  .bar nav a { padding: .35rem .5rem; }
  .home-hero, .page-banner { grid-template-columns: 1fr; border-radius: 1.15rem; }
  .page-banner img { aspect-ratio: 2 / 1; }
  .home-cards { grid-template-columns: repeat(2, 1fr); }
}
