body, html {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background-color: #121212;
    color:#E0E0E0;
}

body {
    overflow-x: hidden;
}

.commlink-page {
    flex: 1; 
    width: 90%; 
    max-width: 800px; 
    font-size: 16px;
    margin: 0 auto;
    overflow-wrap: break-word;
}

a {
    text-decoration: none;
    color: red;
}

a:hover {
    color: #ff6666;
}

#commlink-updated-time {
    font-weight: bold;
    font-size: 18px;
    font-family: monospace;
}

.commlink-item {
    margin-top: 15px;
    margin-bottom: 15px;
    border-bottom: 3px solid #C80000;
}

.commlink-post-thumbnail {
    float: left;
    margin-right: 10px;
}

.commlink-post-thumbnail img {
    max-height: 100px;
    width: auto;
    border: 2px solid #C80000;
}

.commlink-wrapper {
    display: flex;
}

.commlink-post-title {
    font-weight: bold;
    font-size: 18px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.commlink-post-body {
    margin-bottom: 16px;
}

.commlink-post-body p {
    margin-top: 10px;
    margin-bottom: 10px;
}

hr {
    margin-top: 15px;
    border: none; 
    height: 3px; 
    background-color: #C80000; 
}

footer {
    text-align: center;
    color: #E0E0E0;
    font-size: 16px;
    width: 100%;
    padding: 0;
    margin: 0 auto;
    line-height: 1.5;
}

footer a {
    text-decoration: none;
    color: #C80000; 
    vertical-align: middle; 
    font-size: 18px;
}

footer a:visited {
    text-decoration: none;
    color: #C80000; 
}

footer a:hover {
    text-decoration: none;
    color: red; 
}

footer p {
    margin: 2px auto 10px;
}

.nav {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 10px 0;
    background-color: #121212;
    border-bottom: 3px solid #C80000;
    white-space: nowrap;
    margin-bottom: 20px;
}

.nav a {
    color: #E0E0E0 !important;
    font-weight: bold;
    text-decoration: none;
    font-size: 18px;
    height: 24px; 
    display: flex;
    align-items: center; 
    line-height: 1.5;
}

.nav a:hover {
    color: red !important;
}

.banner {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    border-bottom: 3px solid #C80000;
}

.title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: left; 
}

.EAM {
    width: 172px; 
    height: 100px;
    margin-left: 50px;
    margin-right: 50px;
}

.title-text {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.banner h1 {
    font-size: 2.3rem;
    white-space: nowrap; 
    margin: 5px;
}

.disclaimer {
    text-align: center;
}

.disclaimer p {
    margin: 10px auto;
}

.motd-page {
    display: none; 
    width: 90%; 
    height: auto;
    max-width: 800px; 
    font-size: 16px;
    margin: 0 auto;
    overflow-wrap: break-word;
    margin-bottom: 16px;
}

.motd-page.loaded {
    display: block; 
}

.motd-wrapper {
    border: 2px solid #121212;
    outline: 2px solid #C80000;
}

.motd-title {
    padding-top: 3px;
    padding-bottom: 5px;
    text-align: center;
    font-weight: bold;
    font-size: 18px;
    border-bottom: 2px solid #C80000;
    white-space: nowrap;
}

.motd-body {
    max-height: 5000px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}

.motd-body.collapsed {
    max-height: 0;
    opacity: 0;
}

.motd-toggle-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px 0;
    background-color: #121212;
    border-top: 2px solid #C80000;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    color: #E0E0E0;
    font-weight: bold;
    transition: color 0.2s ease, border-top 0.2s ease;
}

.motd-toggle-bar.collapsed {
    border-top: 0;
}

.motd-toggle-bar:hover {
    color: red;
}

.motd-toggle-text {
    letter-spacing: 3px;
}

.motd-item {
    padding: 12px;
    border-bottom: 2px solid #C80000;
}

.motd-item:last-child {
    border-bottom: none;
}

.motd-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 3px;
    gap: 8px;
}

.motd-lobby-name {
    font-weight: bold;
    font-size: 18px;
    white-space: nowrap;
    flex: 1 1 auto;  
    min-width: 0;   
}

.motd-update-time {
    font-size: 14px;
    white-space: nowrap; 
    margin-left: auto;
}

.motd-message {
    color: #E0E0E0;
    line-height: 1.6;
}

.motd-message p {
    margin-top: 5px;
    margin-bottom: 5px;
}

.motd-message a {
    color: red;
    text-decoration: none;
}

.motd-message a:hover {
    color: #ff6666;
}

@media (max-width: 768px) {
    .banner h1 {
        font-size: 2rem;
    }
    .EAM {
        width: 147px; 
        height: 85px;
        margin-left: 30px;
        margin-right: 30px;
    }
}

@media (max-width: 600px) {
    .commlink-wrapper {
        flex-direction: column;
    }
    
    .commlink-post-title {
        font-weight: bold;
        font-size: 16px;
        margin-top: 5px;
        margin-bottom: 0;
    }
    
    .commlink-type {
        display: none;
    }
    
    .commlink-post-time {
        font-size: 14px;
    }
}

@media (max-width: 540px) {
    .banner h1 {
        font-size: 1.5rem;
    }
    .EAM {
        width: 103px; 
        height: 60px;
        margin-left: 10px;
        margin-right: 10px;
    }
}