:root {
    --bg-color: #1a1a24;
    --panel-bg: #262635;
    --row-alt-bg: rgba(255, 255, 255, 0.03);
    --row-hover-bg: rgba(255, 255, 255, 0.06);
    --text-color: #e2e2e2;
    --key-bg-top: #f8f9fa;
    --key-bg-bottom: #e9ecef;
    --key-color: #343a40;
    --key-border: #ced4da;
    --key-shadow: #adb5bd;
    --accent-color: #00e5ff;
}

.controls-panel h2 {
    margin-top: 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent-color);
    font-weight: 800;
    font-size: 20px;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.controls-list {
    display: flex;
    flex-direction: column;
}

.control-row {
    display: grid;
    grid-template-columns: 140px auto;
    gap: 20px;
    align-items: center;
    padding: 12px 0px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.control-row:nth-child(even) {
    background-color: var(--row-alt-bg);
}

.control-row:hover {
    background-color: var(--row-hover-bg);
}

.key-group {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    align-items: center;
}

kbd {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(to bottom, var(--key-bg-top), var(--key-bg-bottom));
    color: var(--key-color);
    min-width: 18px;
    height: 18px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--key-border);
    font-family: 'Consolas', 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow:
        inset 0 1px 0 #ffffff,
        0 3.5px 0 var(--key-shadow),
        0 4px 4px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    user-select: none;
    transition: all 0.1s cubic-bezier(0.4, 0.0, 0.2, 1);
    font-weight: bold;
}

kbd.wide {
    min-width: 36px;
}

kbd.space {
    min-width: 80px;
}

kbd:active {
    transform: translateY(3.5px);
    box-shadow:
        inset 0 1px 0 #ffffff,
        0 0px 0 var(--key-shadow),
        0 1px 2px rgba(0, 0, 0, 0.4);
    background: linear-gradient(to bottom, var(--key-bg-bottom), var(--key-bg-top));
}

/* ---- MOUSE BUTTON STYLING ---- */
.mouse-body {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: linear-gradient(to bottom, #3a3f44, #1e2124);
    padding: 4px 4px 18px 4px;
    /* Thick bottom padding acts as the palm rest */
    border-radius: 36px 36px 32px 32px;
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.1),
        inset 0 -2px 5px rgba(0, 0, 0, 0.5),
        0 4px 0 #111,
        0 6px 6px rgba(0, 0, 0, 0.6);
    gap: 4px;
}

.mouse-body kbd {
    min-width: 26px;
    height: 32px;
    padding: 4px 6px;
    box-shadow:
        inset 0 1px 0 #ffffff,
        0 3px 0 var(--key-shadow),
        0 3px 3px rgba(0, 0, 0, 0.3);
    margin: 0;
}

.mouse-body kbd.lmb {
    border-radius: 32px 4px 4px 10px;
}

.mouse-body kbd.rmb {
    border-radius: 4px 32px 10px 4px;
}

.mouse-body kbd:active {
    transform: translateY(3px);
    box-shadow:
        inset 0 1px 0 #ffffff,
        0 0px 0 var(--key-shadow),
        0 1px 1px rgba(0, 0, 0, 0.2);
}

/* Textured scroll wheel */
.scroll-wheel {
    width: 8px;
    height: 40px;
    background: repeating-linear-gradient(to bottom, #0a0a0c, #0a0a0c 2px, #333 2px, #333 3px);
    border-radius: 4px;
    margin-top: 6px;
    box-shadow:
        inset 0 6px 4px rgba(0, 0, 0, 0.9),
        inset 0 -6px 4px rgba(0, 0, 0, 0.9),
        0 1px 0 rgba(255, 255, 255, 0.1);
}

.action-desc .highlight {
    color: #ff4757;
    font-size: 11px;
    font-style: italic;
    margin-left: 8px;
    background: rgba(255, 71, 87, 0.1);
    padding: 3px 6px;
    border-radius: 4px;
}

.wasd-layout {
    display: grid;
    grid-template-areas:
        ". w ."
        "a s d";
    gap: 6px;
    justify-content: flex-end;
}

.wasd-layout kbd:nth-child(1) {
    grid-area: w;
}

.wasd-layout kbd:nth-child(2) {
    grid-area: a;
}

.wasd-layout kbd:nth-child(3) {
    grid-area: s;
}

.wasd-layout kbd:nth-child(4) {
    grid-area: d;
}