/* --- Root Variables (ธีมทอง-ดำ) --- */
:root {
    /* เปลี่ยนสีหลักเป็นสีทอง */
    --primary-gold: #D4AF37; /* สีทองเมทัลลิค */
    --primary-rgb: 212, 175, 55; /* ค่า RGB ของสีทอง */
    
    --dark-bg: #000000; /* ดำสนิท */
    --card-bg: #111111; /* ดำรอง */
    --nav-bg: #0a0a0a;
    --text-gray: #a0a0a0;
    --text-white: #FFFFFF;
    
    /* สีสถานะอื่นๆ */
    --accent-blue: #3498db;
    --accent-green: #2ecc71;
    --accent-red: #ff1f1f; /* สีแดงสำหรับแจ้งเตือนร้ายแรงยังคงไว้ */
    
    --glass-bg: rgba(10, 10, 10, 0.95);
    --nav-height: 60px;
}

/* --- Global Styles --- */
html,
body {
    height: 100%;
    margin: 0;
    scroll-behavior: smooth;
}

body {
    font-family: 'Kanit', sans-serif;
    background-color: var(--dark-bg);
    color: white;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    font-size: 1rem;
}

/* --- Navbar Area (Compact Version) --- */
.navbar {
    background: var(--nav-bg);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0 10px; /* ลด Padding ด้านข้าง */
    
    /* ปรับความสูง Navbar ให้เล็กลง */
    height: 48px;       
    min-height: 48px;
    max-height: 48px;
    
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--primary-gold);
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.3); /* เปลี่ยนเงาเป็นสีทอง */
    box-sizing: border-box;
}

.nav-menu {
    display: flex;
    gap: 5px; /* ลดช่องว่างระหว่างเมนู */
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow: visible;
    align-items: center;
    width: 100%;
    height: 100%;
    min-width: 0;
}

.nav-item {
    color: var(--text-gray);
    text-decoration: none;
    padding: 4px 10px; /* ลดพื้นที่ภายในปุ่ม */
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px; /* ลดความโค้งเล็กน้อย */
    display: flex;
    align-items: center;
    gap: 5px;
    
    font-size: 0.8rem; /* ลดขนาดตัวหนังสือ */
    height: 30px;      /* ลดความสูงปุ่ม */
    
    white-space: nowrap;
    box-sizing: border-box;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary-gold);
    background: rgba(var(--primary-rgb), 0.15);
    transform: translateY(-1px);
    text-shadow: 0 0 8px rgba(var(--primary-rgb), 0.6);
}

/* Custom Select Bar Style */
.nav-select {
    background-color: #1a1a1a;
    color: var(--primary-gold);
    border: 1px solid var(--primary-gold);
    padding: 2px 8px; /* ลด Padding ในช่องเลือก */
    border-radius: 4px;
    font-family: 'Kanit', sans-serif;
    
    font-size: 0.75rem; /* ลดขนาดตัวหนังสือในช่องเลือก */
    height: 30px;      /* ลดความสูงให้เท่ากับปุ่ม */
    
    cursor: pointer;
    outline: none;
    font-weight: 500;
}

.nav-select:hover {
    background-color: #333;
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.2);
}

/* --- Main Content Layout --- */
.container {
    max-width: 1600px;
    width: 100%;
    margin: 30px auto;
    padding: 0 20px;
    flex: 1 0 auto;
    box-sizing: border-box;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Grid & Cards General --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.8); /* เงาดำเข้ม */
    height: fit-content;
}

h2 {
    color: var(--primary-gold);
    font-size: 1.3rem;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.3);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 15px 0;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(var(--primary-rgb), 0.4);
}

/* --- Rule & Role Styling --- */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

#rules .rules-grid {
    grid-template-columns: 1fr;
    max-width: 1000px;
    margin: 0 auto;
}

.rule-card {
    background-color: #0a0a0a;
    border: 1px solid var(--primary-gold);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.rule-card:hover {
    border-color: var(--primary-gold);
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.4); /* เรืองแสงทอง */
}

.rule-body {
    padding: 20px;
    flex-grow: 1;
}

.rule-header {
    color: var(--primary-gold);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.rule-desc {
    font-size: 0.95rem;
    color: #d1d1d1;
    line-height: 1.6;
    margin-bottom: 15px;
}

.rule-list-title {
    color: #fff;
    font-weight: bold;
    margin-top: 12px;
    margin-bottom: 6px;
    font-size: 1rem;
}

.rule-sub-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rule-sub-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 6px;
    color: #bbb;
    font-size: 0.9rem;
}

.rule-sub-list li::before {
    content: "•";
    color: var(--primary-gold);
    position: absolute;
    left: 0;
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1.1rem;
}

.penalty-footer {
    background: rgba(212, 175, 55, 0.1); /* พื้นหลังทองจางๆ */
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    padding: 15px 25px;
    font-size: 0.9rem;
    color: #eaddcf;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.penalty-label {
    color: var(--primary-gold);
    font-weight: bold;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.penalty-text {
    line-height: 1.5;
    word-wrap: break-word;
}

/* --- Role Images --- */
.role-img-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
    border-bottom: 2px solid var(--primary-gold);
    position: relative;
}

.role-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.5s ease;
}

.rule-card:hover .role-img-wrapper img {
    transform: scale(1.05);
}

.role-specs {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.role-specs h4 {
    font-size: 0.9rem;
    color: var(--primary-gold);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.spec-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.spec-tag {
    background: rgba(var(--primary-rgb), 0.15);
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid rgba(var(--primary-rgb), 0.3);
}

/* --- History Styles --- */
.history-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 30px;
    margin-top: 25px;
}

.history-main-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    box-shadow: 0 8px 20px rgba(0,0,0,0.6);
    position: relative;
    overflow: hidden;
}

.history-main-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-gold), transparent);
}

.timeline-item {
    position: relative;
    padding-left: 50px;
    margin-bottom: 40px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 8px;
    bottom: -50px;
    width: 2px;
    background: rgba(var(--primary-rgb), 0.2);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 9px;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--dark-bg);
    border: 2px solid var(--primary-gold);
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.4);
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.timeline-item:hover::after {
    background: var(--primary-gold);
    transform: scale(1.3);
    box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.8);
}

.history-sub-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-gold);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.era-tag {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-gold);
    border: 1px solid var(--primary-gold);
    padding: 3px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.history-desc {
    font-size: 1rem;
    line-height: 1.7;
    color: #ccc;
    margin-bottom: 15px;
}

.bloodline-box {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--primary-gold);
    padding: 15px;
    border-radius: 0 8px 8px 0;
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.bloodline-item {
    font-size: 0.9rem;
    color: #bbb;
}

.bloodline-item b {
    display: block;
    color: var(--primary-gold);
    font-size: 1rem;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.bloodline-item i {
    margin-right: 6px;
}

/* --- Breaking Point (จุดแตกหัก - ยิ่งแดงเข้ม - คงสีแดงไว้เพื่อความหมายที่ถูกต้อง) --- */
.timeline-item.breaking-point::before {
    background: rgba(255, 0, 0, 0.5);
}

.timeline-item.breaking-point::after {
    border-color: #ff0000;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.6);
}

.timeline-item.breaking-point:hover::after {
    background: #ff0000;
    box-shadow: 0 0 25px rgba(255, 0, 0, 1);
}

.timeline-item.breaking-point .era-tag {
    color: #ff0000;
    border-color: #ff0000;
    background: rgba(255, 0, 0, 0.2);
}

.timeline-item.breaking-point .history-sub-title {
    color: #ff0000 !important;
}

/* --- Side Stack & Vertical Timeline --- */
.side-stack {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.mini-card,
.lore-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.lore-card {
    background: linear-gradient(145deg, #181818, #000000);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    transition: 0.3s;
}

.lore-card:hover {
    border-color: var(--primary-gold);
    transform: translateY(-3px);
    box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.2);
}

.lore-header {
    color: var(--primary-gold);
    font-size: 1.25rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.3);
    padding-bottom: 8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mini-card h3 {
    color: var(--primary-gold);
    margin-bottom: 15px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
}

.list-item:last-child {
    border-bottom: none;
}

.badge-gold {
    background: var(--primary-gold);
    color: #000; /* ตัวหนังสือดำบนพื้นทอง */
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.75rem;
}

/* --- Vertical Timeline Sidebar --- */
.vertical-timeline {
    position: relative;
    padding-left: 10px;
    margin-top: 10px;
}

.vertical-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 6px;
    height: 100%;
    width: 2px;
    background: rgba(var(--primary-rgb), 0.3);
    border-radius: 2px;
}

.v-item {
    position: relative;
    padding-left: 20px;
    margin-bottom: 20px;
}

.v-item:last-child {
    margin-bottom: 0;
}

.v-item::after {
    content: '';
    position: absolute;
    left: -9px;
    top: 6px;
    width: 8px;
    height: 8px;
    background: var(--dark-bg);
    border: 2px solid var(--primary-gold);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.5);
    z-index: 1;
    transition: 0.3s;
}

.v-item:hover::after {
    background: var(--primary-gold);
    transform: scale(1.2);
}

.v-year {
    display: block;
    color: var(--primary-gold);
    font-weight: bold;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.v-desc {
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

/* --- Hero Section --- */
.hero-section {
    text-align: center;
    margin-bottom: 40px;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 600;
    line-height: 1.2;
    text-shadow: 2px 2px 0px #000, 0 0 20px rgba(var(--primary-rgb), 0.5);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid var(--primary-gold);
    box-shadow: 0 8px 30px rgba(var(--primary-rgb), 0.2);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
}

.key {
    background: #2a2a2a;
    padding: 4px 10px;
    border-radius: 6px;
    color: var(--primary-gold);
    font-weight: 600;
    box-shadow: 0 2px 0 #000;
    font-size: 0.9rem;
    border: 1px solid rgba(var(--primary-rgb), 0.3);
}

.desc-text {
    color: var(--text-white);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* --- Controls Styling --- */
.control-category {
    margin-bottom: 20px;
}

.control-category h3 {
    color: #fff;
    border-left: 3px solid var(--primary-gold);
    padding-left: 12px;
    margin-bottom: 12px;
    font-size: 1.3rem;
    background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.1), transparent);
    padding-top: 4px;
    padding-bottom: 4px;
    border-radius: 0 8px 8px 0;
}

.key-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.key-row:last-child {
    border-bottom: none;
}

.kbd {
    display: inline-block;
    padding: 3px 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--primary-gold);
    background: #252525;
    border: 1px solid #444;
    border-bottom: 2px solid #111;
    border-radius: 5px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    min-width: 20px;
    text-align: center;
}

.cmd-box {
    background: #151515;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 15px;
}

.cmd-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #333;
}

.cmd-code {
    color: #ffdb75; /* ปรับ code เป็นสีทองอ่อนๆ */
    font-family: 'Courier New', monospace;
    font-weight: bold;
    background: rgba(212, 175, 55, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 0.9rem;
}

/* --- Music Player --- */
#music-box {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid var(--primary-gold);
    border-radius: 15px;
    padding: 15px;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

#music-box.collapsed {
    width: 50px;
    height: 50px;
    padding: 0;
    border-radius: 50%;
    border-color: var(--primary-gold);
    cursor: pointer;
}

.player-toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-gold);
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 10;
    transition: 0.3s;
}

#music-box:not(.collapsed) .player-toggle {
    width: 30px;
    height: 30px;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    font-size: 0.8rem;
}

.player-toggle:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--primary-gold);
}

.player-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 1;
    transition: 0.3s;
    margin-top: 5px;
}

.collapsed .player-inner {
    opacity: 0;
    pointer-events: none;
}

.disc-icon {
    font-size: 2.5rem;
    color: var(--primary-gold);
    margin-bottom: 8px;
    filter: drop-shadow(0 0 8px rgba(var(--primary-rgb), 0.5));
    animation: spin 4s linear infinite;
    animation-play-state: paused;
}

.playing .disc-icon {
    animation-play-state: running;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.song-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 85%;
}

#track-list {
    width: 100%;
    background: #2a2a2a;
    color: var(--primary-gold);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
    padding: 6px;
    border-radius: 6px;
    font-family: 'Kanit';
    font-size: 0.85rem;
    margin-bottom: 12px;
    cursor: pointer;
    outline: none;
}

#track-list option {
    background: #121212;
    color: #fff;
}

.progress-area {
    width: 100%;
    margin-bottom: 10px;
}

.time-box {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #888;
    margin-top: 4px;
    font-weight: 500;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
}

input[type=range]:focus {
    outline: none;
}

#seek-slider {
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
}

#seek-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 10px;
    width: 10px;
    border-radius: 50%;
    background: var(--primary-gold);
    margin-top: -3.5px;
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.8);
    transition: 0.2s;
}

#seek-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 3px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

#seek-slider:hover::-webkit-slider-thumb {
    transform: scale(1.2);
}

.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.play-btn {
    width: 38px;
    height: 38px;
    background: var(--primary-gold);
    border: none;
    border-radius: 50%;
    color: #000;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.6);
}

.play-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

.volume-box {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.volume-box i {
    font-size: 0.8rem;
    color: #888;
    width: 12px;
}

#vol-slider {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

#vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 8px;
    width: 8px;
    border-radius: 50%;
    background: #fff;
    margin-top: -2.5px;
    cursor: pointer;
}

/* --- Footer Design --- */
footer {
    flex-shrink: 0;
    margin-top: auto;
    background: linear-gradient(to top, #000000, #0a0a0a);
    border-top: 1px solid rgba(var(--primary-rgb), 0.3);
    padding: 20px 0;
    text-align: center;
    position: relative;
    box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.8);
}

.footer-content {
    font-family: 'Kanit', sans-serif;
    color: #555;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.footer-content strong {
    color: var(--primary-gold);
    font-weight: 600;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(var(--primary-rgb), 0.3);
}

.footer-icon {
    color: var(--primary-gold);
    margin: 0 8px;
    font-size: 0.7rem;
    opacity: 0.5;
}

@media (max-width: 900px) {
    .history-grid {
        grid-template-columns: 1fr;
    }
    .grid {
        grid-template-columns: 1fr !important;
    }
}

/* --- Update Log Timeline --- */
.update-log {
    position: relative;
    border-left: 2px solid rgba(var(--primary-rgb), 0.3);
    margin-left: 8px;
    padding-left: 25px;
    margin-top: 15px;
}

.log-item {
    position: relative;
    margin-bottom: 25px;
}

.log-item:last-child {
    margin-bottom: 0;
}

.log-item::before {
    content: '';
    position: absolute;
    left: -32px;
    top: 5px;
    width: 8px;
    height: 8px;
    background: var(--dark-bg);
    border: 2px solid var(--primary-gold);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.6);
    z-index: 1;
}

.log-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 5px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.log-date i {
    color: var(--primary-gold);
    font-size: 0.8rem;
}

.log-time {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-gold);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.log-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    font-size: 1rem;
    color: #e0e0e0;
    line-height: 1.4;
}

.status-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    text-transform: uppercase;
}

/* ปรับสีสถานะต่างๆ ให้เข้ากับธีมทอง-ดำ */
.status-active {
    background: rgba(212, 175, 55, 0.15);
    color: #ffdb75;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.status-soon {
    background: rgba(184, 134, 11, 0.15);
    color: #d4af37;
    border: 1px solid rgba(184, 134, 11, 0.3);
}

.status-fix {
    background: rgba(100, 100, 100, 0.15);
    color: #aaa;
    border: 1px solid #444;
}

/* --- Dropdown Menu --- */
.nav-item.dropdown {
    position: relative;
    overflow: visible;
    padding-right: 20px;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--nav-bg);
    min-width: 220px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.8);
    border: 1px solid var(--primary-gold);
    border-radius: 0 0 8px 8px;
    z-index: 2000;
    flex-direction: column;
}

.nav-item.dropdown:hover .dropdown-content {
    display: flex;
    animation: fadeInDrop 0.3s ease;
}

.dropdown-content a {
    color: #ccc;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.95rem;
    transition: 0.2s;
    text-align: left;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: rgba(var(--primary-rgb), 0.15);
    color: var(--primary-gold);
    padding-left: 20px;
}

@keyframes fadeInDrop {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Golden Scrollbar Styling --- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0f0f0f;
    border-left: 1px solid rgba(var(--primary-rgb), 0.1);
}

::-webkit-scrollbar-thumb {
    /* ไล่สีทอง เข้ม-สว่าง-เข้ม แบบทองแท่ง */
    background: linear-gradient(180deg, #8a7224, #d4af37, #8a7224);
    border-radius: 10px;
    border: 2px solid #0f0f0f;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #d4af37, #ffe680, #d4af37);
    border: 1px solid #0f0f0f;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

::-webkit-scrollbar-corner {
    background: #0f0f0f;
}

html {
    scrollbar-width: thin;
    scrollbar-color: #d4af37 #0f0f0f;
}

/* --- Nested Dropdown Fix --- */
#more-menu-content .dropdown {
    position: relative;
}

#more-menu-content .dropdown .dropdown-content {
    position: absolute;
    right: 100%;
    top: 0;
    left: auto;
    width: 200px;
    margin-right: 2px;
    background-color: rgba(20, 20, 20, 0.95);
    box-shadow: -5px 5px 15px rgba(0,0,0,0.5);
    display: none;
    border-color: var(--primary-gold);
}

#more-menu-content .dropdown:hover > .dropdown-content {
    display: block;
}

/* --- Landing Upgrade --- */
.landing-hero {
    position: relative;
    min-height: 72vh;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 28px;
    border: 1px solid rgba(var(--primary-rgb), 0.35);
    background:
        linear-gradient(115deg, rgba(0,0,0,0.85) 10%, rgba(0,0,0,0.42) 55%, rgba(0,0,0,0.8) 100%),
        radial-gradient(circle at top right, rgba(212,175,55,0.25), transparent 35%),
        url('images/Cowboys race towards mysterious airdrop.png') center/cover no-repeat;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 30px rgba(var(--primary-rgb),0.12);
}

.landing-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.18)),
        radial-gradient(circle at 15% 20%, rgba(255,140,0,0.18), transparent 22%),
        radial-gradient(circle at 80% 15%, rgba(212,175,55,0.16), transparent 26%);
    pointer-events: none;
}

.landing-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(255,220,120,0.55) 0 1px, transparent 1.5px),
        radial-gradient(circle, rgba(255,140,80,0.28) 0 1px, transparent 1.8px);
    background-size: 160px 160px, 220px 220px;
    background-position: 20px 30px, 80px 120px;
    opacity: .55;
    animation: emberFloat 18s linear infinite;
}

@keyframes emberFloat {
    from { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(-8px, -14px, 0); }
    to { transform: translate3d(0, -28px, 0); }
}

.landing-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-height: 72vh;
    padding: 56px;
}

.landing-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(212,175,55,0.14);
    border: 1px solid rgba(212,175,55,0.35);
    color: #f8deb0;
    backdrop-filter: blur(10px);
}

.landing-actions, .form-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.landing-btn {
    border: none;
    outline: none;
    cursor: pointer;
    border-radius: 14px;
    padding: 14px 20px;
    font-family: 'Kanit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    transition: transform .28s cubic-bezier(.2,.8,.2,1), box-shadow .28s ease, background .28s ease, border-color .28s ease;
}

.landing-btn.primary {
    background: linear-gradient(135deg, #d4af37, #f3da7a);
    color: #171717;
    box-shadow: 0 10px 30px rgba(212,175,55,0.28);
}

.landing-btn.secondary {
    background: rgba(255,255,255,0.06);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
}

.landing-btn:hover, .card:hover, .nav-item:hover, .dropdown-content a:hover {
    transform: translateY(-4px) scale(1.01);
}

.nav-item:hover, .dropdown-content a:hover {
    box-shadow: 0 12px 24px rgba(0,0,0,0.22), 0 0 14px rgba(var(--primary-rgb),0.12);
}

.landing-btn:hover {
    box-shadow: 0 18px 42px rgba(0,0,0,0.35), 0 0 18px rgba(var(--primary-rgb),0.22);
}

.card, .nav-item, .dropdown-content a {
    transition: transform .32s cubic-bezier(.2,.8,.2,1), box-shadow .32s ease, border-color .32s ease, background .32s ease;
    will-change: transform;
}

.card:hover {
    border-color: rgba(var(--primary-rgb), 0.28);
    box-shadow: 0 14px 34px rgba(0,0,0,0.55), 0 0 18px rgba(var(--primary-rgb),0.10);
}

.landing-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 860px;
    margin-top: 30px;
}

.landing-stat, .whitelist-card {
    background: rgba(10,10,10,0.64);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 18px;
    backdrop-filter: blur(8px);
}

.landing-stat span {
    display:block;
    color:#c8c8c8;
    font-size:.9rem;
    margin-bottom:6px;
}
.landing-stat strong {
    font-size:1.25rem;
    color:#fff;
}

.whitelist-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr);
    gap: 22px;
}

.whitelist-form .form-grid {
    display:grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-group {
    display:flex;
    flex-direction:column;
    gap:8px;
    margin-bottom: 16px;
}

.form-group label {
    color: #f1d998;
    font-weight: 500;
}

.input-help {
    color: #9f9f9f;
    font-size: .83rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: #0e0e0e;
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    border-radius: 12px;
    padding: 13px 14px;
    font-family: 'Kanit', sans-serif;
    font-size: .98rem;
    transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: rgba(var(--primary-rgb),0.8);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb),0.12);
    transform: translateY(-1px);
    outline: none;
}

.feature-list {
    margin: 0;
    padding-left: 18px;
    color: #ddd;
    line-height: 1.8;
}

.form-message {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    display: none;
}
.form-message.success { display:block; background: rgba(46,204,113,0.1); border:1px solid rgba(46,204,113,0.32); color:#a5efc0; }
.form-message.error { display:block; background: rgba(255,31,31,0.1); border:1px solid rgba(255,31,31,0.28); color:#ffb3b3; }
.latest-applications { display:grid; gap:12px; }
.latest-application-item { padding:12px; border-radius:12px; background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.06); }
.latest-application-item strong { color:#fff; display:block; }
.latest-application-item span { color:#bbb; font-size:.92rem; }

@media (max-width: 980px) {
    .landing-content { padding: 34px 24px; min-height: 68vh; align-items: center; text-align:center; }
    .landing-stats { grid-template-columns: 1fr; max-width: 100%; }
    .whitelist-layout { grid-template-columns: 1fr; }
    .whitelist-form .form-grid { grid-template-columns: 1fr; }
}


.status-badge { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:999px; font-size:.78rem; font-weight:600; letter-spacing:.4px; margin-top:8px; }
.status-badge.pending { background:rgba(212,175,55,0.12); color:#f1d998; border:1px solid rgba(212,175,55,0.26); }
.status-badge.flagged { background:rgba(255,31,31,0.12); color:#ffb3b3; border:1px solid rgba(255,31,31,0.24); }
.duplicate-reason { color:#ffb6b6; font-size:.85rem; margin-top:6px; line-height:1.45; }


/* --- Latest v4 enhancements --- */
.restart-highlight span,
.restart-highlight strong,
.restart-highlight strong * {
    color: #ff4d4d !important;
}

.restart-highlight strong {
    text-shadow: 0 0 18px rgba(255, 77, 77, 0.28);
}

.restart-highlight span i {
    margin-right: 8px;
}

.server-highlight #server-status-players {
    display: inline-block;
    margin-left: 8px;
    color: var(--primary-gold);
}

.blackjob-banner-wrap {
    margin-top: 20px;
    width: 100%;
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid rgba(212,175,55,0.35);
    box-shadow: 0 18px 40px rgba(0,0,0,0.35), 0 0 30px rgba(212,175,55,0.12);
}

.blackjob-banner-wrap img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}


.search-inline-form { display:flex; flex-direction:column; gap:8px; }


/* --- Profile / Discord Login --- */
.profile-layout {
    display: grid;
    gap: 20px;
}

.profile-hero-card {
    border: 1px solid rgba(var(--primary-rgb), 0.28);
    background:
        radial-gradient(circle at top right, rgba(88, 101, 242, 0.14), transparent 32%),
        linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)),
        var(--card-bg);
}

.profile-hero-top {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 22px;
    align-items: center;
}

.profile-avatar-wrap {
    position: relative;
    width: 108px;
    height: 108px;
}

.profile-avatar {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-gold);
    box-shadow: 0 0 24px rgba(var(--primary-rgb), 0.22);
}

.profile-status-dot {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2ecc71;
    border: 3px solid #121212;
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.45);
}

.profile-label {
    color: #9c9c9c;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    font-size: 0.82rem;
}

.profile-meta h2 {
    margin: 6px 0 4px;
    font-size: 2rem;
    color: #fff;
}

.profile-meta p {
    margin: 0 0 14px;
    color: #c6c6c6;
}

.profile-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}

.discord-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #5865F2, #404EED);
    color: #fff;
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
    min-width: 220px;
    font-family: 'Kanit', sans-serif;
}

.discord-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(88, 101, 242, 0.35);
    filter: brightness(1.03);
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 20px;
}

.profile-info-list {
    display: grid;
    gap: 12px;
}

.profile-info-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
}

.profile-info-row span {
    color: #afafaf;
    font-size: 0.92rem;
}

.profile-info-row strong {
    color: #fff;
    text-align: right;
}

.profile-flow {
    display: grid;
    gap: 12px;
}

.flow-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(var(--primary-rgb), 0.18);
}

.flow-step span {
    display: inline-flex;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb), 0.18);
    color: var(--primary-gold);
    font-weight: 700;
}

.form-message.info {
    border: 1px solid rgba(88, 101, 242, 0.35);
    background: rgba(88, 101, 242, 0.08);
    color: #d9ddff;
}

@media (max-width: 900px) {
    .profile-hero-top {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .profile-actions {
        width: 100%;
    }

    .discord-login-btn {
        width: 100%;
    }
}


/* ===== Whitelist Pro Redesign ===== */
.home-auth-panel { display: none !important; }

.whitelist-page {
  padding: 32px 24px 70px;
  background:
    radial-gradient(circle at top, rgba(212,175,55,0.08), transparent 30%),
    #050505;
  color: #fff;
}

.whitelist-hero {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  border-radius: 28px;
  margin-bottom: 26px;
  background:
    linear-gradient(90deg, rgba(0,0,0,.78), rgba(0,0,0,.45)),
    url("images/banners/black_trader.jpg") center/cover no-repeat;
  border: 1px solid rgba(212,175,55,0.16);
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
}

.whitelist-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(212,175,55,0.06), transparent 35%);
}

.whitelist-hero-content {
  position: relative;
  z-index: 2;
  max-width: 860px;
  padding: 42px 36px;
}

.whitelist-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  margin-bottom: 20px;
  font-weight: 700;
  color: #f7de7c;
  background: rgba(212,175,55,0.12);
  border: 1px solid rgba(212,175,55,0.2);
}

.whitelist-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 58px);
  color: #d4af37;
  line-height: 1.02;
}

.whitelist-hero p {
  margin: 0 0 24px;
  max-width: 760px;
  font-size: 18px;
  line-height: 1.65;
  color: rgba(255,255,255,0.92);
}

.whitelist-hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.wl-btn {
  border: none;
  cursor: pointer;
  border-radius: 16px;
  padding: 14px 22px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform .22s ease, box-shadow .22s ease, opacity .22s ease;
}

.wl-btn:hover {
  transform: translateY(-2px);
}

.wl-btn-primary {
  color: #1b1408;
  background: linear-gradient(180deg, #f7dd71 0%, #d4af37 100%);
  box-shadow: 0 14px 34px rgba(212,175,55,.22);
}

.wl-btn-secondary {
  color: #fff;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}

.whitelist-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.wl-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.wl-step span {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  background: rgba(255,255,255,0.08);
}

.wl-step.active {
  border-color: rgba(212,175,55,0.25);
  background: rgba(212,175,55,0.06);
}

.wl-step.active span {
  background: #d4af37;
  color: #18120a;
}

.wl-step strong {
  display: block;
  font-size: 15px;
}

.wl-step small {
  color: rgba(255,255,255,0.68);
}

.whitelist-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(300px, .9fr);
  gap: 24px;
}

.wl-main-card,
.wl-side-card {
  background: rgba(8,8,8,0.84);
  border-radius: 24px;
  border: 1px solid rgba(212,175,55,0.12);
  box-shadow: 0 16px 44px rgba(0,0,0,0.3);
  backdrop-filter: blur(10px);
}

.wl-main-card {
  padding: 28px;
}

.wl-card-header {
  margin-bottom: 24px;
}

.wl-card-header h2 {
  margin: 0 0 8px;
  color: #d4af37;
  font-size: 28px;
}

.wl-card-header p {
  margin: 0;
  color: rgba(255,255,255,0.72);
}

.wl-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.wl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.wl-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wl-group label {
  font-weight: 700;
  color: #f1d36b;
}

.wl-group input,
.wl-group select,
.wl-group textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  color: #fff;
  padding: 14px 15px;
  font-size: 15px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.wl-group input:focus,
.wl-group select:focus,
.wl-group textarea:focus {
  border-color: rgba(212,175,55,0.5);
  box-shadow: 0 0 0 4px rgba(212,175,55,0.08);
  transform: translateY(-1px);
}

.wl-checkbox {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  color: rgba(255,255,255,0.84);
}

.wl-checkbox input {
  margin-top: 4px;
}

.wl-submit-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.wl-submit-btn {
  min-width: 190px;
}

.wl-status-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,80,80,0.08);
  border: 1px solid rgba(255,80,80,0.16);
  color: #ffb4b4;
  font-size: 14px;
}

.wl-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff4040;
  box-shadow: 0 0 12px rgba(255,64,64,0.7);
}

.wl-side-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.wl-side-card {
  padding: 22px;
}

.wl-side-card h3 {
  margin: 0 0 14px;
  color: #d4af37;
  font-size: 20px;
}

.wl-side-highlight {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 10px;
  color: #fff;
}

.wl-side-highlight.online {
  color: #56ff9c;
}

.wl-side-card p,
.wl-side-card li {
  color: rgba(255,255,255,0.76);
  line-height: 1.6;
}

.wl-side-card ul {
  margin: 0;
  padding-left: 18px;
}

.wl-full-btn {
  width: 100%;
  justify-content: center;
  margin-top: 12px;
}

@media (max-width: 1100px) {
  .whitelist-layout {
    grid-template-columns: 1fr;
  }

  .whitelist-steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .whitelist-page {
    padding: 22px 16px 50px;
  }

  .wl-grid {
    grid-template-columns: 1fr;
  }

  .whitelist-steps {
    grid-template-columns: 1fr;
  }

  .whitelist-hero-content {
    padding: 30px 20px;
  }

  .wl-main-card,
  .wl-side-card {
    border-radius: 20px;
  }
}

/* ===== Frontier Rulebook Visual System ===== */
:root {
    --dark-bg: #070605;
    --card-bg: #12100d;
    --nav-bg: rgba(8, 7, 6, 0.96);
    --primary-gold: #D4AF37;
    --primary-rgb: 212, 175, 55;
    --frontier-rust: #9b4d25;
    --frontier-teal: #2f8f89;
    --frontier-paper: #e4c883;
    --panel-line: rgba(228, 200, 131, 0.16);
    --panel-glass: rgba(18, 15, 11, 0.84);
}

body {
    background:
        linear-gradient(180deg, rgba(7, 6, 5, 0.78), rgba(7, 6, 5, 0.96) 54%, #050403 100%),
        url("onesync/newaustin.png") center top / cover fixed no-repeat;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        repeating-linear-gradient(0deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 4px),
        linear-gradient(90deg, rgba(155,77,37,0.10), transparent 18%, transparent 82%, rgba(47,143,137,0.08));
    opacity: 0.85;
}

.navbar {
    height: 54px;
    min-height: 54px;
    max-height: 54px;
    padding: 0 14px;
    background:
        linear-gradient(180deg, rgba(18,15,11,0.98), rgba(8,7,6,0.98)),
        var(--nav-bg);
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.58);
    box-shadow: 0 10px 28px rgba(0,0,0,0.45);
    backdrop-filter: blur(12px);
}

.nav-menu {
    gap: 6px;
}

.nav-item {
    height: 34px;
    padding: 5px 11px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #c8c2b6;
    background: transparent;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(var(--primary-rgb), 0.13);
    border-color: rgba(var(--primary-rgb), 0.22);
    color: var(--frontier-paper);
    text-shadow: none;
}

.dropdown-content {
    background:
        linear-gradient(180deg, rgba(22,18,13,0.98), rgba(10,8,6,0.98));
    border: 1px solid rgba(var(--primary-rgb), 0.34);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 18px 36px rgba(0,0,0,0.55);
}

.dropdown-content a {
    color: #d6d0c5;
}

.container {
    max-width: 1480px;
    margin: 24px auto 34px;
    padding: 0 18px;
}

.landing-hero {
    min-height: 70vh;
    border-radius: 8px;
    border: 1px solid rgba(var(--primary-rgb), 0.36);
    background:
        linear-gradient(90deg, rgba(5,4,3,0.92) 0%, rgba(7,6,5,0.72) 42%, rgba(7,6,5,0.25) 70%, rgba(5,4,3,0.86) 100%),
        url("images/Cowboys race towards mysterious airdrop.png") center / cover no-repeat;
    box-shadow:
        0 24px 54px rgba(0,0,0,0.58),
        inset 0 0 0 1px rgba(255,255,255,0.04);
}

.landing-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 7px;
    background: linear-gradient(90deg, var(--frontier-rust), var(--primary-gold), var(--frontier-teal));
}

.landing-overlay {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.24)),
        repeating-linear-gradient(135deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 15px);
}

.landing-particles {
    opacity: 0.22;
}

.landing-content {
    max-width: 980px;
    min-height: 70vh;
    padding: 58px 60px;
}

.landing-badge {
    border-radius: 6px;
    background: rgba(18,15,11,0.76);
    border-color: rgba(var(--primary-rgb), 0.38);
    color: var(--frontier-paper);
}

#home-title {
    font-size: 4rem;
    line-height: 1;
    text-shadow: 0 5px 24px rgba(0,0,0,0.72);
}

#home-subtitle {
    color: #e5dccb;
    text-shadow: 0 2px 14px rgba(0,0,0,0.72);
}

.landing-actions,
.form-actions {
    gap: 10px;
}

.landing-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 6px;
    padding: 12px 17px;
    border: 1px solid rgba(255,255,255,0.10);
}

.landing-btn.primary {
    background: linear-gradient(180deg, #f2d878, #d4af37);
    color: #18110a;
}

.landing-btn.secondary {
    background: rgba(18,15,11,0.72);
    border-color: rgba(var(--primary-rgb), 0.28);
    color: #fff2ca;
}

.landing-btn.ghost {
    background: rgba(47,143,137,0.16);
    border-color: rgba(47,143,137,0.38);
    color: #d6fffa;
}

.landing-stats {
    gap: 12px;
}

.landing-stat {
    border-radius: 8px;
    background: rgba(10,8,6,0.78);
    border-color: var(--panel-line);
}

.card,
.mini-card,
.history-main-card,
.lore-card,
.rule-card {
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01)),
        var(--panel-glass);
    border-color: var(--panel-line);
    box-shadow: 0 12px 28px rgba(0,0,0,0.38);
}

.card {
    padding: 22px;
}

.card h2,
.rule-header,
.mini-card h3,
.lore-header {
    color: var(--frontier-paper);
    text-shadow: none;
}

.desc-text,
.rule-desc,
.history-desc,
.lore-text {
    color: #d6d0c5;
}

.rule-card:hover,
.card:hover,
.lore-card:hover {
    border-color: rgba(var(--primary-rgb), 0.36);
    box-shadow: 0 18px 36px rgba(0,0,0,0.46), 0 0 0 1px rgba(var(--primary-rgb),0.08);
}

.hero-section {
    padding: 28px 18px;
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(155,77,37,0.12), rgba(212,175,55,0.08), rgba(47,143,137,0.08));
    border: 1px solid rgba(var(--primary-rgb),0.12);
}

@media (max-width: 980px) {
    .landing-hero,
    .landing-content {
        min-height: 64vh;
    }

    .landing-content {
        padding: 38px 24px;
        align-items: flex-start;
        text-align: left;
    }

    #home-title {
        font-size: 3rem;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 12px;
    }

    .landing-actions {
        width: 100%;
    }

    .landing-btn {
        width: 100%;
        justify-content: center;
    }

    #home-title {
        font-size: 2.45rem;
    }
}

/* ===== Frontier Reading Experience ===== */
#server-overview {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
    gap: 14px !important;
}

.card,
.rule-card,
.mini-card,
.history-main-card,
.lore-card {
    position: relative;
    overflow: hidden;
}

.card::before,
.rule-card::before,
.mini-card::before,
.lore-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-top: 1px solid rgba(var(--primary-rgb), 0.18);
    background: linear-gradient(115deg, rgba(255,255,255,0.045), transparent 32%);
}

.card > *,
.rule-card > *,
.mini-card > *,
.lore-card > * {
    position: relative;
    z-index: 1;
}

h2 {
    font-size: 1.15rem;
    letter-spacing: 0;
    border-bottom-color: rgba(var(--primary-rgb), 0.20);
}

.rules-grid {
    gap: 16px;
}

.rule-card {
    border-left: 3px solid rgba(var(--primary-rgb), 0.58);
}

.rule-body {
    padding: 18px;
}

.rule-header {
    font-size: 1.12rem;
    line-height: 1.35;
}

.rule-list-title {
    color: #efe0b6;
}

.rule-sub-list {
    display: grid;
    gap: 7px;
}

.rule-sub-list li {
    color: #d4cfc3;
    line-height: 1.58;
}

.penalty-footer {
    background:
        linear-gradient(90deg, rgba(155,77,37,0.20), rgba(212,175,55,0.08));
    border-top: 1px solid rgba(var(--primary-rgb), 0.18);
    padding: 14px 18px;
}

.penalty-label {
    color: #f1ce66;
}

.penalty-text {
    color: #dfd4bf;
}

.history-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.65fr);
    gap: 20px;
}

.history-main-card {
    padding: 26px;
}

.timeline-item {
    padding-left: 46px;
    margin-bottom: 32px;
}

.timeline-item::before {
    left: 17px;
    background: linear-gradient(180deg, rgba(var(--primary-rgb),0.45), rgba(47,143,137,0.22));
}

.timeline-item::after {
    background: #120f0b;
}

.history-sub-title {
    color: var(--frontier-paper);
    line-height: 1.35;
}

.era-tag,
.badge-gold {
    border-radius: 5px;
    background: rgba(var(--primary-rgb), 0.11);
    color: var(--frontier-paper);
}

.bloodline-box {
    background: rgba(255,255,255,0.035);
    border-left-color: var(--frontier-teal);
    border-radius: 6px;
}

.bloodline-item b {
    color: #d9c074;
}

.side-stack {
    gap: 16px;
}

.vertical-timeline {
    display: grid;
    gap: 10px;
}

.v-item {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.055);
    border-radius: 6px;
    padding: 11px 12px;
}

.role-img-wrapper {
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.38);
}

.role-specs {
    border-top-color: rgba(var(--primary-rgb), 0.14);
}

.spec-tag,
.cmd-code {
    border-radius: 5px;
}

#music-box {
    border-radius: 8px;
    border-color: rgba(var(--primary-rgb), 0.34);
    background:
        linear-gradient(180deg, rgba(20,17,13,0.96), rgba(8,7,6,0.96));
    box-shadow: 0 18px 42px rgba(0,0,0,0.45);
}

#music-box.collapsed {
    border-radius: 8px;
}

.play-btn {
    border-radius: 8px;
}

footer {
    background:
        linear-gradient(180deg, rgba(10,8,6,0.96), #050403);
    border-top-color: rgba(var(--primary-rgb), 0.22);
}

.footer-content {
    color: #918878;
}

@media (max-width: 900px) {
    .history-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .rules-grid {
        grid-template-columns: 1fr !important;
    }

    .penalty-footer {
        flex-direction: column;
    }

    .landing-stat {
        padding: 14px;
    }
}

/* ===== Homepage Hero Redesign ===== */
.landing-hero {
    min-height: min(720px, calc(100vh - 92px));
    border-radius: 10px;
    background:
        linear-gradient(90deg, rgba(6,5,4,0.98) 0%, rgba(7,6,5,0.94) 29%, rgba(8,7,6,0.62) 53%, rgba(8,7,6,0.20) 72%, rgba(5,4,3,0.72) 100%),
        radial-gradient(circle at 82% 20%, rgba(228,200,131,0.16), transparent 28%),
        url("images/Cowboys race towards mysterious airdrop.png") 62% center / cover no-repeat;
}

.landing-hero::before {
    content: "";
    position: absolute;
    inset: 18px;
    border: 1px solid rgba(var(--primary-rgb), 0.18);
    border-radius: 8px;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.34);
    z-index: 2;
}

.landing-hero::after {
    height: 4px;
    left: 18px;
    right: 18px;
    bottom: 18px;
    border-radius: 99px;
    background: linear-gradient(90deg, transparent, var(--frontier-rust), var(--primary-gold), var(--frontier-teal), transparent);
    z-index: 2;
}

.landing-overlay {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.05), rgba(0,0,0,0.28)),
        radial-gradient(circle at 28% 56%, rgba(155,77,37,0.18), transparent 30%),
        linear-gradient(110deg, rgba(0,0,0,0.34) 0%, transparent 46%, rgba(0,0,0,0.42) 100%);
}

.landing-content {
    width: min(760px, 56%);
    max-width: none;
    min-height: min(720px, calc(100vh - 92px));
    padding: 68px 64px 74px;
    justify-content: center;
    isolation: isolate;
    box-sizing: border-box;
    min-width: 0;
}

.landing-content::before {
    content: "";
    position: absolute;
    inset: 36px 0 36px 36px;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(18,15,11,0.62), rgba(8,7,6,0.42)),
        linear-gradient(90deg, rgba(212,175,55,0.10), transparent 72%);
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    box-shadow: 0 24px 50px rgba(0,0,0,0.34);
    z-index: -1;
}

.landing-badge {
    padding: 9px 13px;
    border-radius: 7px;
    font-size: 0.86rem;
    font-weight: 600;
    background: rgba(228,200,131,0.12);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.035);
    max-width: 100%;
    white-space: normal;
}

#home-title {
    margin-top: 20px !important;
    font-size: clamp(3.1rem, 5.6vw, 5.6rem);
    color: #e0bd42 !important;
}

#home-title::after {
    content: "";
    display: block;
    width: 86px;
    height: 3px;
    margin-top: 18px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary-gold), var(--frontier-rust));
}

#home-subtitle {
    display: block !important;
    align-self: stretch;
    width: min(100%, 720px) !important;
    max-width: 720px !important;
    margin-top: 24px !important;
    font-size: 1.05rem !important;
    line-height: 1.9;
    color: #f0e7d7;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    line-break: anywhere;
    white-space: normal !important;
}

.landing-actions {
    margin-top: 30px;
    align-self: stretch;
    width: 100%;
    max-width: 720px;
}

.landing-btn.secondary {
    min-width: 142px;
    min-height: 48px;
    border-radius: 7px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03)),
        rgba(18,15,11,0.80);
    border-color: rgba(var(--primary-rgb), 0.24);
    box-shadow: 0 12px 28px rgba(0,0,0,0.26);
    box-sizing: border-box;
}

.landing-stats {
    align-self: stretch;
    width: 100%;
    max-width: 860px;
    margin-top: 30px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.landing-stat {
    min-height: 86px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.012)),
        rgba(10,8,6,0.76);
    border: 1px solid rgba(228,200,131,0.13);
    box-shadow: 0 16px 28px rgba(0,0,0,0.30);
}

.landing-stat span {
    color: #cfc4ad;
}

.landing-stat strong {
    font-size: 1.16rem;
    line-height: 1.2;
}

.restart-highlight {
    border-color: rgba(255,80,80,0.20);
    background:
        linear-gradient(180deg, rgba(120,28,20,0.22), rgba(10,8,6,0.76));
}

.server-highlight {
    border-color: rgba(47,143,137,0.28);
    background:
        linear-gradient(180deg, rgba(47,143,137,0.13), rgba(10,8,6,0.76));
}

.server-updated-label {
    margin-top: 5px;
    color: rgba(255,255,255,0.46);
}

@media (max-width: 1100px) {
    .landing-content {
        width: 68%;
        padding: 54px 44px 64px;
    }

    .landing-content::before {
        inset: 28px 0 28px 24px;
    }
}

@media (max-width: 860px) {
    .landing-hero {
        min-height: auto;
        background:
            linear-gradient(180deg, rgba(5,4,3,0.88), rgba(5,4,3,0.70)),
            url("images/Cowboys race towards mysterious airdrop.png") center / cover no-repeat;
    }

    .landing-content {
        width: auto;
        min-height: auto;
        padding: 44px 28px 58px;
    }

    .landing-content::before {
        inset: 22px;
    }

    .landing-stats {
        grid-template-columns: 1fr;
        max-width: 100%;
    }
}

@media (max-width: 900px) {
    #home-subtitle,
    .landing-actions,
    .landing-stats {
        width: min(100%, 320px) !important;
        max-width: 320px !important;
        align-self: flex-start;
    }
}

@media (max-width: 460px) {
    .landing-hero {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
    }

    .landing-hero::before {
        inset: 12px;
    }

    .landing-hero::after {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .landing-content {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        padding: 34px 28px 46px;
    }

    .landing-content::before {
        inset: 16px 10px;
    }

    .landing-actions,
    .landing-stats {
        width: calc(100vw - 80px);
        max-width: calc(100vw - 80px);
        align-self: flex-start;
    }

    #home-subtitle {
        width: calc(100vw - 80px) !important;
        max-width: calc(100vw - 80px) !important;
    }

    .landing-btn {
        box-sizing: border-box;
    }

    #home-title {
        font-size: 2.55rem;
    }

    #home-subtitle {
        max-width: 100% !important;
        font-size: 0.98rem !important;
        line-height: 1.8;
    }
}
