/* --- ROYAL ARMIES: MASTER CSS (V18 - DEFINITIVE RECOVERY) --- */

/* 1. GLOBAL DEFAULTS */
body {
    margin: 0; padding: 0;
    background: #1a1a1a url('stonewallbg.png') no-repeat center center fixed;
    background-size: cover;
    color: #f4eee1;
    font-family: 'Quicksand', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

.page-border {
    min-height: 100vh;
    display: flex; flex-direction: column;
    background: rgba(0, 0, 0, 0.55);
}

h1, h2, h3, .side-link, .category-title, .social-trigger, .expand-btn {
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 2. MAIN LAYOUT & FIXED NAVIGATION */
.main-layout { display: block; width: 100%; min-height: 100vh; }

.side-left {
    background: url('sidebarpanel.png') no-repeat left top;
    background-size: 100% 100%;
    padding: 180px 20px 40px 35px;
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; 
    height: 100vh; width: 280px; 
    box-sizing: border-box; z-index: 1000;
    overflow-y: auto; scrollbar-width: none;
}
.side-left::-webkit-scrollbar { display: none; }

.category-outer { margin-bottom: 25px; width: 210px; }
.category-title {
    background: rgba(10, 10, 10, 0.9);
    padding: 5px; font-size: 0.75rem; color: #ffcc33;
    border: 1px solid rgba(212, 175, 55, 0.3);
    text-align: center; margin-bottom: 12px;
}

.side-link, .social-trigger {
    display: flex; align-items: center; justify-content: center;
    width: 210px; height: 50px; margin-bottom: 8px;
    color: #fff !important;
    background: url('sidebartextborder.png') no-repeat center;
    background-size: 100% 100%;
    font-size: 0.85rem; transition: 0.3s ease;
    text-shadow: 2px 2px 4px #000; cursor: pointer; text-decoration: none;
}
.side-link:hover, .side-link.active, .social-trigger:hover {
    filter: brightness(1.3); transform: scale(1.05); color: #ffcc33 !important;
}

/* 3. SOCIAL REVEAL ENGINE */
.social-reveal-wrapper { display: flex; flex-direction: column; width: 210px; }
.social-reveal {
    display: none; flex-direction: column;
    background: rgba(0, 0, 0, 0.4);
    border-left: 2px solid #d4af37;
    margin: -5px 0 10px 0; padding: 5px 0;
}
.sub-link {
    display: block; padding: 8px 0 8px 25px;
    font-size: 0.75rem; color: #ffcc33 !important;
    text-decoration: none; transition: 0.2s;
}
.sub-link:hover { background: rgba(212, 175, 55, 0.1); padding-left: 30px; color: #fff !important; }

/* 4. CONTENT AREA (FIXED CENTERING) */
.content-center {
    margin-left: 280px; 
    width: calc(100% - 280px);
    padding: 40px;
    display: flex; flex-direction: column; align-items: center; 
    box-sizing: border-box; min-width: 0;
}

.main-logo {
    max-width: 750px; width: 100%; height: auto; margin-top: -60px;
    z-index: 10; animation: sway 4s ease-in-out infinite;
}
@keyframes sway { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* 5. COUNTDOWN TIMER */
.timer-section {
    position: relative; margin: -100px auto 40px;
    padding: 25px 50px;
    background: radial-gradient(circle, rgba(40, 30, 10, 0.98) 0%, rgba(10, 10, 10, 1) 100%);
    border: 2px solid #d4af37; width: fit-content;
    z-index: 20; box-shadow: 0 0 30px #000; text-align: center;
}
#countdown { display: flex; gap: 30px; font-size: 2.2rem; font-weight: bold; color: #fff; }
.time-label { font-size: 0.7rem; color: #ffcc33; margin-top: 5px; display: block; }

/* 6. WELCOME & BANNER BOXES (PRECISE PADDING) */
.welcome-box {
    position: relative; width: 100%; max-width: 950px; 
    margin-bottom: 60px;
    background: url('textbox_large.png') no-repeat;
    background-size: 100% 100%; 
    padding: 100px 85px; /* Ensures text stays within parchment borders */
    box-sizing: border-box;
}
.banner-container-box { background-image: url('textbox_xlarge.png') !important; }

.welcome-content {
    background: rgba(0, 0, 0, 0.82); 
    padding: 35px;
    border: 1px solid rgba(255, 204, 51, 0.2); 
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

.welcome-content h2 { 
    display: block !important; color: #ffcc33 !important; 
    text-align: center; font-size: 1.8rem; margin-top: 0; margin-bottom: 30px; 
    text-shadow: 2px 2px 4px #000; 
}
.welcome-content h3 { 
    color: #ffcc33 !important; margin-top: 35px; 
    border-bottom: 1px solid rgba(212, 175, 55, 0.3); padding-bottom: 10px; 
    display: flex; align-items: center; 
}
.list-icon { width: 18px; height: auto; margin-right: 15px; }

/* Banner Tables and Rows */
.banner-row { display: flex; gap: 25px; padding: 25px 0; border-bottom: 1px solid rgba(212, 175, 55, 0.2); align-items: flex-start; }
.banner-row h3 { border: none; margin-top: 0; }
.banner-img { width: 150px; height: auto; flex-shrink: 0; }
.stat-table { width: 100%; border-collapse: collapse; margin-top: 15px; background: rgba(0,0,0,0.3); }
.stat-table td { border: 1px solid rgba(212, 175, 55, 0.2); padding: 10px; font-size: 0.85rem; color: #fff; }

/* 7. ROADMAP ACCORDION ENGINE (DOUBLE EXPAND) */
.accordion-wrapper { display: flex; width: 95%; max-width: 1250px; height: 600px; gap: 15px; margin-top: 20px; }
.accordion-panel { 
    flex: 1; background: rgba(10, 10, 10, 0.7); 
    border: 1px solid rgba(212, 175, 55, 0.3); padding: 20px; 
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1); 
    overflow: hidden; cursor: pointer; display: flex; flex-direction: column; 
}
.accordion-panel.active-panel { flex: 6; background: rgba(0, 0, 0, 0.9); border-color: #d4af37; cursor: default; }

/* Physically remove text in shrunk panels to prevent bleed */
.accordion-panel:not(.active-panel) .roadmap-card .card-details,
.accordion-panel:not(.active-panel) .roadmap-card .expand-btn,
.accordion-panel:not(.active-panel) .roadmap-card h4 { display: none; }

.accordion-panel:not(.active-panel) h3 { 
    font-size: 0.75rem; white-space: nowrap; overflow: hidden; 
    text-overflow: ellipsis; margin-top: 10px; color: #888; 
}

/* NESTED DETAILS STYLING */
.card-details {
    display: none; /* Hidden until script toggles to block */
    padding-top: 15px;
    border-top: 1px solid rgba(212, 175, 55, 0.1);
    margin-top: 10px;
    animation: slideDown 0.3s ease-out;
}
.expand-btn {
    display: inline-block; font-size: 0.65rem; color: #ffcc33;
    cursor: pointer; margin-top: 10px; text-decoration: underline;
}
.expand-btn:hover { color: #fff; }

@keyframes slideDown { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

.roadmap-card { background: rgba(255,255,255,0.03); padding: 15px; margin-bottom: 10px; border-left: 4px solid #888; }
.status-committed { border-left-color: #4caf50; }
.status-progress { border-left-color: #ffcc33; }
.mini-progress { height: 4px; background: #222; margin-top: 10px; width: 100%; }
.mini-progress div { height: 100%; background: #d4af37; }

/* 8. MODAL & AUTH SYSTEM */
.modal { 
    display: none; position: fixed; top: 0; left: 0; 
    width: 100%; height: 100%; background: rgba(0, 0, 0, 0.25); 
    backdrop-filter: blur(8px); z-index: 5000; 
    align-items: center; justify-content: center; 
}
.modal .welcome-box { margin: 0 !important; max-width: 500px; background: none !important; padding: 0 !important; }
.input-group { margin-bottom: 15px; text-align: left; }
.input-group label { display: block; color: #ffcc33; font-size: 0.75rem; margin-bottom: 5px; }
.input-group input { width: 100%; background: rgba(0,0,0,0.5); border: 1px solid #d4af37; color: #fff; padding: 10px; box-sizing: border-box; outline: none; }

/* 9. FOOTER & STATUS */
.status-box { margin-top: auto; background: rgba(0,0,0,0.9); padding: 10px; border: 1px solid #d4af37; text-align: center; color: #ffcc33; font-weight: bold; }
footer { margin-left: 280px; padding: 40px; text-align: center; color: #666; font-size: 0.8rem; }

/* --- FORUM SPECTRUM ENGINE --- */

.forum-container {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    text-align: left;
}

.forum-category-title {
    font-family: 'Cinzel', serif;
    color: #ffcc33;
    font-size: 1.1rem;
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 10px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Individual Channel Row */
.forum-channel-card {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 8px;
    display: flex;
    position: relative;
    transition: 0.2s ease;
    cursor: pointer;
}

.forum-channel-card:hover {
    background: rgba(20, 20, 20, 0.8);
    border-color: rgba(212, 175, 55, 0.3);
}

/* The RSI-style accent border */
.channel-accent {
    width: 4px;
    flex-shrink: 0;
}

.channel-info {
    padding: 20px 25px;
    flex-grow: 1;
}

.channel-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    color: #fff !important;
    border: none !important;
    text-transform: none;
}

.channel-info p {
    margin: 0;
    font-size: 0.85rem;
    color: #888;
}

/* Thread Stats on the Right */
.channel-stats {
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: right;
    min-width: 120px;
}

.stat-num {
    color: #555;
    font-size: 0.8rem;
    font-family: 'Quicksand', sans-serif;
}

/* Tag System */
.tag-container {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.forum-tag {
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.05);
    color: #aaa;
    padding: 3px 10px;
    border-radius: 3px;
    text-transform: uppercase;
    font-family: 'Cinzel', serif;
}

.forum-tag:hover {
    color: #ffcc33;
    background: rgba(212, 175, 55, 0.1);
}