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

/* พื้นหลังธีมดำ-เขียว + ลายเส้นทองตารางข้าวหลามตัด (CSS อย่างเดียว) */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #e2e8f0;
    min-height: 100vh;
    background-color: var(--bg-color, #0d0d0d);
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent calc(100px - 1px),
            rgba(34, 197, 94, 0.25) calc(100px - 1px),
            rgba(74, 222, 128, 0.4) 100px
        ),
        repeating-linear-gradient(
            60deg,
            transparent 0,
            transparent calc(100px - 1px),
            rgba(34, 197, 94, 0.25) calc(100px - 1px),
            rgba(74, 222, 128, 0.4) 100px
        ),
        repeating-linear-gradient(
            120deg,
            transparent 0,
            transparent calc(100px - 1px),
            rgba(34, 197, 94, 0.25) calc(100px - 1px),
            rgba(74, 222, 128, 0.4) 100px
        ),
        linear-gradient(180deg, 
            color-mix(in srgb, var(--bg-color, #0d0d0d), transparent 4%) 0%, 
            color-mix(in srgb, var(--bg-color, #0d0d0d), transparent 6%) 30%, 
            color-mix(in srgb, var(--bg-color, #0d0d0d), transparent 4%) 60%, 
            color-mix(in srgb, var(--bg-color, #0d0d0d), transparent 3%) 100%
        );
    background-attachment: fixed;
    position: relative;
    padding: 2rem 1rem;
}

body.has-bg-image {
    background-color: transparent !important;
    background-image: none !important;
}

body.has-bg-image::before,
body.has-bg-image::after {
    opacity: 0.3;
}

._root_background, ._root_background>img {
  width: 100%;
  height: 100%;
}
._root_background>img {
  display: block;
  -o-object-fit: cover;
  object-fit: cover;
}
._root_background {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: -1;
}

/* เบลอแสงเขียวอ่อนๆ ทับบนลาย */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(34, 197, 94, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(22, 163, 74, 0.05) 0%, transparent 45%);
    pointer-events: none;
    z-index: 0;
}

/* ให้ลายตารางจางหายตรงกลาง (ใกล้เนื้อหา) */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(
        ellipse 90% 100% at 50% 50%,
        rgba(10, 15, 12, 0.92) 0%,
        rgba(10, 18, 13, 0.6) 35%,
        rgba(10, 18, 13, 0.2) 55%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
}

/* ก้อนเดียวอยู่กึ่งกลาง - ไม่มีพื้นหลัง ใช้พื้นหลังจาก body */
.center-block {
    position: relative;
    z-index: 1;
    max-width: 600px;
    width: 100%;
    margin: 12px auto;
    padding: 5px 5px 0;
    overflow: hidden;
    min-width: 0;
    /* ไม่ใส่ background ให้ก้อนนี้ จะได้เห็นพื้นหลัง body */
}

.center-block header {
    background: transparent;
    color: #86efac;
    padding: 2rem 0;
    text-align: center;
}

.center-block header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.center-block header p {
    opacity: 0.9;
    color: #a7f3d0;
}

/* โลโก้ด้านบนสุด */
.site-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.25rem 0 1rem;
    margin-bottom: 0.5rem;
}

.site-logo {
    display: inline-block;
    line-height: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-logo:hover {
    opacity: 0.9;
    transform: scale(1.03);
}

.site-logo__img {
    display: block;
    width: 380px;
    height: 200px;
    object-fit: contain;
    object-position: center;
}

@media (max-width: 576px) {
    .site-header {
        padding: 1rem 0 0.75rem;
    }
    .site-logo__img {
        width: 240px;
        height: 86px;
    }
}

/* แถบข้อความเลื่อนขวาไปซ้าย + เอฟเฟกต์เรืองแสงม่วง */
.marquee-wrap {
    overflow: hidden;
    background: #1f2228;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(168, 85, 247, 0.6);
    box-shadow:
        0 -25px 50px rgba(168, 85, 247, 0.6),
        0 -12px 28px rgba(168, 85, 247, 0.5),
        0 0 15px rgba(168, 85, 247, 0.5),
        0 0 30px rgba(168, 85, 247, 0.35),
        0 0 45px rgba(168, 85, 247, 0.2),
        inset 0 0 20px rgba(168, 85, 247, 0.08);
    animation: marquee-glow 3s ease-in-out infinite alternate;
}

@keyframes marquee-glow {
    from {
        box-shadow:
            0 -25px 50px rgba(168, 85, 247, 0.6),
            0 -12px 28px rgba(168, 85, 247, 0.5),
            0 0 15px rgba(168, 85, 247, 0.5),
            0 0 30px rgba(168, 85, 247, 0.35),
            0 0 45px rgba(168, 85, 247, 0.2),
            inset 0 0 20px rgba(168, 85, 247, 0.08);
    }
    to {
        box-shadow:
            0 -32px 60px rgba(168, 85, 247, 0.75),
            0 -16px 36px rgba(168, 85, 247, 0.55),
            0 0 20px rgba(168, 85, 247, 0.6),
            0 0 40px rgba(168, 85, 247, 0.4),
            0 0 60px rgba(168, 85, 247, 0.25),
            inset 0 0 25px rgba(168, 85, 247, 0.1);
    }
}

.marquee-inner {
    display: flex;
    width: max-content;
    animation: marquee-rtl 25s linear infinite;
}

.marquee-text {
    color: #e2e8f0;
    text-shadow:
        0 0 8px rgba(255, 255, 255, 0.5),
        0 0 16px rgba(168, 85, 247, 0.3);
    white-space: nowrap;
    padding-right: 3rem;
    font-size: 0.95rem;
}

@keyframes marquee-rtl {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* สไลด์รูปโลโก้จากโฟลเดอร์ logogame */
.logo-slider-wrap {
    overflow: hidden;
    margin-bottom: 1.5rem;
    border-radius: 16px;
}

.logo-slider-track {
    display: flex;
    gap: 12px;
    width: max-content;
    padding: 8px 0;
    animation: logo-slide-left 15s linear infinite;
}

.logo-slide {
    flex-shrink: 0;
    width: 200px;
    height: 90px;
    border-radius: 12px;
    background: rgba(20, 20, 35, 0.85);
    border: 2px solid rgba(236, 72, 153, 0.6);
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.35), inset 0 0 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    position: relative;
    overflow: hidden;
}

.logo-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.logo-slide.logo-slide-placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    text-align: center;
}

.logo-slide.logo-slide-placeholder img {
    display: none;
}

.logo-slide .hot-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(236, 72, 153, 0.9);
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(236, 72, 153, 0.8);
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.5);
}

@keyframes logo-slide-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* สไลด์การ์ดเกม จากโฟลเดอร์ img/logo */
.game-slider-wrap {
    overflow: hidden;
    margin-bottom: 1.5rem;
    border-radius: 16px;
}

.game-slider-track {
    display: flex;
    gap: 14px;
    width: max-content;
    padding: 8px 0;
    animation: game-slide-left 25s linear infinite;
}

.game-card {
    flex-shrink: 0;
    width: 160px;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(15, 20, 35, 0.9);
    border: 2px solid rgba(34, 211, 238, 0.6);
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.35), inset 0 0 20px rgba(0, 0, 0, 0.15);
}

.game-card-img-wrap {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
}

.game-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.game-card-title-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: #fff;
}

.game-card-title {
    font-size: 11px;
    font-weight: bold;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.game-card-subtitle {
    font-size: 9px;
    opacity: 0.9;
    margin-top: 2px;
}

.game-card-footer {
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.4);
}

.game-card-name {
    font-size: 10px;
    color: #fff;
    margin-bottom: 4px;
}

.game-card-percent {
    font-size: 11px;
    color: #fff;
    font-weight: bold;
    margin-bottom: 4px;
}

.game-card-bar {
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.game-card-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #a855f7 0%, #22c55e 100%);
    transition: width 0.3s ease;
}

@keyframes game-slide-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* ========== Modern Image Slider (กรอบมีแค่รูป จุดอยู่นอกกรอบ) ========== */
.slider-wrap {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.slider {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.slider__view {
    overflow: hidden;
    border-radius: 20px;
}

.slider__track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.slider__slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
}

.slider__slide img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    vertical-align: middle;
}

.slider__nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
}

.slider__prev,
.slider__next {
    pointer-events: auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.slider__prev:hover,
.slider__next:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.slider__prev:active,
.slider__next:active {
    transform: scale(0.98);
}

/* จุดอยู่นอกกรอบรูป ไม่ถูกกรอบกิน */
.slider__indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 14px 16px 0;
    margin-top: 4px;
    background: transparent;
}

.slider__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.slider__dot:hover {
    background: rgba(255, 255, 255, 0.55);
}

.slider__dot--active {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

@media (max-width: 480px) {
    .slider {
        border-radius: 14px;
    }
    .slider__view {
        border-radius: 14px;
    }
    .slider__prev,
    .slider__next {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    .slider__indicators {
        min-height: 36px;
        padding: 10px 12px;
        gap: 6px;
    }
    .slider__dot {
        width: 5px;
        height: 5px;
    }
}

/* ปุ่ม CTA สมัครสมาชิก + ติดต่อแอดมิน */
.cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 1.5rem;
    padding: 0 4px;
}

.cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

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

.cta-btn-register {
    position: relative;
    overflow: hidden;
    /* background 由 inline style 控制 */
}

.cta-btn-register::before,
.cta-btn-register::after {
    content: '';
    position: absolute;
    left: -35%;
    width: 50%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transform: rotate(-40deg);
    pointer-events: none;
    animation: cta-btn-line-run 5.5s ease-in-out infinite;
}

.cta-btn-register::before {
    top: 25%;
    height: 20px;
}

.cta-btn-register::after {
    top: 71%;
    height: 8px;
    animation-delay: 0.2s;
}

.cta-btn-register .cta-btn-diagonal-line {
    display: block;
    position: absolute;
    left: -35%;
    top: 48%;
    width: 50%;
    height: 14px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transform: rotate(-40deg);
    pointer-events: none;
    animation: cta-btn-line-run 5.5s ease-in-out infinite;
    animation-delay: 0.1s;
}

@keyframes cta-btn-line-run {
    0% { left: -35%; }
    28% { left: 85%; }
    100% { left: 85%; }
}

.cta-btn-register:hover {
    box-shadow: 0 6px 20px color-mix(in srgb, currentColor, transparent 55%);
}

.cta-btn-line {
    /* background 由 inline style 控制 */
    border: 1px solid color-mix(in srgb, currentColor, transparent 60%);
    transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.cta-btn-line:hover {
    filter: brightness(1.2);
    border-color: currentColor;
    box-shadow: 0 6px 20px color-mix(in srgb, currentColor, transparent 55%);
}

.cta-btn-register .cta-btn-text,
.cta-btn-register .cta-btn-icons {
    position: relative;
    z-index: 1;
}

.cta-btn-text {
    white-space: nowrap;
}

.cta-btn-icons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cta-btn-icons .fa-chevron-right {
    font-size: 0.75rem;
}

.cta-btn-icon-line {
    display: flex;
    align-items: center;
}

.cta-btn-icon-line .fa-line {
    font-size: 1.4rem;
}

.center-block main {
    padding: 0 0 2rem;
}

.card {
    background: transparent;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: none;
    border: none;
    overflow: hidden;
    max-width: 100%;
}

.card h2 {
    color: #0c4a6e;
    margin-bottom: 1rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.card p {
    margin-bottom: 1rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

button {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
}

button:active {
    transform: translateY(0);
}

#message {
    margin-top: 1rem;
    font-weight: 500;
    min-height: 1.5em;
}

.center-block footer {
    background: transparent;
    text-align: center;
    padding: 1rem;
    color: rgba(134, 239, 172, 0.7);
    font-size: 0.9rem;
}

/* ========== รองรับหน้าจอมือถือ ========== */
@media (max-width: 576px) {
    body {
        padding: 1rem 0.75rem;
    }

    .center-block {
        margin: 8px auto;
        padding: 4px 4px 0;
    }

    .center-block header h1 {
        font-size: 1.5rem;
    }

    .cta-buttons {
        gap: 10px;
        margin-bottom: 1.25rem;
        padding: 0 2px;
    }

    .cta-btn {
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    .cta-btn-text {
        font-size: inherit;
    }

    .falling-coins__item {
        font-size: 1.15rem;
    }

    .falling-coins__item:nth-child(n) {
        font-size: 1rem;
    }
}

@media (max-width: 380px) {
    body {
        padding: 0.75rem 0.5rem;
    }

    .cta-btn {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
}

/* ========== เหรียญร่วงทั้งหน้าจอ (CSS + Icon ไม่ใช้คลิป) ========== */
.falling-coins {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.falling-coins__item {
    position: absolute;
    top: -60px;
    font-size: 1.5rem;
    line-height: 1;
    opacity: 0.9;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    animation: falling-coin linear infinite;
}

.falling-coins__item:nth-child(1)  { left: 5%;  animation-duration: 12s; animation-delay: 0s;   font-size: 1.25rem; }
.falling-coins__item:nth-child(2)  { left: 12%; animation-duration: 14s; animation-delay: 1.5s; font-size: 1.6rem; }
.falling-coins__item:nth-child(3)  { left: 22%; animation-duration: 10s; animation-delay: 3s;   font-size: 1.35rem; }
.falling-coins__item:nth-child(4)  { left: 35%; animation-duration: 16s; animation-delay: 0.5s; font-size: 1.5rem; }
.falling-coins__item:nth-child(5)  { left: 48%; animation-duration: 11s; animation-delay: 2s;   font-size: 1.7rem; }
.falling-coins__item:nth-child(6)  { left: 55%; animation-duration: 13s; animation-delay: 4s;   font-size: 1.2rem; }
.falling-coins__item:nth-child(7)  { left: 65%; animation-duration: 15s; animation-delay: 1s;   font-size: 1.4rem; }
.falling-coins__item:nth-child(8)  { left: 75%; animation-duration: 9s;  animation-delay: 2.5s; font-size: 1.55rem; }
.falling-coins__item:nth-child(9)  { left: 85%; animation-duration: 12s; animation-delay: 0.8s; font-size: 1.3rem; }
.falling-coins__item:nth-child(10) { left: 92%; animation-duration: 14s; animation-delay: 3.5s; font-size: 1.45rem; }
.falling-coins__item:nth-child(11) { left: 8%;  animation-duration: 13s; animation-delay: 5s;   font-size: 1.4rem; }
.falling-coins__item:nth-child(12) { left: 28%; animation-duration: 10s; animation-delay: 6s;   font-size: 1.6rem; }
.falling-coins__item:nth-child(13) { left: 52%; animation-duration: 15s; animation-delay: 4.5s; font-size: 1.25rem; }
.falling-coins__item:nth-child(14) { left: 70%; animation-duration: 11s; animation-delay: 7s;   font-size: 1.5rem; }
.falling-coins__item:nth-child(15) { left: 95%; animation-duration: 12s; animation-delay: 2.2s; font-size: 1.35rem; }

@keyframes falling-coin {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.9;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0.55;
    }
}
