:root {
    --bg-color: #1a1b1e;
    --panel-bg: rgba(26, 27, 30, 0.85);
    --border-color: rgba(255, 255, 255, 0.05);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #f59e0b;
    /* Orange */
    --primary-hover: #d97706;
    --danger: #ef4444;
    --success: #10b981;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-color);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* Legacy body::before removed because it blocked the dynamic JS overlay */

.main-container {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
}

/* Header Section */
.server-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.server-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--icon-radius, 50%);
    opacity: var(--icon-opacity, 1);
    object-fit: cover;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.header-text h1 {
    font-size: 1.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-text h1 span {
    color: #fca5a5;
    /* Soft reddish for subtitle bracket */
}

.header-text p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Grid Layout */
.layout-grid {
    display: grid;
    grid-template-columns: minmax(300px, 1.6fr) minmax(250px, 1fr);
    /* Increased left ratio */
    gap: 1.5rem;
}

@media (max-width: 800px) {
    .layout-grid {
        grid-template-columns: 1fr;
    }
}

/* Panel Styles */
.panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    position: relative;
}

.panel-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.status-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.status-info span {
    color: var(--text-muted);
}

.status-val.danger {
    color: var(--danger);
}

.status-val.success {
    color: var(--success);
}

.status-val.primary {
    color: var(--primary);
}

.ip-actions {
    text-align: right;
}

.ip-text {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.ip-address {
    color: var(--ip-color);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.check-status-btn-edge {
    margin-right: -1rem;
}

.btn {
    background: transparent;
    border: 1px solid var(--btn-outline-color);
    color: var(--btn-outline-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn.filled {
    background: var(--btn-bg-color);
    border-color: var(--btn-bg-color);
    color: #000;
}

.btn:hover {
    filter: brightness(1.2);
    color: #000;
    background: var(--btn-outline-color);
}

.btn.filled:hover {
    color: #000;
    background: var(--btn-bg-color);
}

/* Left Column Internal Grid */
.info-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.info-grid .info-section {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.info-section h3 {
    font-size: 0.85rem;
    color: var(--text-main);
    text-transform: uppercase;
    margin-bottom: 1rem;
    font-weight: 700;
}

.info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-list li,
.info-list a {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: none;
}

.info-list a.orange {
    color: var(--primary);
    font-weight: 600;
}

.info-list a:hover {
    text-decoration: underline;
}

hr.subtle {
    border: none;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    margin: 1.5rem 0;
}

/* Changelog */
.changelog-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.changelog-item {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.changelog-item span {
    color: var(--text-main);
    font-weight: 700;
    margin-right: 0.5rem;
}

/* Right Column */
.stats-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.stat-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-box h4 {
    font-size: 0.8rem;
    color: var(--text-main);
    font-weight: 500;
}

.stat-box .val.danger {
    color: var(--danger);
    font-size: 1.05rem;
    font-weight: 700;
}

.stat-box .val {
    color: var(--text-muted);
    font-size: 1.05rem;
    font-weight: 700;
}

.player-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #000;
}

.player-info h4 {
    color: var(--text-main);
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.player-info p {
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
}

.support-panel {
    margin-top: 1.5rem;
}

.support-panel p {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.support-panel .contact {
    font-weight: 700;
    font-size: 0.95rem;
}

.support-panel .contact.green {
    color: var(--success);
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer a {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    margin-top: 0.5rem;
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--text-main);
}

/* Admin floating button logic remains */
.admin-tools {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
}

.admin-tools .btn-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: all 0.2s;
}

.admin-tools .btn-icon:hover {
    color: var(--text-main);
    transform: scale(1.05);
}

.edit-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
    outline: none;
    min-width: 0;
}

.edit-input:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.edit-textarea {
    width: 100%;
    min-width: 150px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.75rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
    outline: none;
    resize: both !important;
    line-height: 1.5;
    min-height: 100px;
}

.edit-textarea:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.5);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-content {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s;
}

.modal-overlay[style*="opacity: 1"] .modal-content {
    transform: scale(1);
}

.modal-header {
    margin-bottom: 1.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.5rem;
}

.close-btn:hover {
    color: var(--text-main);
}