/* =====================================================================
   CAEDES FEROX - Componentes especificos
   Tarjeta de jugador, medallas, publicaciones, comentarios y eventos.
   ===================================================================== */

/* --------------------------------------------------------------------
   Tarjeta de perfil gaming
   -------------------------------------------------------------------- */

.player-card {
    position: relative;
    border-radius: var(--r-xl);
    border: 1px solid var(--line-bright);
    background:
        linear-gradient(155deg, rgba(225, 29, 42, 0.14), transparent 46%),
        linear-gradient(180deg, var(--bg-raised), var(--bg-surface));
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* Franja diagonal roja del encabezado */
.player-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 62%;
    height: 150px;
    background: linear-gradient(115deg, transparent 42%, rgba(225, 29, 42, 0.18) 100%);
    clip-path: polygon(28% 0, 100% 0, 100% 100%, 0 100%);
    pointer-events: none;
}

/* Trama de rejilla sutil */
.player-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .5;
    background-image:
        linear-gradient(rgba(255,255,255,.016) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.016) 1px, transparent 1px);
    background-size: 26px 26px;
}

.player-card-inner {
    position: relative;
    z-index: 1;
    padding: 1.4rem 1.2rem 1.2rem;
}

.player-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.player-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.player-avatar-wrap .avatar {
    border: 3px solid var(--bg-base);
    box-shadow: 0 0 0 2px var(--red), 0 0 26px var(--red-glow);
}

.player-level {
    position: absolute;
    right: -4px;
    bottom: -4px;
    min-width: 30px;
    height: 26px;
    padding: 0 .35rem;
    display: grid;
    place-items: center;
    border-radius: var(--r-full);
    background: linear-gradient(135deg, var(--red-bright), var(--red-deep));
    color: #fff;
    font-size: .72rem;
    font-weight: 900;
    border: 2px solid var(--bg-base);
    box-shadow: var(--shadow-sm);
}

.player-id { min-width: 0; flex: 1; }

.player-name {
    margin: 0 0 .28rem;
    font-size: clamp(1.15rem, 4.5vw, 1.55rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.15;
    word-break: break-word;
}

.player-meta {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
    margin-bottom: .3rem;
}

.player-since {
    font-size: .78rem;
    color: var(--text-dim);
}

.player-signature {
    margin-top: .5rem;
    padding: .5rem .7rem;
    border-left: 2px solid var(--red-line);
    background: var(--bg-void);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    font-size: .82rem;
    font-style: italic;
    color: var(--text-soft);
}

/* Barra de estadisticas de la tarjeta */
.player-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
    gap: .45rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.player-stat {
    text-align: center;
    padding: .55rem .3rem;
    border-radius: var(--r-md);
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid var(--line-soft);
    transition: all .2s var(--ease);
}

.player-stat:hover {
    border-color: var(--red-line);
    transform: translateY(-2px);
}

.player-stat .icon {
    font-size: 1rem;
    line-height: 1;
    margin-bottom: .15rem;
}

.player-stat .n {
    display: block;
    font-size: 1.12rem;
    font-weight: 900;
    line-height: 1.15;
}

.player-stat .t {
    font-size: .6rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* --------------------------------------------------------------------
   Medallas
   -------------------------------------------------------------------- */

.medal-card {
    position: relative;
    padding: .9rem .7rem;
    text-align: center;
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    cursor: pointer;
    overflow: hidden;
    transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease);
}

.medal-card:hover {
    transform: translateY(-4px);
    border-color: var(--red-line);
    box-shadow: var(--shadow-md);
}

/* Halo segun rareza */
.medal-card::before {
    content: '';
    position: absolute;
    top: -34%;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 96px;
    border-radius: 50%;
    background: var(--halo, transparent);
    filter: blur(26px);
    opacity: .55;
    pointer-events: none;
    transition: opacity .22s var(--ease);
}

.medal-card:hover::before { opacity: .85; }

.medal-card[data-rarity="comun"]      { --halo: rgba(138,143,152,.28); }
.medal-card[data-rarity="poco_comun"] { --halo: rgba(79,180,119,.3); }
.medal-card[data-rarity="rara"]       { --halo: rgba(58,155,255,.32); }
.medal-card[data-rarity="epica"]      { --halo: rgba(185,59,255,.34); }
.medal-card[data-rarity="legendaria"] { --halo: rgba(255,176,32,.38); }
.medal-card[data-rarity="exclusiva"]  { --halo: rgba(255,45,62,.4); }

.medal-img {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto .55rem;
    display: grid;
    place-items: center;
    border-radius: var(--r-md);
    background: var(--bg-void);
    border: 1px solid var(--line);
    overflow: hidden;
}

.medal-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.medal-img .fallback {
    font-size: 1.9rem;
    line-height: 1;
}

.medal-name {
    font-size: .8rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: .18rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.medal-date {
    font-size: .68rem;
    color: var(--text-dim);
    margin-top: .2rem;
}

/* Medalla bloqueada: apagada y con candado */
.medal-card.is-locked {
    cursor: default;
    opacity: .42;
    filter: grayscale(1);
}

.medal-card.is-locked:hover {
    transform: none;
    border-color: var(--line);
    box-shadow: none;
}

.medal-card.is-locked::before { opacity: 0; }

.medal-lock {
    position: absolute;
    top: .5rem;
    right: .5rem;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: var(--r-full);
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-soft);
}

.medal-lock svg { width: 12px; height: 12px; }

/* Contador de repeticiones cuando la medalla se otorgo varias veces */
.medal-count {
    position: absolute;
    top: .5rem;
    left: .5rem;
    min-width: 21px;
    height: 21px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border-radius: var(--r-full);
    background: var(--red);
    color: #fff;
    font-size: .64rem;
    font-weight: 900;
}

/* Detalle de medalla dentro del modal */
.medal-detail { text-align: center; }

.medal-detail .big-img {
    width: 148px;
    height: 148px;
    margin: 0 auto 1rem;
    display: grid;
    place-items: center;
    border-radius: var(--r-lg);
    background: var(--bg-void);
    border: 1px solid var(--line-bright);
    overflow: hidden;
}

.medal-detail .big-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.medal-detail .big-img .fallback { font-size: 4rem; }

.medal-detail h3 { font-size: 1.25rem; margin-bottom: .3rem; }

.medal-facts {
    margin-top: 1rem;
    text-align: left;
    border-top: 1px solid var(--line);
    padding-top: .85rem;
}

.medal-fact {
    display: flex;
    gap: .75rem;
    padding: .4rem 0;
    font-size: .85rem;
    border-bottom: 1px solid var(--line-soft);
}

.medal-fact:last-child { border-bottom: 0; }

.medal-fact dt {
    flex-shrink: 0;
    width: 108px;
    color: var(--text-dim);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin: 0;
}

.medal-fact dd { margin: 0; flex: 1; }

/* --------------------------------------------------------------------
   Logros
   -------------------------------------------------------------------- */

.achievement {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem .85rem;
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    transition: border-color .2s var(--ease);
}

.achievement:hover { border-color: var(--red-line); }

.achievement.is-locked { opacity: .45; filter: grayscale(1); }

.achievement-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, var(--red-faint), transparent);
    border: 1px solid var(--red-line);
    font-size: 1.25rem;
}

.achievement-icon img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }

.achievement-body { min-width: 0; flex: 1; }
.achievement-body h4 { margin: 0 0 .1rem; font-size: .9rem; }
.achievement-body p { margin: 0; font-size: .78rem; color: var(--text-dim); }

/* --------------------------------------------------------------------
   Publicaciones
   -------------------------------------------------------------------- */

.post {
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: border-color .2s var(--ease);
}

.post:hover { border-color: var(--line-bright); }

.post.is-pinned {
    border-color: var(--red-line);
    box-shadow: inset 0 2px 0 var(--red);
}

.post-head {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .9rem 1rem .5rem;
}

.post-author { min-width: 0; flex: 1; }

.post-author .name {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .875rem;
    font-weight: 800;
    line-height: 1.2;
}

.post-author .when {
    font-size: .74rem;
    color: var(--text-dim);
}

.post-body { padding: 0 1rem .85rem; }

.post-body h3 {
    font-size: 1.06rem;
    margin-bottom: .4rem;
}

.post-body h3 a { color: var(--text); }
.post-body h3 a:hover { color: var(--red-bright); }

.post-body p {
    font-size: .9rem;
    color: var(--text-soft);
    line-height: 1.6;
}

.post-media {
    display: block;
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
    background: var(--bg-void);
}

.post-media img {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
}

.post-video {
    position: relative;
    padding-top: 56.25%;
    background: #000;
}

.post-video iframe,
.post-video video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.post-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0 1rem .85rem;
    padding: .6rem .75rem;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--bg-void);
    font-size: .82rem;
    color: var(--text-soft);
}
.post-link svg { width: 15px; height: 15px; color: var(--red-bright); flex-shrink: 0; }

.post-foot {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .55rem .7rem;
    border-top: 1px solid var(--line-soft);
    background: var(--bg-void);
}

.post-action {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .42rem .7rem;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--text-dim);
    font: inherit;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .18s var(--ease);
    -webkit-tap-highlight-color: transparent;
}

.post-action svg {
    width: 17px;
    height: 17px;
    transition: transform .2s var(--ease);
}

.post-action:hover { background: var(--bg-raised); color: var(--text); }

.post-action.is-liked { color: var(--red-bright); }
.post-action.is-liked svg { fill: currentColor; }
.post-action.just-liked svg { animation: heart-pop .42s var(--ease); }

@keyframes heart-pop {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.35); }
    70%  { transform: scale(.92); }
    100% { transform: scale(1); }
}

/* --------------------------------------------------------------------
   Comentarios
   -------------------------------------------------------------------- */

.comments { padding: .85rem 1rem 1rem; border-top: 1px solid var(--line-soft); }

.comment {
    display: flex;
    gap: .6rem;
    padding: .6rem 0;
}

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

.comment-bubble {
    padding: .55rem .75rem;
    background: var(--bg-raised);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-md);
}

.comment-bubble .who {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin-bottom: .15rem;
    font-size: .8rem;
    font-weight: 800;
}

.comment-bubble .text {
    font-size: .875rem;
    line-height: 1.5;
    color: var(--text-soft);
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-tools {
    display: flex;
    align-items: center;
    gap: .1rem;
    margin-top: .18rem;
    padding-left: .2rem;
}

.comment-tools button,
.comment-tools .when {
    padding: .18rem .4rem;
    border: 0;
    background: transparent;
    color: var(--text-dim);
    font: inherit;
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: color .18s var(--ease);
}

.comment-tools .when { cursor: default; font-weight: 500; }
.comment-tools button:hover { color: var(--text); }
.comment-tools button.is-liked { color: var(--red-bright); }

/* Respuestas anidadas, con guia vertical */
.comment-children {
    margin-top: .3rem;
    padding-left: .85rem;
    border-left: 2px solid var(--line);
}

.comment.is-deleted .comment-bubble {
    background: transparent;
    border-style: dashed;
}
.comment.is-deleted .text { font-style: italic; color: var(--text-faint); }

/* Formulario de comentario */
.comment-form {
    display: flex;
    gap: .55rem;
    align-items: flex-start;
    margin-top: .5rem;
}

.comment-form textarea {
    min-height: 42px;
    max-height: 180px;
    padding: .55rem .7rem;
    font-size: .875rem;
    border-radius: var(--r-lg);
    resize: none;
}

.comment-form.is-reply {
    margin-top: .45rem;
    margin-left: .2rem;
}

/* --------------------------------------------------------------------
   Miembros
   -------------------------------------------------------------------- */

.member-card {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .85rem;
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    color: var(--text);
    transition: all .2s var(--ease);
}

.member-card:hover {
    border-color: var(--red-line);
    transform: translateY(-2px);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.member-card .info { min-width: 0; flex: 1; }

.member-card .name {
    font-size: .92rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: .2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-card .meta {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
    font-size: .72rem;
    color: var(--text-dim);
}

.member-card .points {
    flex-shrink: 0;
    text-align: right;
}

.member-card .points strong {
    display: block;
    font-size: 1rem;
    font-weight: 900;
    color: var(--red-bright);
    line-height: 1.1;
}

.member-card .points span {
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* --------------------------------------------------------------------
   Ranking
   -------------------------------------------------------------------- */

.podium {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    gap: .55rem;
    align-items: end;
    margin-bottom: 1.35rem;
}

.podium-slot {
    position: relative;
    padding: 1rem .5rem .85rem;
    text-align: center;
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg) var(--r-lg) var(--r-sm) var(--r-sm);
    overflow: hidden;
}

.podium-slot .rank {
    position: absolute;
    top: .45rem;
    left: .45rem;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: var(--r-full);
    font-size: .74rem;
    font-weight: 900;
    background: var(--bg-overlay);
    color: var(--text-soft);
}

.podium-slot .avatar { margin: 0 auto .5rem; }

.podium-slot .pname {
    font-size: .8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: .2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.podium-slot .pscore {
    font-size: 1.02rem;
    font-weight: 900;
    color: var(--red-bright);
}

/* Primer puesto destacado */
.podium-slot.gold {
    border-color: rgba(255, 176, 32, .45);
    background: linear-gradient(180deg, rgba(255, 176, 32, .1), var(--bg-surface));
    padding-top: 1.35rem;
}
.podium-slot.gold .rank { background: #FFB020; color: #17130A; }
.podium-slot.gold .avatar { box-shadow: 0 0 0 2px var(--bg-base), 0 0 0 4px #FFB020; }

.podium-slot.silver { border-color: rgba(190, 195, 205, .34); }
.podium-slot.silver .rank { background: #BEC3CD; color: #14151A; }

.podium-slot.bronze { border-color: rgba(205, 127, 50, .34); }
.podium-slot.bronze .rank { background: #CD7F32; color: #1A1109; }

.rank-row {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .65rem .85rem;
    border-bottom: 1px solid var(--line-soft);
    transition: background .15s var(--ease);
}

.rank-row:last-child { border-bottom: 0; }
.rank-row:hover { background: var(--bg-raised); }

.rank-row.is-me {
    background: var(--red-faint);
    box-shadow: inset 3px 0 0 var(--red);
}

.rank-row .pos {
    width: 30px;
    flex-shrink: 0;
    text-align: center;
    font-size: .9rem;
    font-weight: 900;
    color: var(--text-dim);
}

.rank-row .who { min-width: 0; flex: 1; }
.rank-row .who .n {
    font-size: .875rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-row .score {
    flex-shrink: 0;
    font-size: .95rem;
    font-weight: 900;
    color: var(--red-bright);
}

/* --------------------------------------------------------------------
   Eventos
   -------------------------------------------------------------------- */

.event-card {
    display: block;
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    color: var(--text);
    transition: all .2s var(--ease);
}

.event-card:hover {
    border-color: var(--red-line);
    transform: translateY(-3px);
    color: var(--text);
    box-shadow: var(--shadow-md);
}

.event-banner {
    position: relative;
    height: 132px;
    background: linear-gradient(135deg, var(--red-deep), #1A0508);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.event-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-banner .placeholder {
    font-size: 2.4rem;
    opacity: .35;
}

.event-banner .status-pill {
    position: absolute;
    top: .55rem;
    left: .55rem;
}

.event-date {
    position: absolute;
    right: .55rem;
    bottom: .55rem;
    padding: .3rem .55rem;
    border-radius: var(--r-sm);
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    font-size: .72rem;
    font-weight: 800;
}

.event-body { padding: .85rem 1rem 1rem; }

.event-body h3 {
    font-size: .98rem;
    margin-bottom: .3rem;
    line-height: 1.3;
}

.event-meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: .6rem;
    padding-top: .6rem;
    border-top: 1px solid var(--line-soft);
    font-size: .76rem;
    color: var(--text-dim);
}

.event-meta span {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
}

.event-meta svg { width: 13px; height: 13px; }

/* Barra de cupos */
.capacity-bar {
    height: 5px;
    margin-top: .5rem;
    border-radius: var(--r-full);
    background: var(--bg-void);
    overflow: hidden;
}

.capacity-bar i {
    display: block;
    height: 100%;
    border-radius: var(--r-full);
    background: linear-gradient(90deg, var(--red-bright), var(--red-deep));
    transition: width .4s var(--ease);
}

.capacity-bar.is-full i { background: linear-gradient(90deg, var(--warn), #C97F00); }

/* --------------------------------------------------------------------
   Premios
   -------------------------------------------------------------------- */

.reward-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: all .2s var(--ease);
}

.reward-card:hover { border-color: var(--red-line); transform: translateY(-2px); }

.reward-img {
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
    padding: .7rem;
    background: linear-gradient(135deg, rgba(225,29,42,.12), var(--bg-void));
    border-bottom: 1px solid var(--line-soft);
    overflow: hidden;
}

/* Imagen y marcador comparten celda: si la imagen no carga (URL caida o un
   sitio que bloquea el enlace desde fuera) basta con ocultarla y el 🎁 queda
   debajo, en lugar del icono de imagen rota. */
.reward-img > * { grid-area: 1 / 1; }

/* El arte de los premios es cuadrado (iconos del juego). Con 'cover' se
   recortaba por arriba y por abajo y solo se veia una franja del centro;
   'contain' lo muestra entero sobre el fondo degradado. */
.reward-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.reward-img .placeholder { font-size: 2.3rem; opacity: .5; }

.reward-body {
    padding: .85rem;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.reward-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin-bottom: .5rem;
}

.reward-name {
    margin: 0 0 .25rem;
    font-size: .98rem;
    overflow-wrap: anywhere;
}

.reward-desc {
    margin: 0;
    font-size: .8rem;
    line-height: 1.45;
    color: var(--text-dim);
}

.reward-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-top: .8rem;
}

/* Cinta sobre la imagen cuando el premio se agota. */
.reward-flag {
    align-self: start;
    justify-self: end;
    margin: -.1rem -.1rem 0 0;
    padding: .18rem .45rem;
    border-radius: var(--r-sm);
    background: var(--danger);
    color: #fff;
    font-size: .6rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.reward-card.is-out .reward-img img { opacity: .35; }
.reward-card.is-out:hover { border-color: var(--line); transform: none; }

/* Cuanto le falta al miembro, en lugar de una etiqueta larga dentro del
   boton que rompia la fila. */
.reward-missing {
    margin-top: .5rem;
    padding-top: .5rem;
    border-top: 1px dashed var(--line);
    font-size: .74rem;
    color: var(--text-dim);
}

.reward-missing strong { color: var(--warn); }

/* auto-fill, no auto-fit: auto-fit colapsa las columnas que sobran, asi que
   con un solo premio la tarjeta se estiraba de lado a lado de la pantalla.
   Con auto-fill conserva su ancho y la rejilla se ve como tal. */
.reward-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* En movil deja de ser una rejilla de tarjetas y pasa a ser una lista: una
   fila por premio, miniatura cuadrada a la izquierda y los datos a la
   derecha. Ocupa mucho menos alto y encaja con arte 1:1 sin franjas vacias. */
@media (max-width: 639.98px) {
    .reward-grid { grid-template-columns: 1fr; gap: .6rem; }

    .reward-card {
        flex-direction: row;
        align-items: stretch;
        border-radius: var(--r-md);
    }

    /* En una lista el desplazamiento al pasar el dedo estorba. */
    .reward-card:hover { transform: none; }

    .reward-img {
        flex: none;
        width: 96px;
        aspect-ratio: 1;
        padding: .45rem;
        border-bottom: 0;
        border-right: 1px solid var(--line-soft);
    }

    .reward-img .placeholder { font-size: 1.8rem; }

    .reward-body { padding: .6rem .75rem; }
    .reward-tags { margin-bottom: .3rem; }
    .reward-desc { display: none; }
    .reward-foot { margin-top: .5rem; }
    .reward-missing { margin-top: .35rem; padding-top: .35rem; }
}

/* --------------------------------------------------------------------
   Solicitudes de premios
   -------------------------------------------------------------------- */

/* Miniatura del premio. Tamano fijo: el contenido no manda aqui. */
.claim-thumb {
    flex: none;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-soft);
    background: linear-gradient(135deg, rgba(225,29,42,.12), var(--bg-void));
    font-size: 1.1rem;
}

/* Imagen y emoji comparten celda, para que el 🎁 quede debajo si la imagen
   no carga. Sin esto caerian en dos filas y la miniatura se descuadra. */
.claim-thumb > * { grid-area: 1 / 1; }
.claim-thumb img { width: 100%; height: 100%; object-fit: contain; }

/* Enlace al historial desde el catalogo */
.claims-link {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .9rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    color: inherit;
    transition: border-color .18s var(--ease);
}

.claims-link:hover { border-color: var(--red-line); }

.claims-link-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: var(--r-md);
    background: var(--bg-raised);
    border: 1px solid var(--line-soft);
    color: var(--red-bright);
}

.claims-link-body { flex: 1; min-width: 0; }
.claims-link-body .t { display: block; font-weight: 800; font-size: .95rem; }
.claims-link-body .s { display: block; font-size: .78rem; color: var(--text-dim); }
.claims-link-body .warn { color: var(--warn); }

/* Lista del historial */
.claim-list {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    margin-bottom: 1.25rem;
}

.claim-row {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    padding: .85rem .95rem;
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
}

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

.claim-title {
    font-weight: 800;
    font-size: .95rem;
    overflow-wrap: anywhere;
}

.claim-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .3rem;
    margin-top: .15rem;
    font-size: .76rem;
    color: var(--text-dim);
}

.claim-meta svg { width: 12px; height: 12px; }

.claim-note {
    margin: .5rem 0 0;
    padding: .5rem .65rem;
    border-left: 2px solid var(--line-bright);
    background: var(--bg-raised);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    font-size: .8rem;
    color: var(--text-soft);
    overflow-wrap: anywhere;
}

.claim-note.is-admin { border-left-color: var(--red); }

.claim-side {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .45rem;
}

/* En movil la columna de estado se pone debajo, en fila, para no estrangular
   el texto del premio. */
@media (max-width: 519.98px) {
    .claim-row { flex-wrap: wrap; }

    .claim-side {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding-top: .1rem;
    }
}

/* --------------------------------------------------------------------
   Paginacion
   -------------------------------------------------------------------- */

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    margin: 1.25rem 0 .5rem;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 .55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--bg-surface);
    color: var(--text-soft);
    font-size: .85rem;
    font-weight: 700;
    transition: all .18s var(--ease);
}

a.page-btn:hover {
    border-color: var(--red-line);
    color: var(--red-bright);
}

.page-btn.is-current {
    border-color: var(--red);
    background: rgba(225, 29, 42, .14);
    color: var(--red-bright);
}

.page-btn.is-disabled { opacity: .35; }

.page-gap { padding: 0 .2rem; color: var(--text-dim); }

.reward-cost {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .95rem;
    font-weight: 900;
    color: var(--red-bright);
}

/* --------------------------------------------------------------------
   Notificaciones
   -------------------------------------------------------------------- */

.notif {
    display: flex;
    gap: .7rem;
    padding: .8rem .9rem;
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    transition: border-color .2s var(--ease);
}

.notif:hover { border-color: var(--line-bright); }

.notif.is-unread {
    background: var(--red-faint);
    border-color: var(--red-line);
}

.notif-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: var(--r-md);
    background: var(--bg-overlay);
    color: var(--red-bright);
}

.notif-icon svg { width: 17px; height: 17px; }

.notif-body { min-width: 0; flex: 1; }
.notif-body h4 { margin: 0 0 .12rem; font-size: .875rem; }
.notif-body p { margin: 0; font-size: .8rem; color: var(--text-soft); line-height: 1.45; }
.notif-body .when { font-size: .7rem; color: var(--text-dim); margin-top: .25rem; display: block; }

/* --------------------------------------------------------------------
   Linea de tiempo (historial)
   -------------------------------------------------------------------- */

.timeline { position: relative; padding-left: 1.4rem; }

.timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: .4rem;
    bottom: .4rem;
    width: 2px;
    background: var(--line);
}

.timeline-item {
    position: relative;
    padding-bottom: .95rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.4rem;
    top: .38rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-base);
    border: 2px solid var(--red);
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item .what { font-size: .86rem; line-height: 1.45; }
.timeline-item .when { font-size: .72rem; color: var(--text-dim); }

/* --------------------------------------------------------------------
   Vista previa del jugador (registro de miembros)
   -------------------------------------------------------------------- */

.player-preview {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--line-bright);
    border-radius: var(--r-lg);
    background: linear-gradient(160deg, rgba(225,29,42,.1), var(--bg-void));
    animation: modal-in .3s var(--ease);
}

.player-preview.is-visible { display: block; }

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: .55rem;
    margin-top: .85rem;
}

.preview-fact {
    padding: .5rem .65rem;
    background: rgba(0, 0, 0, .3);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-sm);
}

.preview-fact dt {
    margin: 0 0 .1rem;
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.preview-fact dd {
    margin: 0;
    font-size: .88rem;
    font-weight: 700;
    word-break: break-word;
}

/* Verificacion de pertenencia al clan */
.guild-check {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    margin-top: .85rem;
    padding: .65rem .8rem;
    border-radius: var(--r-sm);
    font-size: .84rem;
    line-height: 1.45;
}

.guild-check svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.guild-check.is-ok   { background: rgba(46,204,113,.1); border: 1px solid rgba(46,204,113,.3); color: #B7F5D0; }
.guild-check.is-bad  { background: rgba(255,71,87,.1); border: 1px solid rgba(255,71,87,.32); color: #FFC9CE; }
.guild-check.is-warn { background: rgba(240,165,0,.1); border: 1px solid rgba(240,165,0,.3); color: #FFE2AC; }

/* Medidor de cuota de la API */
.quota-meter {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .7rem .85rem;
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
}

.quota-ring {
    position: relative;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--red) calc(var(--pct, 0) * 1%), var(--bg-overlay) 0);
}

.quota-ring::before {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: var(--bg-surface);
}

.quota-ring span {
    position: relative;
    font-size: .8rem;
    font-weight: 900;
}

.quota-meter.is-low .quota-ring { background: conic-gradient(var(--warn) calc(var(--pct, 0) * 1%), var(--bg-overlay) 0); }
.quota-meter.is-out .quota-ring { background: conic-gradient(var(--danger) calc(var(--pct, 0) * 1%), var(--bg-overlay) 0); }

/* Credenciales recien generadas */
.credentials-box {
    padding: 1rem;
    border: 1px dashed var(--red-line);
    border-radius: var(--r-md);
    background: var(--red-faint);
}

.credential-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .5rem .7rem;
    margin-bottom: .45rem;
    background: var(--bg-void);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
}

.credential-line:last-child { margin-bottom: 0; }

.credential-line .v {
    font-family: 'Cascadia Mono', 'Consolas', ui-monospace, monospace;
    font-size: .95rem;
    font-weight: 700;
    color: var(--red-bright);
    word-break: break-all;
}
