/* ==========================================================================
   Cyber99 AMP Theme - Main Stylesheet
   โทนสี: Dark (#02071c ถึง #000629) | Text (#ffffff) | Gold Accent (#fba501)
   หมายเหตุ: โค้ดนี้จะถูก minify ลงใน <style amp-custom> โดย AMP Plugin
   ========================================================================== */

/* ==========================================================================
   1. RESET & BASE VARIABLES
   ========================================================================== */
:root {
    --bg-dark: #02071c;
    --bg-darker: #000629;
    --bg-panel: #0a0e2a;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --accent-gold: #fba501;
    --accent-gold-hover: #e09400;
    --accent-red: #cc0000;
    --accent-red-hover: #aa0000;
    --border-gold: rgba(251, 165, 1, 0.2);
    --border-gold-strong: rgba(251, 165, 1, 0.4);
    --font-primary: 'Prompt', 'Kanit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --container-width: 1200px;
    --transition-speed: 0.3s;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-primary);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent-gold);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--accent-gold-hover);
}

img, amp-img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col-md-6, .col-md-3, .col-12 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

@media (min-width: 768px) {
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .align-items-end { align-items: flex-end; }
}

/* ==========================================================================
   2. TOPBAR
   ========================================================================== */
.topbar-container {
    background: #111111;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-gold);
    font-size: 12px;
}

.topbar-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-left-section, .topbar-right-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.topbar-item a {
    color: var(--text-muted);
}

.topbar-item a:hover {
    color: var(--text-main);
}

.topbar-item .live-chat {
    background: #333;
    padding: 2px 8px;
    border-radius: 4px;
}

.login-button, .register-button {
    padding: 4px 15px;
    border-radius: 20px;
    font-weight: 500;
    text-transform: uppercase;
}

.login-button {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--text-main);
}

.login-button:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-main);
}

.register-button {
    background: var(--accent-red);
    color: var(--text-main);
    border: 1px solid var(--accent-red);
}

.register-button:hover {
    background: var(--accent-red-hover);
    color: var(--text-main);
}

@media (max-width: 768px) {
    .topbar-container { display: none; } /* ซ่อน topbar บนมือถือ */
}

/* ==========================================================================
   3. HEADER & NAVIGATION
   ========================================================================== */
.site-header {
    background: var(--bg-darker);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-gold);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-branding {
    flex-shrink: 0;
}

.site-logo {
    max-height: 50px;
    width: auto;
}

.desktop-nav {
    display: none;
}

@media (min-width: 992px) {
    .desktop-nav {
        display: block;
        flex-grow: 1;
        margin-left: 40px;
    }
    .desktop-menu-list {
        display: flex;
        list-style: none;
        margin: 0;
        padding: 0;
        gap: 25px;
    }
    .desktop-menu-list a {
        color: var(--text-main);
        font-weight: 500;
        font-size: 14px;
        text-transform: uppercase;
    }
    .desktop-menu-list a:hover {
        color: var(--accent-gold);
    }
}

/* Mobile Hamburger Button */
.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

@media (min-width: 992px) {
    .mobile-menu-toggle { display: none; }
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: var(--accent-gold);
    border-radius: 3px;
    transition: all var(--transition-speed);
}

.mobile-menu-toggle.is-active .hamburger-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.mobile-menu-toggle.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.is-active .hamburger-line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Mobile Off-canvas Panel */
.mobile-nav-panel {
    position: fixed;
    top: 81px; /* ความสูง header โดยประมาณ */
    left: -100%;
    width: 80%;
    max-width: 300px;
    height: calc(100vh - 81px);
    background: var(--bg-panel);
    z-index: 99;
    overflow-y: auto;
    transition: left var(--transition-speed) ease-in-out;
    border-right: 1px solid var(--border-gold);
}

.mobile-nav-panel.is-open {
    left: 0;
}

.mobile-nav-inner {
    padding: 20px;
}

.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu-list li {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.mobile-menu-list a {
    display: block;
    padding: 15px 0;
    color: var(--text-main);
    font-size: 16px;
}

.mobile-menu-list a:hover {
    color: var(--accent-gold);
    padding-left: 10px;
}

/* ==========================================================================
   4. PAGE BUILDER: HERO BANNER
   ========================================================================== */
.builder-hero-banner {
    width: 100%;
    margin-bottom: 0 !important; /* ลบ margin ล่างเพื่อต่อกับ icon menu พอดี */
}

.builder-hero-banner .container {
    padding: 0; /* แบนเนอร์ชิดขอบ */
    max-width: 100%;
}

.builder-hero-banner .hero-link {
    display: block;
    width: 100%;
}

.builder-hero-banner .hero-img-desktop {
    display: block;
}

.builder-hero-banner .hero-img-mobile {
    display: none;
}

@media (max-width: 768px) {
    .builder-hero-banner .hero-img-desktop { display: none; }
    .builder-hero-banner .hero-img-mobile { display: block; }
}

/* ==========================================================================
   5. PAGE BUILDER: ICON MENU STRIP
   ========================================================================== */
.builder-icon-menu {
    background: var(--bg-panel);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-gold);
    margin-bottom: 30px !important;
}

.icon-menu-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 15px 30px;
}

.icon-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--accent-gold);
}

.icon-menu-item:hover {
    color: var(--text-main);
    transform: translateY(-2px);
}

.icon-menu-item .icon-img {
    width: 50px;
    height: 50px;
    margin-bottom: 8px;
    border-radius: 50%;
    background: rgba(0,0,0,0.3);
    padding: 5px;
    border: 1px solid var(--border-gold);
}

.icon-menu-item .icon-text {
    font-size: 12px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .icon-menu-wrapper {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }
    .icon-menu-wrapper::-webkit-scrollbar {
        display: none; /* Safari and Chrome */
    }
    .icon-menu-item {
        flex: 0 0 auto;
        min-width: 60px;
    }
    .icon-menu-item .icon-img {
        width: 40px;
        height: 40px;
    }
    .icon-menu-item .icon-text {
        font-size: 10px;
    }
}

/* ==========================================================================
   6. PAGE BUILDER: JACKPOT COUNTER
   ========================================================================== */
.builder-jackpot-counter {
    margin-bottom: 40px !important;
}

.jackpot-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-gold);
    background: #000;
}

.jackpot-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.5;
}

.jackpot-content {
    position: relative;
    z-index: 1;
    padding: 30px 20px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 15px;
}

.jackpot-currency {
    font-size: 24px;
    color: var(--accent-gold);
    font-weight: bold;
}

.jackpot-amount {
    font-size: 42px;
    color: var(--accent-gold);
    font-weight: bold;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(251, 165, 1, 0.5);
    font-family: monospace; /* ให้ตัวเลขดูเป็นดิจิทัล */
}

@media (max-width: 768px) {
    .jackpot-content { padding: 20px 10px; }
    .jackpot-currency { font-size: 16px; }
    .jackpot-amount { font-size: 28px; letter-spacing: 1px; }
}

/* ==========================================================================
   7. PAGE BUILDER: GAME TABS
   ========================================================================== */
.builder-game-tabs {
    margin-bottom: 40px !important;
}

.game-tabs-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-gold-strong);
    padding-bottom: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.game-tabs-nav::-webkit-scrollbar { display: none; }

.game-tab-btn {
    background: transparent;
    border: 1px solid var(--border-gold);
    color: var(--text-main);
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 14px;
    font-family: var(--font-primary);
    transition: all var(--transition-speed);
}

.game-tab-btn:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.game-tab-btn.active {
    background: var(--accent-gold);
    color: #000;
    border-color: var(--accent-gold);
    font-weight: bold;
}

.game-tab-panel {
    display: none;
    animation: fadeIn 0.5s ease;
}

.game-tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.game-card {
    display: block;
    background: var(--bg-panel);
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    overflow: hidden;
}

.game-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(251, 165, 1, 0.2);
}

.game-card .game-img {
    width: 100%;
    aspect-ratio: 1/1;
    background: #000;
    position: relative;
}

.game-card .game-title {
    padding: 10px;
    font-size: 13px;
    color: var(--text-main);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.no-games {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    border: 1px dashed var(--border-gold);
    border-radius: 8px;
}

@media (max-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .game-card .game-title {
        font-size: 11px;
        padding: 6px 4px;
    }
}

/* ==========================================================================
   8. FOOTER (SEO CONTENT & MAIN)
   ========================================================================== */
.site-footer-content {
    background: #0a0a0a;
    padding: 40px 0;
    border-top: 1px solid var(--border-gold);
    font-size: 13px;
    color: var(--text-muted);
}

.site-footer-content h1, .site-footer-content h2, .site-footer-content h3 {
    color: var(--accent-red);
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 15px;
}

.site-footer-content p {
    margin-bottom: 10px;
}

.site-footer-body {
    background: #000000;
    padding: 30px 0 80px 0; /* padding-bottom เผื่อที่ให้ Fixed Footer บนมือถือ */
}

@media (min-width: 768px) {
    .site-footer-body { padding-bottom: 30px; }
}

.copyrights p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.footer-certs {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: flex-start;
    margin-top: 20px;
}

.footer-certs .icon-item amp-img {
    max-height: 40px;
    width: auto;
}

.footer-social {
    margin-top: 20px;
}

.footer-social-title {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: var(--text-main);
}

.footer-social .icon-list {
    display: flex;
    gap: 10px;
}

.footer-social .icon-item a {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    transition: transform var(--transition-speed);
}

.footer-social .icon-item a:hover {
    transform: scale(1.1);
}

@media (min-width: 768px) {
    .footer-certs { justify-content: flex-end; margin-top: 0; }
    .footer-social { margin-top: 0; text-align: right; }
    .footer-social .icon-list { justify-content: flex-end; }
}

/* ==========================================================================
   9. FIXED FOOTER (MOBILE BOTTOM NAV)
   ========================================================================== */
.fixed-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-darker);
    border-top: 1px solid var(--border-gold);
    display: flex;
    justify-content: space-around;
    padding: 5px 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
}

@media (min-width: 768px) {
    .fixed-footer { display: none; } /* ซ่อนบน Desktop */
}

.fixed-footer a {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
    padding: 5px;
    flex: 1;
}

.fixed-footer a[data-active="true"] {
    color: var(--accent-gold);
}

.fixed-footer-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 3px;
}

.fixed-footer a[data-active="true"] .fixed-footer-icon {
    filter: drop-shadow(0 0 5px rgba(251, 165, 1, 0.8));
}
