/* ── Controls / Remapping Window ─────────────────────────────────────────── */

.controls-window {
    padding: 2px;
}

.controls-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
    padding: 8px 6px;
    background: #000080;
    color: #fff;
    border: 2px inset #808080;
}

.controls-hint {
    font-size: 10px;
    line-height: 1.6;
    color: #cce;
}

.controls-hint kbd {
    background: #444;
    color: #fff;
    padding: 0 4px;
    border-radius: 2px;
    font-size: 9px;
    font-family: monospace;
}

/* ── Controls table ── */
.controls-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    margin-bottom: 8px;
}

.controls-table thead tr {
    background: #c0c0c0;
    border-bottom: 2px solid #808080;
}

.controls-table th {
    text-align: left;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: bold;
    color: #333;
    border-bottom: 2px inset #aaa;
}

.controls-table tbody tr {
    border-bottom: 1px solid #ddd;
    transition: background 0.1s;
}

.controls-table tbody tr:hover {
    background: #e8e8ff;
}

/* Badge for D-Pad / action / center button types */
.ctrl-icon-cell {
    width: 36px;
    padding: 5px 4px 5px 8px;
    text-align: center;
}

.ctrl-btn-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    font-family: monospace;
}

.ctrl-badge-dpad {
    background: #333;
    color: #fff;
    border: 1px solid #000;
    border-radius: 2px;
}

.ctrl-badge-action {
    background: #cc0000;
    color: #fff;
    border-radius: 50%;
    border: 1px solid #800000;
    font-size: 10px;
}

.ctrl-badge-center {
    background: #444;
    color: #ccc;
    border-radius: 3px;
    border: 1px solid #222;
    font-size: 8px;
    width: 28px;
}

.ctrl-label-cell {
    padding: 5px 8px;
    color: #222;
    font-size: 11px;
    min-width: 90px;
}

.ctrl-key-cell {
    padding: 4px 8px;
}

/* The clickable "current key" button */
.ctrl-key-btn {
    min-width: 72px;
    padding: 3px 10px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    background: #fff;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    box-shadow: inset -1px -1px 0 #dfdfdf;
    color: #000080;
    transition: background 0.1s, color 0.1s;
}

.ctrl-key-btn:hover {
    background: #e8e8ff;
    color: #000;
}

.ctrl-key-btn:active {
    border-color: #ffffff #808080 #808080 #ffffff;
    padding: 4px 9px 2px 11px;
}

/* "Waiting for key" state */
.ctrl-key-btn.remapping {
    background: #ffff99;
    color: #cc6600;
    border-color: #cc6600 #ffcc00 #ffcc00 #cc6600;
    animation: remapping-pulse 0.7s ease-in-out infinite alternate;
}

@keyframes remapping-pulse {
    from { background: #ffff99; }
    to   { background: #ffe066; }
}

/* Flash green on successful remap */
.ctrl-key-btn.remap-confirm {
    background: #ccffcc;
    color: #006600;
    border-color: #006600 #ccffcc #ccffcc #006600;
}

/* ── Controls footer ── */
.controls-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 6px;
    border-top: 1px solid #ccc;
}

.controls-status-msg {
    font-size: 10px;
    color: #006600;
    font-style: italic;
    flex: 1;
}