/* ============================================================
   Gamificação — Ranking de solucionadores (dashboard TI)
   ============================================================ */

.gm-total-pill {
    display: inline-flex;
    align-items: center;
    font-size: .78rem;
    font-weight: 600;
    color: #22c97b;
    background: rgba(34, 201, 123, .12);
    border: 1px solid rgba(34, 201, 123, .3);
    border-radius: 999px;
    padding: .25rem .7rem;
}

.gm-board {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

/* Ranking em duas colunas (comporta ~10 técnicos) */
.gm-board-2col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem 1rem;
}
@media (max-width: 767px) {
    .gm-board-2col { grid-template-columns: 1fr; }
}

.gm-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .45rem .7rem;
    border-radius: 11px;
    background: var(--dm-surface-2, #f8fafc);
    border: 1px solid var(--dm-border, #e2e8f0);
    text-decoration: none;
    color: inherit;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    position: relative;
    overflow: hidden;
}

.gm-row:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .1);
    text-decoration: none;
    color: inherit;
    border-color: var(--dm-accent, #4d7cf5);
}

/* Faixa de cor lateral por tier */
.gm-row::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--dm-border, #e2e8f0);
}
.gm-tier-bronze::before { background: linear-gradient(#e0a56a, #c2803a); }
.gm-tier-prata::before  { background: linear-gradient(#7dd3fc, #16A7D3); }
.gm-tier-ouro::before   { background: linear-gradient(#ffe761, #f7b500); }
.gm-tier-lenda::before  { background: linear-gradient(#c084fc, #7c3aed); }

/* Campeão do mês */
.gm-champion {
    background: linear-gradient(135deg, rgba(247, 181, 0, .10), rgba(247, 181, 0, .02));
    border-color: rgba(247, 181, 0, .5);
    box-shadow: 0 0 0 1px rgba(247, 181, 0, .25), 0 4px 16px rgba(247, 181, 0, .18);
}
.gm-champion:hover { border-color: #f7b500; }

/* Campeão ocupa a largura inteira no grid de 2 colunas */
.gm-board-2col .gm-champion { grid-column: 1 / -1; }
.gm-board-2col .gm-champion .gm-count-num { font-size: 1.45rem; }
.gm-board-2col .gm-champion .gm-avatar,
.gm-board-2col .gm-champion .gm-avatar img,
.gm-board-2col .gm-champion .gm-avatar-fallback { width: 46px; height: 46px; }

/* Posição / medalha */
.gm-rank {
    width: 28px;
    flex-shrink: 0;
    text-align: center;
}
.gm-medal { font-size: 1.15rem; line-height: 1; }
.gm-rank-num {
    font-size: .85rem;
    font-weight: 800;
    color: var(--dm-text-muted, #94a3b8);
}

/* Avatar */
.gm-avatar {
    position: relative;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
}
.gm-avatar img,
.gm-avatar-fallback {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--dm-surface, #fff);
    box-shadow: 0 0 0 1px var(--dm-border, #e2e8f0);
}
.gm-avatar-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #2563eb;
    font-weight: 800;
    font-size: .95rem;
}
.gm-champion .gm-avatar img,
.gm-champion .gm-avatar-fallback {
    box-shadow: 0 0 0 2px #f7b500, 0 0 10px rgba(247, 181, 0, .5);
}
.gm-avatar-crown {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%) rotate(-10deg);
    color: #f7b500;
    font-size: .78rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    animation: gmCrownBob 2.2s ease-in-out infinite;
}
@keyframes gmCrownBob {
    0%, 100% { transform: translateX(-50%) rotate(-10deg) translateY(0); }
    50%      { transform: translateX(-50%) rotate(-10deg) translateY(-3px); }
}

/* Bloco central */
.gm-main {
    flex: 1;
    min-width: 0;
}
.gm-name-row {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin-bottom: .25rem;
}
.gm-name {
    font-weight: 700;
    font-size: .86rem;
    color: var(--dm-text, #1e293b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gm-tier-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: .08rem .4rem;
    border-radius: 999px;
    border: 1px solid currentColor;
    background: transparent;
    opacity: .95;
}

.gm-bar {
    height: 5px;
    border-radius: 999px;
    background: var(--dm-border, #e2e8f0);
    overflow: hidden;
}
.gm-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width .7s cubic-bezier(.4, 0, .2, 1);
}

.gm-sub {
    font-size: .66rem;
    color: var(--dm-text-muted, #94a3b8);
    margin-top: .22rem;
}
.gm-sub strong { color: var(--dm-text, #1e293b); }
.gm-maxed { color: #22c97b; font-weight: 600; }

/* Contador de pontos */
.gm-count {
    flex-shrink: 0;
    text-align: center;
    min-width: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}
.gm-count-num {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--dm-text, #1e293b);
}
.gm-champion .gm-count-num { color: #f7b500; }
.gm-count-lbl {
    font-size: .55rem;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--dm-text-muted, #94a3b8);
    margin-top: .05rem;
}

@media (max-width: 575px) {
    .gm-tier-badge { display: none; }
    .gm-count-num { font-size: 1.05rem; }
}
