/* =========================
   BASE
========================= */

body {
    background-color: #1a1d1f;
    color: #efefef;
    font-family: 'Inter', system-ui, sans-serif;
    margin: 0;

    background-image: url('../images/BG/BG.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.container-main {

    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 10px;
    box-sizing: border-box;
}

h1 {

    text-align: center;
    margin: 30px 0 10px;
}

.card-stats .completed {
    color: #00c896;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.card-note {
    width: 100%;
    background: #1a1d1f;
    border: 1px solid #333;
    border-radius: 6px;
    color: #ffcc66;
    font-size: 13px;
    padding: 4px 6px;
    margin-bottom: 4px;
    box-sizing: border-box;
    outline: none;
    text-align: center;
}

.card-note::placeholder {
    color: #555;
}

.card-note:focus {
    border-color: #ffcc66;
}
/* =========================
   BANNER
========================= */

.top-banner {

    width: 100%;
    max-width: 1000px;
    margin: 20px auto;
}

.top-banner img {

    width: 100%;
    border-radius: 14px;
    display: block;
}

.banner-link {

    display: block;
}
/* =========================
   FILTERS
========================= */

.filters {

    width: 100%;
    max-width: 1100px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin: 22px auto;
    padding: 0 12px;
    box-sizing: border-box;
}

/* =========================
   BUTTONS
========================= */

.filter-btn {

    background: #1f2328;
    border: 1px solid #4b5563;
    color: #f3f4f6;
    border-radius: 18px;
    cursor: pointer;
    font-size: 29px;
    font-weight: 400;
    height: 76px;
    min-width: 170px;
    padding: 0 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.filter-btn:hover {

    background: #2b3138;
    border-color: #6b7280;
    transform: translateY(-2px);
}

.filter-btn.active {

    background: #ff2d55;
    border-color: #ff2d55;
    color: white;
    box-shadow: 0 0 14px rgba(255,45,85,0.45);
}

/* =========================
   EXIT BUTTON
========================= */

.exit-btn {

    width: 76px;
    min-width: 76px;
    height: 76px;
    padding: 0;
    background: #1f2328;
    border: 1px solid #4b5563;
}

.exit-btn img {

    width: 55px;
    height: 55px;
    filter: brightness(0) invert(1);
}

/* =========================
   WISH BUTTON
========================= */

.filter-wish {

    width: 76px;
    min-width: 76px;
    height: 76px;
    padding: 0;
    font-size: 37px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    display: flex;
    line-height: 1;
    
}

.filter-wish span {

    position: relative;
    top: -1px;
}

/* =========================
   SEARCH
========================= */

.search-container {

    width: 100%;
    max-width: 900px;
    margin: 24px auto;
    padding: 0 12px;
    box-sizing: border-box;
}

.search-input {

    width: 100%;
    height: 72px;
    background: #1f2328;
    border: 1px solid #4b5563;
    border-radius: 18px;
    padding: 0 18px;
    color: white;
    font-size: 24px;
    outline: none;
    box-sizing: border-box;
}

.search-input::placeholder {

    color: #9ca3af;
}

/* =========================
   COLLECTIONS GRID
========================= */

.collections-grid {

    display: grid;
    grid-template-columns: repeat(auto-fill, 180px);
    gap: 16px;
    margin-top: 30px;
    justify-content: center;
}

/* =========================
   COLLECTION CARD
========================= */

.collection-card {

    position: relative;
    display: block;
    text-decoration: none;
    color: inherit;
    background: #111;
    border-radius: 14px;
    padding: 6px;
    border: 1px solid #2a2a2a;
    overflow: visible;
}

.collection-card img {

    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

/* =========================
   DELETE BUTTON
========================= */

.delete-btn {

    position: absolute;

    top: -8px;
    right: -8px;
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    z-index: 10;
}

.delete-btn img {

    width: 100%;
    height: 100%;
    object-fit: contain;
}



/* =========================
   CARD INFO
========================= */

.card-info {

    margin-top: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 68px;
}

.card-name {

    font-size: 14px;
    font-weight: 500;
    color: #d1d5db;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-stats {

    margin-top: 6px;
    display: flex;
    justify-content: center;
    gap: 4px;
    font-size: 16px;
    font-weight: 700;
}

.card-stats .owned {
    color: #00c896;
}

.card-stats .missing {
    color: #ff2a4a;
}

.card-stats .separator {
    color: #6b7280;
}

/* =========================================
   COLLECTION DETAIL
========================================= */

.cards-section {

    width: 100%;
}

.cards-grid {

    display: grid;
    grid-template-columns: repeat(auto-fill, 180px);
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}

/* CARD */

.card-item {

    position: relative;
    background: #111;
    border-radius: 12px;
    padding: 6px;
    border: 1px solid #2a2a2a;
    overflow: visible;
}

.card-item img {

    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* NUMBER */

.card-number {

    text-align: center;
    margin-top: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #d1d5db;
}

/* BUTTON AREA */

.card-btn {

    position: relative;
    height: 44px;
    border-radius: 10px;
    overflow: hidden;
    background: #222;
    border: 1px solid #333;
}

.card-btn.owned {

    background: #00c896;
}

/* MAIN BUTTON */

.btn-main {

    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-main svg {

    width: 24px;
    height: 24px;
    fill: white;
}

/* CLOCK */

.btn-clock {

    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    cursor: pointer;
}

.btn-clock img {

    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* WISH */

.btn-wish {

    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    opacity: 0.5;
    cursor: pointer;
}

.btn-wish.active {

    opacity: 1;
}

.btn-wish img {

    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* DATE LABEL */

.date-label {

    font-size: 12px;
    font-weight: 700;
    color: #ffcc66;
}

/* STATS */

.stats-bar {

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin: 30px 0;
}

.stat {

    text-align: center;
}

.stat span {

    display: block;
    font-size: 34px;
    font-weight: 700;
}
/* OWNED / MISSING COLORS */

.stats-bar .stat:first-child span {

    color: #00c896;
}

.stats-bar .stat:last-child span {

    color: #ff2a4a;
}


.stat small {

    font-size: 12px;
    color: #9ca3af;
}

/* PROGRESS */

.progress-ring {

    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222;
    position: relative;
}

.progress-ring::before {

    content: "";
    position: absolute;
    width: 96px;
    height: 96px;
    background: #111;
    border-radius: 50%;
}

.ring-content {

    position: relative;
    z-index: 2;
    text-align: center;
}


/* =========================================
   ONGOING BUTTON
========================================= */

/* Contenedor interactivo plano para el SVG (sin fondos ni halos) */
.ongoing-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    vertical-align: middle;
    transform: translateY(4px);
}

/* Estado DESACTIVADO: Icono blanco con opacidad/atenuado */
.ongoing-indicator img {
    filter: brightness(0) invert(1) opacity(0.25);
    transition: filter 0.2s ease;
    width: 40px !important; 
    height: 40px !important;
}

/* Estado ACTIVADO: Aplicamos el filtro para transformar el blanco en tu rosa/rojo exacto (#ff2a54) */
.ongoing-indicator.ongoing-active img {
    filter: brightness(0) invert(23%) sepia(91%) saturate(5430%) hue-rotate(338deg) brightness(99%) contrast(108%) !important;
}


/* =========================================
   DESKTOP COMPACT MODE
========================================= */

@media (min-width: 900px) {

    .container-main {
        max-width: 1600px;
    }

    /* BOTONES */

    .filter-btn {

        height: 56px;
        min-width: 120px;
        font-size: 22px;
        border-radius: 14px;
        padding: 0 24px;
    }

    .exit-btn,
    .filter-wish {

        width: 56px;
        min-width: 56px;
        height: 56px; display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        padding-top: 1px;
    }

.filter-wish span {
    position: relative;
    top: -1px;
}

    .exit-btn img {

        width: 34px;
        height: 34px;
    }

    /* SEARCH */

    .search-input {

        height: 56px;
        font-size: 20px;
    }

    /* COLLECTIONS */

    .collections-grid {

        grid-template-columns: repeat(auto-fill, 180px);
        gap: 16px;
        justify-content: center;
    }

    /* DETAIL */

    .cards-grid {

        grid-template-columns: repeat(auto-fill, 180px);
        gap: 16px;
       justify-content: center;
    }

    /* TITLES */

    h1 {
        font-size: 48px;
    }

    .card-name {
        font-size: 15px;
    }
}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 600px) {

    /* CONTENEDOR */

    .container-main {
        padding: 14px 8px;
    }

    /* TITULO */

    h1 {

        font-size: 28px;
        margin: 20px 0 14px;
    }

.filters:nth-of-type(1) .filter-btn {
    font-size: 14px;
}

    /* FILTROS */

    .filters {

        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        margin: 8px auto;
        width: fit-content;
        max-width: 100%;
    }

    /* BOTON NORMAL */

    .filter-btn {

        height: 38px;
        min-width: 92px;
        padding: 0 10px;
        font-size: 25px;
        border-radius: 10px;
    }

    /* BOTONES ICONO */

    .exit-btn,
    .filter-wish {

        width: 40px;
        min-width: 40px;
        height: 38px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* ICONO SALIR */

    .exit-btn img {

        width: 16px;
        height: 16px;
        display: block;
    }

    /* ESTRELLA */

    .filter-wish {

        font-size: 17px;
        line-height: 1;
    }

    .filter-wish span {

        position: relative;
        top: -1px;
    }

    /* SEGUNDA FILA */

    .filters:nth-of-type(2) {

        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
        max-width: 420px;
    }

    .filters:nth-of-type(2) .filter-btn {

        min-width: 60px;
        height: 36px;
        font-size: 13px;
        padding: 0 8px;
    }

    /* SEARCH */

    .search-container {

        padding: 0 6px;
        margin-top: 18px;
    }

    .search-input {

        height: 52px;
        font-size: 18px;
        border-radius: 14px;
    }

    /* GRID */

    .collections-grid {

        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-top: 14px;
    }


.card-item {

    padding: 4px;
    border-radius: 10px;
}

.card-number {

    font-size: 11px;
    margin-top: 4px;
    margin-bottom: 4px;
}

.card-btn {

    height: 34px;
}

    /* CARD */

    .collection-card {

        padding: 4px;
        border-radius: 10px;
    }

    .card-info {

        min-height: 42px;
    }

    .card-name {

        font-size: 10px;
        line-height: 1.1;
    }

    .card-stats {

        font-size: 11px;
        margin-top: 2px;
    }

.card-item {

    padding: 4px !important;
}
.cards-grid {

    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
}

    /* DELETE */

    .delete-btn {

        width: 22px;
        height: 22px;
        top: -4px;
        right: -4px;
    }
}

/* ========================================
   IMAGE VIEWER
======================================== */

.image-viewer {

    position: fixed;
    inset: 0;

    background: rgba(0,0,0,0.92);

    display: flex;
    justify-content: center;
    align-items: center;

    opacity: 0;
    pointer-events: none;

    transition: 0.25s ease;

    z-index: 99999;
}

.image-viewer.active {

    opacity: 1;
    pointer-events: auto;
}

.image-viewer img {

    max-width: 90%;
    max-height: 90%;

    object-fit: contain;

    border-radius: 12px;

    box-shadow: 0 0 40px rgba(0,0,0,0.5);

    transform: scale(0.9);

    transition: 0.25s ease;
}

.image-viewer.active img {

    transform: scale(1);
}

.close-viewer {

    position: absolute;

    top: 20px;
    right: 30px;

    font-size: 50px;
    color: white;

    cursor: pointer;

    user-select: none;

    z-index: 2;
}

