/* ===== จุดธูปขอเลข — mobile-first ===== */
/* ฟอนต์เก็บไว้ในเว็บเอง (OFL) ไม่โหลดจาก Google */
@font-face { font-family: "Noto Sans Thai"; src: url("/fonts/noto-sans-thai.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Chonburi"; src: url("/fonts/chonburi.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
:root {
    --bg: #140906;
    --bg-2: #1e0f0a;
    --card: #23120c;
    --card-2: #2c170f;
    --line: rgba(227, 181, 91, .16);
    --line-2: rgba(227, 181, 91, .32);
    --ink: #f7ead6;
    --muted: #b8a088;
    --dim: #82705f;
    --gold: #e3b55b;
    --gold-2: #f6d896;
    --red: #b3392f;
    --lacquer: #6e1610;
    --ember: #ff8a3d;
    --ok: #7fc98f;
    --accent: var(--gold);
    --radius: 18px;
    --display: 'Chonburi', 'Noto Sans Thai', serif;
    --body: 'Noto Sans Thai', system-ui, sans-serif;
    --safe-b: env(safe-area-inset-bottom, 0px);
    color-scheme: dark;
}

/* ----- ธีมตามแท่นบูชา: สีพื้น การ์ด และลายพื้นหลัง ----- */
.theme-saffron { --accent: #f0a83c; --bg: #1c0903; --card: #2b1108; --card-2: #36170b; --halo: 240, 140, 40; --halo2: 255, 190, 70; }
.theme-jade    { --accent: #7cc4a4; --bg: #03100b; --card: #0b1d15; --card-2: #10281d; --halo: 70, 170, 120; --halo2: 160, 230, 150; }
.theme-naga    { --accent: #6fb3d9; --bg: #020915; --card: #0a1a2b; --card-2: #0e2338; --halo: 40, 120, 210; --halo2: 120, 200, 255; }
.theme-indigo  { --accent: #b49ae8; --bg: #0a0516; --card: #170f2a; --card-2: #1f1438; --halo: 130, 70, 210; --halo2: 240, 200, 120; }
.theme-gold    { --accent: #f2c66b; --bg: #150c04; --card: #24170a; --card-2: #2e1e0d; --halo: 235, 170, 70; --halo2: 255, 220, 140; }
.theme-crimson { --accent: #f0b443; --bg: #1a0405; --card: #2c0a0b; --card-2: #380e0f; --halo: 210, 40, 40; --halo2: 250, 190, 70; }

body[class*="theme-"] {
    background:
        radial-gradient(120% 55% at 50% -12%, rgba(var(--halo), .42), transparent 62%),
        radial-gradient(90% 45% at 50% 112%, rgba(var(--halo2), .14), transparent 70%),
        var(--bg);
    background-attachment: fixed;
}
body[class*="theme-"]::before {
    content: '';
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    opacity: .5;
    background-size: 64px 64px;
}
.theme-saffron::before { /* ดอกดาวเรืองเล็กๆ */
    background-image: radial-gradient(circle at 16px 16px, rgba(255,160,40,.16) 0 3px, transparent 4px),
                      radial-gradient(circle at 48px 48px, rgba(255,210,80,.12) 0 2px, transparent 3px);
}
.theme-jade::before { /* ใบไม้ */
    background-image: radial-gradient(ellipse 7px 3px at 20px 20px, rgba(120,220,160,.14) 98%, transparent),
                      radial-gradient(ellipse 3px 7px at 50px 44px, rgba(120,220,160,.1) 98%, transparent);
}
.theme-naga::before { /* เกล็ดนาค */
    background-size: 28px 16px;
    background-image: radial-gradient(circle at 14px 0, transparent 9px, rgba(140,210,255,.12) 10px, transparent 11px),
                      radial-gradient(circle at 0 8px, transparent 9px, rgba(140,210,255,.08) 10px, transparent 11px),
                      radial-gradient(circle at 28px 8px, transparent 9px, rgba(140,210,255,.08) 10px, transparent 11px);
}
.theme-indigo::before { /* ดาวประกายทอง */
    background-image: radial-gradient(circle at 12px 18px, rgba(255,225,150,.35) 0 1px, transparent 1.5px),
                      radial-gradient(circle at 44px 50px, rgba(255,255,255,.25) 0 1px, transparent 1.5px),
                      radial-gradient(circle at 52px 10px, rgba(255,225,150,.2) 0 .8px, transparent 1.3px);
}
.theme-gold::before { /* แสงเทียนจุดเล็กๆ */
    background-image: radial-gradient(circle at 20px 22px, rgba(255,200,110,.18) 0 1.6px, transparent 2.6px),
                      radial-gradient(circle at 50px 50px, rgba(255,230,170,.12) 0 1.2px, transparent 2px);
}
.theme-crimson::before { /* เหรียญทองจีน */
    background-image: radial-gradient(circle at 18px 18px, transparent 2px, rgba(250,190,70,.16) 2.5px 4.5px, transparent 5px),
                      radial-gradient(circle at 50px 48px, rgba(250,190,70,.1) 0 1.5px, transparent 2.5px);
}
.theme-saffron .stage, .theme-jade .stage, .theme-naga .stage, .theme-indigo .stage, .theme-gold .stage, .theme-crimson .stage {
    border-color: color-mix(in srgb, var(--accent) 35%, transparent);
    box-shadow: inset 0 0 60px rgba(0,0,0,.7), 0 0 40px -10px rgba(var(--halo), .45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background:
        radial-gradient(120% 60% at 50% -10%, rgba(179, 57, 47, .28), transparent 60%),
        radial-gradient(80% 40% at 50% 110%, rgba(227, 181, 91, .08), transparent 70%),
        var(--bg);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
small { font-size: .8em; color: var(--muted); font-weight: 400; }
code { background: rgba(255,255,255,.08); padding: 1px 6px; border-radius: 6px; }

.app {
    max-width: 520px;
    margin: 0 auto;
    padding: 16px 16px calc(84px + var(--safe-b));
}

/* ---------- type ---------- */
.label {
    display: inline-block;
    font-size: 13px;
    color: var(--muted);
}
.section { margin-top: 28px; }
.section__title, .pagehead h1, .hero__title, .topbar__title, .card__title {
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: .01em;
}
.section__title { font-size: 20px; margin: 0 0 12px; color: var(--gold-2); }
.link { color: var(--gold); text-decoration: none; font-weight: 600; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 18px 8px 8px; }
.hero__eyebrow { margin: 0; color: var(--gold); font-size: 14px; }
.hero__title {
    margin: 4px 0 6px;
    font-size: clamp(34px, 11vw, 46px);
    line-height: 1.25;
    background: linear-gradient(180deg, #fff1cf, var(--gold) 70%, #a9732a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 40px rgba(227, 181, 91, .15);
}
.hero__lead { margin: 0 auto; max-width: 30em; color: var(--muted); font-size: 15px; }

/* ---------- cards ---------- */
.card {
    background: linear-gradient(180deg, var(--card-2), var(--card));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 16px;
    box-shadow: 0 10px 30px -18px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.03);
}
.card__title { font-size: 18px; margin: 0 0 8px; color: var(--gold-2); }
.pill {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 99px;
    background: rgba(227, 181, 91, .12);
    color: var(--gold-2);
    border: 1px solid var(--line);
    white-space: nowrap;
}

.draw-card__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.draw-card__date { font-family: var(--display); font-size: 22px; margin: 2px 0 10px; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.countdown div {
    text-align: center;
    background: rgba(0,0,0,.25);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 0 4px;
}
.countdown b { display: block; font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--gold-2); line-height: 1.3; font-variant-numeric: tabular-nums; }
.countdown span { font-size: 11px; color: var(--muted); }
.draw-card__last {
    margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line);
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    font-size: 13px; color: var(--muted);
}
.draw-card__nums { display: flex; gap: 14px; text-align: right; }
.draw-card__nums span { display: flex; flex-direction: column; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; }
.draw-card__nums small { font-size: 11px; }
.draw-card__nums b { font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--gold-2); }

.calendar-card ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.calendar-card li { display: flex; justify-content: space-between; align-items: baseline; }
.calendar-card b { font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: .25em; color: var(--gold-2); }

/* ---------- shrine list ---------- */
.shrines { display: grid; gap: 12px; }
.shrine {
    --accent: var(--gold);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: var(--radius);
    text-decoration: none;
    background:
        radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 55%),
        var(--card);
    border: 1px solid var(--line);
    transition: transform .15s ease, border-color .15s ease;
}
.shrine.has-scene {
    background:
        linear-gradient(90deg, rgba(10,4,2,.92) 0%, rgba(10,4,2,.72) 55%, rgba(10,4,2,.35) 100%),
        var(--scene) center 18% / cover no-repeat;
    border-color: color-mix(in srgb, var(--accent) 35%, transparent);
    min-height: 96px;
}
.shrine:active { transform: scale(.985); }
.shrine:hover { border-color: var(--line-2); }
.shrine--saffron { --accent: #f0a83c; }
.shrine--jade { --accent: #7cc4a4; }
.shrine--naga { --accent: #6fb3d9; }
.shrine--indigo { --accent: #b49ae8; }
.shrine--gold { --accent: #f2c66b; }
.shrine--crimson { --accent: #f0b443; }
.shrine__body { display: flex; flex-direction: column; min-width: 0; }
.shrine__name { font-family: var(--display); font-size: 19px; line-height: 1.35; }
.shrine__sub { font-size: 13px; color: var(--accent); }
.shrine__desc { font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.shrine__go { width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 2; }

.seal {
    width: 54px; height: 54px;
    display: grid; place-items: center;
    border-radius: 50%;
    font-family: var(--display);
    font-size: 26px;
    color: #2a1208;
    background: radial-gradient(circle at 35% 30%, #fff3d0, var(--accent) 55%, color-mix(in srgb, var(--accent) 55%, #3a1a0a));
    box-shadow: 0 0 0 3px rgba(0,0,0,.35), 0 0 0 4px color-mix(in srgb, var(--accent) 60%, transparent), 0 8px 22px -6px color-mix(in srgb, var(--accent) 60%, transparent);
}
.seal--small { width: 40px; height: 40px; font-size: 19px; }

.how ol { margin: 0 0 10px; padding-left: 20px; color: var(--muted); font-size: 14px; display: grid; gap: 6px; }
.how b { color: var(--ink); font-weight: 600; }

/* ---------- shrine page ---------- */
.topbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-bottom: 12px; }
.topbar__back { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.topbar__back svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2; }
.topbar__title { font-size: 22px; margin: 0; line-height: 1.3; }
.topbar__sub { margin: 0; font-size: 13px; color: var(--muted); }

.stage {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #0b0503;
    aspect-ratio: 4 / 5;
    max-height: 56vh;
    width: 100%;
    margin: 0 auto;
    box-shadow: inset 0 0 60px rgba(0,0,0,.8);
}
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y pinch-zoom; }
.stage__status {
    position: absolute; left: 12px; right: 12px; top: 10px;
    margin: 0; text-align: center; font-size: 14px; color: var(--gold-2);
    text-shadow: 0 1px 8px rgba(0,0,0,.9);
    pointer-events: none;
}

.offering { margin-top: 16px; display: grid; gap: 16px; }
.field { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.field legend, .field__label { font-size: 14px; font-weight: 600; padding: 0; }
.field input, .field textarea, .field select {
    width: 100%;
    background: rgba(0,0,0,.3);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 16px;
    outline: none;
    resize: vertical;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }

.incenses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.incense, .chip { position: relative; display: block; min-width: 0; }
.chip { display: inline-block; }
.incense input, .chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.incense__card {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    height: 100%;
    padding: 12px 6px 10px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--card);
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .15s;
}
.incense input:checked + .incense__card {
    border-color: var(--accent);
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 14%, var(--card)), var(--card));
    box-shadow: 0 0 0 1px var(--accent) inset;
}
.incense input:focus-visible + .incense__card { outline: 2px solid var(--accent); outline-offset: 2px; }
.incense__sticks { display: flex; justify-content: center; align-items: flex-end; gap: 4px; min-height: 40px; margin-bottom: 6px; }
.incense__sticks i {
    position: relative;
    width: 9px; height: 24px; margin-bottom: 5px;
    border-radius: 1px;
    background: linear-gradient(180deg, #ffb46b 0 2px, #efe0c2 2px, #d4bd95);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--stick) 70%, transparent);
}
.incense__sticks i::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 1px; height: 5px; background: #8e8a84; }
.incense--gold .incense__sticks i {
    background: linear-gradient(180deg, #ffb46b 0 2px, #fff1c4 2px, #e2b24c 45%, #a8741f);
    box-shadow: inset 0 0 0 1px rgba(150,28,18,.75), 0 0 6px rgba(255,205,90,.45);
}
.incense--gold .incense__sticks i::after, .incense--dragon .incense__sticks i::after { background: #d9b25a; }
.incense--dragon .incense__sticks i {
    background:
        linear-gradient(180deg, #ffb46b 0 2px, #f2c55e 2px 4px, transparent 4px calc(100% - 2px), #f2c55e calc(100% - 2px)),
        linear-gradient(90deg, #d23a2a, #8a100b);
    box-shadow: inset 0 0 0 1px rgba(246,204,96,.8), 0 0 7px rgba(220,60,40,.5);
}
.incense__name { font-weight: 700; font-size: 15px; }
.incense__blurb { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.incense__price { margin-top: 6px; font-size: 11px; color: var(--gold-2); background: rgba(227,181,91,.1); border-radius: 99px; padding: 1px 8px; }

/* ธูป 4 หลัก / ธูป 6 หลัก (ใช้คู่กับธูปที่เลือก) */
.addons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.digit { position: relative; display: block; min-width: 0; }
.digit input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.digit__card {
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px;
    height: 100%; padding: 10px 6px; border-radius: 14px;
    border: 1px solid var(--line); background: var(--card); cursor: pointer;
    transition: border-color .15s, background .15s;
}
.digit__card b { font-size: 15px; }
.digit__card small { font-size: 11.5px; line-height: 1.35; }
.digit__left { margin-top: 4px; font-size: 11px; color: var(--gold-2); background: rgba(227,181,91,.1); border-radius: 99px; padding: 1px 8px; }
.digit input:checked + .digit__card {
    border-color: var(--gold);
    background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 14%, var(--card)), var(--card));
    box-shadow: 0 0 0 1px var(--gold) inset;
}
.digit input:focus-visible + .digit__card { outline: 2px solid var(--gold); outline-offset: 2px; }
.digit input:disabled + .digit__card { opacity: .5; cursor: not-allowed; }
.fullres__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fullres__list li {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line-2);
    background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 10%, var(--card)), var(--card));
}
.fullres__pos { font-size: 13px; color: var(--muted); }
.fullres__nums { display: flex; gap: 14px; align-items: baseline; }
.fullres__nums span { font-size: 12px; color: var(--muted); }
.fullres__nums b { font-family: var(--display); font-weight: 400; font-size: 26px; color: var(--gold-2); letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.fullres__nums b.fullres__four { font-size: 20px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip span {
    display: inline-block; padding: 6px 12px; border-radius: 99px; font-size: 14px;
    border: 1px solid var(--line); background: var(--card); cursor: pointer;
}
.chip input:checked + span { border-color: var(--accent); color: #1b0c06; background: var(--accent); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* hold-to-light */
.hold {
    position: relative; overflow: hidden;
    width: 100%;
    min-height: 62px;
    border-radius: 99px;
    border: 1px solid color-mix(in srgb, var(--accent) 70%, #000);
    background: linear-gradient(180deg, #8d2219, var(--lacquer));
    font-family: var(--display);
    font-size: 19px;
    color: #fff3dc;
    cursor: pointer;
    user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
    touch-action: none;
    box-shadow: 0 10px 30px -10px rgba(179, 57, 47, .8), inset 0 1px 0 rgba(255,255,255,.18);
}
.hold:disabled { filter: grayscale(.8); opacity: .6; cursor: not-allowed; }
.hold__fill {
    position: absolute; inset: 0;
    transform-origin: left center;
    transform: scaleX(var(--p, 0));
    background: linear-gradient(90deg, #ff8a3d, var(--gold-2));
    opacity: .9;
}
.hold__text { position: relative; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.hold.is-busy { pointer-events: none; }
.hold.is-share { background: linear-gradient(180deg, #f3cf7a, #c8902f); color: #2a1406; border-color: rgba(255,230,170,.7); }
.hold.is-share .hold__text { text-shadow: none; }
.hold.is-share .hold__fill { display: none; }
.offering__note { margin: -6px 0 0; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- result ---------- */
.result { margin-top: 18px; animation: rise .5s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.result__eyebrow { text-align: center; margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.result__main { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big {
    text-align: center;
    padding: 14px 8px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--line-2);
    background: radial-gradient(100% 90% at 50% 0%, rgba(227,181,91,.18), transparent 70%), var(--card);
}
.big__label { display: block; font-size: 13px; color: var(--muted); }
.big__num {
    display: block;
    font-family: var(--display); font-weight: 400;
    font-size: clamp(52px, 17vw, 72px);
    line-height: 1.15;
    color: var(--gold-2);
    text-shadow: 0 0 24px rgba(246, 216, 150, .35);
    font-variant-numeric: tabular-nums;
}
.big--three .big__num { font-size: clamp(42px, 13vw, 56px); padding-top: 8px; }
.big__meta { font-size: 12.5px; color: var(--muted); }
.personal {
    margin-top: 10px; padding: 12px 14px; border-radius: 14px;
    border: 1px dashed var(--line-2); font-size: 14px; color: var(--muted);
    display: flex; align-items: center; gap: 12px;
}
.personal b { font-family: var(--display); font-weight: 400; font-size: 30px; color: var(--accent); line-height: 1; }
.result__h { font-size: 15px; margin: 20px 0 8px; }
.sticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.stick {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    overflow: hidden;
}
.stick summary {
    list-style: none;
    display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px;
    padding: 10px 12px; cursor: pointer;
}
.stick summary::-webkit-details-marker { display: none; }
.stick__pos { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: rgba(227,181,91,.12); color: var(--gold-2); }
.stick__formula { font-size: 14px; }
.stick__formula small { display: block; font-size: 12px; }
.stick__nums { font-family: var(--display); font-size: 22px; color: var(--gold-2); white-space: nowrap; }
.stick__nums span { font-size: 14px; color: var(--muted); margin-left: 6px; }
.stick ul { margin: 0; padding: 0 14px 12px 50px; font-size: 13.5px; color: var(--muted); display: grid; gap: 4px; }
.stick[open] { border-color: var(--line-2); }
.stick--echo .stick__pos { background: var(--accent); color: #1b0c06; }

.result__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.result__actions .btn:last-child { grid-column: 1 / -1; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 10px 18px;
    border-radius: 99px; border: 1px solid transparent;
    background: linear-gradient(180deg, var(--gold-2), var(--gold));
    color: #2a1208; font-weight: 700; font-size: 15px;
    text-decoration: none; cursor: pointer;
}
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); font-weight: 600; }
.btn--small { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.link-btn { background: none; border: 0; color: var(--red); cursor: pointer; padding: 4px; font-size: 13px; }

/* ---------- pages ---------- */
.pagehead { padding: 10px 0 0; }
.pagehead h1 { margin: 0; font-size: 28px; color: var(--gold-2); line-height: 1.35; }
.pagehead p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.pagehead--row { display: flex; justify-content: space-between; align-items: center; }

.book__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.book__head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 19px; }
.book__result { text-align: right; line-height: 1.1; }
.book__result small { display: block; }
.book__result b { font-family: var(--display); font-weight: 400; font-size: 30px; color: var(--gold-2); }
.book__list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.book__list li { padding-top: 12px; border-top: 1px dashed var(--line); }
.book__meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.book__nums { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag { font-variant-numeric: tabular-nums; font-size: 14px; padding: 2px 10px; border-radius: 8px; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.tag--strong { background: rgba(227,181,91,.16); color: var(--gold-2); border-color: var(--line-2); font-weight: 700; }
.book__hit { margin: 8px 0 0; color: var(--ok); font-weight: 600; font-size: 14px; }
.book__miss { margin: 8px 0 0; color: var(--dim); font-size: 13px; }
.empty { text-align: center; padding: 48px 0; color: var(--muted); }

.digits { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; height: 150px; margin-top: 10px; align-items: end; }
.digits__col { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 4px; }
.digits__bar { width: 70%; height: var(--h); min-height: 3px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--gold-2), #a26a24); }
.digits__count { font-size: 11px; color: var(--muted); }
.digits__col b { font-family: var(--display); font-weight: 400; font-size: 18px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two-col .card { margin-top: 16px; }
.rank { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.rank li { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); }
.rank b { font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--ink); }
.results { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; font-variant-numeric: tabular-nums; }
.results th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.results td { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.results b { color: var(--gold-2); }

/* admin */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.stats-row b { display: block; font-family: var(--display); font-weight: 400; font-size: 26px; color: var(--gold-2); }
.stats-row span { font-size: 12px; color: var(--muted); }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; margin: 10px 0 14px; }
.grid-form .btn, .field--wide { grid-column: 1 / -1; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.admin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.admin-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; border-bottom: 1px dashed var(--line); padding: 4px 0; }
.admin-list b { color: var(--gold-2); }
.flash { background: rgba(127, 201, 143, .14); border: 1px solid rgba(127, 201, 143, .4); color: var(--ok); border-radius: 12px; padding: 10px 14px; }
.error { color: #ff8f7f; font-size: 14px; }
.stack { display: grid; gap: 12px; }

/* ---------- chrome ---------- */
.warn-box { margin: 36px 0 0; padding: 12px 14px; border: 1px solid rgba(227,181,91,.28); border-radius: 14px; background: rgba(0,0,0,.22); font-size: 12px; line-height: 1.65; color: var(--muted); }
.warn-box > b { display: block; color: var(--gold-2); font-size: 13px; margin-bottom: 2px; }
.warn-box p { margin: 4px 0 0; }
.warn-box p b { color: var(--ink); font-weight: 600; }
.result__warn { margin: 14px 0 0; font-size: 12px; line-height: 1.6; color: var(--dim); text-align: center; }
.disclaimer { margin: 14px 0 0; font-size: 12px; line-height: 1.6; color: var(--dim); text-align: center; }

.tabbar {
    position: fixed; z-index: 20;
    /* ชิดขอบล่างจอ: พื้นหลังเลยลงไปใต้แถบท่าทางของมือถือ ปุ่มอยู่เหนือ safe-area */
    left: 0; right: 0; bottom: 0; margin-inline: auto;
    width: min(480px, 100%);
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    padding: 6px 8px calc(6px + var(--safe-b));
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    background: rgba(28, 14, 9, .86);
    border: 1px solid var(--line);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 16px 40px -12px rgba(0,0,0,.9);
}
.tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 6px 0; border-radius: 16px;
    text-decoration: none; font-size: 12px; color: var(--muted);
}
.tabbar svg { width: 22px; height: 22px; fill: currentColor; }
.tabbar a.is-active { color: var(--gold-2); background: rgba(227,181,91,.1); }

.install {
    position: fixed; z-index: 30;
    /* จัดกลางด้วย margin (ไม่ใช้ transform เพราะ animation rise ทับ transform จนกล่องเลื่อนไปขวา) */
    left: 0; right: 0; margin-inline: auto;
    bottom: calc(78px + var(--safe-b));
    width: min(440px, calc(100% - 24px));
    display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px;
    padding: 12px 10px 12px 14px;
    border-radius: 16px;
    background: linear-gradient(180deg, #3a1a10, #24110b);
    border: 1px solid var(--line-2);
    box-shadow: 0 16px 40px -10px rgba(0,0,0,.9);
    animation: rise .4s ease both;
}
.install[hidden] { display: none; }

.consent {
    position: fixed; z-index: 35;
    /* จัดกลางด้วย margin (ไม่ใช้ transform เพราะ animation rise ทับ transform จนกล่องเลื่อนไปขวา) */
    left: 0; right: 0; margin-inline: auto;
    bottom: calc(78px + var(--safe-b));
    width: min(440px, calc(100% - 24px));
    padding: 12px 14px;
    border-radius: 16px;
    background: linear-gradient(180deg, #3a1a10, #24110b);
    border: 1px solid var(--line-2);
    box-shadow: 0 16px 40px -10px rgba(0,0,0,.9);
    animation: rise .4s ease both;
}
.consent[hidden] { display: none; }
.consent__text { margin: 0 0 10px; font-size: 13px; line-height: 1.55; color: var(--muted); }
.consent__text a, .disclaimer a { color: var(--gold-2); }
.consent__actions { display: flex; gap: 8px; justify-content: flex-end; }
.consent__actions .btn { flex: 1; white-space: nowrap; padding-inline: 10px; }
.admin .consent, body:not(:has(.tabbar)) .consent { bottom: calc(14px + var(--safe-b)); }
body.has-actionbar .consent { bottom: calc(104px + var(--safe-b)); }

.prose h2 { font-size: 17px; color: var(--gold-2); margin: 22px 0 6px; }
.prose p, .prose li { font-size: 14px; line-height: 1.7; color: var(--ink); }
.prose small { color: var(--muted); }
.prose code { font-size: 12px; background: rgba(255,255,255,.06); padding: 1px 5px; border-radius: 5px; }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.ptable { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.55; }
.ptable th, .ptable td { text-align: left; vertical-align: top; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.ptable th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.ptable td:first-child { min-width: 96px; font-weight: 600; }
.ptable td:last-child { min-width: 80px; color: var(--muted); }
.install__text { display: flex; flex-direction: column; font-size: 13px; line-height: 1.4; color: var(--muted); }
.install__text strong { color: var(--ink); font-size: 14px; }
.install__close { background: none; border: 0; font-size: 22px; color: var(--muted); padding: 0 4px; cursor: pointer; }

.toast {
    position: fixed; z-index: 40; left: 0; right: 0; margin-inline: auto; width: max-content; max-width: calc(100% - 24px);
    top: calc(14px + env(safe-area-inset-top, 0px));
    background: #2c170f; border: 1px solid var(--line-2); color: var(--ink);
    padding: 10px 16px; border-radius: 12px; font-size: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.6);
    animation: rise .25s ease both;
}

.lottabs {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px;
    margin-top: 16px; padding: 4px;
    border-radius: 16px; background: rgba(0,0,0,.28); border: 1px solid var(--line);
}
.lottabs__tab {
    display: flex; flex-direction: column; align-items: center; line-height: 1.25;
    padding: 6px 4px; border-radius: 12px; text-decoration: none; color: var(--muted);
}
.lottabs__tab b { font-size: 15px; font-weight: 700; }
.lottabs__tab small { font-size: 11px; }
.lottabs__tab.is-active { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a1208; }
.lottabs__tab.is-active small { color: #5a3a14; }
.draw-card__empty { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

.lotpick {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px;
    margin-bottom: 10px; padding: 4px;
    border-radius: 16px; background: rgba(0,0,0,.28); border: 1px solid var(--line);
}
.lotpick__opt { position: relative; }
.lotpick__opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; }
.lotpick__opt span {
    display: flex; flex-direction: column; align-items: center; line-height: 1.25;
    padding: 6px 4px; border-radius: 12px; color: var(--muted); cursor: pointer;
}
.lotpick__opt b { font-size: 15px; }
.lotpick__opt small { font-size: 11px; }
.lotpick__opt input:checked + span { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a1208; }
.lotpick__opt input:checked + span small { color: #5a3a14; }
.lotpick__opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.lotpick__opt input:disabled + span { opacity: .6; cursor: default; }

.import { margin: 4px 0 14px; }
.import summary { cursor: pointer; color: var(--gold); font-weight: 600; font-size: 14px; padding: 6px 0; }

.actionbar {
    position: fixed; z-index: 25;
    left: 0; right: 0; bottom: 0; margin-inline: auto;
    width: min(520px, 100%);
    display: grid; gap: 4px;
    padding: 8px 10px calc(6px + var(--safe-b));
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
    background: color-mix(in srgb, var(--card) 92%, transparent);
    border: 1px solid var(--line);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 16px 40px -12px rgba(0,0,0,.9);
}
.actionbar .hold { min-height: 56px; }
.actionbar__note { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }
.actionbar__note a { color: var(--accent); }
.quota-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quota-card .card__title { margin-bottom: 2px; }
.quota-card p { margin: 0; font-size: 13px; color: var(--muted); }
.has-actionbar .app { padding-bottom: calc(120px + var(--safe-b)); }
.has-actionbar .install { bottom: calc(104px + var(--safe-b)); }

@media (min-width: 560px) {
    .app { padding-top: 28px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- การ์ดแจ้งเตือน ---------- */
.push-card { display: grid; gap: 12px; }
.push-card[hidden], .push-card [hidden] { display: none !important; }
.push-card__head { display: flex; gap: 12px; align-items: center; }
.push-card__head b { display: block; font-size: 16px; }
.push-card__head small { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; }
.push-card__icon { width: 34px; height: 34px; flex: none; fill: var(--gold-2); padding: 7px; border-radius: 50%; background: rgba(227,181,91,.12); }
.push-card.is-on .push-card__icon { background: var(--gold-2); fill: #2a1208; }
.push-card__row { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px dashed var(--line); }
.push-card__row .chips { flex: 1 1 auto; flex-wrap: nowrap; gap: 6px; min-width: 0; }
.push-card__row .chip span { font-size: 12.5px; padding: 5px 10px; white-space: nowrap; }
.push-card__actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: none; }
.push-card__actions .btn { white-space: nowrap; font-size: 13px; padding: 5px 12px; min-height: 32px; }
/* จอแคบมาก (เช่น 320px) ให้ปุ่มลงบรรทัดใหม่แทนการบีบ */
@media (max-width: 340px) { .push-card__row { flex-wrap: wrap; } }
.push-card__actions .btn:disabled { opacity: .65; cursor: default; }
.result .push-card { margin-top: 18px; text-align: left; }
.push-card .link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: 14px; color: var(--muted); }

/* ---------- บัญชี / เครดิต ---------- */
.account { display: grid; gap: 16px; }
.account__who { display: flex; align-items: center; gap: 12px; }
.account__who b { display: block; font-size: 17px; }
.account__who small { color: var(--muted); font-size: 13px; }
.account__avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid var(--line-2); }
.account__avatar--blank { display: grid; place-items: center; background: rgba(227,181,91,.12); color: var(--gold-2); font-family: Chonburi, serif; font-size: 22px; }
.account__out { margin-left: auto; }
.account__out .link, .danger .link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: 14px; color: var(--muted); }
.account__credits { display: grid; gap: 2px; padding: 14px 16px; border-radius: 16px; background: linear-gradient(160deg, rgba(227,181,91,.16), rgba(227,181,91,.04)); border: 1px solid var(--line-2); }
.account__credits b { font-family: Chonburi, serif; font-size: 40px; line-height: 1.2; color: var(--gold-2); }
.account__credits small { color: var(--muted); font-size: 12.5px; }
.account__perks { margin: 0; padding-left: 20px; color: var(--ink); line-height: 1.8; font-size: 14.5px; }
.btn--line { background: #06c755; color: #fff; border-color: #06c755; }
.btn--line svg { width: 22px; height: 22px; fill: currentColor; }
.packages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.package { display: grid; justify-items: center; gap: 4px; padding: 14px 8px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.package b { font-family: Chonburi, serif; font-size: 26px; color: var(--gold-2); line-height: 1.2; }
.package > span { font-size: 12.5px; color: var(--muted); }
.package .btn { margin-top: 6px; width: 100%; }
.package .btn[aria-disabled] { opacity: .55; }
button.package { cursor: pointer; font: inherit; color: inherit; }
button.package:hover { border-color: var(--line-2); background: rgba(227,181,91,.06); }
.pay-methods .chip span { font-size: 13px; }
.ledger { list-style: none; margin: 10px 0 0; padding: 0; }
.ledger li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ledger small { display: block; color: var(--muted); font-size: 12px; }
.ledger .plus { color: #7fc98f; }
.ledger .minus { color: var(--muted); }
.danger summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.disclaimer a { color: var(--gold-2); }

/* ---------- สมัคร / เข้าสู่ระบบ ---------- */
.auth .auth__btn { width: 100%; }
.auth__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth__small { justify-self: center; font-size: 14px; }
.auth__or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 16px 0 12px; }
.auth__or::before, .auth__or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth__accept { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--muted); }
.auth__accept input { margin-top: 3px; accent-color: var(--gold); width: 16px; height: 16px; flex: none; }
.auth__switch { text-align: center; color: var(--muted); font-size: 14px; margin-top: 16px; }
.field__label small { font-weight: 400; color: var(--muted); }

/* ---------- ชำระเงิน ---------- */
.pay { display: grid; gap: 14px; text-align: center; }
.pay__body { display: grid; gap: 14px; justify-items: center; }
.pay__amount { display: grid; gap: 2px; }
.pay__amount b { font-family: Chonburi, serif; font-size: 42px; line-height: 1.2; color: var(--gold-2); }
.pay__amount small { font-family: "Noto Sans Thai", sans-serif; font-size: 16px; color: var(--muted); }
.pay__amount em { font-style: normal; font-size: 12.5px; color: var(--gold); }
.pay__qr { background: #fff; border-radius: 16px; padding: 14px 14px 10px; display: grid; justify-items: center; gap: 6px; width: min(300px, 100%); }
.pay__qr img, .pay__qr svg { width: 100%; height: auto; aspect-ratio: 1; display: block; }
.pay__pp { color: #113566; font-weight: 700; font-size: 13px; }
.pay__timer { margin: 0; color: var(--muted); font-size: 14px; }
.pay__timer b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pay__steps { text-align: left; margin: 0; padding-left: 22px; color: var(--ink); font-size: 14px; line-height: 1.7; }
.pay__slip { display: grid; gap: 6px; justify-items: center; width: 100%; }
.pay__slip .btn { width: 100%; cursor: pointer; }
.pay__test { border: 1px dashed var(--line-2); border-radius: 10px; padding: 8px 10px; }
.pay__done, .pay__review { display: grid; gap: 8px; justify-items: center; padding: 10px 0; }
.pay__done[hidden] { display: none; }
.pay__done svg { width: 56px; height: 56px; fill: #2a1208; background: #7fc98f; border-radius: 50%; padding: 10px; }
.pay__done b, .pay__review b { font-size: 18px; }
.pay__done span, .pay__review span { color: var(--muted); font-size: 14px; }
p.error.card { margin: 12px 0 0; }

/* ---------- ดูธูปที่จุดไปแล้ว ---------- */
.is-replay .lotpick, .is-replay .offering { display: none; }
.book__list li { position: relative; }
.book__open { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 14px; }
.book__open svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- ผลงานธูป / เลขที่ถูก ---------- */
.record__nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; text-align: center; }
.record__nums b { display: block; font-family: var(--display); font-weight: 400; font-size: 26px; color: var(--ink); line-height: 1.2; }
.record__nums small { font-size: 12px; color: var(--muted); }
.record__nums .is-win b { color: #7fc98f; }
.record__nums .is-near b { color: var(--gold-2); }
.record__wins { list-style: none; margin: 12px 0 0; padding: 0; }
.record__wins li { border-top: 1px dashed var(--line); }
.record__wins a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; color: var(--ink); text-decoration: none; font-size: 13.5px; }
.record__wins a span { color: var(--muted); }
.record__wins b { font-weight: 600; text-align: right; }
.record__wins .win { color: #7fc98f; }
.record__wins .near { color: var(--gold-2); }
.book__hits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hit { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 99px; }
.hit--win { background: rgba(127, 201, 143, .16); color: #9fe0ad; border: 1px solid rgba(127, 201, 143, .4); }
.hit--near { background: rgba(227, 181, 91, .12); color: var(--gold-2); border: 1px solid var(--line-2); }
.tag--win { background: rgba(127, 201, 143, .22) !important; border-color: rgba(127, 201, 143, .6) !important; color: #c8f2d1 !important; }
.tag--near { border-color: var(--gold) !important; color: var(--gold-2) !important; box-shadow: 0 0 0 1px rgba(227,181,91,.35); }

/* ---- สมาชิกรายเดือน ---- */
.pay-methods { align-items: center; margin-bottom: 12px; }
.member { display: grid; gap: 8px; background: linear-gradient(160deg, rgba(227,181,91,.18), rgba(140,40,20,.10)); border: 1px solid var(--line-2); }
.member.is-active { border-color: rgba(227,181,91,.55); }
.member__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.member__big { margin: 0; font-size: 15px; }
.member__big b { font-family: Chonburi, serif; font-size: 30px; color: var(--gold-2); line-height: 1.2; }
.member__perks { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; color: var(--muted); }
.member .btn { justify-self: start; }
.member .hint, .member .error { margin: 0; }
.card-row { display: grid; grid-template-columns: 1fr 110px; gap: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--accent); flex: none; }
.member__auto { display: grid; gap: 6px; padding-top: 8px; border-top: 1px dashed var(--line-2); font-size: 13.5px; }
.member__auto form { display: inline; }
.member__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* reCAPTCHA: v3 ซ่อนป้ายลอย แล้วแสดงข้อความใต้ฟอร์มแทน (Google อนุญาต) · v2 จัดกลาง */
.grecaptcha-badge { visibility: hidden; }
.recaptcha { display: flex; justify-content: center; min-height: 78px; }
.recaptcha__note { font-size: 11.5px; margin: 0; text-align: center; }
.recaptcha__note { line-height: 1.7; }
.recaptcha__note a { color: inherit; text-decoration: underline; white-space: nowrap; }

/* ช่องทางติดต่อ LINE */
.contact { display: grid; gap: 10px; margin-top: 8px; }
.contact__line { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 16px; background: #fff; color: #111; text-decoration: none; max-width: 360px; }
.contact__line img { width: 96px; height: 96px; flex: none; }
.contact__line b { display: block; color: #06c755; font-size: 16px; }
.contact__line small { display: block; color: #555; font-size: 12.5px; margin-top: 2px; }
.contact p { margin: 0; }

/* การ์ดติดตั้งแอป (หน้าบัญชี) */
.install-card { display: flex; gap: 14px; align-items: flex-start; }
.install-card[hidden] { display: none; }
.install-card img { width: 56px; height: 56px; border-radius: 14px; flex: none; }
.install-card b { display: block; font-size: 16px; }
.install-card small { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; margin: 2px 0 10px; }

/* แถวเลือกหวยในการ์ดแจ้งเตือน: ชื่อสั้น (หวยไทย/หวยลาว/หวยฮานอย) ให้อยู่บรรทัดเดียวบนมือถือ */
.push-card__lotteries { flex-wrap: nowrap; gap: 6px; }
.push-card__lotteries .chip span { font-size: 13px; padding: 5px 11px; white-space: nowrap; }
@media (max-width: 340px) { .push-card__lotteries { flex-wrap: wrap; } }

/* ---------- หน้าผลหวย / เลขเด็ดรายงวด ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--dim); margin: 4px 0 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs [aria-current] { color: var(--gold-2); }
.muted-p { margin: 0 0 10px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.muted-p b { color: var(--gold-2); }
.prize-card { display: grid; gap: 10px; }
.prize { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.prize span { font-size: 14px; color: var(--muted); }
.prize b { font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--ink); letter-spacing: .06em; font-variant-numeric: tabular-nums; text-align: right; }
.prize--big b { font-size: 34px; color: var(--gold-2); }
.prize-card__note { margin: 0; font-size: 12px; color: var(--dim); }
.cta-card p { margin: 4px 0 12px; font-size: 14px; color: var(--muted); }
.cta-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cta-card__actions .btn { flex: 1 1 140px; }
.pager-links { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-top: 16px; font-size: 14px; }
.pager-links a { color: var(--gold); text-decoration: none; }
.pager-links > :last-child { text-align: right; }
.pager-links > :nth-child(2) { color: var(--muted); }
.next-link { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.next-link b { color: var(--gold-2); }
.results--links a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.hotnums { list-style: none; margin: 4px 0 14px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.hotnums li { display: flex; flex-direction: column; align-items: center; padding: 8px 0; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,0,0,.18); }
.hotnums b { font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--ink); line-height: 1.3; }
.hotnums span { font-size: 11px; color: var(--muted); }
.hotnums li.is-top { border-color: var(--line-2); }
.hotnums li.is-top b { color: var(--gold-2); font-size: 28px; }
.hotnums li.is-hit { background: rgba(127, 201, 143, .14); border-color: var(--ok); }
.chips--nums span { font-family: var(--display); font-size: 18px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--gold-2); }
.shrine-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shrine-links a { display: flex; flex-direction: column; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); text-decoration: none; }
.shrine-links b { color: var(--gold-2); font-weight: 600; font-size: 15px; }
.shrine-links span { color: var(--muted); font-size: 12px; }
h2.label { font-weight: 400; margin: 0; }
@media (max-width: 380px) { .hotnums { grid-template-columns: repeat(4, 1fr); } }
.hero__h1sub { display: block; margin-top: 4px; font-family: var(--body); font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--gold); -webkit-text-fill-color: var(--gold); }
.draw-card__links { margin: 10px 0 0; font-size: 13px; }
.how__links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; }
.disclaimer--nav { margin-top: 18px; line-height: 2; }

/* ---------- ทำนายฝัน ---------- */
.dream-meaning { margin: 0; font-size: 15px; line-height: 1.8; color: var(--ink); }
.dream-nums__row { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; margin-top: 8px; }
.dream-nums__row > span { font-size: 13px; color: var(--muted); }
.dream-links { display: flex; flex-wrap: wrap; gap: 8px; }
.dream-links a { padding: 7px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); color: var(--ink); text-decoration: none; font-size: 14px; }
.dream-search__row { display: flex; gap: 8px; margin-top: 6px; }
.dream-search__row input { flex: 1; min-width: 0; min-height: 46px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(0,0,0,.25); color: var(--ink); font: inherit; font-size: 16px; }
.dream-search__row .btn { flex: 0 0 auto; }
.dream-found { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 12px; }
.dream-found li { display: grid; gap: 4px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.dream-found a { color: var(--gold-2); text-decoration: none; font-size: 16px; }
.dream-found small { color: var(--muted); font-size: 13px; line-height: 1.6; }

/* ---------- กล่องให้ทิป ---------- */
.tipbox { padding: 0; }
.tipbox__head { list-style: none; display: flex; gap: 12px; align-items: center; padding: 14px 16px; cursor: pointer; }
.tipbox__head::-webkit-details-marker { display: none; }
.tipbox__head::after { content: '›'; margin-left: auto; color: var(--muted); font-size: 22px; transition: transform .2s; }
.tipbox[open] .tipbox__head::after { transform: rotate(90deg); }
.tipbox__icon { font-size: 26px; line-height: 1; }
.tipbox__head b { display: block; color: var(--gold-2); font-size: 15px; }
.tipbox__head small { display: block; color: var(--muted); font-size: 12.5px; }
.tipbox__body { padding: 0 16px 16px; display: grid; gap: 12px; justify-items: center; }
.tipbox__amounts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tipbox__amt { min-height: 38px; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.tipbox__amt.is-on { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a1208; border-color: transparent; font-weight: 700; }
.tipbox__qr { display: grid; justify-items: center; gap: 4px; padding: 12px; background: #fff; border-radius: 16px; color: #1b2f5b; }
.tipbox__qr [data-tip-qr] { width: 220px; height: 220px; display: grid; place-items: center; font-size: 13px; color: #555; }
.tipbox__qr svg { width: 220px; height: 220px; display: block; }
.tipbox__pp { font-size: 13px; font-weight: 700; }
.tipbox__amount { font-size: 15px; font-weight: 700; color: #113; }
.tipbox__note { margin: 0; font-size: 12px; line-height: 1.6; color: var(--dim); text-align: center; }

/* ปุ่มให้ทิปลอยมุมขวาล่าง (อยู่เหนือเมนูล่าง · ซ่อนเมื่อมีแบนเนอร์คุกกี้/ติดตั้งแอป) */
.tipfab { position: fixed; z-index: 19; right: 12px; bottom: calc(76px + var(--safe-b)); display: flex; align-items: flex-start; animation: tipfab-in .5s ease-out; }
.tipfab[hidden] { display: none; }
.tipfab__btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px 9px 11px; border-radius: 99px; text-decoration: none; font-size: 14px; font-weight: 700; color: #2a1208; background: linear-gradient(180deg, var(--gold-2), var(--gold)); box-shadow: 0 8px 22px -8px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.12) inset; }
.tipfab__btn span { font-size: 18px; line-height: 1; }
.tipfab__x { width: 22px; height: 22px; margin: -6px 0 0 -8px; padding: 0; border-radius: 50%; border: 1px solid var(--line-2); background: var(--card); color: var(--muted); font-size: 14px; line-height: 1; cursor: pointer; }
body:has(.consent:not([hidden])) .tipfab, body:has(.install:not([hidden])) .tipfab, body:not(:has(.tabbar)) .tipfab { display: none; }
@keyframes tipfab-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tipfab { animation: none; } }
.tipbox__custom { display: flex; gap: 8px; width: 100%; max-width: 320px; }
.tipbox__custom[hidden], .tipbox__claim[hidden] { display: none; }
.tipbox__custom input, .tipbox__claim input, .tipbox__claim textarea { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0,0,0,.25); color: var(--ink); font: inherit; font-size: 16px; }
.tipbox__hint { margin: 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.tipbox__hint b { color: var(--gold-2); letter-spacing: .05em; }
.tipbox__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tipbox__claim { display: grid; gap: 8px; width: 100%; max-width: 360px; }
.tipbox__thanks { margin: 0; padding: 10px 14px; border-radius: 12px; background: rgba(127, 201, 143, .14); color: var(--ink); font-size: 14px; text-align: center; }
.tipbox__thanks[hidden] { display: none; }

/* ถาม-ตอบ / ประโยคตอบตรงคำถาม */
.answer { margin: 12px 0 0; padding: 12px 14px; border-left: 3px solid var(--gold); border-radius: 0 12px 12px 0; background: rgba(227,181,91,.07); font-size: 15px; line-height: 1.7; color: var(--ink); }
.answer b { color: var(--gold-2); }
.faq__item { border: 1px solid var(--line); border-radius: 14px; background: var(--card); margin-top: 8px; }
.faq__item summary { cursor: pointer; padding: 12px 14px; font-weight: 600; font-size: 15px; color: var(--ink); list-style: none; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: '+'; float: right; color: var(--gold); }
.faq__item[open] summary::after { content: '–'; }
.faq__item p { margin: 0; padding: 0 14px 12px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.account__link { margin: 14px 0 6px; font-size: 13px; color: var(--muted); }

/* แถบสิทธิ์จุดฟรีใต้แท็บหน้าแรก */
.quota-line { display: flex; justify-content: center; margin: 4px 0 18px; }

/* ยืนยันอายุก่อนซื้อครั้งแรก (หน้าบัญชี) */
.adult-check { margin: 0 0 14px; }

/* ข้อมูลผู้ให้บริการ (หน้าข้อกำหนด/ความเป็นส่วนตัว/คืนเงิน) */
.operator { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0 0 12px; font-size: 14px; }
.operator dt { color: var(--muted); }
.operator dd { margin: 0; }

/* ---- คลังธูป / ร้านธูป (หน้าบัญชี) ---- */
.account__stock .stock-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.stock-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: rgba(0,0,0,.18); border: 1px solid var(--line); font-size: 14px; }
.stock-chip i { width: 4px; height: 16px; border-radius: 2px; background: var(--stick, var(--gold)); }
.account__stock .stock-chip b { font-family: Chonburi, serif; font-size: 20px; line-height: 1; }
.shop-type + .shop-type { margin-top: 16px; }
.shop-type__head { margin: 0 0 8px; padding-left: 10px; border-left: 4px solid var(--stick, var(--gold)); }
.shop-type__head small { color: var(--muted); }
.package { position: relative; }
.package small { font-size: 11.5px; color: var(--muted); }
.package.is-best { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.package__tag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--gold); color: #2a1408; white-space: nowrap; }

/* ---- โพสต์ผลรายงวด (แบบข่าว) ---- */
.post { margin-bottom: 18px; }
.post__head h1 { font-size: 24px; line-height: 1.35; margin: 6px 0 6px; }
.post__cat { display: inline-block; font-size: 12px; font-weight: 700; color: #2a1408; background: var(--gold); border-radius: 6px; padding: 1px 8px; }
.post__meta { margin: 0; font-size: 12.5px; color: var(--muted); }
.post__lead { font-size: 16px; line-height: 1.7; margin: 14px 0; }
.post__note { font-size: 12.5px; color: var(--muted); margin: 12px 0; }
.post-prizes { display: grid; gap: 10px; }
.post-prizes__first { text-align: center; padding: 18px 12px; border-radius: 16px; background: linear-gradient(160deg, rgba(227,181,91,.18), rgba(227,181,91,.04)); border: 1px solid var(--line-2); }
.post-prizes__first span, .post-prizes__row span { display: block; font-size: 13px; color: var(--muted); }
.post-prizes__first b { display: block; font-family: var(--display); font-weight: 400; font-size: 46px; letter-spacing: .08em; color: var(--gold-2); line-height: 1.25; font-variant-numeric: tabular-nums; }
.post-prizes__first small { color: var(--muted); font-size: 12px; }
.post-prizes__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.post-prizes__row > div { text-align: center; padding: 12px 8px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.post-prizes__row b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: .05em; color: var(--ink); font-variant-numeric: tabular-nums; }
.post-prizes__row .is-hl b { font-size: 30px; color: var(--gold-2); }
.post-prizes__row--small b { font-size: 18px; }
.post-hero { display: grid; gap: 6px; text-decoration: none; color: inherit; margin-bottom: 12px; }
.post-hero__title { font-size: 18px; line-height: 1.4; }
.post-hero__num { font-family: var(--display); font-size: 40px; letter-spacing: .08em; color: var(--gold-2); }
.post-hero small { color: var(--muted); }
.post-cards { display: grid; gap: 10px; }
.post-card { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: inherit; }
.post-card__num { flex: none; width: 92px; text-align: center; padding: 8px 4px; border-radius: 10px; background: rgba(227,181,91,.1); }
.post-card__num small { display: block; font-size: 10.5px; color: var(--muted); }
.post-card__num b { font-family: var(--display); font-weight: 400; font-size: 17px; letter-spacing: .04em; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.post-card__body { display: grid; gap: 2px; min-width: 0; }
.post-card__title { font-size: 15px; line-height: 1.4; }
.post-card__body small { color: var(--muted); font-size: 12.5px; }
