@import url("https://fonts.googleapis.com/css2?family=Kanit:wght@100;200;300;400&display=swap");

:root {
    --stage-max: 1280px;
    --stage-h: clamp(520px, 78vh, 860px);

    /* ปรับตำแหน่งหลัก (ถ้าจะจูนให้ “เป๊ะ” เพิ่ม/ลดทีละนิดตรงนี้ได้เลย) */
    --globe-x: 50%;
    --globe-y: 47%;

    --mons1-x: 10%;
    --mons1-y: 52%;

    --mons2-x: 90%;
    --mons2-y: 80%;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: #05040a;
    overflow-x: hidden;
    font-family: "Kanit", sans-serif;
}

.navbar-ggt {
    z-index: 9;
    position: fixed;
    width: 100%;
    box-shadow: 0px 0px 4px #a5a0a0;
}

/* ===== HERO WRAPPER ===== */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 560px;
    isolation: isolate;
}

/* ===== LAYERS ===== */
.layer {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.layer-bg {
    z-index: 0;
    background: radial-gradient(1200px 600px at 50% 30%, rgba(160, 120, 255, 0.15), transparent 60%),
        radial-gradient(900px 500px at 60% 70%, rgba(80, 255, 220, 0.1), transparent 65%), #04030a;
}

.layer-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../images/bg.png") center/cover no-repeat;
    transform: none;
    filter: saturate(1.05) contrast(1.02);
}

/* เอฟเฟกต์บนสุด: vignette + streaks + grain */
.layer-effect {
    position: absolute;
    z-index: 6;
    pointer-events: none;

    background: url("../images/effect.png") center/cover no-repeat;

    mix-blend-mode: screen;
    opacity: 0.75;

    animation: effectFloat 6s ease-in-out infinite;
}

.layer-effect::before {
    /* vignette + dark corners */
    content: "";
    position: absolute;
    inset: -2%;
    background: radial-gradient(60% 55% at 50% 45%,
            rgba(0, 0, 0, 0) 40%,
            rgba(0, 0, 0, 0.55) 78%,
            rgba(0, 0, 0, 0.85) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.25));
}

.layer-effect::after {
    /* light streaks + subtle grain */
    content: "";
    position: absolute;
    inset: -10%;
    background: conic-gradient(from 210deg at 20% 25%,
            rgba(140, 255, 220, 0),
            rgba(140, 255, 220, 0.2),
            rgba(140, 255, 220, 0) 18%,
            rgba(140, 255, 220, 0) 45%,
            rgba(140, 255, 220, 0.18) 55%,
            rgba(140, 255, 220, 0) 70%,
            rgba(140, 255, 220, 0)),
        repeating-linear-gradient(0deg,
            rgba(255, 255, 255, 0.015) 0px,
            rgba(255, 255, 255, 0.015) 1px,
            rgba(0, 0, 0, 0) 2px,
            rgba(0, 0, 0, 0) 5px);
    mix-blend-mode: screen;
    filter: blur(0.2px);
    opacity: 0.55;
    animation: sweep 6.5s ease-in-out infinite;
}

@keyframes sweep {

    0%,
    100% {
        transform: translate3d(0, 0, 0) rotate(0.5deg);
        opacity: 0.42;
    }

    50% {
        transform: translate3d(-2%, 1%, 0) rotate(-0.5deg);
        opacity: 0.62;
    }
}

@keyframes effectFloat {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.65;
    }

    50% {
        transform: translate(-1%, 1%) scale(1.02);
        opacity: 0.85;
    }

    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.65;
    }
}

/* ===== STAGE ===== */
.stage {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(var(--stage-max), 100vw);
    height: var(--stage-h);
    transform: translate(-50%, -52%);
    z-index: 3;
}

.sprite {
    position: absolute;
    transform: translate(-50%, -50%);
    user-select: none;
    -webkit-user-drag: none;
    will-change: transform, filter;
}

/* Globe กลาง */
.globe {
    left: var(--globe-x);
    top: var(--globe-y);
    width: clamp(340px, 52vw, 900px);
    /* <<< ใหญ่ขึ้น */
    z-index: 5;
    /* อยู่หน้าสุดใน stage */

    filter: drop-shadow(0 18px 28px rgba(70, 45, 120, 0.45)) drop-shadow(0 0 22px rgba(160, 120, 255, 0.25));
    animation: floatG 4.2s ease-in-out infinite;
}

/* mons1 ซ้าย (ทับกับ globe นิด ๆ) */
.mons1 {
    left: var(--mons1-x);
    top: var(--mons1-y);
    width: clamp(260px, 34vw, 450px);
    z-index: 3;

    filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.55));
    animation: floatL 5.2s ease-in-out infinite;
}

/* mons2 ขวา */
.mons2 {
    left: var(--mons2-x);
    top: var(--mons2-y);
    width: clamp(320px, 40vw, 620px);
    z-index: 2;

    filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.55));
    animation: floatR 5.8s ease-in-out infinite;
}

@keyframes floatG {

    0%,
    100% {
        transform: translate(-50%, -50%) translateY(0) rotate(0deg) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) translateY(-10px) rotate(0.8deg) scale(1.01);
    }
}

@keyframes floatL {

    0%,
    100% {
        transform: translate(-50%, -50%) translateY(0) rotate(-0.6deg);
    }

    50% {
        transform: translate(-50%, -50%) translateY(-8px) rotate(0.6deg);
    }
}

@keyframes floatR {

    0%,
    100% {
        transform: translate(-50%, -50%) translateY(0) rotate(0.6deg);
    }

    50% {
        transform: translate(-50%, -50%) translateY(-9px) rotate(-0.6deg);
    }
}

/* ===== CTA ===== */
.cta {
    position: absolute;
    left: 50%;
    bottom: clamp(16px, 5vh, 44px);
    transform: translateX(-50%);
    width: min(980px, 92vw);
    z-index: 7;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(10px, 2vh, 18px);
}

.title-img {
    width: clamp(360px, 70vw, 860px);
    height: auto;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
    animation: titlePop 1.1s ease-out both;
}

.enter-btn {
    display: inline-grid;
    place-items: center;
    text-decoration: none;
    transform-origin: center;
    animation: btnPop 1.25s ease-out both;
}

.enter-btn img {
    width: clamp(220px, 34vw, 420px);
    height: auto;
    filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.55));
    transition:
        transform 0.2s ease,
        filter 0.2s ease;
}

.enter-btn:hover img {
    transform: translateY(-2px) scale(1.02);
    filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 18px rgba(200, 160, 255, 0.2));
}

.enter-btn:active img {
    transform: translateY(0) scale(0.99);
}

@keyframes titlePop {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes btnPop {
    0% {
        opacity: 0;
        transform: translateY(14px) scale(0.96);
    }

    70% {
        opacity: 1;
        transform: translateY(0) scale(1.02);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== RESPONSIVE TUNING ===== */
@media (max-width: 820px) {
    :root {
        --globe-y: 45%;
        --mons1-x: 20%;
        --mons2-x: 82%;
    }

    .stage {
        transform: translate(-50%, -54%);
    }
}

@media (max-width: 560px) {
    body {
        overflow-x: hidden;
    }

    :root {
        --stage-h: clamp(520px, 82vh, 780px);
        --globe-y: 44%;
        --mons1-x: 18%;
        --mons1-y: 54%;
        --mons2-x: 84%;
        --mons2-y: 56%;
    }

    .cta {
        bottom: 14px;
        gap: 12px;
    }
}

/* ลด motion ให้คนที่ตั้งค่า reduce motion */
@media (prefers-reduced-motion: reduce) {

    .layer-effect::after,
    .globe,
    .mons1,
    .mons2,
    .title-img,
    .enter-btn {
        animation: none !important;
    }

    .enter-btn img {
        transition: none;
    }
}

.nightmare-footer {
    position: relative;
    z-index: 10;
    background: radial-gradient(1200px 300px at 50% -20%, rgba(140, 90, 255, 0.25), transparent 60%),
        linear-gradient(180deg, #05040a 0%, #090713 60%, #0b0718 100%);
    border-top: 1px solid rgba(170, 120, 255, 0.18);
    box-shadow: 0 -10px 40px rgba(120, 80, 255, 0.15);
    padding: 36px 0 24px;
    overflow: hidden;
}

/* glow fog */
.nightmare-footer::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at 30% 20%, rgba(120, 255, 220, 0.12), transparent 35%),
        radial-gradient(circle at 70% 60%, rgba(180, 120, 255, 0.18), transparent 40%);
    filter: blur(40px);
    pointer-events: none;
}

/* FOLLOW US */
.nightmare-footer .h4 {
    color: #e6dcff;
    letter-spacing: 0.12em;
    font-weight: 900;
    text-shadow: 0 0 12px rgba(160, 120, 255, 0.6);
}

/* social icons */
.nightmare-footer .list-inline-item a img {
    height: 28px;
    filter: drop-shadow(0 0 6px rgba(160, 120, 255, 0.6)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.8));
    transition:
        transform 0.25s ease,
        filter 0.25s ease;
}

.nightmare-footer .list-inline-item a:hover img {
    transform: translateY(-3px) scale(1.05);
    filter: drop-shadow(0 0 12px rgba(180, 140, 255, 0.9)) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.9));
}

/* logo ggt */
.nightmare-footer img.img-fluid {
    filter: drop-shadow(0 0 12px rgba(140, 120, 255, 0.6));
}

/* copyright */
.nightmare-footer .footer-copyright {
    font-size: 12px;
    color: rgba(220, 210, 255, 0.75);
    /*text-align: center;*/
    line-height: 1.7;
    text-shadow: 0 0 6px rgba(120, 80, 255, 0.4);
}

/* links */
.nightmare-footer a.text-white {
    color: #cdbbff !important;
    text-shadow: 0 0 6px rgba(150, 120, 255, 0.6);
}

.nightmare-footer a.text-white:hover {
    color: #ffffff !important;
    text-shadow: 0 0 12px rgba(200, 160, 255, 1);
}

/* =========================
   Nightmare Footer FX
   ========================= */

.nightmare-footer {
    position: relative;
    z-index: 10;
    overflow: hidden;

    background: radial-gradient(1200px 320px at 50% -25%, rgba(140, 90, 255, 0.22), transparent 62%),
        linear-gradient(180deg, #05040a 0%, #090713 60%, #0b0718 100%);

    border-top: 1px solid rgba(170, 120, 255, 0.18);
    box-shadow: 0 -10px 40px rgba(120, 80, 255, 0.15);
    padding: 36px 0 24px;
}

/* ให้ content อยู่เหนือเอฟเฟกต์ */
.nightmare-footer .sec-follow {
    position: relative;
    z-index: 2;
}

/* ===== FX Container ===== */
.nightmare-footer .nf-fx {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* ===== Fog (หมอกลอยจากด้านล่าง) ===== */
.nightmare-footer .nf-fog {
    position: absolute;
    left: -10%;
    right: -10%;
    bottom: -30%;
    height: 70%;
    background: radial-gradient(60% 50% at 20% 80%, rgba(160, 120, 255, 0.18), transparent 60%),
        radial-gradient(55% 55% at 65% 90%, rgba(120, 255, 220, 0.12), transparent 62%),
        radial-gradient(40% 40% at 50% 60%, rgba(255, 255, 255, 0.06), transparent 70%);
    filter: blur(26px);
    opacity: 0.75;
    transform: translateY(0);
    animation: nfFogFloat 7.5s ease-in-out infinite;
    mix-blend-mode: screen;
}

@keyframes nfFogFloat {

    0%,
    100% {
        transform: translateY(0) scale(1);
        opacity: 0.65;
    }

    50% {
        transform: translateY(-18px) scale(1.03);
        opacity: 0.9;
    }
}

/* ===== Sweep light (เส้นแสง sweep) ===== */
.nightmare-footer .nf-sweep {
    position: absolute;
    inset: -35%;
    background: conic-gradient(from 220deg at 25% 25%,
            rgba(140, 255, 220, 0) 0deg,
            rgba(140, 255, 220, 0.2) 18deg,
            rgba(140, 255, 220, 0) 40deg,
            rgba(180, 120, 255, 0) 95deg,
            rgba(180, 120, 255, 0.22) 125deg,
            rgba(180, 120, 255, 0) 155deg,
            rgba(0, 0, 0, 0) 360deg);
    opacity: 0.45;
    filter: blur(0.3px);
    mix-blend-mode: screen;
    animation: nfSweep 6.8s ease-in-out infinite;
}

@keyframes nfSweep {

    0%,
    100% {
        transform: translate3d(0, 0, 0) rotate(0.6deg);
        opacity: 0.35;
    }

    50% {
        transform: translate3d(-2%, 1%, 0) rotate(-0.6deg);
        opacity: 0.62;
    }
}

/* ===== Gears (ใช้รูป gear.png) ===== */
.nightmare-footer .nf-gear {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;

    /* ใช้รูปจริง */
    background: url("../images/gear.png") center/contain no-repeat;

    /* ถ้ารูปมีพื้นขาว: multiply จะทำให้ “ขาวหาย” บนพื้นมืด */
    mix-blend-mode: multiply;

    opacity: 0.22;

    filter: drop-shadow(0 0 10px rgba(160, 120, 255, 0.35)) drop-shadow(0 12px 20px rgba(0, 0, 0, 0.85));
}

/* ตำแหน่ง/ขนาด/สปีด */
.nightmare-footer .nf-gear.g1 {
    width: 220px;
    height: 220px;
    left: 6%;
    top: 18%;
    opacity: 0.2;
    animation: nfGearCW 18s linear infinite;
}

.nightmare-footer .nf-gear.g2 {
    width: 150px;
    height: 150px;
    right: 10%;
    top: 35%;
    opacity: 0.18;
    animation: nfGearCCW 22s linear infinite;
}

.nightmare-footer .nf-gear.g3 {
    width: 260px;
    height: 260px;
    right: -3%;
    bottom: -12%;
    opacity: 0.14;
    animation: nfGearCW 28s linear infinite;
}

@keyframes nfGearCW {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes nfGearCCW {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(-360deg);
    }
}

/* responsive */
@media (max-width: 560px) {
    .nightmare-footer .nf-gear.g1 {
        width: 160px;
        height: 160px;
        left: -6%;
        top: 10%;
    }

    .nightmare-footer .nf-gear.g2 {
        width: 120px;
        height: 120px;
        right: 2%;
        top: 18%;
    }

    .nightmare-footer .nf-gear.g3 {
        width: 190px;
        height: 190px;
        right: -18%;
        bottom: -18%;
    }
}

/* กลุ่มปุ่มรอง */
.cta-sub {
    display: flex;
    gap: 16px;
    margin-top: 6px;
}

/* base */
.sub-btn {
    min-width: 140px;
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-decoration: none;
    text-align: center;
    color: #e6dcff;

    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.12);

    box-shadow:
        0 6px 14px rgba(0, 0, 0, 0.65),
        0 0 6px rgba(120, 80, 255, 0.18);

    transition: 0.25s ease;
}

/* เติมเงิน = dark emerald */
.sub-btn.topup {
    background: linear-gradient(180deg, #0f3a34, #082621);
    text-shadow: 0 0 4px rgba(120, 255, 220, 0.35);
}

.sub-btn.topup:hover {
    background: linear-gradient(180deg, #144942, #0c332d);
    box-shadow:
        0 10px 18px rgba(0, 0, 0, 0.8),
        0 0 10px rgba(120, 255, 220, 0.4);
    transform: translateY(-2px);
}

/* ดาวน์โหลด = dark violet */
.sub-btn.download {
    background: linear-gradient(180deg, #3a255a, #231437);
    text-shadow: 0 0 4px rgba(180, 120, 255, 0.45);
}

.sub-btn.download:hover {
    background: linear-gradient(180deg, #4a2e72, #2c1944);
    box-shadow:
        0 10px 18px rgba(0, 0, 0, 0.8),
        0 0 10px rgba(180, 120, 255, 0.55);
    transform: translateY(-2px);
}

/* กด */
.sub-btn:active {
    transform: scale(0.97);
}

/* มือถือ */
@media (max-width: 560px) {
    .cta-sub {
        gap: 10px;
    }

    .sub-btn {
        min-width: 120px;
        font-size: 13px;
        padding: 8px 18px;
    }
}

.sub-btn {
    min-width: 140px;
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-decoration: none;
    text-align: center;
    color: #e6dcff;

    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.25)),
        repeating-linear-gradient(45deg,
            rgba(255, 255, 255, 0.03) 0px,
            rgba(255, 255, 255, 0.03) 1px,
            rgba(0, 0, 0, 0) 3px,
            rgba(0, 0, 0, 0) 6px);

    border: 1px solid rgba(255, 255, 255, 0.15);

    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.12),
        inset 0 -2px 4px rgba(0, 0, 0, 0.6),
        0 6px 14px rgba(0, 0, 0, 0.65),
        0 0 6px rgba(120, 80, 255, 0.15);

    text-shadow: 0 0 4px rgba(180, 140, 255, 0.4);

    transition: 0.25s ease;
    position: relative;
    overflow: hidden;
}

.sub-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.08), transparent 35%),
        radial-gradient(circle at 70% 60%, rgba(0, 0, 0, 0.35), transparent 40%),
        linear-gradient(120deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.25));
    mix-blend-mode: overlay;
    opacity: 0.55;
    pointer-events: none;
}


/* Modal  */
.modal {
    background: #000000a3;
}

.popup_news .modal-content {
    background: transparent;
    border: none;
}

.popup_newsImg {
    max-width: 600px;
    width: 100%;
}