/* CS2D shell. The game owns the whole viewport (fixed overlay) so the site nav/layout doesn't
   intrude on the canvas. Lobby and play states both live inside .cs2d-root. */
.cs2d-root {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: #14161c;
    color: #e8eaf0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    overflow: hidden;
    user-select: none;
}

.cs2d-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: #14161c;
    cursor: crosshair;
}

/* ---- lobby -------------------------------------------------------------- */
.cs2d-lobby {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background:
        radial-gradient(900px 600px at 50% -10%, rgba(74, 144, 217, 0.18), transparent 60%),
        #14161c;
}

.cs2d-card {
    width: min(440px, 90vw);
    padding: 34px 30px;
    background: rgba(26, 29, 38, 0.92);
    border: 1px solid #2a2f3c;
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.cs2d-title {
    margin: 0 0 6px;
    font-size: 56px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #fff;
}
.cs2d-title span { color: #4a90d9; }

.cs2d-sub {
    margin: 0 0 22px;
    font-size: 14px;
    color: #9aa0ad;
}

.cs2d-form {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.cs2d-name {
    flex: 1;
    padding: 12px 14px;
    font-size: 16px;
    color: #e8eaf0;
    background: #11131a;
    border: 1px solid #2a2f3c;
    border-radius: 8px;
    outline: none;
}
.cs2d-name:focus { border-color: #4a90d9; }

.cs2d-deploy {
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: #4a90d9;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}
.cs2d-deploy:hover { background: #5a9fe6; }
.cs2d-deploy:disabled { background: #39414f; color: #6b7280; cursor: not-allowed; }

.cs2d-hint {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
}

/* ---- in-game chrome ----------------------------------------------------- */
.cs2d-leave {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 34px;
    height: 34px;
    font-size: 16px;
    color: #e8eaf0;
    background: rgba(26, 29, 38, 0.8);
    border: 1px solid #2a2f3c;
    border-radius: 8px;
    cursor: pointer;
    z-index: 60;
}
.cs2d-leave:hover { background: rgba(217, 138, 58, 0.85); }

/* build palette */
.cs2d-build {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    background: rgba(20, 22, 28, 0.82);
    border: 1px solid #2a2f3c;
    border-radius: 10px;
    z-index: 60;
}
.cs2d-build-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 64px;
    padding: 6px 8px;
    color: #cdd2dd;
    background: #20242e;
    border: 1px solid #343a47;
    border-radius: 7px;
    cursor: pointer;
    font-family: inherit;
}
.cs2d-build-btn:hover { background: #2a2f3b; }
.cs2d-build-btn.sel { border-color: #4a90d9; background: #243247; color: #fff; }
.cs2d-build-name { font-size: 12px; font-weight: 600; }
.cs2d-build-cost { font-size: 11px; color: #e0c24a; }
.cs2d-build-help { margin-left: 6px; font-size: 11px; color: #6b7280; }

/* buy menu */
.cs2d-buy-toggle {
    position: absolute;
    top: 12px;
    right: 56px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #e8eaf0;
    background: rgba(26, 29, 38, 0.8);
    border: 1px solid #2a2f3c;
    border-radius: 8px;
    cursor: pointer;
    z-index: 60;
}
.cs2d-buy-toggle:hover { background: rgba(74, 144, 217, 0.85); }

.cs2d-team-toggle {
    position: absolute;
    top: 12px;
    right: 138px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #e8eaf0;
    background: rgba(26, 29, 38, 0.8);
    border: 1px solid #2a2f3c;
    border-radius: 8px;
    cursor: pointer;
    z-index: 60;
}
.cs2d-team-toggle:hover { background: rgba(217, 138, 58, 0.85); }

.cs2d-buy {
    position: absolute;
    top: 56px;
    right: 14px;
    width: 300px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 12px 14px;
    background: rgba(18, 20, 26, 0.95);
    border: 1px solid #2a2f3c;
    border-radius: 12px;
    z-index: 61;
}
.cs2d-buy-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 15px;
}
.cs2d-buy-close {
    width: 24px; height: 24px;
    color: #e8eaf0; background: #20242e;
    border: 1px solid #343a47; border-radius: 6px; cursor: pointer;
}
.cs2d-buy-cat { margin: 8px 0 4px; font-size: 12px; color: #6b7280; text-transform: uppercase; }
.cs2d-buy-items { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cs2d-buy-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 7px 9px; font-size: 12px; color: #cdd2dd;
    background: #20242e; border: 1px solid #343a47; border-radius: 7px; cursor: pointer;
}
.cs2d-buy-item:hover { background: #243247; border-color: #4a90d9; color: #fff; }
.cs2d-buy-price { color: #e0c24a; font-size: 11px; }
