*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #070810;
    --surface: #0c0e1a;
    --surface-2: #111426;
    --surface-hover: #161930;
    --border: #191d32;
    --border-2: #232840;
    --text: #ece9f4;
    --text-muted: #505570;
    --gold: #e8b84b;
    --gold-dim: rgba(232,184,75,0.12);
    --crimson: #e8273b;
    --crimson-dim: rgba(232,39,59,0.12);
    --cyan: #38d9f5;
    --green: #3de88a;
    --blue: #5b9cf6;
    --purple: #b06cff;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 8px 40px rgba(0,0,0,0.7);
    --transition: 0.22s ease;
    --font-display: 'Bebas Neue', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --font-mono: 'DM Mono', monospace;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    min-height: 100vh;
    line-height: 1.6;
}

/* Grain overlay for atmospheric depth */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.022;
    pointer-events: none;
    z-index: 9000;
}

a { color: inherit; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ── HEADER ─────────────────────────────────────────── */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 80px 0 64px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Subtle gold grid pattern */
.site-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(232,184,75,0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(232,184,75,0.035) 1px, transparent 1px);
    background-size: 56px 56px;
    pointer-events: none;
}

/* Radial glows */
.site-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 60% at 50% 110%, rgba(232,39,59,0.08) 0%, transparent 65%),
        radial-gradient(ellipse 50% 40% at 50% -10%, rgba(232,184,75,0.06) 0%, transparent 60%);
    pointer-events: none;
}

.header-content { position: relative; z-index: 1; }

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    margin-bottom: 14px;
}

.logo-icon {
    width: 56px;
    height: 56px;
    filter: drop-shadow(0 0 14px rgba(232,39,59,0.8));
    animation: pulse-glow 2.8s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 12px rgba(232,39,59,0.7)) brightness(1.05); }
    50%       { filter: drop-shadow(0 0 28px rgba(232,184,75,0.95)) brightness(1.25); }
}

.logo-text {
    font-family: var(--font-display);
    font-size: 4.4rem;
    letter-spacing: 5px;
    background: linear-gradient(95deg, var(--crimson) 0%, #ff6b35 30%, var(--gold) 65%, #fff0c0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.header-subtitle {
    color: var(--text-muted);
    font-size: 0.82rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    font-weight: 400;
    font-family: var(--font-mono);
}

/* ── SECTION ────────────────────────────────────────── */
.sets-section { margin: 72px 0; }

/* Colapso de secciones */
.sets-section .sets-grid {
    overflow: hidden;
    transition: opacity 0.2s ease;
}
.sets-section.collapsed .sets-grid {
    display: none;
}

.section-header {
    margin-bottom: 40px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.section-header-text { flex: 1; }
.collapsible-header { cursor: pointer; }

.section-collapse-btn {
    flex-shrink: 0;
    margin-top: 6px;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 6px;
    transition: background var(--transition), color var(--transition), transform 0.2s ease;
    display: flex;
    align-items: center;
}
.section-collapse-btn:hover { background: rgba(255,255,255,0.07); color: var(--text); }
.section-chevron { width: 22px; height: 22px; transition: transform 0.25s ease; }
.sets-section.collapsed .section-chevron { transform: rotate(180deg); }

/* Filtro rápido de colecciones */
.col-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 48px;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 10px 16px;
}
.col-filter-icon { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.col-filter-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 0.95rem;
    font-family: var(--font-body);
}
.col-filter-input::placeholder { color: var(--text-muted); }
.col-filter-count {
    font-size: 0.78rem;
    color: var(--blue);
    font-family: var(--font-mono);
    white-space: nowrap;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 18px;
    font-family: var(--font-display);
    font-size: 3.2rem;
    letter-spacing: 3px;
    line-height: 1;
    margin-bottom: 10px;
}

.era-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 10px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.era-badge.sv {
    background: rgba(124,58,237,0.1);
    color: var(--purple);
    border: 1px solid rgba(124,58,237,0.35);
}
.era-badge.sw {
    background: rgba(56,217,245,0.08);
    color: var(--cyan);
    border: 1px solid rgba(56,217,245,0.35);
}
.era-badge.me {
    background: var(--gold-dim);
    color: var(--gold);
    border: 1px solid rgba(232,184,75,0.35);
}
.era-badge.sm {
    background: rgba(249,115,22,0.1);
    color: #f97316;
    border: 1px solid rgba(249,115,22,0.35);
}
.era-badge.xy {
    background: rgba(232,39,59,0.1);
    color: var(--crimson);
    border: 1px solid rgba(232,39,59,0.35);
}
.era-badge.bw {
    background: rgba(148,163,184,0.1);
    color: #94a3b8;
    border: 1px solid rgba(148,163,184,0.35);
}
.era-badge.hgss {
    background: rgba(251,191,36,0.1);
    color: #fbbf24;
    border: 1px solid rgba(251,191,36,0.35);
}
.era-badge.pl {
    background: rgba(203,213,225,0.08);
    color: #cbd5e1;
    border: 1px solid rgba(203,213,225,0.3);
}
.era-badge.dp {
    background: rgba(96,165,250,0.1);
    color: #60a5fa;
    border: 1px solid rgba(96,165,250,0.35);
}
.era-badge.ex {
    background: rgba(34,197,94,0.1);
    color: #22c55e;
    border: 1px solid rgba(34,197,94,0.35);
}
.era-badge.neo {
    background: rgba(20,184,166,0.1);
    color: #14b8a6;
    border: 1px solid rgba(20,184,166,0.35);
}
.era-badge.gym {
    background: rgba(251,146,60,0.1);
    color: #fb923c;
    border: 1px solid rgba(251,146,60,0.35);
}
.era-badge.base {
    background: rgba(234,179,8,0.1);
    color: #eab308;
    border: 1px solid rgba(234,179,8,0.35);
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-left: 72px;
    letter-spacing: 0.3px;
}

/* ── SETS GRID ──────────────────────────────────────── */
.sets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
}

@keyframes card-enter {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.set-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 20px 22px;
    cursor: pointer;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition), background var(--transition);
    text-align: center;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    animation: card-enter 0.5s ease both;
}

/* Gold corner accent */
.set-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 44px; height: 44px;
    background: linear-gradient(225deg, rgba(232,184,75,0.2) 0%, transparent 65%);
    border-top-right-radius: var(--radius-lg);
    transition: width var(--transition), height var(--transition);
    opacity: 0.7;
}

/* Holographic shimmer */
.set-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        125deg,
        transparent 15%,
        rgba(232,39,59,0.05) 28%,
        rgba(255,165,0,0.06) 40%,
        rgba(232,184,75,0.05) 52%,
        rgba(56,217,245,0.05) 64%,
        rgba(91,156,246,0.05) 76%,
        transparent 88%
    );
    opacity: 0;
    transition: opacity 0.35s;
    pointer-events: none;
    border-radius: inherit;
}

.set-card:hover::after { opacity: 1; }

.set-card:hover {
    background: var(--surface-hover);
    border-color: rgba(232,184,75,0.5);
    transform: translateY(-6px);
    box-shadow:
        0 0 0 1px rgba(232,184,75,0.15),
        0 20px 52px rgba(0,0,0,0.65),
        0 0 36px rgba(232,184,75,0.07);
}

.set-card:hover::before { width: 66px; height: 66px; opacity: 1; }

.set-logo {
    max-width: 160px;
    max-height: 76px;
    object-fit: contain;
    transition: filter var(--transition);
    position: relative;
    z-index: 1;
}
.set-card:hover .set-logo { filter: brightness(1.3) drop-shadow(0 0 10px rgba(232,184,75,0.35)); }

.set-info { display: flex; flex-direction: column; gap: 5px; position: relative; z-index: 1; }
.set-name { font-size: 0.9rem; font-weight: 600; line-height: 1.3; }
.set-release { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); }
.set-total { font-size: 0.78rem; color: var(--gold); font-weight: 500; font-family: var(--font-mono); }

/* ── LOADING / ERROR ────────────────────────────────── */
.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 72px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ── PAGE HEADER (subpages) ─────────────────────────── */
.page-header {
    background: rgba(7,8,16,0.92);
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(18px);
}

.page-header .container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.78rem;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
    padding: 7px 14px;
    border-radius: 7px;
    border: 1px solid var(--border-2);
    transition: all var(--transition);
    white-space: nowrap;
    cursor: pointer;
    background: none;
}
.back-btn:hover {
    color: var(--gold);
    border-color: rgba(232,184,75,0.4);
    background: var(--gold-dim);
}

.page-title-sm {
    font-size: 0.97rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── SET BANNER ─────────────────────────────────────── */
.set-banner {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 40px 0;
    position: relative;
    overflow: hidden;
}

.set-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 100% at 0% 50%, rgba(232,184,75,0.04) 0%, transparent 60%);
    pointer-events: none;
}

.set-banner-inner {
    display: flex;
    align-items: center;
    gap: 40px;
    position: relative;
    z-index: 1;
}

.set-banner-logo { max-width: 220px; max-height: 88px; object-fit: contain; }

.set-banner-name {
    font-family: var(--font-display);
    font-size: 2.6rem;
    letter-spacing: 2px;
    margin-bottom: 14px;
    line-height: 1;
}

.set-banner-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-family: var(--font-mono);
}

/* ── SEARCH BAR ─────────────────────────────────────── */
.search-wrap { margin: 32px 0 8px; position: relative; }

.search-input {
    width: 100%;
    padding: 14px 20px 14px 50px;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95rem;
    font-family: var(--font-body);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input:focus {
    border-color: rgba(232,184,75,0.5);
    box-shadow: 0 0 0 3px rgba(232,184,75,0.07);
}
.search-input::placeholder { color: var(--text-muted); }

.search-icon { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); font-size: 1.1rem; pointer-events: none; }

.results-info { color: var(--text-muted); font-size: 0.78rem; margin-bottom: 4px; font-family: var(--font-mono); }

/* ── CARDS GRID ─────────────────────────────────────── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 14px;
    margin-top: 24px;
}

@keyframes holo-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.card-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    text-decoration: none;
    color: var(--text);
    display: block;
    position: relative;
}

/* Holographic rainbow shimmer — the signature effect */
.card-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        125deg,
        transparent 0%,
        rgba(255,50,50,0.07) 14%,
        rgba(255,165,0,0.08) 27%,
        rgba(240,230,50,0.07) 40%,
        rgba(50,220,100,0.07) 52%,
        rgba(50,160,255,0.08) 65%,
        rgba(140,50,255,0.07) 78%,
        rgba(255,50,160,0.06) 90%,
        transparent 100%
    );
    background-size: 300% 300%;
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 2;
    pointer-events: none;
    border-radius: inherit;
    mix-blend-mode: screen;
}

.card-item:hover::before {
    opacity: 1;
    animation: holo-shift 4s ease infinite;
}

.card-item:hover {
    transform: translateY(-8px) perspective(600px) rotateX(3deg);
    box-shadow: 0 18px 50px rgba(0,0,0,0.75), 0 0 28px rgba(232,184,75,0.1);
    border-color: rgba(232,184,75,0.28);
    z-index: 5;
}

.card-img-wrap { aspect-ratio: 5 / 7; overflow: hidden; background: var(--surface-2); }
.card-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--transition); }
.card-item:hover .card-img { transform: scale(1.04); }

.card-item-body { padding: 10px 12px 12px; }
.card-item-name { font-size: 0.82rem; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-item-num { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; font-family: var(--font-mono); }
.card-item-price { font-size: 0.8rem; color: var(--green); font-weight: 500; margin-top: 5px; font-family: var(--font-mono); }

/* ── CARD DETAIL ────────────────────────────────────── */
.card-detail-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 56px;
    margin: 52px 0 80px;
    align-items: start;
}

.card-detail-img-wrap { position: sticky; top: 90px; }

.card-big-img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.8), 0 0 60px rgba(232,39,59,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
}
.card-big-img:hover {
    transform: scale(1.02) perspective(1000px) rotateY(-3deg) rotateX(1deg);
    box-shadow: 0 40px 100px rgba(0,0,0,0.9), 0 0 80px rgba(232,184,75,0.14);
}

.card-detail-right { display: flex; flex-direction: column; gap: 36px; }

.card-main-name {
    font-family: var(--font-display);
    font-size: 3.4rem;
    letter-spacing: 2px;
    line-height: 1.1;
    margin-bottom: 14px;
}

.badges-row { display: flex; flex-wrap: wrap; gap: 8px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.73rem;
    font-weight: 500;
    font-family: var(--font-mono);
    letter-spacing: 0.3px;
}
.badge-type     { background: var(--gold-dim); color: var(--gold); border: 1px solid rgba(232,184,75,0.25); }
.badge-rarity   { background: rgba(160,100,255,0.1); color: var(--purple); border: 1px solid rgba(160,100,255,0.25); }
.badge-set      { background: rgba(91,156,246,0.08); color: var(--blue); border: 1px solid rgba(91,156,246,0.25); }
.badge-hp       { background: var(--crimson-dim); color: #ff5569; border: 1px solid rgba(232,39,59,0.25); }
.badge-super    { background: rgba(61,232,138,0.08); color: var(--green); border: 1px solid rgba(61,232,138,0.25); }

/* ── INFO PANEL ─────────────────────────────────────── */
.info-panel {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    overflow: hidden;
}

.panel-title {
    padding: 11px 18px;
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: rgba(0,0,0,0.3);
    font-family: var(--font-mono);
}

.panel-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    gap: 12px;
}
.panel-row:last-child { border-bottom: none; }
.panel-label { color: var(--text-muted); flex-shrink: 0; font-family: var(--font-mono); font-size: 0.8rem; }
.panel-value { font-weight: 500; text-align: right; }

/* ── ATTACKS ────────────────────────────────────────── */
.attacks-list { display: flex; flex-direction: column; gap: 10px; }

.attack-card {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.attack-info { flex: 1; }
.attack-name { font-weight: 600; font-size: 0.93rem; margin-bottom: 5px; }
.attack-cost { font-size: 0.76rem; color: var(--text-muted); margin-bottom: 4px; font-family: var(--font-mono); }
.attack-text { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }
.attack-damage {
    font-family: var(--font-display);
    font-size: 2.2rem;
    color: var(--crimson);
    white-space: nowrap;
    letter-spacing: 1px;
    line-height: 1;
}

/* ── PRICES ─────────────────────────────────────────── */
.prices-block { display: flex; flex-direction: column; gap: 16px; }

.prices-heading {
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: 2px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1;
}

.price-card {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    overflow: hidden;
}

.price-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.82rem;
    font-family: var(--font-mono);
    letter-spacing: 0.6px;
}

.price-source-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-cardmarket    { background: #1b7acc; box-shadow: 0 0 5px rgba(27,122,204,0.7); }
.dot-pricecharting { background: #e07b39; box-shadow: 0 0 5px rgba(224,123,57,0.7); }
.dot-psa           { background: var(--gold); box-shadow: 0 0 5px rgba(232,184,75,0.7); }
.dot-tcgplayer     { background: #2ea0d1; box-shadow: 0 0 5px rgba(46,160,209,0.7); }

.price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}

.price-cell {
    padding: 18px 16px;
    border-right: 1px solid var(--border);
}
.price-cell:last-child { border-right: none; }

.price-cell-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 8px;
    font-family: var(--font-mono);
}

.price-cell-value {
    font-family: var(--font-mono);
    font-size: 1.45rem;
    font-weight: 500;
    color: var(--green);
    line-height: 1;
}

.price-cell-value.loading { color: var(--text-muted); font-size: 0.83rem; font-weight: 400; margin-top: 6px; font-style: italic; }
.price-cell-value.unavail { color: var(--text-muted); font-size: 0.83rem; font-weight: 400; margin-top: 6px; }

.psa-10 .price-cell-value { color: var(--gold); }
.psa-9  .price-cell-value { color: var(--blue); }
.psa-8  .price-cell-value { color: var(--green); }

.price-card-footer {
    padding: 10px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.76rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    font-family: var(--font-mono);
}

.price-card-footer a { color: var(--cyan); text-decoration: none; white-space: nowrap; }
.price-card-footer a:hover { color: var(--gold); }

.lang-links { display: flex; gap: 16px; flex-wrap: wrap; }

.price-stale-warning {
    margin: 0 18px 2px;
    padding: 8px 12px;
    background: rgba(255,160,0,0.06);
    border: 1px solid rgba(255,160,0,0.18);
    border-radius: 7px;
    font-size: 0.74rem;
    color: #f0a040;
    line-height: 1.4;
    font-family: var(--font-mono);
}

/* ── TCGplayer variants ─────────────────────────────── */
.tcg-variant-label {
    padding: 10px 18px 6px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
}
.price-card > .tcg-variant-label:first-of-type { border-top: none; }

/* ── Live badge ─────────────────────────────────────── */
.live-badge {
    margin-left: auto;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 1.2px;
    padding: 3px 9px;
    border-radius: 4px;
    background: rgba(61,232,138,0.08);
    color: var(--green);
    border: 1px solid rgba(61,232,138,0.28);
    font-family: var(--font-mono);
    text-transform: uppercase;
}

/* ── Cardmarket link-only card ──────────────────────── */
.price-card-link-body {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}
.link-card-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}
.cm-big-btn {
    display: inline-block;
    padding: 11px 24px;
    background: linear-gradient(135deg, #1b5fa8, #2ea0d1);
    color: #fff !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 20px rgba(27,122,204,0.2);
    font-family: var(--font-mono);
}
.cm-big-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(27,122,204,0.38);
    text-decoration: none;
}

.cm-link-primary { font-weight: 600; font-size: 0.88rem; }


/* Language section dividers */
.lang-section-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 0.78rem;
    background: rgba(91,156,246,0.04);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-mono);
}
.lang-section-label:first-of-type { border-top: none; }
.lang-section-es { background: rgba(232,39,59,0.04); }
.lang-note { color: var(--text-muted); font-weight: 400; font-size: 0.74rem; }

/* ── FOOTER ─────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 48px 0;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 2;
    margin-top: 40px;
    font-family: var(--font-mono);
    letter-spacing: 0.3px;
}

/* ── GALLERY TABS ───────────────────────────────────── */
.gallery-tabs {
    display: flex;
    gap: 8px;
    margin: 28px 0 0;
    flex-wrap: wrap;
}

.gallery-tab {
    padding: 9px 22px;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-family: var(--font-mono);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 0.3px;
}
.gallery-tab:hover {
    border-color: rgba(56,217,245,0.4);
    color: var(--text);
}
.gallery-tab.active {
    background: rgba(56,217,245,0.08);
    border-color: rgba(56,217,245,0.5);
    color: var(--cyan);
}

/* ── RARITY FILTERS ─────────────────────────────────── */
.rarity-filters {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 16px 0 4px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    flex-shrink: 0;
    padding-top: 5px;
}

.rarity-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rarity-chip {
    padding: 4px 13px;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 0.73rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.rarity-chip:hover {
    border-color: rgba(160,100,255,0.4);
    color: var(--text);
}
.rarity-chip.active {
    background: rgba(160,100,255,0.1);
    border-color: rgba(160,100,255,0.5);
    color: var(--purple);
}

/* ── GALLERY TAG (índice de sets) ───────────────────── */
.set-gallery-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    background: rgba(56,217,245,0.08);
    border: 1px solid rgba(56,217,245,0.3);
    border-radius: 4px;
    font-size: 0.62rem;
    font-family: var(--font-mono);
    color: var(--cyan);
    vertical-align: middle;
    white-space: nowrap;
}

/* ── GLOBAL SEARCH (página principal) ──────────────── */
.gsearch-section {
    padding: 40px 0 8px;
}

.gsearch-wrap {
    position: relative;
    max-width: 680px;
    margin: 0 auto;
}

.gsearch-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.15rem;
    pointer-events: none;
    z-index: 1;
}

.gsearch-input {
    width: 100%;
    padding: 16px 20px 16px 54px;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    color: var(--text);
    font-size: 1rem;
    font-family: var(--font-body);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.gsearch-input:focus {
    border-color: rgba(232,184,75,0.5);
    box-shadow: 0 0 0 3px rgba(232,184,75,0.07);
}
.gsearch-input::placeholder { color: var(--text-muted); }

.gsearch-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    z-index: 200;
    max-height: 520px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.gsearch-section-label {
    padding: 10px 18px 6px;
    font-size: 0.65rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: rgba(0,0,0,0.25);
    position: sticky;
    top: 0;
}

.gsearch-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.gsearch-item:last-child { border-bottom: none; }
.gsearch-item:hover { background: var(--surface-hover); }

/* Set result */
.gsearch-set-logo {
    width: 72px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    filter: brightness(0.95);
}

/* Card result */
.gsearch-card-img {
    width: 36px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: var(--surface-2);
}

.gsearch-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}

.gsearch-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gsearch-item-sub {
    font-size: 0.73rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gsearch-type-badge {
    flex-shrink: 0;
    font-size: 0.6rem;
    font-family: var(--font-mono);
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
}

.gsearch-badge-set {
    background: var(--gold-dim);
    color: var(--gold);
    border: 1px solid rgba(232,184,75,0.3);
}

.gsearch-badge-card {
    background: rgba(56,217,245,0.08);
    color: var(--cyan);
    border: 1px solid rgba(56,217,245,0.3);
}

.gsearch-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

.gsearch-empty {
    padding: 24px 18px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 900px) {
    .card-detail-layout { grid-template-columns: 1fr; gap: 32px; }
    .card-detail-img-wrap { position: static; }
    .card-big-img { max-width: 280px; margin: 0 auto; }
    .set-banner-inner { flex-direction: column; text-align: center; }
    .set-banner-meta { justify-content: center; }
}

@media (max-width: 640px) {
    .logo-text { font-size: 2.8rem; letter-spacing: 3px; }
    .section-title { font-size: 2.2rem; }
    .section-desc { margin-left: 0; margin-top: 6px; }
    .sets-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .cards-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
    .card-main-name { font-size: 2.5rem; }
    .set-banner-name { font-size: 2rem; }
    .price-grid { grid-template-columns: 1fr 1fr; }
    .container { padding: 0 14px; }
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR DE NAVEGACIÓN
   ═══════════════════════════════════════════════════════════════ */

/* Layout wrapper: sidebar + contenido principal */
.layout {
    display: flex;
    align-items: flex-start;
}

main {
    flex: 1;
    min-width: 0;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
    width: 252px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--border);
    z-index: 100;
    overflow: hidden;
}

/* Cabecera del sidebar */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 14px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sb-header-icon {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 0 6px rgba(232,39,59,0.7));
    flex-shrink: 0;
}

.sb-header-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    letter-spacing: 3px;
    color: var(--text);
    flex: 1;
}

.sb-close-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background var(--transition), color var(--transition);
}
.sb-close-btn:hover { background: var(--surface-hover); color: var(--text); }

/* Nav scrollable */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 0 32px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-2) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }

/* ── Era group ───────────────────────────────────────────────── */
.sb-era-group {
    border-bottom: 1px solid var(--border);
}

.sb-era-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 10px 9px 6px;
    background: none;
    border: none;
    border-left: 2px solid transparent;
    cursor: pointer;
    color: var(--text-muted);
    text-align: left;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.sb-era-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
}
.sb-era-btn.active {
    background: rgba(232,184,75,0.06);
    color: var(--gold);
    border-left-color: var(--gold);
}

/* Badge pequeño dentro del sidebar */
.sb-badge {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.52rem !important;
    letter-spacing: 0.4px !important;
    flex-shrink: 0;
}

.sb-era-label {
    flex: 1;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.25;
}

.sb-chevron {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    opacity: 0.35;
    transition: transform 0.22s ease, opacity 0.22s ease;
}
.sb-era-btn:hover .sb-chevron { opacity: 0.7; }
.sb-era-group.expanded .sb-chevron { transform: rotate(90deg); opacity: 0.7; }

/* ── Sub-lista de colecciones ────────────────────────────────── */
.sb-sets-list {
    display: none;
    flex-direction: column;
    padding: 2px 0 6px;
    background: rgba(0,0,0,0.12);
}
.sb-era-group.expanded .sb-sets-list {
    display: flex;
}

.sb-set-item {
    padding: 5px 12px 5px 50px;
    font-size: 0.74rem;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 2px solid transparent;
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.sb-set-item:hover {
    color: var(--text);
    background: var(--surface-hover);
    border-left-color: var(--border-2);
}

.sb-loading {
    padding: 5px 12px 5px 50px;
    font-size: 0.74rem;
    color: var(--text-muted);
    opacity: 0.4;
    letter-spacing: 3px;
}

/* ── Botón flotante (solo móvil) ─────────────────────────────── */
.sb-toggle-btn {
    display: none;
    position: fixed;
    bottom: 22px;
    left: 22px;
    z-index: 150;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.7);
    transition: background var(--transition), box-shadow var(--transition);
}
.sb-toggle-btn:hover { background: var(--surface-hover); }
.sb-toggle-btn svg { width: 20px; height: 20px; }

/* ── Backdrop (móvil) ────────────────────────────────────────── */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 90;
    backdrop-filter: blur(2px);
}
.sidebar-backdrop.visible { display: block; }

/* ── Responsivo ──────────────────────────────────────────────── */
@media (max-width: 900px) {
    .layout { display: block; }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
        box-shadow: 6px 0 32px rgba(0,0,0,0.7);
    }
    .sidebar.open { transform: translateX(0); }

    .sb-toggle-btn { display: flex; }
    .sb-close-btn  { display: flex; align-items: center; justify-content: center; }
}
