.backup-panel {
    display: flex;
    flex-direction: column;
    gap: .7rem;
    padding: 1rem 1.2rem;
    background: #f8fbff;
    border: 2px solid #dce7f8;
    border-radius: 16px;
}

.backup-title {
    font-size: 1.05rem;
    margin: 0;
    color: #2c3e50;
}

.backup-subtitle {
    font-size: .82rem;
    color: #667;
    line-height: 1.4;
    margin: 0;
    text-align: center;
}

.backup-pick-title {
    font-size: .82rem;
    font-weight: 700;
    color: #555;
    margin: 0;
    text-align: left;
}

.backup-players {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .9rem;
}

.backup-player-row {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .9rem;
    cursor: pointer;
}

.backup-player-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.backup-player-avatar {
    font-size: 1.3rem;
    line-height: 1;
}

.backup-player-name {
    font-weight: 600;
    color: #333;
}

.backup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.backup-panel button.backup-btn {
    margin: 0;
    padding: .55rem .9rem;
    font-size: .9rem;
    border-radius: 10px;
    background: var(--primary);
    color: white;
}

.backup-panel button.backup-btn:hover {
    opacity: .9;
}

.backup-status {
    font-size: .85rem;
    color: #555;
    margin: 0;
    min-height: 1.2em;
}

.backup-qr-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
}

.backup-qr-img {
    max-width: min(94vw, 560px);
    height: auto;
    border: 2px solid #eee;
    border-radius: 12px;
    background: white;
    padding: .6rem;
    image-rendering: pixelated;
}

.backup-scan-video {
    width: 100%;
    max-width: 320px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.backup-panel button.backup-scan-stop {
    margin: 0;
    padding: .5rem 1rem;
    font-size: .85rem;
    border-radius: 10px;
    background: #dc3545;
    color: white;
}

.backup-hint {
    font-size: .8rem;
    color: #888;
    margin: 0;
}

.backup-paste-area {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    width: 100%;
}

.backup-paste-input {
    width: 100%;
    padding: .5rem;
    border: 2px solid #dce7f8;
    border-radius: 10px;
    font-family: inherit;
    font-size: .85rem;
    resize: vertical;
    box-sizing: border-box;
}

.backup-hidden {
    display: none;
}

.backup-toast {
    position: fixed;
    left: 50%;
    top: 1.2rem;
    transform: translateX(-50%);
    z-index: 9999;
    max-width: min(92vw, 460px);
    padding: .7rem 1.1rem;
    border-radius: 12px;
    background: #1f7a3d;
    color: white;
    font-size: .92rem;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .28);
    animation: backup-toast-in .25s ease-out;
}

.backup-toast.warn {
    background: #c0392b;
}

@keyframes backup-toast-in {
    from {
        opacity: 0;
        transform: translate(-50%, -12px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}