*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --bg-deep: #0b0f16;
    --bg-mid: #121a27;
    --panel: rgba(28, 38, 53, 0.88);
    --panel-light: rgba(53, 68, 91, 0.72);
    --line: rgba(182, 211, 255, 0.18);
    --text: #f4f7fb;
    --muted: #aeb9c8;
    --blue: #6f9dd9;
    --cyan: #70d3e8;
     --green: #2ecc71;
    --yellow: #f1c40f;
    --red: #e74c3c;
    --shadow:
        rgba(0, 0, 0, 0.18) 0 -20px 24px inset,
        rgba(0, 0, 0, 0.22) 0 18px 45px;
}

html {
    min-height: 100%;
    background: var(--bg-deep);
}

body {
    margin: 0;
    min-width: 280px;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 20% 0%, rgba(85, 111, 151, 0.45), transparent 35%),
        radial-gradient(circle at 90% 20%, rgba(49, 86, 118, 0.3), transparent 30%),
        linear-gradient(145deg, var(--bg-mid), var(--bg-deep) 68%);
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

.main {
    min-height: 100vh;
}

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

.screen.active {
    display: block;
}

.board-shell {
    width: min(1440px, 100%);
    margin: 0 auto;
      padding: 1.5rem;
}

.board-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.board-header h1 {
    margin: 0.2rem 0 0.35rem;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.04em;
    text-shadow: 0 5px 18px rgba(0, 0, 0, 0.55);
}

.board-header p {
    margin: 0;
    color: var(--muted);
}

.eyebrow {
    margin: 0 !important;
    color: var(--cyan) !important;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    font-weight: 800;
}

.header-actions,
.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.panel,
.auth-panel,
.admin-team-card {
    border: 1px solid var(--line);
    border-radius: 1.4rem;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.06), transparent 45%),
        var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.panel {
    padding: 1.25rem;
}

.panel h2 {
    margin-top: 0;
}

.panel-heading,
.team-card-heading,
.vehicle-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.primary-btn,
.secondary-btn,
.danger-btn,
.role-button,
.system-btn,
.direction-btn {
    border: 1px solid var(--line);
    cursor: pointer;
    transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

.primary-btn,
.secondary-btn,
.danger-btn {
    min-height: 2.8rem;
    padding: 0.7rem 1rem;
    border-radius: 0.9rem;
    font-weight: 800;
}

.primary-btn {
    background: linear-gradient(145deg, #5d83b8, #243650);
}

.secondary-btn {
    background: linear-gradient(145deg, #46556d, #1d2634);
}

.danger-btn {
    background: linear-gradient(145deg, #aa443b, #4c1f20);
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.12);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.wide-btn {
    width: 100%;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-weight: 800;
    font-size: 0.82rem;
}

.status-pill.success {
    color: #79e7a5;
}

.status-pill.warning {
    color: #ffe07a;
}

.status-pill.danger {
    color: #ff8b7f;
}

.map-grid {
    display: grid;
    grid-template-columns: repeat(15, minmax(1.65rem, 1fr));
    gap: 2px;
    aspect-ratio: 1 / 1;
    width: 100%;
    overflow: hidden;
    border-radius: 1rem;
    background: rgba(0, 0, 0, 0.34);
    padding: 0.4rem;
}

.map-cell {
    min-width: 0;
    border: 0;
    border-radius: 0.22rem;
    background: rgba(111, 157, 217, 0.16);
    color: rgba(255, 255, 255, 0.76);
    font-size: clamp(0.55rem, 1vw, 0.85rem);
    cursor: pointer;
}

.map-cell:hover:not(:disabled) {
    background: rgba(112, 211, 232, 0.34);
}

.map-cell.crater {
    background:
        radial-gradient(circle at 40% 35%, #3b4250 0 20%, #161b23 45%, #080b10 75%);
    opacity: 0.95;
}

.muted {
    color: var(--muted);
}

.status-grid,
.admin-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.status-grid div,
.admin-stats div {
    padding: 0.85rem;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.05);
}

.status-grid span,
.admin-stats span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
}

.status-grid strong,
.admin-stats strong {
    display: block;
    margin-top: 0.2rem;
}

.success {
    color: var(--green);
}

.error {
    color: #ff7c70;
}

@media (max-width: 760px) {
    .board-shell {
        padding: 1rem;
    }

    .board-header {
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .map-grid {
        grid-template-columns: repeat(15, minmax(1.1rem, 1fr));
    }
}

@media (max-width: 425px) {
    .board-shell {
        padding: 0.7rem;
    }

    .panel {
        padding: 0.9rem;
        border-radius: 1rem;
    }

    .status-grid,
    .admin-stats {
        grid-template-columns: 1fr;
    }
}
