/* =====================================================
   BGG Collection Plugin – Estils v1.2
   ===================================================== */

.bggc-wrapper {
    margin: 1.5em 0;
    font-family: inherit;
}

.bggc-title {
    font-size: 1.4em;
    margin-bottom: 0.5em;
}

.bggc-count {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 1em;
}

/* ── Cercador ────────────────────────────────────── */

.bggc-controls {
    margin-bottom: 0.75em;
}

.bggc-search {
    width: 100%;
    max-width: 380px;
    padding: 0.5em 0.85em;
    font-size: 0.95em;
    border: 1px solid #ccc;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.bggc-search:focus {
    border-color: #FF6600;
    box-shadow: 0 0 0 3px rgba(255,102,0,0.15);
}

/* ── Filtre per lletra ───────────────────────────── */

.bggc-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 1em;
}

.bggc-letter-btn {
    padding: 4px 9px;
    font-size: 0.82em;
    font-weight: 600;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f7f7f7;
    color: #444;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1.4;
}

.bggc-letter-btn:hover {
    background: #ffe8d6;
    border-color: #FF6600;
    color: #c04a00;
}

.bggc-letter-btn.bggc-letter-active {
    background: #FF6600;
    border-color: #FF6600;
    color: #fff;
}

/* ── Graella ─────────────────────────────────────── */

.bggc-grid {
    display: grid;
    gap: 1rem;
}

.bggc-cols-1 { grid-template-columns: repeat(1, 1fr); }
.bggc-cols-2 { grid-template-columns: repeat(2, 1fr); }
.bggc-cols-3 { grid-template-columns: repeat(3, 1fr); }
.bggc-cols-4 { grid-template-columns: repeat(4, 1fr); }
.bggc-cols-5 { grid-template-columns: repeat(5, 1fr); }
.bggc-cols-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 900px) {
    .bggc-cols-4,
    .bggc-cols-5,
    .bggc-cols-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
    .bggc-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 360px) {
    .bggc-grid { grid-template-columns: 1fr !important; }
}

/* ── Targeta ─────────────────────────────────────── */

.bggc-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.bggc-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.13);
    transform: translateY(-2px);
}

.bggc-card a {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* ── Imatge ──────────────────────────────────────── */

.bggc-thumb-wrap {
    width: 100%;
    padding-top: 100%;
    position: relative;
    background: #f4f4f4;
    overflow: hidden;
}

.bggc-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.bggc-card:hover .bggc-thumb {
    transform: scale(1.04);
}

.bggc-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bggc-no-image span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #ccc;
}

/* ── Informació ──────────────────────────────────── */

.bggc-info {
    padding: 0.6em 0.75em 0.75em;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.bggc-name {
    font-weight: 600;
    font-size: 0.9em;
    margin: 0 0 0.2em;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bggc-year {
    font-size: 0.78em;
    color: #888;
    margin: 0 0 0.4em;
}

.bggc-meta {
    display: flex;
    gap: 0.5em;
    flex-wrap: wrap;
    margin-top: auto;
}

.bggc-rating,
.bggc-rank {
    font-size: 0.75em;
    background: #f0f0f0;
    border-radius: 4px;
    padding: 2px 6px;
    color: #555;
    white-space: nowrap;
}

.bggc-rating { color: #b8860b; }
.bggc-rank   { color: #4a6fa5; }

/* ── Botó "Carrega més" ──────────────────────────── */

.bggc-load-more-wrap {
    text-align: center;
    margin-top: 1.5em;
}

.bggc-load-more {
    padding: 0.6em 1.8em;
    font-size: 0.95em;
    font-weight: 600;
    background: #FF6600;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.bggc-load-more:hover {
    background: #cc5200;
    transform: translateY(-1px);
}

.bggc-load-more:active {
    transform: none;
}

/* ── Sense resultats ─────────────────────────────── */

.bggc-no-results {
    text-align: center;
    padding: 2em;
    color: #888;
    font-size: 0.95em;
}

/* ── Logo "Powered by BGG" ───────────────────────── */

.bggc-powered-by {
    margin-top: 1.25em;
    text-align: right;
}

.bggc-bgg-logo {
    height: 32px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
    transition: opacity 0.2s;
}

.bggc-powered-by a:hover .bggc-bgg-logo {
    opacity: 0.85;
}

/* ── Missatges d'error / avís ─────────────────────── */

.bggc-error,
.bggc-notice {
    padding: 0.75em 1em;
    border-radius: 6px;
    font-size: 0.9em;
}

.bggc-error  { background: #fff0f0; border-left: 4px solid #e55; color: #700; }
.bggc-notice { background: #fff8e1; border-left: 4px solid #f0b429; color: #6b5000; }
