:root {
    --bp-bg-start: #1e1b4b;
    --bp-bg-end: #3b0764;
    --bp-primary: #4f46e5;
    --bp-primary-hover: #4338ca;
    --bp-purple: #7c3aed;
    --bp-purple-dark: #5b21b6;
    --bp-surface: #f5f3ff;
    --bp-card-bg: #ffffff;
    --bp-border: #c4b5fd;
    --bp-text: #1e3a8a;
    --bp-muted: #1e3a8a;
}

html {
    scroll-behavior: smooth;
}

.bp-cards-wrapper {
    background: linear-gradient(135deg, var(--bp-bg-start) 0%, var(--bp-bg-end) 100%);
    color: #f5f3ff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 28px rgba(30, 27, 75, 0.35);
    margin: 12px 0;
}

.bp-cards-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.bp-cards-title {
    margin: 0;
    font-size: 1.5rem;
    color: #ffffff;
}

.bp-jump-received-link {
    display: inline-block;
    background: #ffffff;
    color: #1e3a8a !important;
    font-weight: 700;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 7px;
    border: 2px solid #1e3a8a;
    white-space: nowrap;
}

.bp-jump-received-link:hover {
    background: #dbeafe;
    color: #172554 !important;
}

.bp-search-box {
    position: relative;
    flex: 1 1 300px;
    max-width: 420px;
}

.bp-search-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 2px solid #818cf8;
    background: #1e1b4b;
    color: #ffffff;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.bp-search-input:focus {
    outline: none;
    border-color: #c084fc;
    box-shadow: 0 0 0 3px rgba(192, 132, 252, 0.25);
}

.bp-guess-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 40;
    background: #2e1065;
    border: 1px solid #a78bfa;
    border-radius: 8px;
    margin-top: 4px;
    max-height: 220px;
    overflow-y: auto;
    display: none;
}

.bp-guess-list.active {
    display: block;
}

.bp-guess-item {
    padding: 8px 12px;
    cursor: pointer;
    color: #f3e8ff;
    border-bottom: 1px solid rgba(196, 181, 253, 0.15);
}

.bp-guess-item:hover {
    background: linear-gradient(90deg, var(--bp-primary), var(--bp-purple));
    color: #ffffff;
}

.bp-grid-20x20 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.bp-card-tile {
    background: #ffffff;
    color: #1e3a8a;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--bp-border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.bp-card-tile:hover,
.bp-card-tile.selected {
    transform: translateY(-2px);
    border-color: #9333ea;
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.28);
}

.bp-card-thumb {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: #312e81;
}

.bp-card-body {
    padding: 10px 12px;
}

.bp-card-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: #1e3a8a !important;
    margin: 0 0 6px;
}

.bp-card-tags {
    font-size: 0.76rem;
    color: #1e3a8a !important;
    margin-bottom: 8px;
}

.bp-btn {
    background: linear-gradient(135deg, var(--bp-primary), var(--bp-purple));
    color: #ffffff !important;
    border: none;
    border-radius: 7px;
    padding: 8px 14px;
    font-weight: 600;
    cursor: pointer;
}

.bp-btn:hover {
    background: linear-gradient(135deg, var(--bp-primary-hover), var(--bp-purple-dark));
}

.bp-load-more-wrap {
    text-align: center;
    margin-top: 20px;
}

.bp-exchange-panel,
.bp-exchange-panel h3,
.bp-exchange-panel h4,
.bp-exchange-panel p,
.bp-exchange-panel label,
.bp-exchange-panel span,
.bp-exchange-panel div,
.bp-exchange-panel small,
.bp-exchange-panel strong {
    color: #1e3a8a !important;
}

.bp-exchange-panel {
    margin-top: 24px;
    background: #ffffff !important;
    border-radius: 10px;
    padding: 16px;
    border: 2px solid #1e3a8a;
}

.bp-exchange-panel h3,
.bp-exchange-panel h4 {
    margin-top: 0;
    font-weight: 700;
}

.bp-exchange-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.bp-exchange-row input,
.bp-exchange-row textarea {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #1e3a8a;
    background: #0b192c;
    color: #ffffff !important;
}

.bp-history-list {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}

.bp-history-item {
    background: #ffffff !important;
    border: 1px solid #93c5fd;
    border-left: 4px solid #1e3a8a;
    padding: 10px;
    border-radius: 6px;
}

.bp-received-section {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 2px solid #1e3a8a;
}

/* Screen-fit modal with dark blue text on white background */
.bp-card-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 14px;
    overflow: hidden;
    box-sizing: border-box;
}

.bp-card-modal-backdrop.open {
    display: flex;
}

.bp-card-modal-dialog,
.bp-card-modal-dialog h3,
.bp-card-modal-dialog p,
.bp-card-modal-dialog div,
.bp-card-modal-dialog span,
.bp-card-modal-dialog small,
.bp-card-modal-dialog strong {
    color: #1e3a8a !important;
}

.bp-card-modal-dialog {
    background: #ffffff !important;
    border-radius: 12px;
    width: auto;
    max-width: 94vw;
    max-height: 92vh;
    overflow: hidden;
    padding: 14px 18px 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    border: 2px solid #1e3a8a;
    position: relative;
    box-sizing: border-box;
}

.bp-card-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 8px;
}

.bp-card-modal-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.bp-card-modal-meta {
    margin-bottom: 8px;
    font-size: 0.92rem;
}

.bp-card-modal-close {
    background: #1e3a8a !important;
    color: #ffffff !important;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-weight: 700;
    cursor: pointer;
}

.bp-card-modal-close:hover {
    background: #172554 !important;
}

.bp-card-fit-stage {
    overflow: hidden;
    max-width: 88vw;
    max-height: 64vh;
    text-align: center;
    background: #ffffff;
    padding: 4px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bp-card-fit-img {
    display: block;
    max-width: 86vw;
    max-height: 60vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
}

.bp-received-card-box {
    border: 1px solid #cbd5e1;
    background: #ffffff !important;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.bp-received-card-box:last-child {
    margin-bottom: 0;
}

.bp-clickable-exchange-img {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bp-clickable-exchange-img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}
