:root {
    --primary-gold: #c5a059;
    --dark-gold: #8b6e3a;
    --bg-dark: #0f0b08;
    --card-bg: rgba(20, 15, 10, 0.85);
    --border-color: #4a3b2a;
    --text-color: #d1c4b2;
    --accent-red: #8b0000;
    --font-fantasy: 'Cinzel', serif;
    --font-ui: 'Montserrat', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-color);
    font-family: var(--font-ui);
    line-height: 1.6;
    overflow-x: hidden;
}

.page-wrapper {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fixed-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/banner.png');
    background-size: cover;
    background-position: center;
    z-index: -2;
}

.menu-text {
    font-size: 36px;
    font-weight: 600;
    letter-spacing: 1px;
}

.overlay-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
    z-index: -1;
}

/* Header */
.main-header {
    width: 95%;
    max-width: 1200px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    z-index: 100;
    flex-wrap: wrap;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 20px;
}

.nav-left,
.nav-right {
    display: flex;
    gap: 20px;
    flex: 1;
}

.nav-left {
    justify-content: flex-end;
    padding-right: 10px;
    transform: translateY(-40px);
}

.nav-right {
    justify-content: flex-start;
    padding-left: 10px;
    transform: translateY(-40px);
}

.main-header a {
    color: white;
    text-decoration: none;
    font-size: 22px;
    font-weight: 600;
    transition: color 0.3s, transform 0.3s;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.main-header a:hover {
    color: var(--primary-gold);
    transform: translateY(-2px);
}

/* Dropdown Menu Custom */
.menu-item-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu-custom {
    display: none;
    position: absolute;
    background: var(--card-bg);
    border: 1px solid var(--primary-gold);
    min-width: 180px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    z-index: 1001;
    top: 60%;
    /* Adjust based on parent position */
    left: 50%;
    transform: translateX(-50%);
    border-top: 2px solid var(--primary-gold);
}

.dropdown-menu-custom a {
    color: var(--text-color) !important;
    padding: 12px 20px !important;
    text-decoration: none;
    display: block;
    font-size: 16px !important;
    text-align: center;
    border-bottom: 1px solid rgba(197, 160, 89, 0.1);
    transform: none !important;
    text-shadow: none !important;
}

.dropdown-menu-custom a:last-child {
    border-bottom: none;
}

.dropdown-menu-custom a:hover {
    background: rgba(197, 160, 89, 0.15);
    color: var(--primary-gold) !important;
    transform: none !important;
}

.menu-item-dropdown:hover .dropdown-menu-custom {
    display: block;
}

/* Mobile adjustments for dropdown */
@media (max-width: 768px) {
    .menu-item-dropdown {
        width: 100%;
        text-align: center;
    }

    .dropdown-menu-custom {
        position: static;
        display: block;
        /* Show expanded on mobile */
        transform: none;
        background: transparent;
        border: none;
        box-shadow: none;
        width: 100%;
        margin-top: 10px;
    }

    .dropdown-menu-custom a {
        padding: 10px !important;
        font-size: 18px !important;
        background: rgba(255, 255, 255, 0.05);
        margin-bottom: 5px;
    }
}

/* Modal theme integration */
.modal-content {
    background: var(--card-bg) !important;
    border: 1px solid var(--primary-gold) !important;
    color: var(--text-color) !important;
}

.modal-header,
.modal-footer {
    border-color: var(--border-color) !important;
}

.text-main-1 {
    color: var(--primary-gold) !important;
}

.modal-body {
    padding: 30px !important;
}

.modal-body .close {
    position: absolute;
    top: 15px;
    right: 15px;
    color: var(--primary-gold) !important;
    opacity: 0.8;
    transition: opacity 0.3s;
    font-size: 1.5rem;
    z-index: 10;
}

.modal-body .close:hover {
    opacity: 1;
}

.btn-premium-modal {
    background: linear-gradient(to bottom, #d4af37, #8b6e3a) !important;
    border: 2px solid #5a4628 !important;
    padding: 10px 20px !important;
    color: #1a1510 !important;
    font-family: var(--font-fantasy) !important;
    font-weight: bold !important;
    font-size: 1.1rem !important;
    cursor: pointer !important;
    border-radius: 4px !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), inset 0 0 5px rgba(255, 255, 255, 0.3) !important;
    transition: transform 0.2s, filter 0.2s !important;
    display: block;
    width: 100%;
}

.btn-premium-modal:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
    color: #1a1510 !important;
    text-decoration: none !important;
}

.nk-gap,
.nk-gap-1 {
    display: block;
    height: 15px;
}

.nk-gap-2 {
    height: 30px;
}

.nk-gap-3 {
    height: 45px;
}

.nk-gap-4 {
    height: 60px;
}

.form-group-custom {
    margin-bottom: 20px;
}

.form-group-custom label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-gold);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-control {
    background: #1a1510 !important;
    border: 1px solid #343a40 !important;
    color: white !important;
}

.form-control:focus {
    border-color: var(--primary-gold) !important;
    box-shadow: 0 0 0 0.2rem rgba(197, 160, 89, 0.25) !important;
}

.main-logo {
    height: 180px;
    filter: drop-shadow(0 0 10px rgba(197, 160, 89, 0.3));
    transform: translateY(-40px);
    transition: all 0.3s ease;
    z-index: 2;
}

/* Mobile Menu Toggle */
.mobile-menu-checkbox {
    display: none;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--primary-gold);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* Toggle Interaction */
.mobile-menu-checkbox:checked~.mobile-menu-toggle span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-checkbox:checked~.mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-checkbox:checked~.mobile-menu-toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-menu-checkbox:checked~.mobile-menu-overlay {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-checkbox:checked~.header-content {
    transform: translateX(0);
}

/* Main Content */
.content-container {
    width: 95%;
    max-width: 1100px;
    padding: 20px 0;
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 40px;
}

.characters-display {
    position: absolute;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    pointer-events: none;
    z-index: 1;
    /* Stay behind the header/menu */
}

.hero-title-text {
    font-family: var(--font-fantasy);
    color: white;
    text-decoration: none;
    text-align: center;
    text-shadow: 0 0 20px rgba(197, 160, 89, 0.5), 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-size: clamp(24px, 5vw, 48px);
    margin-top: 30px;
    letter-spacing: 2px;
    font-weight: 700;
}

.characters-display img {
    mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
}

.char-left,
.char-right {
    height: 350px;
    opacity: 0.7;
}

.char-center {
    height: 450px;
    z-index: 2;
}

.game-start-container {
    z-index: 5;
    text-align: center;
    margin-bottom: 20px;
}

.btn-game-start {
    background: linear-gradient(to bottom, #d4af37, #8b6e3a);
    border: 2px solid #5a4628;
    padding: 15px 60px;
    color: #1a1510;
    font-family: var(--font-fantasy);
    font-weight: bold;
    font-size: 2rem;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.3);
    position: relative;
    transition: transform 0.2s, filter 0.2s;
}

.btn-game-start:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.test-server-link a {
    color: var(--primary-gold);
    text-decoration: none;
    font-size: 0.8rem;
    margin-top: 10px;
    display: inline-block;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    border-top: 2px solid var(--primary-gold);
}

/* Corner decorations */
.dashboard-card::before,
.dashboard-card::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    border: 2px solid var(--primary-gold);
    z-index: 2;
    pointer-events: none;
}

.dashboard-card::before {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
}

.dashboard-card::after {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
}

/* Special styling for middle promo card to match the image's unique frame */
.promo-card {
    border-top: none;
    background: transparent;
    box-shadow: none;
}

.promo-card .promo-viewport {
    border: 4px solid var(--border-color);
    position: relative;
    box-shadow: 0 0 30px rgba(0, 0, 0, 1);
}

.promo-card .promo-viewport::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 10px;
    background: var(--primary-gold);
    clip-path: polygon(0 100%, 20% 0, 80% 0, 100% 100%);
}

/* Login Card */
.login-card .card-header {
    background: linear-gradient(to right, #2a2015, #343a40);
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
}

.login-card h3 {
    font-family: var(--font-fantasy);
    font-size: 0.9rem;
    color: var(--primary-gold);
    letter-spacing: 1px;
}

.login-form {
    padding: 15px;
}

.input-group {
    margin-bottom: 10px;
    position: relative;
}

.input-group label {
    display: none;
}

.input-group input {
    width: 100%;
    background: #1a1510;
    border: 1px solid #343a40;
    padding: 8px 10px;
    color: white;
    font-size: 0.8rem;
}

.btn-login {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 80px;
    background: var(--accent-red);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    border: 1px solid #500;
}

.input-group:last-of-type {
    display: flex;
}

.input-group:last-of-type input {
    flex: 1;
}

.login-footer-links {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
}

.login-footer-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.75rem;
}

.payment-banner {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
    gap: 10px;
    border-top: 1px solid #343a40;
}

.payment-icon {
    width: 30px;
    height: 30px;
    background: var(--primary-gold);
    border-radius: 50%;
    flex-shrink: 0;
}

.payment-banner p {
    font-size: 0.7rem;
    color: #a08c74;
}

/* Promo Card */
.promo-card {
    display: flex;
    flex-direction: column;
}

.promo-viewport {
    flex: 1;
    overflow: hidden;
}

.promo-viewport img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.promo-footer {
    background: rgba(0, 0, 0, 0.8);
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.promo-footer .tag {
    color: var(--primary-gold);
    font-size: 0.8rem;
    font-weight: bold;
}

.promo-footer .text {
    font-size: 0.75rem;
    flex: 1;
}

/* Video Card */
.video-card .video-preview-container {
    position: relative;
    cursor: pointer;
    height: 100%;
}

.video-card img,
.video-card video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: background 0.3s;
}

.video-card:hover .play-overlay {
    background: rgba(0, 0, 0, 0.1);
}

.play-overlay .video-label {
    font-size: 1.5rem;
    font-family: var(--font-fantasy);
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 1);
}

.play-overlay .age-brand {
    font-size: 0.7rem;
    letter-spacing: 2px;
}

/* Info Panels */
.info-panels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.info-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 15px;
}

.panel-tabs {
    display: flex;
    border-bottom: 2px solid #343a40;
    margin-bottom: 15px;
}

.panel-tabs button {
    background: none;
    border: none;
    color: var(--text-color);
    padding: 5px 15px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.panel-tabs button.active {
    color: var(--primary-gold);
    border-bottom: 2px solid var(--primary-gold);
    margin-bottom: -2px;
}

.ranking-list,
.news-list {
    list-style: none;
}

.ranking-list li,
.news-list li {
    font-size: 0.8rem;
    padding: 5px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rank-num {
    font-weight: bold;
    color: var(--primary-gold);
    width: 20px;
}

.rank-name {
    flex: 1;
}

.rank-stats {
    color: #888;
    font-size: 0.7rem;
}

.news-tag {
    color: #5a8;
    font-weight: bold;
}

.news-title {
    flex: 1;
    color: var(--text-color);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-date {
    font-size: 0.7rem;
    color: #666;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.item-slot {
    background: #1a1510;
    border: 1px solid #343a40;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.panel-header h3 {
    font-size: 0.9rem;
    color: var(--primary-gold);
}

.more-link {
    text-decoration: none;
    color: var(--primary-gold);
}

/* Responsive */
@media (max-width: 1024px) {
    .main-logo {
        height: 140px;
    }

    .nav-left,
    .nav-right {
        gap: 15px;
        transform: translateY(-20px);
    }

    .main-header a {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .header-content {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 280px;
        background: var(--card-bg);
        border-left: 2px solid var(--primary-gold);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 60px 20px;
        z-index: 1000;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .main-header {
        height: 80px;
        padding: 0;
        justify-content: center;
    }

    .nav-left,
    .nav-right {
        flex-direction: column;
        gap: 40px;
        text-align: center;
        transform: none;
        width: 100%;
        flex: none;
        justify-content: center;
    }

    .main-logo {
        height: 100px;
        transform: none;
        order: -1;
        margin-bottom: 40px;
    }

    .main-header a {
        font-size: 24px;
    }

    .hero-section {
        height: auto;
        min-height: 200px;
        padding-top: 40px;
    }

    .hero-title-text {
        font-size: clamp(20px, 6vw, 28px);
        margin-top: 10px;
    }

    .btn-game-start {
        font-size: 1.5rem;
        padding: 12px 40px;
    }
}

@media (max-width: 480px) {
    .main-logo {
        height: 100px;
    }

    .hero-title-text {
        font-size: clamp(18px, 6vw, 22px);
    }

    .panel-tabs button {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .login-footer-links {
        font-size: 0.7rem;
    }
}