* { box-sizing: border-box; }
html, body {
    margin: 0;
    height: 100%;
    background: #12151a;
    color: #e8ecf1;
    font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: #6a98d4; }

.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; }

/* ---------- login ---------- */

#loginScreen { align-items: center; justify-content: center; }
.login-card {
    width: 320px;
    padding: 28px;
    background: #171b21;
    border: 1px solid #262c35;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.login-card h1 { font-size: 18px; margin: 0 0 4px; }
.login-card .hint { color: #8b96a5; font-size: 12px; margin: 0 0 16px; }
.login-card label { font-size: 12px; color: #8b96a5; margin-top: 8px; }
.login-card input {
    background: #12151a;
    border: 1px solid #2c333c;
    border-radius: 6px;
    color: #e8ecf1;
    padding: 8px 10px;
    font-size: 14px;
}
.login-card input:focus { outline: none; border-color: #6a98d4; }
.login-card button {
    margin-top: 18px;
    background: #6a98d4;
    border: none;
    border-radius: 6px;
    color: #10131a;
    font-weight: 600;
    padding: 10px;
    cursor: pointer;
}
.login-card button:hover { background: #5a8abf; }
.login-card button:disabled { opacity: 0.6; cursor: default; }
.error { color: #e07a7a; font-size: 12px; min-height: 16px; }

#checkingScreen { align-items: center; justify-content: center; }

/* ---------- panel ---------- */

#panelScreen { width: 100%; }
.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #171b21;
    border-right: 1px solid #262c35;
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
}
.sidebar-title { font-size: 15px; font-weight: 600; padding: 4px 8px 16px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-btn {
    text-align: left;
    background: transparent;
    border: none;
    color: #c3cad4;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}
.nav-btn:hover { background: #1d2228; }
.nav-btn.active { background: #24303f; color: #6a98d4; font-weight: 600; }

.sidebar-footer { border-top: 1px solid #262c35; padding-top: 12px; }
.whoami { font-size: 12px; color: #8b96a5; padding: 0 8px 8px; word-break: break-word; }
.logout-btn {
    width: 100%;
    background: transparent;
    border: 1px solid #2c333c;
    color: #e8ecf1;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
}
.logout-btn:hover { border-color: #6a98d4; color: #6a98d4; }

.content { flex: 1; padding: 24px 32px; overflow-y: auto; }
.content h2 { margin: 0 0 18px; font-size: 18px; }
.tab { display: none; }
.tab.active { display: block; }

.cards { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.card {
    background: #171b21;
    border: 1px solid #262c35;
    border-radius: 10px;
    padding: 18px 20px;
    min-width: 220px;
}
.card h3 { margin: 0 0 12px; font-size: 14px; color: #6a98d4; }
.card .row { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; padding: 3px 0; }
.card .row span:first-child { color: #8b96a5; }

.server-card { width: 340px; cursor: default; }
.server-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin: -4px -4px 12px;
    padding: 4px;
    border-radius: 6px;
}
.server-card-header:hover { background: #1d2228; }
.server-card-header h3 { margin: 0; }
.chevron { color: #8b96a5; font-size: 16px; }

.back-btn {
    background: transparent;
    border: 1px solid #2c333c;
    color: #c3cad4;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 16px;
}
.back-btn:hover { border-color: #6a98d4; color: #6a98d4; }
.detail-card { max-width: 480px; margin-bottom: 24px; }
.detail-card .row { font-size: 14px; padding: 6px 0; }
.detail-subhead { margin: 0 0 12px; font-size: 14px; color: #6a98d4; }
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.badge.on { background: #1e3a2b; color: #6fcf97; }
.badge.off { background: #2b2020; color: #d98080; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #262c35; }
th { color: #8b96a5; font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
tr:hover td { background: #171b21; }
.pill {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}
.pill.admin { background: #33291a; color: #d9a45a; }
.pill.bot { background: #1c2230; color: #7c93c9; }
.pill.dead { background: #2b2020; color: #d98080; }
.pill.registered { background: #1a2e33; color: #6ac2d9; }
.pill.guest { background: #23262c; color: #9aa3af; }

.placeholder-card {
    background: #171b21;
    border: 1px solid #262c35;
    border-radius: 10px;
    padding: 24px;
    max-width: 480px;
    color: #c3cad4;
}
.placeholder-card p { margin: 0 0 8px; }
.placeholder-card .hint { color: #8b96a5; font-size: 12px; }

.empty { color: #8b96a5; font-size: 13px; padding: 8px 0; }

/* ---------- game modes ---------- */

.gamemode-form { max-width: 560px; margin-bottom: 20px; }
.field-row { display: flex; gap: 14px; margin-bottom: 10px; }
.field-row .field { flex: 1; }
.field-row label { display: block; font-size: 12px; color: #8b96a5; margin-bottom: 4px; }
.field-row input[type=text], .field-row input[type=number] {
    width: 100%;
    background: #12151a;
    border: 1px solid #2c333c;
    border-radius: 6px;
    color: #e8ecf1;
    padding: 7px 9px;
    font-size: 13px;
}
.field-row input:focus { outline: none; border-color: #6a98d4; }
.field-row.checkboxes { align-items: center; }
.checkbox-field { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #c3cad4; cursor: pointer; }
.gamemode-form button[type=submit] {
    background: #6a98d4;
    border: none;
    border-radius: 6px;
    color: #10131a;
    font-weight: 600;
    padding: 9px 16px;
    cursor: pointer;
    font-size: 13px;
}
.gamemode-form button[type=submit]:hover { background: #5a8abf; }
.gamemode-card .row span:first-child { color: #8b96a5; }

/* ---------- map gallery ---------- */

.map-gallery { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.map-card {
    width: 200px;
    background: #171b21;
    border: 1px solid #262c35;
    border-radius: 10px;
    overflow: hidden;
}
.map-card .thumb {
    width: 100%;
    aspect-ratio: 1;
    background: #12151a center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #495260;
    font-size: 12px;
}
.map-card .meta { padding: 10px 12px; }
.map-card .meta .name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-card .meta .mode { font-size: 12px; color: #8b96a5; margin-top: 2px; }
.map-card .meta .created { font-size: 11px; color: #6b7480; margin-top: 4px; }
.map-card .meta .delete-btn {
    margin-top: 8px;
    width: 100%;
    background: transparent;
    border: 1px solid #4a2c2c;
    color: #d98080;
    padding: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}
.map-card .meta .delete-btn:hover { background: #2b2020; }
