:root {
    --forest: #183b2e;
    --forest-deep: #0c211d;
    --leaf: #a8bd83;
    --gold: #e8c77e;
    --gold-deep: #b98b43;
    --cream: #fff5df;
    --muted: rgba(255, 245, 223, .78);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-width: 320px;
    background: var(--forest-deep);
    color: var(--cream);
    font-family: 'Kanit', sans-serif;
    font-weight: 300;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
h1, h2, h3 { font-family: inherit; }

.scene, .scene-shade, .fireflies { position: fixed; inset: 0; pointer-events: none; }
.scene {
    z-index: -3;
    background: url('../images/backgrounds/river-lantern-night.webp') center 48% / cover no-repeat;
    transform: scale(1.015);
}
.scene-shade {
    z-index: -2;
    background: linear-gradient(90deg, rgba(5, 10, 38, .74) 0%, rgba(6, 12, 42, .5) 42%, rgba(6, 12, 42, .08) 100%),
                linear-gradient(180deg, rgba(5, 10, 36, .34) 0%, transparent 42%, rgba(5, 12, 34, .5) 100%);
}
.fireflies { z-index: -1; overflow: hidden; }
.firefly {
    position: absolute;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: #ffe8a2;
    box-shadow: 0 0 8px 3px rgba(255, 218, 119, .48);
    opacity: .25;
    animation: firefly-drift var(--duration) ease-in-out infinite alternate;
}
@keyframes firefly-drift {
    from { transform: translate3d(0, 0, 0); opacity: .15; }
    to { transform: translate3d(18px, -35px, 0); opacity: .9; }
}

.site-header {
    position: relative;
    z-index: 20;
    width: min(1280px, calc(100% - 9vw));
    height: 92px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 239, 199, .2);
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 21px; font-weight: 600; letter-spacing: .02em; }
.brand-mark { color: var(--gold); font-size: 30px; text-shadow: 0 0 18px rgba(232, 199, 126, .55); }
.brand-light { color: var(--gold); margin-left: 5px; font-weight: 300; }
.main-nav { display: flex; align-items: center; gap: clamp(20px, 3vw, 44px); font-size: 14px; }
.nav-link { color: rgba(255, 245, 223, .83); transition: color .2s; white-space: nowrap; }
.nav-link:hover, .nav-link.active { color: var(--gold); }
.nav-cta { padding: 11px 19px; border: 1px solid rgba(232, 199, 126, .75); border-radius: 999px; color: var(--cream); transition: .25s; }
.nav-cta:hover { background: var(--gold); color: var(--forest-deep); }
.nav-cta span { color: var(--gold); margin-left: 8px; }
.nav-cta:hover span { color: var(--forest-deep); }
.menu-toggle { display: none; }
.menu-toggle span { transition: transform .25s, opacity .2s; }
.menu-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.hero {
    min-height: min(760px, calc(100svh - 92px));
    width: min(1280px, calc(100% - 9vw));
    margin: 0 auto;
    display: flex;
    align-items: center;
    position: relative;
    padding: 55px 0 100px;
}
.hero-content { max-width: 620px; padding-bottom: 10px; }
.eyebrow, .section-kicker { color: var(--gold); font-size: 11px; letter-spacing: .23em; font-weight: 500; }
.eyebrow { display: flex; align-items: center; gap: 13px; margin-bottom: 24px; }
.eyebrow-line { display: inline-block; width: 35px; height: 1px; background: var(--gold); opacity: .8; }
h1 { margin: 0; font-size: clamp(52px, 7.2vw, 94px); line-height: 1.14; font-weight: 600; letter-spacing: -.035em; text-shadow: 0 5px 28px rgba(0, 0, 0, .22); }
h1 span { color: var(--gold); }
.hero-description { margin: 24px 0 30px; color: var(--muted); font-size: clamp(16px, 1.5vw, 19px); line-height: 1.9; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.button { font-family: inherit; line-height: 1.2; text-align: center; cursor: pointer; border: 0; background: none; color: inherit; -webkit-appearance: none; appearance: none; min-height: 52px; padding: 0 25px; display: inline-flex; justify-content: center; align-items: center; gap: 17px; border-radius: 999px; font-size: 15px; font-weight: 500; transition: transform .2s, background .2s, box-shadow .2s; }
.button:hover { transform: translateY(-3px); }
.button-primary { color: #263a27; background: linear-gradient(135deg, #f2d995, #d8ad5d); box-shadow: 0 8px 28px rgba(190, 143, 63, .24); }
.button-primary:hover { box-shadow: 0 12px 32px rgba(190, 143, 63, .38); }
.button-icon { font-size: 20px; }
.button-ghost { border: 1px solid rgba(255, 245, 223, .45); background: transparent; color: var(--cream); }
.button-ghost:hover { background: rgba(255, 245, 223, .12); }
.arrow { color: var(--gold); font-size: 19px; }
.hero-note { margin-top: 32px; color: rgba(255, 245, 223, .7); font-size: 12px; letter-spacing: .04em; }
.note-icon { color: var(--gold); margin-right: 8px; font-size: 17px; }
.scroll-hint { position: absolute; bottom: 30px; left: 0; display: flex; align-items: center; gap: 12px; color: rgba(255, 245, 223, .7); font-size: 11px; letter-spacing: .12em; }
.scroll-line { width: 38px; height: 1px; background: var(--gold); }

.intro { padding: 92px 20px 100px; text-align: center; background: linear-gradient(180deg, rgba(10, 32, 27, .92), rgba(13, 38, 30, .98)); border-top: 1px solid rgba(232, 199, 126, .18); }
.intro-ornament { color: var(--gold); font-size: 30px; margin-bottom: 14px; }
.section-kicker { margin: 0 0 13px; }
.intro h2 { margin: 0; font-size: clamp(27px, 4vw, 42px); font-weight: 500; }
.intro h2 span { color: var(--gold); }
.intro-copy { margin: 18px auto 23px; color: var(--muted); font-size: 15px; line-height: 2; }
.text-link { color: var(--gold); font-size: 14px; border-bottom: 1px solid rgba(232, 199, 126, .5); padding-bottom: 6px; }
.text-link span { margin-left: 8px; }
.site-footer { min-height: 65px; padding: 15px 5vw; display: flex; justify-content: space-between; align-items: center; gap: 15px; color: rgba(255, 245, 223, .55); background: transparent; font-size: 11px; }
.mobile-break { display: none; }

@media (max-width: 760px) {
    .site-header { height: 74px; width: calc(100% - 36px); }
    .brand { font-size: 18px; }
    .brand-mark { font-size: 26px; }
    .hero { width: calc(100% - 40px); min-height: 690px; min-height: calc(88svh - 74px); padding: 55px 0 90px; align-items: center; }
    .scene { background-position: 58% center; }
    .scene-shade { background: linear-gradient(90deg, rgba(5, 10, 38, .74), rgba(6, 12, 42, .4)), linear-gradient(180deg, rgba(5, 10, 36, .2), rgba(5, 12, 34, .5)); }
    .eyebrow { font-size: 9px; letter-spacing: .16em; gap: 8px; }
    .eyebrow-line { width: 22px; }
    h1 { font-size: clamp(49px, 13vw, 72px); }
    .hero-description { font-size: 15px; }
    .mobile-break { display: initial; }
    .hero-actions { align-items: stretch; flex-direction: column; max-width: 300px; }
    .button { width: 100%; }
    .scroll-hint { bottom: 24px; }
    .intro { padding: 75px 22px 80px; }
    .intro-copy { font-size: 13px; }
    .desktop-break { display: none; }
    .site-footer { flex-direction: column; justify-content: center; text-align: center; }
}

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


/* Create Krathong page */
.create-page { min-height: 100vh; }
.create-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 64px 0 90px; }
.create-heading { text-align: center; margin: 0 auto 42px; }
.create-heading .section-kicker { letter-spacing: .2em; }
.create-heading h1 { font-size: clamp(38px, 5vw, 58px); line-height: 1.25; }
.create-heading h1 span { color: var(--gold); margin-left: 10px; }
.create-heading > p:last-child { color: var(--muted); margin: 14px 0 0; font-size: 15px; }
.create-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr); gap: 24px; align-items: start; }
.form-panel, .preview-panel, .success-panel { border: 1px solid rgba(232,199,126,.2); background: rgba(10,15,35,.9); border-radius: 22px; box-shadow: 0 18px 55px rgba(0,0,0,.18); }
.form-panel { padding: 30px; }
.form-section + .form-section { border-top: 1px solid rgba(255,245,223,.12); margin-top: 28px; padding-top: 27px; }
.step-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.step-heading > span { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--gold); border: 1px solid rgba(232,199,126,.45); font-size: 13px; }
.step-heading h2, .preview-panel h2 { margin: 0; font-size: 20px; font-weight: 500; }
.step-heading p { margin: 2px 0 0; color: rgba(255,245,223,.58); font-size: 12px; }
.field-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 13px; }
.field-label span, .char-count { color: rgba(255,245,223,.48); font-size: 11px; }
.text-field { display: block; width: 100%; border: 1px solid rgba(255,245,223,.2); border-radius: 11px; padding: 13px 15px; color: var(--cream); background: rgba(255,255,255,.055); outline: none; font: inherit; font-size: 14px; }
.text-field:focus { border-color: rgba(232,199,126,.8); box-shadow: 0 0 0 3px rgba(232,199,126,.1); }
.text-field::placeholder { color: rgba(255,245,223,.38); }
.prayer-tabs { display: flex; gap: 9px; margin-bottom: 13px; }
.prayer-tabs label { cursor: pointer; }
.prayer-tabs input, .prayer-option input { position: absolute; opacity: 0; }
.prayer-tabs span { display: block; padding: 8px 14px; border: 1px solid rgba(255,245,223,.18); border-radius: 999px; color: var(--muted); font-size: 12px; }
.prayer-tabs input:checked + span { border-color: var(--gold); color: var(--gold); background: rgba(232,199,126,.09); }
.prayer-presets { display: grid; gap: 8px; }
.prayer-option { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border: 1px solid rgba(255,245,223,.13); border-radius: 10px; cursor: pointer; color: var(--muted); font-size: 12px; line-height: 1.7; }
.prayer-option:has(input:checked) { border-color: rgba(232,199,126,.65); background: rgba(232,199,126,.07); color: var(--cream); }
.prayer-option span:before { content: ''; display: inline-block; width: 8px; height: 8px; margin: 0 9px 1px 0; border: 1px solid var(--gold); border-radius: 50%; }
.prayer-option:has(input:checked) span:before { background: var(--gold); box-shadow: inset 0 0 0 2px #19352a; }
.prayer-custom { resize: vertical; min-height: 110px; }
.prayer-custom[hidden], .prayer-presets[hidden] { display: none; }
.char-count { text-align: right; margin: 5px 0 0; }
.submit-button { border: 0; width: 100%; margin-top: 27px; cursor: pointer; font-family: inherit; }
.preview-panel { position: sticky; top: 22px; padding: 27px 24px 25px; text-align: center; overflow: hidden; }
.preview-panel .section-kicker { margin-bottom: 7px; font-size: 10px; }
.preview-panel h2 { font-size: 21px; }
.krathong-preview { position: relative; width: 220px; height: 190px; margin: 24px auto 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; isolation: isolate; }
.preview-nickname { color: var(--gold); font-size: 17px; margin: 0 0 9px; font-weight: 500; }
.preview-prayer { min-height: 64px; margin: 0 auto; max-width: 280px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.preview-note { border-top: 1px solid rgba(255,245,223,.12); margin-top: 20px; padding-top: 15px; color: rgba(255,245,223,.55); font-size: 11px; }
.preview-note span { color: var(--gold); margin-right: 6px; }
.form-alert { margin: 0 0 18px; padding: 15px 18px; border: 1px solid rgba(255,140,125,.4); border-radius: 12px; background: rgba(120,35,30,.25); color: #ffd4cc; font-size: 13px; }
.form-alert ul { margin: 7px 0 0; padding-left: 20px; }
.success-panel { max-width: 650px; margin: 0 auto; padding: 48px 35px; text-align: center; }
.success-symbol { width: 64px; height: 64px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(232,199,126,.55); color: var(--gold); font-size: 30px; }
.success-panel h2 { margin: 8px 0; font-size: 27px; font-weight: 500; }
.success-panel > p:not(.section-kicker) { color: var(--muted); font-size: 14px; line-height: 1.8; }
.success-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
@media (max-width: 820px) { .create-layout { grid-template-columns: 1fr; } .preview-panel { position: static; grid-row: 1; } .preview-panel .krathong-preview { margin-top: 10px; margin-bottom: 5px; height: 145px; } .preview-prayer { min-height: 0; } }
@media (max-width: 560px) { .create-shell { width: calc(100% - 28px); padding: 43px 0 65px; } .create-heading { margin-bottom: 27px; } .create-heading h1 { font-size: 39px; } .create-heading > p:last-child { font-size: 13px; } .form-panel { padding: 21px 16px; border-radius: 17px; } .preview-panel { padding: 22px 18px; } .success-panel { padding: 36px 20px; } .success-panel h2 { font-size: 23px; } .success-actions { flex-direction: column; } }

/* Multi-step krathong builder */
.wizard-layout { grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr); }
.wizard-panel { min-width: 0; }
.wizard-progress { margin: 0 0 30px; }
.wizard-progress-top { display:flex; justify-content:space-between; color:var(--muted); font-size:12px; margin-bottom:9px; }
.wizard-progress-top span:last-child { color:var(--gold); }
.wizard-track { height:5px; border-radius:99px; background:rgba(255,255,255,.1); overflow:hidden; }
.wizard-track > span { display:block; height:100%; border-radius:inherit; background:var(--gold); transition:width .3s ease; }
.wizard-steps { display:flex; justify-content:space-between; gap:5px; margin-top:10px; }
.wizard-steps span { color:rgba(255,245,223,.4); font-size:10px; white-space:nowrap; }
.wizard-steps span.active,.wizard-steps span.done { color:var(--gold); }
.wizard-step[hidden] { display:none !important; }
.wizard-step.active { animation:wizardFade .25s ease; }
@keyframes wizardFade { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
.wizard-step .step-heading { margin-bottom:25px; }
.wizard-hint { margin:12px 0 0; color:rgba(255,245,223,.5); font-size:11px; }
.krathong-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.krathong-option { position:relative; display:flex; flex-direction:column; align-items:center; text-align:center; gap:6px; padding:12px; border:1px solid rgba(255,245,223,.15); border-radius:14px; background:rgba(255,255,255,.035); cursor:pointer; transition:.2s; }
.krathong-option:hover,.krathong-option.selected { border-color:rgba(232,199,126,.8); background:rgba(232,199,126,.09); }
.krathong-option input { position:absolute; opacity:0; pointer-events:none; }
.catalog-name { font-size:13px; font-weight:500; color:var(--cream); }
.catalog-description { color:rgba(255,245,223,.5); font-size:10px; line-height:1.5; }
.catalog-selected { position:absolute; top:8px; right:8px; width:20px; height:20px; border-radius:50%; display:grid; place-items:center; color:#14281e; background:var(--gold); font-size:11px; opacity:0; transform:scale(.7); transition:.2s; }
.krathong-option.selected .catalog-selected { opacity:1; transform:scale(1); }
.wizard-actions { display:flex; align-items:center; gap:10px; border-top:1px solid rgba(255,245,223,.12); margin-top:30px; padding-top:22px; }
.wizard-actions [hidden] { display:none !important; }
.wizard-spacer { flex:1; }
.wizard-actions .button { min-width:125px; justify-content:center; }
.review-card { border:1px solid rgba(232,199,126,.2); border-radius:14px; padding:16px; background:rgba(255,255,255,.025); }
.review-row { display:flex; justify-content:space-between; gap:12px; padding:10px 0; border-bottom:1px solid rgba(255,245,223,.1); font-size:12px; }
.review-row span,.review-prayer > span { color:rgba(255,245,223,.52); }
.review-row strong { color:var(--cream); text-align:right; font-weight:500; }
.review-flower-row { align-items:flex-start; }
.review-prayer { padding-top:13px; font-size:12px; }
.review-prayer p { color:var(--cream); line-height:1.8; margin:8px 0 0; }
.preview-krathong-name { margin:3px 0 7px; color:var(--gold); font-size:12px; }
.wizard-preview .preview-nickname { margin-top:0; }
@media (max-width:820px) { .wizard-layout { grid-template-columns:1fr; } .wizard-preview { grid-row:1; } .wizard-preview .krathong-preview { height:130px; } }
@media (max-width:560px) { .krathong-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; } .wizard-steps span { font-size:9px; } .wizard-actions .button { min-width:0; padding-left:17px; padding-right:17px; } }


/* Wizard navigation buttons — match the site's Kanit typography and forest/gold palette */
.wizard-actions .button {
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
    letter-spacing: .1px;
    min-height: 48px;
    border-radius: 999px;
    transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.wizard-actions .button:focus-visible {
    outline: 3px solid rgba(255, 232, 162, .85);
    outline-offset: 3px;
}

.wizard-actions #prevStep {
    color: var(--cream);
    background: rgba(31, 75, 57, .92);
    border: 1px solid rgba(232, 199, 126, .72);
    box-shadow: 0 5px 18px rgba(0, 0, 0, .18);
}

.wizard-actions #prevStep:hover {
    color: #fff8e9;
    background: #285b43;
    border-color: var(--gold);
    box-shadow: 0 7px 22px rgba(0, 0, 0, .24);
    transform: translateY(-2px);
}

.wizard-actions #nextStep,
.wizard-actions #submitKrathong {
    color: #193326;
    background: linear-gradient(135deg, #ffe8a2 0%, #e8c77e 55%, #d5a956 100%);
    border: 1px solid rgba(255, 238, 190, .75);
    font-family: 'Kanit', sans-serif;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(190, 143, 63, .28);
}

.wizard-actions #nextStep:hover,
.wizard-actions #submitKrathong:hover {
    color: #10271d;
    background: linear-gradient(135deg, #fff0bd 0%, #f0d58e 55%, #dfb96c 100%);
    box-shadow: 0 9px 25px rgba(190, 143, 63, .4);
    transform: translateY(-2px);
}

.wizard-actions .button:active {
    transform: translateY(0);
}

@media (max-width: 560px) {
    .wizard-actions { gap: 9px; }
    .wizard-actions .button {
        min-height: 46px;
        font-size: 14px;
        padding-left: 18px;
        padding-right: 18px;
    }
}

.prayer-custom[hidden], .prayer-presets[hidden] { display: none; }

/* ---------- SVG artwork (krathong / flowers / logo) ---------- */
.brand-mark { display: inline-flex; width: 30px; height: 30px; }
.lotus-icon { width: 100%; height: 100%; display: block; color: var(--gold); filter: drop-shadow(0 0 10px rgba(232, 199, 126, .5)); }
.intro-ornament { display: flex; justify-content: center; }
.intro-ornament .lotus-icon { width: 38px; height: 38px; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; }
.footer-brand .lotus-icon { width: 16px; height: 16px; filter: none; }
@media (max-width: 760px) { .brand-mark { width: 26px; height: 26px; } }

.catalog-visual { display: block; width: 100%; border-radius: 10px; background: radial-gradient(ellipse at 50% 60%, rgba(232,199,126,.16), rgba(255,255,255,.02) 72%); }
.catalog-visual svg { display: block; width: 100%; height: auto; }
.krathong-visual { padding: 8px 6px 2px; }
.krathong-option:hover .krathong-visual svg, .krathong-option.selected .krathong-visual svg { transform: translateY(-2px); }
.krathong-visual svg, .set-visual svg { transition: transform .25s ease; }
.set-visual { padding: 10px 6px 8px; }
.set-theme { color: var(--gold); font-weight: 400; font-size: 12px; }
.set-flowers { color: rgba(255,245,223,.78); font-size: 11px; line-height: 1.5; }
.flower-set-option .catalog-description { font-size: 10.5px; }

.field-error { margin: 9px 0 0; color: #ffb4a8; font-size: 12px; }
.field-error[hidden] { display: none; }
.text-field.invalid { border-color: rgba(255, 140, 125, .85); box-shadow: 0 0 0 3px rgba(255, 140, 125, .12); }
.char-count[hidden] { display: none; }

.krathong-preview { position: relative; width: 100%; max-width: 280px; height: auto; margin: 14px auto 8px; display: block; }
.preview-svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 8px 14px rgba(0,0,0,.28)); }
.preview-svg use { transition: opacity .2s; }
@media (max-width: 820px) { .wizard-preview .krathong-preview { height: auto; max-width: 230px; } }

/* ---------- View / Gallery ---------- */
.view-panel { max-width: 640px; margin: 0 auto; padding: 38px 28px; text-align: center; border: 1px solid rgba(232,199,126,.2); background: rgba(10,15,35,.9); border-radius: 22px; box-shadow: 0 18px 55px rgba(0,0,0,.18); }
.view-title { margin: 6px 0 4px; font-size: clamp(28px, 6vw, 38px); font-weight: 500; letter-spacing: 0; line-height: 1.4; text-shadow: none; }
.create-shell h1 { letter-spacing: 0; }
.view-stage { position: relative; width: min(100%, 420px); margin: 12px auto 6px; }
.view-water { position: absolute; left: 6%; right: 6%; bottom: 6%; height: 26%; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(120,200,190,.28), transparent 70%); animation: ripple 5s ease-in-out infinite; }
.krathong-art { display: block; width: 100%; height: auto; overflow: visible; }
.view-art { }
.view-from { margin: 4px 0 10px; color: var(--muted); font-size: 14px; }
.view-from strong { color: var(--gold); font-weight: 500; }
.view-prayer { margin: 0 auto 26px; max-width: 480px; padding: 16px 20px; border-left: 3px solid var(--gold-deep); background: rgba(255,245,223,.06); border-radius: 0 12px 12px 0; text-align: left; line-height: 1.8; font-size: 15px; overflow-wrap: anywhere; }
.view-copied { margin: 14px 0 0; color: var(--leaf); font-size: 13px; overflow-wrap: anywhere; }

.gallery-shell { width: min(1180px, calc(100% - 40px)); }
.gallery-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.gallery-item { all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer; padding: 10px 10px 14px; border-radius: 18px; text-align: center; background: rgba(9,29,25,.55); border: 1px solid rgba(232,199,126,.14); transition: background .2s, border-color .2s, transform .2s; }
.gallery-item:hover, .gallery-item:focus-visible { background: rgba(9,29,25,.82); border-color: rgba(232,199,126,.5); transform: translateY(-3px); }
.gallery-item:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.gallery-art { animation: bob var(--bob-time, 6s) ease-in-out var(--bob-delay, 0s) infinite; }
.gallery-name { display: block; margin-top: 4px; font-size: 14px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-pager { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 34px; color: var(--muted); font-size: 14px; }
.gallery-pager .button { min-height: 44px; padding: 0 20px; width: auto; }

.wish-dialog { width: min(480px, calc(100% - 32px)); padding: 30px 26px; border: 1px solid rgba(232,199,126,.35); border-radius: 20px; background: #0d2823; color: var(--cream); text-align: center; }
.wish-dialog::backdrop { background: rgba(3,12,10,.78); }
.wish-dialog h2 { margin: 4px 0 12px; font-weight: 500; font-size: 24px; overflow-wrap: anywhere; }
.wish-dialog blockquote { margin: 0 0 22px; line-height: 1.8; font-size: 15px; overflow-wrap: anywhere; text-align: left; padding: 14px 16px; border-left: 3px solid var(--gold-deep); background: rgba(255,245,223,.06); border-radius: 0 10px 10px 0; }
.wish-close { all: unset; position: absolute; top: 10px; right: 14px; cursor: pointer; font-size: 26px; line-height: 1; color: var(--muted); }
.wish-close:hover { color: var(--cream); }

@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-.6deg); } 50% { transform: translateY(-4px) rotate(.6deg); } }
@keyframes ripple { 0%, 100% { opacity: .55; transform: scaleX(1); } 50% { opacity: 1; transform: scaleX(1.06); } }
@media (max-width: 560px) { .view-panel { padding: 28px 16px; } .view-title { font-size: 26px; } .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .gallery-shell { width: calc(100% - 28px); } .gallery-pager { gap: 8px; font-size: 12px; } }
@media (prefers-reduced-motion: reduce) { .view-art, .gallery-art, .view-water { animation: none; } }

/* ---------- Release animation ---------- */
.release { position: relative; width: min(100%, 560px); height: 330px; margin: 10px auto 6px; overflow: hidden; border-radius: 18px; border: 1px solid rgba(232,199,126,.18); background: linear-gradient(180deg, rgba(10,30,52,.55) 0%, rgba(14,44,60,.35) 55%, rgba(6,28,30,.55) 100%); }
.rel-sky { position: absolute; inset: 0 0 38% 0; overflow: hidden; }
.rel-water { position: absolute; left: 0; right: 0; bottom: 0; height: 38%; background: linear-gradient(180deg, rgba(40,110,120,.55), rgba(6,36,40,.85)); overflow: hidden; }
.wave { position: absolute; left: 0; width: 200%; height: 14px; top: 0; background: radial-gradient(circle at 12px 14px, transparent 11px, rgba(150,225,220,.5) 12px, rgba(150,225,220,.5) 13px, transparent 14px) 0 0 / 24px 14px repeat-x; opacity: .6; animation: waveSlide 7s linear infinite; }
.wave-2 { top: 26px; opacity: .35; animation-duration: 11s; animation-direction: reverse; }
.rel-boat { position: absolute; left: 50%; bottom: 17%; width: 62%; transform: translateX(-50%); }
.rel-float { transform-origin: 50% 85%; animation: bob 5s ease-in-out infinite; }
.rel-ripples { position: absolute; left: 50%; bottom: 19%; width: 0; height: 0; }
.rel-ripples i { position: absolute; left: -90px; top: -14px; width: 180px; height: 28px; border-radius: 50%; border: 2px solid rgba(190,240,232,.65); opacity: 0; animation: ringOut 3.2s ease-out infinite; }
.rel-ripples i:nth-child(2) { animation-delay: 1.05s; } .rel-ripples i:nth-child(3) { animation-delay: 2.1s; }
.rel-splash { position: absolute; left: 50%; bottom: 20%; width: 0; height: 0; }
.rel-splash b { position: absolute; width: 7px; height: 7px; margin: -3px; border-radius: 50%; background: #bff2ea; box-shadow: 0 0 6px #bff2ea; opacity: 0; animation: droplet .95s cubic-bezier(.2,.7,.4,1) forwards; }
.rel-sparkle { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #ffe7a1; box-shadow: 0 0 8px 2px rgba(255,214,120,.6); opacity: 0; animation: sparkleUp var(--t, 4s) ease-out forwards; }
.rel-lantern { position: absolute; bottom: -40px; width: 22px; height: 28px; border-radius: 6px 6px 9px 9px; background: linear-gradient(180deg, #ffcf70, #f08a2a); box-shadow: 0 0 18px 6px rgba(255,170,60,.5); opacity: 0; animation: lanternUp var(--t, 12s) ease-in forwards; }
.flame-outer, .flame-inner { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 1.1s ease-in-out infinite alternate; }
.flame-inner { animation-duration: .8s; animation-delay: -.3s; }
.flame-glow { animation: glowPulse 1.6s ease-in-out infinite alternate; }

.release-go .rel-boat { animation: dropIn 1.35s cubic-bezier(.45,0,.75,1) both; }
.release-go .rel-float { animation: bob 5s ease-in-out 1.35s infinite; }
.release-go .rel-ripples i { animation-delay: 1.15s; } .release-go .rel-ripples i:nth-child(2) { animation-delay: 2.2s; } .release-go .rel-ripples i:nth-child(3) { animation-delay: 3.25s; }
.view-panel.animating .reveal { opacity: 0; }
.view-panel.animating.go .reveal { animation: fadeUp .9s ease-out 2.6s forwards; }

@keyframes waveSlide { to { transform: translateX(-24px); } }
@keyframes ringOut { 0% { opacity: .9; transform: scale(.15); } 100% { opacity: 0; transform: scale(1.55); } }
@keyframes dropIn { 0% { opacity: 0; transform: translate(-50%, -300px) rotate(-10deg) scale(1.2); } 12% { opacity: 1; } 68% { transform: translate(-50%, 0) rotate(2deg) scale(1); } 78% { transform: translate(-50%, 9px) scale(1.05, .93); } 90% { transform: translate(-50%, -4px) scale(.99, 1.02); } 100% { transform: translate(-50%, 0) scale(1); } }
@keyframes droplet { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); } }
@keyframes sparkleUp { 0% { opacity: 0; transform: translate(0, 0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx, 0px), -150px); } }
@keyframes lanternUp { 0% { opacity: 0; transform: translate(0, 0) rotate(-3deg); } 12% { opacity: .95; } 100% { opacity: 0; transform: translate(var(--dx, 20px), -330px) rotate(4deg) scale(.7); } }
@keyframes flicker { 0% { transform: scale(1, 1) rotate(-1.5deg); } 50% { transform: scale(.92, 1.08) rotate(1deg); } 100% { transform: scale(1.06, .95) rotate(-.5deg); } }
@keyframes glowPulse { from { opacity: .7; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 560px) { .release { height: 270px; } .rel-boat { width: 74%; } }
@media (prefers-reduced-motion: reduce) { .wave, .rel-ripples i, .rel-float, .flame-outer, .flame-inner, .flame-glow, .release-go .rel-boat, .release-go .rel-float { animation: none; } .rel-ripples i { opacity: .4; transform: scale(.9); } .view-panel.animating .reveal { opacity: 1; animation: none !important; } }

/* ---------- River page ---------- */
.river-page { overflow: hidden; height: 100svh; }
.river-page .scene, .river-page .scene-shade { display: none; }
.river-page .site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 30; width: 100%; height: 88px; margin: 0; padding: 0 max(4.5vw, calc((100vw - 1280px) / 2)); border-bottom: 0; background: linear-gradient(180deg, rgba(4,14,20,.82) 0%, rgba(4,14,20,.45) 60%, rgba(4,14,20,0) 100%); }
.river-page .brand, .river-page .nav-link { text-shadow: 0 1px 10px rgba(0,0,0,.65); }
.river-page .main-nav { gap: clamp(20px, 3vw, 40px); }
.river-view { position: fixed; inset: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; background: #0a1030; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-x; }
.river-view::-webkit-scrollbar { display: none; }
.river-world {
    --w: max(100vw, 177.78svh); --h: calc(var(--w) * .5628);
    position: relative; width: var(--w); height: var(--h);
    margin-top: calc((100svh - var(--h)) / 2);
    /* โทนมืด: ไล่เงามุมจอ + ชั้นน้ำเงินเข้มทับภาพ (ปรับความมืดที่ค่า alpha .42 / .55 — มากขึ้น = มืดขึ้น)
       ใช้ชุดเดียวกันทับชั้นน้ำเคลื่อนไหวด้วย (.river-water::after) ให้ผืนน้ำมืดเท่าภาพ ไม่เห็นขอบสว่างเป็นก้อน */
    --night-tint: radial-gradient(ellipse 75% 70% at 50% 58%, rgba(2,4,24,0) 40%, rgba(2,4,24,.55) 100%), linear-gradient(rgba(5,8,34,.42), rgba(5,8,34,.42));
    background: var(--night-tint), #0a1030 url('../images/backgrounds/river-lantern-night.webp') center / 100% 100% no-repeat;
}

.rk { all: unset; box-sizing: border-box; position: absolute; width: calc(var(--w) * .095 * var(--s, 1)); transform: translate(-50%, -78%); will-change: transform; contain: layout; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rk:focus-visible .rk-tag, .rk:hover .rk-tag { opacity: 1; transform: translate(-50%, 0); }
.rk:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 12px; }
.rk-drift { display: block; position: relative; }
.rk-release, .rk-arc, .rk-bob { display: block; }
.rk-bob { animation: bob var(--bob, 5s) ease-in-out infinite; transform-origin: 50% 85%; }
.river-art { display: block; width: 100%; height: auto; overflow: visible; }
.rk-tag { position: absolute; left: 50%; top: 100%; margin-top: 4px; transform: translate(-50%, -4px); opacity: 0; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 400; white-space: nowrap; max-width: 160px; overflow: hidden; line-height: 1.5; text-overflow: ellipsis; color: var(--cream); background: rgba(6,22,20,.82); border: 1px solid rgba(232,199,126,.4); transition: opacity .2s, transform .2s; pointer-events: none; }
.rk-ring, .rk-splash { position: absolute; left: 50%; top: 80%; width: 0; height: 0; pointer-events: none; }
.rk-ring::before, .rk-ring::after { content: ''; position: absolute; left: calc(var(--w) * -.055); top: calc(var(--w) * -.012); width: calc(var(--w) * .11); height: calc(var(--w) * .024); border-radius: 50%; border: 2px solid rgba(255,226,150,.8); opacity: 0; animation: ringOut 3.2s ease-out infinite; }
.rk-ring::after { animation-delay: 1.6s; }
.rk-mine .rk-tag { opacity: 1; transform: translate(-50%, 0); color: #263a27; background: linear-gradient(135deg, #f2d995, #d8ad5d); border-color: transparent; font-weight: 500; }
.rk-splash b { position: absolute; width: 7px; height: 7px; margin: -3px; border-radius: 50%; background: #cdf5ee; box-shadow: 0 0 6px #cdf5ee; opacity: 0; }
.rk-mine.splashed .rk-splash b { animation: droplet .95s cubic-bezier(.2,.7,.4,1) forwards; }

/* ปล่อยกระทงของเรา: ลอยโค้งจากท่าน้ำ (ล่างกลางภาพ) ลงน้ำ */
.rk-mine.is-releasing { --fx: calc(var(--w) * .05); --fy: calc(var(--w) * .16); }
.rk-mine.is-releasing .rk-release { animation: relX 2.2s linear both; }
.rk-mine.is-releasing .rk-arc { animation: relY 2.2s linear both; }
.rk-mine.is-releasing .rk-ring { opacity: 0; animation: fadeIn .1s linear 2.2s forwards; }

.river-toast { position: fixed; left: 50%; bottom: 22px; z-index: 40; width: min(480px, calc(100% - 28px)); transform: translate(-50%, 30px); opacity: 0; pointer-events: none; padding: 16px 20px; text-align: center; border-radius: 18px; border: 1px solid rgba(232,199,126,.3); background: rgba(8,26,23,.93); display: grid; gap: 4px; transition: opacity .6s, transform .6s; }
.river-toast-show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.river-toast strong { font-weight: 500; font-size: 17px; }
.river-toast > span { color: var(--muted); font-size: 13px; }
.river-toast-actions { display: flex; gap: 10px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }
.river-toast-actions .button { min-height: 42px; padding: 0 20px; width: auto; font-size: 14px; }

@keyframes glint { from { transform: translate3d(-90px, 0, 0); } to { transform: translate3d(0, 0, 0); } }
@keyframes glint-wide { from { transform: translate3d(-130px, 0, 0); } to { transform: translate3d(0, 0, 0); } }
@keyframes skyUp { 0% { opacity: 0; transform: translate(0, 0); } 10% { opacity: .95; } 100% { opacity: 0; transform: translate(var(--dx, 20px), -75svh) scale(.7); } }
@keyframes relX { from { transform: translateX(var(--fx)); } to { transform: translateX(0); } }
@keyframes relY { 0% { transform: translateY(var(--fy)) scale(1.9) rotate(-14deg); animation-timing-function: cubic-bezier(.2,.7,.4,1); }
                  45% { transform: translateY(calc(var(--w) * -.04)) scale(1.35) rotate(6deg); animation-timing-function: cubic-bezier(.55,0,.8,.5); }
                  82% { transform: translateY(0) scale(1) rotate(0); }
                  91% { transform: translateY(5px) scale(1.04, .94); }
                  100% { transform: translateY(0) scale(1); } }
@keyframes fadeIn { to { opacity: 1; } }
@media (max-width: 760px) {
    .river-page .site-header { height: 70px; padding: 0 18px; }
    .river-toast { bottom: max(12px, env(safe-area-inset-bottom)); width: calc(100% - 24px); padding: 12px 14px; border-radius: 16px; gap: 2px; }
    .river-toast strong { font-size: 15px; }
    .river-toast > span { font-size: 12px; line-height: 1.5; }
    .river-toast-actions { margin-top: 6px; gap: 8px; flex-wrap: nowrap; }
    .river-toast-actions .button { flex: 1 1 0; min-height: 40px; padding: 0 10px; font-size: 13px; gap: 6px; white-space: nowrap; }
    .wish-dialog { padding: 26px 18px 20px; }
}
@media (prefers-reduced-motion: reduce) { .rk-bob, .river-glint::before, .river-glint::after, .rk-ring::before, .rk-ring::after { animation: none; } .rk-ring { opacity: 1; } }


/* ---- เพิ่มภายหลัง: honeypot, ข้อความแจ้งความเป็นส่วนตัว, ลิงก์ท้ายเว็บ ---- */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.review-notice { margin: 14px 0 0; font-size: .85rem; line-height: 1.6; opacity: .8; }
.footer-link { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.footer-link:hover { opacity: .8; }
.legal-panel { max-width: 720px; margin: 0 auto; line-height: 1.8; }
.legal-panel h2 { margin-top: 1.6em; }

/* ---- หน้าผู้ดูแล ---- */
.admin-panel { max-width: 960px; }
.admin-login { display: grid; gap: 12px; max-width: 360px; }
.admin-login input { padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(232, 194, 106, .35); background: rgba(0, 0, 0, .25); color: inherit; font: inherit; }
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; line-height: 1.5; }
.admin-table th, .admin-table td { padding: 8px 10px; border-bottom: 1px solid rgba(255, 255, 255, .12); text-align: left; vertical-align: top; }
.admin-table tr.is-hidden td { opacity: .45; }

/* ---- รายงานกระทงที่ไม่เหมาะสม ---- */
.wish-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.report-link { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; font-family: inherit; font-size: 13px; color: var(--muted); border-radius: 999px; text-decoration: underline; text-decoration-color: rgba(255, 245, 223, .3); text-underline-offset: 4px; }
.report-link:hover { color: var(--cream); text-decoration-color: currentColor; }
.report-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.report-link[hidden] { display: none; }
.report-line { margin: 10px 0 0; }

.report-dialog { text-align: left; max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.report-dialog h2 { margin-bottom: 14px; }
.report-form[hidden], .report-done[hidden], .report-msg[hidden] { display: none; }
.report-reasons { margin: 0 0 14px; padding: 0; border: 0; display: grid; gap: 8px; min-width: 0; }
.report-reasons legend { padding: 0; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.report-reason { display: block; cursor: pointer; }
.report-reason input { position: absolute; opacity: 0; pointer-events: none; }
.report-reason span { display: flex; align-items: center; gap: 11px; min-height: 46px; padding: 9px 14px; border: 1px solid rgba(232, 199, 126, .22); border-radius: 12px; font-size: 14px; line-height: 1.45; background: rgba(255, 245, 223, .04); transition: border-color .15s, background .15s; }
.report-reason span::before { content: ''; flex: none; width: 16px; height: 16px; border: 1px solid var(--gold); border-radius: 50%; }
.report-reason:hover span { border-color: rgba(232, 199, 126, .5); }
.report-reason input:checked + span { border-color: var(--gold); background: rgba(232, 199, 126, .1); }
.report-reason input:checked + span::before { background: var(--gold); box-shadow: inset 0 0 0 3px #0d2823; }
.report-reason input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.report-label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.report-dialog textarea { display: block; width: 100%; resize: vertical; min-height: 84px; padding: 11px 13px; border: 1px solid rgba(232, 199, 126, .3); border-radius: 12px; background: rgba(0, 0, 0, .25); color: var(--cream); font: inherit; font-size: 16px; line-height: 1.6; }
.report-dialog textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.report-count { display: block; margin-top: 4px; text-align: right; font-size: 12px; color: var(--muted); }
.report-msg { margin: 10px 0 0; padding: 10px 14px; border: 1px solid rgba(255, 140, 125, .4); border-radius: 10px; background: rgba(120, 35, 30, .25); color: #ffd4cc; font-size: 13px; }
.report-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.report-actions .button { min-height: 46px; padding: 0 22px; width: auto; }
.report-actions .button:disabled { opacity: .6; cursor: progress; transform: none; }
.report-done { text-align: center; padding: 6px 0 0; }
.report-done p { margin: 0 0 18px; line-height: 1.7; overflow-wrap: anywhere; }
.report-done .success-symbol { width: 52px; height: 52px; margin-bottom: 14px; font-size: 24px; }
@media (max-width: 560px) {
    .report-dialog { padding: 24px 16px 18px; }
    .report-actions { flex-direction: column-reverse; }
    .report-actions .button { width: 100%; }
}


/* =====================================================================
   Responsive overhaul — มือถือ / iPad (portrait + landscape)
   ไล่ breakpoint: 1024 (iPad Pro / แท็บเล็ตแนวนอน) → 900 (iPad แนวตั้ง)
   → 560 (มือถือ) → 400 (มือถือจอเล็ก) และโหมดจอเตี้ย (มือถือแนวนอน)
   ===================================================================== */
:root { --gutter: clamp(20px, 4.5vw, 48px); --header-h: 92px; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
a, button, label, input, select, textarea, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
img, svg { max-width: 100%; }
.create-page { min-height: 100dvh; }
.site-footer { padding-bottom: calc(15px + env(safe-area-inset-bottom)); }
.footer-brand, .site-footer > span { min-width: 0; }

/* พื้นหลัง fixed ไม่ให้สเกลกระตุกตอน address bar ของ iOS ยุบ/ขยาย */
@supports (height: 100lvh) {
    .scene, .scene-shade, .fireflies { bottom: auto; height: 100lvh; }
}

/* ---------- แท็บเล็ต / จอ ≤ 1024 ---------- */
@media (max-width: 1024px) {
    .create-shell { width: calc(100% - 2 * var(--gutter)); padding-top: 52px; }
    .gallery-shell { width: calc(100% - 2 * var(--gutter)); }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, clamp(160px, 21vw, 230px)), 1fr)); }
    /* iOS/iPadOS ซูมเองถ้า font-size ของช่องกรอกน้อยกว่า 16px */
    .text-field, .report-dialog textarea, .admin-login input { font-size: 16px; }
}

/* ---------- iPad แนวตั้ง / มือถือ (≤ 900): เมนูแบบ dropdown ---------- */
@media (max-width: 900px) {
    :root { --header-h: 76px; --gutter: 24px; }
    .site-header { height: var(--header-h); width: calc(100% - 2 * var(--gutter)); }
    .brand { font-size: 19px; }
    .brand-mark { width: 28px; height: 28px; }
    .menu-toggle { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; width: 46px; height: 46px; margin-right: -9px; border: 0; border-radius: 12px; background: transparent; padding: 0; cursor: pointer; }
    .menu-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
    .menu-toggle span { display: block; width: 24px; height: 2px; border-radius: 2px; background: var(--cream); }
    .main-nav { display: none; position: absolute; z-index: 5; top: calc(100% + 8px); right: 0; width: min(340px, 100%); padding: 10px 20px; flex-direction: column; align-items: stretch; gap: 0; font-size: 16px; background: rgba(12, 33, 29, .97); border: 1px solid rgba(232, 199, 126, .3); border-radius: 18px; box-shadow: 0 18px 50px rgba(0, 0, 0, .4); }
    .main-nav.open { display: flex; }
    .main-nav .nav-link { padding: 15px 2px; border-bottom: 1px solid rgba(255, 245, 223, .1); }
    .main-nav .nav-link:last-of-type { border-bottom: 0; }
    .main-nav .nav-cta { margin: 8px 0; padding: 14px 19px; text-align: center; }
    .nav-link.active { color: var(--gold); }

    /* ฉาก/พื้นหลังแนวตั้ง: เลื่อนจุดโฟกัสไปที่วัด+แม่น้ำ แล้วเพิ่มความเข้มให้อ่านข้อความง่าย */
    .scene { background-position: 60% center; }
    .scene-shade { background: linear-gradient(90deg, rgba(5, 10, 38, .74), rgba(6, 12, 42, .4)), linear-gradient(180deg, rgba(5, 10, 36, .2), rgba(5, 12, 34, .5)); }

    /* หน้าแรก */
    .hero { width: calc(100% - 2 * var(--gutter)); min-height: min(820px, calc(84svh - var(--header-h))); padding: 56px 0 96px; }
    .hero-content { max-width: 600px; }
    h1 { font-size: clamp(52px, 10.5vw, 88px); }
    .hero-description { font-size: clamp(16px, 2.4vw, 19px); }
    .mobile-break { display: initial; }
    .intro { padding: 80px var(--gutter) 88px; }
    .intro-copy { font-size: 15px; }

    /* ฟอร์มสร้างกระทง: เหลือคอลัมน์เดียว + พรีวิวเป็นแถบกะทัดรัดด้านบน */
    .create-layout, .wizard-layout { grid-template-columns: minmax(0, 1fr); }
    .wizard-preview, .preview-panel { position: static; grid-row: 1; }
    .wizard-preview { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); grid-template-areas: "art kick" "art title" "art kname" "art nick" "art prayer"; align-content: center; column-gap: 24px; padding: 20px 26px; text-align: left; }
    .wizard-preview .krathong-preview { grid-area: art; align-self: center; width: 100%; max-width: none; height: auto; margin: 0; }
    .wizard-preview .section-kicker { grid-area: kick; margin: 0 0 2px; }
    .wizard-preview h2 { grid-area: title; font-size: 19px; }
    .wizard-preview .preview-krathong-name { grid-area: kname; margin: 8px 0 2px; }
    .wizard-preview .preview-nickname { grid-area: nick; margin: 0 0 4px; }
    .wizard-preview .preview-prayer { grid-area: prayer; margin: 0; max-width: none; min-height: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
    .wizard-preview .preview-note { display: none; }

    /* ปุ่มเดิน/ย้อนกลับ ติดขอบล่างของแผงฟอร์ม เลื่อนยาว ๆ ก็ยังกดได้ */
    .form-panel { --pad-x: 26px; --pad-y: 26px; padding: var(--pad-y) var(--pad-x); }
    .wizard-actions { position: sticky; bottom: 0; z-index: 5; margin: 26px calc(var(--pad-x) * -1) calc(var(--pad-y) * -1); padding: 14px var(--pad-x) calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255, 245, 223, .12); border-radius: 0 0 22px 22px; background: rgba(9, 29, 25, .96); }
    .wizard-actions .button { min-height: 50px; }

    /* ตัวเลือกกระทง/ชุดดอกไม้ 3 คอลัมน์บนแท็บเล็ต */
    .krathong-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
    .catalog-name { font-size: 14px; }
    .catalog-description { font-size: 11.5px; }
    .set-flowers { font-size: 12px; }
    .prayer-tabs span { padding: 11px 18px; font-size: 13px; }
    .prayer-option { padding: 14px 15px; font-size: 13.5px; }
    .wizard-steps span { font-size: 11px; }

    /* หน้ารายละเอียด / ป๊อปอัป */
    .view-panel { max-width: 720px; padding: 40px 32px; }
    .release { width: min(100%, 640px); height: 380px; }
    .wish-dialog { max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
    .wish-close { width: 44px; height: 44px; display: grid; place-items: center; top: 8px; right: 8px; font-size: 28px; }

    /* หน้าแม่น้ำ */
    .river-page .site-header { height: calc(var(--header-h) - 6px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left)); }
    .river-page .main-nav { right: max(var(--gutter), env(safe-area-inset-right)); }
    .river-toast { bottom: max(16px, env(safe-area-inset-bottom)); }
}

/* ---------- แท็บเล็ตแนวตั้งโดยเฉพาะ (561–900) ---------- */
@media (min-width: 561px) and (max-width: 900px) {
    .hero-actions .button { min-width: 220px; }
    .create-heading h1 { font-size: clamp(40px, 6.4vw, 54px); }
    .flower-set-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- มือถือ (≤ 560) ---------- */
@media (max-width: 560px) {
    :root { --gutter: 18px; --header-h: 70px; }
    .brand { font-size: 17px; gap: 9px; }
    .brand-mark { width: 26px; height: 26px; }
    .hero { min-height: calc(86svh - var(--header-h)); padding: 44px 0 88px; }
    .eyebrow { font-size: 10px; letter-spacing: .15em; }
    h1 { font-size: clamp(46px, 13.5vw, 64px); }
    .hero-description { margin: 20px 0 26px; font-size: 15.5px; line-height: 1.85; }
    .hero-actions { max-width: none; }
    .hero-note { font-size: 12.5px; }
    .intro { padding: 68px 22px 76px; }
    .intro-copy { font-size: 14px; line-height: 1.95; }
    .text-link { display: inline-block; padding: 6px 0 8px; }
    .site-footer { font-size: 12px; padding-left: 20px; padding-right: 20px; }

    .create-shell, .gallery-shell { width: calc(100% - 2 * var(--gutter)); padding: 34px 0 54px; }
    .create-heading h1 { font-size: 36px; }
    .create-heading h1 span { margin-left: 6px; }
    .create-heading > p:last-child { font-size: 13.5px; }
    .form-panel { --pad-x: 16px; --pad-y: 20px; border-radius: 18px; }
    .wizard-actions { border-radius: 0 0 18px 18px; margin-top: 22px; gap: 9px; }
    .wizard-actions .button { min-width: 0; }
    .wizard-actions #nextStep, .wizard-actions #submitKrathong { flex: 1 1 auto; }
    .step-heading { gap: 12px; margin-bottom: 18px; }
    .step-heading h2 { font-size: 18px; }
    .wizard-step .step-heading { margin-bottom: 20px; }
    .wizard-progress { margin-bottom: 24px; }
    .wizard-steps span { font-size: 10.5px; }

    /* พรีวิวกะทัดรัด: รูปซ้าย ข้อความขวา */
    .wizard-preview { grid-template-columns: 112px minmax(0, 1fr); column-gap: 16px; padding: 14px 16px; border-radius: 18px; }
    .wizard-preview .section-kicker, .wizard-preview h2 { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .wizard-preview .preview-krathong-name { margin: 0 0 2px; font-size: 12px; }
    .wizard-preview .preview-nickname { font-size: 17px; }
    .wizard-preview .preview-prayer { font-size: 12.5px; line-height: 1.65; }

    /* ชุดดอกไม้: การ์ดแนวนอน ภาพซ้าย-ข้อความขวา อ่านง่ายกว่า 2 คอลัมน์แคบ ๆ */
    .flower-set-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .flower-set-option { display: grid; grid-template-columns: minmax(0, 44%) minmax(0, 1fr); grid-template-areas: "vis name" "vis flw" "vis desc"; align-items: center; justify-items: start; text-align: left; column-gap: 12px; row-gap: 2px; padding: 10px 36px 10px 10px; }
    .flower-set-option .set-visual { grid-area: vis; }
    .flower-set-option .catalog-name { grid-area: name; }
    .flower-set-option .set-flowers { grid-area: flw; }
    .flower-set-option .catalog-description { grid-area: desc; font-size: 11.5px; }
    .catalog-selected { top: 10px; right: 10px; }
    .krathong-grid:not(.flower-set-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .catalog-description { font-size: 11px; }

    .review-row { font-size: 13px; }
    .review-prayer { font-size: 13px; }
    .wizard-hint, .char-count { font-size: 12px; }
    .field-label span { font-size: 12px; }

    .view-panel { padding: 30px 16px; }
    .release { height: 280px; }
    .gallery-pager .button { padding: 0 16px; }
    .river-toast > span { font-size: 12.5px; }
}

/* ---------- มือถือจอเล็กมาก (≤ 380) ---------- */
@media (max-width: 380px) {
    .brand { font-size: 16px; }
    .wizard-preview { grid-template-columns: 92px minmax(0, 1fr); column-gap: 12px; }
    .flower-set-option { grid-template-columns: minmax(0, 40%) minmax(0, 1fr); }
    .wizard-steps span { font-size: 10px; }
    .wizard-actions .button { padding-left: 14px; padding-right: 14px; font-size: 13.5px; }
}

/* ---------- จอเตี้ย (มือถือแนวนอน): ย่อทุกอย่างให้พอดีจอ ---------- */
@media (max-height: 520px) and (orientation: landscape) {
    :root { --header-h: 60px; }
    .site-header { height: var(--header-h); }
    .hero { min-height: 0; padding: 26px 0 36px; }
    .eyebrow { margin-bottom: 12px; }
    h1 { font-size: clamp(34px, 11vh, 54px); line-height: 1.12; }
    .hero-description { margin: 12px 0 18px; font-size: 14px; line-height: 1.7; }
    .hero-actions { flex-direction: row; flex-wrap: wrap; max-width: none; gap: 10px; }
    .hero-actions .button { width: auto; min-height: 44px; padding: 0 20px; }
    .hero-note, .scroll-hint { display: none; }
    .intro { padding: 44px var(--gutter) 48px; }
    .create-shell { padding: 22px 0 40px; }
    .create-heading { margin-bottom: 20px; }
    .create-heading h1 { font-size: 32px; }
    .wizard-actions { position: static; margin: 22px 0 0; padding: 16px 0 0; background: none; border-radius: 0; }
    .form-panel { padding: 20px; }
    .view-panel { padding: 22px 20px; }
    .release { height: 220px; }
    .wish-dialog { padding: 20px 18px 16px; }

    /* แม่น้ำ: toast กะทัดรัด ไม่บังผืนน้ำ */
    .river-page .site-header { height: calc(56px + env(safe-area-inset-top)); }
    .river-toast { width: min(600px, calc(100% - 28px)); grid-template-columns: minmax(0, 1fr) auto; align-items: center; text-align: left; column-gap: 16px; padding: 10px 14px; bottom: max(10px, env(safe-area-inset-bottom)); }
    .river-toast strong { grid-column: 1; font-size: 14px; }
    .river-toast > span { grid-column: 1; font-size: 11.5px; line-height: 1.4; }
    .river-toast-actions { grid-column: 2; grid-row: 1 / span 2; margin: 0; flex-wrap: nowrap; }
    .river-toast-actions .button { flex: none; min-height: 38px; padding: 0 14px; font-size: 13px; }
    .river-toast-actions .button-ghost { display: none; }
}

/* ---------- หน้าแม่น้ำบนมือถือ/ไอแพด: ล็อกจอ ไม่ให้เลื่อน (กระทงทุกใบอยู่ในจอ) ---------- */
.river-view.is-locked { overflow: hidden; touch-action: manipulation; overscroll-behavior: none; }

/* ---------- ฟองคำอธิษฐานเหนือกระทง (แสดงตอนเอาเมาส์ชี้) + ชื่ออยู่ด้านล่าง ---------- */
.rk-wish { position: absolute; left: 50%; bottom: calc(100% + 4px); z-index: 2; width: max-content; max-width: 210px; padding: 8px 12px; border-radius: 12px; font-size: 12.5px; font-weight: 300; line-height: 1.55; text-align: left; color: var(--cream); background: rgba(6, 22, 20, .9); border: 1px solid rgba(232, 199, 126, .4); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; overflow-wrap: anywhere; opacity: 0; transform: translate(calc(-50% + var(--shift, 0px)), 4px); transition: opacity .2s, transform .2s; pointer-events: none; }
.rk:hover, .rk:focus-visible { z-index: 900 !important; }
@media (hover: hover) {
    .rk:hover .rk-wish, .rk:focus-visible .rk-wish { opacity: 1; transform: translate(calc(-50% + var(--shift, 0px)), 0); }
}

/* ---------- ระบบเสียง (assets/js/audio.js) ---------- */
.kt-audio { position: fixed; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; font-family: 'Kanit', sans-serif; }
.kt-audio-bar { display: flex; gap: 8px; padding: 5px; border-radius: 999px; border: 1px solid rgba(232, 199, 126, .35); background: rgba(8, 26, 23, .92); box-shadow: 0 8px 26px rgba(0, 0, 0, .35); }
.kt-audio-btn { position: relative; display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; color: var(--gold); background: transparent; cursor: pointer; transition: background .2s, color .2s, transform .15s; }
.kt-audio-btn svg { width: 22px; height: 22px; }
.kt-audio-btn:hover { background: rgba(232, 199, 126, .14); }
.kt-audio-btn:active { transform: scale(.94); }
.kt-audio-btn:focus-visible, .kt-audio-row input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.kt-audio-toggle { color: rgba(255, 245, 223, .65); }
.kt-audio.is-on .kt-audio-toggle { color: #183b2e; background: var(--gold); }
.kt-audio.is-on .kt-audio-toggle:hover { background: #f1d594; }
.kt-audio.is-playing .kt-audio-toggle::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid rgba(232, 199, 126, .55); animation: kt-audio-pulse 2.4s ease-out infinite; }
.kt-audio.is-waiting .kt-audio-toggle { animation: kt-audio-wait 1.6s ease-in-out infinite; }
@keyframes kt-audio-pulse { from { transform: scale(.9); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }
@keyframes kt-audio-wait { 50% { opacity: .55; } }

.kt-audio-panel { width: min(260px, calc(100vw - 28px)); padding: 14px 16px 10px; border-radius: 18px; border: 1px solid rgba(232, 199, 126, .3); background: rgba(8, 26, 23, .94); box-shadow: 0 16px 44px rgba(0, 0, 0, .45); }
.kt-audio-panel[hidden], .kt-audio-hint[hidden] { display: none; }
.kt-audio-title { margin: 0 0 8px; font-size: 13px; font-weight: 500; letter-spacing: .04em; color: var(--gold); }
.kt-audio-row { display: grid; grid-template-columns: 78px 1fr; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; color: var(--cream); }
.kt-audio-row input { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 0; background: transparent; cursor: pointer; --fill: 50%; }
.kt-audio-row input::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--gold) var(--fill), rgba(255, 245, 223, .22) var(--fill)); }
.kt-audio-row input::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 245, 223, .22); }
.kt-audio-row input::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--gold); }
.kt-audio-row input::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; border: 2px solid #183b2e; background: var(--gold); box-shadow: 0 1px 6px rgba(0, 0, 0, .4); }
.kt-audio-row input::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #183b2e; background: var(--gold); }

.kt-audio-hint { position: absolute; right: 0; bottom: calc(100% + 10px); white-space: nowrap; padding: 8px 14px; border-radius: 999px; font-size: 13px; color: #183b2e; background: var(--gold); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); animation: kt-audio-wait 2s ease-in-out infinite; }
.kt-audio-hint::after { content: ''; position: absolute; right: 18px; top: 100%; border: 6px solid transparent; border-top-color: var(--gold); }

/* หน้าแม่น้ำ: ด้านล่างมีกล่องข้อความ จึงย้ายปุ่มเสียงไปมุมขวาบนใต้เมนู */
.river-page .kt-audio { bottom: auto; top: 92px; }
.river-page .kt-audio-hint { bottom: auto; top: calc(100% + 10px); }
.river-page .kt-audio-hint::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--gold); }
.river-page .kt-audio { flex-direction: column-reverse; }

/* หน้าสร้างกระทงบนมือถือ: เว้นเหนือแถบปุ่มย้อนกลับ/ถัดไปที่ติดล่างจอ */
@media (max-width: 900px) {
    .create-page .kt-audio { bottom: calc(86px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
    .kt-audio.is-playing .kt-audio-toggle::after, .kt-audio.is-waiting .kt-audio-toggle, .kt-audio-hint { animation: none; }
}

/* ประสิทธิภาพ: เปลวเทียนของกระทงคนอื่นอยู่นิ่ง (อนิเมชันภายใน SVG วาดใหม่ทุกเฟรม) เคลื่อนไหวเฉพาะกระทงของเรา/ตอนชี้ */
.rk:not(.rk-mine):not(:hover):not(:focus-visible) .flame-outer,
.rk:not(.rk-mine):not(:hover):not(:focus-visible) .flame-inner,
.rk:not(.rk-mine):not(:hover):not(:focus-visible) .flame-glow { animation: none; }

/* ---- สถิติจำนวนกระทง (ทั้งหมด / วันนี้) ---- */
.kt-stats { display: flex; justify-content: center; gap: 12px; margin: 6px 0 4px; }
.kt-stat { display: grid; gap: 2px; min-width: 112px; padding: 10px 18px; text-align: center; border-radius: 14px; border: 1px solid rgba(232,199,126,.28); background: rgba(8,26,23,.55); }
.kt-stat strong { font-size: 26px; font-weight: 600; line-height: 1.1; color: var(--gold, #e8c77e); font-variant-numeric: tabular-nums; }
.kt-stat span { font-size: 12px; color: var(--muted, rgba(255,245,223,.7)); letter-spacing: .02em; }
.kt-stats-hero { justify-content: flex-start; margin: 26px 0 0; }
.river-toast .kt-stats { margin: 4px 0 2px; }
.river-toast .kt-stat { min-width: 0; flex: 1; padding: 6px 12px; background: rgba(255,255,255,.04); }
.river-toast .kt-stat strong { font-size: 22px; }
.gallery-shell .kt-stats { margin-top: 14px; }
@media (max-width: 560px) { .kt-stat { min-width: 96px; padding: 8px 12px; } .kt-stat strong { font-size: 22px; } .kt-stats-hero { margin-top: 18px; } }
@media (max-height: 520px) { .river-toast .kt-stats { display: none; } }
.kt-stat strong.kt-bump { animation: kt-bump .9s ease-out; }
@keyframes kt-bump { 0% { transform: scale(1); } 30% { transform: scale(1.25); color: #fff3cf; } 100% { transform: scale(1); } }
.rk-arrive { animation: rk-arrive 2.2s ease-out; }
@keyframes rk-arrive { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .kt-stat strong.kt-bump, .rk-arrive { animation: none; } }
@media (max-height: 520px) { .kt-stats-hero { display: none; } }


/* =====================================================================
   River v2 — คืนจันทร์เต็มดวง (ภาพ river-lantern-night): กระทงเด่นขึ้น + แอนิเมชันเข้ากับภาพ + UI เรียบง่าย
   ตำแหน่งของทุกชั้นเอฟเฟกต์เป็น % ของภาพ จึงตรงกับภาพทุกขนาดจอ
   ===================================================================== */
.river-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.river-fx > i { position: absolute; display: block; }
.fx-moon { left: 69.4%; top: 14.4%; width: 25%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(255,236,170,.42) 0, rgba(255,222,140,.18) 28%, transparent 62%); animation: moonPulse 6s ease-in-out infinite alternate; }

.river-stars { position: absolute; inset: 0 0 42% 0; pointer-events: none; overflow: hidden; }
.river-stars i { position: absolute; width: calc(var(--w) * .0016); height: calc(var(--w) * .0016); border-radius: 50%; background: #fff6d8; opacity: 0; animation: starTwinkle var(--t, 4s) ease-in-out var(--d, 0s) infinite; }
.river-stars i.big { width: calc(var(--w) * .011); height: calc(var(--w) * .011); border-radius: 0; background: radial-gradient(circle, #fff 0 8%, rgba(255,246,216,.75) 14%, transparent 34%), linear-gradient(90deg, transparent 38%, rgba(255,246,216,.9) 50%, transparent 62%) center / 100% 8% no-repeat, linear-gradient(180deg, transparent 38%, rgba(255,246,216,.9) 50%, transparent 62%) center / 8% 100% no-repeat; transform: translate(-50%, -50%); }

/* แสงสะท้อนจันทร์บนผิวน้ำ: เสาแสงสีทอง + ประกายกระเพื่อมทั่วผืนน้ำ */
.river-orbs { position: absolute; inset: 0; pointer-events: none; }
.river-orbs i { position: absolute; width: calc(var(--w) * .0042 * var(--z, 1)); height: calc(var(--w) * .0042 * var(--z, 1)); border-radius: 50%; background: #ffe7a6; box-shadow: 0 0 calc(var(--w) * .007) calc(var(--w) * .0016) rgba(255,196,96,.7); opacity: 0; animation: orbFloat var(--t, 7s) ease-in-out var(--d, 0s) infinite; }

/* โคมลอยฟ้า (ขึ้นจากชายฝั่ง โยกเอนและเล็กลงเมื่อสูงขึ้น) */
.sky-lantern { all: unset; position: absolute; display: block; left: 0; bottom: -2%; width: calc(var(--w) * var(--ls, .014)); height: calc(var(--w) * var(--ls, .014) * 1.28); opacity: 0; animation: skyRise var(--t, 18s) ease-in forwards; will-change: transform, opacity; }
.sky-lantern b { display: block; width: 100%; height: 100%; clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%); border-radius: 18% 18% 6% 6%; background: linear-gradient(180deg, #ffb865 0%, #ff9a45 55%, #ffd88a 100%); box-shadow: inset 0 -35% 50% rgba(255,232,160,.8); animation: lanternSway var(--sw, 4.5s) ease-in-out infinite alternate; transform-origin: 50% 0; filter: drop-shadow(0 0 calc(var(--w) * .008) rgba(255,170,70,.85)); }

/* ---- กระทง: ใหญ่ขึ้น เรืองแสง และสะท้อนผิวน้ำ ---- */
.rk::before { content: ''; position: absolute; left: 50%; top: 42%; width: max(100%, 44px); height: max(72%, 44px); transform: translate(-50%, -50%); }   /* พื้นที่แตะกว้างขึ้นสำหรับกระทงเล็ก */
.rk-drift { isolation: isolate; }
.rk-drift::before { content: ''; position: absolute; left: 50%; top: 44%; width: 165%; aspect-ratio: 1.15; transform: translate(-50%, -50%); z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgba(255,198,100,.46), rgba(255,170,70,.16) 58%, transparent 100%); }
.rk-drift::after { content: ''; position: absolute; left: 50%; top: 76%; width: 120%; height: 24%; transform: translateX(-50%); z-index: -1; pointer-events: none; border-radius: 50%; background: radial-gradient(ellipse, rgba(255,205,120,.5), rgba(255,180,80,.15) 55%, transparent 75%); }
.river-art { filter: drop-shadow(0 4px 4px rgba(0,0,24,.55)); }
.rk:hover .river-art { filter: drop-shadow(0 4px 4px rgba(0,0,24,.55)) brightness(1.15); }
.rk-mine .river-art { filter: drop-shadow(0 0 12px rgba(255,214,120,.8)) drop-shadow(0 4px 4px rgba(0,0,24,.55)); }
.rk-mine .rk-drift::before { width: 200%; background: radial-gradient(closest-side, rgba(255,214,120,.6), rgba(255,180,80,.2) 58%, transparent 100%); animation: glowPulse 2.4s ease-in-out infinite alternate; }
.rk-tag { background: rgba(6,16,40,.88); border-color: rgba(255,214,140,.45); }
.rk-wish { background: rgba(6,16,40,.92); border-color: rgba(255,214,140,.45); }
.rk-mine.is-releasing { --fx: calc(var(--w) * -.12); --fy: calc(var(--w) * .1); }   /* ปล่อยจากท่าน้ำล่างซ้าย */

/* ---- UI: ชิปสถิติมุมซ้ายบน + แถบปุ่มล่างบรรทัดเดียว ---- */
.river-hud { position: fixed; left: max(16px, env(safe-area-inset-left)); top: 92px; z-index: 35; display: flex; align-items: center; gap: 14px; padding: 8px 16px; border-radius: 16px; border: 1px solid rgba(255,214,140,.26); background: rgba(6,16,40,.82); box-shadow: 0 6px 24px rgba(0,0,20,.35); }
.river-hud-title { margin: 0; font-size: 14px; font-weight: 500; letter-spacing: .02em; color: var(--gold); white-space: nowrap; }
.river-hud .kt-stats { margin: 0; gap: 14px; justify-content: flex-start; }
.river-hud .kt-stat { display: flex; align-items: baseline; gap: 6px; min-width: 0; padding: 0; border: 0; background: none; text-align: left; }
.river-hud .kt-stat + .kt-stat { padding-left: 14px; border-left: 1px solid rgba(255,214,140,.28); }
.river-hud .kt-stat strong { font-size: 19px; }
.river-hud .kt-stat span { font-size: 12px; }

.river-page .river-toast { left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); width: auto; max-width: min(600px, calc(100% - 24px)); display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 8px 8px 20px; border-radius: 999px; text-align: left; border: 1px solid rgba(255,214,140,.3); background: rgba(6,16,40,.9); box-shadow: 0 10px 34px rgba(0,0,20,.45); transition: opacity .6s, transform .6s, padding .5s; }
.river-toast-msg { margin: 0; display: grid; gap: 1px; min-width: 0; max-width: 340px; overflow: hidden; transition: max-width .6s, opacity .5s; }
.river-toast-msg strong { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.river-toast-msg span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.river-page .river-toast .river-toast-actions { margin: 0; flex-wrap: nowrap; flex: none; }
.river-page .river-toast .river-toast-actions .button { min-height: 42px; padding: 0 18px; font-size: 14px; white-space: nowrap; width: auto; }
.river-page .river-toast .river-toast-actions .button-ghost { display: inline-flex; background: rgba(255,255,255,.06); }
.river-page .river-toast.is-compact { padding-left: 8px; }
.river-page .river-toast.is-compact .river-toast-msg { max-width: 0; opacity: 0; }
.river-page .river-toast[role="alert"] { padding: 12px 22px; border-radius: 18px; }

.wish-dialog { background: #0a1230; }
.river-page .wish-dialog::backdrop { background: rgba(2,6,22,.78); }

@keyframes moonPulse { from { opacity: .6; transform: translate(-50%, -50%) scale(1); } to { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } }
@keyframes lampFlicker { 0% { opacity: .7; transform: translate(-50%, -50%) scale(.95); } 40% { opacity: 1; } 70% { opacity: .78; } 100% { opacity: .95; transform: translate(-50%, -50%) scale(1.06); } }
@keyframes mistDrift { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
@keyframes starTwinkle { 0%, 100% { opacity: 0; transform: scale(.6); } 50% { opacity: .95; transform: scale(1.15); } }
@keyframes orbFloat { 0%, 100% { opacity: 0; transform: translate(0, 0) scale(.7); } 25%, 75% { opacity: .95; } 50% { opacity: .5; transform: translate(calc(var(--w) * .004), calc(var(--w) * -.003)) scale(1); } }
@keyframes skyRise { 0% { opacity: 0; transform: translate3d(0, 0, 0) scale(.4); } 14% { opacity: .95; } 80% { opacity: .85; } 100% { opacity: 0; transform: translate3d(var(--dx, 30px), calc(var(--h) * var(--rise, -.5)), 0) scale(.85); } }
@keyframes lanternSway { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }

/* มือถือ / ไอแพด (จอล็อก ไม่เลื่อน) */
@media (max-width: 760px) {
    .river-hud { top: 78px; gap: 10px; padding: 7px 12px; border-radius: 14px; }
    .river-hud-title { font-size: 12.5px; }
    .river-hud .kt-stats { gap: 10px; }
    .river-hud .kt-stat + .kt-stat { padding-left: 10px; }
    .river-hud .kt-stat strong { font-size: 16px; }
    .river-hud .kt-stat span { font-size: 11px; }
    .river-page .river-toast { max-width: calc(100% - 20px); gap: 8px; padding: 7px 7px 7px 16px; }
    .river-toast-msg { max-width: 190px; }
    .river-toast-msg strong { font-size: 13px; }
    .river-toast-msg span { font-size: 11.5px; }
    .river-page .river-toast .river-toast-actions { gap: 6px; }
    .river-page .river-toast .river-toast-actions .button { min-height: 40px; padding: 0 14px; font-size: 13px; }
}
@media (max-width: 430px) {
    .river-hud { flex-direction: column; align-items: flex-start; gap: 3px; }
    .river-toast-msg span { display: none; }
}
@media (max-height: 520px) {
    .river-hud { top: 62px; padding: 5px 12px; }
    .river-hud-title { display: none; }
    .river-hud .kt-stats { display: flex; }
    .river-page .river-toast { padding-top: 5px; padding-bottom: 5px; }
    .river-page .river-toast .river-toast-actions .button { min-height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
    .fx-moon, .fx-shore, .fx-sky, .fx-lamp, .fx-mist, .rw-band > i, .river-glint i, .rw-sheen, .river-stars i, .river-orbs i, .rk-mine .rk-drift::before { animation: none; }
    .river-stars i, .river-orbs i { opacity: .7; }
}

.river-orbs i.air { animation-name: airFloat; animation-timing-function: ease-in-out; }
@keyframes airFloat { 0%, 100% { opacity: 0; transform: translate(0, 0) scale(.6); } 30%, 70% { opacity: .95; } 50% { opacity: .6; transform: translate(calc(var(--w) * .012), calc(var(--w) * -.01)) scale(1); } }



/* =====================================================================
   River v3 — ภาพ river-lantern-night (ทะเลสาบยามค่ำ มีโคมลอย วัดไทย และท่าไม้)
   ทุกตำแหน่งเป็น % ของภาพ ตรงกับภาพทุกขนาดจอ
   ===================================================================== */
/* แสงจากฝั่งตรงข้าม: หน้าต่างวัด/ศาลา เรืองและกะพริบเบา ๆ */
.fx-shore { transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(ellipse closest-side, rgba(255,196,96,.42) 0, rgba(255,170,70,.16) 48%, transparent 100%); animation: shoreGlow var(--t, 4s) ease-in-out var(--d, 0s) infinite alternate; }
/* โคมไฟบนเสาริมท่า (ซ้าย) และประกายแสงบนท่าไม้ */
.fx-lamp { transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(255,190,90,.55) 0, rgba(255,170,70,.18) 42%, transparent 70%); animation: lampFlicker 2.6s ease-in-out infinite alternate; }
.fx-lamp-post { left: 5.9%; top: 47.6%; width: 11%; aspect-ratio: 1; }
.fx-lamp-dock { left: 21%; top: 93.6%; width: 6%; aspect-ratio: 1; animation-duration: 3.4s; animation-delay: -1.2s; }
.fx-mist { left: -10%; top: 57.6%; width: 120%; height: 8%; background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(170,170,255,.2), transparent 72%); animation: mistDrift 38s ease-in-out infinite alternate; }
.fx-mist-b { top: 60.6%; height: 6%; opacity: .75; animation-duration: 52s; animation-direction: alternate-reverse; }
/* แสงเรืองรอบโคมลอยที่วาดอยู่ในภาพ: กะพริบและลอยเอื่อย ๆ */
.fx-sky { transform: translate(-50%, -50%); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,184,92,.5), rgba(255,160,70,.16) 55%, transparent 100%); animation: skyGlow var(--t, 3s) ease-in-out var(--d, 0s) infinite alternate; will-change: transform, opacity; }
/* ดาวตกเป็นระยะ (ในภาพมีดาวตกอยู่แล้ว 2 ดวง) */

/* ---- น้ำเคลื่อนไหว (ถูกตัดด้วย clip-path ผืนน้ำ) ---- */
.river-water { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
/* แถบน้ำแต่ละแถบแสดงภาพพื้นหลังส่วนนั้นซ้ำแล้วแกว่งซ้ายขวาเบา ๆ ต่างจังหวะกัน เกิดเป็นคลื่นระลอกทั้งภาพสะท้อนและผิวน้ำ */
.rw-band { position: absolute; left: 0; right: 0; top: calc(var(--t) * 100%); height: calc(var(--hh) * 100%); overflow: hidden; }
.rw-band > i { position: absolute; inset: 0; background: url('../images/backgrounds/river-lantern-night.webp') 0 calc(var(--t) * var(--h) * -1) / var(--w) var(--h) no-repeat; will-change: transform; animation: waveSway var(--dur, 6s) ease-in-out var(--del, 0s) infinite alternate; }
/* ประกายระลอกคลื่นไหลผ่านผืนน้ำ: ไกลเล็กละเอียด ใกล้ใหญ่ขึ้น (ทุกชั้นวนต่อเนื่องไม่สะดุด) */
.river-glint { position: absolute; inset: 0; display: block; }
.river-glint i { position: absolute; left: 0; width: calc(100% + var(--tile)); display: block; will-change: transform; background-repeat: repeat; animation: glintFlow var(--dur) linear infinite; }
.river-glint .g1, .river-glint .g2, .river-glint .g3 {
    background-image: radial-gradient(ellipse calc(var(--tile) * .2) calc(var(--tile) * .02) at 24% 26%, rgba(196,208,255,.62), transparent 72%),
                      radial-gradient(ellipse calc(var(--tile) * .15) calc(var(--tile) * .016) at 68% 72%, rgba(170,186,255,.5), transparent 72%);
    background-size: var(--tile) calc(var(--tile) * .3);
}
.river-glint .g1 { --tile: calc(var(--w) * .055); --dur: 14s; top: 63.4%; height: 14%; opacity: .8; }
.river-glint .g2 { --tile: calc(var(--w) * .085); --dur: 17s; top: 77%; height: 12%; opacity: .85; animation-direction: reverse; }
.river-glint .g3 { --tile: calc(var(--w) * .125); --dur: 21s; top: 88.5%; height: 12%; opacity: .9; }
/* ประกายสีทองบนเสาแสงจันทร์ (เฉพาะแนวที่จันทร์สะท้อนในภาพ) */
.river-glint .gold, .river-glint .col { left: 53%; width: 27%; top: 63.4%; height: 36.6%; }
.river-glint .gold { --tile: calc(var(--w) * .05); --dur: 9s; width: calc(27% + var(--tile)); animation-name: glintFlow; background-image: radial-gradient(ellipse calc(var(--tile) * .22) calc(var(--tile) * .022) at 28% 24%, rgba(255,236,170,.9), transparent 72%), radial-gradient(ellipse calc(var(--tile) * .17) calc(var(--tile) * .018) at 72% 70%, rgba(255,226,150,.75), transparent 72%); background-size: var(--tile) calc(var(--tile) * .28); -webkit-mask-image: radial-gradient(ellipse 50% 70% at 62% 0, #000 30%, transparent 78%); mask-image: radial-gradient(ellipse 50% 70% at 62% 0, #000 30%, transparent 78%); }
.river-glint .col { background: radial-gradient(ellipse 36% 100% at 62% 0, rgba(255,226,150,.22), transparent 74%); animation: colPulse 5s ease-in-out infinite alternate; transform-origin: 62% 0; }
/* แสงวาบจางทั่วผืนน้ำให้ดูมีชีวิต */
.rw-sheen { position: absolute; inset: 0; display: block; background: linear-gradient(100deg, transparent 30%, rgba(160,176,255,.10) 48%, transparent 66%) -60% 0 / 60% 100% no-repeat; animation: sheen 11s ease-in-out infinite; }

/* โคมลอยที่สร้างเพิ่ม: ขึ้นจากแนวต้นไม้ฝั่งตรงข้าม (y ≈ 58–60% ของภาพ) ผ่านท้องฟ้า */
.river-sky { position: absolute; inset: 0 0 40% 0; overflow: hidden; pointer-events: none; -webkit-mask-image: linear-gradient(to top, transparent 0, #000 12%); mask-image: linear-gradient(to top, transparent 0, #000 12%); }

@keyframes shoreGlow { from { opacity: .5; transform: translate(-50%, -50%) scale(.94); } to { opacity: 1; transform: translate(-50%, -50%) scale(1.06); } }
@keyframes skyGlow { from { opacity: .45; transform: translate(-50%, -50%) scale(.9); } to { opacity: 1; transform: translate(calc(-50% + var(--w) * .0012 * var(--bx, 1)), calc(-50% - var(--w) * .0016)) scale(1.1); } }
@keyframes waveSway { from { transform: translate3d(calc(var(--w) * var(--amp, .002) * -1), 0, 0); } to { transform: translate3d(calc(var(--w) * var(--amp, .002)), 0, 0); } }
@keyframes glintFlow { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(calc(var(--tile) * -1), 0, 0); } }
@keyframes colPulse { from { opacity: .55; transform: scaleX(.9); } to { opacity: 1; transform: scaleX(1.08); } }
@keyframes sheen { 0% { background-position: -60% 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { background-position: 160% 0; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .river-glint i, .rw-sheen, .rw-band > i { animation: none; } }


/* ---- กระทงของเรา: ใหญ่ เด่น และแสดงคำอธิษฐานตลอด (คนอื่นแสดงเมื่อชี้/แตะ) ---- */
.rk-mine .rk-wish { opacity: 1; transform: translate(calc(-50% + var(--shift, 0px)), 0); max-width: min(230px, 60vw); padding: 7px 12px; font-size: 13px; font-weight: 400; line-height: 1.55; -webkit-line-clamp: 3; line-clamp: 3; border-color: rgba(255,214,140,.42); background: rgba(10,16,52,.42); box-shadow: none; text-shadow: 0 1px 5px rgba(0,0,10,.9), 0 0 2px rgba(0,0,10,.8); transition: opacity .9s, transform .9s; }
.rk-mine .rk-wish::before { content: '✦ คำอธิษฐานของคุณ'; display: block; margin-bottom: 1px; font-size: 10.5px; letter-spacing: .04em; color: var(--gold); }
.rk-mine.is-releasing:not(.splashed) .rk-wish { opacity: 0; transform: translate(calc(-50% + var(--shift, 0px)), 8px); }
.rk-mine .rk-tag { font-size: 13px; padding: 4px 14px; box-shadow: 0 0 16px rgba(255,214,120,.5); }

/* ฟองคำอธิษฐานของคนอื่น (ตอนชี้/แตะ): โปร่งขึ้น ไม่บังฉากด้านหลัง */
.rk-wish { background: rgba(8,14,46,.5); border-color: rgba(255,214,140,.35); text-shadow: 0 1px 5px rgba(0,0,10,.9), 0 0 2px rgba(0,0,10,.8); }

/* ---- เมฆลอย (สร้างด้วย JS: ก้อนนุ่มโปร่งแสงหลายก้อนซ้อนกัน ลอยช้า ๆ เฉพาะในพื้นที่ท้องฟ้าที่กำหนด) เมฆเดิมในภาพปล่อยไว้ ----
   .river-clouds ถูกตัดด้วย polygon (clip-path ใส่จาก pages/river.php → riverCloudClipPath()) การเคลื่อนที่/ความจางทำใน river.js */
.river-clouds { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.sky-cloud { position: absolute; display: block; opacity: 0; transform: translate3d(-50%, -50%, 0); will-change: transform, opacity; }
.sky-cloud i { position: absolute; display: block; border-radius: 50%; background: radial-gradient(ellipse at 50% 32%, rgba(176,168,250,.62) 0, rgba(118,108,214,.4) 48%, rgba(84,76,184,0) 72%); }

/* ---- โลโก้ TV5HD Online: ตราเล็กในหัวเว็บ (พื้นโปร่งใส) และแผ่นพื้นขาวนวลสำหรับโลโก้เต็มที่มีตัวอักษรสีเข้ม ---- */
.brand-sep { width: 1px; height: 26px; margin: 0 4px 0 6px; background: linear-gradient(180deg, transparent, rgba(232,199,126,.7), transparent); }
.brand-partner { display: block; height: 36px; width: auto; filter: drop-shadow(0 0 10px rgba(255,245,223,.22)); }
.partner-plate { display: block; width: fit-content; margin: 44px auto 0; padding: 12px 22px; border-radius: 20px; background: #fffdf6; box-shadow: 0 0 0 1px rgba(232,199,126,.5), 0 12px 34px rgba(0,0,0,.28), 0 0 38px rgba(232,199,126,.16); }
.partner-plate img { display: block; height: 104px; width: auto; mix-blend-mode: multiply; }
@media (max-width: 760px) {
    .brand-sep { height: 22px; margin: 0 2px 0 3px; }
    .brand-partner { height: 30px; }
    .partner-plate { margin-top: 34px; padding: 10px 18px; }
    .partner-plate img { height: 84px; }
}
@media (max-width: 380px) { .brand-sep, .brand-partner { display: none; } }

.river-water::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: var(--night-tint); }

/* ดาวตก (สร้างและเคลื่อนที่ด้วย JS ใน river.js): พุ่งจากขวาลงซ้าย หัวสว่างอยู่ปลายซ้ายของเส้น หางไล่จางไปทางขวา */
.fx-meteor { position: absolute; height: 2px; opacity: 0; border-radius: 2px; transform-origin: 0% 50%; will-change: transform, opacity; background: linear-gradient(270deg, rgba(190,205,255,0) 0%, rgba(200,212,255,.45) 65%, rgba(255,255,255,.95) 100%); filter: drop-shadow(0 0 3px rgba(200,210,255,.8)); }
.fx-meteor::after { content: ''; position: absolute; left: -1px; top: 50%; width: 4px; height: 4px; margin-top: -2px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px 2px rgba(210,222,255,.85); }

/* เมนูมือถือที่เปิดอยู่ต้องอยู่เหนือสถิติ (35) และปุ่มเสียง (60) */
.site-header:has(.main-nav.open), .river-page .site-header:has(.main-nav.open) { z-index: 70; }


/* =====================================================================
   หน้าแม่น้ำ: โหมดเบาสุด (ใช้กับทุกอุปกรณ์)
   เหลือแค่ น้ำ (canvas ใบเดียว ความละเอียดต่ำ) · โคมลอย · แสงระยิบระยับ · กระทง
   ===================================================================== */
.river-view.is-paused *, .river-view.is-paused *::before, .river-view.is-paused *::after { animation-play-state: paused !important; }

/* กระทง: ไม่มีเงาเรือง/แสงไล่สี/โยก — ขยับด้วย transform จาก JS อย่างเดียว */
.river-art, .rk:hover .river-art { filter: none; }
.rk-mine .river-art { filter: drop-shadow(0 0 8px rgba(255,214,120,.8)); }
.rk-drift::before, .rk-drift::after { display: none; }
.rk-bob { animation: none; }

/* น้ำ: canvas ใบเดียว (วาดที่ ~15fps ใน river.js) */
.river-wave { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* แสงระยิบระยับ: กะพริบเป็นกลุ่ม (opacity อย่างเดียว) */
.river-stars .sg, .river-orbs .og { position: absolute; inset: 0; will-change: opacity; }
.river-stars .sg { animation: sgTwinkle var(--t, 4s) ease-in-out var(--d, 0s) infinite alternate; }
.river-orbs .og { animation: ogFloat var(--t, 7s) ease-in-out var(--d, 0s) infinite alternate; }
.river-stars .sg i, .river-orbs .og i { animation: none; opacity: .9; }
@keyframes sgTwinkle { from { opacity: .25; } to { opacity: 1; } }
@keyframes ogFloat { from { opacity: .3; } to { opacity: 1; } }

/* โคมลอย: ขึ้นด้วย transform + opacity เท่านั้น ไม่มี clip-path / filter / mask / การโยก */
.river-sky { -webkit-mask-image: none; mask-image: none; }
.sky-lantern b { clip-path: none; border-radius: 22% 22% 10% 10%; animation: none; filter: none; box-shadow: 0 0 calc(var(--w) * .004) rgba(255,170,70,.7), inset 0 -35% 50% rgba(255,232,160,.8); }

/* ขนาดกระทงบนมือถือ/ไอแพด (จอล็อก): เล็กกว่าเดสก์ท็อป (.095) ประมาณ 25–30% */
.river-view.is-locked .rk { width: calc(var(--w) * .066 * var(--s, 1)); }                          /* ไอแพด / จอใหญ่ */
@media (max-width: 760px) { .river-view.is-locked .rk { width: calc(var(--w) * .06 * var(--s, 1)); } }    /* มือถือแนวตั้ง */
@media (max-height: 520px) { .river-view.is-locked .rk { width: calc(var(--w) * .075 * var(--s, 1)); } }  /* มือถือแนวนอน */

/* ---- คำเปิดหน้า "คืนเพ็ญ เดือนสิบสอง": เฉพาะหน้าแม่น้ำ ----
   แถวเดียว: พระจันทร์อยู่หน้าข้อความ แล้วมีเส้นอยู่ใต้ จางเข้า-ค้าง-จางออกพร้อมกันทั้งก้อน
   ขนาดทุกอย่างอิงตัวแปร --fs ตัวเดียว (ขนาดตัวอักษร) พระจันทร์จึงสเกลตามข้อความเสมอ
   ใช้ opacity/transform อย่างเดียว เบาทุกอุปกรณ์ เล่นครั้งเดียว ไม่บังการกด */
.river-page .moon-intro { --fs: clamp(30px, min(5.2vw, 9.5vh), 72px); position: fixed; left: 0; right: 0; margin: 0 auto; top: 19vh; top: 19svh; z-index: 45; width: max-content; max-width: calc(100% - 24px);   /* จัดกลางด้วย margin auto: ไม่ต้องรอวัดความกว้างข้อความ ไม่มีวูบข้าง */ pointer-events: none; text-align: center; opacity: 0; visibility: hidden; animation: moonIntroBox 6.5s ease-in-out .5s both; }
.river-page .moon-intro::before { content: ''; position: absolute; left: 50%; top: 50%; width: 150%; height: 190%; transform: translate(-50%, -50%); z-index: -1; background: radial-gradient(closest-side, rgba(3,6,28,.5), rgba(3,6,28,.2) 60%, transparent 100%); }   /* พื้นมืดนุ่ม ๆ ให้ตัวอักษรเด่น */
.river-page .moon-intro-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; column-gap: calc(var(--fs) * .22); row-gap: clamp(8px, 1.6vh, 16px); }
.river-page .moon-intro-icon { display: block; flex: none; width: calc(var(--fs) * 1.05); height: auto; overflow: visible; animation: moonIntroIcon 6.5s ease-in-out .5s both; }
.river-page .moon-intro-text { display: flex; flex-wrap: wrap; justify-content: center; column-gap: .4em; margin: 0; color: #f3d894; font-family: 'Charmonman', 'Kanit', serif; font-size: var(--fs); font-weight: 400; line-height: 1.2;
    text-shadow: 0 0 14px rgba(255,226,150,.8), 0 0 40px rgba(232,199,126,.6), 0 0 80px rgba(232,199,126,.35), 0 2px 14px rgba(0,0,0,.85); animation: moonIntroText 6.5s ease-in-out .5s both; }
.river-page .moon-intro-line { display: block; flex: 0 0 100%; height: 2px; background: linear-gradient(90deg, transparent, rgba(243,216,148,.95), transparent); transform: scaleX(0); animation: moonIntroLine 6.5s ease-in-out .5s both; }
/* รอให้ฟอนต์พร้อมก่อนค่อยเริ่มเล่น (river.js ใส่ .is-ready) กันแว๊บตอนฟอนต์สลับ */
.river-page .moon-intro:not(.is-ready), .river-page .moon-intro:not(.is-ready) * { animation-play-state: paused; }
@keyframes moonIntroBox { 0% { opacity: 0; visibility: visible; } 22% { opacity: 1; } 72% { opacity: 1; } 99% { opacity: 0; visibility: visible; } 100% { opacity: 0; visibility: hidden; } }
@keyframes moonIntroText { 0% { transform: translateY(12px) scale(1.06); } 22%, 72% { transform: none; } 100% { transform: translateY(-10px) scale(1.02); } }
@keyframes moonIntroIcon { 0% { transform: scale(.6); } 22% { transform: scale(1); } 72% { transform: scale(1.06); } 100% { transform: scale(1.15); } }
@keyframes moonIntroLine { 0% { transform: scaleX(0); } 30%, 72% { transform: scaleX(1); } 100% { transform: scaleX(1.12); } }
/* มือถือแนวตั้ง: ให้ทั้งแถวพอดีหนึ่งบรรทัด (กว้าง ~360px ก็ไม่ตกบรรทัด) */
@media (max-width: 600px) { .river-page .moon-intro { --fs: clamp(24px, 7.2vw, 40px); } }
/* มือถือแนวนอน / จอเตี้ย */
@media (max-height: 460px) and (min-width: 601px) { .river-page .moon-intro { --fs: clamp(22px, 8.5vh, 36px); top: 22vh; top: 22svh; } }
@media (prefers-reduced-motion: reduce) { .river-page .moon-intro-text, .river-page .moon-intro-icon { animation: none; } .river-page .moon-intro-line { animation: none; transform: scaleX(1); } }
/* ปรับตำแหน่ง/ขนาดเฉพาะอุปกรณ์: มือถือขยับลง · ไอแพดแนวตั้งใหญ่ขึ้นและขยับลง (คอม/ไอแพดแนวนอนคงเดิม) */
@media (max-width: 600px) { .river-page .moon-intro { top: 25vh; top: 25svh; } }
@media (min-width: 601px) and (orientation: portrait) { .river-page .moon-intro { --fs: clamp(46px, 8.2vw, 88px); top: 25vh; top: 25svh; } }

/* ซ่อนฉากจนกว่า river.js จะเลื่อนมาตรงกลางเสร็จ (is-ready) กันแว๊บที่ขอบซ้ายตอนเปิด/รีเฟรช
   กันพลาด: ถ้า JS ไม่ทำงาน ฉากจะโผล่เองหลัง 2 วินาที */
.river-view:not(.is-ready) { opacity: 0; animation: riverFailsafe 0s linear 2s forwards; }
.river-view.is-ready { animation: riverFadeIn .35s ease-out; }
@keyframes riverFailsafe { to { opacity: 1; } }
@keyframes riverFadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .river-view.is-ready { animation: none; } }

/* ---------- ฉากกระทง: กลืนไปกับพื้นหลังเว็บ (ไม่มีกรอบ/พื้นสี่เหลี่ยม) ---------- */
.release {
    border: 0; border-radius: 0; background: none; overflow: visible; isolation: isolate; clip-path: inset(0 -30px -10px -30px);
}
.release::before {                      /* แสงจันทร์/แสงเทียนนวลๆ ด้านหลังกระทง */
    content: ""; position: absolute; left: 50%; top: 48%; width: 92%; height: 92%;
    transform: translate(-50%, -50%); z-index: -1; pointer-events: none;
    background: radial-gradient(ellipse at 50% 55%, rgba(255,205,120,.16), rgba(120,150,255,.07) 45%, transparent 70%);
    filter: blur(6px);
}
.rel-sky { inset: -20px -10px 36% -10px; overflow: hidden;
    -webkit-mask-image: radial-gradient(ellipse at 50% 70%, #000 40%, transparent 78%);
            mask-image: radial-gradient(ellipse at 50% 70%, #000 40%, transparent 78%); }
.rel-water {
    left: -6%; right: -6%; height: 40%; overflow: hidden;
    background: linear-gradient(180deg, rgba(34,70,120,.0) 0%, rgba(40,95,125,.38) 28%, rgba(10,38,60,.5) 100%);
    -webkit-mask-image: radial-gradient(ellipse 62% 100% at 50% 40%, #000 35%, rgba(0,0,0,.55) 62%, transparent 100%);
            mask-image: radial-gradient(ellipse 62% 100% at 50% 40%, #000 35%, rgba(0,0,0,.55) 62%, transparent 100%);
}
.rel-water::after {                     /* เงาแสงเทียนสะท้อนบนผืนน้ำ */
    content: ""; position: absolute; left: 50%; top: 4%; width: 46%; height: 92%; transform: translateX(-50%);
    background: radial-gradient(ellipse at 50% 0, rgba(255,200,110,.32), transparent 68%);
    animation: glowPulse 2.4s ease-in-out infinite alternate;
}
.wave { background: radial-gradient(circle at 12px 14px, transparent 11px, rgba(170,205,255,.38) 12px, rgba(170,205,255,.38) 13px, transparent 14px) 0 0 / 24px 14px repeat-x; opacity: .5; }
.rel-ripples i { border-color: rgba(255,225,160,.5); }
.rel-boat { filter: drop-shadow(0 10px 16px rgba(0,0,0,.35)); }
