/* ══════════════════════════════════════════════════════════════
   MU LATINO ORIGEN — Páginas /items y /ancient
   Usa la paleta de latino-theme.css (rojo sangre · hueso · bronce)
══════════════════════════════════════════════════════════════ */
.mlo-it { --slot-bg: #0d0707; --t1: #e0301f; --t2: #4b8dff; color: var(--text-primary, #ebe3d2); }
.mlo-it *, .mlo-it *::before, .mlo-it *::after { box-sizing: border-box; }
.mlo-it img { max-width: none; }

/* Pestañas entre páginas */
.mlo-tabs { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 0 0 1.6rem; }
.mlo-tab {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: 'Cinzel', serif; font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
    color: var(--bone, #d2c8ae) !important; text-decoration: none !important;
    padding: 10px 22px; border: 1px solid rgba(170,148,128,.4); background: rgba(10,4,4,.6); border-radius: 1px;
    transition: background .2s, border-color .2s, box-shadow .2s;
}
.mlo-tab:hover { border-color: var(--red-bright, #e0301f); box-shadow: 0 0 16px rgba(224,48,31,.3); }
.mlo-tab.is-active {
    background: linear-gradient(180deg, #7d0b06, #4c0302); border-color: #8c7660;
    outline: 1px solid rgba(170,148,128,.35); outline-offset: 3px;
}
.mlo-tab img { width: 22px; height: 22px; object-fit: contain; }

/* Barra de búsqueda */
.mlo-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 1rem; }
.mlo-search { position: relative; flex: 1 1 260px; }
.mlo-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--red-bright, #e0301f); font-size: .85rem; }
.mlo-search input {
    width: 100%; padding: 11px 14px 11px 38px; font-size: .95rem;
    background: rgba(10,4,4,.85); border: 1px solid rgba(170,148,128,.3); color: var(--text-primary, #ebe3d2);
    border-radius: 2px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.mlo-search input:focus { border-color: rgba(224,48,31,.7); box-shadow: 0 0 0 3px rgba(165,9,5,.2); }
.mlo-count { font-family: 'Cinzel', serif; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim, #7f786e); }
.mlo-count b { color: var(--bone, #d2c8ae); }

/* Grupos (barra fija al hacer scroll) */
.mlo-groups {
    position: sticky; top: var(--navbar-h, 68px); z-index: 20;
    display: flex; gap: 6px; overflow-x: auto; padding: 10px 6px; margin: 0 -6px 1.4rem;
    background: linear-gradient(180deg, rgba(14,6,6,.97), rgba(9,4,4,.97));
    border-top: 1px solid rgba(170,148,128,.18); border-bottom: 1px solid rgba(170,148,128,.18);
    scrollbar-width: thin; scrollbar-color: #8e1109 transparent;
}
.mlo-groups::-webkit-scrollbar { height: 4px; }
.mlo-groups::-webkit-scrollbar-track { background: transparent; }
.mlo-groups::-webkit-scrollbar-thumb { background: linear-gradient(90deg, #6a0503, #c41e14); border-radius: 2px; }
.mlo-group {
    flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 5px;
    min-width: 78px; padding: 7px 8px 6px; cursor: pointer;
    background: rgba(255,255,255,.02); border: 1px solid rgba(170,148,128,.14); border-radius: 2px;
    color: var(--text-muted, #b4ab9b); transition: all .2s;
}
.mlo-group:hover { border-color: rgba(224,48,31,.5); color: var(--bone, #d2c8ae); }
.mlo-group.is-active {
    background: linear-gradient(180deg, rgba(142,12,7,.55), rgba(60,3,2,.6)); border-color: #8c7660; color: #fff4dd;
    box-shadow: 0 0 14px rgba(224,48,31,.3);
}
.mlo-group .gi { height: 34px; display: flex; align-items: center; justify-content: center; }
.mlo-group .gi img { max-height: 34px; max-width: 34px; object-fit: contain; filter: drop-shadow(0 2px 3px #000); }
.mlo-group .gn { font-family: 'Cinzel', serif; font-size: .6rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.mlo-group .gc { font-size: .6rem; color: var(--text-dim, #7f786e); }
.mlo-group.is-active .gc { color: #e8c9b5; }

/* Encabezado de grupo */
.mlo-sec { scroll-margin-top: calc(var(--navbar-h, 68px) + 110px); margin-bottom: 2.2rem; }
.mlo-sec-title {
    display: flex; align-items: center; gap: 12px; margin: 0 0 1rem;
    font-family: 'Cinzel', serif; font-size: 1.05rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--bone, #d2c8ae);
}
.mlo-sec-title small { font-family: 'Alegreya Sans', sans-serif; font-size: .8rem; letter-spacing: 0; text-transform: none; color: var(--text-dim, #7f786e); }
.mlo-sec-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(224,48,31,.8), rgba(170,148,128,.15) 60%, transparent); }

/* Tarjeta de ítem (casilla de inventario) */
.mlo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 12px; }
.it-card {
    position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 10px 8px 10px; cursor: pointer; scroll-margin-top: calc(var(--navbar-h, 68px) + 120px);
    background: linear-gradient(180deg, rgba(24,10,9,.94), rgba(9,4,4,.97));
    border: 1px solid rgba(170,148,128,.18); border-radius: 2px;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.it-card:hover, .it-card:focus-visible, .it-card.is-open {
    border-color: rgba(224,48,31,.6); transform: translateY(-3px); outline: none;
    box-shadow: 0 0 22px rgba(165,9,5,.3), 0 10px 24px rgba(0,0,0,.6);
}
.it-card.is-flash { animation: mloFlash 1.6s ease 2; }
@keyframes mloFlash { 50% { box-shadow: 0 0 0 3px rgba(224,48,31,.8), 0 0 30px rgba(224,48,31,.6); } }
.it-slot {
    position: relative; width: 100%; height: 132px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px;
    background:
        radial-gradient(circle at 50% 55%, rgba(165,9,5,.22), transparent 65%),
        repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 30px),
        repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 30px),
        var(--slot-bg);
    border: 1px solid rgba(170,148,128,.22);
    box-shadow: inset 0 0 18px rgba(0,0,0,.8);
}
.it-slot img { display: block; image-rendering: auto; filter: drop-shadow(0 4px 6px rgba(0,0,0,.8)); transition: transform .25s; }
.it-card:hover .it-slot img { transform: scale(1.06); }
.it-slot .noimg { font-size: 1.8rem; color: rgba(170,148,128,.3); }
.it-name { font-family: 'Cinzel', serif; font-size: .74rem; font-weight: 600; line-height: 1.3; color: var(--bone, #d2c8ae); min-height: 2.6em; display: flex; align-items: center; }
.it-code { font-size: .68rem; color: var(--text-dim, #7f786e); margin-top: 2px; }
.it-badges { position: absolute; top: 6px; right: 6px; display: flex; gap: 3px; z-index: 1; }
.tb { display: inline-flex; align-items: center; justify-content: center; font-size: .58rem; font-weight: 700; letter-spacing: .04em; padding: 2px 5px; border-radius: 2px; color: #fff; line-height: 1.3; }
.tb.t1 { background: linear-gradient(180deg, #c41e14, #6e0503); border: 1px solid rgba(255,140,120,.4); }
.tb.t2 { background: linear-gradient(180deg, #2f6be0, #173a87); border: 1px solid rgba(140,180,255,.4); }

/* Ficha (tooltip estilo juego) */
.it-tip {
    position: fixed; z-index: 3000; width: 290px; max-width: calc(100vw - 24px); pointer-events: none;
    padding: 14px 16px 12px; font-size: .86rem; line-height: 1.5; text-align: center;
    background: rgba(6,3,3,.97); border: 1px solid #8c7660; outline: 1px solid rgba(170,148,128,.25); outline-offset: 3px;
    box-shadow: 0 0 30px rgba(165,9,5,.35), 0 14px 40px rgba(0,0,0,.85);
    opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .15s, transform .15s, visibility .15s;
}
.it-tip.is-on { opacity: 1; visibility: visible; transform: none; }
.it-tip h4 { font-family: 'Cinzel', serif; font-size: .95rem; font-weight: 700; margin: 0 0 2px; color: #fff4dd; letter-spacing: .03em; }
.it-tip .tp-sec { font-size: .72rem; color: var(--text-dim, #7f786e); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.it-tip .tp-line { color: #e9e2d0; }
.it-tip .tp-req { color: #b8afa0; }
.it-tip .tp-hr { height: 1px; margin: 8px 0; background: linear-gradient(90deg, transparent, rgba(170,148,128,.5), transparent); }
.it-tip .tp-cls { color: #8fb7ff; font-size: .8rem; }
.it-tip .tp-anc { font-size: .82rem; margin-top: 2px; }
.it-tip .tp-anc .a1 { color: #ff6a55; }
.it-tip .tp-anc .a2 { color: #79a8ff; }
.it-tip .tp-hint { margin-top: 8px; font-size: .68rem; color: var(--text-dim, #7f786e); }
.it-tip .tp-close { display: none; }
@media (hover: none), (max-width: 575px) {
    .it-tip {
        pointer-events: auto; left: 12px !important; right: 12px; top: auto !important; bottom: 12px; width: auto;
    }
    .it-tip .tp-close {
        display: block; position: absolute; top: 6px; right: 8px; width: 30px; height: 30px; border: 0; background: none;
        color: var(--bone, #d2c8ae); font-size: 1.1rem; cursor: pointer;
    }
}

/* ── Página Sets Ancient ───────────────────────────────────── */
.anc-intro {
    position: relative; padding: 1.5rem 1.6rem; margin-bottom: 1.4rem;
    background: radial-gradient(ellipse 70% 100% at 50% 0%, rgba(165,9,5,.22), transparent 70%), linear-gradient(180deg, rgba(24,10,9,.94), rgba(9,4,4,.97));
    border: 1px solid rgba(170,148,128,.28); outline: 1px solid rgba(170,148,128,.12); outline-offset: 5px; border-radius: 2px;
}
.anc-intro p { margin: 0 0 .7rem; color: var(--text-muted, #b4ab9b); line-height: 1.7; }
.anc-intro p:last-child { margin-bottom: 0; }
.anc-intro b { color: var(--bone, #d2c8ae); }
.anc-jewels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 1rem 0 1.1rem; }
.anc-jewel { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 2px; background: rgba(0,0,0,.35); }
.anc-jewel.j1 { border: 1px solid rgba(224,48,31,.55); box-shadow: inset 0 0 16px rgba(165,9,5,.25); }
.anc-jewel.j2 { border: 1px solid rgba(75,141,255,.55); box-shadow: inset 0 0 16px rgba(47,107,224,.2); }
.anc-jewel img { width: 44px; height: 44px; object-fit: contain; image-rendering: auto; filter: drop-shadow(0 2px 4px #000); }
.anc-jewel strong { display: block; font-family: 'Cinzel', serif; font-size: .82rem; letter-spacing: .08em; }
.anc-jewel.j1 strong { color: #ff6a55; }
.anc-jewel.j2 strong { color: #79a8ff; }
.anc-jewel span { font-size: .85rem; color: var(--text-muted, #b4ab9b); }

.anc-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.anc-filter {
    font-family: 'Cinzel', serif; font-size: .66rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
    padding: 8px 13px; cursor: pointer; color: var(--text-muted, #b4ab9b);
    background: rgba(10,4,4,.6); border: 1px solid rgba(170,148,128,.25); border-radius: 1px; transition: all .2s;
}
.anc-filter:hover { border-color: rgba(224,48,31,.6); color: var(--bone, #d2c8ae); }
.anc-filter.is-active { background: linear-gradient(180deg, #7d0b06, #4c0302); border-color: #8c7660; color: #fff4dd; }

.anc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 470px), 1fr)); gap: 16px; }
.anc-set {
    scroll-margin-top: calc(var(--navbar-h, 68px) + 20px);
    background: linear-gradient(180deg, rgba(24,10,9,.94), rgba(9,4,4,.97));
    border: 1px solid rgba(170,148,128,.22); border-radius: 2px; overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,.55); transition: border-color .2s, box-shadow .2s;
}
.anc-set:hover { border-color: rgba(224,48,31,.45); box-shadow: 0 0 26px rgba(165,9,5,.22), 0 10px 30px rgba(0,0,0,.6); }
.anc-set.is-flash { animation: mloFlash 1.6s ease 2; }
.anc-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    padding: 12px 16px; border-bottom: 1px solid rgba(170,148,128,.2);
    background: linear-gradient(90deg, rgba(165,9,5,.26), rgba(165,9,5,.05) 70%, transparent);
}
.anc-head h3 { margin: 0; font-family: 'Cinzel', serif; font-size: .98rem; font-weight: 700; letter-spacing: .08em; color: var(--bone, #d2c8ae); text-transform: uppercase; }
.anc-head h3 i { color: var(--red-bright, #e0301f); margin-right: 6px; }
.anc-head h3 small { font-family: 'Alegreya Sans', sans-serif; font-size: .78rem; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--text-dim, #7f786e); margin-left: 6px; }
.anc-kind { font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 2px; white-space: nowrap; }
.anc-kind.k1 { background: rgba(196,30,20,.18); color: #ff6a55; border: 1px solid rgba(224,48,31,.45); }
.anc-kind.k2 { background: rgba(47,107,224,.16); color: #79a8ff; border: 1px solid rgba(75,141,255,.45); }
.anc-kind.km { background: rgba(224,178,60,.12); color: #f0c860; border: 1px solid rgba(224,178,60,.45); }
.anc-pieces { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; padding: 14px 14px 16px; }
.anc-piece { display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none !important; }
.anc-piece .it-slot { height: 96px; margin-bottom: 6px; }
.anc-piece:hover .it-slot { border-color: rgba(224,48,31,.6); }
.anc-piece .pc-slot { font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim, #7f786e); }
.anc-piece .pc-name { font-family: 'Cinzel', serif; font-size: .7rem; font-weight: 600; line-height: 1.3; color: var(--bone, #d2c8ae); margin: 2px 0 4px; }
.anc-dead { margin-top: 2.2rem; }
.anc-dead .anc-set { opacity: .55; filter: grayscale(.7); }
.anc-dead-note { margin: 0 0 1rem; color: var(--text-dim, #7f786e); font-size: .9rem; }
.mlo-empty { padding: 2.5rem 1rem; text-align: center; color: var(--text-dim, #7f786e); font-family: 'Cinzel', serif; letter-spacing: .1em; }

@media (max-width: 575px) {
    .mlo-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
    .it-slot { height: 104px; }
    .anc-jewels { grid-template-columns: 1fr; }
    .anc-pieces { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
    .mlo-tab { padding: 9px 14px; font-size: .7rem; }
}
