/* ==========================================
   TUGUEL CONSOLAS - Fichas de Consolas
   ========================================== */

/* ── Cabecera sección ── */
.fichas-section-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.fichas-count {
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: .25rem;
}

/* ── Barra de filtros ── */
.fichas-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.25rem;
    padding: .75rem 1rem;
    background: var(--surface-2, #1a1a2e);
    border-radius: 10px;
    border: 1px solid var(--border);
}
.fichas-filters select,
.fichas-filters input[type="text"] {
    background: var(--surface, #0f0f1a);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .4rem .65rem;
    font-size: .8rem;
    font-family: inherit;
    flex: 1 1 130px;
    max-width: 200px;
    transition: border-color .2s;
}
.fichas-filters select:focus,
.fichas-filters input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}
.fichas-filters label {
    font-size: .7rem;
    color: var(--text-muted);
    align-self: center;
}
.fichas-filter-group {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

/* ── Grid ── */
.fichas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}
.fichas-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* ── Tarjeta ── */
.ficha-card {
    background: var(--surface, #0f1930);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease;
    cursor: default;
}
.ficha-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 36px rgba(0,0,0,.5);
    border-color: var(--brand-accent, rgba(255,255,255,.2));
}

/* ── Zona imagen ── */
.ficha-card-img-wrap {
    position: relative;
    height: 155px;
    background: var(--brand-bg, #1a1a2e);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ficha-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: .5rem;
    transition: transform .3s ease;
    /* Oculta el icono roto y el alt text mientras carga */
    color: transparent;
    font-size: 0;
}
.ficha-card:hover .ficha-card-img-wrap img {
    transform: scale(1.05);
}

/* Placeholder cuando no hay imagen */
.ficha-ph {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--c1, #1a1a2e) 0%, var(--c2, #2d2d50) 100%);
}
.ficha-ph-icon {
    font-size: 2.8rem;
    opacity: .65;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.5));
}
.ficha-ph-name {
    font-size: .65rem;
    color: rgba(255,255,255,.5);
    text-align: center;
    padding: .4rem .75rem 0;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: .05em;
}

/* Badge ROCKNIX sobre la imagen */
.ficha-rocknix-badge {
    position: absolute;
    top: .5rem;
    right: .5rem;
    background: linear-gradient(135deg, #6a0dad, #9c27b0);
    color: #fff;
    font-size: .55rem;
    font-weight: 800;
    letter-spacing: .1em;
    padding: .2rem .45rem;
    border-radius: 4px;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0,0,0,.4);
}

/* ── Cuerpo tarjeta ── */
.ficha-card-body {
    padding: .8rem;
    display: flex;
    flex-direction: column;
    gap: .45rem;
    flex: 1;
}
.ficha-brand {
    font-size: .6rem;
    color: var(--brand-accent, #aaa);
    font-weight: 800;
    letter-spacing: .15em;
    text-transform: uppercase;
    line-height: 1;
}
.ficha-model {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-top: .05rem;
}
.ficha-versions {
    font-size: .65rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Specs en dos columnas */
.ficha-specs-dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: .18rem .6rem;
    font-size: .73rem;
    margin: 0;
}
.ficha-specs-dl dt {
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}
.ficha-specs-dl dd {
    color: var(--text-primary);
    margin: 0;
    word-break: break-word;
}

/* Precio */
.ficha-price-wrap {
    display: flex;
    align-items: baseline;
    gap: .25rem;
}
.ficha-price-label {
    font-size: .65rem;
    color: var(--text-muted);
}
.ficha-price {
    font-size: .95rem;
    font-weight: 800;
    color: var(--accent, #7b68ee);
}

/* Badges OS */
.ficha-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}
.os-badge {
    padding: .18rem .5rem;
    border-radius: 5px;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .04em;
}
.os-badge-android  { background: #1B5E20; color: #A5D6A7; }
.os-badge-rocknix  { background: #4A148C; color: #E1BEE7; }
.os-badge-linux    { background: #1A237E; color: #BBDEFB; }
.os-badge-knulli   { background: #004D40; color: #A7FFEB; }
.os-badge-other    { background: #263238; color: #CFD8DC; }

/* Plataformas >90% */
.ficha-plats-label {
    font-size: .6rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: .05em;
    margin-top: .1rem;
}
.ficha-plats {
    display: flex;
    flex-wrap: wrap;
    gap: .22rem;
}
.plat-badge {
    padding: .12rem .38rem;
    border-radius: 4px;
    font-size: .58rem;
    font-weight: 700;
    white-space: nowrap;
}
.plat-nintendo  { background: #C62828; color: #fff; }
.plat-sony      { background: #1565C0; color: #fff; }
.plat-sega      { background: #2d2d2d; color: #e0e0e0; border: 1px solid #555; }
.plat-microsoft { background: #1B5E20; color: #fff; }
.plat-arcade    { background: #E65100; color: #fff; }
.plat-other     { background: #424242; color: #ccc; }

/* ── Responsive ── */
@media (max-width: 600px) {
    .fichas-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: .75rem;
    }
    .fichas-filters select,
    .fichas-filters input[type="text"] {
        max-width: none;
    }
}
