/* =========================================================
   ลอยกระทงแห่งคำอธิษฐาน — วิทยาลัยพยาบาลบรมราชชนนี เชียงใหม่
   Visual redesign: Lanna moonlit night
   ========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --night-0: #030910;
    --night-1: #061422;
    --night-2: #0b2337;
    --night-3: #123049;

    --water-h: 40%;

    --gold: #ffd88a;
    --gold-bright: #fff0c8;
    --amber: #ffb45c;
    --ember: #ff8a3d;

    --pink: #f7a8c4;
    --pink-deep: #e87ba6;
    --cream: #fff6e2;

    --leaf-1: #6f9a63;
    --leaf-2: #47714a;
    --leaf-3: #2b4b34;

    --muted: #a9c4d6;
    --line: rgba(255, 216, 138, 0.22);
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Sarabun', system-ui, -apple-system, sans-serif;
    color: var(--cream);
    background: var(--night-0);
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ============ SCENE ============ */
.scene {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    isolation: isolate;
}

.scene::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 7;
    pointer-events: none;
    opacity: 0.05;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 160px 160px;
}

.scene::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 50% 38%, transparent 42%, rgba(2, 7, 13, 0.5) 100%),
        linear-gradient(180deg, rgba(2, 6, 12, 0.4) 0%, transparent 16%);
}

/* =========================================================
   1. SKY
   ========================================================= */
.sky {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - var(--water-h) + 4%);
    background:
        radial-gradient(ellipse 70% 45% at 72% 8%, rgba(255, 205, 135, 0.14), transparent 62%),
        radial-gradient(ellipse 55% 45% at 18% 4%, rgba(90, 140, 210, 0.16), transparent 62%),
        linear-gradient(180deg, #03070f 0%, #071528 32%, #0c2338 62%, #163a56 100%);
    z-index: 1;
    pointer-events: none;
}

.sky::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 32%, rgba(140, 180, 220, 0.05) 46%, transparent 60%);
    filter: blur(18px);
    opacity: 0.7;
}

.sky::after {
    content: '';
    position: absolute;
    left: -10%;
    right: -10%;
    top: 26%;
    height: 26%;
    background:
        radial-gradient(ellipse 38% 100% at 24% 60%, rgba(120, 160, 200, 0.09), transparent 70%),
        radial-gradient(ellipse 30% 90% at 74% 40%, rgba(255, 210, 150, 0.12), transparent 70%);
    filter: blur(26px);
    opacity: 0.65;
    animation: cloud-drift 90s ease-in-out infinite alternate;
}

@keyframes cloud-drift {
    from { transform: translateX(-2%); }
    to { transform: translateX(3%); }
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 4s ease-in-out infinite;
    box-shadow: 0 0 4px #fff, 0 0 10px rgba(255, 236, 190, 0.7);
}

@keyframes twinkle {
    0%, 100% { opacity: 0.12; transform: scale(1); }
    50% { opacity: 0.95; transform: scale(1.45); }
}

.moon {
    position: absolute;
    top: 7%;
    right: 11%;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 42% 34%, rgba(255, 255, 255, 0.25), transparent 62%),
        radial-gradient(circle at 58% 68%, rgba(214, 190, 142, 0.09) 0 4%, transparent 7%),
        linear-gradient(150deg, #fffdf4 0%, #fff4d2 66%, #ffe8b8 100%);
    box-shadow:
        0 0 46px rgba(255, 238, 194, 0.55),
        0 0 110px rgba(255, 226, 168, 0.28),
        0 0 200px rgba(255, 220, 160, 0.12);
    z-index: 3;
    animation: moon-breathe 9s ease-in-out infinite;
}

.moon::after {
    content: '';
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    border: 1px solid rgba(255, 236, 196, 0.12);
    filter: blur(3px);
}

@keyframes moon-breathe {
    0%, 100% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.02) translateY(-2px); }
}

/* =========================================================
   2. FIREWORKS
   ========================================================= */
.fireworks-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - var(--water-h) + 2%);
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.firework {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
    animation: firework-cycle ease-out infinite;
    opacity: 0;
    scale: var(--fw-scale, 1);
}

.firework--gold { --fw-1: #fff8e0; --fw-2: #ffd27a; --fw-3: #ffb347; --fw-4: #ff8c00; }
.firework--pink { --fw-1: #fff0f8; --fw-2: #f8bbd0; --fw-3: #f06292; --fw-4: #ec407a; }
.firework--blue { --fw-1: #e0f4ff; --fw-2: #81d4fa; --fw-3: #4fc3f7; --fw-4: #0288d1; }
.firework--purple { --fw-1: #f3e5f5; --fw-2: #ce93d8; --fw-3: #ba68c8; --fw-4: #8e24aa; }

.firework::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 220px;
    height: 220px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background:
        conic-gradient(
            from 0deg,
            transparent 0deg, var(--fw-2) 2deg, transparent 4deg,
            transparent 18deg, var(--fw-2) 20deg, transparent 22deg,
            transparent 36deg, var(--fw-2) 38deg, transparent 40deg,
            transparent 54deg, var(--fw-2) 56deg, transparent 58deg,
            transparent 72deg, var(--fw-2) 74deg, transparent 76deg,
            transparent 90deg, var(--fw-2) 92deg, transparent 94deg,
            transparent 108deg, var(--fw-2) 110deg, transparent 112deg,
            transparent 126deg, var(--fw-2) 128deg, transparent 130deg,
            transparent 144deg, var(--fw-2) 146deg, transparent 148deg,
            transparent 162deg, var(--fw-2) 164deg, transparent 166deg,
            transparent 180deg, var(--fw-2) 182deg, transparent 184deg,
            transparent 198deg, var(--fw-2) 200deg, transparent 202deg,
            transparent 216deg, var(--fw-2) 218deg, transparent 220deg,
            transparent 234deg, var(--fw-2) 236deg, transparent 238deg,
            transparent 252deg, var(--fw-2) 254deg, transparent 256deg,
            transparent 270deg, var(--fw-2) 272deg, transparent 274deg,
            transparent 288deg, var(--fw-2) 290deg, transparent 292deg,
            transparent 306deg, var(--fw-2) 308deg, transparent 310deg,
            transparent 324deg, var(--fw-2) 326deg, transparent 328deg,
            transparent 342deg, var(--fw-2) 344deg, transparent 346deg,
            transparent 360deg
        );
    mask: radial-gradient(circle, transparent 0%, #000 14%, #000 46%, transparent 72%);
    -webkit-mask: radial-gradient(circle, transparent 0%, #000 14%, #000 46%, transparent 72%);
    filter: blur(0.5px) drop-shadow(0 0 8px var(--fw-3));
    opacity: 0;
    animation: firework-rays ease-out infinite;
}

.firework::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 9px;
    height: 9px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, var(--fw-1) 0%, var(--fw-2) 40%, var(--fw-3) 70%, transparent 100%);
    box-shadow:
        0 0 12px var(--fw-2),
        0 0 26px var(--fw-3),
        0 0 52px var(--fw-4);
    opacity: 0;
    animation: firework-core ease-out infinite;
}

@keyframes firework-cycle {
    0%, 100% { opacity: 1; }
}

@keyframes firework-rays {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.1) rotate(0deg); }
    6%   { opacity: 0; transform: translate(-50%, -50%) scale(0.1) rotate(0deg); }
    12%  { opacity: 1; transform: translate(-50%, -50%) scale(0.6) rotate(0deg); }
    26%  { opacity: 0.85; transform: translate(-50%, -50%) scale(1.02) rotate(7deg); }
    48%  { opacity: 0.35; transform: translate(-50%, -50%) scale(1.22) rotate(13deg); }
    62%  { opacity: 0; transform: translate(-50%, -50%) scale(1.32) rotate(18deg); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.32) rotate(18deg); }
}

@keyframes firework-core {
    0%, 6% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
    12%  { opacity: 1; transform: translate(-50%, -50%) scale(1.8); }
    20%  { opacity: 0.9; transform: translate(-50%, -50%) scale(1); }
    32%  { opacity: 0; transform: translate(-50%, -50%) scale(2.2); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(2.2); }
}

/* =========================================================
   3. LANTERNS
   ========================================================= */
.lantern-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - var(--water-h) + 2%);
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}

.lantern {
    position: absolute;
    bottom: -70px;
    width: 24px;
    height: 34px;
    border-radius: 46% 46% 38% 38% / 42% 42% 58% 58%;
    background:
        radial-gradient(ellipse at 50% 64%, rgba(255, 243, 200, 0.95) 0 16%, rgba(255, 190, 110, 0.5) 38%, transparent 68%),
        linear-gradient(180deg, #ffe3a0 0%, #ffc06d 46%, #ef8b32 100%);
    box-shadow:
        0 0 22px rgba(255, 175, 90, 0.55),
        0 0 58px rgba(255, 140, 60, 0.22);
    scale: var(--l-scale, 1);
    animation: float-up linear infinite;
    opacity: 0;
}

.lantern::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 66%;
    height: 3px;
    border-radius: 2px;
    background: #ffd79a;
    opacity: 0.9;
}

.lantern::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 4px;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #fff6cf;
    box-shadow: 0 0 8px #ffcf7a, 0 0 18px #ff9d3d;
}

@keyframes float-up {
    0%   { translate: 0 0; rotate: -1.5deg; opacity: 0; }
    8%   { opacity: 0.92; }
    50%  { translate: 6px -46vh; rotate: 1.5deg; opacity: 0.95; }
    88%  { opacity: 0.4; }
    96%  { opacity: 0; }
    100% { translate: -6px -106vh; rotate: -1deg; opacity: 0; }
}

/* =========================================================
   4. HORIZON — ดอย + เจดีย์ + ต้นอ้อ + หมอก
   ========================================================= */
.horizon {
    position: absolute;
    left: 0;
    width: 100%;
    bottom: var(--water-h);
    height: 16%;
    z-index: 4;
    pointer-events: none;
}

.horizon-hills {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.horizon-hills--far {
    height: 122%;
    opacity: 0.7;
    filter: blur(1.5px);
}

.horizon-suthep {
    position: absolute;
    left: 8%;
    bottom: 0;
    height: 150%;
    width: auto;
    display: block;
    opacity: 0.96;
    filter: drop-shadow(0 0 26px rgba(255, 190, 110, 0.08));
}

.horizon-gate {
    position: absolute;
    right: 3%;
    bottom: 0;
    height: 115%;
    width: auto;
    display: block;
    opacity: 0.98;
    filter: drop-shadow(0 0 24px rgba(255, 170, 80, 0.08));
}

.horizon-reeds {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 58%;
    display: block;
}

.horizon-trees {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 48%;
    display: block;
    opacity: 0.95;
}

.horizon-ground {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 7px;
    background: linear-gradient(180deg, #071823 0%, #04101a 60%, #030c14 100%);
    box-shadow:
        0 -1px 0 rgba(255, 214, 160, 0.1),
        0 -6px 14px rgba(4, 14, 22, 0.5);
}

.mist {
    position: absolute;
    left: -12%;
    width: 124%;
    height: 56%;
    bottom: 2%;
    background: radial-gradient(ellipse at 50% 100%, rgba(158, 192, 216, 0.2), transparent 70%);
    filter: blur(20px);
    animation: mist-drift 30s ease-in-out infinite alternate;
}

.mist--front {
    bottom: -4%;
    height: 38%;
    opacity: 0.9;
    filter: blur(24px);
    background: radial-gradient(ellipse at 46% 100%, rgba(178, 210, 232, 0.2), transparent 72%);
    animation-duration: 42s;
}

@keyframes mist-drift {
    from { transform: translateX(-2.5%) scaleX(1); opacity: 0.55; }
    to { transform: translateX(2.5%) scaleX(1.06); opacity: 0.85; }
}

/* =========================================================
   5. RIVER
   ========================================================= */
.river {
    position: absolute;
    left: 0;
    width: 100%;
    top: calc(100% - var(--water-h));
    height: var(--water-h);
    overflow: hidden;
    background:
        radial-gradient(ellipse 60% 38% at 70% 0%, rgba(255, 214, 150, 0.12), transparent 70%),
        radial-gradient(ellipse 55% 40% at 24% 8%, rgba(120, 180, 220, 0.11), transparent 70%),
        linear-gradient(180deg, #163c56 0%, #103049 26%, #0b263d 62%, #071a2b 100%);
    z-index: 5;
}

.river::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 26%;
    background:
        linear-gradient(180deg, rgba(3, 11, 19, 0.82) 0%, rgba(3, 11, 19, 0.3) 34%, transparent 85%),
        linear-gradient(180deg, rgba(255, 214, 160, 0.05), transparent 30%);
    filter: blur(2.5px);
    z-index: 0;
}

.river::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        180deg,
        transparent 0 26px,
        rgba(170, 215, 245, 0.04) 26px 28px
    );
    filter: blur(1px);
    animation: water-flow 34s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes water-flow {
    from { background-position: 0 0; }
    to { background-position: 0 112px; }
}

.moon-path {
    position: absolute;
    top: 0;
    right: 10%;
    width: 11%;
    height: 96%;
    z-index: 1;
    pointer-events: none;
}

.moon-path::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 242, 208, 0.32), rgba(255, 220, 168, 0.09) 46%, transparent 88%);
    filter: blur(16px);
}

.moon-path::after {
    content: '';
    position: absolute;
    left: 30%;
    top: 0;
    width: 40%;
    height: 82%;
    background:
        radial-gradient(ellipse 46% 1.6% at 50% 7%, rgba(255, 246, 218, 0.7), transparent 72%),
        radial-gradient(ellipse 62% 1.4% at 46% 14%, rgba(255, 246, 218, 0.5), transparent 72%),
        radial-gradient(ellipse 38% 1.2% at 54% 21%, rgba(255, 246, 218, 0.6), transparent 72%),
        radial-gradient(ellipse 56% 1.1% at 48% 29%, rgba(255, 246, 218, 0.4), transparent 72%),
        radial-gradient(ellipse 34% 1% at 52% 37%, rgba(255, 246, 218, 0.5), transparent 72%),
        radial-gradient(ellipse 60% 0.9% at 46% 46%, rgba(255, 246, 218, 0.3), transparent 72%),
        radial-gradient(ellipse 30% 0.8% at 54% 56%, rgba(255, 246, 218, 0.4), transparent 72%),
        radial-gradient(ellipse 48% 0.8% at 50% 67%, rgba(255, 246, 218, 0.3), transparent 72%),
        radial-gradient(ellipse 26% 0.7% at 52% 78%, rgba(255, 246, 218, 0.25), transparent 72%);
    filter: blur(2.5px);
    mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.6) 45%, transparent 92%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.6) 45%, transparent 92%);
    opacity: 0.5;
    animation: moon-shimmer 8s ease-in-out infinite;
}

@keyframes moon-shimmer {
    0%, 100% { opacity: 0.45; transform: scaleX(1) translateY(0); }
    50% { opacity: 0.75; transform: scaleX(1.08) translateY(2px); }
}

.water-shimmer {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 22% 5% at 30% 16%, rgba(190, 225, 255, 0.14), transparent 70%),
        radial-gradient(ellipse 26% 6% at 68% 30%, rgba(190, 225, 255, 0.12), transparent 70%),
        radial-gradient(ellipse 18% 4% at 44% 52%, rgba(190, 225, 255, 0.1), transparent 70%),
        radial-gradient(ellipse 24% 5% at 78% 70%, rgba(255, 220, 180, 0.09), transparent 70%);
    filter: blur(7px);
    animation: water-drift 26s ease-in-out infinite alternate;
}

@keyframes water-drift {
    from { transform: translateX(-1.5%) translateY(0); opacity: 0.8; }
    to { transform: translateX(1.5%) translateY(-4px); opacity: 1; }
}

.glint {
    position: absolute;
    width: 3px;
    height: 2px;
    border-radius: 50%;
    background: #ffe9b8;
    box-shadow:
        0 0 6px rgba(255, 220, 150, 0.8),
        0 0 12px rgba(255, 200, 120, 0.35);
    opacity: 0;
    animation: glint 7s ease-in-out infinite;
    z-index: 2;
    pointer-events: none;
}

@keyframes glint {
    0%, 100% { opacity: 0; transform: scale(0.8); }
    45% { opacity: 0.85; transform: scale(1.1); }
    60% { opacity: 0.55; }
}

/* =========================================================
   6. KRATHONG
   ========================================================= */
.float-lane {
    position: absolute;
    left: 0;
    width: 100%;
    height: 0;
    z-index: 10;
    pointer-events: none;
}

/* ความลึก: แถวบน = ไกล/เล็ก/ช้า, แถวล่าง = ใกล้/ใหญ่/เร็ว */
.float-lane[data-lane="0"] { top: 9%;  z-index: 10; }
.float-lane[data-lane="1"] { top: 22%; z-index: 11; }
.float-lane[data-lane="2"] { top: 35%; z-index: 12; }
.float-lane[data-lane="3"] { top: 48%; z-index: 13; }
.float-lane[data-lane="4"] { top: 61%; z-index: 14; }
.float-lane[data-lane="5"] { top: 74%; z-index: 15; }

.float-lane[data-lane="0"] .krathong-wrap { scale: 0.74; }
.float-lane[data-lane="1"] .krathong-wrap { scale: 0.79; }
.float-lane[data-lane="2"] .krathong-wrap { scale: 0.84; }
.float-lane[data-lane="3"] .krathong-wrap { scale: 0.89; }
.float-lane[data-lane="4"] .krathong-wrap { scale: 0.94; }
.float-lane[data-lane="5"] .krathong-wrap { scale: 0.99; }

.krathong-wrap {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: max-content;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    translate: -24vw 0;
    animation: drift var(--drift-dur, 42s) linear infinite;
    animation-delay: var(--drift-delay, 0s);
}

@media (min-width: 601px) {
    .krathong-wrap {
        filter: drop-shadow(0 7px 7px rgba(0, 0, 0, 0.35));
    }
}

@keyframes drift {
    from { translate: -24vw 0; }
    to { translate: 124vw 0; }
}

.krathong-wrap::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -4px;
    width: 136%;
    height: 30px;
    transform: translateX(-50%);
    border-radius: 50%;
    border: 1px solid rgba(190, 225, 255, 0.18);
    box-shadow: inset 0 0 16px rgba(190, 225, 255, 0.06);
    animation: wake 7.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes wake {
    0%, 100% { opacity: 0.25; transform: translateX(-50%) scale(0.9, 0.85); }
    50% { opacity: 0.65; transform: translateX(-50%) scale(1.07, 1); }
}

.krathong-wrap:hover,
.krathong-wrap:focus-visible {
    animation-play-state: paused;
    outline: none;
}

.krathong-wrap:hover .krathong,
.krathong-wrap:focus-visible .krathong {
    filter: drop-shadow(0 0 14px rgba(255, 210, 140, 0.45));
}

.krathong {
    position: relative;
    width: 118px;
    height: 72px;
    animation: krathong-bob 4.4s ease-in-out infinite;
    animation-delay: var(--bob-delay, 0s);
    transition: filter 0.25s ease;
}

@keyframes krathong-bob {
    0%, 100% { transform: translateY(0) rotate(-0.7deg); }
    50% { transform: translateY(-3px) rotate(0.7deg); }
}

/* --- จานใบตอง --- */
.krathong-base-outer {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 118px;
    height: 40px;
    border-radius: 50% 50% 44% 44% / 32% 32% 68% 68%;
    background:
        radial-gradient(ellipse at 50% 24%, #8fb37c 0%, var(--leaf-1) 38%, var(--leaf-2) 72%, var(--leaf-3) 100%);
    box-shadow:
        inset 0 -7px 10px rgba(0, 0, 0, 0.38),
        inset 0 4px 7px rgba(214, 236, 180, 0.28),
        0 3px 6px rgba(0, 0, 0, 0.35),
        0 8px 14px rgba(0, 0, 0, 0.35);
}

.krathong-base-outer::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        repeating-conic-gradient(
            from 0deg at 50% 100%,
            rgba(20, 40, 18, 0.24) 0deg 3deg,
            transparent 3deg 11deg
        );
    mask: radial-gradient(ellipse at 50% 100%, #000 52%, transparent 78%);
    -webkit-mask: radial-gradient(ellipse at 50% 100%, #000 52%, transparent 78%);
    opacity: 0.55;
}

.krathong-base-outer::after {
    content: '';
    position: absolute;
    left: 10%;
    right: 10%;
    top: 3px;
    height: 7px;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 50%, rgba(228, 244, 198, 0.34), transparent 72%);
}

/* --- ชั้นใน --- */
.krathong-base-inner {
    position: absolute;
    bottom: 19px;
    left: 50%;
    transform: translateX(-50%);
    width: 92px;
    height: 28px;
    border-radius: 50% 50% 44% 44% / 38% 38% 62% 62%;
    background:
        radial-gradient(ellipse at 50% 34%, #7ea36c 0%, var(--leaf-1) 42%, var(--leaf-2) 78%, var(--leaf-3) 100%);
    box-shadow:
        inset 0 3px 5px rgba(214, 236, 180, 0.3),
        inset 0 -4px 8px rgba(0, 0, 0, 0.32);
    z-index: 2;
}

/* --- ดอกไม้ --- */
.flower-ring {
    position: absolute;
    bottom: 17px;
    left: 50%;
    transform: translateX(-50%);
    width: 108px;
    height: 32px;
    z-index: 3;
}

.flower-ring::after {
    content: '';
    position: absolute;
    inset: -12px -8px -14px;
    background: radial-gradient(ellipse at 50% 64%, rgba(255, 214, 140, 0.38), transparent 66%);
    mix-blend-mode: screen;
    opacity: 0.5;
    pointer-events: none;
}

.flower {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.flower.pink {
    background:
        radial-gradient(circle at 50% 50%, #ffd75e 0 16%, transparent 20%),
        radial-gradient(circle at 50% 10%, #ffe4ee 0 32%, var(--pink) 34% 62%, transparent 66%),
        radial-gradient(circle at 88% 38%, #ffe4ee 0 32%, var(--pink) 34% 62%, transparent 66%),
        radial-gradient(circle at 74% 86%, #ffe4ee 0 32%, var(--pink) 34% 62%, transparent 66%),
        radial-gradient(circle at 26% 86%, #ffe4ee 0 32%, var(--pink) 34% 62%, transparent 66%),
        radial-gradient(circle at 12% 38%, #ffe4ee 0 32%, var(--pink) 34% 62%, transparent 66%);
    filter: drop-shadow(0 0 5px rgba(247, 168, 196, 0.4));
}

.flower.white {
    background:
        radial-gradient(circle at 50% 50%, #ffd75e 0 16%, transparent 20%),
        radial-gradient(circle at 50% 10%, #fffdf4 0 32%, #efe2cf 34% 62%, transparent 66%),
        radial-gradient(circle at 88% 38%, #fffdf4 0 32%, #efe2cf 34% 62%, transparent 66%),
        radial-gradient(circle at 74% 86%, #fffdf4 0 32%, #efe2cf 34% 62%, transparent 66%),
        radial-gradient(circle at 26% 86%, #fffdf4 0 32%, #efe2cf 34% 62%, transparent 66%),
        radial-gradient(circle at 12% 38%, #fffdf4 0 32%, #efe2cf 34% 62%, transparent 66%);
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

.flower.yellow {
    background:
        radial-gradient(circle at 50% 50%, #ff9f1c 0 16%, transparent 20%),
        radial-gradient(circle at 50% 10%, #fff7c2 0 32%, #f6cb52 34% 62%, transparent 66%),
        radial-gradient(circle at 88% 38%, #fff7c2 0 32%, #f6cb52 34% 62%, transparent 66%),
        radial-gradient(circle at 74% 86%, #fff7c2 0 32%, #f6cb52 34% 62%, transparent 66%),
        radial-gradient(circle at 26% 86%, #fff7c2 0 32%, #f6cb52 34% 62%, transparent 66%),
        radial-gradient(circle at 12% 38%, #fff7c2 0 32%, #f6cb52 34% 62%, transparent 66%);
    filter: drop-shadow(0 0 5px rgba(253, 216, 53, 0.35));
}

.flower:nth-child(1) { left: 2px; bottom: 13px; }
.flower:nth-child(2) { left: 21px; bottom: 5px; }
.flower:nth-child(3) { left: 50%; bottom: 1px; transform: translateX(-50%); }
.flower:nth-child(4) { right: 21px; bottom: 5px; }
.flower:nth-child(5) { right: 2px; bottom: 13px; }

/* --- ธูป + เทียน --- */
.krathong-incense {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    width: 74px;
    height: 46px;
    z-index: 4;
}

.incense {
    position: absolute;
    bottom: 0;
    width: 1.6px;
    height: 32px;
    background: linear-gradient(180deg, #a0703c 0%, #7a4f22 55%, #4a2c0f 100%);
    border-radius: 1px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.incense::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffcc66 0%, #ff6600 62%, transparent 100%);
    box-shadow: 0 0 5px #ff8c00, 0 0 11px rgba(255, 68, 0, 0.5);
    animation: incense-glow 2.8s ease-in-out infinite;
}

.incense:nth-child(1) { left: 6px; transform: rotate(-9deg); transform-origin: bottom center; }
.incense:nth-child(2) { left: 50%; transform: translateX(-50%); height: 36px; }
.incense:nth-child(3) { right: 6px; transform: rotate(9deg); transform-origin: bottom center; }

@keyframes incense-glow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; box-shadow: 0 0 7px #ff8c00, 0 0 14px rgba(255, 68, 0, 0.55); }
}

.candle {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 9px;
    height: 28px;
    border-radius: 2px 2px 3px 3px;
    background: linear-gradient(180deg, #fffbea 0%, #f4e7ca 55%, #d9c096 100%);
    box-shadow:
        inset -1px 0 2px rgba(0, 0, 0, 0.22),
        inset 1px 0 1px rgba(255, 255, 255, 0.65),
        0 2px 4px rgba(0, 0, 0, 0.35);
    z-index: 5;
}

.candle::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 1.4px;
    height: 5px;
    background: #2a1a0a;
    border-radius: 1px;
}

.candle::after {
    content: '';
    position: absolute;
    top: -17px;
    left: 50%;
    transform: translateX(-50%);
    width: 9px;
    height: 16px;
    border-radius: 50% 50% 46% 46% / 72% 72% 28% 28%;
    background: radial-gradient(ellipse at 50% 72%, #fff9e3 0%, #ffd88a 26%, #ffb45c 52%, #ff8a3d 82%, transparent 100%);
    box-shadow:
        0 0 10px rgba(255, 180, 92, 0.8),
        0 0 22px rgba(255, 140, 61, 0.45),
        0 0 40px rgba(255, 100, 0, 0.25);
    animation: candle-flicker 1.1s ease-in-out infinite alternate;
    transform-origin: 50% 100%;
    filter: blur(0.35px);
}

@keyframes candle-flicker {
    0% { transform: translateX(-50%) scale(1, 1); opacity: 1; }
    45% { transform: translateX(-52%) scale(0.94, 1.08); opacity: 0.94; }
    100% { transform: translateX(-48%) scale(1.04, 0.96); opacity: 1; }
}

/* --- เงาสะท้อนบนน้ำ --- */
.krathong-reflection {
    width: 92px;
    height: 16px;
    margin-top: 2px;
    border-radius: 50%;
    background:
        radial-gradient(ellipse at 50% 34%, rgba(0, 0, 0, 0.4), transparent 72%),
        radial-gradient(ellipse at 50% 26%, rgba(255, 205, 130, 0.62), rgba(255, 170, 90, 0.2) 58%, transparent 82%);
    filter: blur(4px);
    mask-image: repeating-linear-gradient(180deg, #000 0 4px, transparent 4px 7px);
    -webkit-mask-image: repeating-linear-gradient(180deg, #000 0 4px, transparent 4px 7px);
    opacity: 1;
    animation: reflection-shimmer 5s ease-in-out infinite;
}

@keyframes reflection-shimmer {
    0%, 100% { opacity: 0.5; transform: scaleX(0.96); }
    50% { opacity: 0.85; transform: scaleX(1.05); }
}

/* --- กระทงของคุณ (ไฮไลต์ด้วยแสงทอง) --- */
.krathong-wrap.is-mine .krathong {
    filter: drop-shadow(0 0 16px rgba(255, 214, 140, 0.8));
}

.krathong-wrap.is-mine::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 168%;
    height: 130%;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(
        ellipse at 50% 56%,
        rgba(255, 218, 150, 0.5),
        rgba(255, 170, 80, 0.16) 46%,
        transparent 72%
    );
    filter: blur(12px);
    z-index: -1;
    animation: mine-aura 3.6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes mine-aura {
    0%, 100% { opacity: 0.55; transform: translateX(-50%) scale(0.96); }
    50% { opacity: 0.95; transform: translateX(-50%) scale(1.05); }
}

.krathong-wrap.is-mine .krathong::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -3px;
    width: 128%;
    height: 52%;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 226, 160, 0.6);
    border-radius: 50%;
    box-shadow:
        0 0 24px rgba(255, 205, 110, 0.5),
        inset 0 0 16px rgba(255, 230, 170, 0.18);
    z-index: 1;
    animation: mine-ring 3.6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes mine-ring {
    0%, 100% { opacity: 0.55; transform: translateX(-50%) scale(0.97); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.04); }
}

.krathong-wrap.is-mine .krathong-base-outer {
    box-shadow:
        inset 0 -7px 10px rgba(0, 0, 0, 0.38),
        inset 0 4px 7px rgba(255, 245, 205, 0.45),
        0 3px 6px rgba(0, 0, 0, 0.35),
        0 0 24px rgba(255, 205, 120, 0.7);
}

.krathong-wrap.is-mine .krathong-base-inner {
    box-shadow:
        inset 0 3px 5px rgba(255, 245, 205, 0.5),
        inset 0 -4px 8px rgba(0, 0, 0, 0.32),
        0 0 20px rgba(255, 205, 120, 0.5);
}

.krathong-wrap.is-mine .flower {
    filter: drop-shadow(0 0 7px rgba(255, 225, 160, 0.85));
}

.krathong-wrap.is-mine .candle::after {
    box-shadow:
        0 0 14px rgba(255, 210, 130, 0.95),
        0 0 30px rgba(255, 180, 90, 0.65),
        0 0 55px rgba(255, 140, 60, 0.4);
}

.krathong-wrap.is-mine .krathong-reflection {
    background:
        radial-gradient(ellipse at 50% 34%, rgba(0, 0, 0, 0.35), transparent 72%),
        radial-gradient(ellipse at 50% 26%, rgba(255, 225, 160, 0.85), rgba(255, 185, 100, 0.35) 58%, transparent 82%);
}

.mine-badge {
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    padding: 2px 9px;
    border: 1px solid rgba(255, 220, 150, 0.65);
    border-radius: 999px;
    background: rgba(46, 30, 10, 0.85);
    color: #ffe6a8;
    font-size: 0.58rem;
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: 0.02em;
    white-space: nowrap;
    box-shadow: 0 0 16px rgba(255, 190, 90, 0.4);
    pointer-events: none;
}

/* =========================================================
   7. EMPTY STATE
   ========================================================= */
.empty {
    position: absolute;
    left: 50%;
    top: 48%;
    transform: translate(-50%, -50%);
    width: min(88%, 420px);
    padding: 26px 24px 24px;
    border-radius: 22px;
    border: 1px solid rgba(255, 216, 138, 0.22);
    background: linear-gradient(160deg, rgba(12, 36, 55, 0.7), rgba(4, 13, 22, 0.82));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-align: center;
    z-index: 20;
}

.empty-icon {
    font-size: 1.5rem;
    color: var(--gold);
    text-shadow: 0 0 18px rgba(255, 180, 80, 0.8);
    margin-bottom: 8px;
}

.empty-title {
    font-family: 'Kanit', 'Sarabun', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff1d2;
    margin-bottom: 4px;
}

.empty-sub {
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 16px;
}

.empty-cta {
    padding: 10px 22px;
    border-radius: 999px;
    border: 1px solid rgba(255, 216, 138, 0.45);
    background: rgba(255, 216, 138, 0.1);
    color: var(--gold-bright);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.empty-cta:hover {
    background: rgba(255, 216, 138, 0.2);
    border-color: var(--gold);
    transform: translateY(-1px);
}

/* =========================================================
   8. HEADER
   ========================================================= */
.content-overlay {
    position: relative;
    z-index: 30;
    max-width: 1180px;
    margin: 0 auto;
    padding: clamp(18px, 4vh, 38px) 20px 0;
    text-align: center;
    pointer-events: none;
}

header {
    position: relative;
    pointer-events: auto;
    padding: 0 6px;
}

header::before {
    content: '';
    position: absolute;
    left: 50%;
    top: -14px;
    transform: translateX(-50%);
    width: min(440px, 82vw);
    height: 210px;
    background: radial-gradient(ellipse at 50% 34%, rgba(255, 200, 130, 0.1), transparent 66%);
    pointer-events: none;
}

.logo-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    margin: 0 auto 10px;
}

.logo-wrap::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 165%;
    height: 165%;
    background: radial-gradient(circle at 50% 45%, rgba(255, 246, 224, 0.12), rgba(255, 220, 160, 0.04) 46%, transparent 72%);
    filter: blur(12px);
    pointer-events: none;
}

.college-logo {
    display: block;
    height: clamp(66px, 7vw, 106px);
    width: auto;
    position: relative;
    filter: drop-shadow(0 10px 30px rgba(255, 180, 90, 0.16));
}

.eyebrow {
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.38em;
    text-transform: uppercase;
    color: rgba(255, 216, 138, 0.68);
    margin-bottom: 12px;
}

.college-name {
    font-family: 'Sarabun', sans-serif;
    font-weight: 500;
    font-size: clamp(0.86rem, 1.4vw, 1rem);
    letter-spacing: 0.02em;
    color: #cfe2f0;
    margin-bottom: 8px;
}

h1 {
    font-family: 'Kanit', 'Sarabun', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5.4vw, 4rem);
    line-height: 1.16;
    letter-spacing: 0.005em;
    text-wrap: balance;
    background: linear-gradient(180deg, #fffdf4 0%, #ffe7b3 46%, #ffc978 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 8px 34px rgba(255, 170, 60, 0.32));
}

.header-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 12px 0 12px;
}

.orn-line {
    width: clamp(34px, 8vw, 92px);
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 216, 138, 0.5), transparent);
}

.orn-star {
    font-size: 0.72rem;
    color: var(--gold);
    text-shadow: 0 0 14px rgba(255, 180, 80, 0.85);
}

.header-sub {
    font-size: clamp(0.92rem, 1.6vw, 1.05rem);
    font-weight: 300;
    color: #c5d9e8;
    letter-spacing: 0.01em;
    text-shadow: 0 2px 12px rgba(2, 8, 15, 0.65);
}

.event-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 216, 138, 0.2);
    background: rgba(7, 20, 33, 0.45);
    color: #ffe6b0;
    font-size: 0.76rem;
    letter-spacing: 0.02em;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* =========================================================
   9. STATS
   ========================================================= */
.stats-cards {
    position: fixed;
    left: 18px;
    top: 18px;
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 128px;
    padding: 9px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 216, 138, 0.16);
    background: linear-gradient(150deg, rgba(14, 40, 60, 0.72), rgba(5, 14, 24, 0.85));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    pointer-events: auto;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 216, 138, 0.3);
}

.stat-card--highlight {
    border-color: rgba(255, 216, 138, 0.32);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.35),
        0 0 26px rgba(255, 170, 70, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.stat-icon {
    display: flex;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--gold);
    opacity: 0.9;
}

.stat-icon svg {
    width: 100%;
    height: 100%;
}

.stat-card--highlight .stat-icon {
    opacity: 1;
    filter: drop-shadow(0 0 7px rgba(255, 180, 80, 0.55));
}

.stat-body {
    display: flex;
    flex-direction: column;
    line-height: 1.18;
}

.stat-number {
    font-family: 'Kanit', 'Sarabun', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    color: #fff0c8;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

.stat-label {
    font-size: 0.66rem;
    color: #9fbdd2;
    letter-spacing: 0.02em;
}

/* =========================================================
   10. FAB + FOOTER
   ========================================================= */
.fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 70;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 15px 24px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffe9b8 0%, #ffcf87 42%, #f4a447 100%);
    color: #2a1a05;
    font: inherit;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow:
        0 14px 34px rgba(255, 170, 70, 0.32),
        0 0 24px rgba(255, 170, 70, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.fab::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: inherit;
    border: 1px solid rgba(255, 216, 138, 0.4);
    animation: fab-ring 3.4s ease-out infinite;
    pointer-events: none;
}

@keyframes fab-ring {
    0% { opacity: 0.65; transform: scale(0.97); }
    72%, 100% { opacity: 0; transform: scale(1.09); }
}

.fab:hover {
    transform: translateY(-2px);
    box-shadow:
        0 18px 40px rgba(255, 170, 70, 0.42),
        0 0 32px rgba(255, 170, 70, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.fab:active {
    transform: translateY(0) scale(0.985);
}

.fab-icon {
    font-size: 1rem;
    animation: fab-glow 2.4s ease-in-out infinite;
}

@keyframes fab-glow {
    0%, 100% { opacity: 1; text-shadow: 0 0 6px rgba(255, 255, 255, 0.6); }
    50% { opacity: 0.75; text-shadow: 0 0 14px #fff; }
}

footer {
    position: fixed;
    left: 18px;
    bottom: 12px;
    z-index: 55;
    max-width: 44vw;
    color: rgba(150, 180, 205, 0.48);
    font-size: 0.66rem;
    line-height: 1.6;
    letter-spacing: 0.01em;
    pointer-events: none;
}

/* =========================================================
   11. MODALS
   ========================================================= */
.wish-modal,
.form-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.wish-modal[hidden],
.form-modal[hidden] {
    display: none;
}

.wish-modal-backdrop,
.form-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 7, 14, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: modal-fade-in 0.3s ease-out;
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wish-modal-card,
.form-modal-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    padding: 36px 30px 28px;
    border-radius: 26px;
    border: 1px solid rgba(255, 216, 138, 0.26);
    background: linear-gradient(165deg, rgba(17, 48, 72, 0.97), rgba(5, 15, 26, 0.99));
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(255, 170, 70, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: modal-pop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    text-align: center;
}

.wish-modal-card { max-width: 460px; }
.form-modal-card { max-width: 520px; }

@keyframes modal-pop {
    from { opacity: 0; transform: scale(0.94) translateY(14px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.wish-modal-icon {
    font-size: 1.8rem;
    color: var(--gold);
    text-shadow: 0 0 18px rgba(255, 180, 80, 0.9);
    margin-bottom: 14px;
}

.wish-modal-text {
    color: #fff8e8;
    font-size: 1.12rem;
    line-height: 1.75;
    font-weight: 400;
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin-bottom: 18px;
}

.wish-modal-hint {
    color: #8ba9c2;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 216, 138, 0.16);
}

.wish-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 216, 138, 0.24);
    border-radius: 50%;
    background: rgba(5, 12, 24, 0.5);
    color: var(--gold);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 2;
}

.wish-modal-close:hover {
    background: rgba(255, 216, 138, 0.14);
    border-color: var(--gold);
    transform: rotate(90deg);
}

/* --- form --- */
.form-emblem {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0 auto 10px;
    border-radius: 50%;
    border: 1px solid rgba(255, 216, 138, 0.32);
    color: var(--gold);
    font-size: 1.05rem;
    box-shadow: 0 0 24px rgba(255, 170, 70, 0.18);
}

.form-modal-title {
    font-family: 'Kanit', 'Sarabun', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffe6a8;
    letter-spacing: 0.01em;
    margin-bottom: 4px;
    text-shadow: 0 0 26px rgba(255, 200, 120, 0.35);
}

.form-modal-subtitle {
    font-size: 0.86rem;
    color: #9fbed4;
    margin-bottom: 20px;
}

.field-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

label {
    display: block;
    font-weight: 600;
    color: var(--gold-bright);
    font-size: 0.9rem;
    text-align: left;
    position: relative;
    z-index: 1;
}

.char-count {
    flex-shrink: 0;
    font-size: 0.72rem;
    color: #7f9db4;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

textarea {
    width: 100%;
    min-height: 118px;
    padding: 14px 16px;
    resize: vertical;
    border: 1px solid rgba(255, 216, 138, 0.16);
    border-radius: 14px;
    color: #fff;
    background: rgba(3, 10, 18, 0.62);
    font: inherit;
    font-size: 0.98rem;
    line-height: 1.65;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    position: relative;
    z-index: 1;
}

textarea:focus {
    outline: none;
    border-color: rgba(255, 216, 138, 0.65);
    box-shadow: 0 0 0 3px rgba(255, 216, 138, 0.1), 0 0 26px rgba(255, 179, 71, 0.12);
    background: rgba(3, 10, 18, 0.8);
}

textarea::placeholder { color: #6a8ba8; }

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 4px;
}

.chip {
    padding: 6px 12px;
    border: 1px solid rgba(255, 216, 138, 0.22);
    border-radius: 999px;
    background: transparent;
    color: #cfe2f0;
    font: inherit;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip:hover {
    border-color: rgba(255, 216, 138, 0.55);
    background: rgba(255, 216, 138, 0.1);
    color: var(--gold-bright);
}

.form-note {
    margin: 14px 0 18px;
    color: #8ba9c2;
    font-size: 0.76rem;
    line-height: 1.55;
    text-align: left;
    position: relative;
    z-index: 1;
}

.form-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.submit-btn {
    width: 100%;
    padding: 15px 24px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffe9b8 0%, #ffcf87 45%, #f2a247 100%);
    color: #2a1a05;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow:
        0 10px 26px rgba(255, 170, 70, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 14px 32px rgba(255, 170, 70, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.submit-btn:active { transform: translateY(0); }

.submit-btn:disabled {
    opacity: 0.75;
    cursor: wait;
    transform: none;
}

.error {
    margin: 0 0 16px;
    padding: 11px 14px;
    border-radius: 12px;
    color: #ffd7d7;
    background: rgba(220, 80, 80, 0.12);
    border: 1px solid rgba(220, 80, 80, 0.32);
    font-size: 0.86rem;
    text-align: left;
}

.notice {
    margin: 0 0 16px;
    padding: 11px 14px;
    border-radius: 12px;
    color: #d5ffe4;
    background: rgba(60, 200, 120, 0.12);
    border: 1px solid rgba(60, 200, 120, 0.3);
    font-size: 0.86rem;
}

/* =========================================================
   12. TOAST
   ========================================================= */
.toast {
    position: fixed;
    left: 50%;
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    width: max-content;
    max-width: min(92vw, 560px);
    padding: 14px 16px 14px 18px;
    border-radius: 16px;
    border: 1px solid rgba(255, 216, 138, 0.4);
    background: linear-gradient(160deg, rgba(20, 56, 82, 0.98), rgba(5, 14, 26, 0.98));
    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.55),
        0 0 35px rgba(255, 179, 71, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: #e9fff0;
    font-size: 0.92rem;
    line-height: 1.55;
    transform: translate(-50%, 0);
    animation: toast-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.toast.is-hiding {
    opacity: 0;
    transform: translate(-50%, 14px);
    pointer-events: none;
}

@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, 16px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.toast-icon {
    flex-shrink: 0;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--gold-bright);
    text-shadow: 0 0 14px rgba(255, 180, 80, 0.9);
}

.toast-text {
    flex: 1;
    margin: 0;
    text-align: left;
    overflow-wrap: anywhere;
}

.toast-close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(255, 216, 138, 0.28);
    border-radius: 50%;
    background: rgba(5, 12, 24, 0.5);
    color: var(--gold);
    font: inherit;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: rgba(255, 216, 138, 0.14);
    border-color: var(--gold);
}

/* =========================================================
   13. RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
    .content-overlay { padding-top: 28px; }
}

@media (max-width: 600px) {
    :root { --water-h: 42%; }

    .moon { top: 2.2%; right: 8%; width: 52px; height: 52px; }

    .stats-cards {
        flex-direction: row;
        left: 10px;
        top: 10px;
        gap: 8px;
    }

    .stat-card {
        min-width: 0;
        padding: 6px 10px;
        gap: 6px;
        border-radius: 11px;
    }

    .stat-icon { width: 16px; height: 16px; }
    .stat-number { font-size: 0.9rem; }
    .stat-label { font-size: 0.58rem; }

    .content-overlay { padding: 62px 16px 0; }

    .content-overlay::before {
        content: '';
        position: absolute;
        left: -20px;
        right: -20px;
        top: -46px;
        bottom: -26px;
        background: radial-gradient(ellipse 82% 72% at 50% 32%, rgba(3, 9, 17, 0.52), rgba(3, 9, 17, 0.26) 56%, transparent 82%);
        pointer-events: none;
        z-index: -1;
    }

    .college-logo { height: 62px; }
    .logo-wrap { margin-bottom: 8px; }

    .eyebrow {
        display: none;
    }
    .college-name { font-size: 0.8rem; margin-bottom: 6px; }
    h1 { font-size: clamp(1.75rem, 8.6vw, 2.35rem); line-height: 1.24; }
    .header-ornament { margin: 9px 0 9px; gap: 9px; }
    .header-sub { font-size: 0.88rem; }
    .event-date { font-size: 0.68rem; padding: 6px 12px; margin-top: 11px; }

    .horizon { height: 15%; }
    .horizon-reeds { height: 62%; }
    .horizon-suthep { left: -4%; height: 112%; }
    .horizon-gate { right: 0; height: 84%; }
    .horizon-trees { display: none; }

    /* ใช้ 4 แถวบนมือถือ: ใหญ่ขึ้น เว้นระยะชัด */
    .float-lane[data-lane="0"] { top: 7%;  z-index: 10; }
    .float-lane[data-lane="1"] { top: 29%; z-index: 11; }
    .float-lane[data-lane="2"] { top: 51%; z-index: 12; }
    .float-lane[data-lane="3"] { top: 73%; z-index: 13; }
    .float-lane[data-lane="4"],
    .float-lane[data-lane="5"] { display: none; }

    .float-lane[data-lane="0"] .krathong-wrap { scale: 0.86; }
    .float-lane[data-lane="1"] .krathong-wrap { scale: 0.9; }
    .float-lane[data-lane="2"] .krathong-wrap { scale: 0.95; }
    .float-lane[data-lane="3"] .krathong-wrap { scale: 1; }

    .krathong { width: 96px; height: 60px; }
    .krathong-base-outer { width: 96px; height: 34px; }
    .krathong-base-inner { width: 76px; height: 24px; bottom: 15px; }
    .flower-ring { width: 88px; height: 28px; bottom: 13px; }
    .flower { width: 13px; height: 13px; }
    .krathong-incense { width: 62px; height: 38px; bottom: 30px; }
    .incense { height: 26px; }
    .incense:nth-child(2) { height: 30px; }
    .candle { width: 8px; height: 23px; }
    .candle::after { width: 8px; height: 14px; top: -15px; }
    .krathong-reflection { width: 76px; height: 13px; }
    .mine-badge { font-size: 0.52rem; padding: 1px 7px; bottom: calc(100% + 4px); }

    .empty { padding: 22px 18px; width: min(92%, 380px); }
    .empty-title { font-size: 1.05rem; }

    .fab {
        right: 14px;
        bottom: 16px;
        padding: 13px 19px;
        font-size: 0.9rem;
        gap: 7px;
    }
    .fab-icon { font-size: 0.9rem; }

    footer { display: none; }

    .toast {
        bottom: calc(84px + env(safe-area-inset-bottom, 0px));
        padding: 12px 12px 12px 15px;
        font-size: 0.86rem;
    }

    .wish-modal-card,
    .form-modal-card {
        padding: 30px 20px 22px;
        border-radius: 22px;
    }

    .wish-modal-text { font-size: 1rem; }
    .wish-modal-close { width: 32px; height: 32px; font-size: 1.15rem; }
    .form-modal-title { font-size: 1.32rem; }
    .form-modal-subtitle { font-size: 0.8rem; margin-bottom: 16px; }
    .form-emblem { width: 38px; height: 38px; margin-bottom: 8px; }
    textarea { min-height: 104px; font-size: 0.94rem; }
    .chip { font-size: 0.7rem; padding: 5px 10px; }

    .firework::before { width: 160px; height: 160px; }
}

@media (max-width: 380px) {
    h1 { font-size: 1.62rem; }
    .event-date { font-size: 0.64rem; }
}

@media (max-height: 520px) and (orientation: landscape) {
    :root { --water-h: 44%; }

    .content-overlay { padding-top: 46px; }
    h1 { font-size: 1.5rem; }
    .college-name { font-size: 0.75rem; }
    .eyebrow { display: none; }
    .header-sub { display: none; }
    .event-date { display: none; }
    .header-ornament { margin: 4px 0; }
    .moon { width: 50px; height: 50px; top: 5%; }

    .stats-cards { flex-direction: row; gap: 6px; }
    .stat-card { padding: 5px 9px; }
    .stat-number { font-size: 0.8rem; }
    .stat-label { font-size: 0.54rem; }

    .fab { padding: 10px 16px; font-size: 0.82rem; bottom: 10px; }

    .wish-modal-card,
    .form-modal-card {
        padding: 22px 20px 18px;
        max-height: 92vh;
    }

    .form-emblem { display: none; }
    .form-modal-subtitle { margin-bottom: 12px; }
    textarea { min-height: 76px; }
    .chips { margin: 8px 0 2px; }
    .form-note { margin: 10px 0 12px; }
    .submit-btn { padding: 12px 20px; }
}

@media print {
    .sky, .lantern-layer, .fireworks-layer, .horizon, .river, .float-lane,
    .wish-modal, .form-modal, .krathong-wrap, .fab, .stats-cards, .toast, footer {
        display: none !important;
    }
    body { background: #fff; color: #000; }
    .scene { min-height: auto; }
    h1 { -webkit-text-fill-color: #000; color: #000; filter: none; }
}

/* =========================================================
   14. REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    .float-lane .krathong-wrap,
    .krathong, .krathong-reflection, .krathong-wrap::before,
    .krathong-wrap.is-mine::after,
    .krathong-wrap.is-mine .krathong::after,
    .moon, .star, .moon-path::after, .water-shimmer, .glint,
    .river::after, .sky::after, .mist,
    .lantern, .firework, .firework::before, .firework::after,
    .fab, .fab::after, .fab-icon,
    .empty-icon, .wish-modal-icon {
        animation: none !important;
    }

    .krathong-wrap { translate: 0 0; }
}
