html,
body {
    overflow-x: hidden;
    position: relative;
}

body {
    font-family: "Kanit", sans-serif;
    padding: 0;
    margin: 0;
}

.main-menu-bar {
    border-bottom: 0.125rem solid #FFB62F;
    background: rgba(28, 28, 28, 0.75);
    width: 100%;
    max-width: 100%;
}

/* ให้แถบเมนูเต็มความกว้าง: .navbar เป็น flex ลูก .container-fluid ต้องขยายเต็มแนวนอน */
.main-menu-bar>.container-fluid {
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
    min-width: 0;
}

.main-menu-bar-list {
    min-width: 0;
}

/* จำกัดความสูงโลโก้ navbar เพื่อไม่ให้ดันเลย์เอาท์บนมือถือ */
.main-menu-bar .navbar-brand {
    padding-top: 0;
    padding-bottom: 0;
    margin-right: 0.5rem;
}

.main-menu-bar .navbar-brand img {
    height: 2.5rem;
    width: auto;
    max-width: 100%;
}

@media (min-width: 62rem) {
    .main-menu-bar .navbar-brand img {
        height: 3rem;
    }
}

.main-menu-bar-list ul li a {
    position: relative;
    background: linear-gradient(180deg, #FFF 0%, #E2E2E2 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.main-menu-bar-list ul li a:hover {
    background: linear-gradient(180deg, #F6E6A2 0%, #FAD27A 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#ygc-new-server-menu-register {
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
    border-radius: 3.125rem;
    padding: 0.5rem 1.75rem !important;
    border: 0.125rem solid rgba(255, 255, 255, 0.3);
    margin-left: 0.5rem;
    transition: all 0.3s ease;
    -webkit-text-fill-color: #fff !important;
    font-weight: 700;
}

#ygc-new-server-menu-enter-site {
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
    border-radius: 3.125rem;
    padding: 0.5rem 1.75rem !important;
    border: 0.125rem solid rgba(255, 255, 255, 0.3);
    margin-left: 0.5rem;
    transition: all 0.3s ease;
    -webkit-text-fill-color: #fff !important;
    font-weight: 700;
}

#ygc-new-server-menu-register:hover,
#ygc-new-server-menu-enter-site:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.25rem 0.9375rem rgba(227, 101, 60, 0.6);
    filter: brightness(1.1);
}

/* ปุ่ม nav: ย่อ padding/ขนาดลงบนจอเล็ก เพื่อไม่ให้ทับโลโก้ */
@media (max-width: 36rem) {

    #ygc-new-server-menu-register,
    #ygc-new-server-menu-enter-site {
        padding: 0.35rem 0.85rem !important;
        font-size: 0.85rem;
        margin-left: 0.35rem;
    }
}

@media (max-width: 22.5rem) {

    #ygc-new-server-menu-register,
    #ygc-new-server-menu-enter-site {
        padding: 0.3rem 0.65rem !important;
        font-size: 0.75rem;
    }
}


.main-backgroung {
    background: url(../image/bg-header.jpg) no-repeat center center / cover;
    height: auto;
    width: 100%;
    position: relative;
    padding-top: 0rem;
    overflow: hidden;
}

/* พื้นหลังวิดีโอเต็มกล่อง hero (w/h 100% ของ .main-backgroung) */
.main-backgroung__bg-video {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    mix-blend-mode: plus-lighter;
}

@media (max-width: 62rem) {
    .main-backgroung {
        padding-top: 3.75rem;
    }
}


.scroll-down {
    padding-top: 4.5rem;
    padding-bottom: 2.5rem;
    position: relative;
    z-index: 999;
}

@media (max-width: 48rem) {
    .scroll-down {
        padding-top: 2.25rem;
        padding-bottom: 1.25rem;
    }
}

.btn-load-masked {
    position: relative;
    display: inline-block;
    overflow: visible;
    transition:
        transform 0.4s cubic-bezier(0.33, 1.25, 0.64, 1),
        filter 0.35s ease;
    filter: drop-shadow(0 0.2rem 0.65rem rgba(0, 0, 0, 0.45));
}

.btn-load-masked__art {
    position: relative;
    z-index: 0;
    display: block;
}

.btn-load-masked__fx {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
    -webkit-mask-image: url("../image/btn-load.png");
    mask-image: url("../image/btn-load.png");
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    /* -webkit-mask-mode: luminance; */
    /* mask-mode: luminance; */
    mix-blend-mode: plus-lighter;
}

.btn-load-masked__video {
    width: 100%;
    height: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* .btn-load-masked:hover {
    transform: scale(1.05);
    filter:
        drop-shadow(0 0.15rem 1.1rem rgba(200, 160, 255, 0.4))
        drop-shadow(0 0.3rem 0.85rem rgba(0, 0, 0F, 0.5));
} */

.btn-load-masked:active {
    transform: scale(1.02);
    transition-duration: 0.12s;
}

@media (prefers-reduced-motion: reduce) {
    .btn-load-masked {
        transition: transform 0.2s ease, filter 0.2s ease;
    }
}

.line-sec-b {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 1;
}

.line-sec-t {
    position: absolute;
    top: 0;
    left: 0;
}

/* section 2 */
.bg-section-2 {
    background: url(../image/bg-sec-2.png) no-repeat center center / cover;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.title-sec-2 {
    color: #232E44;
    text-align: center;
    font-family: Kanit;
    font-size: 2rem;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
}

.sub-title-sec-2 {
    background: linear-gradient(270deg, #174880 0%, #307ABE 50.48%, #174880 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    font-family: Kanit;
    font-size: 4rem;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
}

/* section 3 */
.bg-section-3 {
    background: url(../image/bg-sec-3.jpg) no-repeat center center / cover;
    width: 100%;
    position: relative;
    min-height: 55em;
    --sec3-bg-height: 55rem;
    --sec3-above-character-reserve: 14rem;
}

.light-eff {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    mix-blend-mode: plus-lighter;
    max-width: none;
}

.sec-3-char {
    position: relative;
    z-index: 1;
}

.sec-3-character {
    overflow: hidden;
    max-height: calc(var(--sec3-bg-height) - var(--sec3-above-character-reserve));
    position: relative;
    display: inline-block;
}

@media screen and (max-width: 1024px) {
    .bg-section-3 {
        min-height: auto;
        height: auto;
    }
}

/* มือถือ: ไม่จำกัดความสูง — รูปเต็มตาม img-fluid (กว้างเต็มคอลัมน์ สูงตามอัตราส่วน) */
@media screen and (max-width: 767.98px) {
    .sec-3-character {
        max-height: none;
        overflow: visible;
        height: auto;
    }

    .sec-3-character img.img-fluid {
        width: 100%;
        height: auto;
        max-height: none;
    }
}

.obj-sec-3 {
    position: absolute;
    top: -22%;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 2;
}

.box-class {
    position: relative;
    /* z-index: 2; */
    color: #000;
    text-align: center;
    font-family: Kanit;
    font-size: 1rem;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    background-image: url(../image/ellipse.png);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 100% 100%;
    padding: 2rem 1.25rem;
}

@media (max-width: 48rem) {
    .box-class {
        background-size: contain;
        padding: 1.5rem 1rem;
    }
}

/*sevtion 4 */
.bg-section-4 {
    background: url(../image/bg-sec-2.png) no-repeat center center / cover;
    width: 100%;
    position: relative;
}

.news-tablist {
    position: relative;
    z-index: 2;
}

.news-panels {
    position: relative;
    z-index: 1;
}

.news-panels .box-banner-news {
    display: none;
}

.news-panels .box-banner-news.is-active {
    display: block;
}

.news-tab-link:focus-visible {
    outline: 0.15rem solid #307abe;
    outline-offset: 0.2rem;
}

/* Section 4 news: มือถือ = แบนเนอร์ก่อน แท็บข่าวจัด Grid 2x2 ด้านล่าง (ไม่ต้องเลื่อน) */
@media screen and (max-width: 767.98px) {
    .news-tablist {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        overflow: visible;
        padding-bottom: 0;
    }

    .news-tablist .news-tab-link {
        width: 100%;
        display: block;
    }

    .news-tablist .news-tab-link img {
        width: 100%;
        height: auto;
        display: block;
    }
}

@media screen and (min-width: 768px) {
    .news-tablist {
        overflow-x: visible;
    }

    .news-tablist .news-tab-link {
        display: block;
        width: 100%;
    }

    .news-tablist .news-tab-link img {
        width: 100%;
        height: auto;
        display: block;
    }
}

footer {
    position: relative;
    background-color: #15172D;
    color: #FFF;
    text-align: center;
    font-family: Kanit;
    font-size: 1rem;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.character-left {
    position: absolute;
    bottom: 0;
    z-index: 1;
    left: -11%;
}

.character-right {
    position: absolute;
    bottom: 0;
    right: -10%;
    z-index: 1;
}

@media screen and (max-width: 1024px) {

    .character-right,
    .character-left {
        display: none;
    }
}


.sec-2-character-left {
    position: absolute;
    /* bottom: -5%; */
    /* z-index: 1; */
    left: -22%;
}

.sec-2-character-right {
    position: absolute;
    /* bottom: -5%; */
    right: -21%;
    /* z-index: 2; */
}

@media screen and (max-width: 1024px) {

    .sec-2-character-left,
    .sec-2-character-right {
        display: none;
    }
}

/* light sweep */
.title-img-light-sweep {
    position: relative;
    display: block;
    width: fit-content;
    margin: 0 auto;
    line-height: 0;
    isolation: isolate;
    overflow: hidden;
    /* เพิ่มเพื่อให้แสงอยู่แค่ใน block ของรูป */
}

.title-img-light-sweep>img {
    display: block;
    position: relative;
    z-index: 1;
}

.title-img-light-sweep::after {
    content: "";
    position: absolute;
    bottom: -10%;
    /* ขยับลงมาที่ด้านล่างของรูป title */
    left: 0;
    width: 40%;
    /* ขนาดความกว้างของแสง */
    height: 100%;
    /* ความสูงของแสง */
    z-index: 2;
    pointer-events: none;
    background: url("../image/light.png") no-repeat center;
    background-size: contain;
    mix-blend-mode: screen;
    animation: title-img-light-sweep 4s linear infinite;
    filter: brightness(2);
}

@keyframes title-img-light-sweep {
    0% {
        transform: translateX(-100%) scale(1);
        opacity: 0;
    }

    15% {
        opacity: 1;
    }

    85% {
        opacity: 1;
    }

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

/* --- New Premium Effects --- */

/* Floating Snow Particles */
.floating-petal {
    position: fixed;
    top: -50px;
    background: #fff;
    border-radius: 50%;
    opacity: 0.8;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    animation: snow-fall linear infinite;
}

@keyframes snow-fall {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    90% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(110vh) translateX(50px);
        opacity: 0;
    }
}

/* Character Card Hover Tilt & Glow - Removed per request */
.box-class {
    transition: none;
}

.box-class:hover {
    transform: none;
    filter: none;
}

/* Parallax smoothing */
.character-left,
.character-right,
.sec-2-character-left,
.sec-2-character-right {
    transition: transform 0.2s ease-out !important;
}