← All Workshops

MudEngine Part 6: Multiplayer

Step 16 / 18

CSS Additions

The multiplayer UI needs additional styles for the game layout, player indicators, sidebar, D-pad controls, clickable room cards, and name screen.

Append these styles to assets/main.css. Keep the existing styles from Part 4 (the grid, description panel, etc. are reused).

The .cell.clickable rules bring back the Part 5 click-to-move affordance: a pointer cursor, a subtle border, and a blue hover glow so players can see which rooms they can move into. .game-layout:focus removes the browser's focus ring — the game area is focusable so the keyboard shortcuts work, but we don't want an ugly outline around the whole layout.

mud-engine/assets/main.css
/* ── Game Layout ── */
.game-layout {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.game-layout:focus {
    outline: none;
}

.grid-area {
    flex: 1;
    min-width: 0;
}

/* ── Clickable cells ── */
.world-grid .cell.clickable {
    cursor: pointer;
    border: 1px solid #2a2a5a;
    transition:
        filter 0.2s,
        border-color 0.2s,
        box-shadow 0.2s;
}

.world-grid .cell.clickable:hover {
    filter: brightness(1.35);
    border-color: #3b82f6;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.15);
}

.world-grid .cell.clickable:active {
    filter: brightness(0.9);
    transform: scale(0.97);
}

/* ── Player indicator in grid cells ── */
.player-indicator {
    font-size: 11px;
    color: #a0d0ff;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-indicator::before {
    content: "";
    color: #60a0ff;
}

/* ── Player list sidebar ── */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #12122a;
    border-radius: 8px;
    padding: 12px;
}

.sidebar h2 {
    font-size: 14px;
    margin: 0 0 10px 0;
    color: #a0a0c0;
}

.player-entry {
    padding: 6px 8px;
    margin-bottom: 4px;
    border-radius: 4px;
    background: #1a1a30;
    font-size: 13px;
}

.player-entry.me {
    background: #1a3050;
    border: 1px solid #3b82f6;
}

.player-name {
    color: #d0d0e0;
    display: block;
}

.player-room {
    color: #6b6b8a;
    font-size: 11px;
    display: block;
}

/* ── Name Screen ── */
.name-screen {
    text-align: center;
    padding: 80px 20px;
}

.name-screen h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.subtitle {
    color: #8a8aaa;
    margin-bottom: 24px;
    font-size: 15px;
}

.name-input {
    padding: 10px 14px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    border: 2px solid #3b82f6;
    border-radius: 6px;
    background: #12122a;
    color: #d0d0e0;
    width: 280px;
    outline: none;
    box-sizing: border-box;
}

.name-input:focus {
    border-color: #60a0ff;
}

.join-btn {
    display: block;
    margin: 16px auto 0;
    padding: 10px 28px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 15px;
    border: none;
    border-radius: 6px;
    background: #3b82f6;
    color: #fff;
    cursor: pointer;
}

.join-btn:hover {
    background: #2563eb;
}

/* ── D-Pad Controls ── */
.dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 16px auto;
    gap: 4px;
}

.dpad-row {
    display: flex;
    gap: 4px;
}

.dpad-btn {
    width: 48px;
    height: 48px;
    border: 2px solid #3b82f6;
    border-radius: 6px;
    background: #12122a;
    color: #90b0e0;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.dpad-btn:hover {
    background: #1a2a4a;
}

.dpad-btn:active {
    background: #2a3a5a;
}

.dpad-btn.center {
    border-color: transparent;
    background: transparent;
    cursor: default;
    color: #3b82f6;
    font-size: 14px;
}
Step 16 / 18