* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: #1a1a2e;
    color: #e0e0e0;
    font-family: 'Segoe UI', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
}

.container { width: 100%; max-width: 700px; }

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header h1 { font-size: 1.6rem; }

.nav a, .header a {
    color: #a0a0c0;
    text-decoration: none;
    margin-left: 16px;
    font-size: 0.95rem;
}

.nav a:hover, .header a:hover { color: #fff; }

h1 { margin-bottom: 24px; font-size: 1.8rem; }

input[type=text], input[type=password] {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    background: #2a2a4a;
    border: 1px solid #3a3a5a;
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
}

button[type=submit] {
    width: 100%;
    padding: 12px;
    background: #4a6fa5;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}

button[type=submit]:hover { background: #5a7fb5; }

.flash {
    background: #3a3a1a;
    border: 1px solid #6a6a2a;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 20px;
    color: #e0d080;
}

.status-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    border-radius: 10px;
    margin-bottom: 24px;
}

.status-card.online  { background: #1a3a2a; border: 1px solid #2a6a4a; }
.status-card.offline { background: #3a1a1a; border: 1px solid #6a2a2a; }

.status-indicator {
    width: 18px; height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-card.online  .status-indicator { background: #4adf7a; box-shadow: 0 0 10px #4adf7a; }
.status-card.offline .status-indicator { background: #df4a4a; box-shadow: 0 0 10px #df4a4a; }

.status-card h2 { font-size: 1.3rem; margin-bottom: 4px; }
.status-card p  { color: #a0a0c0; font-size: 0.9rem; }

.restart-btn {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: #5a2a2a;
    color: white;
    margin-bottom: 30px;
    transition: background 0.2s;
}

.restart-btn:hover:not(:disabled) { background: #7a3a3a; }
.restart-btn:disabled {
    background: #2a4a2a;
    color: #4adf7a;
    cursor: not-allowed;
}

.log-section h3 { margin-bottom: 12px; color: #a0a0c0; font-size: 1rem; }

table { width: 100%; border-collapse: collapse; }

th, td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #2a2a4a;
    font-size: 0.9rem;
}

th { color: #a0a0c0; font-weight: 600; }

.card {
    background: #2a2a4a;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.card h3 { margin-bottom: 16px; }

label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.delete-btn {
    width: auto;
    padding: 6px 12px;
    font-size: 0.85rem;
    background: #5a2a2a;
    border-radius: 4px;
    border: none;
    color: white;
    cursor: pointer;
}

.delete-btn:hover { background: #7a3a3a; }

/* Password reveal */
.password-wrapper {
    position: relative;
    margin-bottom: 12px;
}

.password-wrapper input {
    margin-bottom: 0;
    padding-right: 48px;
}

.reveal-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    width: auto;
    padding: 4px 6px;
    color: #a0a0c0;
}

.reveal-btn:hover { color: #fff; }

/* Loading status state */
.status-card.loading {
    background: #2a2a1a;
    border: 1px solid #6a6a2a;
}

.status-card.loading .status-indicator {
    background: #dfb84a;
    box-shadow: 0 0 10px #dfb84a;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

/* Live log panel */
.log-panel {
    background: #0d0d0d;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    margin-bottom: 24px;
    overflow: hidden;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #1a1a2e;
    border-bottom: 1px solid #2a2a4a;
    font-size: 0.85rem;
    color: #a0a0c0;
}

.log-status { font-size: 0.8rem; color: #dfb84a; }

.log-output {
    padding: 12px 14px;
    height: 280px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    line-height: 1.6;
}

.log-output p { margin: 0; color: #c0c0c0; word-break: break-all; }
.log-output p.log-warn { color: #dfb84a; }
.log-output p.log-done { color: #4adf7a; font-weight: bold; }

/* Player box */
.player-box {
    background: #1e1e3a;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.player-header {
    font-size: 0.85rem;
    color: #a0a0c0;
    margin-bottom: 10px;
}

.player-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.player-tag {
    background: #2a3a2a;
    border: 1px solid #3a5a3a;
    color: #4adf7a;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.85rem;
}

.no-players {
    color: #6a6a8a;
    font-size: 0.85rem;
    font-style: italic;
}

/* =============================================
   RESPONSIVE / MOBILE
   ============================================= */
@media (max-width: 600px) {

    /* General layout */
    body {
        padding: 16px 12px;
        align-items: flex-start;
    }

    .container {
        width: 100%;
    }

    /* Header — stack title and nav vertically */
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 20px;
    }

    .header h1 {
        font-size: 1.3rem;
    }

    .nav {
        display: flex;
        gap: 16px;
    }

    .nav a, .header a {
        margin-left: 0;
        font-size: 1rem;
    }

    /* Status card */
    .status-card {
        padding: 16px;
        gap: 12px;
    }

    .status-card h2 {
        font-size: 1.1rem;
    }

    .status-card p {
        font-size: 0.8rem;
        word-break: break-all;
    }

    /* Buttons */
    .restart-btn {
        font-size: 1rem;
        padding: 14px;
    }

    button[type=submit] {
        font-size: 1rem;
        padding: 14px;
    }

    /* Player tags — wrap nicely on small screens */
    .player-list {
        gap: 6px;
    }

    .player-tag {
        font-size: 0.8rem;
        padding: 4px 10px;
    }

    /* Log panel — shorter height on mobile */
    .log-output {
        height: 200px;
        font-size: 0.72rem;
    }

    /* Recent restarts table */
    .log-section h3 {
        font-size: 0.95rem;
    }

    th, td {
        padding: 8px 8px;
        font-size: 0.8rem;
    }

    /* Admin panel cards */
    .card {
        padding: 16px;
    }

    /* Inputs */
    input[type=text],
    input[type=password] {
        font-size: 1rem;
        padding: 14px 12px;
    }

    /* Login page title */
    h1 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    /* Flash messages */
    .flash {
        font-size: 0.9rem;
        padding: 10px;
    }
}