* { box-sizing: border-box; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: #0f1115;
    color: #e6e8eb;
    margin: 0;
    padding: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 16px 32px 10px;
    background: linear-gradient(180deg, rgba(11, 37, 69, 0.82) 0%, rgba(15, 17, 21, 0.82) 100%);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: 0 1px 0 rgba(34, 211, 238, 0.08), 0 12px 32px -20px rgba(0, 0, 0, 0.6);
}

.header-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    border-radius: 10px;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.brand-link:hover { transform: translateY(-1px); opacity: 0.92; }
.brand-link:focus-visible {
    outline: 2px solid #22d3ee;
    outline-offset: 4px;
}

.site-header h1 {
    margin: 0;
    font-size: 28px;
    color: #4f9dff;
}

.site-header h1.brand {
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #f4f6f9;
}

.brand-accent {
    color: #22d3ee;
    text-shadow: 0 0 18px rgba(34, 211, 238, 0.55);
}

/* --- Buscador --- */
.site-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(23, 26, 33, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    padding: 8px 14px;
    min-width: 200px;
    flex: 1 1 220px;
    max-width: 320px;
    margin-left: auto;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.site-search:focus-within {
    border-color: rgba(34, 211, 238, 0.55);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
    background: rgba(23, 26, 33, 0.9);
}

.site-search__icon { width: 16px; height: 16px; color: #7c8797; flex-shrink: 0; }
.site-search:focus-within .site-search__icon { color: #22d3ee; }

.site-search__input {
    background: transparent;
    border: none;
    outline: none;
    color: #e6e8eb;
    font-size: 14px;
    width: 100%;
    font-family: inherit;
}

.site-search__input::placeholder { color: #7c8797; }

/* --- Precio WEMIX --- */
.wemix-price {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(23, 26, 33, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 14px;
}

.wemix-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22d3ee;
    box-shadow: 0 0 8px 1px rgba(34, 211, 238, 0.8);
    animation: wemixPulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes wemixPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.8); }
}

.wemix-label { color: #9aa3af; font-weight: 600; }
.wemix-value { font-weight: 700; color: #e6e8eb; }
.wemix-change.up { color: #4ade80; }
.wemix-change.down { color: #f87171; }

.auth-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.auth-status__login {
    background: rgba(34, 211, 238, 0.12);
    border: 1px solid rgba(34, 211, 238, 0.35);
    color: #22d3ee;
    text-decoration: none;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 999px;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.auth-status__login:hover { background: rgba(34, 211, 238, 0.2); }

.auth-status__user {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #e6e8eb;
    text-decoration: none;
    font-weight: 600;
}
.auth-status__user:hover { color: #22d3ee; }

.auth-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

.auth-status__logout {
    color: #9aa3af;
    text-decoration: none;
    font-size: 12px;
}
.auth-status__logout:hover { color: #f87171; }

.auth-status__membership {
    color: #fbbf24;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}
.auth-status__membership:hover { color: #fcd34d; }

.subtitle {
    color: #9aa3af;
    margin: 10px 0 0;
    font-size: 14px;
}

@media (max-width: 860px) {
    .site-search { order: 2; max-width: none; margin-left: 0; }
}

.maintenance-banner {
    background: rgba(251, 191, 36, 0.12);
    border-bottom: 1px solid rgba(251, 191, 36, 0.35);
    color: #fbbf24;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
}

main {
    padding: 24px 32px;
    max-width: 1600px;
    margin: 0 auto;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: end;
    background: #171a21;
    border: 1px solid #262a33;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
}

.filter-group label {
    color: #9aa3af;
}

.filter-group.range {
    flex-direction: row;
    align-items: end;
    gap: 6px;
}

.filter-group.range span {
    color: #6b7280;
    padding-bottom: 6px;
}

.power-slider {
    width: 240px;
}

.power-slider__values {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: #e6e8eb;
    font-variant-numeric: tabular-nums;
}

.power-slider__track-wrap {
    position: relative;
    height: 22px;
}

.power-slider__track,
.power-slider__range {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    border-radius: 2px;
}

.power-slider__track {
    left: 0;
    right: 0;
    background: #333844;
}

.power-slider__range {
    background: #22d3ee;
    box-shadow: 0 0 6px rgba(34, 211, 238, 0.5);
}

.power-slider__track-wrap input[type="range"] {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    max-width: none;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
}

.power-slider__track-wrap input[type="range"]::-webkit-slider-runnable-track {
    -webkit-appearance: none;
    background: transparent;
}

.power-slider__track-wrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #22d3ee;
    border: 2px solid #0f1115;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(34, 211, 238, 0.6);
}

.power-slider__track-wrap input[type="range"]::-moz-range-track {
    background: transparent;
}

.power-slider__track-wrap input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #22d3ee;
    border: 2px solid #0f1115;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(34, 211, 238, 0.6);
}

select, input[type="number"] {
    background: #0f1115;
    color: #e6e8eb;
    border: 1px solid #333844;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 14px;
    max-width: 130px;
}

.filter-actions {
    display: flex;
    gap: 8px;
}

.advanced-filters {
    margin: 4px 0 16px;
    border-top: 1px solid #262a33;
    padding-top: 10px;
}

.advanced-filters summary {
    cursor: pointer;
    color: #4f9dff;
    font-size: 13px;
    font-weight: 600;
    user-select: none;
}

.advanced-block {
    margin-top: 12px;
    padding: 12px;
    background: #0f1115;
    border: 1px solid #262a33;
    border-radius: 8px;
}

.advanced-block + .advanced-block {
    margin-top: 10px;
}

.advanced-block__title {
    margin: 0 0 10px;
    font-size: 12px;
    color: #9aa3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.training-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.training-grid .filter-group input {
    max-width: 80px;
}

.equip-slot-picker {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #262b35;
}

.equip-slot-picker:last-child {
    border-bottom: none;
}

.equip-slot-picker__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #9aa3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 6px;
}

.equip-slot-picker__clear {
    font-size: 10px;
    text-transform: none;
    letter-spacing: normal;
    color: #f87171;
    background: none;
    border: 1px solid #f87171;
    border-radius: 10px;
    padding: 1px 8px;
    cursor: pointer;
}

.equip-slot-picker__clear:hover {
    background: #f8717122;
}

.equip-slot-picker__items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 160px;
    overflow-y: auto;
    padding: 4px;
    margin-bottom: 8px;
}

.equip-item-cycle {
    position: relative;
    cursor: pointer;
}

.equip-item-cycle img {
    display: block;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #eab308;
    object-fit: cover;
    opacity: 0.55;
}

.equip-item-cycle.is-selected img {
    outline: 3px solid #4f9dff;
    outline-offset: 1px;
    opacity: 1;
}

.equip-item-cycle__tier-badge {
    position: absolute;
    bottom: -4px;
    left: -4px;
    min-width: 16px;
    padding: 0 3px;
    border-radius: 8px;
    background: #333844;
    color: #cbd3e0;
    font-size: 9px;
    font-weight: 700;
    text-align: center;
    line-height: 16px;
}

.equip-item-cycle.is-selected .equip-item-cycle__tier-badge {
    background: #4f9dff;
    color: #0b0d12;
}

.spirit-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
    margin-bottom: 12px;
}

.spirit-picker__item {
    position: relative;
    cursor: pointer;
}

.spirit-picker__item img {
    display: block;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #333844;
    object-fit: cover;
}

.spirit-picker__item img.grade-5 { border-color: #eab308; }
.spirit-picker__item img.grade-4 { border-color: #c084fc; }
.spirit-picker__item img.grade-3 { border-color: #4f9dff; }
.spirit-picker__item img.grade-2 { border-color: #4ade80; }

.spirit-picker__item[data-tier="1"] img,
.spirit-picker__item[data-tier="2"] img,
.spirit-picker__item[data-tier="3"] img,
.spirit-picker__item[data-tier="4"] img {
    outline: 3px solid #4f9dff;
    outline-offset: 1px;
}

.spirit-tier-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    min-width: 16px;
    padding: 0 3px;
    border-radius: 8px;
    background: #4f9dff;
    color: #0b0d12;
    font-size: 9px;
    font-weight: 700;
    text-align: center;
    line-height: 16px;
}

.skill-filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.skill-filter-item {
    cursor: pointer;
}

.skill-filter-item .icon-badge {
    width: 36px;
    height: 36px;
}

button, .btn-reset {
    background: #4f9dff;
    color: #0f1115;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}

.btn-reset {
    background: transparent;
    color: #9aa3af;
    border: 1px solid #333844;
}

.results-count {
    color: #9aa3af;
    font-size: 14px;
    margin: 8px 0;
}

.new-activity-banner {
    display: block;
    width: 100%;
    margin: 0 0 16px;
    padding: 12px 16px;
    background: rgba(34, 211, 238, 0.12);
    border: 1px solid #22d3ee;
    border-radius: 8px;
    color: #22d3ee;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.new-activity-banner:hover {
    background: rgba(34, 211, 238, 0.22);
}

.new-activity-banner[hidden] {
    display: none;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid #262a33;
    border-radius: 8px;
}

table.characters {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table.characters th, table.characters td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #262a33;
    white-space: nowrap;
}

table.characters th {
    background: #171a21;
    color: #9aa3af;
    font-weight: 600;
}

table.characters tbody tr:hover {
    background: #171a21;
}

.empty {
    text-align: center;
    color: #6b7280;
    padding: 24px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
}

.badge-listed { background: #123a24; color: #4ade80; }
.badge-sold { background: #3a1212; color: #f87171; }
.badge-delisted { background: #2a2a2a; color: #9aa3af; }

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
    font-size: 14px;
}

.pagination a {
    color: #4f9dff;
    text-decoration: none;
}

.page-info {
    color: #9aa3af;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.char-card {
    display: block;
    text-decoration: none;
    color: #e6e8eb;
    border-radius: 20px;
    padding: 18px;
    border: 2px solid #262a33;
    background: linear-gradient(135deg, #23262f 0%, #14161c 60%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 16px 32px -22px rgba(0, 0, 0, 0.65);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease, box-shadow 0.35s ease, filter 0.35s ease;
    overflow: hidden;
}

.char-card:hover {
    transform: translateY(-6px) scale(1.012);
    border-color: #4f9dff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 28px 48px -20px rgba(0, 0, 0, 0.7);
}

.char-card.accent-green:hover { border-color: #22c55e; filter: brightness(1.12); }
.char-card.accent-blue:hover { border-color: #4f9dff; filter: brightness(1.12); }
.char-card.accent-red:hover { border-color: #f87171; filter: brightness(1.12); }
.char-card.accent-yellow:hover { border-color: #eab308; filter: brightness(1.12); }
.char-card.accent-mythic:hover { border-color: #d8b4fe; filter: brightness(1.12); }

/* Color de fondo por rango de Power Score (no por clase) -- ver powerTier() en index.php.
   Gradiente mas saturado y extendido (llega mas lejos antes de apagarse a negro) + borde
   a juego, para que el rango se distinga de un vistazo y no solo de cerca. Compartido con
   .detail-hero (detail.php) para que ambas paginas usen el mismo lenguaje visual. */
.char-card.accent-green, .detail-hero.accent-green {
    background: linear-gradient(135deg, #1e8f4c 0%, #143a24 55%, #14161c 90%);
    border-color: #22c55e;
}
.char-card.accent-blue, .detail-hero.accent-blue {
    background: linear-gradient(135deg, #2166e0 0%, #14284a 55%, #14161c 90%);
    border-color: #4f9dff;
}
.char-card.accent-red, .detail-hero.accent-red {
    background: linear-gradient(135deg, #d4322f 0%, #431717 55%, #14161c 90%);
    border-color: #f87171;
}
.char-card.accent-yellow, .detail-hero.accent-yellow {
    background: linear-gradient(135deg, #d0a010 0%, #453510 55%, #14161c 90%);
    border-color: #eab308;
}

.char-card.accent-mythic, .detail-hero.accent-mythic {
    background: linear-gradient(135deg, #b23fd6 0%, #4a1c3a 45%, #14161c 85%);
    border-color: #d8b4fe;
    box-shadow: 0 0 20px rgba(192, 132, 252, 0.35);
}

.accent-green .portrait-frame::before { background: radial-gradient(circle, rgba(74, 222, 128, 0.45), transparent 70%); }
.accent-blue .portrait-frame::before { background: radial-gradient(circle, rgba(79, 157, 255, 0.45), transparent 70%); }
.accent-red .portrait-frame::before { background: radial-gradient(circle, rgba(248, 113, 113, 0.45), transparent 70%); }
.accent-yellow .portrait-frame::before { background: radial-gradient(circle, rgba(234, 179, 8, 0.45), transparent 70%); }
.accent-mythic .portrait-frame::before { background: radial-gradient(circle, rgba(216, 180, 254, 0.55), transparent 70%); }

.portrait-frame {
    width: 168px;
    height: 168px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.char-card .portrait-frame::before,
.detail-hero .portrait-frame::before {
    content: '';
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 70%);
    filter: blur(6px);
    z-index: -1;
}

.portrait-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.portrait-frame--lg {
    width: 140px;
    height: 140px;
    margin: 0;
    flex-shrink: 0;
}

.portrait-placeholder {
    width: 78%;
    height: 78%;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    background: linear-gradient(160deg, #4f9dff, #1c2a3a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
}

.char-card {
    position: relative;
    padding-top: 78px;
}

.card-ribbon {
    position: absolute;
    top: 17px;
    left: -38px;
    width: 150px;
    text-align: center;
    transform: rotate(-45deg);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 0;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.featured-badge {
    position: absolute;
    top: 17px;
    right: -38px;
    width: 150px;
    text-align: center;
    transform: rotate(45deg);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 0;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    background: linear-gradient(135deg, #eab308, #fbbf24);
    color: #1c1400;
    z-index: 3;
}

.card-tabs {
    position: absolute;
    top: 40px;
    right: 12px;
    display: flex;
    gap: 2px;
    background: rgba(6, 7, 10, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 3px;
}

.card-timer {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 12, 16, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(34, 211, 238, 0.25);
    color: #e6e8eb;
    font-size: 10px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 5px 10px;
    border-radius: 999px;
    white-space: nowrap;
    z-index: 2;
}

.card-tab {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    position: relative;
    z-index: 2;
    transition: background 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-tab.active {
    background: #f4f6f9;
    color: #0b2545;
    text-shadow: none;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.45);
}

.card-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.16);
    color: #f4f6f9;
}

.card-panel--enter {
    animation: panelFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes panelFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-heading {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    color: #f4f6f9;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.panel-placeholder {
    text-align: center;
    padding: 30px 0;
}

.progress-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.progress-row {
    display: grid;
    grid-template-columns: 74px 1fr 56px;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.progress-label {
    color: #f4f6f9;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-track {
    height: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #4f9dff, #22d3ee);
    border-radius: 999px;
    box-shadow: 0 0 8px rgba(34, 211, 238, 0.55);
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-value {
    text-align: right;
    color: #e6e8eb;
    font-weight: 600;
}

.progress-row--total {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid #262a33;
}

.progress-row--total .progress-label { color: #f4f6f9; font-weight: 700; }
.progress-row--total .progress-fill { background: linear-gradient(135deg, #eab308, #fbbf24); }
.progress-row--total .progress-value { color: #eab308; }

.kv-mini {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 14px;
}

.kv-mini th, .kv-mini td {
    text-align: left;
    padding: 4px 6px;
    border-bottom: 1px solid #262a33;
    font-weight: 400;
}

.kv-mini th { color: #f4f6f9; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); font-weight: 500; }
.kv-mini td { text-align: right; color: #e6e8eb; font-weight: 600; }

.icon-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}

.icon-badge {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #4b5563;
    background: #0f1115;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

.icon-badge img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.icon-badge.grade-5 { border-color: #eab308; }
.icon-badge.grade-4 { border-color: #c084fc; }
.icon-badge.grade-3 { border-color: #4f9dff; }
.icon-badge.grade-2 { border-color: #4ade80; }
.icon-badge.grade-1, .icon-badge.grade-0 { border-color: #6b7280; }

.icon-badge__enhance,
.icon-badge__tier,
.icon-badge__qty {
    position: absolute;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    padding: 1px 3px;
    border-radius: 4px;
    background: #14161c;
    color: #e6e8eb;
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 2;
}

.icon-badge__enhance { top: -5px; right: -5px; color: #4ade80; }
.icon-badge__tier { bottom: -5px; left: -5px; color: #eab308; }
.icon-badge__qty { bottom: -5px; right: -5px; color: #9aa3af; }

.icon-badge__tradeable {
    position: absolute;
    top: -7px;
    left: -7px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
    border-radius: 50%;
    background: #22d3ee;
    color: #052e33;
    border: 1px solid #0891b2;
    box-shadow: 0 0 6px rgba(34, 211, 238, 0.8);
    z-index: 3;
    animation: float-balloon 2.4s ease-in-out infinite;
}

.icon-badge__tradeable--locked {
    background: #3f3f46;
    color: #d4d4d8;
    border-color: #52525b;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    animation: none;
}

@keyframes float-balloon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.skill-badge {
    display: flex;
    align-items: center;
    justify-content: center;
}

.skill-sprite {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-image: url('sprites/sp-skill.webp');
    background-size: 640px 451px;
    background-repeat: no-repeat;
    z-index: 1;
}

/* El "ultimate" (skill indice 0, el signature skill) ocupa una celda nativa
   de 80x80 en el spritesheet, contra 56x56 del resto -- con el mismo
   background-size uniforme para toda la hoja, se ve mas grande/zoomeado
   dentro del mismo circulo que los demas skills. Se compensa escalando
   hacia abajo en la misma proporcion (56/80) para que se vea del mismo
   tamano aparente que el resto. */
.skill-sprite--ultimate {
    transform: scale(0.7);
}

/* Aura detras del icono segun rareza -- confirmado con el usuario:
   1-7 sin efecto, 8-9 chispas/fuego rojo, 10 chispas/fuego amarillo,
   11 morado brillante. Estilizacion propia inspirada en como se ve en el
   juego, no un asset extraido (no tenemos acceso a los assets del cliente). */
.skill-badge {
    overflow: visible;
}

.skill-badge::before,
.skill-badge::after {
    content: '';
    position: absolute;
    inset: -9px;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

.skill-badge.skill-normal {
    border-color: #4b5563;
    background: #1c1f26;
}

/* Aura de energia: solo el degradado conico rotando (before), sin el anillo
   de borde/pulso -- quitado porque saturaba demasiado la grilla de skills
   cuando hay muchos iconos juntos. Color propio de cada rareza via
   --glow-1/--glow-2. Reemplaza el flame-morph organico anterior, a pedido
   del usuario (ver ejemplo aportado). */
.skill-badge.skill-epic {
    border-color: #ef4444;
    background: #2a1c1c;
    --glow-1: #ef4444;
    --glow-2: #fbbf24;
}
.skill-badge.skill-legendary {
    border-color: #fbbf24;
    background: #3a3416;
    --glow-1: #fbbf24;
    --glow-2: #f97316;
}
.skill-badge.skill-mythic {
    border-color: #d8b4fe;
    background: #2a1c3a;
    --glow-1: #a855f7;
    --glow-2: #f0abfc;
}

.skill-badge.skill-epic::before,
.skill-badge.skill-legendary::before,
.skill-badge.skill-mythic::before {
    inset: -5px;
    background: conic-gradient(from 0deg, transparent, var(--glow-1), var(--glow-2), var(--glow-1), transparent);
    filter: blur(3px);
    opacity: 0.55;
    animation: rotateEnergy 3s linear infinite;
}

.skill-badge::after {
    content: none;
}

@keyframes rotateEnergy {
    0%   { transform: rotate(0deg) scale(1); }
    50%  { transform: rotate(180deg) scale(1.08); }
    100% { transform: rotate(360deg) scale(1); }
}

.skill-badge .icon-badge__enhance { top: auto; bottom: -5px; right: -5px; color: #e6e8eb; }

.card-class-vertical {
    position: absolute;
    top: 100px;
    left: 8px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
    text-transform: lowercase;
}

.char-card__level {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #f4f6f9;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.char-card__power {
    margin: 2px 0 4px;
    font-size: 29px;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: #ffffff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    text-align: center;
}

.char-card__name {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #7ec4ff;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.char-card__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px 10px;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 12px;
}

.stat-cell { display: flex; flex-direction: column; gap: 3px; }
.stat-label { font-size: 12px; color: #9aa3af; letter-spacing: 0.02em; line-height: 1.3; }
.stat-value {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
    line-height: 1.25;
    color: #f4f6f9;
}

.char-card__price {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 8px 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.price-amount { font-weight: 700; color: #7ec4ff; font-size: 16px; font-variant-numeric: tabular-nums; }
.price-usd { font-size: 13px; color: #9aa3af; }

.value-badge {
    display: block;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    border-radius: 999px;
    padding: 4px 10px;
    margin: -4px 0 10px;
}

.value-badge.value-bajo { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.value-badge.value-justo { background: rgba(154, 163, 175, 0.15); color: #9aa3af; }
.value-badge.value-alto { background: rgba(248, 113, 113, 0.15); color: #f87171; }

.my-alerts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.my-alerts-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #171a21;
    border: 1px solid #262a33;
    border-radius: 12px;
    padding: 14px 18px;
    flex-wrap: wrap;
}

.my-alerts-row__main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 320px;
    flex-wrap: wrap;
}

.my-alerts-row__name {
    color: #7ec4ff;
    font-weight: 700;
    text-decoration: none;
    font-size: 15px;
}
.my-alerts-row__name:hover { text-decoration: underline; }

.my-alerts-row__meta { color: #9aa3af; font-size: 13px; }

.my-alerts-row__price {
    font-weight: 700;
    color: #7ec4ff;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.my-alerts-row .subscribe-form { margin: 0; }
.my-alerts-row .subscribe-btn { width: auto; white-space: nowrap; }

.donate-presets {
    display: flex;
    gap: 10px;
    margin: 16px 0;
}
.donate-presets .subscribe-btn { width: auto; flex: 1; padding: 12px; font-size: 15px; }

.donate-custom {
    display: flex;
    gap: 8px;
    align-items: center;
}
.donate-custom label { color: #9aa3af; font-size: 13px; white-space: nowrap; }
.donate-custom input {
    flex: 1;
    background: #0f1115;
    border: 1px solid #262a33;
    border-radius: 8px;
    padding: 8px 10px;
    color: #e6e8eb;
}
.donate-custom .subscribe-btn { width: auto; white-space: nowrap; }

.subscribe-form { margin: 0 0 10px; }

.subscribe-btn {
    display: block;
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: #c7cdd6;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 10px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.subscribe-btn:hover { border-color: #22d3ee; color: #22d3ee; background: rgba(34, 211, 238, 0.08); }
.subscribe-btn.is-subscribed { border-color: rgba(34, 211, 238, 0.45); color: #22d3ee; background: rgba(34, 211, 238, 0.12); }

.price-drop-badge {
    display: block;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    border-radius: 999px;
    padding: 4px 10px;
    margin: -4px 0 10px;
    background: rgba(34, 211, 238, 0.15);
    color: #22d3ee;
}

.value-summary {
    font-size: 13px;
    text-align: center;
    margin: 4px 0 8px;
    font-weight: 600;
}

.value-summary--bajo { color: #4ade80; }
.value-summary--justo { color: #9aa3af; }
.value-summary--alto { color: #f87171; }

.value-info-btn {
    display: block;
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: #c7cdd6;
    font-size: 11px;
    padding: 7px 10px;
    margin: 0 0 8px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.value-info-btn:hover { border-color: #22d3ee; color: #22d3ee; background: rgba(34, 211, 238, 0.08); }

#value-methodology {
    max-width: 480px;
    width: 90vw;
    background: #12141a;
    color: #e6e8eb;
    border: 1px solid #2a2f3a;
    border-radius: 12px;
    padding: 20px;
}
#value-methodology::backdrop { background: rgba(0, 0, 0, 0.6); }
#value-methodology h3 { margin: 0 0 10px; font-size: 16px; color: #e6e8eb; }
#value-methodology p { font-size: 13px; line-height: 1.5; color: #cbd3e0; }
.value-methodology__close-form { display: flex; justify-content: flex-end; margin: -6px -6px 0 0; }
.value-methodology__close {
    background: none;
    border: none;
    color: #9aa3af;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
}
.value-methodology__close:hover { color: #e6e8eb; }
.value-methodology__chart { width: 100%; height: auto; margin: 8px 0; }
.value-methodology__warning {
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.25);
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 10px;
}
.value-methodology__warning p { margin: 0 0 6px; font-size: 13px; }
.value-methodology__warning ul { margin: 0 0 8px; padding-left: 18px; }
.value-methodology__warning li { font-size: 12px; color: #cbd3e0; margin-bottom: 6px; line-height: 1.4; }

.char-card__server {
    text-align: center;
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 10px;
}

.char-card__assets {
    border-top: 1px solid #262a33;
    padding-top: 8px;
}

.assets-title {
    margin: 0 0 6px;
    font-size: 11px;
    text-align: center;
    color: #9aa3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.assets-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.asset-mini-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #0f1115;
    border: 1px solid #262a33;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
}

.asset-mini-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: contain;
}

.breadcrumb { margin: 0 0 16px; }
.breadcrumb a { color: #4f9dff; text-decoration: none; font-size: 14px; }


.detail-hero {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    border-radius: 20px;
    padding: 24px;
    border: 2px solid #262a33;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 16px 32px -22px rgba(0, 0, 0, 0.65);
    margin-bottom: 20px;
}

.detail-hero .portrait-frame--lg { margin: 0; }

.detail-hero__info { flex: 1; min-width: 200px; }
.detail-hero__info h2 { margin: 8px 0 4px; font-size: 26px; letter-spacing: -0.02em; }

.detail-hero__power {
    margin: 10px 0 0;
    font-size: 22px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #ffffff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.detail-hero__power span {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-sub { color: rgba(255, 255, 255, 0.75); margin: 0; font-size: 14px; }

.detail-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    text-align: right;
}

.detail-price .price {
    font-size: 24px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #ffffff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    margin: 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 720px) {
    .detail-grid { grid-template-columns: 1fr; }
    .detail-hero { padding: 20px; }
    .detail-price { align-items: flex-start; text-align: left; }
}

.detail-tabs {
    position: sticky;
    top: 78px;
    z-index: 30;
    display: flex;
    gap: 6px;
    background: rgba(15, 17, 21, 0.85);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 6px;
    margin: 0 0 20px;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    box-shadow: 0 12px 32px -20px rgba(0, 0, 0, 0.7);
}

.detail-tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    color: rgba(255, 255, 255, 0.72);
    background: transparent;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.08);
    color: #f4f6f9;
}

.detail-tab.active {
    background: #f4f6f9;
    color: #0b2545;
    transform: scale(1.02);
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.45);
}

.detail-tab__icon { font-size: 14px; }

.detail-tab:focus-visible {
    outline: 2px solid #22d3ee;
    outline-offset: 2px;
}

.detail-panel--enter {
    animation: panelFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 720px) {
    .detail-tabs { top: 0; }
    .detail-tab { padding: 8px 13px; font-size: 12px; }
}

.price-sparkline {
    display: block;
    width: 100%;
    height: auto;
    margin-bottom: 14px;
}

.price-sparkline__meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #6b7280;
    margin: -8px 0 14px;
}

.panel {
    background: rgba(23, 26, 33, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 16px;
}

.panel h3 {
    margin: 0 0 12px;
    font-size: 13px;
    color: #9aa3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

table.kv { width: 100%; border-collapse: collapse; font-size: 14px; }
table.kv th, table.kv td { text-align: left; padding: 7px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
table.kv th { color: #9aa3af; font-weight: 500; width: 40%; }
table.kv a { color: #7ec4ff; }

.empty-inline { color: #6b7280; font-size: 14px; }

.detail-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px;
}

.stats-scroll {
    max-height: 340px;
    overflow-y: auto;
}

.icon-grid--lg { gap: 12px; }
.icon-badge--lg { width: 56px; height: 56px; }
/* El spritesheet de skills esta calibrado para celdas de 56px nativas; la
   tarjeta (40px) lo escala hacia abajo via el 3er param de
   skillSpritePosition(). El badge grande de detail.php muestra el sprite a
   su tamano nativo, asi que el background-size tambien tiene que ser el
   nativo (896x631.4 = 640x451 * 56/40), no el reducido de la tarjeta. */
.icon-badge--lg .skill-sprite { background-size: 896px 631.4px; }

.assets-mini-grid--lg {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.assets-mini-grid--lg .asset-mini-pill { padding: 8px 12px; }
.assets-mini-grid--lg .asset-mini-icon { width: 22px; height: 22px; }
.assets-mini-grid--lg .asset-mini-value { font-size: 14px; }

.site-footer {
    text-align: center;
    color: #6b7280;
    font-size: 12px;
    padding: 16px;
    border-top: 1px solid #262a33;
}

/* Panel premium de busqueda de tradeables (tic-5609) */
.premium-intro { margin-bottom: 16px; }

/* Tarjeta simplificada del panel premium: sin card-timer/card-tabs (por eso
   no necesita el padding-top:78px reservado para esos en .char-card) */
.char-card.tradeable-card { padding-top: 18px; }

.tradeable-ratio-badge {
    display: block;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    border-radius: 999px;
    padding: 4px 10px;
    margin: 4px 0 10px;
    background: rgba(34, 211, 238, 0.15);
    color: #22d3ee;
}

.premium-caveat {
    margin-top: 16px;
    max-width: 720px;
}
