:root {
    --bg: #0b0d0f;
    --page-bg: #1a1d21;
    --gold: #ffd700;
    --blue-pgo: #00aaff;
}

body {
    background-color: var(--bg);
    color: white;
    font-family: 'Segoe UI', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding-bottom: 50px;
}

/* HEADER */

.header-fixed {
    position: sticky;
    top: 0;
    width: 100%;
    background: rgba(11, 13, 15, 0.98);
    z-index: 1000;
    border-bottom: 2px solid #333;
    text-align: center;
    padding: 10px 0;
    backdrop-filter: blur(8px);
}

.stats-text {
    font-size: 0.8rem;
}

.page-info {
    font-size: 0.7rem;
    color: #888;
    margin-top: 5px;
}

.progress-bar-bg {
    width: 85%;
    height: 8px;
    background: #222;
    border-radius: 4px;
    margin: 8px auto;
    overflow: hidden;
}

#progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--blue-pgo), #00ffcc);
    transition: width 0.3s;
}

/* BOTONES */

.data-management {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.btn-data {
    font-size: 10px;
    padding: 5px 10px;
    background: #333;
    border: 1px solid #555;
    color: #ccc;
    cursor: pointer;
    border-radius: 4px;
}

.nav-controls {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-btn {
    background: #222;
    color: white;
    border: 1px solid #444;
    padding: 10px 25px;
    border-radius: 6px;
    font-weight: bold;
}

/* ÁLBUM */

.album-viewport {
    width: 360px;
    max-width: 95%;
    overflow: hidden;
    margin: 15px 0;
    border: 6px solid #222;
    border-radius: 12px;
    background: var(--page-bg);
    touch-action: pan-y;
    position: relative;
}

.pages-container {
    display: flex;
    transition: transform 0.3s ease;
    will-change: transform;
}

.page {
    min-width: 360px;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px;
    box-sizing: border-box;
}

.card-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.card-img {
    width: 100px;
    height: 140px;
    background-size: cover;
    border-radius: 6px;
    filter: grayscale(1) brightness(0.85);
    transition: all 0.3s;
    border: 1px solid #444;
    cursor: pointer;
}

.card-img.mastered {
    box-shadow: 0 0 12px var(--gold), 0 0 25px var(--gold);
}

.card-id {
    font-size: 8px;
    color: #666;
}

.check-card {
    display: none;
}

.check-card:checked + .card-img {
    filter: grayscale(0) brightness(1);
    border-color: var(--gold);
}

.toast { 
    position: fixed; 
    bottom: 20px; 
    left: 50%; 
    transform: translateX(-50%) translateY(100px); 
    background: #2ed573; 
    color: #000; 
    padding: 15px 25px; 
    border-radius: 25px; 
    opacity: 0; 
    transition: all 0.3s; 
    z-index: 9999; 
    font-weight: bold; 
} 

.toast.show { 
    opacity: 1; 
    transform: translateX(-50%) translateY(0); 
}

/* MODAL */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.modal.hidden {
    display: none;
}

#modal-title{
    background-color: #fff;
    color: #000;
    margin-bottom: 10px;
    border-radius: 8px;
    padding: 5px;
}

.modal-content {
    background: var(--page-bg);
    border-radius: 12px;
    padding: 15px;
    width: 260px;
    max-width: 90%;
    text-align: center;
    border: 2px solid #333;
}

.modal-content img {
    border-radius: 8px;
    margin-bottom: 10px;
}

.variant-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin: 6px 0;
}

.page-numbers {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.page-num {
    font-size: 0.75rem;
    padding: 6px 10px;
    border-radius: 6px;
    background: #1a1d21;
    border: 1px solid #444;
    color: #aaa;
    cursor: pointer;
}

.page-num.active {
    background: var(--blue-pgo);
    color: #000;
    font-weight: bold;
}

/* ===== ANIMACIONES ===== */

/* Flip al completar */
@keyframes cardFlip {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}

.card-img.flip-animation {
  animation: cardFlip 0.6s ease;
}

/* Partículas doradas */
@keyframes particle-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100px) rotate(360deg);
    opacity: 0;
  }
}

.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: gold;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  animation: particle-fall 1.5s ease-out forwards;
}

/* Brillo dorado mejorado */
@keyframes golden-glow {
  0%, 100% { 
    box-shadow: 0 0 12px var(--gold), 0 0 25px var(--gold);
  }
  50% { 
    box-shadow: 0 0 20px var(--gold), 0 0 40px var(--gold), 0 0 60px var(--gold);
  }
}

.card-img.mastered {
  box-shadow: 0 0 12px var(--gold), 0 0 25px var(--gold);
  animation: golden-glow 2s ease-in-out infinite;
}

/* Transición suave en progreso */
#progress-fill {
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.stats-text {
  transition: all 0.3s ease;
}

/* ===== RAREZA EN MODAL ===== */
.modal-rarity-badge {
    width: 13px !important;
    height: 13px;
    margin-left: 6px;
    vertical-align: middle;
    margin-bottom: 0 !important;
}

/* ===== BADGE DE RAREZA ===== */
.rarity-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    padding: 2px;
    z-index: 10;
}

.rarity-badge img {
    width: 100%;
    height: 100%;
}

/* ===== CONTADOR DE VARIANTES (HOVER) ===== */
.variant-counter {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
    pointer-events: none;
    transition: transform 0.2s ease;
    z-index: 10;
    border: 1px solid var(--gold);
}

.card-slot:hover .variant-counter {
    transform: translateX(-50%) scale(1);
}

.variant-counter.complete {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
    border-color: #ffd700;
}

/* ===== FILTROS DE RAREZA ===== */
.filter-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #333;
}

.filter-label {
    font-size: 10px;
    color: #888;
    margin-bottom: 5px;
}

.rarity-filters {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.rarity-filter-btn {
    font-size: 9px;
    padding: 5px 10px;
    background: #222;
    border: 1px solid #444;
    color: #ccc;
    cursor: pointer;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.rarity-filter-btn img {
    width: 12px;
    height: 12px;
}

.rarity-filter-btn:hover {
    background: #333;
    border-color: #666;
}

.rarity-filter-btn.active {
    background: var(--blue-pgo);
    color: #000;
    border-color: var(--blue-pgo);
    font-weight: bold;
}

/* Mejorar posicionamiento relativo del card-slot */
.card-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative; /* ← Importante para los badges absolutos */
}

/* ===== MODAL DE COMPARTIR ===== */
.share-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 4000;
}

.share-modal.show {
    display: flex;
}

.share-modal-content {
    background: var(--page-bg);
    border-radius: 12px;
    padding: 20px;
    width: 400px;
    max-width: 90%;
    text-align: center;
    border: 2px solid #00aaff;
}

.share-modal-content img {
    width: 100%;
    border-radius: 8px;
    margin: 15px 0;
}

.share-link-box {
    background: #1a1d21;
    padding: 10px;
    border-radius: 8px;
    margin: 15px 0;
    word-break: break-all;
    font-size: 0.8rem;
    border: 1px solid #333;
}

.btn-copy {
    background: var(--blue-pgo);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin: 5px;
}

.btn-copy:hover {
    background: #00ffcc;
}

/* ===== MODAL DE COMPARACIÓN ===== */
.compare-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    overflow-y: auto;
}

.compare-modal.show {
    display: flex;
}

.compare-content {
    background: var(--page-bg);
    border-radius: 12px;
    padding: 20px;
    width: 600px;
    max-width: 95%;
    max-height: 80vh;
    overflow-y: auto;
    border: 2px solid #ffd700;
}

.compare-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.compare-stat {
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #333;
}

.compare-stat h4 {
    font-size: 0.8rem;
    color: #00ffcc;
    margin-bottom: 8px;
}

.compare-stat .number {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.difference-list {
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
    margin: 15px 0;
}

.difference-item {
    padding: 8px;
    margin: 5px 0;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    font-size: 0.85rem;
}

.difference-item.you-have {
    border-left: 3px solid #2ed573;
}

.difference-item.they-have {
    border-left: 3px solid #ff4757;
}

/* ===== SELECTOR DE SETS ===== */
.selector-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

.selector-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #00aaff, #00ffcc, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.selector-subtitle {
    color: #aaa;
    margin-bottom: 50px;
    font-size: 1.1rem;
}

.sets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.set-card {
    background: rgba(255,255,255,0.05);
    border: 2px solid #333;
    border-radius: 16px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.set-card:hover {
    transform: translateY(-8px);
    border-color: var(--blue-pgo);
    box-shadow: 0 8px 30px rgba(0,170,255,0.3);
}

.set-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--blue-pgo), #00ffcc);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.set-card:hover::before {
    transform: scaleX(1);
}

.set-logo {
    width: 200px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.set-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #fff;
}

.set-info {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.set-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.set-stat {
    text-align: center;
}

.set-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--blue-pgo);
}

.set-stat-label {
    font-size: 0.75rem;
    color: #666;
    margin-top: 5px;
}

.progress-mini {
    width: 100%;
    height: 6px;
    background: #222;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 15px;
}

.progress-mini-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue-pgo), #00ffcc);
    transition: width 0.3s ease;
}

.badge-new {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ff4757;
    color: white;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.coming-soon {
    opacity: 0.5;
    pointer-events: none;
}

.coming-soon-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.1);
    padding: 15px 30px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.2rem;
    border: 2px solid #666;
}

.set-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue-pgo);
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #2ed573;
    color: #000;
    padding: 15px 25px;
    border-radius: 25px;
    opacity: 0;
    transition: all 0.3s;
    z-index: 9999;
    font-weight: bold;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 400px) {
    .page {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 10px;
    }

    .card-img {
        width: 80px;
        height: 110px;
    }

    .nav-btn {
        padding: 8px 15px;
        font-size: 0.8rem;
    }

    .stats-text {
        font-size: 0.7rem;
    }

    .page-info {
        font-size: 0.65rem;
    }

    .btn-data {
        font-size: 9px;
        padding: 4px 8px;
    }

    .variant-row {
        font-size: 0.75rem;
    }

    .modal-content {
        padding: 10px;
    }

    .modal-content img {
        width: 140px;
    }
}

@media (max-width: 300px) {
    .page {
        grid-template-columns: 1fr;
    }

    .card-img {
        width: 70px;
        height: 100px;
    }

    .nav-btn {
        padding: 6px 10px;
        font-size: 0.7rem;
    }
}