:root {
  --night: #100925;
  --night-soft: #1b1037;
  --violet: #6f4de0;
  --gold: #e9c779;
  --gold-pale: #f6e7b9;
  --ink: #f8f4ff;
  --muted: #c6bada;
  --card: rgba(35, 20, 67, .78);
  --line: rgba(233, 199, 121, .24);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(111,77,224,.24), transparent 34rem),
    radial-gradient(circle at 90% 35%, rgba(82,45,156,.17), transparent 28rem),
    var(--night);
  font-family: "Noto Sans Thai", "Thonburi", "Tahoma", sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .23;
  background-image: radial-gradient(#fff 0.7px, transparent 0.7px);
  background-size: 27px 27px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.sky span {
  position: fixed;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold-pale);
  box-shadow: 18vw 12vh #fff, 71vw 17vh #fff, 86vw 43vh #e9c779, 13vw 64vh #fff, 54vw 78vh #fff;
  animation: twinkle 3.6s infinite alternate;
}
.sky span:nth-child(2) { left: 33vw; top: 7vh; animation-delay: 1s; opacity: .5; }
.sky span:nth-child(3) { left: 62vw; top: 28vh; animation-delay: 2s; opacity: .65; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 20px 12px;
  background: rgba(16, 9, 37, .78);
  border-bottom: 1px solid rgba(255,255,255,.06);
  backdrop-filter: blur(18px);
}

.brand { display: flex; gap: 9px; align-items: center; color: var(--gold-pale); text-decoration: none; font-weight: 800; letter-spacing: .01em; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--gold); border-radius: 50%; }
.sound-button { border: 1px solid var(--line); color: var(--muted); background: transparent; border-radius: 999px; padding: 7px 11px; font-size: .75rem; }

main { width: min(100%, 720px); margin: 0 auto; }
.hero { min-height: calc(100svh - 57px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 46px 22px 36px; text-align: center; }
.eyebrow { margin: 0 0 10px; color: var(--gold); font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 17px; font-family: Georgia, "Noto Serif Thai", serif; font-size: clamp(2.15rem, 10vw, 4.3rem); line-height: 1.06; letter-spacing: -.035em; }
h1 em { color: var(--gold-pale); font-weight: 500; }
.intro { max-width: 470px; color: var(--muted); line-height: 1.75; font-size: .97rem; }

.oracle-wrap { position: relative; display: grid; place-items: center; width: 286px; height: 286px; margin: 18px auto 11px; }
.orbit { position: absolute; border: 1px solid var(--line); border-radius: 50%; }
.orbit-one { inset: 5px; animation: spin 22s linear infinite; }
.orbit-one::before, .orbit-two::after { content: "✦"; position: absolute; color: var(--gold); font-size: 13px; }
.orbit-one::before { top: 18px; left: 43px; }
.orbit-two { inset: 26px; border-style: dashed; animation: spin 18s linear infinite reverse; }
.orbit-two::after { right: 12px; bottom: 44px; }
.oracle {
  position: relative;
  z-index: 2;
  width: 196px;
  height: 196px;
  border-radius: 50%;
  border: 1px solid rgba(246,231,185,.7);
  color: var(--ink);
  background: radial-gradient(circle at 35% 25%, #7d5ae7, #3a226e 46%, #170d31 74%);
  box-shadow: 0 0 0 10px rgba(233,199,121,.04), 0 20px 70px rgba(111,77,224,.38), inset 0 0 34px rgba(255,255,255,.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.oracle:active { transform: scale(.96); }
.oracle-stars { color: var(--gold); font-size: .7rem; letter-spacing: .2em; }
.oracle strong { margin: 4px 0 -2px; font-family: Georgia, serif; color: var(--gold-pale); font-size: 4rem; line-height: 1; }
.oracle span:last-child { color: #e5dcf4; font-size: .8rem; }
.oracle.drawing { animation: pulse .65s ease; }
.hint { color: #8f82a8; font-size: .75rem; }

.result, .recent, .about { margin: 0 16px 24px; border: 1px solid var(--line); border-radius: 26px; background: var(--card); backdrop-filter: blur(14px); }
.result { padding: 26px 20px 20px; box-shadow: 0 18px 70px rgba(0,0,0,.2); }
.result-heading { display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.result-heading h2 { margin: 0; font-family: Georgia, "Noto Serif Thai", serif; color: var(--gold-pale); font-size: 1.72rem; line-height: 1.25; }
.number-seal { flex: 0 0 auto; display: grid; place-items: center; width: 62px; height: 62px; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold-pale); font-family: Georgia, serif; font-size: 1.55rem; box-shadow: inset 0 0 18px rgba(233,199,121,.1); }
.message { margin: 22px 0; padding-left: 14px; border-left: 2px solid var(--gold); color: #e4daf2; line-height: 1.75; }
.reading-grid { display: grid; gap: 10px; }
.reading-grid article { padding: 15px; border: 1px solid rgba(255,255,255,.07); border-radius: 16px; background: rgba(255,255,255,.035); }
.reading-grid span { float: right; color: var(--gold); }
.reading-grid h3 { margin-bottom: 6px; font-size: .9rem; color: var(--gold-pale); }
.reading-grid p, .story-card p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.65; }
.story-card { margin-top: 14px; padding: 18px; border-radius: 18px; color: #211537; background: linear-gradient(145deg, #f2dfaa, #caa55c); }
.story-card .story-label { margin-bottom: 6px; color: #684f20; font-size: .67rem; font-weight: 800; letter-spacing: .14em; }
.story-card h3 { margin-bottom: 7px; font-family: Georgia, "Noto Serif Thai", serif; font-size: 1.2rem; }
.story-card p:last-child { color: #503b24; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 15px; }
.actions button { min-height: 48px; border-radius: 14px; cursor: pointer; }
.primary-action { border: 0; background: var(--gold); color: #24183e; font-weight: 800; }
.secondary-action { border: 1px solid var(--line); background: transparent; color: var(--ink); }

.recent { padding: 20px; }
.section-title { display: flex; justify-content: space-between; align-items: center; }
.section-title h2 { margin: 0; font-size: 1rem; }
.section-title button { border: 0; background: transparent; color: #9b8caf; font-size: .75rem; }
.history { display: flex; gap: 10px; margin-top: 13px; overflow-x: auto; scrollbar-width: none; }
.history button { min-width: 55px; height: 55px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.04); color: var(--gold-pale); font: 1.1rem Georgia, serif; }
.about { position: relative; overflow: hidden; padding: 34px 24px; text-align: center; }
.about h2 { font: 1.75rem/1.25 Georgia, "Noto Serif Thai", serif; color: var(--gold-pale); }
.about > p:not(.eyebrow), .story-index p { color: var(--muted); font-size: 1rem; line-height: 1.85; }
.story-index { display: grid; gap: 14px; margin: 26px 0; text-align: left; }
.story-index article { padding: 18px; border: 1px solid rgba(255,255,255,.09); border-radius: 16px; background: rgba(255,255,255,.035); }
.story-index h3 { margin-bottom: 8px; color: var(--gold-pale); font-size: 1.1rem; }
.story-index p { margin: 0; }
.editorial-note { margin: 0; text-align: left; }
.moon { display: inline-grid; place-items: center; width: 52px; height: 52px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 50%; color: var(--gold); font-size: 1.7rem; }

.laodee-cta { display: flex; justify-content: center; padding: 8px 16px 28px; }
.hero .laodee-cta { width: 100%; padding-bottom: 0; }
.laodee-cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  width: min(100%, 360px);
  padding: 12px 24px;
  border-radius: 14px;
  color: #24183e;
  background: var(--gold);
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  transition: box-shadow .2s ease, transform .2s ease;
}
.laodee-cta a:hover { box-shadow: 0 0 18px rgba(233, 199, 121, .42); transform: translateY(-2px); }
.laodee-cta a:focus-visible { outline: 2px solid var(--gold-pale); outline-offset: 4px; }

footer { padding: 30px 24px calc(30px + env(safe-area-inset-bottom)); text-align: center; color: #887b9f; font-size: .72rem; line-height: 1.6; }
footer strong { display: block; margin-bottom: 5px; color: var(--gold-pale); font-size: .9rem; }
footer p { max-width: 500px; margin: 0 auto; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, 20px); opacity: 0; padding: 10px 16px; border-radius: 999px; color: #24183e; background: var(--gold-pale); font-size: .82rem; transition: .25s ease; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
[hidden] { display: none !important; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes twinkle { to { opacity: .15; transform: scale(.75); } }
@keyframes pulse { 50% { transform: scale(.91); filter: brightness(1.35); } }

@media (min-width: 660px) {
  .reading-grid { grid-template-columns: repeat(3, 1fr); }
  .hero { padding-top: 70px; }
  .result, .recent, .about { margin-left: 0; margin-right: 0; }
}

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

/* Content hub: shared editorial layout */
nav[aria-label="เมนูหลัก"] { display:flex; gap:4px; overflow-x:auto; padding:10px max(16px, calc((100vw - 1120px)/2)); background:#170e2c; scrollbar-width:thin; }
nav[aria-label="เมนูหลัก"] a { flex:0 0 auto; color:var(--gold-pale); text-decoration:none; padding:12px 13px; border-radius:10px; font-size:.9rem; }
nav[aria-label="เมนูหลัก"] a:hover,nav[aria-label="เมนูหลัก"] a:focus-visible {background:#382457;outline:2px solid var(--gold);}
.content-main { width:min(100% - 32px, 1000px); min-height:65vh; margin:32px auto 80px; }
.content-main h1 { font-size:clamp(2rem,5vw,3.4rem);line-height:1.3;max-width:850px; }
.content-main a {color:var(--gold-pale)}
.breadcrumbs {color:var(--muted);font-size:.9rem;line-height:1.8;margin-bottom:25px;overflow-wrap:anywhere}
.lead {color:var(--muted);font-size:1.12rem;line-height:1.9;max-width:760px}
.card-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:18px;margin:20px 0 35px}
.content-card {border:1px solid var(--line);border-radius:18px;overflow:hidden;background:var(--card)}
.content-card a {text-decoration:none;color:inherit;display:block;height:100%}
.content-card img {display:block;width:100%;height:auto;aspect-ratio:3/2;object-fit:cover}
.card-body {display:block;padding:17px}.card-body small {color:var(--gold)}.card-body h3 {font-size:1.15rem;line-height:1.5;margin:8px 0}.card-body p {color:var(--muted);font-size:.95rem;line-height:1.7;margin:0}
.hub-section {padding:25px 16px;margin:16px 0}.hub-section h2,.related h2 {color:var(--gold-pale)}
.category-links {display:flex;flex-wrap:wrap;gap:10px}.category-links a {border:1px solid var(--line);border-radius:12px;padding:12px;color:var(--gold-pale);text-decoration:none}
.article-cover {display:block;width:100%;height:auto;aspect-ratio:3/2;object-fit:cover;border-radius:20px;margin:25px 0 32px}
.byline {font-size:.9rem;color:var(--muted);line-height:1.7}
.toc {border:1px solid var(--line);background:var(--card);border-radius:16px;padding:20px;margin:32px 0;max-width:760px}
.toc ol {padding-left:24px;line-height:2}.toc a {color:var(--gold-pale)}
.article-body {max-width:760px}.article-body section {scroll-margin-top:90px}.article-body h2 {font-size:1.65rem;line-height:1.4;color:var(--gold-pale);margin:40px 0 15px}.article-body p {font-size:1.05rem;line-height:1.95;color:#e4daf2}
.disclaimer {max-width:760px;border-left:3px solid var(--gold);padding:15px;background:var(--card);line-height:1.8}
.share-tools {display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:35px 0 55px}.share-tools a,.share-tools button {min-height:44px;padding:10px 14px;background:var(--night-soft);border:1px solid var(--line);border-radius:10px;color:var(--gold-pale);text-decoration:none;font:inherit;cursor:pointer}.share-status {width:100%;color:var(--muted)}
.related {border-top:1px solid var(--line);padding-top:20px}
a:focus-visible,button:focus-visible {outline:2px solid var(--gold-pale);outline-offset:3px}
@media(max-width:430px){.content-main{margin-top:22px}.hub-section{padding:18px 16px}.hero{min-height:auto}.content-main h1{font-size:2rem}}
.article-body h3 {font-size:1.22rem;line-height:1.5;color:var(--gold);margin:24px 0 10px}

/* Analytics choice uses the site's purple and gold palette. */
footer a,footer .consent-settings {color:var(--gold-pale)}
footer .consent-settings {background:none;border:0;text-decoration:underline;cursor:pointer;font:inherit;padding:0}
.analytics-consent[hidden] {display:none}
.analytics-consent {position:fixed;z-index:1000;bottom:12px;left:12px;right:12px;max-width:680px;margin:auto;padding:20px;background:#241637;color:#f6efff;border:1px solid var(--gold);border-radius:18px;box-shadow:0 12px 45px #0009;line-height:1.65}
.analytics-consent p {margin:0 0 10px;font-size:1rem}
.analytics-consent a {color:var(--gold-pale)}
.consent-actions {display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}
.consent-actions button {flex:1 1 180px;min-height:48px;border:1px solid var(--gold);border-radius:12px;background:#382457;color:#fff;font:inherit;cursor:pointer}
.consent-actions button:hover,.consent-actions button:focus-visible {background:#594079;outline:2px solid var(--gold-pale)}
.privacy-copy {max-width:760px}.privacy-copy h2 {color:var(--gold-pale);margin-top:25px}.privacy-copy p {font-size:1.05rem;line-height:1.9}
.contact-card {max-width:600px;padding:22px;border:1px solid var(--line);border-radius:18px;background:var(--card);overflow-wrap:anywhere}
.contact-card p {margin:0 0 14px}.contact-card p:last-child {margin:14px 0 0}
.line-button {display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:10px 20px;border-radius:12px;background:var(--gold);color:#24183e!important;font-weight:700;text-decoration:none}
.line-button:hover {box-shadow:0 0 18px rgba(233,199,121,.42)}
.home-contact {display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px 18px;margin:0 auto 34px;padding:12px 16px;max-width:560px;border-top:1px solid var(--line);color:var(--muted);font-size:.95rem;text-align:center}
.home-contact a {display:inline-flex;align-items:center;min-height:48px;color:var(--gold-pale);font-weight:700;white-space:normal}
footer p + p {margin-top:12px;font-size:.88rem;line-height:2}

.reading-actions {display:flex;flex-wrap:wrap;gap:12px;margin:24px 0}.reading-actions a{display:inline-flex;align-items:center;min-height:48px;padding:10px 15px;border:1px solid var(--line);border-radius:12px;text-decoration:none;background:var(--card);line-height:1.5}.reading-actions a:first-child{border-color:var(--gold)}
@media(max-width:430px){.reading-actions{display:grid}.reading-actions a{width:100%}}
