/* --- GLOBAL STYLES (Applies to all pages) --- */
body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
}

.container { 
    max-width: 900px; 
    margin: auto; 
}

h1 { 
    color: #00adb5; 
    text-align: center; 
    font-size: 2.5rem;
    margin-bottom: 20px;
}

/* Navigation Bar */
nav { 
    text-align: center; 
    margin-bottom: 40px; 
}
nav a { 
    color: #00adb5; 
    text-decoration: none; 
    margin: 0 15px; 
    font-weight: bold; 
}

/* Profile Pictures / Avatars */
.avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid #333;
    background-color: #2a2a2a;
    object-fit: cover;
    vertical-align: middle;
}

/* =========================================
   HOME PAGE & STORY (index.html)
   ========================================= */
.story-header { text-align: center; margin-bottom: 30px; }
.story-blurb { font-style: italic; color: #888; }

.story-content {
    background: #1e1e1e;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #00adb5;
    
    font-size: 18px;            
    line-height: 1.6em; 
    max-height: 60vh;           
    overflow-y: auto;           
    padding-right: 15px;        
    display: flex;
    flex-direction: column-reverse; /* Flips the text order AND anchors the scrollbar to the bottom! */
}

.paragraph-box { margin-bottom: 10px; }

/* Recent Archives on Home Page */
.archives-section { margin-top: 50px; }
.archive-title { font-size: 1.8rem; border-bottom: 1px solid #333; padding-bottom: 10px; }
.archive-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 20px; }
.archive-item { text-decoration: none; color: inherit; }
.archive-card { background: #1e1e1e; padding: 15px; border-radius: 8px; border: 1px solid #333; transition: transform 0.3s, border-color 0.3s; }
.archive-card:hover { border-color: #00adb5; transform: translateY(-3px); }
.archive-name { display: block; font-weight: bold; color: #00adb5; font-size: 1.1rem; }
.archive-setting { display: block; color: #888; font-size: 0.9rem; margin-top: 5px; }
.view-all { text-align: center; margin-top: 20px; }
.view-all a { color: #00adb5; text-decoration: none; font-weight: bold; }


/* =========================================
   LEADERBOARDS (leaderboards.html)
   ========================================= */
.board-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.leaderboard-box { background: #1e1e1e; padding: 20px; border-radius: 8px; border-top: 4px solid #00adb5; }
.full-width { grid-column: span 2; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid #333; }
th { color: #00adb5; font-size: 0.9rem; text-transform: uppercase; }
.rank { width: 40px; color: #888; }
.username a { color: #e0e0e0; text-decoration: none; display: flex; align-items: center; }
.username a:hover { color: #00adb5; }
.highlight { color: #ffd700; font-weight: bold; }


/* =========================================
   ARCHIVES (archives.html)
   ========================================= */
.archive-entry { background: #1e1e1e; padding: 15px; border-radius: 8px; margin-bottom: 15px; border-left: 4px solid #444; }
.story-link { color: #00adb5; text-decoration: none; font-weight: bold; font-size: 1.2rem; display: block; margin-bottom: 5px; }
.description { color: #888; font-size: 0.9rem; }
.pagination { text-align: center; margin-top: 30px; }
.pagination a { display: inline-block; padding: 8px 12px; margin: 0 5px; background: #1e1e1e; color: #e0e0e0; text-decoration: none; border-radius: 4px; }
.pagination a.active, .pagination a:hover { background: #00adb5; color: #121212; font-weight: bold; }


/* =========================================
   FAQ & INSTRUCTIONS (faq.html & instructions.html)
   ========================================= */
.faq-item, .command-box { background: #1e1e1e; padding: 20px; border-radius: 8px; margin-bottom: 20px; border-left: 4px solid #00adb5; }
.question { color: #00adb5; font-weight: bold; display: block; font-size: 1.2rem; margin-bottom: 10px; }
.hero-section { text-align: center; margin-bottom: 40px; }
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.rule-card { background: #1e1e1e; padding: 20px; border-radius: 8px; border-top: 4px solid #00adb5; }
.rule-card h4 { margin-top: 0; color: #00adb5; }
.cta-buttons { display: flex; justify-content: center; gap: 20px; margin-top: 40px; }

/* Updated .btn class */
.btn { 
    padding: 12px 24px; 
    border-radius: 25px; 
    text-decoration: none; 
    font-weight: bold; 
    color: white; 
    text-align: center;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.btn-kofi { background-color: #29abe0; color: #fff; }
.btn-kofi:hover { background-color: #1a8fbf; }
.btn-twitch { background-color: #9146FF; color: #ffffff; }
.btn-twitch:hover { background-color: #772ce8; }


/* =========================================
   MEMBERS (members.html)
   ========================================= */
.subtitle { text-align: center; color: #888; margin-bottom: 40px; }
.tier-section { margin-bottom: 40px; }
.tier-header { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; border-bottom: 1px solid #333; padding-bottom: 10px; }
.tier-title { font-size: 1.5rem; font-weight: bold; }
.gold { color: #ffd700; }
.silver { color: #c0c0c0; }
.bronze { color: #cd7f32; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; }
.member-card { background: #1e1e1e; padding: 15px; border-radius: 8px; text-align: center; }
.member-card a { color: #e0e0e0; text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.member-card a:hover { color: #00adb5; }
.empty-msg { color: #666; font-style: italic; }


/* =========================================
   PROFILE (profile.html)
   ========================================= */
.profile-header { text-align: center; margin-bottom: 30px; }
.profile-main-avatar { width: 100px; height: 100px; margin-bottom: 15px; border: 4px solid #00adb5; }
.tier-badge { display: inline-block; padding: 5px 15px; border-radius: 20px; font-weight: bold; font-size: 0.9rem; margin-top: 10px; background: #333;}
.tier-Gold { color: #ffd700; border: 1px solid #ffd700; }
.tier-Silver { color: #c0c0c0; border: 1px solid #c0c0c0; }
.tier-Bronze { color: #cd7f32; border: 1px solid #cd7f32; }
.tier-None { color: #888; }
.bonus-status { color: #4caf50; font-size: 0.9rem; margin-top: 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin: 25px 0; }
.stat-card { background: #1e1e1e; padding: 20px; text-align: center; border-radius: 8px; }
.stat-value { color: #00adb5; font-size: 1.5rem; display: block; font-weight: bold; }
.stat-label { color: #888; font-size: 0.9rem; }
.word-list { background: #1e1e1e; padding: 20px; border-radius: 8px; margin-top: 20px; }
.word-tag { display: inline-block; background: #333; padding: 5px 12px; border-radius: 15px; margin: 5px; color: #00adb5; }


/* =========================================
   ROADMAP (roadmap.html)
   ========================================= */
.roadmap-header { text-align: center; margin-bottom: 40px; }
.roadmap-intro { color: #888; max-width: 600px; margin: 0 auto; }
.feature-card { background: #1e1e1e; padding: 25px; border-radius: 8px; margin-bottom: 25px; border-left: 4px solid #00adb5; }
.feature-title { margin-top: 0; display: flex; justify-content: space-between; align-items: center; color: #00adb5; }
.status-badge { background: #333; color: #ffd700; font-size: 0.8rem; padding: 4px 10px; border-radius: 12px; text-transform: uppercase; font-weight: normal; }
.feature-description { color: #e0e0e0; }


/* =========================================
   MOBILE RESPONSIVE FIXES
   ========================================= */
@media (max-width: 768px) {
    .board-grid {
        /* Changes the layout from 2 columns to 1 column on phones */
        grid-template-columns: 1fr; 
    }
    .full-width {
        /* Ensures the bottom box doesn't try to stretch across 2 columns when there is only 1 */
        grid-column: span 1; 
    }

    /* --- NEW: MOBILE STORY BOX FIX --- */
    .story-content {
        font-size: 16px !important;        /* Shrinks the font slightly for small screens */
        height: 250px !important;          /* Replaces the strict 5-line limit with a taller box */
        justify-content: flex-start !important; /* Anchors text to the top so it doesn't get pushed down */
        overflow-y: auto !important;       /* Ensures you can scroll through it smoothly */
    }
}


/* =========================================
   TERMS PAGE FIX
   ========================================= */

/* This targets the story-content ONLY when it is on the terms page */
.terms-page .story-content {
    height: auto !important;          /* Removes the 5-line height limit */
    overflow: visible !important;      /* Shows all the text */
    display: block !important;         /* Resets the flexbox layout */
    font-size: 1.1rem !important;      /* Makes legal text a readable size */
}

.terms-page .paragraph-box {
    margin-bottom: 25px !important;
    max-width: 100% !important;
}

.terms-page ul {
    margin-bottom: 20px;
    padding-left: 20px;
}


/* --- Global Fix for Terms Page --- */
.terms-page .story-content {
    height: auto !important;           /* Breaks the 5-line limit */
    min-height: 500px;                 /* Gives the legal text room */
    overflow: visible !important;       /* Shows all hidden text */
    display: block !important;          /* Stops the "bottom-up" story logic */
    padding: 30px 20px !important;
}

.terms-page .paragraph-box {
    height: auto !important;           /* Allows boxes to expand with text */
    margin-bottom: 20px !important;
    max-width: 100% !important;
}

/* =========================================
   PLATFORM ICONS
   ========================================= */
.platform-icon {
    font-size: 1.1em;
    margin-right: 5px;
    margin-left: 5px;
    vertical-align: middle;
}

.twitch-icon {
    color: #9146FF;
}

/* =========================================
   CONTACT FORM STYLES
   ========================================= */
.form-container {
    background: #1e1e1e;
    padding: 30px;
    border-radius: 8px;
    border-top: 4px solid #00adb5;
    max-width: 600px;
    margin: 0 auto 40px auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #00adb5;
    font-weight: bold;
    margin-bottom: 8px;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 12px;
    background-color: #121212;
    border: 1px solid #333;
    border-radius: 4px;
    color: #e0e0e0;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box; /* Prevents overflow */
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: #00adb5;
}

.captcha-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.submit-btn {
    width: 100%;
    background-color: #00adb5;
    color: #121212;
    padding: 15px;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 15px;
}

.submit-btn:hover {
    background-color: #008b92;
}

/* Alert Messages (Success/Error) */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: bold;
    text-align: center;
}
.alert.success {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid #4caf50;
}
.alert.error {
    background-color: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid #f44336;
}