 :root {
    --wolf-ui-font: "Courier New", monospace;
 }

/*
 * Wolf3D Multiplayer CSS
 * Style matched to original Wolf3D game menus:
 *   - Background: dark teal #004141
 *   - Border frame: gray brick pattern (simulated with gradients)
 *   - Text: pixel-crisp, no antialiasing, yellow/white/gray
 *   - No rounded corners, no gradients, no glow - pure retro
 */

/* ===== LOBBY ===== */
#mp-lobby {
    position: absolute;
    top: 0;
    left: 0;
    width: 640px;
    height: 400px;
    background-color: #8a0000;
    background-image: url(art/menubg_main.png);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
    image-rendering: optimizeSpeed;
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: pixelated;
}

#mp-lobby,
#mp-lobby * {
    text-decoration: none;
    font-family: var(--wolf-ui-font);
    -webkit-font-smoothing: none;
    font-smooth: never;
}

#mp-lobby-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lobby-box {
    background-color: rgba(22, 22, 22, 0.92);
    border: 4px solid #737373;
    border-top-color: #9c9c9c;
    border-left-color: #9c9c9c;
    border-right-color: #525252;
    border-bottom-color: #525252;
    box-shadow: 0 0 0 2px #000;
    padding: 16px 20px;
    max-width: 480px;
    width: calc(100% - 56px);
    max-height: calc(100% - 24px);
    overflow-y: auto;
    box-sizing: border-box;
    position: relative;
}

/* Red title bar like Wolf3D menu headers */
.lobby-title {
    text-align: center;
    background-color: #8a0000;
    color: #fcfc54;
    font-family: var(--wolf-ui-font);
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 3px;
    padding: 6px 0;
    margin: -16px -20px 12px -20px;
    border-bottom: 3px solid #525252;
    text-shadow: 2px 2px 0 #000;
    image-rendering: pixelated;
}

.lobby-subtitle {
    text-align: center;
    color: #c8c8c8;
    font-family: var(--wolf-ui-font);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 14px;
    text-shadow: 1px 1px 0 #000;
}

.lobby-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lobby-label {
    color: #c8c8c8;
    font-family: var(--wolf-ui-font);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-top: 4px;
    text-shadow: 1px 1px 0 #000;
}

.lobby-input {
    background-color: #141414;
    border: 2px solid #525252;
    border-bottom-color: #9c9c9c;
    border-right-color: #9c9c9c;
    color: #fcfc54;
    padding: 6px 8px;
    font-family: var(--wolf-ui-font);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    text-shadow: 1px 1px 0 #000;
    outline: none;
}
.lobby-input:focus {
    border-color: #fcfc54;
}
.lobby-input option {
    background: #141414;
    color: #fcfc54;
    font-family: var(--wolf-ui-font);
}

.lobby-btn {
    padding: 8px 12px;
    font-family: var(--wolf-ui-font);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 2px;
    border: 2px solid;
    cursor: pointer;
    text-transform: uppercase;
    image-rendering: pixelated;
}

.lobby-btn-primary {
    background-color: #8a0000;
    color: #fcfc54;
    border-color: #b30000 #5a0000 #5a0000 #b30000;
    text-shadow: 1px 1px 0 #000;
}
.lobby-btn-primary:hover {
    background-color: #a00000;
    color: #fff;
}

.lobby-btn-secondary {
    background-color: #292929;
    color: #9c9c9c;
    border-color: #525252 #141414 #141414 #525252;
}
.lobby-btn-secondary:hover {
    background-color: #3a3a3a;
    color: #fcfc54;
}

.lobby-btn-join {
    background-color: #004100;
    color: #54fc54;
    border-color: #006100 #002100 #002100 #006100;
    padding: 4px 12px;
    font-size: 10px;
}
.lobby-btn-join:hover {
    background-color: #006100;
    color: #fff;
}

.lobby-status {
    text-align: center;
    font-family: var(--wolf-ui-font);
    font-size: 10px;
    font-weight: 700;
    margin-top: 8px;
    min-height: 14px;
    color: #737373;
}

.lobby-loading, .lobby-empty {
    text-align: center;
    color: #737373;
    padding: 24px 0;
    font-family: var(--wolf-ui-font);
    font-size: 11px;
    font-weight: 700;
}

.lobby-actions {
    display: flex;
    gap: 4px;
    margin-top: 10px;
}
.lobby-actions .lobby-btn {
    flex: 1;
    font-size: 9px;
    padding: 6px 4px;
}

.lobby-help {
    text-align: center;
    color: #c8c8c8;
    font-family: var(--wolf-ui-font);
    font-size: 8px;
    letter-spacing: 1px;
    margin-top: 10px;
    text-shadow: 1px 1px 0 #000;
}

/* Room list */
.lobby-room-list {
    max-height: 170px;
    overflow-y: auto;
    margin: 6px 0;
}

.lobby-room {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    margin-bottom: 2px;
    background-color: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-left: 3px solid #525252;
}
.lobby-room:hover {
    background-color: #292929;
    border-left-color: #fcfc54;
}

.room-name {
    color: #fcfc54;
    font-family: var(--wolf-ui-font);
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 0 #000;
}

.room-details {
    color: #c8c8c8;
    font-family: var(--wolf-ui-font);
    font-size: 9px;
    font-weight: 700;
    margin-top: 2px;
}

.room-info {
    flex: 1;
}

.room-full .room-name {
    color: #525252;
}
.room-full-text {
    color: #525252;
    font-family: var(--wolf-ui-font);
    font-size: 9px;
    letter-spacing: 2px;
}

/* ===== KILL FEED ===== */
#mp-killfeed {
    position: absolute;
    top: 10px;
    right: 18px;
    width: 190px;
    z-index: 100;
    font-family: var(--wolf-ui-font);
    font-size: 9px;
    pointer-events: none;
}

.killfeed-item {
    padding: 2px 6px;
    margin-bottom: 1px;
    background-color: rgba(0,0,0,0.75);
    border-left: 3px solid;
    text-shadow: 1px 1px 0 #000;
    color: #fcfc54;
}

#mp-match-status {
    position: absolute;
    top: 10px;
    left: 18px;
    min-width: 184px;
    z-index: 120;
    padding: 6px 8px;
    background-color: rgba(0,0,0,0.78);
    border: 2px solid #737373;
    box-shadow: 0 0 0 2px #000;
    color: #c8c8c8;
    font-family: var(--wolf-ui-font);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    pointer-events: none;
}

.mp-match-line + .mp-match-line {
    margin-top: 2px;
}

.mp-match-mode {
    color: #fcfc54;
}

.mp-match-accent {
    color: #54fc54;
}

.mp-match-ping-elevated {
    color: #ffb347;
}

.mp-match-ping-high,
.mp-match-warning {
    color: #ff8a3c;
}

.mp-match-ping-severe {
    color: #fc5454;
}

/* ===== SCOREBOARD ===== */
#mp-scoreboard {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    background-color: #292929;
    border: 4px solid #737373;
    border-top-color: #9c9c9c;
    border-left-color: #9c9c9c;
    border-right-color: #525252;
    border-bottom-color: #525252;
    z-index: 200;
    font-family: var(--wolf-ui-font);
    padding: 0;
}

.sb-title {
    text-align: center;
    background-color: #8a0000;
    color: #fcfc54;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 4px;
    padding: 5px 0;
    text-shadow: 2px 2px 0 #000;
    border-bottom: 3px solid #525252;
}

.sb-header {
    display: flex;
    padding: 4px 10px;
    border-bottom: 2px solid #525252;
    color: #737373;
    font-size: 9px;
    letter-spacing: 1px;
}

.sb-row {
    display: flex;
    padding: 3px 10px;
    border-bottom: 1px solid #1a1a1a;
    font-size: 10px;
}

.sb-row.sb-bot {
    background-color: rgba(255, 138, 60, 0.14);
}

.sb-row.sb-enemy {
    background-color: rgba(84, 84, 252, 0.08);
}

.sb-me {
    background-color: #3a2a0a;
}

.sb-name { flex: 3; color: #fcfc54; }
.sb-kills { flex: 1; text-align: center; color: #54fc54; }
.sb-deaths { flex: 1; text-align: center; color: #fc5454; }
.sb-ping { flex: 1.1; text-align: center; color: #c8c8c8; }
.sb-ping.sb-ping-elevated { color: #ffb347; }
.sb-ping.sb-ping-high { color: #ff8a3c; }

.sb-badge,
.go-badge {
    display: inline-block;
    margin-right: 6px;
    padding: 1px 4px 0 4px;
    border: 1px solid;
    font-size: 8px;
    line-height: 1.1;
    letter-spacing: 1px;
    vertical-align: middle;
}

.sb-badge-bot,
.go-badge-bot {
    background: #ff8a3c;
    border-color: #fcfc54;
    color: #141414;
}

.sb-badge-player,
.go-badge-player {
    background: #8a0000;
    border-color: #fc5454;
    color: #fcfc54;
}

.sb-header .sb-name,
.sb-header .sb-kills,
.sb-header .sb-deaths { color: #737373; }

.sb-time {
    text-align: center;
    color: #737373;
    font-size: 10px;
    padding: 6px 0;
    border-top: 2px solid #525252;
}

/* ===== CHAT ===== */
#mp-chat {
    position: absolute;
    bottom: 84px;
    left: 18px;
    width: 220px;
    z-index: 100;
    font-family: var(--wolf-ui-font);
    font-size: 9px;
    pointer-events: none;
}

.chat-msg {
    padding: 1px 4px;
    margin-bottom: 1px;
    background-color: rgba(0,0,0,0.6);
    text-shadow: 1px 1px 0 #000;
}

.chat-name {
    color: #fcfc54;
    font-weight: bold;
}

.chat-text {
    color: #9c9c9c;
}

#mp-chat-input-container {
    position: absolute;
    bottom: 84px;
    left: 18px;
    width: 220px;
    z-index: 200;
}

#mp-chat-input {
    width: 100%;
    padding: 3px 6px;
    background-color: #141414;
    border: 2px solid #737373;
    border-bottom-color: #525252;
    border-right-color: #525252;
    color: #fcfc54;
    font-family: var(--wolf-ui-font);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    outline: none;
    box-sizing: border-box;
}

/* ===== GAME OVER ===== */
#mp-gameover {
    position: absolute;
    top: 0;
    left: 0;
    width: 640px;
    height: 400px;
    background-color: #004141;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--wolf-ui-font);
}

.go-box {
    background-color: #292929;
    border: 4px solid #737373;
    border-top-color: #9c9c9c;
    border-left-color: #9c9c9c;
    border-right-color: #525252;
    border-bottom-color: #525252;
    padding: 0 20px 16px 20px;
    text-align: center;
    min-width: 320px;
}

.go-title {
    background-color: #8a0000;
    color: #fcfc54;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 6px;
    padding: 6px 0;
    margin: 0 -20px 10px -20px;
    border-bottom: 3px solid #525252;
    text-shadow: 2px 2px 0 #000;
}

.go-winner {
    color: #fcfc54;
    font-size: 14px;
    margin-bottom: 10px;
    text-shadow: 1px 1px 0 #000;
}

.go-scores {
    text-align: left;
}

.go-row {
    display: flex;
    gap: 8px;
    padding: 3px 0;
    border-bottom: 1px solid #1a1a1a;
    font-size: 11px;
}

.go-bot {
    background-color: rgba(255, 138, 60, 0.1);
}

.go-enemy {
    background-color: rgba(84, 84, 252, 0.05);
}

.go-me {
    background-color: #3a2a0a;
}

.go-rank { color: #737373; width: 28px; text-align: right; }
.go-name { color: #fcfc54; flex: 1; }
.go-kd   { color: #9c9c9c; width: 90px; text-align: right; }

.go-hint {
    color: #737373;
    font-size: 9px;
    margin-top: 12px;
    animation: go-blink 1s steps(2, start) infinite;
}

@keyframes go-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ===== MULTIPLAYER BUTTON IN MAIN MENU ===== */
/* Override the inline style to match the original pixel menu items */
#menu li.multiplayer div.button {
    background: none !important;
    width: 330px !important;
    text-align: left !important;
    color: #9c9c9c !important;
    font-size: 24px !important;
    font-family: Impact, "Arial Black", sans-serif !important;
    font-weight: 900 !important;
    line-height: 24px !important;
    letter-spacing: 0 !important;
    text-shadow: 1px 1px 0 #000, 2px 2px 0 #000, 3px 3px 0 rgba(0, 0, 0, 0.35) !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    padding-left: 0 !important;
    cursor: pointer;
    image-rendering: pixelated;
    transform: scale(0.92, 0.86);
    transform-origin: left center;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.2);
}

#menu li.active.multiplayer div.button {
    color: #fcfc54 !important;
}

/* ===== DEBUG LOG PANEL ===== */
#debug-log-panel {
    position: absolute;
    inset: 0;
    z-index: 12000;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
}

.debug-log-box {
    width: 90%;
    max-width: 760px;
    background-color: #292929;
    border: 4px solid #737373;
    border-top-color: #9c9c9c;
    border-left-color: #9c9c9c;
    border-right-color: #525252;
    border-bottom-color: #525252;
    padding: 0 12px 10px 12px;
    font-family: var(--wolf-ui-font);
}

.debug-log-title {
    background-color: #8a0000;
    color: #fcfc54;
    text-align: center;
    font-size: 14px;
    letter-spacing: 3px;
    font-weight: bold;
    padding: 6px 0;
    margin: 0 -12px 8px -12px;
    border-bottom: 3px solid #525252;
    text-shadow: 2px 2px 0 #000;
}

#debug-log-text {
    width: 100%;
    height: 250px;
    box-sizing: border-box;
    background: #111;
    color: #d9d9d9;
    border: 2px solid #525252;
    padding: 6px;
    font-family: var(--wolf-ui-font);
    font-size: 11px;
    resize: vertical;
}

.debug-log-actions {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

#debug-log-status {
    margin-top: 6px;
    color: #9c9c9c;
    font-size: 10px;
    text-align: center;
}

/* Scrollbar styling - retro look */
.lobby-room-list::-webkit-scrollbar {
    width: 8px;
    background-color: #141414;
}
.lobby-room-list::-webkit-scrollbar-track {
    background-color: #141414;
    border: 1px solid #292929;
}
.lobby-room-list::-webkit-scrollbar-thumb {
    background-color: #525252;
    border: 1px solid #737373;
}
.lobby-room-list::-webkit-scrollbar-thumb:hover {
    background-color: #737373;
}

/* ===== MOBILE TOUCH CONTROLS ===== */
#touch-controls {
    position: absolute;
    inset: 0;
    z-index: 10000; /* Above HUD, below Lobby/Title */
    pointer-events: none;
    font-family: var(--wolf-ui-font);
    display: flex;
    justify-content: space-between;
}

#touch-left-area {
    width: 45%;
    height: 100%;
    pointer-events: auto;
    position: relative;
}

#touch-right-area {
    width: 45%;
    height: 100%;
    pointer-events: none; /* Let the buttons themselves take the pointer-events */
    position: relative;
}

#touch-joystick-base {
    position: absolute;
    bottom: 30px;
    left: 40px;
    width: 130px;
    height: 130px;
    background: rgba(80, 80, 80, 0.4);
    border: 2px solid rgba(252, 252, 84, 0.5); /* yellowish retro */
    border-radius: 50%;
    pointer-events: none;
}

.dpad-arrow {
    position: absolute;
    color: rgba(252, 252, 84, 0.6);
    font-size: 18px;
    pointer-events: none;
}
.dpad-up { top: 6px; left: 50%; transform: translateX(-50%); }
.dpad-down { bottom: 6px; left: 50%; transform: translateX(-50%); }
.dpad-left { top: 50%; left: 8px; transform: translateY(-50%); }
.dpad-right { top: 50%; right: 4px; transform: translateY(-50%); }

#touch-joystick-thumb {
    position: absolute;
    width: 50px;
    height: 50px;
    left: 40px;
    top: 40px;
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    pointer-events: none;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.touch-btn {
    position: absolute;
    background: rgba(138, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: rgba(252, 252, 84, 0.8);
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
}

.touch-btn.active {
    background: rgba(252, 84, 84, 0.8);
    color: #fff;
    border-color: #fff;
}

#touch-btn-fire {
    bottom: 30px;
    right: 30px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    font-size: 18px;
    background: rgba(220, 0, 0, 0.4);
    border-color: rgba(255, 100, 100, 0.6);
}

#touch-btn-use {
    bottom: 120px;
    right: 80px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 100, 220, 0.4);
    border-color: rgba(100, 150, 255, 0.6);
}

#touch-btn-strafe {
    bottom: 30px;
    right: 120px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(100, 100, 100, 0.4);
    border-color: rgba(200, 200, 200, 0.6);
}

#touch-btn-run {
    bottom: 90px;
    right: 150px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(220, 150, 0, 0.4);
    border-color: rgba(255, 200, 100, 0.6);
}

#touch-btn-wpn {
    bottom: 160px;
    right: 140px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(150, 0, 200, 0.4);
    border-color: rgba(200, 100, 255, 0.6);
}

#touch-btn-esc {
    top: 20px;
    right: 30px;
    width: 50px;
    height: 40px;
    border-radius: 5px;
    background: rgba(100, 100, 100, 0.3);
    border-color: rgba(200, 200, 200, 0.4);
}

