:root {
    --bg-color: #0f0f0f;
    --card-bg: #1a1a1a;
    --accent-color: #f39c12;
    --text-color: #e0e0e0;
    --online-color: #2ecc71;
    --offline-color: #e74c3c;
    --muted-gold: #b38b4d;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh; /* Allow it to grow */
    padding: 5px 0; /* Ensure 5px gap from top and bottom edges */
    box-sizing: border-box;
    overflow-y: auto; /* Enable scrolling if screen is too small */
}

/* Background Glow Effect */
body::before {
    content: "";
    position: fixed;
    width: 300px;
    height: 300px;
    background: var(--accent-color);
    filter: blur(150px);
    opacity: 0.1;
    z-index: -1;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.container {
    background: var(--card-bg);
    padding: 20px 50px 30px 50px; 
    border-radius: 15px;
    border: 1px solid #333;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
    text-align: center;
    width: 600px; 
    min-height: 680px; /* UNIVERSAL DESKTOP HEIGHT */
    max-width: 90%;
    position: relative;
    margin: auto; /* Prevents top cut-off on small screens */
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.status-container, .btn-group, form {
    width: 100%; /* Prevent shrinking */
}

.container::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('img/l2-logo.jpg') no-repeat center center;
    background-size: cover;
    opacity: 0.25;
    z-index: 0;
    pointer-events: none;
}

/* Ensure content stays above the background */
.container > * {
    position: relative;
    z-index: 1;
}

h1 {
    color: var(--accent-color);
    font-size: 2.5em;
    letter-spacing: 5px;
    margin: 0 0 10px 0;
    text-transform: uppercase;
}

.subtitle {
    color: var(--muted-gold);
    margin-bottom: 20px; 
    font-size: 0.85em;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.4); /* Slightly darker subtle background */
    padding: 15px 20px;
    border-radius: 8px; /* Rounded corners matching other elements */
    border: 1px solid #333; /* Barely visible border */
    width: 100%;
}

.news-wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

.news-container {
    flex-grow: 1;
    max-height: 125px; 
    overflow-y: auto;
    padding-right: 10px;
    /* Hide native scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

.news-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.news-controls {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 20px;
    padding: 5px 0;
}

.scroll-btn {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s, transform 0.1s;
}

.scroll-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

.scroll-btn:active {
    transform: scale(0.9);
}

.scroll-btn.up {
    border-bottom: 10px solid var(--muted-gold);
}

.scroll-btn.down {
    border-top: 10px solid var(--muted-gold);
}

.log-entry {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
}

.log-date {
    color: var(--accent-color);
    font-family: monospace;
    white-space: nowrap;
    opacity: 0.8;
}

.status-container {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px; 
}

.status-box {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #333;
    width: 40%;
}

.status-label {
    display: block;
    font-size: 0.75em;
    color: var(--muted-gold);
    text-transform: uppercase;
    margin-bottom: 8px;
    opacity: 0.8;
}

.status-value {
    font-weight: bold;
    font-size: 1.1em;
}

.online { color: var(--online-color); text-shadow: 0 0 10px rgba(46, 204, 113, 0.4); }
.offline { color: var(--offline-color); text-shadow: 0 0 10px rgba(231, 76, 60, 0.4); }

/* Registration Form Styles */
.form-group {
    margin-bottom: 15px;
    text-align: left;
    width: 100%;
}

input {
    width: 100%;
    padding: 12px 15px;
    background: #111;
    border: 1px solid #444;
    color: #fff;
    border-radius: 5px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.3s;
}

input:focus {
    border-color: var(--accent-color);
}

.message {
    margin-top: 20px;
    font-size: 0.9em;
    padding: 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
    box-sizing: border-box;
}

.error { color: var(--offline-color); background: rgba(231, 76, 60, 0.1); border: 1px solid rgba(231, 76, 60, 0.2); }
.success { color: var(--online-color); background: rgba(46, 204, 113, 0.1); border: 1px solid rgba(46, 204, 113, 0.2); }

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.btn {
    display: block;
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 12px;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
    text-transform: uppercase;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    box-sizing: border-box;
}

.btn:hover {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 15px var(--accent-color);
}

.back-link {
    display: inline-block;
    color: var(--accent-color); /* Brighter color */
    text-decoration: none;
    font-size: 0.9em; /* Larger font */
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.9;
    font-weight: bold;
    transition: all 0.3s;
}

.back-link:hover {
    opacity: 1;
}

.footer {
    margin-top: auto; /* Universal push to bottom */
    padding-top: 10px;
    font-size: 0.7em;
    color: var(--muted-gold);
    opacity: 0.6;
    letter-spacing: 1px;
    text-transform: uppercase;
    width: 100%;
}

.ip-badge {
    display: inline-block;
    margin-top: 12px;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #333;
    border-radius: 4px;
    color: var(--muted-gold);
}

.ip-badge span {
    color: var(--muted-gold);
    font-weight: bold;
}

/* Mobile Styles */
@media (max-width: 650px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto; /* Enable scrolling on mobile */
        padding: 10px 0;
        align-items: flex-start; /* Align to top for scrolling */
    }

    .container {
        width: 95%;
        padding: 25px 15px 40px 15px;
        min-height: 780px !important; /* UNIVERSAL MOBILE HEIGHT */
        margin: 10px auto;
        top: 0; /* Reset desktop offset */
    }

    h1 {
        font-size: 1.6em;
        letter-spacing: 2px;
        margin-bottom: 15px;
    }

    .subtitle {
        font-size: 0.7em;
        width: 100%;
        margin-bottom: 25px;
    }

    .news-container {
        max-height: 100px; 
    }

    .log-entry {
        flex-direction: column;
        gap: 4px;
        margin-bottom: 12px;
        align-items: flex-start;
    }

    .status-container {
        flex-direction: column;
        gap: 12px;
        align-items: center;
        margin-bottom: 30px;
    }

    .status-box {
        width: 90%;
        max-width: 300px;
        padding: 12px;
    }

    .btn-group {
        gap: 10px;
    }

    .btn {
        padding: 16px;
        font-size: 0.8em;
    }

    input {
        padding: 14px;
        font-size: 16px; /* Prevents iOS auto-zoom on focus */
    }

    .footer {
        margin-top: auto;
    }

    .ip-badge {
        padding: 6px 15px;
    }
}