:root {
    --primary-gold: #ffd700;
    --secondary-gold: #d4af37;
    --dark-bg: #0a0a0a;
    --dark-overlay: rgba(0, 0, 0, 0.7);
    --text-light: #f0f0f0;
    --accent-red: #8b0000;
    --font-heading: 'Cinzel', serif;
    --font-body: 'Lato', sans-serif;
    --font-thai: 'Kanit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--dark-bg);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Thai language font styling */
html[lang="th"] body,
html[lang="th"] .nav-links a,
html[lang="th"] .btn,
html[lang="th"] .tagline,
html[lang="th"] .class-desc,
html[lang="th"] .class-specs,
html[lang="th"] .news-content,
html[lang="th"] .download-box,
html[lang="th"] p,
html[lang="th"] li,
html[lang="th"] span,
html[lang="th"] h1,
html[lang="th"] h2,
html[lang="th"] h3,
html[lang="th"] h4,
html[lang="th"] h5,
html[lang="th"] h6 {
    font-family: var(--font-thai);
}

html[lang="th"] .nav-links a,
html[lang="th"] .btn {
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* English font size adjustment - reduce slightly to match Thai */
html[lang="en"] .nav-links a {
    font-size: 0.88rem;
}

html[lang="en"] .btn {
    font-size: 0.88rem;
}

html[lang="en"] .lang-btn {
    font-size: 0.78rem;
}

/* Ensure Thai font size remains consistent */
html[lang="th"] .nav-links a,
html[lang="th"] .btn {
    font-size: 0.95rem;
}

html[lang="th"] .lang-btn {
    font-size: 0.85rem;
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.7));
    padding: 15px 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

header.scrolled {
    background: rgba(0, 0, 0, 0.98);
    padding: 10px 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
}

.nav-brand {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
    transition: transform 0.3s ease;
}

.nav-logo:hover {
    transform: scale(1.05);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    gap: 5px;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary-gold);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: center;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    padding: 10px 18px;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.95rem;
    line-height: 1.4;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-gold);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-links a:hover {
    color: var(--primary-gold);
    background: rgba(255, 215, 0, 0.05);
}

.nav-links a:hover::after {
    width: 80%;
}

.social-link.discord:hover {
    color: #5865F2;
    background: rgba(88, 101, 242, 0.1);
}

.social-link.facebook:hover {
    color: #1877F2;
    background: rgba(24, 119, 242, 0.1);
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(45deg, var(--secondary-gold), var(--primary-gold));
    color: #000;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.5);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--primary-gold);
    color: var(--primary-gold);
}

.btn-secondary:hover {
    background: rgba(255, 215, 0, 0.1);
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 2px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.lang-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 14px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1.4;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 6px;
    pointer-events: auto;
    position: relative;
    z-index: 10;
    min-width: 42px;
    text-align: center;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateY(-1px);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-weight: 900;
    transform: scale(1.05);
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.2rem;
    margin: 0 10px;
}

.btn-play {
    width: 100%;
    background: linear-gradient(45deg, #8b0000, #ff0000);
    color: white;
    border: 1px solid #ff4444;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
}

.btn-play:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.6);
}

.btn-download {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--primary-gold);
    color: var(--primary-gold);
}

.btn-download:hover {
    background: var(--primary-gold);
    color: #000;
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.8) 100%);
    z-index: -1;
}

.hero-content {
    z-index: 1;
    padding: 20px;
    animation: fadeInUp 1s ease-out;
}

.logo-container {
    margin-bottom: 20px;
}

.main-logo {
    max-width: 300px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.3));
    animation: float 6s ease-in-out infinite;
}

.tagline {
    font-size: 1.5rem;
    margin-bottom: 40px;
    color: #ddd;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    font-family: var(--font-heading);
    letter-spacing: 2px;
}

/* Features Section */
.features {
    padding: 80px 20px;
    background: #111;
    text-align: center;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.features h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--primary-gold);
    margin-bottom: 50px;
    text-transform: uppercase;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.1);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-gold);
    background: rgba(255, 215, 0, 0.05);
}

.feature-card h3 {
    font-family: var(--font-heading);
    color: var(--text-light);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

/* Footer */
footer {
    background: #050505;
    padding: 40px 20px;
    text-align: center;
    border-top: 1px solid #333;
}

.social-links {
    margin-top: 20px;
}

.social-links a {
    color: #888;
    margin: 0 15px;
    text-decoration: none;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--primary-gold);
}

/* Animations */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* News Section */
.news-section {
    padding: 80px 20px;
    background: #0f0f0f;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--primary-gold);
    text-transform: uppercase;
    margin-bottom: 10px;
}

html[lang="th"] .section-header h2 {
    font-family: var(--font-thai);
}

.header-line {
    width: 100px;
    height: 3px;
    background: var(--primary-gold);
    margin: 0 auto;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.news-card {
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s;
    border: 1px solid #333;
}

.news-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-gold);
}

.news-thumb {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.news-card:hover .news-thumb img {
    transform: scale(1.1);
}

.news-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    color: #fff;
}

.news-tag.update {
    background: #007bff;
}

.news-tag.event {
    background: #28a745;
}

.news-tag.community {
    background: #fd7e14;
}

.news-content {
    padding: 20px;
}

.news-date {
    display: block;
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 10px;
}

.news-content h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-light);
}

html[lang="th"] .news-content h3 {
    font-family: var(--font-thai);
}

.news-content p {
    font-size: 0.95rem;
    color: #ccc;
    margin-bottom: 20px;
}

.read-more {
    color: var(--primary-gold);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.read-more:hover {
    color: #fff;
}

.view-all-container {
    text-align: center;
}

/* Classes Section */
.classes-section {
    padding: 80px 20px;
    background: url('cover.png') no-repeat center center/cover;
    /* Fallback or reuse cover */
    position: relative;
}

.classes-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    /* Dark overlay */
    z-index: 0;
}

.classes-section .container {
    position: relative;
    z-index: 1;
}

.class-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.class-tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

.class-tab {
    background: transparent;
    border: 2px solid #444;
    color: #888;
    padding: 10px 30px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.class-display {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.class-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.class-info {
    flex: 1;
    max-width: 500px;
}

.class-info h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--primary-gold);
    margin-bottom: 15px;
}

html[lang="th"] .class-info h3 {
    font-family: var(--font-thai);
}

.class-desc {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: #ddd;
}

.class-specs {
    list-style: none;
}

.class-specs li {
    margin-bottom: 10px;
    font-size: 1.1rem;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.class-specs strong {
    color: var(--secondary-gold);
    margin-right: 10px;
}

.class-image {
    flex: 1;
    text-align: center;
}

.class-image img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.8));
    animation: float 4s ease-in-out infinite;
}

/* Media Section */
.media-section {
    padding: 80px 20px;
    background: #111;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.media-item {
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #333;
    transition: border-color 0.3s;
    cursor: pointer;
}

.media-item:hover {
    border-color: var(--primary-gold);
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.media-item:hover img {
    transform: scale(1.05);
}

/* Download Section */
.download-section {
    padding: 80px 20px;
    background: linear-gradient(to bottom, #0a0a0a, #1a1a1a);
    text-align: center;
}

.download-box {
    margin: 0 auto;
}

.download-box h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--primary-gold);
    margin-bottom: 20px;
}

html[lang="th"] .download-box h2 {
    font-family: var(--font-thai);
}

.download-box p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    color: #ccc;
}

.download-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.sys-req {
    background: rgba(0, 0, 0, 0.5);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #333;
}

.sys-req h3 {
    font-family: var(--font-heading);
    color: #fff;
    margin-bottom: 20px;
}

html[lang="th"] .sys-req h3 {
    font-family: var(--font-thai);
}

.sys-req table {
    width: 100%;
    border-collapse: collapse;
    color: #ccc;
}

.sys-req th,
.sys-req td {
    padding: 15px;
    border-bottom: 1px solid #333;
    text-align: left;
}

.sys-req th {
    color: var(--primary-gold);
    text-transform: uppercase;
    font-size: 0.9rem;
}

/* Download Page Specific Styles */
main.download-page {
    margin-top: 80px;
}

.download-info {
    margin: 40px 0;
    padding: 30px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    text-align: left;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.download-info h3 {
    color: var(--primary-gold);
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-family: var(--font-heading);
}

html[lang="th"] .download-info h3 {
    font-family: var(--font-thai);
}

.download-info ol {
    line-height: 2;
    color: #ccc;
    padding-left: 20px;
}

.download-info-note {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 215, 0, 0.1);
    border-left: 3px solid var(--primary-gold);
    border-radius: 5px;
}

.download-info-note p {
    color: var(--primary-gold);
    margin: 0;
}

.download-faq {
    margin-top: 60px;
    padding: 30px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.download-faq h3 {
    color: var(--primary-gold);
    margin-bottom: 30px;
    font-size: 1.5rem;
    text-align: center;
    font-family: var(--font-heading);
}

html[lang="th"] .download-faq h3 {
    font-family: var(--font-thai);
}

.faq-item {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.faq-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.faq-item h4 {
    color: var(--secondary-gold);
    margin-bottom: 10px;
    font-family: var(--font-heading);
}

html[lang="th"] .faq-item h4 {
    font-family: var(--font-thai);
}

.faq-item p {
    color: #ccc;
    line-height: 1.8;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Header */
@media (max-width: 968px) {
    nav {
        flex-wrap: wrap;
    }
    
    .nav-links {
        order: 3;
        width: 100%;
        flex-direction: column;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        background: rgba(0, 0, 0, 0.95);
        margin-top: 10px;
        padding: 0 20px;
    }
    
    .nav-links.active {
        max-height: 400px;
        padding: 20px;
    }
    
    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 12px;
        border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    }
    
    .nav-links a:last-child {
        border-bottom: none;
    }
    
    .auth-buttons {
        order: 2;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .language-switcher {
        order: 1;
        padding: 2px;
    }
    
    .lang-btn {
        padding: 6px 14px;
        font-size: 0.8rem;
        min-width: 40px;
    }
    
    .btn {
        font-size: 0.85rem;
        padding: 8px 15px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 10px 0;
    }
    
    nav {
        padding: 0 15px;
    }
    
    .mobile-menu-toggle {
        display: flex;
        order: 1;
    }
    
    .nav-brand {
        order: 0;
        flex: 1;
    }
    
    .nav-logo {
        height: 35px;
    }
    
    .auth-buttons {
        order: 2;
        margin-left: auto;
    }
    
    .language-switcher {
        order: 0;
        padding: 2px;
    }
    
    .lang-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
        min-width: 38px;
    }
    
    .btn-secondary,
    .btn-primary {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(0, 0, 0, 0.98);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .class-content {
        flex-direction: column-reverse;
        text-align: center;
    }

    .class-info {
        text-align: left;
    }

    .download-buttons {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .auth-buttons {
        flex-direction: column;
        width: 100%;
        margin-top: 10px;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .language-switcher {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
        max-width: 120px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .lang-btn {
        flex: 1;
    }
}

.sys-req h3 {
    font-family: var(--font-heading);
    color: #fff;
    margin-bottom: 20px;
}

html[lang="th"] .sys-req h3 {
    font-family: var(--font-thai);
}

.sys-req table {
    width: 100%;
    border-collapse: collapse;
    color: #ccc;
}

.sys-req th,
.sys-req td {
    padding: 15px;
    border-bottom: 1px solid #333;
    text-align: left;
}

.sys-req th {
    color: var(--primary-gold);
    text-transform: uppercase;
    font-size: 0.9rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}