:root {
    --btn-color-light: #444;
    --btn-color-dark: #2a2a2a;
    --btn-color-border: #555;
    --btn-color-active-light: #333;
    --btn-color-active-dark: #1a1a1a;
}

body {
    background-color: #222;
    color: white;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

#commsInfoDiv {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 12px;
}

#commsInfoDiv a {
    color: #888;
    text-decoration: none;
    margin-right: 10px;
    cursor: pointer;
}

.header {
    margin-top: 40px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    font-size: 20px;
}

.score-container {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

#playerScore {
    color: #4CAF50;
    font-size: 24px;
}

#resetBtn {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s, box-shadow 0.1s;
}

#resetBtn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
}

.dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    width: 100%;
    max-width: 400px;
    gap: 10px;
}

.dpad-middle {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 50px;
    box-sizing: border-box;
}

.dir-button {
    background: linear-gradient(135deg, var(--btn-color-light), var(--btn-color-dark));
    color: white;
    border: 2px solid var(--btn-color-border);
    border-radius: 20px;
    font-size: 48px;
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.1), 0 8px 15px rgba(0, 0, 0, 0.5);
    transition: all 0.1s ease;
}

.dir-button:active {
    background: linear-gradient(135deg, var(--btn-color-active-light), var(--btn-color-active-dark));
    box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.6), 0 2px 5px rgba(0, 0, 0, 0.3);
    transform: translateY(4px);
}

#status {
    height: 30px;
    color: #ff5555;
    font-weight: bold;
    margin-bottom: 20px;
}