/* =============================================
   PokeGuesser — Profile Page Styles
   ============================================= */

/* Réplica funcional de utilidades de espaciado de Bootstrap 5.3 (ver Fase 3
   del port de detalles de WhatPiece) — profile.php es la única página que
   usa "container pt-0 pb-4"; .container vive en common.css, estas dos solo
   aquí porque solo se usan aquí. */
.pt-0 {
    padding-top: 0 !important;
}

.pb-4 {
    padding-bottom: 1.5rem !important;
}

/* Iconos: antes bootstrap-icons.css (fuente de iconos vía CDN), ahora SVG
   inline con los mismos glyphs (MIT, bootstrap-icons@1.11.3) para no
   depender de esa fuente solo por 6 iconos. .bi controla tamaño/alineación
   igual que hacía la fuente (1em, currentColor, ajuste fino a la línea de
   base del texto). */
.bi {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    fill: currentColor;
}

@keyframes poke-fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.poke-fade-in { animation: poke-fade-up 0.45s ease both; }

/* ── Hero panel ──
   Fondo/borde/sombra ahora los da .pokebox-light (+ esquinas pokéball
   vía .pokebox-light--corners::after, ver common.css) -- aquí solo queda
   el layout. Sin overflow:hidden a propósito: recortaba las esquinas
   pokéball (inset:-18px, se salen del borde). El rombo ⬟ decorativo que
   antes vivía aquí (y necesitaba overflow:hidden para no desbordar) se
   quita en vez de complicar el problema. */
.poke-profile-hero {
    padding: 2rem 1.5rem 1.75rem;
    text-align: center;
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Nickname display ── */
.poke-nickname-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.3rem;
}

.poke-nickname-display {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--poke-navy);
    text-shadow: none;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

/* profile.js alterna el atributo nativo "hidden" entre #nicknameWrap y
   #nicknameEditWrap, pero el atributo [hidden] del navegador (display:none
   sin !important) empataba en especificidad con el display:inline-flex de
   arriba, y una regla de autor empata-o-gana siempre contra el user-agent:
   el bloque "editar" nunca llegaba a ocultarse de verdad. */
#nicknameWrap[hidden],
#nicknameEditWrap[hidden] {
    display: none !important;
}

.poke-nickname-edit-btn {
    background: rgba(0, 58, 112, 0.08);
    border: 1px solid rgba(0, 58, 112, 0.35);
    color: var(--poke-navy);
    font-size: 0.8rem;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.poke-nickname-edit-btn:hover {
    color: var(--poke-navy);
    background: rgba(0, 58, 112, 0.16);
    border-color: rgba(0, 58, 112, 0.6);
}

/* ── Nickname — edit mode ── */
.poke-nickname-edit-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 0.3rem;
}

/* Campo de texto claro -- dentro de .pokebox-light un input oscuro se lee
   como un hueco roto, no como parte del formulario. */
.poke-nickname-input {
    background: #fff;
    border: 2px solid rgba(0, 58, 112, 0.4);
    border-radius: 10px;
    color: #2a2a2a;
    padding: 8px 14px;
    font-size: 0.95rem;
    font-family: 'Press Start 2P', monospace;
    width: 220px;
    outline: none;
    text-align: center;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.poke-nickname-input::placeholder {
    color: rgba(0, 58, 112, 0.35);
}

.poke-nickname-input:focus {
    border-color: var(--poke-navy);
    box-shadow: 0 0 0 3px rgba(0, 58, 112, 0.18);
}

.poke-nickname-save-btn {
    background: var(--poke-yellow);
    border: none;
    color: #141d38;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
    transition: background 0.2s;
}

.poke-nickname-save-btn:hover {
    background: #ffe066;
}

.poke-nickname-cancel-btn {
    background: transparent;
    border: 1.5px solid rgba(0, 58, 112, 0.4);
    color: rgba(0, 58, 112, 0.85);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.poke-nickname-cancel-btn:hover {
    background: rgba(255, 80, 80, 0.12);
    border-color: rgba(255, 80, 80, 0.5);
    color: #ff6060;
}

/* ── Stats grid ── */
.poke-profile-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.9rem;
    margin-bottom: 1.75rem;
    animation-delay: .08s;
}

/* Integrado al tema claro (antes se dejaba oscuro por vivir fuera de
   .poke-profile-hero -- pero justo debajo de una caja ya clara, 4 chips
   oscuros se leían como una regresión, no como una elección de diseño). */
.poke-profile-stat {
    background: #f0f0e8;
    border: 1.5px solid rgba(0, 58, 112, 0.35);
    border-radius: 16px;
    padding: 1.25rem 0.75rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}
.poke-profile-stat:hover { transform: translateY(-4px); }

.stat-fire   { border-bottom: 3px solid rgba(255, 80, 80, 0.8); }
.stat-star   { border-bottom: 3px solid rgba(255, 203, 5, 0.85); }
.stat-shield { border-bottom: 3px solid rgba(0, 180, 255, 0.8); }
.stat-plays  { border-bottom: 3px solid rgba(50, 205, 130, 0.8); }

.stat-fire:hover   { box-shadow: 0 12px 28px rgba(255, 80, 80, 0.2); }
.stat-star:hover   { box-shadow: 0 12px 28px rgba(255, 203, 5, 0.2); }
.stat-shield:hover { box-shadow: 0 12px 28px rgba(0, 180, 255, 0.2); }
.stat-plays:hover  { box-shadow: 0 12px 28px rgba(50, 205, 130, 0.2); }

.poke-profile-stat-emoji {
    font-size: 1.55rem;
    margin-bottom: 0.35rem;
    display: block;
}

.poke-profile-stat-val {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.2;
    display: block;
    color: var(--poke-navy);
}

/* Colores por categoría oscurecidos para AA sobre el fondo crema (los
   originales -- amarillo puro sobre todo -- eran ilegibles sobre claro).
   El acento de color por categoría se mantiene en el border-bottom. */
.stat-fire   .poke-profile-stat-val { color: var(--color-danger-dark); text-shadow: none; }
.stat-star   .poke-profile-stat-val { color: #9c6b00; text-shadow: none; }
.stat-shield .poke-profile-stat-val { color: #0d5c9e; text-shadow: none; }
.stat-plays  .poke-profile-stat-val { color: var(--color-success-dark); text-shadow: none; }

.poke-profile-stat-lbl {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: rgba(0, 58, 112, 0.65);
    margin-top: 0.4rem;
    display: block;
}

/* ── Section title ── */
.poke-section-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    color: #fff;
    background: rgb(0, 58, 112);
    margin-bottom: 0.9rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md, 10px);
    box-shadow: 0 2px 8px rgba(0, 58, 112, 0.35);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.3px;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35);
}

/* ── Game cards grid ── */
.poke-games-section { animation-delay: .14s; }

.poke-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.poke-game-card {
    /* Tarjeta propia, más ligera que .pokebox-light -- el marco negro
       grueso de doble borde funciona para una caja hero única, pero
       repetido 5 veces en una grilla resultaba demasiado pesado. */
    background: #f0f0e8;
    border: 2px solid rgb(0, 58, 112);
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    padding: 1.4rem 1.5rem 1.25rem;
    text-decoration: none;
    color: #2a2a2a;
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    overflow: hidden;
}
.poke-game-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-danger-dark);
    box-shadow: 0 14px 32px rgba(0,0,0,0.14), 0 0 0 1px rgba(183,28,28,0.2);
    color: #2a2a2a;
    text-decoration: none;
}

/* Juego aún no lanzado: visible pero no jugable desde el perfil (misma
   filosofía que la tarjeta "próximamente" del home). */
.poke-game-card.is-coming-soon {
    cursor: default;
    opacity: 0.6;
    position: relative;
}

.poke-game-card.is-coming-soon:hover {
    transform: none;
    border-color: rgb(0, 58, 112);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.poke-game-card-coming-soon-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(0, 58, 112, 0.1);
    border: 1px solid rgba(0, 58, 112, 0.35);
    color: var(--color-danger-dark, #b71c1c);
}

.poke-game-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.1rem;
}

/* Antes era un emoji suelto -- ahora el mismo icono PNG/WebP que usa el
   propio juego en la home (icono_pokemon.webp, etc.), igual que hace
   OP/Naruto en su tarjeta de perfil. */
.poke-game-card-icon {
    width: 72px;
    height: 72px;
    object-fit: contain;
    flex-shrink: 0;
}

.poke-game-card-name {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6rem;
    color: var(--poke-navy);
    letter-spacing: 0.3px;
    text-shadow: none;
    line-height: 1.4;
}

.poke-game-card-status {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgb(0, 58, 112);
    color: #fff;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 58, 112, 0.45);
    white-space: nowrap;
    letter-spacing: 0.3px;
    line-height: 1.6;
}
.poke-game-card-status.played {
    background: rgba(46, 160, 67, 0.18);
    color: var(--color-success-dark);
    border: 1px solid rgba(46, 160, 67, 0.4);
    box-shadow: none;
}

.poke-game-card-body {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 1rem;
}

.poke-game-card-streak-val {
    font-family: 'Press Start 2P', monospace;
    font-size: 2.2rem;
    font-weight: 400;
    color: rgb(0, 58, 112);
    line-height: 1;
    letter-spacing: -1px;
    text-shadow: none;
}

.poke-game-card-streak-lbl {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(0, 58, 112, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 4px;
}

.poke-game-card-footer {
    font-size: 0.72rem;
    color: rgba(0, 58, 112, 0.55);
    border-top: 1px solid rgba(0, 58, 112, 0.2);
    padding-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.poke-game-card-footer strong { color: var(--poke-navy); font-weight: 700; }

/* ── Avatar hero button ── */
.poke-profile-avatar-hero-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.6rem;
    border-radius: 50%;
    transition: transform 0.2s ease;
}
.poke-profile-avatar-hero-btn:hover { transform: scale(1.08); }

.poke-profile-avatar-hero-emoji {
    font-size: 6rem;
    line-height: 1;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
    user-select: none;
    display: block;
}

.poke-profile-avatar-edit-badge {
    position: absolute;
    bottom: -4px;
    right: -8px;
    background: var(--poke-yellow);
    color: #141d38;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 0 2px #141d38;
    pointer-events: none;
    transition: transform 0.2s ease;
}
.poke-profile-avatar-hero-btn:hover .poke-profile-avatar-edit-badge { transform: scale(1.15); }

/* ── Hero rarity borders ── */
.poke-hero-rarity-rare      { box-shadow: 0 0 0 3px #2196f3, 0 0 18px rgba(33,150,243,0.45); }
.poke-hero-rarity-epic      { box-shadow: 0 0 0 3px #9c27b0, 0 0 18px rgba(156,39,176,0.45); }

@keyframes poke-legendary-pulse-hero {
    0%,100% { box-shadow: 0 0 0 3px var(--poke-yellow), 0 0 14px rgba(255,203,5,0.45); }
    50%      { box-shadow: 0 0 0 3px var(--poke-yellow), 0 0 30px rgba(255,203,5,0.75); }
}
.poke-hero-rarity-legendary { animation: poke-legendary-pulse-hero 2.8s ease-in-out infinite; }

@property --rainbow-angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}
@keyframes rainbow-flow {
    to { --rainbow-angle: 360deg; }
}

.poke-hero-rarity-ultralegendary {
    box-shadow: none;
    position: relative;
}
.poke-hero-rarity-ultralegendary::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    padding: 3px;
    background: conic-gradient(from var(--rainbow-angle),
        #ff0066, #ff4400, #ff9900, #ffee00,
        #88ff00, #00ff88, #00ccff, #4466ff,
        #aa00ff, #ff0066);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: rainbow-flow 3s linear infinite;
}

/* ── Avatar grid ── */
.poke-avatars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
    gap: 0.8rem;
}

/* ── Modal picker ── */
.poke-avatar-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 16, 35, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    backdrop-filter: blur(5px);
}
.poke-avatar-modal-overlay.hidden { display: none; }

.poke-avatar-modal-content {
    background: #f7f5e8;
    border: 4px solid var(--poke-navy);
    border-radius: 18px;
    width: min(700px, 100%);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.52),
        inset 0 0 0 3px #fff,
        inset 0 0 0 6px rgba(0, 58, 112, 0.16);
    animation: pokeModalEnter 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
    transform: scale(0.92);
    opacity: 0;
}
@keyframes pokeModalEnter { to { transform: scale(1); opacity: 1; } }

.poke-avatar-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem 0.75rem;
    border-bottom: 3px solid var(--poke-navy);
    background: #f6edbf;
    flex-shrink: 0;
}

.poke-avatar-modal-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.78rem;
    color: var(--poke-navy);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.poke-avatar-modal-title-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.poke-avatar-modal-title-copy small {
    color: rgba(0, 58, 112, 0.58);
    font-family: system-ui, sans-serif;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    line-height: 1;
}

.poke-avatar-inventory-ball {
    position: relative;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    overflow: hidden;
    border: 3px solid var(--poke-navy);
    border-radius: 50%;
    background: linear-gradient(#e63b32 0 46%, var(--poke-navy) 46% 56%, #fff 56%);
    box-shadow: 0 2px 0 rgba(0, 58, 112, 0.2);
}

.poke-avatar-inventory-ball::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 9px;
    height: 9px;
    border: 3px solid var(--poke-navy);
    border-radius: 50%;
    background: #fff;
    transform: translate(-50%, -50%);
}

.poke-avatar-modal-close {
    background: transparent;
    border: none;
    color: rgba(0, 58, 112, 0.65);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.poke-avatar-modal-close:hover { color: var(--poke-navy); background: rgba(0,58,112,0.1); }

.poke-avatar-inventory-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 0.45rem 1.15rem;
    color: #fff;
    background: linear-gradient(180deg, var(--poke-navy-light), var(--poke-navy));
    border-bottom: 3px solid var(--poke-yellow);
    flex-shrink: 0;
}

.poke-avatar-box-label,
.poke-avatar-collection-count {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.poke-avatar-box-label {
    color: var(--poke-yellow);
    font-family: 'Press Start 2P', monospace;
    font-size: 0.58rem;
    letter-spacing: 0.04em;
}

.poke-avatar-collection-count {
    min-width: 78px;
    justify-content: center;
    padding: 5px 9px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: var(--radius-pill);
    color: #fff;
    background: rgba(0, 0, 0, 0.2);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}

.poke-avatar-collection-track {
    height: 5px;
    background: rgba(0, 58, 112, 0.15);
    flex: 0 0 5px;
}

.poke-avatar-collection-track span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--poke-blue);
    transition: width 0.35s ease;
}

.poke-avatar-picker-grid {
    padding: 1rem 1.1rem 1.2rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,58,112,0.4) rgba(0,58,112,0.08);
    background-color: #e8edf0;
    background-image:
        linear-gradient(rgba(0, 58, 112, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 58, 112, 0.055) 1px, transparent 1px);
    background-size: 18px 18px;
    box-shadow: inset 0 10px 18px rgba(0, 58, 112, 0.08);
}
.poke-avatar-picker-grid::-webkit-scrollbar { width: 6px; }
.poke-avatar-picker-grid::-webkit-scrollbar-track { background: rgba(0,58,112,0.08); border-radius: var(--radius-sm); }
.poke-avatar-picker-grid::-webkit-scrollbar-thumb { background: rgba(0,58,112,0.4); border-radius: var(--radius-sm); }

/* ── Avatar card ── */
.poke-avatar-card {
    min-height: 219px;
    background: linear-gradient(155deg, #fff 0 68%, #eef2ea 100%);
    border: 3px solid #94a8b2;
    border-radius: 10px;
    padding: 1.8rem 0.55rem 0.9rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.32rem;
    transition: transform 0.18s ease, border-color 0.18s, box-shadow 0.18s;
    cursor: pointer;
    position: relative;
    box-shadow:
        inset 0 0 0 2px #fff,
        0 3px 0 rgba(0, 58, 112, 0.16),
        0 7px 12px rgba(0, 58, 112, 0.09);
}
.poke-avatar-card:not(.poke-avatar-locked):hover {
    transform: translateY(-3px) scale(1.015);
    border-color: var(--poke-yellow);
    box-shadow: inset 0 0 0 2px #fff, 0 8px 18px rgba(0,58,112,0.22), 0 0 0 2px rgba(255,203,5,0.28);
}
.poke-avatar-card:not(.poke-avatar-locked):focus-visible { outline: 2px solid var(--poke-yellow); outline-offset: 2px; }

.poke-avatar-card.poke-avatar-active {
    border-color: var(--poke-yellow);
    background: linear-gradient(155deg, #fffdf0 0 65%, #fff2ad 100%);
    box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--poke-navy), 0 7px 16px rgba(0,58,112,0.2);
    cursor: default;
}

.poke-avatar-card.poke-avatar-locked {
    cursor: default;
    border-color: #aeb9bd;
    background:
        repeating-linear-gradient(135deg, rgba(0,58,112,0.035) 0 8px, transparent 8px 16px),
        linear-gradient(155deg, #f8f8f3, #e3e7e4);
}
.poke-avatar-locked .poke-avatar-emoji { filter: grayscale(100%) brightness(0.76); opacity: 0.88; }

.poke-avatar-slot-number {
    position: absolute;
    top: 8px;
    left: 10px;
    color: rgba(0, 58, 112, 0.6);
    font-family: 'Press Start 2P', monospace;
    font-size: 0.48rem;
    font-variant-numeric: tabular-nums;
}

.poke-avatar-rarity-dot {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 9px;
    height: 9px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #9e9e9e;
    box-shadow: 0 0 0 1px rgba(0,58,112,0.28);
}

.poke-avatar-lock-icon {
    position: absolute;
    top: 2.15rem;
    right: 0.7rem;
    background: var(--poke-navy);
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
    pointer-events: none;
    border: 1px solid rgba(0,58,112,0.15);
}

.poke-avatar-emoji {
    font-size: 5.8rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 6rem;
    height: 6rem;
    flex: 0 0 6rem;
    overflow: hidden;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 42%, #fff 0 48%, #dfe8e9 49% 63%, #bdcbd0 64% 100%);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px rgba(0,58,112,0.58), inset 0 -5px 10px rgba(0,58,112,0.12);
}

.poke-avatar-img {
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.18s ease;
}

/* Estos archivos tienen más transparencia interior que los retratos redondos.
   Compensamos solo el lienzo visible para que todos pesen igual en la rejilla. */
.poke-avatar-card[data-avatar-slug="baya"] .poke-avatar-img { transform: scale(1.22); }
.poke-avatar-card[data-avatar-slug="medalla"] .poke-avatar-img { transform: scale(1.22); }
.poke-avatar-card[data-avatar-slug="pokedex"] .poke-avatar-img { transform: scale(1.25); }

.poke-profile-avatar-hero-emoji img,
.poke-avatar-hero-img {
    width: 8rem;
    height: 8rem;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.poke-avatar-name {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.55rem;
    color: var(--poke-navy);
    letter-spacing: 0.3px;
    line-height: 1.4;
    width: 100%;
    min-height: 1.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.poke-avatar-hint {
    font-size: 0.58rem;
    color: rgba(0,58,112,0.68);
    letter-spacing: 0.3px;
    line-height: 1.3;
    min-height: 1.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.poke-avatar-progress {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    margin-top: 0;
    margin-bottom: 0.2rem;
    transform: translateY(-4px);
}

.poke-avatar-progress-bar {
    width: 100%;
    height: 7px;
    border: 1px solid rgba(0,58,112,0.28);
    border-radius: var(--radius-pill);
    background: rgba(0,58,112,0.12);
    overflow: hidden;
}

.poke-avatar-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--poke-blue);
    transition: width 0.3s ease;
}

.poke-avatar-progress-label {
    font-size: 0.55rem;
    color: rgba(0,58,112,0.72);
    letter-spacing: 0.3px;
    line-height: 1;
}

.poke-avatar-active-badge {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    min-height: 27px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    padding: 3px 7px;
    border-radius: 6px;
    background: var(--poke-navy);
    border: 1px solid var(--poke-navy-light);
    color: var(--poke-yellow);
    line-height: 1.5;
}

.poke-avatar-active-badge.is-active {
    color: var(--poke-navy);
    background: var(--poke-yellow);
    border-color: #d69f00;
}

/* ── Rarity borders ── */
.poke-avatar-rarity-common      { border-color: rgba(158,158,158,0.6); }
.poke-avatar-rarity-rare        { border-color: #2196f3; box-shadow: 0 0 8px rgba(33,150,243,0.3); }
.poke-avatar-rarity-epic        { border-color: #9c27b0; box-shadow: 0 0 10px rgba(156,39,176,0.35); }
.poke-avatar-rarity-rare .poke-avatar-rarity-dot { background: #2196f3; }
.poke-avatar-rarity-epic .poke-avatar-rarity-dot { background: #9c27b0; }
.poke-avatar-rarity-legendary .poke-avatar-rarity-dot { background: var(--poke-yellow); }
.poke-avatar-rarity-ultralegendary .poke-avatar-rarity-dot { background: linear-gradient(135deg, #ff0066, #00ccff, #ffee00); }

@keyframes poke-legendary-pulse {
    0%,100% { box-shadow: 0 0 8px rgba(255,203,5,0.35); }
    50%      { box-shadow: 0 0 18px rgba(255,203,5,0.65), 0 0 28px rgba(255,203,5,0.2); }
}
.poke-avatar-rarity-legendary {
    border-color: var(--poke-yellow);
    animation: poke-legendary-pulse 2.8s ease-in-out infinite;
}
.poke-avatar-rarity-legendary.poke-avatar-active { animation: none; box-shadow: 0 0 0 2px rgba(255,203,5,0.5), 0 0 22px rgba(255,203,5,0.45), 0 6px 20px rgba(0,0,0,0.5); }

.poke-avatar-rarity-rare:not(.poke-avatar-locked):hover  { border-color: #64b5f6; box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 18px rgba(33,150,243,0.5); }
.poke-avatar-rarity-epic:not(.poke-avatar-locked):hover  { border-color: #ce93d8; box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 18px rgba(156,39,176,0.5); }
.poke-avatar-rarity-legendary:not(.poke-avatar-locked):hover { animation: none; border-color: var(--poke-yellow); box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 22px rgba(255,203,5,0.6); }

/* Ultralegendary: borde arcoíris animado (conic-gradient que rota) */
.poke-avatar-rarity-ultralegendary {
    border: none;
    position: relative;
    animation: none;
}
.poke-avatar-rarity-ultralegendary::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    padding: 2px;
    background: conic-gradient(from var(--rainbow-angle),
        #ff0066, #ff4400, #ff9900, #ffee00,
        #88ff00, #00ff88, #00ccff, #4466ff,
        #aa00ff, #ff0066);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: rainbow-flow 3s linear infinite;
}
.poke-avatar-rarity-ultralegendary:not(.poke-avatar-locked):hover {
    border: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.55);
}
.poke-avatar-rarity-ultralegendary.poke-avatar-active {
    border: none;
    background: #fffbea;
    box-shadow: 0 6px 20px rgba(0,58,112,0.16);
}

/* ── Responsive ── */
@media (max-width: 576px) {
    /* El gutter por defecto de .container (Bootstrap, 0.75rem = 12px) es
       menor que el inset:-18px de las esquinas pokéball de
       .pokebox-light--corners (common.css) -- en móvil las esquinas se
       salían del viewport. Un poco más de aire a los lados para que las 4
       esquinas queden dentro. */
    .container { padding-left: 24px; padding-right: 24px; }

    .poke-avatar-modal-overlay { padding: 8px; }
    .poke-avatar-modal-content { max-height: 92vh; border-radius: 14px; }
    .poke-avatar-modal-header  { padding: 0.65rem 0.7rem; }
    .poke-avatar-inventory-toolbar { padding: 0.4rem 0.75rem; }
    .poke-avatar-picker-grid   { padding: 0.65rem; }
    .poke-avatars-grid         { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; }
    .poke-avatar-card          { min-height: 204px; padding: 1.65rem 0.4rem 0.8rem; }
    .poke-avatar-emoji,
    .poke-avatar-img           { width: 5rem; height: 5rem; }
    .poke-avatar-emoji         { flex-basis: 5rem; font-size: 2rem; }
    .poke-avatar-name          { font-size: 0.48rem; }
    .poke-avatar-hint          { font-size: 0.52rem; }
    .poke-avatar-active-badge  { font-size: 0.48rem; }
    .poke-avatar-lock-icon     { top: 1.95rem; right: 0.4rem; }
    .poke-games-grid           { grid-template-columns: 1fr; }
    .poke-profile-hero         { padding: 1.75rem 1.25rem 1.5rem; }
    .poke-profile-stat-grid    { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
    .poke-profile-stat         { padding: 1rem 0.4rem; }
    .poke-profile-stat-val     { font-size: 1.1rem; }
    .poke-profile-stat-lbl     { font-size: 0.55rem; }
    .poke-nickname-display     { font-size: 1rem; }
    .poke-game-card-streak-val { font-size: 1.6rem; }
}
